diff options
Diffstat (limited to 'arch/arm/mach-omap1/board-fsample.c')
-rw-r--r-- | arch/arm/mach-omap1/board-fsample.c | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 149fdd32e127..0efb9dbae44c 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -69,36 +69,35 @@ | |||
69 | #define fsample_cpld_clear(bit) \ | 69 | #define fsample_cpld_clear(bit) \ |
70 | fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) | 70 | fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) |
71 | 71 | ||
72 | static int fsample_keymap[] = { | 72 | static const unsigned int fsample_keymap[] = { |
73 | KEY(0,0,KEY_UP), | 73 | KEY(0, 0, KEY_UP), |
74 | KEY(0,1,KEY_RIGHT), | 74 | KEY(1, 0, KEY_RIGHT), |
75 | KEY(0,2,KEY_LEFT), | 75 | KEY(2, 0, KEY_LEFT), |
76 | KEY(0,3,KEY_DOWN), | 76 | KEY(3, 0, KEY_DOWN), |
77 | KEY(0,4,KEY_ENTER), | 77 | KEY(4, 0, KEY_ENTER), |
78 | KEY(1,0,KEY_F10), | 78 | KEY(0, 1, KEY_F10), |
79 | KEY(1,1,KEY_SEND), | 79 | KEY(1, 1, KEY_SEND), |
80 | KEY(1,2,KEY_END), | 80 | KEY(2, 1, KEY_END), |
81 | KEY(1,3,KEY_VOLUMEDOWN), | 81 | KEY(3, 1, KEY_VOLUMEDOWN), |
82 | KEY(1,4,KEY_VOLUMEUP), | 82 | KEY(4, 1, KEY_VOLUMEUP), |
83 | KEY(1,5,KEY_RECORD), | 83 | KEY(5, 1, KEY_RECORD), |
84 | KEY(2,0,KEY_F9), | 84 | KEY(0, 2, KEY_F9), |
85 | KEY(2,1,KEY_3), | 85 | KEY(1, 2, KEY_3), |
86 | KEY(2,2,KEY_6), | 86 | KEY(2, 2, KEY_6), |
87 | KEY(2,3,KEY_9), | 87 | KEY(3, 2, KEY_9), |
88 | KEY(2,4,KEY_KPDOT), | 88 | KEY(4, 2, KEY_KPDOT), |
89 | KEY(3,0,KEY_BACK), | 89 | KEY(0, 3, KEY_BACK), |
90 | KEY(3,1,KEY_2), | 90 | KEY(1, 3, KEY_2), |
91 | KEY(3,2,KEY_5), | 91 | KEY(2, 3, KEY_5), |
92 | KEY(3,3,KEY_8), | 92 | KEY(3, 3, KEY_8), |
93 | KEY(3,4,KEY_0), | 93 | KEY(4, 3, KEY_0), |
94 | KEY(3,5,KEY_KPSLASH), | 94 | KEY(5, 3, KEY_KPSLASH), |
95 | KEY(4,0,KEY_HOME), | 95 | KEY(0, 4, KEY_HOME), |
96 | KEY(4,1,KEY_1), | 96 | KEY(1, 4, KEY_1), |
97 | KEY(4,2,KEY_4), | 97 | KEY(2, 4, KEY_4), |
98 | KEY(4,3,KEY_7), | 98 | KEY(3, 4, KEY_7), |
99 | KEY(4,4,KEY_KPASTERISK), | 99 | KEY(4, 4, KEY_KPASTERISK), |
100 | KEY(4,5,KEY_POWER), | 100 | KEY(5, 4, KEY_POWER), |
101 | 0 | ||
102 | }; | 101 | }; |
103 | 102 | ||
104 | static struct smc91x_platdata smc91x_info = { | 103 | static struct smc91x_platdata smc91x_info = { |
@@ -120,6 +119,15 @@ static struct resource smc91x_resources[] = { | |||
120 | }, | 119 | }, |
121 | }; | 120 | }; |
122 | 121 | ||
122 | static void __init fsample_init_smc91x(void) | ||
123 | { | ||
124 | fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); | ||
125 | mdelay(50); | ||
126 | fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, | ||
127 | H2P2_DBG_FPGA_LAN_RESET); | ||
128 | mdelay(50); | ||
129 | } | ||
130 | |||
123 | static struct mtd_partition nor_partitions[] = { | 131 | static struct mtd_partition nor_partitions[] = { |
124 | /* bootloader (U-Boot, etc) in first sector */ | 132 | /* bootloader (U-Boot, etc) in first sector */ |
125 | { | 133 | { |
@@ -244,11 +252,15 @@ static struct resource kp_resources[] = { | |||
244 | }, | 252 | }, |
245 | }; | 253 | }; |
246 | 254 | ||
255 | static const struct matrix_keymap_data fsample_keymap_data = { | ||
256 | .keymap = fsample_keymap, | ||
257 | .keymap_size = ARRAY_SIZE(fsample_keymap), | ||
258 | }; | ||
259 | |||
247 | static struct omap_kp_platform_data kp_data = { | 260 | static struct omap_kp_platform_data kp_data = { |
248 | .rows = 8, | 261 | .rows = 8, |
249 | .cols = 8, | 262 | .cols = 8, |
250 | .keymap = fsample_keymap, | 263 | .keymap_data = &fsample_keymap_data, |
251 | .keymapsize = ARRAY_SIZE(fsample_keymap), | ||
252 | .delay = 4, | 264 | .delay = 4, |
253 | }; | 265 | }; |
254 | 266 | ||
@@ -285,6 +297,8 @@ static struct omap_board_config_kernel fsample_config[] = { | |||
285 | 297 | ||
286 | static void __init omap_fsample_init(void) | 298 | static void __init omap_fsample_init(void) |
287 | { | 299 | { |
300 | fsample_init_smc91x(); | ||
301 | |||
288 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 302 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
289 | BUG(); | 303 | BUG(); |
290 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); | 304 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); |
@@ -312,21 +326,10 @@ static void __init omap_fsample_init(void) | |||
312 | omap_register_i2c_bus(1, 100, NULL, 0); | 326 | omap_register_i2c_bus(1, 100, NULL, 0); |
313 | } | 327 | } |
314 | 328 | ||
315 | static void __init fsample_init_smc91x(void) | ||
316 | { | ||
317 | fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); | ||
318 | mdelay(50); | ||
319 | fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, | ||
320 | H2P2_DBG_FPGA_LAN_RESET); | ||
321 | mdelay(50); | ||
322 | } | ||
323 | |||
324 | static void __init omap_fsample_init_irq(void) | 329 | static void __init omap_fsample_init_irq(void) |
325 | { | 330 | { |
326 | omap1_init_common_hw(); | 331 | omap1_init_common_hw(); |
327 | omap_init_irq(); | 332 | omap_init_irq(); |
328 | omap_gpio_init(); | ||
329 | fsample_init_smc91x(); | ||
330 | } | 333 | } |
331 | 334 | ||
332 | /* Only FPGA needs to be mapped here. All others are done with ioremap */ | 335 | /* Only FPGA needs to be mapped here. All others are done with ioremap */ |