gpio: sx150x: Update OF configuration
Subsystems (2)
PATCH v2 1/1 gpio: sx150x: Update OF configuration
In case of OF probing, the driver fails to initialize :
- gpio_chip.base must be -1
- irq_summary must be either -1 or valid
- There is no way to use the other configurations
Add OF parsing function to complete the HW configuration, make OF configuration dynamic instead of static with #defines and update the DT bindings.
---
Changes since v1 at http://lkml.kernel.org/r/1466157063-10955-1-git-send-email-narmstrong-rdvid1DuHRBWk0Htik3J/[email protected]:
- Put back #ifdef CONFIG_OF_GPIO to remove OF code for non-of platforms
.../devicetree/bindings/gpio/gpio-sx150x.txt | 17 ++++++ drivers/gpio/gpio-sx150x.c | 67 ++++++++++++++++++++-- 2 files changed, 79 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/gpio/gpio-sx150x.txt +17 -0
@@ -22,6 +22,17 @@ Required properties: - interrupt-controller: Marks the device as a interrupt controller. +Optional Properties: +- oscio-is-gpo: Boolean, Indicated the oscio pin can be used as additional + output gpo port. + +- pull-up-ports: Array of port numbers which must have pull-up enabled. +- pull-down-ports: Array of port numbers which must have pull-down enabled. +- open-drain-ports: Array of port numbers which must be configured as open-drain, + Push-Pull mode is default. +- polarity-invert-ports: Array of port numbers whih port polarity must be inverted. +- probe-reset: Boolean, Indicates the expander must be resetted. + The GPIO expander can optionally be used as an interrupt controller, in which case it uses the default two cell specifier as described in Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
@@ -38,4 +49,10 @@ Example: gpio-controller; interrupt-controller; + + pull-up-ports = <0 12>; + pull-down-ports = <1 8>; + open-drain-ports = <6 7 11>; + polarity-invert-ports = <3>; + probe-reset; };
drivers/gpio/gpio-sx150x.c +62 -5
91 lines not on this page · raw message
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html