On 18 March 2016 at 03:54, Peng Fan <[email protected]> wrote: > Introduce a new driver that supports driver model for pca953x. > The pca953x chips are used as I2C I/O expanders. > This driver is designed to support the following chips: > " > 4 bits: pca9536, pca9537 > 8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554, > pca9556, pca9557, pca9574, tca6408, xra1202 > 16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575, > tca6416 > 24 bits: tca6424 > 40 bits: pca9505, pca9698 > " > But for now this driver only supports max 24 bits and pca953x compatible > chips. pca957x compatible chips are not supported now. > These can be addressed when we need to add such support for the different > chips. > This driver has been tested on i.MX6 SoloX Sabreauto board with max7310 > i2c expander using gpio command as following: > > =>gpio status -a > Bank gpio@48: > gpio@480: input: 1 [ ] > => gpio clear gpio@480 > gpio: pin gpio@480 (gpio 224) value is 0 > => gpio status -a > Bank gpio@48: > gpio@480: output: 0 [ ]
Don't you think 480 is confusing? Perhaps you should have gpio@48_ as the bank name? Also I think you should support a gpio-bank-name property in the node, to allow a sensible name to be provided. > > => dm tree: > i2c [ ] | | `-- i2c@021a8000 > gpio [ ] | | |-- gpio@30 > gpio [ ] | | `-- gpio@32 > > Signed-off-by: Peng Fan <[email protected]> > Cc: Simon Glass <[email protected]> > Cc: Masahiro Yamada <[email protected]> > Cc: Wenyou Yang <[email protected]> > Cc: Daniel Schwierzeck <[email protected]> > Cc: Purna Chandra Mandal <[email protected]> > Cc: Thomas Chou <[email protected]> > Cc: Bhuvanchandra DV <[email protected]> > Cc: Andrea Scian <[email protected]> > Cc: Michal Simek <[email protected]> > Cc: Stefano Babic <[email protected]> > Cc: Fabio Estevam <[email protected]> > --- > drivers/gpio/Kconfig | 23 +++ > drivers/gpio/Makefile | 2 + > drivers/gpio/pca953x_gpio.c | 349 > ++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 374 insertions(+) > create mode 100644 drivers/gpio/pca953x_gpio.c One nit - there is no need to check for chip being NULL as it cannot be. Acked-by: Simon Glass <[email protected]> _______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

