diff options
-rw-r--r-- | arch/sh/boards/se/7722/setup.c | 41 | ||||
-rw-r--r-- | include/asm-sh/se7722.h | 2 |
2 files changed, 43 insertions, 0 deletions
diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c index b1a3d9d0172..33f6ee71f84 100644 --- a/arch/sh/boards/se/7722/setup.c +++ b/arch/sh/boards/se/7722/setup.c | |||
@@ -13,10 +13,12 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/ata_platform.h> | 15 | #include <linux/ata_platform.h> |
16 | #include <linux/input.h> | ||
16 | #include <asm/machvec.h> | 17 | #include <asm/machvec.h> |
17 | #include <asm/se7722.h> | 18 | #include <asm/se7722.h> |
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
19 | #include <asm/heartbeat.h> | 20 | #include <asm/heartbeat.h> |
21 | #include <asm/sh_keysc.h> | ||
20 | 22 | ||
21 | /* Heartbeat */ | 23 | /* Heartbeat */ |
22 | static struct heartbeat_data heartbeat_data = { | 24 | static struct heartbeat_data heartbeat_data = { |
@@ -92,10 +94,47 @@ static struct platform_device cf_ide_device = { | |||
92 | .resource = cf_ide_resources, | 94 | .resource = cf_ide_resources, |
93 | }; | 95 | }; |
94 | 96 | ||
97 | static struct sh_keysc_info sh_keysc_info = { | ||
98 | .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */ | ||
99 | .scan_timing = 3, | ||
100 | .delay = 5, | ||
101 | .keycodes = { /* SW1 -> SW30 */ | ||
102 | KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, | ||
103 | KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, | ||
104 | KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, | ||
105 | KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, | ||
106 | KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, | ||
107 | KEY_Z, | ||
108 | KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */ | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | static struct resource sh_keysc_resources[] = { | ||
113 | [0] = { | ||
114 | .start = 0x044b0000, | ||
115 | .end = 0x044b000f, | ||
116 | .flags = IORESOURCE_MEM, | ||
117 | }, | ||
118 | [1] = { | ||
119 | .start = 79, | ||
120 | .flags = IORESOURCE_IRQ, | ||
121 | }, | ||
122 | }; | ||
123 | |||
124 | static struct platform_device sh_keysc_device = { | ||
125 | .name = "sh_keysc", | ||
126 | .num_resources = ARRAY_SIZE(sh_keysc_resources), | ||
127 | .resource = sh_keysc_resources, | ||
128 | .dev = { | ||
129 | .platform_data = &sh_keysc_info, | ||
130 | }, | ||
131 | }; | ||
132 | |||
95 | static struct platform_device *se7722_devices[] __initdata = { | 133 | static struct platform_device *se7722_devices[] __initdata = { |
96 | &heartbeat_device, | 134 | &heartbeat_device, |
97 | &smc91x_eth_device, | 135 | &smc91x_eth_device, |
98 | &cf_ide_device, | 136 | &cf_ide_device, |
137 | &sh_keysc_device, | ||
99 | }; | 138 | }; |
100 | 139 | ||
101 | static int __init se7722_devices_setup(void) | 140 | static int __init se7722_devices_setup(void) |
@@ -136,6 +175,8 @@ static void __init se7722_setup(char **cmdline_p) | |||
136 | ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */ | 175 | ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */ |
137 | ctrl_outw(0x0000, PORT_PYCR); | 176 | ctrl_outw(0x0000, PORT_PYCR); |
138 | ctrl_outw(0x0000, PORT_PZCR); | 177 | ctrl_outw(0x0000, PORT_PZCR); |
178 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA); | ||
179 | ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC); | ||
139 | } | 180 | } |
140 | 181 | ||
141 | /* | 182 | /* |
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h index e0e89fcb838..3690fe5857a 100644 --- a/include/asm-sh/se7722.h +++ b/include/asm-sh/se7722.h | |||
@@ -77,6 +77,8 @@ | |||
77 | #define PORT_PSELA 0xA405014EUL | 77 | #define PORT_PSELA 0xA405014EUL |
78 | #define PORT_PYCR 0xA405014AUL | 78 | #define PORT_PYCR 0xA405014AUL |
79 | #define PORT_PZCR 0xA405014CUL | 79 | #define PORT_PZCR 0xA405014CUL |
80 | #define PORT_HIZCRA 0xA4050158UL | ||
81 | #define PORT_HIZCRC 0xA405015CUL | ||
80 | 82 | ||
81 | /* IRQ */ | 83 | /* IRQ */ |
82 | #define IRQ0_IRQ 32 | 84 | #define IRQ0_IRQ 32 |