diff options
author | Rajeev Kumar <rajeev-dlh.kumar@st.com> | 2012-02-24 03:51:40 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-02-28 04:18:32 -0500 |
commit | f8354c60ca2212810c168d8f992559226c8c0e71 (patch) | |
tree | a9d8d77c9e6c7e76fa982c757e0eb82d98024998 /drivers/input/keyboard/spear-keyboard.c | |
parent | 5e238b548aac6227ce296d41364a3f7b10caff44 (diff) |
Input: spear-keyboard - configure device according to supplied mode
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/spear-keyboard.c')
-rw-r--r-- | drivers/input/keyboard/spear-keyboard.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index c88bd63dc9cc..933fb019b967 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #define ROW_MASK 0xF0 | 50 | #define ROW_MASK 0xF0 |
51 | #define COLUMN_MASK 0x0F | 51 | #define COLUMN_MASK 0x0F |
52 | #define ROW_SHIFT 4 | 52 | #define ROW_SHIFT 4 |
53 | #define KEY_MATRIX_SHIFT 6 | ||
53 | 54 | ||
54 | struct spear_kbd { | 55 | struct spear_kbd { |
55 | struct input_dev *input; | 56 | struct input_dev *input; |
@@ -57,6 +58,7 @@ struct spear_kbd { | |||
57 | void __iomem *io_base; | 58 | void __iomem *io_base; |
58 | struct clk *clk; | 59 | struct clk *clk; |
59 | unsigned int irq; | 60 | unsigned int irq; |
61 | unsigned int mode; | ||
60 | unsigned short last_key; | 62 | unsigned short last_key; |
61 | unsigned short keycodes[256]; | 63 | unsigned short keycodes[256]; |
62 | }; | 64 | }; |
@@ -106,7 +108,8 @@ static int spear_kbd_open(struct input_dev *dev) | |||
106 | return error; | 108 | return error; |
107 | 109 | ||
108 | /* program keyboard */ | 110 | /* program keyboard */ |
109 | val = SCAN_RATE_80 | MODE_KEYBOARD | PCLK_FREQ_MSK; | 111 | val = SCAN_RATE_80 | MODE_KEYBOARD | PCLK_FREQ_MSK | |
112 | (kbd->mode << KEY_MATRIX_SHIFT); | ||
110 | writew(val, kbd->io_base + MODE_REG); | 113 | writew(val, kbd->io_base + MODE_REG); |
111 | writeb(1, kbd->io_base + STATUS_REG); | 114 | writeb(1, kbd->io_base + STATUS_REG); |
112 | 115 | ||
@@ -176,6 +179,8 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) | |||
176 | 179 | ||
177 | kbd->input = input_dev; | 180 | kbd->input = input_dev; |
178 | kbd->irq = irq; | 181 | kbd->irq = irq; |
182 | kbd->mode = pdata->mode; | ||
183 | |||
179 | kbd->res = request_mem_region(res->start, resource_size(res), | 184 | kbd->res = request_mem_region(res->start, resource_size(res), |
180 | pdev->name); | 185 | pdev->name); |
181 | if (!kbd->res) { | 186 | if (!kbd->res) { |