aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/mach-smdk6410.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-smdk6410.c')
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c82
1 files changed, 20 insertions, 62 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 2c0353a8090..a9f3183e029 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -48,7 +48,6 @@
48#include <asm/mach/irq.h> 48#include <asm/mach/irq.h>
49 49
50#include <mach/hardware.h> 50#include <mach/hardware.h>
51#include <mach/regs-fb.h>
52#include <mach/map.h> 51#include <mach/map.h>
53 52
54#include <asm/irq.h> 53#include <asm/irq.h>
@@ -71,6 +70,8 @@
71#include <plat/adc.h> 70#include <plat/adc.h>
72#include <plat/ts.h> 71#include <plat/ts.h>
73#include <plat/keypad.h> 72#include <plat/keypad.h>
73#include <plat/backlight.h>
74#include <plat/regs-fb-v4.h>
74 75
75#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 76#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
76#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 77#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -209,17 +210,9 @@ static struct platform_device smdk6410_smsc911x = {
209}; 210};
210 211
211#ifdef CONFIG_REGULATOR 212#ifdef CONFIG_REGULATOR
212static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = { 213static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] __initdata = {
213 { 214 REGULATOR_SUPPLY("PVDD", "0-001b"),
214 /* WM8580 */ 215 REGULATOR_SUPPLY("AVDD", "0-001b"),
215 .supply = "PVDD",
216 .dev_name = "0-001b",
217 },
218 {
219 /* WM8580 */
220 .supply = "AVDD",
221 .dev_name = "0-001b",
222 },
223}; 216};
224 217
225static struct regulator_init_data smdk6410_b_pwr_5v_data = { 218static struct regulator_init_data smdk6410_b_pwr_5v_data = {
@@ -269,45 +262,6 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
269 .cols = 8, 262 .cols = 8,
270}; 263};
271 264
272static int smdk6410_backlight_init(struct device *dev)
273{
274 int ret;
275
276 ret = gpio_request(S3C64XX_GPF(15), "Backlight");
277 if (ret) {
278 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
279 return ret;
280 }
281
282 /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
283 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
284
285 return 0;
286}
287
288static void smdk6410_backlight_exit(struct device *dev)
289{
290 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
291 gpio_free(S3C64XX_GPF(15));
292}
293
294static struct platform_pwm_backlight_data smdk6410_backlight_data = {
295 .pwm_id = 1,
296 .max_brightness = 255,
297 .dft_brightness = 255,
298 .pwm_period_ns = 78770,
299 .init = smdk6410_backlight_init,
300 .exit = smdk6410_backlight_exit,
301};
302
303static struct platform_device smdk6410_backlight_device = {
304 .name = "pwm-backlight",
305 .dev = {
306 .parent = &s3c_device_timer[1].dev,
307 .platform_data = &smdk6410_backlight_data,
308 },
309};
310
311static struct map_desc smdk6410_iodesc[] = {}; 265static struct map_desc smdk6410_iodesc[] = {};
312 266
313static struct platform_device *smdk6410_devices[] __initdata = { 267static struct platform_device *smdk6410_devices[] __initdata = {
@@ -337,16 +291,12 @@ static struct platform_device *smdk6410_devices[] __initdata = {
337 &s3c_device_rtc, 291 &s3c_device_rtc,
338 &s3c_device_ts, 292 &s3c_device_ts,
339 &s3c_device_wdt, 293 &s3c_device_wdt,
340 &s3c_device_timer[1],
341 &smdk6410_backlight_device,
342}; 294};
343 295
344#ifdef CONFIG_REGULATOR 296#ifdef CONFIG_REGULATOR
345/* ARM core */ 297/* ARM core */
346static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = { 298static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = {
347 { 299 REGULATOR_SUPPLY("vddarm", NULL),
348 .supply = "vddarm",
349 }
350}; 300};
351 301
352/* VDDARM, BUCK1 on J5 */ 302/* VDDARM, BUCK1 on J5 */
@@ -484,11 +434,7 @@ static struct regulator_init_data wm8350_dcdc3_data = {
484 434
485/* USB, EXT, PCM, ADC/DAC, USB, MMC */ 435/* USB, EXT, PCM, ADC/DAC, USB, MMC */
486static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = { 436static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
487 { 437 REGULATOR_SUPPLY("DVDD", "0-001b"),
488 /* WM8580 */
489 .supply = "DVDD",
490 .dev_name = "0-001b",
491 },
492}; 438};
493 439
494static struct regulator_init_data wm8350_dcdc4_data = { 440static struct regulator_init_data wm8350_dcdc4_data = {
@@ -599,7 +545,7 @@ static struct regulator_init_data wm1192_dcdc3 = {
599}; 545};
600 546
601static struct regulator_consumer_supply wm1192_ldo1_consumers[] = { 547static struct regulator_consumer_supply wm1192_ldo1_consumers[] = {
602 { .supply = "DVDD", .dev_name = "0-001b", }, /* WM8580 */ 548 REGULATOR_SUPPLY("DVDD", "0-001b"), /* WM8580 */
603}; 549};
604 550
605static struct regulator_init_data wm1192_ldo1 = { 551static struct regulator_init_data wm1192_ldo1 = {
@@ -679,6 +625,16 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
679 .oversampling_shift = 2, 625 .oversampling_shift = 2,
680}; 626};
681 627
628/* LCD Backlight data */
629static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
630 .no = S3C64XX_GPF(15),
631 .func = S3C_GPIO_SFN(2),
632};
633
634static struct platform_pwm_backlight_data smdk6410_bl_data = {
635 .pwm_id = 1,
636};
637
682static void __init smdk6410_map_io(void) 638static void __init smdk6410_map_io(void)
683{ 639{
684 u32 tmp; 640 u32 tmp;
@@ -740,6 +696,8 @@ static void __init smdk6410_machine_init(void)
740 696
741 s3c_ide_set_platdata(&smdk6410_ide_pdata); 697 s3c_ide_set_platdata(&smdk6410_ide_pdata);
742 698
699 samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
700
743 platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); 701 platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
744} 702}
745 703