diff options
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6450.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/mach-smdk6450.c | 54 |
1 files changed, 13 insertions, 41 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c index d19c4690ee97..33f2adf8f3fe 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6450.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <plat/adc.h> | 46 | #include <plat/adc.h> |
47 | #include <plat/ts.h> | 47 | #include <plat/ts.h> |
48 | #include <plat/s5p-time.h> | 48 | #include <plat/s5p-time.h> |
49 | #include <plat/backlight.h> | ||
49 | 50 | ||
50 | #define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 51 | #define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
51 | S3C2410_UCON_RXILEVEL | \ | 52 | S3C2410_UCON_RXILEVEL | \ |
@@ -109,45 +110,6 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = { | |||
109 | #endif | 110 | #endif |
110 | }; | 111 | }; |
111 | 112 | ||
112 | static int smdk6450_backlight_init(struct device *dev) | ||
113 | { | ||
114 | int ret; | ||
115 | |||
116 | ret = gpio_request(S5P6450_GPF(15), "Backlight"); | ||
117 | if (ret) { | ||
118 | printk(KERN_ERR "failed to request GPF for PWM-OUT1\n"); | ||
119 | return ret; | ||
120 | } | ||
121 | |||
122 | /* Configure GPIO pin with S5P6450_GPF15_PWM_TOUT1 */ | ||
123 | s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_SFN(2)); | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
128 | static void smdk6450_backlight_exit(struct device *dev) | ||
129 | { | ||
130 | s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_OUTPUT); | ||
131 | gpio_free(S5P6450_GPF(15)); | ||
132 | } | ||
133 | |||
134 | static struct platform_pwm_backlight_data smdk6450_backlight_data = { | ||
135 | .pwm_id = 1, | ||
136 | .max_brightness = 255, | ||
137 | .dft_brightness = 255, | ||
138 | .pwm_period_ns = 78770, | ||
139 | .init = smdk6450_backlight_init, | ||
140 | .exit = smdk6450_backlight_exit, | ||
141 | }; | ||
142 | |||
143 | static struct platform_device smdk6450_backlight_device = { | ||
144 | .name = "pwm-backlight", | ||
145 | .dev = { | ||
146 | .parent = &s3c_device_timer[1].dev, | ||
147 | .platform_data = &smdk6450_backlight_data, | ||
148 | }, | ||
149 | }; | ||
150 | |||
151 | static struct platform_device *smdk6450_devices[] __initdata = { | 113 | static struct platform_device *smdk6450_devices[] __initdata = { |
152 | &s3c_device_adc, | 114 | &s3c_device_adc, |
153 | &s3c_device_rtc, | 115 | &s3c_device_rtc, |
@@ -157,8 +119,6 @@ static struct platform_device *smdk6450_devices[] __initdata = { | |||
157 | &s3c_device_wdt, | 119 | &s3c_device_wdt, |
158 | &samsung_asoc_dma, | 120 | &samsung_asoc_dma, |
159 | &s5p6450_device_iis0, | 121 | &s5p6450_device_iis0, |
160 | &s3c_device_timer[1], | ||
161 | &smdk6450_backlight_device, | ||
162 | /* s5p6450_device_spi0 will be added */ | 122 | /* s5p6450_device_spi0 will be added */ |
163 | }; | 123 | }; |
164 | 124 | ||
@@ -194,6 +154,16 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { | |||
194 | .oversampling_shift = 2, | 154 | .oversampling_shift = 2, |
195 | }; | 155 | }; |
196 | 156 | ||
157 | /* LCD Backlight data */ | ||
158 | static struct samsung_bl_gpio_info smdk6450_bl_gpio_info = { | ||
159 | .no = S5P6450_GPF(15), | ||
160 | .func = S3C_GPIO_SFN(2), | ||
161 | }; | ||
162 | |||
163 | static struct platform_pwm_backlight_data smdk6450_bl_data = { | ||
164 | .pwm_id = 1, | ||
165 | }; | ||
166 | |||
197 | static void __init smdk6450_map_io(void) | 167 | static void __init smdk6450_map_io(void) |
198 | { | 168 | { |
199 | s5p_init_io(NULL, 0, S5P64X0_SYS_ID); | 169 | s5p_init_io(NULL, 0, S5P64X0_SYS_ID); |
@@ -213,6 +183,8 @@ static void __init smdk6450_machine_init(void) | |||
213 | i2c_register_board_info(1, smdk6450_i2c_devs1, | 183 | i2c_register_board_info(1, smdk6450_i2c_devs1, |
214 | ARRAY_SIZE(smdk6450_i2c_devs1)); | 184 | ARRAY_SIZE(smdk6450_i2c_devs1)); |
215 | 185 | ||
186 | samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data); | ||
187 | |||
216 | platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); | 188 | platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); |
217 | } | 189 | } |
218 | 190 | ||