mbox series

[v2,0/2] Add support for ADG1414 Serially-Controlled Octal SPST Switches

Message ID 20250213-for_upstream-v2-0-ec4eff3b3cd5@analog.com
Headers show
Series Add support for ADG1414 Serially-Controlled Octal SPST Switches | expand

Message

Kim Seer Paller Feb. 13, 2025, 1:15 p.m. UTC
Apologies for the long delay in following up on this patch series.
I checked the gpio-regmap abstraction to achieve a smaller footprint,
but found that it may not suitable for the ADG1414. The ADG1414 device
requires direct manipulation of individual bits to control the switches.
In the regmap_config, reg_bits and val_bits need to be set to reflect a
byte for instruction and a byte for data. However, the ADG1414 device
directly changes the bit itself (e.g., bit 0 to change on/off switch 0).
I think the standard regmap read/write API may not be applicable.
Additionally, the size of the transaction dynamically changes based on
the number of daisy-chained devices.

This version address the feedback provided and includes the necessary
improvements.

ADG1414:
* Define a static struct regmap_bus to wrap custom read/write functions.
* Use devm_mutex_init() to initialize the mutex.

Bindings:
* Modify filename to adi,adg1414-gpio.
* Add type definition for #daisy-chained-devices property.
* Modify title and description to describe hardware.

- Kim Seer Paller

Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
---
Kim Seer Paller (2):
      dt-bindings: gpio: add adg1414
      gpio: gpio-adg1414: New driver

 .../devicetree/bindings/gpio/adi,adg1414-gpio.yaml |  68 +++++++++
 MAINTAINERS                                        |   7 +
 drivers/gpio/Kconfig                               |  10 ++
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-adg1414.c                        | 162 +++++++++++++++++++++
 5 files changed, 248 insertions(+)
---
base-commit: 4dc1d1bec89864d8076e5ab314f86f46442bfb02
change-id: 20250213-for_upstream-a490d1a04bf2

Best regards,

Comments

Krzysztof Kozlowski Feb. 13, 2025, 6:16 p.m. UTC | #1
On 13/02/2025 14:15, Kim Seer Paller wrote:
> +maintainers:
> +  - Kim Seer Paller <kimseer.paller@analog.com>
> +
> +description:
> +  The ADG1414 is a 9.5 Ω RON ±15 V/+12 V/±5 V iCMOS serially-controlled
> +  octal SPST switches.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,adg14140-gpio


Is ADG1414 anything else than GPIO? Where are the rest of the bindings then?

> +
> +  reg:
> +    maxItems: 1
> +


...

> diff --git a/MAINTAINERS b/MAINTAINERS
> index 25c86f47353de25c88291cc7fd6c4e9bfb12d5c4..66d92be0f57daa9eabb48d7e53b6b2bea0c40863 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -498,6 +498,12 @@ W:	https://ez.analog.com/linux-software-drivers
>  F:	Documentation/devicetree/bindings/net/ieee802154/adf7242.txt
>  F:	drivers/net/ieee802154/adf7242.c
>  
> +ADG1414 SPST Switch Driver
> +M:	Kim Seer Paller <kimseer.paller@analog.com>
> +S:	Supported
> +W:	https://ez.analog.com/linux-software-drivers
> +F:	Documentation/devicetree/bindings/gpio/gpio-adg1414.yaml
As reported - wrong path.

Best regards,
Krzysztof
Linus Walleij Feb. 14, 2025, 10:42 a.m. UTC | #2
On Thu, Feb 13, 2025 at 7:16 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On 13/02/2025 14:15, Kim Seer Paller wrote:
> > +maintainers:
> > +  - Kim Seer Paller <kimseer.paller@analog.com>
> > +
> > +description:
> > +  The ADG1414 is a 9.5 Ω RON ±15 V/+12 V/±5 V iCMOS serially-controlled
> > +  octal SPST switches.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,adg14140-gpio
>
>
> Is ADG1414 anything else than GPIO? Where are the rest of the bindings then?

I read the spec and it is actually an SPI-controlled switch.

(As in "power switch", not "network switch".)

It's a bit interesting since we have no "switch" subsystem, but there
is "mux".

The question is whether this should be considered some kind of
"gpio" (due to the nature of switches being off/on) in order to not
complicate our world too much or if we need to create a whole
new device class for switches.

Yours,
Linus Walleij