aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorMagnus Damm <magnus.damm@gmail.com>2008-03-04 18:23:45 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-04-18 12:50:01 -0400
commit92cfeb610d1da059b395501142915fadaa1625bf (patch)
tree921b037ba4e180699206a8501b7241917e30e9bc /arch/sh
parent795e6bf33561ff03e253a6a756d5eb663b4a56bd (diff)
sh: SuperH KEYSC keypad data for MigoR
Add KEYSC platform data for the sh7722 MigoR board. Signed-off-by: Magnus Damm <damm@igel.co.jp> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/boards/renesas/migor/setup.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c
index 21ab8c8fb590..8a6ee842624f 100644
--- a/arch/sh/boards/renesas/migor/setup.c
+++ b/arch/sh/boards/renesas/migor/setup.c
@@ -10,8 +10,10 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/input.h>
13#include <asm/machvec.h> 14#include <asm/machvec.h>
14#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/sh_keysc.h>
15 17
16/* Address IRQ Size Bus Description 18/* Address IRQ Size Bus Description
17 * 0x00000000 64MB 16 NOR Flash (SP29PL256N) 19 * 0x00000000 64MB 16 NOR Flash (SP29PL256N)
@@ -40,8 +42,43 @@ static struct platform_device smc91x_eth_device = {
40 .resource = smc91x_eth_resources, 42 .resource = smc91x_eth_resources,
41}; 43};
42 44
45static struct sh_keysc_info sh_keysc_info = {
46 .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
47 .scan_timing = 3,
48 .delay = 5,
49 .keycodes = {
50 0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
51 0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
52 0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
53 0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
54 0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
55 },
56};
57
58static struct resource sh_keysc_resources[] = {
59 [0] = {
60 .start = 0x044b0000,
61 .end = 0x044b000f,
62 .flags = IORESOURCE_MEM,
63 },
64 [1] = {
65 .start = 79,
66 .flags = IORESOURCE_IRQ,
67 },
68};
69
70static struct platform_device sh_keysc_device = {
71 .name = "sh_keysc",
72 .num_resources = ARRAY_SIZE(sh_keysc_resources),
73 .resource = sh_keysc_resources,
74 .dev = {
75 .platform_data = &sh_keysc_info,
76 },
77};
78
43static struct platform_device *migor_devices[] __initdata = { 79static struct platform_device *migor_devices[] __initdata = {
44 &smc91x_eth_device, 80 &smc91x_eth_device,
81 &sh_keysc_device,
45}; 82};
46 83
47static int __init migor_devices_setup(void) 84static int __init migor_devices_setup(void)
@@ -50,9 +87,26 @@ static int __init migor_devices_setup(void)
50} 87}
51__initcall(migor_devices_setup); 88__initcall(migor_devices_setup);
52 89
90#define PORT_PJCR 0xA4050110UL
91#define PORT_PSELA 0xA405014EUL
92#define PORT_PYCR 0xA405014AUL
93#define PORT_PZCR 0xA405014CUL
94#define PORT_HIZCRA 0xA4050158UL
95#define PORT_HIZCRC 0xA405015CUL
96#define MSTPCR2 0xA4150038UL
97
53static void __init migor_setup(char **cmdline_p) 98static void __init migor_setup(char **cmdline_p)
54{ 99{
55 ctrl_outw(0x1000, 0xa4050110); /* Enable IRQ0 in PJCR */ 100 /* SMC91C111 - Enable IRQ0 */
101 ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
102
103 /* KEYSC */
104 ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
105 ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
106 ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
107 ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
108 ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
109 ctrl_outl(ctrl_inl(MSTPCR2) & ~0x00004000, MSTPCR2);
56} 110}
57 111
58static struct sh_machine_vector mv_migor __initmv = { 112static struct sh_machine_vector mv_migor __initmv = {