Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294015
b: refs/heads/master
c: f8354c6
h: refs/heads/master
i:
  294013: 9b0a670
  294011: 89dacbb
  294007: 4ab01ae
  293999: 5485e24
  293983: 3633f76
  293951: a0b6489
  293887: 53b5c2f
v: v3
  • Loading branch information
Rajeev Kumar authored and Dmitry Torokhov committed Feb 28, 2012
1 parent cf3aa57 commit 6c666e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e238b548aac6227ce296d41364a3f7b10caff44
refs/heads/master: f8354c60ca2212810c168d8f992559226c8c0e71
6 changes: 6 additions & 0 deletions trunk/arch/arm/plat-spear/include/plat/keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,23 @@ 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.
*/
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 */
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/input/keyboard/spear-keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
#define ROW_MASK 0xF0
#define COLUMN_MASK 0x0F
#define ROW_SHIFT 4
#define KEY_MATRIX_SHIFT 6

struct spear_kbd {
struct input_dev *input;
struct resource *res;
void __iomem *io_base;
struct clk *clk;
unsigned int irq;
unsigned int mode;
unsigned short last_key;
unsigned short keycodes[256];
};
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6c666e7

Please sign in to comment.