All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Input/spear-keyboard: delete redundant key definitions from 9x9 keyboard
@ 2012-02-23  9:12 Viresh Kumar
  2012-02-23  9:12 ` [PATCH 2/3] Input/spear-keyboard: Add 6x6 keypad matrix definitions Viresh Kumar
  2012-02-23  9:12 ` [PATCH 3/3] Input/spear-keyboard: Configure device according to supplied mode Viresh Kumar
  0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-02-23  9:12 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux,
	bhavna.yadav, vincenzo.frascino, mirko.gardi

From: Rajeev Kumar <rajeev-dlh.kumar@st.com>

Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 arch/arm/plat-spear/include/plat/keyboard.h |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h
index 68b5394..004195f 100644
--- a/arch/arm/plat-spear/include/plat/keyboard.h
+++ b/arch/arm/plat-spear/include/plat/keyboard.h
@@ -62,24 +62,6 @@ int _name[] = { \
 	KEY(4, 6, KEY_Z), \
 	KEY(4, 7, KEY_X), \
 	KEY(4, 8, KEY_C), \
-	KEY(4, 0, KEY_L), \
-	KEY(4, 1, KEY_SEMICOLON), \
-	KEY(4, 2, KEY_APOSTROPHE), \
-	KEY(4, 3, KEY_GRAVE), \
-	KEY(4, 4, KEY_LEFTSHIFT), \
-	KEY(4, 5, KEY_BACKSLASH), \
-	KEY(4, 6, KEY_Z), \
-	KEY(4, 7, KEY_X), \
-	KEY(4, 8, KEY_C), \
-	KEY(4, 0, KEY_L), \
-	KEY(4, 1, KEY_SEMICOLON), \
-	KEY(4, 2, KEY_APOSTROPHE), \
-	KEY(4, 3, KEY_GRAVE), \
-	KEY(4, 4, KEY_LEFTSHIFT), \
-	KEY(4, 5, KEY_BACKSLASH), \
-	KEY(4, 6, KEY_Z), \
-	KEY(4, 7, KEY_X), \
-	KEY(4, 8, KEY_C), \
 	KEY(5, 0, KEY_V), \
 	KEY(5, 1, KEY_B), \
 	KEY(5, 2, KEY_N), \
-- 
1.7.8.110.g4cb5d


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

* [PATCH 2/3] Input/spear-keyboard: Add 6x6 keypad matrix definitions
  2012-02-23  9:12 [PATCH 1/3] Input/spear-keyboard: delete redundant key definitions from 9x9 keyboard Viresh Kumar
@ 2012-02-23  9:12 ` Viresh Kumar
  2012-02-23  9:12 ` [PATCH 3/3] Input/spear-keyboard: Configure device according to supplied mode Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-02-23  9:12 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux,
	bhavna.yadav, vincenzo.frascino, mirko.gardi

From: Rajeev Kumar <rajeev-dlh.kumar@st.com>

Add 6x6 keypad matrix and rename 9x9 keymap

Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 arch/arm/plat-spear/include/plat/keyboard.h |   42 ++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h
index 004195f..130c045 100644
--- a/arch/arm/plat-spear/include/plat/keyboard.h
+++ b/arch/arm/plat-spear/include/plat/keyboard.h
@@ -15,7 +15,7 @@
 #include <linux/input/matrix_keypad.h>
 #include <linux/types.h>
 
-#define DECLARE_KEYMAP(_name) \
+#define DECLARE_9x9_KEYMAP(_name) \
 int _name[] = { \
 	KEY(0, 0, KEY_ESC), \
 	KEY(0, 1, KEY_1), \
@@ -100,6 +100,46 @@ int _name[] = { \
 	KEY(8, 8, KEY_KP0), \
 }
 
+#define DECLARE_6x6_KEYMAP(_name) \
+int _name[] = { \
+	KEY(0, 0, KEY_RESERVED), \
+	KEY(0, 1, KEY_1), \
+	KEY(0, 2, KEY_2), \
+	KEY(0, 3, KEY_3), \
+	KEY(0, 4, KEY_4), \
+	KEY(0, 5, KEY_5), \
+	KEY(1, 0, KEY_Q), \
+	KEY(1, 1, KEY_W), \
+	KEY(1, 2, KEY_E), \
+	KEY(1, 3, KEY_R), \
+	KEY(1, 4, KEY_T), \
+	KEY(1, 5, KEY_Y), \
+	KEY(2, 0, KEY_D), \
+	KEY(2, 1, KEY_F), \
+	KEY(2, 2, KEY_G), \
+	KEY(2, 3, KEY_H), \
+	KEY(2, 4, KEY_J), \
+	KEY(2, 5, KEY_K), \
+	KEY(3, 0, KEY_B), \
+	KEY(3, 1, KEY_N), \
+	KEY(3, 2, KEY_M), \
+	KEY(3, 3, KEY_COMMA), \
+	KEY(3, 4, KEY_DOT), \
+	KEY(3, 5, KEY_SLASH), \
+	KEY(4, 0, KEY_F6), \
+	KEY(4, 1, KEY_F7), \
+	KEY(4, 2, KEY_F8), \
+	KEY(4, 3, KEY_F9), \
+	KEY(4, 4, KEY_F10), \
+	KEY(4, 5, KEY_NUMLOCK), \
+	KEY(5, 0, KEY_KP2), \
+	KEY(5, 1, KEY_KP3), \
+	KEY(5, 2, KEY_KP0), \
+	KEY(5, 3, KEY_KPDOT), \
+	KEY(5, 4, KEY_RO), \
+	KEY(5, 5, KEY_ZENKAKUHANKAKU), \
+}
+
 /**
  * struct kbd_platform_data - spear keyboard platform data
  * keymap: pointer to keymap data (table and size)
-- 
1.7.8.110.g4cb5d


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

* [PATCH 3/3] Input/spear-keyboard: Configure device according to supplied mode
  2012-02-23  9:12 [PATCH 1/3] Input/spear-keyboard: delete redundant key definitions from 9x9 keyboard Viresh Kumar
  2012-02-23  9:12 ` [PATCH 2/3] Input/spear-keyboard: Add 6x6 keypad matrix definitions Viresh Kumar
@ 2012-02-23  9:12 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-02-23  9:12 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux,
	bhavna.yadav, vincenzo.frascino, mirko.gardi

From: Rajeev Kumar <rajeev-dlh.kumar@st.com>

Let platform pass mode information to keyboard driver according to which
it configures itself. The mode can be
 - KEYPAD_9x9     0
 - KEYPAD_6x6     1
 - KEYPAD_2x2     2

Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 arch/arm/plat-spear/include/plat/keyboard.h |    6 ++++++
 drivers/input/keyboard/spear-keyboard.c     |    7 ++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h
index 130c045..c16cc31 100644
--- a/arch/arm/plat-spear/include/plat/keyboard.h
+++ b/arch/arm/plat-spear/include/plat/keyboard.h
@@ -140,10 +140,15 @@ int _name[] = { \
 	KEY(5, 5, KEY_ZENKAKUHANKAKU), \
 }
 
+#define KEYPAD_9x9     0
+#define KEYPAD_6x6     1
+#define KEYPAD_2x2     2
+
 /**
  * struct kbd_platform_data - spear keyboard platform data
  * keymap: pointer to keymap data (table and size)
  * rep: enables key autorepeat
+ * mode: choose keyboard support(9x9, 6x6, 2x2)
  *
  * This structure is supposed to be used by platform code to supply
  * keymaps to drivers that implement keyboards.
@@ -151,6 +156,7 @@ int _name[] = { \
 struct kbd_platform_data {
 	const struct matrix_keymap_data *keymap;
 	bool rep;
+	unsigned int mode;
 };
 
 /* This function is used to set platform data field of pdev->dev */
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index c88bd63..0e7f686 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -50,6 +50,7 @@
 #define ROW_MASK	0xF0
 #define COLUMN_MASK	0x0F
 #define ROW_SHIFT	4
+#define KEY_MATRIX_SHIFT	6
 
 struct spear_kbd {
 	struct input_dev *input;
@@ -58,6 +59,7 @@ struct spear_kbd {
 	struct clk *clk;
 	unsigned int irq;
 	unsigned short last_key;
+	unsigned int mode;
 	unsigned short keycodes[256];
 };
 
@@ -106,7 +108,8 @@ static int spear_kbd_open(struct input_dev *dev)
 		return error;
 
 	/* program keyboard */
-	val = SCAN_RATE_80 | MODE_KEYBOARD | PCLK_FREQ_MSK;
+	val = SCAN_RATE_80 | MODE_KEYBOARD | PCLK_FREQ_MSK |
+		(kbd->mode << KEY_MATRIX_SHIFT);
 	writew(val, kbd->io_base + MODE_REG);
 	writeb(1, kbd->io_base + STATUS_REG);
 
@@ -176,6 +179,8 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev)
 
 	kbd->input = input_dev;
 	kbd->irq = irq;
+	kbd->mode = pdata->mode;
+
 	kbd->res = request_mem_region(res->start, resource_size(res),
 				      pdev->name);
 	if (!kbd->res) {
-- 
1.7.8.110.g4cb5d


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

end of thread, other threads:[~2012-02-23  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-23  9:12 [PATCH 1/3] Input/spear-keyboard: delete redundant key definitions from 9x9 keyboard Viresh Kumar
2012-02-23  9:12 ` [PATCH 2/3] Input/spear-keyboard: Add 6x6 keypad matrix definitions Viresh Kumar
2012-02-23  9:12 ` [PATCH 3/3] Input/spear-keyboard: Configure device according to supplied mode Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.