pinctrl: Add Cypress cy8c95x0
Subsystems (4)
Patrick Rudolph
maintainerv3 cover pinctrl: Add Cypress cy8c95x0
Add Cypress cy8c95x0 pinctrl support.
v3:
- Update DT binding
- Fix direction mask calculation in irq_bus_sync_unlock
- Set can_sleep to true
v2:
- Update DT binding
- Support output pincfg through DT
- Always expose all GPIOs and ignore ngpios property
Patrick Rudolph (2):
dt-binding: pinctrl: Add cypress,cy8c95x0
pinctrl: Add Cypress cy8c95x0 support
.../bindings/pinctrl/cypress,cy8c95x0.yaml | 134 ++ MAINTAINERS | 6 + drivers/pinctrl/Kconfig | 14 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-cy8c95x0.c | 1381 +++++++++++++++++ 5 files changed, 1536 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/cypress,cy8c95x0.yaml create mode 100644 drivers/pinctrl/pinctrl-cy8c95x0.c
Signature · 1 line
2.37.1
Patrick Rudolph
maintainerPATCH v3 1/2 dt-binding: pinctrl: Add cypress,cy8c95x0
Added device tree binding documentation for
Cypress CY8C95x0 I2C pin-controller.
--- .../bindings/pinctrl/cypress,cy8c95x0.yaml | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/cypress,cy8c95x0.yaml
Documentation/devicetree/bindings/pinctrl/cypress,cy8c95x0.yaml new file +134 -0
@@ -0,0 +1,134 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/cypress,cy8c95x0.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cypress CY8C95X0 I2C GPIO expander + +maintainers: + - Patrick Rudolph <[email protected]> + +description: | + This supports the 20/40/60 pin Cypress CYC95x0 GPIO I2C expanders. + Pin function configuration is performed on a per-pin basis. + +properties: + compatible: + enum: + - cypress,cy8c9520 + - cypress,cy8c9540 + - cypress,cy8c9560 + + reg: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + description: + The first cell is the GPIO number and the second cell specifies GPIO + flags, as defined in <dt-bindings/gpio/gpio.h>. + const: 2 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + + gpio-line-names: true + + gpio-ranges: + maxItems: 1 + + gpio-reserved-ranges: + maxItems: 1 + + vdd-supply: + description: + Optional power supply. + +patternProperties: + '-pins$': + type: object + description: + Pinctrl node's client devices use subnodes for desired pin configuration. + Client device subnodes use below standard properties. + $ref: pincfg-node.yaml# + + properties: + pins: + description: + List of gpio pins affected by the properties specified in this + subnode. + items: + pattern: '^gp([0-7][0-7])$' + minItems: 1 + maxItems: 60 + + function: + description: + Specify the alternative function to be configured for the specified + pins. + enum: [ gpio, pwm ] + + bias-pull-down: true + + bias-pull-up: true + + bias-disable: true + + output-high: true + + output-low: true + + drive-push-pull: true + + drive-open-drain: true + + drive-open-source: true + + required: + - pins + - function + + additionalProperties: false + +required: + - compatible + - reg + - interrupts + - interrupt-controller + - '#interrupt-cells' + - gpio-controller + - '#gpio-cells' + +additionalProperties: false + +allOf: + - $ref: "pinctrl.yaml#" + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pinctrl@20 { + compatible = "cypress,cy8c9520"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + #interrupt-cells = <2>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + interrupt-controller; + vdd-supply = <&p3v3>; + gpio-reserved-ranges = <5 1>; + }; + };
Signature · 1 line
2.37.1
Re: [PATCH v3 1/2] dt-binding: pinctrl: Add cypress,cy8c95x0
Quoted 4 lines · Patrick Rudolph
Added device tree binding documentation for
Cypress CY8C95x0 I2C pin-controller.Signed-off-by Patrick Rudolph <[email protected]>
Best regards,
Krzysztof
Re: [PATCH v3 1/2] dt-binding: pinctrl: Add cypress,cy8c95x0
In reply to Patrick RudolphQuoted 4 lines · Patrick Rudolph
Added device tree binding documentation for
Cypress CY8C95x0 I2C pin-controller.Signed-off-by Patrick Rudolph <[email protected]>
Patch applied!
Yours,
Linus Walleij
Patrick Rudolph
maintainerPATCH v3 2/2 pinctrl: Add Cypress cy8c95x0 support
In reply to Patrick RudolphAdd support for cypress I2C GPIO expanders cy8c9520, cy8c9540 and cy8c9560. The GPIO expanders feature a PWM mode, thus add it as pinctrl driver.
The chip features multiple drive modes for each pin when configured as output and multiple bias settings when configured as input.
Tested all three components and verified that all functionality is fully working.
Datasheet: https://www.cypress.com/file/37971/download
--- MAINTAINERS | 6 + drivers/pinctrl/Kconfig | 14 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-cy8c95x0.c | 1381 ++++++++++++++++++++++++++++ 4 files changed, 1402 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-cy8c95x0.c
MAINTAINERS +6 -0
@@ -5629,6 +5629,12 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/ T: git git://linuxtv.org/anttip/media_tree.git F: drivers/media/common/cypress_firmware* +CYPRESS CY8C95X0 PINCTRL DRIVER +M: Patrick Rudolph <[email protected]> +L: [email protected] +S: Maintained +F: drivers/pinctrl/pinctrl-cy8c95x0.c + CYPRESS CY8CTMA140 TOUCHSCREEN DRIVER M: Linus Walleij <[email protected]> L: [email protected]
drivers/pinctrl/Kconfig +14 -0
@@ -135,6 +135,20 @@ config PINCTRL_BM1880 help Pinctrl driver for Bitmain BM1880 SoC. +config PINCTRL_CY8C95X0 + tristate "Cypress CY8C95X0 I2C pinctrl and GPIO driver" + depends on I2C && OF + select GPIOLIB + select GPIOLIB_IRQCHIP + select PINMUX + select PINCONF + select GENERIC_PINCONF + select REGMAP_I2C + help + Support for 20/40/60 pin Cypress Cy8C95x0 pinctrl/gpio I2C expander. + This driver can also be built as a module. If so, the module will be + called pinctrl-cy8c95x0. + config PINCTRL_DA850_PUPD tristate "TI DA850/OMAP-L138/AM18XX pull-up and pull-down groups" depends on OF && (ARCH_DAVINCI_DA850 || COMPILE_TEST)
drivers/pinctrl/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_AT91PIO4) += pinctrl-at91-pio4.o obj-$(CONFIG_PINCTRL_AXP209) += pinctrl-axp209.o obj-$(CONFIG_PINCTRL_BM1880) += pinctrl-bm1880.o +obj-$(CONFIG_PINCTRL_CY8C95X0) += pinctrl-cy8c95x0.o obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o obj-$(CONFIG_PINCTRL_DA9062) += pinctrl-da9062.o obj-$(CONFIG_PINCTRL_DIGICOLOR) += pinctrl-digicolor.o
drivers/pinctrl/pinctrl-cy8c95x0.c new file +1381 -0
1,381 lines not on this page · raw message
Signature · 1 line
2.37.1
Re: [PATCH v3 2/2] pinctrl: Add Cypress cy8c95x0 support
Quoted 7 lines · Patrick Rudolph
Add support for cypress I2C GPIO expanders cy8c9520, cy8c9540 and cy8c9560. The GPIO expanders feature a PWM mode, thus add it as pinctrl driver.
The chip features multiple drive modes for each pin when configured as output and multiple bias settings when configured as input.
Quoted 6 lines
Tested all three components and verified that all functionality is fully working.
Datasheet: https://www.cypress.com/file/37971/download
Signed-off-by Patrick Rudolph <[email protected]>Signed-off-by Naresh Solanki <[email protected]>
Patch applied!
Yours,
Linus Walleij
Re: [PATCH v3 2/2] pinctrl: Add Cypress cy8c95x0 support
In reply to Patrick RudolphQuoted 10 lines · Patrick Rudolph
Add support for cypress I2C GPIO expanders cy8c9520, cy8c9540 and cy8c9560. The GPIO expanders feature a PWM mode, thus add it as pinctrl driver.
The chip features multiple drive modes for each pin when configured as output and multiple bias settings when configured as input.
Tested all three components and verified that all functionality is fully working.
Thanks, I appreciated it!
Since Linus applied this, I will work on it instead of reviewing. Because it will be faster and more productive (and we do not have many weeks left in this cycle).
Signature · 2 lines
With Best Regards, Andy Shevchenko