Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] gpio: pca953x: Redesign handling of chip types
@ 2023-01-30 20:59 Levente Révész
  2023-01-30 21:32 ` Andy Shevchenko
  2023-02-02 15:12 ` Andy Shevchenko
  0 siblings, 2 replies; 7+ messages in thread
From: Levente Révész @ 2023-01-30 20:59 UTC (permalink / raw)
  To: Andy Shevchenko, Martyn Welch, Linus Walleij
  Cc: Bartosz Golaszewski, Haibo Chen, Puyou Lu, Justin Chen,
	Andrey Gusakov, Nate Drude, linux-gpio, Peter Robinson

Hi All,

The pca953x driver supports many chips. These all have the basic 4
registers: input, output, invert and direction. Most of them have
additional registers for various functions, like pull-up and
pull-down control, interrupt status and mask, hardware debounce.

Different chip types have various register layouts. These layouts differ
even in the basic 4 registers.

This patch series

    1. Cleans up chip type handling, and
    2. Replaces register address calculations. The proposed scheme
       works with every register of every chip type.

These changes make it possible to add support for extended functions for
more chip types, including:

    * Interrupt mask for PCA950X, PCA9698, PCA957X and XRA120X
    * Interrupt status for PCA957X and XRA120X
    * Bias for PCA957X and XRA120X
    * Debounce for PCAL65XX and XRA120X

References:
1. Previous discussion about the chip types
   https://lore.kernel.org/linux-gpio/Y1q52efyv93%2Fz8BC@smile.fi.intel.com/
2. An overview of pca953x chip types
   https://lore.kernel.org/linux-gpio/67bba210-09ac-32fb-bb97-8bfc40c2c200@eilabs.com/


Best Regards,
Levente Révész

Levente Révész (3):
  gpio: pca953x: Replace chip type flags with a type enum
  gpio: pca953x: Describe register maps with enums
  gpio: pca953x: Redesign register address calculation

 drivers/gpio/gpio-pca953x.c | 1196 ++++++++++++++++++++++++++---------
 1 file changed, 894 insertions(+), 302 deletions(-)

-- 
2.38.1

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

end of thread, other threads:[~2023-02-03 12:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-30 20:59 [RFC PATCH 0/3] gpio: pca953x: Redesign handling of chip types Levente Révész
2023-01-30 21:32 ` Andy Shevchenko
2023-02-02 15:12 ` Andy Shevchenko
2023-02-02 15:14   ` Andy Shevchenko
2023-02-03 10:40     ` Levente Révész
2023-02-03 11:32       ` Andy Shevchenko
2023-02-03 12:30   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox