aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5p64x0/mach-smdk6440.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6440.c')
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c54
1 files changed, 13 insertions, 41 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 2d559f10fd47..346f8dfa6f35 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.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 SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 51#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
51 S3C2410_UCON_RXILEVEL | \ 52 S3C2410_UCON_RXILEVEL | \
@@ -91,45 +92,6 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
91 }, 92 },
92}; 93};
93 94
94static int smdk6440_backlight_init(struct device *dev)
95{
96 int ret;
97
98 ret = gpio_request(S5P6440_GPF(15), "Backlight");
99 if (ret) {
100 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
101 return ret;
102 }
103
104 /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */
105 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_SFN(2));
106
107 return 0;
108}
109
110static void smdk6440_backlight_exit(struct device *dev)
111{
112 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT);
113 gpio_free(S5P6440_GPF(15));
114}
115
116static struct platform_pwm_backlight_data smdk6440_backlight_data = {
117 .pwm_id = 1,
118 .max_brightness = 255,
119 .dft_brightness = 255,
120 .pwm_period_ns = 78770,
121 .init = smdk6440_backlight_init,
122 .exit = smdk6440_backlight_exit,
123};
124
125static struct platform_device smdk6440_backlight_device = {
126 .name = "pwm-backlight",
127 .dev = {
128 .parent = &s3c_device_timer[1].dev,
129 .platform_data = &smdk6440_backlight_data,
130 },
131};
132
133static struct platform_device *smdk6440_devices[] __initdata = { 95static struct platform_device *smdk6440_devices[] __initdata = {
134 &s3c_device_adc, 96 &s3c_device_adc,
135 &s3c_device_rtc, 97 &s3c_device_rtc,
@@ -139,8 +101,6 @@ static struct platform_device *smdk6440_devices[] __initdata = {
139 &s3c_device_wdt, 101 &s3c_device_wdt,
140 &samsung_asoc_dma, 102 &samsung_asoc_dma,
141 &s5p6440_device_iis, 103 &s5p6440_device_iis,
142 &s3c_device_timer[1],
143 &smdk6440_backlight_device,
144}; 104};
145 105
146static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { 106static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -175,6 +135,16 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
175 .oversampling_shift = 2, 135 .oversampling_shift = 2,
176}; 136};
177 137
138/* LCD Backlight data */
139static struct samsung_bl_gpio_info smdk6440_bl_gpio_info = {
140 .no = S5P6440_GPF(15),
141 .func = S3C_GPIO_SFN(2),
142};
143
144static struct platform_pwm_backlight_data smdk6440_bl_data = {
145 .pwm_id = 1,
146};
147
178static void __init smdk6440_map_io(void) 148static void __init smdk6440_map_io(void)
179{ 149{
180 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 150 s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
@@ -194,6 +164,8 @@ static void __init smdk6440_machine_init(void)
194 i2c_register_board_info(1, smdk6440_i2c_devs1, 164 i2c_register_board_info(1, smdk6440_i2c_devs1,
195 ARRAY_SIZE(smdk6440_i2c_devs1)); 165 ARRAY_SIZE(smdk6440_i2c_devs1));
196 166
167 samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
168
197 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); 169 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
198} 170}
199 171