
Dear Peter Tyser,
In message 1227045436.3065.32.camel@localhost.localdomain you wrote:
create mode 100644 drivers/gpio/ds4510.c create mode 100644 include/gpio/ds4510.h
This should go to devices/i2c/
I'm assuming you're referring to drivers/i2c. I was under the
Right.
impression the driver/i2c directory was only for drivers which controller I2C buses (similar to drivers/i2c/busses in Linux), not actual I2C chip device drivers. I don't currently see any other I2C chip drivers in there and didn't want to be the first to add one:)
Ah yes, you are right again. Hm...
I agree that the ds4510 doesn't fit in the GPIO category well. How about drivers/misc? If I'm mistaken about what is supposed to go in drivers/i2c let me know and I'll move it in there.
I think drivers/misc/ is probably the best place we have at the moment, indeed.
- "ds4510 - ds4510 eeprom/seeprom/sram/gpio access\n",
- "chip info\n"
- " - display ds4510 info\n"
- "ds4510 chip nv 0|1\n"
- " - make gpio and seeprom writes volatile/non-volatile\n"
- "ds4510 chip rstdelay 0-3\n"
- " - set reset output delay\n"
- "ds4510 chip output pin 0|1\n"
- " - set pin low or high-Z\n"
- "ds4510 chip input pin\n"
- " - read value of pin\n"
- "ds4510 chip pullup pin 0|1\n"
- " - disable/enable pullup on specified pin\n"
- "ds4510 chip eeprom read addr off cnt\n"
- "ds4510 chip eeprom write addr off cnt\n"
- " - read/write 'cnt' bytes at EEPROM offset 'off'\n"
- "ds4510 chip seeprom read addr off cnt\n"
- "ds4510 chip seeprom write addr off cnt\n"
- " - read/write 'cnt' bytes at SRAM-shadowed EEPROM offset 'off'\n"
- "ds4510 chip sram read addr off cnt\n"
- "ds4510 chip sram write addr off cnt\n"
- " - read/write 'cnt' bytes at SRAM offset 'off'\n"
Why do we need the "chip" argument? It just adds typing...
In theory more than 1 chip could be on a board. The chip uses an address pin pull up/down to determine the device's i2c address.
We should follow the model used elsewhere, then, i. e. add a "ds4510 dev" command which can display and select a "current" device that then gets used in all commands unless you explicitely switch to a new device (or bus - please keep in mind that we can have multiple I2C busses as well).
Best regards,
Wolfgang Denk