devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] Input: pmic8xxx-keypad - add support keypad found in pm8941
       [not found] ` <1412675448-11990-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
@ 2014-10-07  9:50   ` Ivan T. Ivanov
  0 siblings, 0 replies; 2+ messages in thread
From: Ivan T. Ivanov @ 2014-10-07  9:50 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Dmitry Torokhov
  Cc: Ivan T. Ivanov, Stephen Boyd, linux-input-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA

Controller seems to be the same. Just access to it is over SPMI bus
and registers and bits are reshuffled. Hopefully this is nicely
abstracted by regmap helpers.

Signed-off-by: Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
---
 .../bindings/input/qcom,pm8xxx-keypad.txt          |  1 +
 drivers/input/keyboard/pmic8xxx-keypad.c           | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt b/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
index 7d8cb92..2b60f8a 100644
--- a/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
+++ b/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
@@ -8,6 +8,7 @@ PROPERTIES
 	Definition: must be one of:
 		    "qcom,pm8058-keypad"
 		    "qcom,pm8921-keypad"
+		    "qcom,pm8941-keypad"
 
 - reg:
 	Usage: required
diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c
index b82d161..2d4fa07 100644
--- a/drivers/input/keyboard/pmic8xxx-keypad.c
+++ b/drivers/input/keyboard/pmic8xxx-keypad.c
@@ -136,6 +136,32 @@ static const struct pmic8xxx_kp_info ssbi_kp = {
 	.row_hold	= REG_FIELD(0x149, 6, 7),
 };
 
+static const struct pmic8xxx_kp_info spmi_kp = {
+	.max_rows	= 10,
+	.min_rows	= 2,
+	.max_cols	= 8,
+	.min_cols	= 1,
+
+	.rows_select = {
+		1, 2, 3, 4, 5, 6, 7,
+		8, 9, 10
+	},
+
+	.recent_data	= 0xa87c,
+	.old_data	= 0xa85c,
+	.read_stride	= 2,
+
+	.events		= REG_FIELD(0xa808, 0, 1),
+	.scan_rows	= REG_FIELD(0xa840, 0, 3),
+	.scan_cols	= REG_FIELD(0xa840, 4, 6),
+	.enable		= REG_FIELD(0xa846, 7, 7),
+
+	.read_state	= REG_FIELD(0xa844, 0, 0),
+	.dbonce		= REG_FIELD(0xa842, 0, 1),
+	.pause		= REG_FIELD(0xa842, 3, 5),
+	.row_hold	= REG_FIELD(0xa842, 6, 7),
+};
+
 static u8 pmic8xxx_col_state(struct pmic8xxx_kp *kp, u8 col)
 {
 	/* all keys pressed on that particular row? */
@@ -715,6 +741,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
 static const struct of_device_id pm8xxx_match_table[] = {
 	{ .compatible = "qcom,pm8058-keypad", .data = (void *)&ssbi_kp },
 	{ .compatible = "qcom,pm8921-keypad", .data = (void *)&ssbi_kp },
+	{ .compatible = "qcom,pm8941-keypad", .data = (void *)&spmi_kp },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pm8xxx_match_table);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 4/4] Input: pmic8xxx-keypad - update DT bindings documentation
       [not found] <1412675448-11990-1-git-send-email-iivanov@mm-sol.com>
       [not found] ` <1412675448-11990-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
@ 2014-10-07  9:50 ` Ivan T. Ivanov
  1 sibling, 0 replies; 2+ messages in thread
From: Ivan T. Ivanov @ 2014-10-07  9:50 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Dmitry Torokhov
  Cc: Ivan T. Ivanov, Stephen Boyd, linux-input, devicetree,
	linux-kernel, linux-arm-msm

Fix incorrect dimensions for 'debonce' and 'scan-delay' times.
Now they represent what driver really expect. Add possible
time quants for 'debonce', 'scan-delay' and 'row-hold' times.
Update bindings example.

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt b/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
index 2b60f8a..df5e2a1 100644
--- a/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
+++ b/Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
@@ -54,20 +54,23 @@ PROPERTIES
 - debounce:
 	Usage: optional
 	Value type: <u32>
-	Definition: time in microseconds that key must be pressed or release
+	Definition: time in miliseconds that key must be pressed or release
 		    for key sense interrupt to trigger.
+		    Possible values: 5, 10, 15, 20.
 
 - scan-delay:
 	Usage: optional
 	Value type: <u32>
-	Definition: time in microseconds to pause between successive scans
+	Definition: time in miliseconds to pause between successive scans
 		    of the matrix array.
+		    Possible values: 1, 2, 4, 8, 16, 32, 64, 128.
 
 - row-hold:
 	Usage: optional
 	Value type: <u32>
 	Definition: time in nanoseconds to pause between scans of each row in
 		    the matrix array.
+		    Possible values: 30500, 61000, 122000.
 
 EXAMPLE
 
@@ -86,5 +89,5 @@ EXAMPLE
 		keypad,num-columns = <5>;
 		debounce = <15>;
 		scan-delay = <32>;
-		row-hold = <91500>;
+		row-hold = <61000>;
 	};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-07  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1412675448-11990-1-git-send-email-iivanov@mm-sol.com>
     [not found] ` <1412675448-11990-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2014-10-07  9:50   ` [PATCH 3/4] Input: pmic8xxx-keypad - add support keypad found in pm8941 Ivan T. Ivanov
2014-10-07  9:50 ` [PATCH 4/4] Input: pmic8xxx-keypad - update DT bindings documentation Ivan T. Ivanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).