Skip to contentSkip to conversation

input: vt8500: Add power button keypad driver

PATCH New Tony Prisk 1 participant 1 message Dec 31, 2012

Subsystems (3)
lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

PATCH v3 1/1 input: vt8500: Add power button keypad driver

This patch adds support for the Power Button keypad found on Wondermedia netbooks/tablets.

A keymap property is exposed to allowing defining the key event to be generated when the power button is pressed.

---
CC: linux-kernel at vger.kernel.org
CC: linux-arm-kernel at lists.infradead.org
CC: vt8500-wm8505-linux-kernel at googlegroups.com
CC: linux-input at vger.kernel.org

v2:
Remove devicetree binding for keycode
Add dependency on OF in Kconfig
Move static variables in a struct
Remove redundant inline modifier from kpad_power_timeout()
Remove unneccessary checks against power_button_pressed. Drop variable. Cleanup the fail path code and add a .remove function.
Change the button behaviour so that a key-released event is only generated once the key is released, not after timeout.
*Changes tested on WM8650 tablet.

v3:
Remove dependency on PMC node, and change binding document accordingly. Remove mod_timer call in kpad_power_timeout()
Unmap io memory in fail path and .remove
Update name & phys fields to be more meaningful
Use del_timer_sync rather than del_timer
Fix usage of input_unregister_device/input_free_device

 .../bindings/input/vt8500-power-keypad.txt         |   17 ++
 drivers/input/keyboard/Kconfig                     |   10 ++
 drivers/input/keyboard/Makefile                    |    1 +
 drivers/input/keyboard/wmt_power_keypad.c          |  182 ++++++++++++++++++++
 4 files changed, 210 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/vt8500-power-keypad.txt
 create mode 100644 drivers/input/keyboard/wmt_power_keypad.c
Documentation/devicetree/bindings/input/vt8500-power-keypad.txt new file +17 -0
new file mode 100644
index 0000000..f6996d5
@@ -0,0 +1,17 @@
+* Wondermedia Power Keypad device tree bindings
+
+Wondermedia SoCs have a single irq-driven power button attached to
+the power management controller.
+
+Required SoC Specific Properties:
+- compatible: should be one of the following
+   - "wm,power-keypad": For all Wondermedia 8xxx-series SoCs.
+- reg : Should contain the register range of the Power Mgmt controller
+- interrupts: should be the power management controller wakeup interrupt.
+
+Example:
+	powerkey: pwrkey at 0 {
+		compatible = "wm,power-keypad";
+		reg = <0xd8130000 0x1000>;
+		interrupts = <22>;
+	};
drivers/input/keyboard/Kconfig +10 -0
index 5a240c6..bb1e04f 100644
@@ -595,6 +595,16 @@ config KEYBOARD_TWL4030
 	  To compile this driver as a module, choose M here: the
 	  module will be called twl4030_keypad.
 
+config KEYBOARD_WMT_POWER_KEYPAD
+	tristate "Wondermedia Power keypad support"
+	depends on (OF && ARCH_VT8500)
+	help
+	  Say Y here to enable support for the power button keypad
+	  on Wondermedia 8xxx-series SoCs.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called wmt_power_keypad.
+
 config KEYBOARD_XTKBD
 	tristate "XT keyboard"
 	select SERIO
drivers/input/keyboard/Makefile +1 -0
index 44e7600..eea31af 100644
@@ -52,5 +52,6 @@ obj-$(CONFIG_KEYBOARD_TC3589X)		+= tc3589x-keypad.o
 obj-$(CONFIG_KEYBOARD_TEGRA)		+= tegra-kbc.o
 obj-$(CONFIG_KEYBOARD_TNETV107X)	+= tnetv107x-keypad.o
 obj-$(CONFIG_KEYBOARD_TWL4030)		+= twl4030_keypad.o
+obj-$(CONFIG_KEYBOARD_WMT_POWER_KEYPAD)	+= wmt_power_keypad.o
 obj-$(CONFIG_KEYBOARD_XTKBD)		+= xtkbd.o
 obj-$(CONFIG_KEYBOARD_W90P910)		+= w90p910_keypad.o
drivers/input/keyboard/wmt_power_keypad.c new file +182 -0

182 lines not on this page · raw message

Signature · 1 line
1.7.9.5