diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-10-19 21:40:32 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-10-19 21:40:32 -0400 |
commit | 79ed2a9216dd3cc35c4f2c5dbaddadb195af83ac (patch) | |
tree | b1567c167b4eeb60cd0a4f316012a637045b0168 /arch/sh/boards | |
parent | 25627c7fd71269e2658b6872eef65719ee80b9aa (diff) | |
parent | 843284d0e41b2a7f88504d051d91b5e9dc9c78c7 (diff) |
Merge branch 'sh/gpiolib'
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/Kconfig | 4 | ||||
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 100 | ||||
-rw-r--r-- | arch/sh/boards/board-magicpanelr2.c | 11 | ||||
-rw-r--r-- | arch/sh/boards/board-rsk7203.c | 11 | ||||
-rw-r--r-- | arch/sh/boards/mach-migor/lcd_qvga.c | 6 | ||||
-rw-r--r-- | arch/sh/boards/mach-migor/setup.c | 187 |
6 files changed, 223 insertions, 96 deletions
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig index c6b21e82755e..50467f9d0d0b 100644 --- a/arch/sh/boards/Kconfig +++ b/arch/sh/boards/Kconfig | |||
@@ -128,6 +128,7 @@ config SH_RTS7751R2D | |||
128 | 128 | ||
129 | config SH_RSK7203 | 129 | config SH_RSK7203 |
130 | bool "RSK7203" | 130 | bool "RSK7203" |
131 | select GENERIC_GPIO | ||
131 | depends on CPU_SUBTYPE_SH7203 | 132 | depends on CPU_SUBTYPE_SH7203 |
132 | 133 | ||
133 | config SH_SDK7780 | 134 | config SH_SDK7780 |
@@ -162,6 +163,7 @@ config SH_SH7785LCR_29BIT_PHYSMAPS | |||
162 | config SH_MIGOR | 163 | config SH_MIGOR |
163 | bool "Migo-R" | 164 | bool "Migo-R" |
164 | depends on CPU_SUBTYPE_SH7722 | 165 | depends on CPU_SUBTYPE_SH7722 |
166 | select GENERIC_GPIO | ||
165 | help | 167 | help |
166 | Select Migo-R if configuring for the SH7722 Migo-R platform | 168 | Select Migo-R if configuring for the SH7722 Migo-R platform |
167 | by Renesas System Solutions Asia Pte. Ltd. | 169 | by Renesas System Solutions Asia Pte. Ltd. |
@@ -169,6 +171,7 @@ config SH_MIGOR | |||
169 | config SH_AP325RXA | 171 | config SH_AP325RXA |
170 | bool "AP-325RXA" | 172 | bool "AP-325RXA" |
171 | depends on CPU_SUBTYPE_SH7723 | 173 | depends on CPU_SUBTYPE_SH7723 |
174 | select GENERIC_GPIO | ||
172 | help | 175 | help |
173 | Renesas "AP-325RXA" support. | 176 | Renesas "AP-325RXA" support. |
174 | Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" | 177 | Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" |
@@ -235,6 +238,7 @@ config SH_X3PROTO | |||
235 | config SH_MAGIC_PANEL_R2 | 238 | config SH_MAGIC_PANEL_R2 |
236 | bool "Magic Panel R2" | 239 | bool "Magic Panel R2" |
237 | depends on CPU_SUBTYPE_SH7720 | 240 | depends on CPU_SUBTYPE_SH7720 |
241 | select GENERIC_GPIO | ||
238 | help | 242 | help |
239 | Select Magic Panel R2 if configuring for Magic Panel R2. | 243 | Select Magic Panel R2 if configuring for Magic Panel R2. |
240 | 244 | ||
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 6abaf46a9835..84fa8a04eac4 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -18,11 +18,13 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/smc911x.h> | 20 | #include <linux/smc911x.h> |
21 | #include <linux/gpio.h> | ||
21 | #include <media/soc_camera_platform.h> | 22 | #include <media/soc_camera_platform.h> |
22 | #include <media/sh_mobile_ceu.h> | 23 | #include <media/sh_mobile_ceu.h> |
23 | #include <video/sh_mobile_lcdc.h> | 24 | #include <video/sh_mobile_lcdc.h> |
24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
25 | #include <asm/clock.h> | 26 | #include <asm/clock.h> |
27 | #include <asm/sh7723.h> | ||
26 | 28 | ||
27 | static struct smc911x_platdata smc911x_info = { | 29 | static struct smc911x_platdata smc911x_info = { |
28 | .flags = SMC911X_USE_32BIT, | 30 | .flags = SMC911X_USE_32BIT, |
@@ -109,17 +111,7 @@ static struct platform_device ap325rxa_nor_flash_device = { | |||
109 | #define FPGA_LCDREG 0xB4100180 | 111 | #define FPGA_LCDREG 0xB4100180 |
110 | #define FPGA_BKLREG 0xB4100212 | 112 | #define FPGA_BKLREG 0xB4100212 |
111 | #define FPGA_LCDREG_VAL 0x0018 | 113 | #define FPGA_LCDREG_VAL 0x0018 |
112 | #define PORT_PHCR 0xA405010E | ||
113 | #define PORT_PLCR 0xA4050114 | ||
114 | #define PORT_PMCR 0xA4050116 | ||
115 | #define PORT_PRCR 0xA405011C | ||
116 | #define PORT_PSCR 0xA405011E | ||
117 | #define PORT_PZCR 0xA405014C | ||
118 | #define PORT_HIZCRA 0xA4050158 | ||
119 | #define PORT_MSELCRB 0xA4050182 | 114 | #define PORT_MSELCRB 0xA4050182 |
120 | #define PORT_PSDR 0xA405013E | ||
121 | #define PORT_PZDR 0xA405016C | ||
122 | #define PORT_PSELD 0xA4050154 | ||
123 | 115 | ||
124 | static void ap320_wvga_power_on(void *board_data) | 116 | static void ap320_wvga_power_on(void *board_data) |
125 | { | 117 | { |
@@ -129,8 +121,7 @@ static void ap320_wvga_power_on(void *board_data) | |||
129 | ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG); | 121 | ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG); |
130 | 122 | ||
131 | /* backlight */ | 123 | /* backlight */ |
132 | ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR); | 124 | gpio_set_value(GPIO_PTS3, 0); |
133 | ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR); | ||
134 | ctrl_outw(0x100, FPGA_BKLREG); | 125 | ctrl_outw(0x100, FPGA_BKLREG); |
135 | } | 126 | } |
136 | 127 | ||
@@ -301,8 +292,77 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
301 | 292 | ||
302 | static int __init ap325rxa_devices_setup(void) | 293 | static int __init ap325rxa_devices_setup(void) |
303 | { | 294 | { |
304 | clk_always_enable("mstp200"); /* LCDC */ | 295 | /* LD3 and LD4 LEDs */ |
305 | clk_always_enable("mstp203"); /* CEU */ | 296 | gpio_request(GPIO_PTX5, NULL); /* RUN */ |
297 | gpio_direction_output(GPIO_PTX5, 1); | ||
298 | gpio_export(GPIO_PTX5, 0); | ||
299 | |||
300 | gpio_request(GPIO_PTX4, NULL); /* INDICATOR */ | ||
301 | gpio_direction_output(GPIO_PTX4, 0); | ||
302 | gpio_export(GPIO_PTX4, 0); | ||
303 | |||
304 | /* SW1 input */ | ||
305 | gpio_request(GPIO_PTF7, NULL); /* MODE */ | ||
306 | gpio_direction_input(GPIO_PTF7); | ||
307 | gpio_export(GPIO_PTF7, 0); | ||
308 | |||
309 | /* LCDC */ | ||
310 | clk_always_enable("mstp200"); | ||
311 | gpio_request(GPIO_FN_LCDD15, NULL); | ||
312 | gpio_request(GPIO_FN_LCDD14, NULL); | ||
313 | gpio_request(GPIO_FN_LCDD13, NULL); | ||
314 | gpio_request(GPIO_FN_LCDD12, NULL); | ||
315 | gpio_request(GPIO_FN_LCDD11, NULL); | ||
316 | gpio_request(GPIO_FN_LCDD10, NULL); | ||
317 | gpio_request(GPIO_FN_LCDD9, NULL); | ||
318 | gpio_request(GPIO_FN_LCDD8, NULL); | ||
319 | gpio_request(GPIO_FN_LCDD7, NULL); | ||
320 | gpio_request(GPIO_FN_LCDD6, NULL); | ||
321 | gpio_request(GPIO_FN_LCDD5, NULL); | ||
322 | gpio_request(GPIO_FN_LCDD4, NULL); | ||
323 | gpio_request(GPIO_FN_LCDD3, NULL); | ||
324 | gpio_request(GPIO_FN_LCDD2, NULL); | ||
325 | gpio_request(GPIO_FN_LCDD1, NULL); | ||
326 | gpio_request(GPIO_FN_LCDD0, NULL); | ||
327 | gpio_request(GPIO_FN_LCDLCLK_PTR, NULL); | ||
328 | gpio_request(GPIO_FN_LCDDCK, NULL); | ||
329 | gpio_request(GPIO_FN_LCDVEPWC, NULL); | ||
330 | gpio_request(GPIO_FN_LCDVCPWC, NULL); | ||
331 | gpio_request(GPIO_FN_LCDVSYN, NULL); | ||
332 | gpio_request(GPIO_FN_LCDHSYN, NULL); | ||
333 | gpio_request(GPIO_FN_LCDDISP, NULL); | ||
334 | gpio_request(GPIO_FN_LCDDON, NULL); | ||
335 | |||
336 | /* LCD backlight */ | ||
337 | gpio_request(GPIO_PTS3, NULL); | ||
338 | gpio_direction_output(GPIO_PTS3, 1); | ||
339 | |||
340 | /* CEU */ | ||
341 | clk_always_enable("mstp203"); | ||
342 | gpio_request(GPIO_FN_VIO_CLK2, NULL); | ||
343 | gpio_request(GPIO_FN_VIO_VD2, NULL); | ||
344 | gpio_request(GPIO_FN_VIO_HD2, NULL); | ||
345 | gpio_request(GPIO_FN_VIO_FLD, NULL); | ||
346 | gpio_request(GPIO_FN_VIO_CKO, NULL); | ||
347 | gpio_request(GPIO_FN_VIO_D15, NULL); | ||
348 | gpio_request(GPIO_FN_VIO_D14, NULL); | ||
349 | gpio_request(GPIO_FN_VIO_D13, NULL); | ||
350 | gpio_request(GPIO_FN_VIO_D12, NULL); | ||
351 | gpio_request(GPIO_FN_VIO_D11, NULL); | ||
352 | gpio_request(GPIO_FN_VIO_D10, NULL); | ||
353 | gpio_request(GPIO_FN_VIO_D9, NULL); | ||
354 | gpio_request(GPIO_FN_VIO_D8, NULL); | ||
355 | |||
356 | gpio_request(GPIO_PTZ7, NULL); | ||
357 | gpio_direction_output(GPIO_PTZ7, 0); /* OE_CAM */ | ||
358 | gpio_request(GPIO_PTZ6, NULL); | ||
359 | gpio_direction_output(GPIO_PTZ6, 0); /* STBY_CAM */ | ||
360 | gpio_request(GPIO_PTZ5, NULL); | ||
361 | gpio_direction_output(GPIO_PTZ5, 1); /* RST_CAM */ | ||
362 | gpio_request(GPIO_PTZ4, NULL); | ||
363 | gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */ | ||
364 | |||
365 | ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB); | ||
306 | 366 | ||
307 | platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20); | 367 | platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20); |
308 | 368 | ||
@@ -316,18 +376,6 @@ device_initcall(ap325rxa_devices_setup); | |||
316 | 376 | ||
317 | static void __init ap325rxa_setup(char **cmdline_p) | 377 | static void __init ap325rxa_setup(char **cmdline_p) |
318 | { | 378 | { |
319 | /* LCDC configuration */ | ||
320 | ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR); | ||
321 | ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR); | ||
322 | ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR); | ||
323 | ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR); | ||
324 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA); | ||
325 | |||
326 | /* CEU */ | ||
327 | ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0001, PORT_MSELCRB); | ||
328 | ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x0003, PORT_PSELD); | ||
329 | ctrl_outw((ctrl_inw(PORT_PZCR) & ~0xff00) | 0x5500, PORT_PZCR); | ||
330 | ctrl_outb((ctrl_inb(PORT_PZDR) & ~0xf0) | 0x20, PORT_PZDR); | ||
331 | } | 379 | } |
332 | 380 | ||
333 | static struct sh_machine_vector mv_ap325rxa __initmv = { | 381 | static struct sh_machine_vector mv_ap325rxa __initmv = { |
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c index f3b8b07ea5d6..eb0e8e992c29 100644 --- a/arch/sh/boards/board-magicpanelr2.c +++ b/arch/sh/boards/board-magicpanelr2.c | |||
@@ -13,12 +13,14 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/gpio.h> | ||
16 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/partitions.h> | 18 | #include <linux/mtd/partitions.h> |
18 | #include <linux/mtd/physmap.h> | 19 | #include <linux/mtd/physmap.h> |
19 | #include <linux/mtd/map.h> | 20 | #include <linux/mtd/map.h> |
20 | #include <asm/magicpanelr2.h> | 21 | #include <asm/magicpanelr2.h> |
21 | #include <asm/heartbeat.h> | 22 | #include <asm/heartbeat.h> |
23 | #include <asm/sh7720.h> | ||
22 | 24 | ||
23 | #define LAN9115_READY (ctrl_inl(0xA8000084UL) & 0x00000001UL) | 25 | #define LAN9115_READY (ctrl_inl(0xA8000084UL) & 0x00000001UL) |
24 | 26 | ||
@@ -170,7 +172,14 @@ static void __init setup_port_multiplexing(void) | |||
170 | /* R7 A25; R6 A24; R5 A23; R4 A22; | 172 | /* R7 A25; R6 A24; R5 A23; R4 A22; |
171 | * R3 A21; R2 A20; R1 A19; R0 A0; | 173 | * R3 A21; R2 A20; R1 A19; R0 A0; |
172 | */ | 174 | */ |
173 | ctrl_outw(0x0000, PORT_PRCR); /* 00 00 00 00 00 00 00 00 */ | 175 | gpio_request(GPIO_FN_A25, NULL); |
176 | gpio_request(GPIO_FN_A24, NULL); | ||
177 | gpio_request(GPIO_FN_A23, NULL); | ||
178 | gpio_request(GPIO_FN_A22, NULL); | ||
179 | gpio_request(GPIO_FN_A21, NULL); | ||
180 | gpio_request(GPIO_FN_A20, NULL); | ||
181 | gpio_request(GPIO_FN_A19, NULL); | ||
182 | gpio_request(GPIO_FN_A0, NULL); | ||
174 | 183 | ||
175 | /* S7 (x); S6 (x); S5 (x); S4 GPO(EEPROM_CS2); | 184 | /* S7 (x); S6 (x); S5 (x); S4 GPO(EEPROM_CS2); |
176 | * S3 GPO(EEPROM_CS1); S2 SIOF0_TXD; S1 SIOF0_RXD; S0 SIOF0_SCK; | 185 | * S3 GPO(EEPROM_CS1); S2 SIOF0_TXD; S1 SIOF0_RXD; S0 SIOF0_SCK; |
diff --git a/arch/sh/boards/board-rsk7203.c b/arch/sh/boards/board-rsk7203.c index ffbedc59a973..ded799cf3eae 100644 --- a/arch/sh/boards/board-rsk7203.c +++ b/arch/sh/boards/board-rsk7203.c | |||
@@ -16,8 +16,10 @@ | |||
16 | #include <linux/mtd/physmap.h> | 16 | #include <linux/mtd/physmap.h> |
17 | #include <linux/mtd/map.h> | 17 | #include <linux/mtd/map.h> |
18 | #include <linux/smc911x.h> | 18 | #include <linux/smc911x.h> |
19 | #include <linux/gpio.h> | ||
19 | #include <asm/machvec.h> | 20 | #include <asm/machvec.h> |
20 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | #include <asm/sh7203.h> | ||
21 | 23 | ||
22 | static struct smc911x_platdata smc911x_info = { | 24 | static struct smc911x_platdata smc911x_info = { |
23 | .flags = SMC911X_USE_16BIT, | 25 | .flags = SMC911X_USE_16BIT, |
@@ -122,6 +124,15 @@ static struct platform_device *rsk7203_devices[] __initdata = { | |||
122 | 124 | ||
123 | static int __init rsk7203_devices_setup(void) | 125 | static int __init rsk7203_devices_setup(void) |
124 | { | 126 | { |
127 | /* Select pins for SCIF0 */ | ||
128 | gpio_request(GPIO_FN_TXD0, NULL); | ||
129 | gpio_request(GPIO_FN_RXD0, NULL); | ||
130 | |||
131 | /* Lit LED0 */ | ||
132 | gpio_request(GPIO_PE10, NULL); | ||
133 | gpio_direction_output(GPIO_PE10, 0); | ||
134 | gpio_export(GPIO_PE10, 0); | ||
135 | |||
125 | set_mtd_partitions(); | 136 | set_mtd_partitions(); |
126 | return platform_add_devices(rsk7203_devices, | 137 | return platform_add_devices(rsk7203_devices, |
127 | ARRAY_SIZE(rsk7203_devices)); | 138 | ARRAY_SIZE(rsk7203_devices)); |
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c index 735326c04497..c283cfc2a5c3 100644 --- a/arch/sh/boards/mach-migor/lcd_qvga.c +++ b/arch/sh/boards/mach-migor/lcd_qvga.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/gpio.h> | ||
20 | #include <video/sh_mobile_lcdc.h> | 21 | #include <video/sh_mobile_lcdc.h> |
22 | #include <asm/sh7722.h> | ||
21 | #include <asm/migor.h> | 23 | #include <asm/migor.h> |
22 | 24 | ||
23 | /* LCD Module is a PH240320T according to board schematics. This module | 25 | /* LCD Module is a PH240320T according to board schematics. This module |
@@ -30,9 +32,9 @@ | |||
30 | 32 | ||
31 | static void reset_lcd_module(void) | 33 | static void reset_lcd_module(void) |
32 | { | 34 | { |
33 | ctrl_outb(ctrl_inb(PORT_PHDR) & ~0x04, PORT_PHDR); | 35 | gpio_set_value(GPIO_PTH2, 0); |
34 | mdelay(2); | 36 | mdelay(2); |
35 | ctrl_outb(ctrl_inb(PORT_PHDR) | 0x04, PORT_PHDR); | 37 | gpio_set_value(GPIO_PTH2, 1); |
36 | mdelay(1); | 38 | mdelay(1); |
37 | } | 39 | } |
38 | 40 | ||
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index f27475d2fa0c..003ce837734d 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/smc91x.h> | 17 | #include <linux/smc91x.h> |
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/gpio.h> | ||
20 | #include <media/soc_camera_platform.h> | 21 | #include <media/soc_camera_platform.h> |
21 | #include <media/sh_mobile_ceu.h> | 22 | #include <media/sh_mobile_ceu.h> |
22 | #include <video/sh_mobile_lcdc.h> | 23 | #include <video/sh_mobile_lcdc.h> |
@@ -25,6 +26,7 @@ | |||
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
26 | #include <asm/sh_keysc.h> | 27 | #include <asm/sh_keysc.h> |
27 | #include <asm/migor.h> | 28 | #include <asm/migor.h> |
29 | #include <asm/sh7722.h> | ||
28 | 30 | ||
29 | /* Address IRQ Size Bus Description | 31 | /* Address IRQ Size Bus Description |
30 | * 0x00000000 64MB 16 NOR Flash (SP29PL256N) | 32 | * 0x00000000 64MB 16 NOR Flash (SP29PL256N) |
@@ -169,7 +171,7 @@ static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd, | |||
169 | 171 | ||
170 | static int migor_nand_flash_ready(struct mtd_info *mtd) | 172 | static int migor_nand_flash_ready(struct mtd_info *mtd) |
171 | { | 173 | { |
172 | return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */ | 174 | return gpio_get_value(GPIO_PTA1); /* NAND_RBn */ |
173 | } | 175 | } |
174 | 176 | ||
175 | struct platform_nand_data migor_nand_flash_data = { | 177 | struct platform_nand_data migor_nand_flash_data = { |
@@ -286,22 +288,15 @@ static struct clk *camera_clk; | |||
286 | 288 | ||
287 | static void camera_power_on(void) | 289 | static void camera_power_on(void) |
288 | { | 290 | { |
289 | unsigned char value; | ||
290 | |||
291 | camera_clk = clk_get(NULL, "video_clk"); | 291 | camera_clk = clk_get(NULL, "video_clk"); |
292 | clk_set_rate(camera_clk, 24000000); | 292 | clk_set_rate(camera_clk, 24000000); |
293 | clk_enable(camera_clk); /* start VIO_CKO */ | 293 | clk_enable(camera_clk); /* start VIO_CKO */ |
294 | 294 | ||
295 | /* use VIO_RST to take camera out of reset */ | ||
295 | mdelay(10); | 296 | mdelay(10); |
296 | value = ctrl_inb(PORT_PTDR); | 297 | gpio_set_value(GPIO_PTT3, 0); |
297 | value &= ~0x09; | ||
298 | #ifndef CONFIG_SH_MIGOR_RTA_WVGA | ||
299 | value |= 0x01; | ||
300 | #endif | ||
301 | ctrl_outb(value, PORT_PTDR); | ||
302 | mdelay(10); | 298 | mdelay(10); |
303 | 299 | gpio_set_value(GPIO_PTT3, 1); | |
304 | ctrl_outb(value | 8, PORT_PTDR); | ||
305 | } | 300 | } |
306 | 301 | ||
307 | static void camera_power_off(void) | 302 | static void camera_power_off(void) |
@@ -309,7 +304,7 @@ static void camera_power_off(void) | |||
309 | clk_disable(camera_clk); /* stop VIO_CKO */ | 304 | clk_disable(camera_clk); /* stop VIO_CKO */ |
310 | clk_put(camera_clk); | 305 | clk_put(camera_clk); |
311 | 306 | ||
312 | ctrl_outb(ctrl_inb(PORT_PTDR) & ~0x08, PORT_PTDR); | 307 | gpio_set_value(GPIO_PTT3, 0); |
313 | } | 308 | } |
314 | 309 | ||
315 | #ifdef CONFIG_I2C | 310 | #ifdef CONFIG_I2C |
@@ -458,75 +453,133 @@ static struct i2c_board_info migor_i2c_devices[] = { | |||
458 | 453 | ||
459 | static int __init migor_devices_setup(void) | 454 | static int __init migor_devices_setup(void) |
460 | { | 455 | { |
456 | /* Lit D11 LED */ | ||
457 | gpio_request(GPIO_PTJ7, NULL); | ||
458 | gpio_direction_output(GPIO_PTJ7, 1); | ||
459 | gpio_export(GPIO_PTJ7, 0); | ||
460 | |||
461 | /* Lit D12 LED */ | ||
462 | gpio_request(GPIO_PTJ5, NULL); | ||
463 | gpio_direction_output(GPIO_PTJ5, 1); | ||
464 | gpio_export(GPIO_PTJ5, 0); | ||
465 | |||
466 | /* SMC91C111 */ | ||
467 | gpio_request(GPIO_FN_IRQ0, NULL); | ||
468 | |||
469 | /* KEYSC */ | ||
461 | clk_always_enable("mstp214"); /* KEYSC */ | 470 | clk_always_enable("mstp214"); /* KEYSC */ |
471 | gpio_request(GPIO_FN_KEYOUT0, NULL); | ||
472 | gpio_request(GPIO_FN_KEYOUT1, NULL); | ||
473 | gpio_request(GPIO_FN_KEYOUT2, NULL); | ||
474 | gpio_request(GPIO_FN_KEYOUT3, NULL); | ||
475 | gpio_request(GPIO_FN_KEYOUT4_IN6, NULL); | ||
476 | gpio_request(GPIO_FN_KEYIN1, NULL); | ||
477 | gpio_request(GPIO_FN_KEYIN2, NULL); | ||
478 | gpio_request(GPIO_FN_KEYIN3, NULL); | ||
479 | gpio_request(GPIO_FN_KEYIN4, NULL); | ||
480 | gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); | ||
481 | |||
482 | /* NAND Flash */ | ||
483 | gpio_request(GPIO_FN_CS6A_CE2B, NULL); | ||
484 | ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x0600) | 0x0200, BSC_CS6ABCR); | ||
485 | gpio_request(GPIO_PTA1, NULL); | ||
486 | gpio_direction_input(GPIO_PTA1); | ||
487 | |||
488 | /* Touch Panel */ | ||
489 | gpio_request(GPIO_FN_IRQ6, NULL); | ||
490 | |||
491 | /* LCD Panel */ | ||
462 | clk_always_enable("mstp200"); /* LCDC */ | 492 | clk_always_enable("mstp200"); /* LCDC */ |
493 | #ifdef CONFIG_SH_MIGOR_QVGA /* LCDC - QVGA - Enable SYS Interface signals */ | ||
494 | gpio_request(GPIO_FN_LCDD17, NULL); | ||
495 | gpio_request(GPIO_FN_LCDD16, NULL); | ||
496 | gpio_request(GPIO_FN_LCDD15, NULL); | ||
497 | gpio_request(GPIO_FN_LCDD14, NULL); | ||
498 | gpio_request(GPIO_FN_LCDD13, NULL); | ||
499 | gpio_request(GPIO_FN_LCDD12, NULL); | ||
500 | gpio_request(GPIO_FN_LCDD11, NULL); | ||
501 | gpio_request(GPIO_FN_LCDD10, NULL); | ||
502 | gpio_request(GPIO_FN_LCDD8, NULL); | ||
503 | gpio_request(GPIO_FN_LCDD7, NULL); | ||
504 | gpio_request(GPIO_FN_LCDD6, NULL); | ||
505 | gpio_request(GPIO_FN_LCDD5, NULL); | ||
506 | gpio_request(GPIO_FN_LCDD4, NULL); | ||
507 | gpio_request(GPIO_FN_LCDD3, NULL); | ||
508 | gpio_request(GPIO_FN_LCDD2, NULL); | ||
509 | gpio_request(GPIO_FN_LCDD1, NULL); | ||
510 | gpio_request(GPIO_FN_LCDRS, NULL); | ||
511 | gpio_request(GPIO_FN_LCDCS, NULL); | ||
512 | gpio_request(GPIO_FN_LCDRD, NULL); | ||
513 | gpio_request(GPIO_FN_LCDWR, NULL); | ||
514 | gpio_request(GPIO_PTH2, NULL); /* LCD_DON */ | ||
515 | gpio_direction_output(GPIO_PTH2, 1); | ||
516 | #endif | ||
517 | #ifdef CONFIG_SH_MIGOR_RTA_WVGA /* LCDC - WVGA - Enable RGB Interface signals */ | ||
518 | gpio_request(GPIO_FN_LCDD15, NULL); | ||
519 | gpio_request(GPIO_FN_LCDD14, NULL); | ||
520 | gpio_request(GPIO_FN_LCDD13, NULL); | ||
521 | gpio_request(GPIO_FN_LCDD12, NULL); | ||
522 | gpio_request(GPIO_FN_LCDD11, NULL); | ||
523 | gpio_request(GPIO_FN_LCDD10, NULL); | ||
524 | gpio_request(GPIO_FN_LCDD9, NULL); | ||
525 | gpio_request(GPIO_FN_LCDD8, NULL); | ||
526 | gpio_request(GPIO_FN_LCDD7, NULL); | ||
527 | gpio_request(GPIO_FN_LCDD6, NULL); | ||
528 | gpio_request(GPIO_FN_LCDD5, NULL); | ||
529 | gpio_request(GPIO_FN_LCDD4, NULL); | ||
530 | gpio_request(GPIO_FN_LCDD3, NULL); | ||
531 | gpio_request(GPIO_FN_LCDD2, NULL); | ||
532 | gpio_request(GPIO_FN_LCDD1, NULL); | ||
533 | gpio_request(GPIO_FN_LCDD0, NULL); | ||
534 | gpio_request(GPIO_FN_LCDLCLK, NULL); | ||
535 | gpio_request(GPIO_FN_LCDDCK, NULL); | ||
536 | gpio_request(GPIO_FN_LCDVEPWC, NULL); | ||
537 | gpio_request(GPIO_FN_LCDVCPWC, NULL); | ||
538 | gpio_request(GPIO_FN_LCDVSYN, NULL); | ||
539 | gpio_request(GPIO_FN_LCDHSYN, NULL); | ||
540 | gpio_request(GPIO_FN_LCDDISP, NULL); | ||
541 | gpio_request(GPIO_FN_LCDDON, NULL); | ||
542 | #endif | ||
543 | |||
544 | /* CEU */ | ||
463 | clk_always_enable("mstp203"); /* CEU */ | 545 | clk_always_enable("mstp203"); /* CEU */ |
546 | gpio_request(GPIO_FN_VIO_CLK2, NULL); | ||
547 | gpio_request(GPIO_FN_VIO_VD2, NULL); | ||
548 | gpio_request(GPIO_FN_VIO_HD2, NULL); | ||
549 | gpio_request(GPIO_FN_VIO_FLD, NULL); | ||
550 | gpio_request(GPIO_FN_VIO_CKO, NULL); | ||
551 | gpio_request(GPIO_FN_VIO_D15, NULL); | ||
552 | gpio_request(GPIO_FN_VIO_D14, NULL); | ||
553 | gpio_request(GPIO_FN_VIO_D13, NULL); | ||
554 | gpio_request(GPIO_FN_VIO_D12, NULL); | ||
555 | gpio_request(GPIO_FN_VIO_D11, NULL); | ||
556 | gpio_request(GPIO_FN_VIO_D10, NULL); | ||
557 | gpio_request(GPIO_FN_VIO_D9, NULL); | ||
558 | gpio_request(GPIO_FN_VIO_D8, NULL); | ||
559 | |||
560 | gpio_request(GPIO_PTT3, NULL); /* VIO_RST */ | ||
561 | gpio_direction_output(GPIO_PTT3, 0); | ||
562 | gpio_request(GPIO_PTT2, NULL); /* TV_IN_EN */ | ||
563 | gpio_direction_output(GPIO_PTT2, 1); | ||
564 | gpio_request(GPIO_PTT0, NULL); /* CAM_EN */ | ||
565 | #ifdef CONFIG_SH_MIGOR_RTA_WVGA | ||
566 | gpio_direction_output(GPIO_PTT0, 0); | ||
567 | #else | ||
568 | gpio_direction_output(GPIO_PTT0, 1); | ||
569 | #endif | ||
570 | ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2000, PORT_MSELCRB); /* D15->D8 */ | ||
464 | 571 | ||
465 | platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20); | 572 | platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20); |
466 | 573 | ||
467 | i2c_register_board_info(0, migor_i2c_devices, | 574 | i2c_register_board_info(0, migor_i2c_devices, |
468 | ARRAY_SIZE(migor_i2c_devices)); | 575 | ARRAY_SIZE(migor_i2c_devices)); |
469 | 576 | ||
470 | return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); | 577 | return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); |
471 | } | 578 | } |
472 | __initcall(migor_devices_setup); | 579 | __initcall(migor_devices_setup); |
473 | 580 | ||
474 | static void __init migor_setup(char **cmdline_p) | 581 | static void __init migor_setup(char **cmdline_p) |
475 | { | 582 | { |
476 | /* SMC91C111 - Enable IRQ0 */ | ||
477 | ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR); | ||
478 | |||
479 | /* KEYSC */ | ||
480 | ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR); | ||
481 | ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR); | ||
482 | ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA); | ||
483 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA); | ||
484 | ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC); | ||
485 | |||
486 | /* NAND Flash */ | ||
487 | ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR); | ||
488 | ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200, | ||
489 | BSC_CS6ABCR); | ||
490 | |||
491 | /* Touch Panel - Enable IRQ6 */ | ||
492 | ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR); | ||
493 | ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA); | ||
494 | ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC); | ||
495 | |||
496 | #ifdef CONFIG_SH_MIGOR_RTA_WVGA | ||
497 | /* LCDC - WVGA - Enable RGB Interface signals */ | ||
498 | ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR); | ||
499 | ctrl_outw(0x0000, PORT_PHCR); | ||
500 | ctrl_outw(0x0000, PORT_PLCR); | ||
501 | ctrl_outw(0x0000, PORT_PMCR); | ||
502 | ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x000f, PORT_PRCR); | ||
503 | ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x000d) | 0x0400, PORT_PSELD); | ||
504 | ctrl_outw(ctrl_inw(PORT_MSELCRB) & ~0x0100, PORT_MSELCRB); | ||
505 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA); | ||
506 | #endif | ||
507 | #ifdef CONFIG_SH_MIGOR_QVGA | ||
508 | /* LCDC - QVGA - Enable SYS Interface signals */ | ||
509 | ctrl_outw(ctrl_inw(PORT_PACR) & ~0x0003, PORT_PACR); | ||
510 | ctrl_outw((ctrl_inw(PORT_PHCR) & ~0xcfff) | 0x0010, PORT_PHCR); | ||
511 | ctrl_outw(0x0000, PORT_PLCR); | ||
512 | ctrl_outw(0x0000, PORT_PMCR); | ||
513 | ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x030f, PORT_PRCR); | ||
514 | ctrl_outw((ctrl_inw(PORT_PSELD) & ~0x0001) | 0x0420, PORT_PSELD); | ||
515 | ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x0100, PORT_MSELCRB); | ||
516 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01e0, PORT_HIZCRA); | ||
517 | #endif | ||
518 | |||
519 | /* CEU */ | ||
520 | ctrl_outw((ctrl_inw(PORT_PTCR) & ~0x03c3) | 0x0051, PORT_PTCR); | ||
521 | ctrl_outw(ctrl_inw(PORT_PUCR) & ~0x03ff, PORT_PUCR); | ||
522 | ctrl_outw(ctrl_inw(PORT_PVCR) & ~0x03ff, PORT_PVCR); | ||
523 | ctrl_outw(ctrl_inw(PORT_PWCR) & ~0x3c00, PORT_PWCR); | ||
524 | ctrl_outw(ctrl_inw(PORT_PSELC) | 0x0001, PORT_PSELC); | ||
525 | ctrl_outw(ctrl_inw(PORT_PSELD) & ~0x2000, PORT_PSELD); | ||
526 | ctrl_outw(ctrl_inw(PORT_PSELE) | 0x000f, PORT_PSELE); | ||
527 | ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2200, PORT_MSELCRB); | ||
528 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x0a00, PORT_HIZCRA); | ||
529 | ctrl_outw(ctrl_inw(PORT_HIZCRB) & ~0x0003, PORT_HIZCRB); | ||
530 | } | 583 | } |
531 | 584 | ||
532 | static struct sh_machine_vector mv_migor __initmv = { | 585 | static struct sh_machine_vector mv_migor __initmv = { |