dm: gpio: pca953x: Support PCA953X with 40 GPIOs
PATCH 1/1 dm: gpio: pca953x: Support PCA953X with 40 GPIOs
A DM driver for PCA953x was recently introduced by Peng Fan, which lacked support for the 40 GPIO versions.
This patch adds support for these chips.
--- drivers/gpio/pca953x_gpio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpio/pca953x_gpio.c +6 -3
@@ -16,8 +16,8 @@* * TODO: * 1. Support PCA957X_TYPE -* 2. Support max 40 gpio pins -* 3. Support Plolarity Inversion +* 2. Support 24 gpio pins +* 3. Support Polarity Inversion */ #include <common.h>
@@ -47,7 +47,7 @@ enum { PCA953X_DIRECTION_OUT, }; -#define MAX_BANK 3 +#define MAX_BANK 5#define BANK_SZ 8DECLARE_GLOBAL_DATA_PTR ;
@@ -121,6 +121,9 @@ static int pca953x_read_regs(struct udevice *dev, int reg, u8 *val) ret =dm_i2c_read (dev, reg, val,1 ); }else if (info->gpio_count <=16 ) { ret =dm_i2c_read (dev, reg <<1 , val, info->bank_count); + }else if (info->gpio_count ==40 ) { +/* Auto increment */ + ret =dm_i2c_read (dev, (reg <<3 ) |0x80 , val, info->bank_count); }else {dev_err (dev,"Unsupported now\n" );return -EINVAL ;
--
2.7.0.GIT
PATCH 1/1 dm: gpio: pca953x: Support PCA953X with 40 GPIOs
Hi Mario,
Quoted 6 lines · Mario Six
A DM driver for PCA953x was recently introduced by Peng Fan, which lacked support for the 40 GPIO versions.
This patch adds support for these chips.
Signed-off-by Mario Six <[email protected]>
Looks fine to me.
Quoted 41 lines
---
drivers/gpio/pca953x_gpio.c| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpio/pca953x_gpio.c +6
-4@@ -16,8 +16,8 @@* * TODO: * 1. Support PCA957X_TYPE -* 2. Support max 40 gpio pins -* 3. Support Plolarity Inversion +* 2. Support 24 gpio pins +* 3. Support Polarity Inversion */ #include <common.h> @@ -47,7 +47,7 @@ enum { PCA953X_DIRECTION_OUT, }; -#define MAX_BANK 3 +#define MAX_BANK 5#define BANK_SZ 8DECLARE_GLOBAL_DATA_PTR ;@@ -121,6 +121,9 @@ static int pca953x_read_regs(struct udevice *dev, int reg, u8 *val) ret =dm_i2c_read (dev, reg, val,1 ); }else if (info->gpio_count <=16 ) { ret =dm_i2c_read (dev, reg <<1 , val, info->bank_count); + }else if (info->gpio_count ==40 ) { +/* Auto increment */ + ret =dm_i2c_read (dev, (reg <<3 ) |0x80 , val, info->bank_count); }else {dev_err (dev,"Unsupported now\n" );return -EINVAL ; --2.7.0.GIT
PATCH 1/1 dm: gpio: pca953x: Support PCA953X with 40 GPIOs
Quoted 6 lines · Peng Fan
Hi Mario,
Quoted 3 lines · Mario Six
A DM driver for PCA953x was recently introduced by Peng Fan, which lacked support for the 40 GPIO versions.
Quoted 7 lines
Quoted 3 lines
This patch adds support for these chips.
Signed-off-by Mario Six <[email protected]>Looks fine to me.
Reviewed-by Peng Fan <[email protected]>
Quoted 8 lines · mario.six at gdsys.cc
A DM driver for PCA953x was recently introduced by Peng Fan, which lacked support for the 40 GPIO versions.
This patch adds support for these chips.
Signed-off-by Mario Six <[email protected]>Reviewed-by Peng Fan <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/bc3d1b49/attachment.sig>