--- v2
+++ v6
@@ -9,15 +9,16 @@
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
+Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/input/keyboard/Kconfig | 11 ++
drivers/input/keyboard/Makefile | 1 +
- drivers/input/keyboard/tm2-touchkey.c | 280 ++++++++++++++++++++++++++++++++++
- 3 files changed, 292 insertions(+)
+ drivers/input/keyboard/tm2-touchkey.c | 287 ++++++++++++++++++++++++++++++++++
+ 3 files changed, 299 insertions(+)
create mode 100644 drivers/input/keyboard/tm2-touchkey.c
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
-index cbd75cf..e6e9858 100644
+index cbd75cf..97acd65 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -666,6 +666,17 @@ config KEYBOARD_TC3589X
@@ -25,7 +26,7 @@
module will be called tc3589x-keypad.
+config KEYBOARD_TM2_TOUCHKEY
-+ tristate "tm2-touchkey support"
++ tristate "TM2 touchkey support"
+ depends on I2C
+ depends on LEDS_CLASS
+ help
@@ -52,10 +53,10 @@
obj-$(CONFIG_KEYBOARD_W90P910) += w90p910_keypad.o
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
new file mode 100644
-index 0000000..92eacb6
+index 0000000..e927d06
--- /dev/null
+++ b/drivers/input/keyboard/tm2-touchkey.c
-@@ -0,0 +1,280 @@
+@@ -0,0 +1,287 @@
+/*
+ * TM2 touchkey device driver
+ *
@@ -98,6 +99,11 @@
+ TM2_TOUCHKEY_KEY_BACK,
+};
+
++enum {
++ TM2_TOUCHKEY_SUPPLIES_VCC,
++ TM2_TOUCHKEY_SUPPLIES_VDD,
++};
++
+struct tm2_touchkey_data {
+ struct i2c_client *client;
+ struct input_dev *input_dev;
@@ -124,7 +130,9 @@
+ data = TM2_TOUCHKEY_CMD_LED_ON;
+ }
+
-+ regulator_set_voltage(touchkey->regulators[1].consumer, volt, volt);
++ regulator_set_voltage(
++ touchkey->regulators[TM2_TOUCHKEY_SUPPLIES_VDD].consumer,
++ volt, volt);
+ i2c_smbus_write_byte_data(touchkey->client,
+ TM2_TOUCHKEY_BASE_REG, data);
+}
@@ -213,8 +221,8 @@
+ i2c_set_clientdata(client, touchkey);
+
+ /* regulators */
-+ touchkey->regulators[0].supply = "vcc";
-+ touchkey->regulators[1].supply = "vdd";
++ touchkey->regulators[TM2_TOUCHKEY_SUPPLIES_VCC].supply = "vcc";
++ touchkey->regulators[TM2_TOUCHKEY_SUPPLIES_VDD].supply = "vdd";
+ ret = devm_regulator_bulk_get(&client->dev,
+ ARRAY_SIZE(touchkey->regulators),
+ touchkey->regulators);
@@ -315,7 +323,7 @@
+MODULE_DEVICE_TABLE(i2c, tm2_touchkey_id_table);
+
+static const struct of_device_id tm2_touchkey_of_match[] = {
-+ {.compatible = "samsung,tm2-touchkey",},
++ {.compatible = "cypress,tm2-touchkey",},
+ {},
+};
+MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match);