Skip to contentSkip to conversation

input: keyboard: Add devicetree support for lm8333

PATCH Superseded Gordan Markus 2 participants 4 messages Oct 27, 2016 – Oct 31, 2016 1 message not in the archive

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: keyboard: Add devicetree support for lm8333

This adds LM8333 devicetree parsing for the keypad part. Optional properties to specify the keypad driver active time and debounce time.

---
 .../devicetree/bindings/input/ti,lm8333.txt        | 45 ++++++++++++++++++
 drivers/input/keyboard/lm8333.c                    | 54 ++++++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ti,lm8333.txt
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +45 -0
new file mode 100644
index 0000000..4100d48
@@ -0,0 +1,45 @@
+LM8333 Keypad
+
+Required properties:
+- compatible: Compatible property value should be "ti,lm8333".
+
+- reg: Physical base address of the peripheral and length of memory mapped
+  region.
+
+- interrupts: The interrupt number for the peripheral.
+
+- linux,keymap: The keymap to use
+	(see Documentation/devicetree/bindings/input/matrix-keymap.txt)
+
+Optional properties:
+- ti,active-time: Specify the time during which the keypad is scanned after
+	the last key is released, before entering Halt mode.
+	The active time must be longer than the debounce time.
+	Default 500 ms.
+
+- ti,debounce-time: Specify the keypad debounce time.
+	This can be used for reliable scanning of keyboards with noisy contacts.
+	Default 10 ms.
+
+Example:
+input {
+	compatible = "ti,lm8333";
+	reg = <0x51>;
+	interrupts = <5>;
+
+	ti,active-time = <750>;
+	ti,debounce-time = <20>;
+
+	linux,keymap = <
+			0x0001001e
+			0x00020030
+			0x0003002e
+			0x00040020
+			0x00050012
+			0x00060021
+			0x00070022
+			0x00080023
+			0x01010017
+			0x01020024
+			0x01030025>;
+};
drivers/input/keyboard/lm8333.c +54 -0

66 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

A message that is not in the archive (sent off-list or not yet received): 1477595854-9059-1-git-send-email-gordan.markus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 7 lines · Gordan Markus

This adds LM8333 devicetree parsing for the keypad part. Optional properties to specify the keypad driver active time and debounce time.

---
 .../devicetree/bindings/input/ti,lm8333.txt        | 45 ++++++++++++++++++

It is preferred that bindings be a separate patch.

Quoted 18 lines
 drivers/input/keyboard/lm8333.c                    | 54 ++++++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ti,lm8333.txt
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +8 -0
new file mode 100644
index 0000000..4100d48
@@ -0,0 +1,45 @@
+LM8333 Keypad
+
+Required properties:
+- compatible: Compatible property value should be "ti,lm8333".
+
+- reg: Physical base address of the peripheral and length of memory mapped
+  region.
+

Documentation/devicetree/bindings/input/ti,lm8333.txt line 18

Quoted 10 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +10 -0
+- interrupts: The interrupt number for the peripheral.
+
+- linux,keymap: The keymap to use
+	(see Documentation/devicetree/bindings/input/matrix-keymap.txt)
+
+Optional properties:
+- ti,active-time: Specify the time during which the keypad is scanned after
+	the last key is released, before entering Halt mode.
+	The active time must be longer than the debounce time.
+	Default 500 ms.

Add a unit suffix.

Documentation/devicetree/bindings/input/ti,lm8333.txt line 22

Quoted 4 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +4 -0
+
+- ti,debounce-time: Specify the keypad debounce time.
+	This can be used for reliable scanning of keyboards with noisy contacts.
+	Default 10 ms.

Don't we have a common property for this?

Quoted 13 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +13 -0
+
+Example:
+input {
+	compatible = "ti,lm8333";
+	reg = <0x51>;
+	interrupts = <5>;
+
+	ti,active-time = <750>;
+	ti,debounce-time = <20>;
+
+	linux,keymap = <
+			0x0001001e
+			0x00020030

Documentation/devicetree/bindings/input/ti,lm8333.txt line 45

Quoted 10 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +10 -0
+			0x0003002e
+			0x00040020
+			0x00050012
+			0x00060021
+			0x00070022
+			0x00080023
+			0x01010017
+			0x01020024
+			0x01030025>;
+};

--
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

#3 lore raw
Quoted 10 lines · Rob Herring
Quoted 7 lines · Gordan Markus

This adds LM8333 devicetree parsing for the keypad part. Optional properties to specify the keypad driver active time and debounce time.

---
 .../devicetree/bindings/input/ti,lm8333.txt        | 45 ++++++++++++++++++

It is preferred that bindings be a separate patch.

Thanks Rob.
Just to be clear, should I create a new thread with two patches?

Quoted 23 lines
Quoted 23 lines
 drivers/input/keyboard/lm8333.c                    | 54 ++++++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ti,lm8333.txt
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +12 -0
new file mode 100644
index 0000000..4100d48
@@ -0,0 +1,45 @@
+LM8333 Keypad
+
+Required properties:
+- compatible: Compatible property value should be "ti,lm8333".
+
+- reg: Physical base address of the peripheral and length of memory mapped
+  region.
+
+- interrupts: The interrupt number for the peripheral.
+
+- linux,keymap: The keymap to use
+	(see Documentation/devicetree/bindings/input/matrix-keymap.txt)
Quoted 8 lines

Documentation/devicetree/bindings/input/ti,lm8333.txt line 18

Quoted 6 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +6 -0
+
+Optional properties:
+- ti,active-time: Specify the time during which the keypad is scanned after
+	the last key is released, before entering Halt mode.
+	The active time must be longer than the debounce time.
+	Default 500 ms.

Add a unit suffix.

The property will be renamed to "ti,active-time-ms".

Quoted 7 lines

Documentation/devicetree/bindings/input/ti,lm8333.txt line 22

Quoted 5 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +4 -0
+
+- ti,debounce-time: Specify the keypad debounce time.
+	This can be used for reliable scanning of keyboards with noisy contacts.
+	Default 10 ms.

Don't we have a common property for this?

There isn't a common property, as far as I can tell. Different devices have different debounce time properties.

Furthermore, the property should have a unit sufix as well, i.e. it should be renamed to "ti,debounce-time-ms", right?

Gordan

--
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

#4 lore raw
Quoted 7 lines · Gordan Markuš
Quoted 5 lines · Rob Herring
Quoted 4 lines · Gordan Markus

This adds LM8333 devicetree parsing for the keypad part. Optional properties to specify the keypad driver active time and debounce time.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
---
 .../devicetree/bindings/input/ti,lm8333.txt        | 45 ++++++++++++++++++

It is preferred that bindings be a separate patch.

Thanks Rob.
Just to be clear, should I create a new thread with two patches?

Considering changes are needed, yes.

Quoted 39 lines
Quoted 22 lines
Quoted 22 lines
 drivers/input/keyboard/lm8333.c                    | 54 ++++++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/ti,lm8333.txt
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +12 -0
new file mode 100644
index 0000000..4100d48
@@ -0,0 +1,45 @@
+LM8333 Keypad
+
+Required properties:
+- compatible: Compatible property value should be "ti,lm8333".
+
+- reg: Physical base address of the peripheral and length of memory mapped
+  region.
+
+- interrupts: The interrupt number for the peripheral.
+
+- linux,keymap: The keymap to use
+   (see Documentation/devicetree/bindings/input/matrix-keymap.txt)
Quoted 8 lines

Documentation/devicetree/bindings/input/ti,lm8333.txt line 18

Quoted 6 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +6 -0
+
+Optional properties:
+- ti,active-time: Specify the time during which the keypad is scanned after
+   the last key is released, before entering Halt mode.
+   The active time must be longer than the debounce time.
+   Default 500 ms.

Add a unit suffix.

The property will be renamed to "ti,active-time-ms".

Quoted 6 lines
Quoted 5 lines
Documentation/devicetree/bindings/input/ti,lm8333.txt new file +4 -0
+
+- ti,debounce-time: Specify the keypad debounce time.
+   This can be used for reliable scanning of keyboards with noisy contacts.
+   Default 10 ms.
Quoted 4 lines
Quoted 1 line

Don't we have a common property for this?

There isn't a common property, as far as I can tell. Different devices have different debounce time properties.

Looks like we have 2 at least: debounce-interval and debounce-delay-ms. I'd go with the latter as it has units.

And there's lots of other variations. Don't add yet another one.

$ git grep debounce Documentation/devicetree/bindings/input/
Documentation/devicetree/bindings/input/ads7846.txt:
ti,debounce-max                 Max number of additional readings per
Documentation/devicetree/bindings/input/ads7846.txt:
ti,debounce-tol                 Tolerance used for filtering (u16).
Documentation/devicetree/bindings/input/ads7846.txt:
ti,debounce-rep                 Additional consecutive good readings
Documentation/devicetree/bindings/input/ads7846.txt:
ti,pendown-gpio-debounce        Platform specific debounce time for
the
Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt:-
col-debounce-filter-period: The debounce period for the Column filter.
Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt:-
status-debounce-filter-period: The debounce period for the Status
filter.
Documentation/devicetree/bindings/input/brcm,bcm-keypad.txt:
 col-debounce-filter-period = <5>;
Documentation/devicetree/bindings/input/gpio-keys-polled.txt:   -
debounce-interval: Debouncing interval time in milliseconds.
Documentation/devicetree/bindings/input/gpio-keys.txt:  -
debounce-interval: Debouncing interval time in milliseconds.
Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt:-
debounce-delay-ms:     debounce interval in milliseconds
Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt:
 debounce-delay-ms = <5>;
Documentation/devicetree/bindings/input/lpc32xx-key.txt:-
nxp,debounce-delay-ms: Debounce delay in ms
Documentation/devicetree/bindings/input/lpc32xx-key.txt:
 nxp,debounce-delay-ms = <3>;
Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt:-
nvidia,debounce-delay-ms: delay in milliseconds per row scan for
debouncing
Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt:
nvidia,debounce-delay-ms = <640>;
Documentation/devicetree/bindings/input/pxa27x-keypad.txt:-
marvell,debounce-interval : How long time the key will be
Documentation/devicetree/bindings/input/pxa27x-keypad.txt:  is
debounce interval for direct key and bit[15:0] is debounce
Documentation/devicetree/bindings/input/pxa27x-keypad.txt:
 marvell,debounce-interval = <0x001e001e>;
Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt:- debounce:
Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt:
 debounce = <15625>;
Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt:- debounce:
Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt:
 debounce = <15>;
Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt:- debounce:
Documentation/devicetree/bindings/input/qcom,pm8xxx-pwrkey.txt:
 debounce = <15625>;
Documentation/devicetree/bindings/input/st-keyscan.txt:-
st,debounce_us: Debouncing interval time in microseconds
Documentation/devicetree/bindings/input/st-keyscan.txt: st,debounce_us = <5000>;
Documentation/devicetree/bindings/input/stmpe-keypad.txt: -
debounce-interval        : Debouncing interval time in milliseconds
Documentation/devicetree/bindings/input/stmpe-keypad.txt:
 debounce-interval = <64>;
Documentation/devicetree/bindings/input/ti,palmas-pwrbutton.txt:-
ti,palmas-pwron-debounce-milli-seconds: Duration in milliseconds
Documentation/devicetree/bindings/input/ti,palmas-pwrbutton.txt:
         ti,palmas-pwron-debounce-milli-seconds = <15>;
Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt:-
debounce_timeout: Each step is 512 us.  Valid 0-255
Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt:
        debounce_timeout = <40>;
Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt:
- fsl,pen-debounce-ns: Pen debounce time in nanoseconds.

Rob
--
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