diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-07-28 06:07:04 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 06:08:19 -0400 |
commit | 6968980a1bc0ba56dd8ef21c14577af3f2f9992b (patch) | |
tree | 681365bd68cde06a654915bdb1814447c9ee7bca /arch/sh | |
parent | 1765534c23596794385f309609c09642f33846e4 (diff) |
sh: SuperH Mobile LCDC platform data for AP325RXA
Add LCD panel platform data for the AP325RXA board.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/renesas/ap325rxa/setup.c | 81 |
1 files changed, 80 insertions, 1 deletions
diff --git a/arch/sh/boards/renesas/ap325rxa/setup.c b/arch/sh/boards/renesas/ap325rxa/setup.c index 333b15cd7952..db4e37d9c5b2 100644 --- a/arch/sh/boards/renesas/ap325rxa/setup.c +++ b/arch/sh/boards/renesas/ap325rxa/setup.c | |||
@@ -16,7 +16,10 @@ | |||
16 | #include <linux/mtd/physmap.h> | 16 | #include <linux/mtd/physmap.h> |
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/delay.h> | ||
20 | #include <asm/sh_mobile_lcdc.h> | ||
19 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | #include <asm/clock.h> | ||
20 | 23 | ||
21 | static struct resource smc9118_resources[] = { | 24 | static struct resource smc9118_resources[] = { |
22 | [0] = { | 25 | [0] = { |
@@ -79,9 +82,77 @@ static struct platform_device ap325rxa_nor_flash_device = { | |||
79 | }, | 82 | }, |
80 | }; | 83 | }; |
81 | 84 | ||
85 | #define FPGA_LCDREG 0xB4100180 | ||
86 | #define FPGA_BKLREG 0xB4100212 | ||
87 | #define FPGA_LCDREG_VAL 0x0018 | ||
88 | #define PORT_PHCR 0xA405010E | ||
89 | #define PORT_PLCR 0xA4050114 | ||
90 | #define PORT_PMCR 0xA4050116 | ||
91 | #define PORT_PRCR 0xA405011C | ||
92 | #define PORT_HIZCRA 0xA4050158 | ||
93 | #define PORT_PSCR 0xA405011E | ||
94 | #define PORT_PSDR 0xA405013E | ||
95 | |||
96 | static void ap320_wvga_power_on(void *board_data) | ||
97 | { | ||
98 | msleep(100); | ||
99 | |||
100 | /* ASD AP-320/325 LCD ON */ | ||
101 | ctrl_outw(FPGA_LCDREG_VAL, FPGA_LCDREG); | ||
102 | |||
103 | /* backlight */ | ||
104 | ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR); | ||
105 | ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR); | ||
106 | ctrl_outw(0x100, FPGA_BKLREG); | ||
107 | } | ||
108 | |||
109 | static struct sh_mobile_lcdc_info lcdc_info = { | ||
110 | .clock_source = LCDC_CLK_EXTERNAL, | ||
111 | .ch[0] = { | ||
112 | .chan = LCDC_CHAN_MAINLCD, | ||
113 | .bpp = 16, | ||
114 | .interface_type = RGB18, | ||
115 | .clock_divider = 1, | ||
116 | .lcd_cfg = { | ||
117 | .name = "LB070WV1", | ||
118 | .xres = 800, | ||
119 | .yres = 480, | ||
120 | .left_margin = 40, | ||
121 | .right_margin = 160, | ||
122 | .hsync_len = 8, | ||
123 | .upper_margin = 63, | ||
124 | .lower_margin = 80, | ||
125 | .vsync_len = 1, | ||
126 | .sync = 0, /* hsync and vsync are active low */ | ||
127 | }, | ||
128 | .board_cfg = { | ||
129 | .display_on = ap320_wvga_power_on, | ||
130 | }, | ||
131 | } | ||
132 | }; | ||
133 | |||
134 | static struct resource lcdc_resources[] = { | ||
135 | [0] = { | ||
136 | .name = "LCDC", | ||
137 | .start = 0xfe940000, /* P4-only space */ | ||
138 | .end = 0xfe941fff, | ||
139 | .flags = IORESOURCE_MEM, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static struct platform_device lcdc_device = { | ||
144 | .name = "sh_mobile_lcdc_fb", | ||
145 | .num_resources = ARRAY_SIZE(lcdc_resources), | ||
146 | .resource = lcdc_resources, | ||
147 | .dev = { | ||
148 | .platform_data = &lcdc_info, | ||
149 | }, | ||
150 | }; | ||
151 | |||
82 | static struct platform_device *ap325rxa_devices[] __initdata = { | 152 | static struct platform_device *ap325rxa_devices[] __initdata = { |
83 | &smc9118_device, | 153 | &smc9118_device, |
84 | &ap325rxa_nor_flash_device | 154 | &ap325rxa_nor_flash_device, |
155 | &lcdc_device, | ||
85 | }; | 156 | }; |
86 | 157 | ||
87 | static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | 158 | static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { |
@@ -89,6 +160,8 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
89 | 160 | ||
90 | static int __init ap325rxa_devices_setup(void) | 161 | static int __init ap325rxa_devices_setup(void) |
91 | { | 162 | { |
163 | clk_always_enable("mstp200"); /* LCDC */ | ||
164 | |||
92 | i2c_register_board_info(0, ap325rxa_i2c_devices, | 165 | i2c_register_board_info(0, ap325rxa_i2c_devices, |
93 | ARRAY_SIZE(ap325rxa_i2c_devices)); | 166 | ARRAY_SIZE(ap325rxa_i2c_devices)); |
94 | 167 | ||
@@ -99,6 +172,12 @@ device_initcall(ap325rxa_devices_setup); | |||
99 | 172 | ||
100 | static void __init ap325rxa_setup(char **cmdline_p) | 173 | static void __init ap325rxa_setup(char **cmdline_p) |
101 | { | 174 | { |
175 | /* LCDC configuration */ | ||
176 | ctrl_outw(ctrl_inw(PORT_PHCR) & ~0xffff, PORT_PHCR); | ||
177 | ctrl_outw(ctrl_inw(PORT_PLCR) & ~0xffff, PORT_PLCR); | ||
178 | ctrl_outw(ctrl_inw(PORT_PMCR) & ~0xffff, PORT_PMCR); | ||
179 | ctrl_outw(ctrl_inw(PORT_PRCR) & ~0x03ff, PORT_PRCR); | ||
180 | ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x01C0, PORT_HIZCRA); | ||
102 | } | 181 | } |
103 | 182 | ||
104 | static struct sh_machine_vector mv_ap325rxa __initmv = { | 183 | static struct sh_machine_vector mv_ap325rxa __initmv = { |