[U-Boot] [PATCH 2/3] Add support for Maxim's DS4510 I2C device

Wolfgang Denk wd at denx.de
Wed Nov 19 00:16:15 CET 2008


Dear Peter Tyser,

In message <1227045436.3065.32.camel at 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

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
EMACS belongs in <sys/errno.h>: Editor too big!


More information about the U-Boot mailing list