* [U-Boot] [PATCH] dm: gpio: pca953x: Support PCA953X with 40 GPIOs
@ 2016-04-25 13:25 Mario Six
2016-04-26 1:45 ` Peng Fan
2016-05-30 17:56 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 4+ messages in thread
From: Mario Six @ 2016-04-25 13:25 UTC (permalink / raw)
To: u-boot
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 <mario.six@gdsys.cc>
---
drivers/gpio/pca953x_gpio.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c
index 987d10e..065b181 100644
--- a/drivers/gpio/pca953x_gpio.c
+++ b/drivers/gpio/pca953x_gpio.c
@@ -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 8
DECLARE_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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: gpio: pca953x: Support PCA953X with 40 GPIOs
2016-04-25 13:25 [U-Boot] [PATCH] dm: gpio: pca953x: Support PCA953X with 40 GPIOs Mario Six
@ 2016-04-26 1:45 ` Peng Fan
2016-05-01 18:54 ` Simon Glass
2016-05-30 17:56 ` [U-Boot] " Tom Rini
1 sibling, 1 reply; 4+ messages in thread
From: Peng Fan @ 2016-04-26 1:45 UTC (permalink / raw)
To: u-boot
Hi Mario,
On Mon, Apr 25, 2016 at 03:25:37PM +0200, Mario Six wrote:
>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 <mario.six@gdsys.cc>
Looks fine to me.
Reviewed-by: Peng Fan <van.freenix@gmail.com>
>---
> drivers/gpio/pca953x_gpio.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c
>index 987d10e..065b181 100644
>--- a/drivers/gpio/pca953x_gpio.c
>+++ b/drivers/gpio/pca953x_gpio.c
>@@ -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 8
>
> DECLARE_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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: gpio: pca953x: Support PCA953X with 40 GPIOs
2016-04-26 1:45 ` Peng Fan
@ 2016-05-01 18:54 ` Simon Glass
0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2016-05-01 18:54 UTC (permalink / raw)
To: u-boot
On 25 April 2016 at 19:45, Peng Fan <van.freenix@gmail.com> wrote:
> Hi Mario,
>
> On Mon, Apr 25, 2016 at 03:25:37PM +0200, Mario Six wrote:
>>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 <mario.six@gdsys.cc>
>
> Looks fine to me.
>
> Reviewed-by: Peng Fan <van.freenix@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] dm: gpio: pca953x: Support PCA953X with 40 GPIOs
2016-04-25 13:25 [U-Boot] [PATCH] dm: gpio: pca953x: Support PCA953X with 40 GPIOs Mario Six
2016-04-26 1:45 ` Peng Fan
@ 2016-05-30 17:56 ` Tom Rini
1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-05-30 17:56 UTC (permalink / raw)
To: u-boot
On Mon, Apr 25, 2016 at 03:25:37PM +0200, mario.six at gdsys.cc wrote:
> 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 <mario.six@gdsys.cc>
> Reviewed-by: Peng Fan <van.freenix@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-30 17:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25 13:25 [U-Boot] [PATCH] dm: gpio: pca953x: Support PCA953X with 40 GPIOs Mario Six
2016-04-26 1:45 ` Peng Fan
2016-05-01 18:54 ` Simon Glass
2016-05-30 17:56 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox