On Tue, Jun 17, 2014 at 04:58:20AM +0100, George Cherian wrote:The driver takes this as part of platform data. It never continues operation if
Add device tree support to extcon-gpio driver.This looks distinctly odd. Why do you need this here?
Add devicetree binding documentation
Signed-off-by: George Cherian <george.cherian@xxxxxx>
---
.../devicetree/bindings/extcon/extcon-gpio.txt | 34 ++++++++++++++++++++++
drivers/extcon/extcon-gpio.c | 29 ++++++++++++++++++
2 files changed, 63 insertions(+)
create mode 100644 Documentation/devicetree/bindings/extcon/extcon-gpio.txt
diff --git a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt
new file mode 100644
index 0000000..80b791b
--- /dev/null
+++ b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt
@@ -0,0 +1,34 @@
+GPIO based EXTCON
+
+EXTCON GPIO
+-----------
+
+Required Properties:
+ - compatible: should be:
+ * "ti,extcon-gpio"
+ - gpios: specifies the gpio pin used.
+ - debounce: Debounce time for GPIO IRQ in ms
+ - irq-flags: IRQ flag to be used ( eg: IRQ_TYPE_EDGE_FALLING)
+Optional Properties:Surely this is defined in the gpio flags?
+ - gpio-active-low: Property describing whether gpio active state is 1 or 0
+ If defined , low state of gpio means active.
okay. For my use-case I dont need this.
+ - check-on-resume: Property describing whether to check the gpio stateDoes this need to be in DT? Surely we could jsut always check this?
+ while resuming from SLEEP.
You mean to say this should not be part of dt?+ - state-on: print_state is overriden with state_on string if provided.This means nothing from a HW perspective. This describes linux internal
+ If NULL, default method of extcon class is used.
+ - state_off: print_state is overriden with state_off string if provided.
+ If NUll, default method of extcon class is used.
details.
[...]I dont need this, will remove in v2.
+ of_property_read_u32(np, "debounce", (u32 *)&pdata->debounce);If you need theses casts, the code is broken.
+ of_property_read_u32(np, "irq-flags", (u32 *)&pdata->irq_flags);
true.
These functions can only read into a u32. If you pass a smaller type
you'll trash aribtrary memory locations, and if you pass a larger type
this is broken for BE.
Mark.