devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] gpio-pca953x driver and PCA9536 chip
@ 2015-08-31 14:26 Janusz Użycki
       [not found] ` <55E4641D.7050603-cjVIcFy54eMe9JSWTWOYM+658FiBabzs@public.gmane.org>
  2015-09-05 21:15 ` [RFC PATCH] " Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Janusz Użycki @ 2015-08-31 14:26 UTC (permalink / raw)
  To: Grant Likely, Rob Herring, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linus Walleij
  Cc: Krzysztof Borgulski

Hi,

The driver sets register #02 (inversion) to 0x01 instead of 0x00 on my 
board.
Reason: device_pca953x_init() does not initialize val buffer because 
NBANK() returns
for PCA9536 ngpio=4 value 0 instead of 1.

My proposed code-patch for 3.14.17 is below.
Because I don't work on stable/next I can't deliver complete/ready patch.
Please for comments.

best regards
Janusz

--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -75,7 +75,7 @@ MODULE_DEVICE_TABLE(i2c, pca953x_id);
  #define MAX_BANK 5
  #define BANK_SZ 8

-#define NBANK(chip) (chip->gpio_chip.ngpio / BANK_SZ)
+#define NBANK(chip) DIV_ROUND_UP(chip->gpio_chip.ngpio, BANK_SZ)

  struct pca953x_chip {
         unsigned gpio_start;
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-07 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-31 14:26 [RFC PATCH] gpio-pca953x driver and PCA9536 chip Janusz Użycki
     [not found] ` <55E4641D.7050603-cjVIcFy54eMe9JSWTWOYM+658FiBabzs@public.gmane.org>
2015-09-04  9:33   ` [RFC] " Janusz Użycki
2015-09-05 21:15 ` [RFC PATCH] " Linus Walleij
2015-09-07 12:36   ` Grygorii Strashko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).