diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-03 02:29:44 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-18 05:46:30 -0400 |
commit | f64bea4318a73e833d0a9b8400cc0f6cee957da3 (patch) | |
tree | 7ea2a44b745039041029acb5ecb2b83dae0a7cf4 /arch/arm/mach-s3c2416/mach-smdk2416.c | |
parent | f077f3fc055b329787783a1ab0efb9a8f8ecc874 (diff) |
ARM: SMDK2416: Add support for framebuffer device and ensure correct setup
Add support for the LCD display on the SMDJK2416, and correctly name the
framebuffer device.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2416/mach-smdk2416.c')
-rw-r--r-- | arch/arm/mach-s3c2416/mach-smdk2416.c | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c index 99d24c44f30f..5fc3f67ef265 100644 --- a/arch/arm/mach-s3c2416/mach-smdk2416.c +++ b/arch/arm/mach-s3c2416/mach-smdk2416.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/fb.h> | ||
25 | 26 | ||
26 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
@@ -36,16 +37,19 @@ | |||
36 | #include <mach/regs-lcd.h> | 37 | #include <mach/regs-lcd.h> |
37 | 38 | ||
38 | #include <mach/idle.h> | 39 | #include <mach/idle.h> |
39 | #include <mach/fb.h> | ||
40 | #include <mach/leds-gpio.h> | 40 | #include <mach/leds-gpio.h> |
41 | #include <plat/iic.h> | 41 | #include <plat/iic.h> |
42 | 42 | ||
43 | #include <plat/s3c2416.h> | 43 | #include <plat/s3c2416.h> |
44 | #include <plat/gpio-cfg.h> | ||
44 | #include <plat/clock.h> | 45 | #include <plat/clock.h> |
45 | #include <plat/devs.h> | 46 | #include <plat/devs.h> |
46 | #include <plat/cpu.h> | 47 | #include <plat/cpu.h> |
47 | #include <plat/nand.h> | 48 | #include <plat/nand.h> |
48 | 49 | ||
50 | #include <plat/regs-fb-v4.h> | ||
51 | #include <plat/fb.h> | ||
52 | |||
49 | #include <plat/common-smdk.h> | 53 | #include <plat/common-smdk.h> |
50 | 54 | ||
51 | static struct map_desc smdk2416_iodesc[] __initdata = { | 55 | static struct map_desc smdk2416_iodesc[] __initdata = { |
@@ -109,7 +113,54 @@ static struct s3c2410_uartcfg smdk2416_uartcfgs[] __initdata = { | |||
109 | } | 113 | } |
110 | }; | 114 | }; |
111 | 115 | ||
116 | struct s3c_fb_pd_win smdk2416_fb_win[] = { | ||
117 | [0] = { | ||
118 | /* think this is the same as the smdk6410 */ | ||
119 | .win_mode = { | ||
120 | .pixclock = 41094, | ||
121 | .left_margin = 8, | ||
122 | .right_margin = 13, | ||
123 | .upper_margin = 7, | ||
124 | .lower_margin = 5, | ||
125 | .hsync_len = 3, | ||
126 | .vsync_len = 1, | ||
127 | .xres = 800, | ||
128 | .yres = 480, | ||
129 | }, | ||
130 | .default_bpp = 16, | ||
131 | .max_bpp = 32, | ||
132 | }, | ||
133 | }; | ||
134 | |||
135 | static void s3c2416_fb_gpio_setup_24bpp(void) | ||
136 | { | ||
137 | unsigned int gpio; | ||
138 | |||
139 | for (gpio = S3C2410_GPC(1); gpio <= S3C2410_GPC(4); gpio++) { | ||
140 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
141 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
142 | } | ||
143 | |||
144 | for (gpio = S3C2410_GPC(8); gpio <= S3C2410_GPC(15); gpio++) { | ||
145 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
146 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
147 | } | ||
148 | |||
149 | for (gpio = S3C2410_GPD(0); gpio <= S3C2410_GPD(15); gpio++) { | ||
150 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
151 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
152 | } | ||
153 | } | ||
154 | |||
155 | static struct s3c_fb_platdata smdk2416_fb_platdata = { | ||
156 | .win[0] = &smdk2416_fb_win[0], | ||
157 | .setup_gpio = s3c2416_fb_gpio_setup_24bpp, | ||
158 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, | ||
159 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, | ||
160 | }; | ||
161 | |||
112 | static struct platform_device *smdk2416_devices[] __initdata = { | 162 | static struct platform_device *smdk2416_devices[] __initdata = { |
163 | &s3c_device_fb, | ||
113 | &s3c_device_wdt, | 164 | &s3c_device_wdt, |
114 | &s3c_device_ohci, | 165 | &s3c_device_ohci, |
115 | &s3c_device_i2c0, | 166 | &s3c_device_i2c0, |
@@ -119,20 +170,25 @@ static struct platform_device *smdk2416_devices[] __initdata = { | |||
119 | 170 | ||
120 | static void __init smdk2416_map_io(void) | 171 | static void __init smdk2416_map_io(void) |
121 | { | 172 | { |
122 | |||
123 | s3c24xx_init_io(smdk2416_iodesc, ARRAY_SIZE(smdk2416_iodesc)); | 173 | s3c24xx_init_io(smdk2416_iodesc, ARRAY_SIZE(smdk2416_iodesc)); |
124 | s3c24xx_init_clocks(12000000); | 174 | s3c24xx_init_clocks(12000000); |
125 | s3c24xx_init_uarts(smdk2416_uartcfgs, ARRAY_SIZE(smdk2416_uartcfgs)); | 175 | s3c24xx_init_uarts(smdk2416_uartcfgs, ARRAY_SIZE(smdk2416_uartcfgs)); |
126 | |||
127 | } | 176 | } |
128 | 177 | ||
129 | static void __init smdk2416_machine_init(void) | 178 | static void __init smdk2416_machine_init(void) |
130 | { | 179 | { |
131 | s3c_i2c0_set_platdata(NULL); | 180 | s3c_i2c0_set_platdata(NULL); |
181 | s3c_fb_set_platdata(&smdk2416_fb_platdata); | ||
132 | 182 | ||
133 | gpio_request(S3C2410_GPB(4), "USBHost Power"); | 183 | gpio_request(S3C2410_GPB(4), "USBHost Power"); |
134 | gpio_direction_output(S3C2410_GPB(4), 1); | 184 | gpio_direction_output(S3C2410_GPB(4), 1); |
135 | 185 | ||
186 | gpio_request(S3C2410_GPB(3), "Display Power"); | ||
187 | gpio_direction_output(S3C2410_GPB(3), 1); | ||
188 | |||
189 | gpio_request(S3C2410_GPB(1), "Display Reset"); | ||
190 | gpio_direction_output(S3C2410_GPB(1), 1); | ||
191 | |||
136 | platform_add_devices(smdk2416_devices, ARRAY_SIZE(smdk2416_devices)); | 192 | platform_add_devices(smdk2416_devices, ARRAY_SIZE(smdk2416_devices)); |
137 | smdk_machine_init(); | 193 | smdk_machine_init(); |
138 | } | 194 | } |