aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5p64x0
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-03-11 01:48:52 -0500
committerKukjin Kim <kgene.kim@samsung.com>2011-03-11 01:48:52 -0500
commit6d2f42cc275ba72a47ce6933b18480163ecf2740 (patch)
treeb986e612edd1d44fa64874601712060970308290 /arch/arm/mach-s5p64x0
parenta9518cde232960875a1f03ba00c112f56872cf60 (diff)
parent5cd435b4ab881280fb0b8ce6686cfceb005d98c8 (diff)
Merge branch 'dev/pwm-backlight' into for-next
Conflicts: arch/arm/mach-s3c64xx/mach-smdk6410.c
Diffstat (limited to 'arch/arm/mach-s5p64x0')
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig2
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c43
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c43
3 files changed, 88 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 164d2783d381..08b0a5bf1d60 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -34,6 +34,7 @@ config MACH_SMDK6440
34 select S3C_DEV_WDT 34 select S3C_DEV_WDT
35 select S3C64XX_DEV_SPI 35 select S3C64XX_DEV_SPI
36 select SAMSUNG_DEV_ADC 36 select SAMSUNG_DEV_ADC
37 select SAMSUNG_DEV_PWM
37 select SAMSUNG_DEV_TS 38 select SAMSUNG_DEV_TS
38 select S5P64X0_SETUP_I2C1 39 select S5P64X0_SETUP_I2C1
39 help 40 help
@@ -47,6 +48,7 @@ config MACH_SMDK6450
47 select S3C_DEV_WDT 48 select S3C_DEV_WDT
48 select S3C64XX_DEV_SPI 49 select S3C64XX_DEV_SPI
49 select SAMSUNG_DEV_ADC 50 select SAMSUNG_DEV_ADC
51 select SAMSUNG_DEV_PWM
50 select SAMSUNG_DEV_TS 52 select SAMSUNG_DEV_TS
51 select S5P64X0_SETUP_I2C1 53 select S5P64X0_SETUP_I2C1
52 help 54 help
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index e5beb84e2393..366dca4ec794 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.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>
@@ -32,6 +33,7 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <mach/i2c.h> 35#include <mach/i2c.h>
36#include <mach/regs-gpio.h>
35 37
36#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
@@ -88,6 +90,45 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
88 }, 90 },
89}; 91};
90 92
93static int smdk6440_backlight_init(struct device *dev)
94{
95 int ret;
96
97 ret = gpio_request(S5P6440_GPF(15), "Backlight");
98 if (ret) {
99 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
100 return ret;
101 }
102
103 /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */
104 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_SFN(2));
105
106 return 0;
107}
108
109static void smdk6440_backlight_exit(struct device *dev)
110{
111 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT);
112 gpio_free(S5P6440_GPF(15));
113}
114
115static struct platform_pwm_backlight_data smdk6440_backlight_data = {
116 .pwm_id = 1,
117 .max_brightness = 255,
118 .dft_brightness = 255,
119 .pwm_period_ns = 78770,
120 .init = smdk6440_backlight_init,
121 .exit = smdk6440_backlight_exit,
122};
123
124static struct platform_device smdk6440_backlight_device = {
125 .name = "pwm-backlight",
126 .dev = {
127 .parent = &s3c_device_timer[1].dev,
128 .platform_data = &smdk6440_backlight_data,
129 },
130};
131
91static struct platform_device *smdk6440_devices[] __initdata = { 132static struct platform_device *smdk6440_devices[] __initdata = {
92 &s3c_device_adc, 133 &s3c_device_adc,
93 &s3c_device_rtc, 134 &s3c_device_rtc,
@@ -97,6 +138,8 @@ static struct platform_device *smdk6440_devices[] __initdata = {
97 &s3c_device_wdt, 138 &s3c_device_wdt,
98 &samsung_asoc_dma, 139 &samsung_asoc_dma,
99 &s5p6440_device_iis, 140 &s5p6440_device_iis,
141 &s3c_device_timer[1],
142 &smdk6440_backlight_device,
100}; 143};
101 144
102static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { 145static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 3a20de0a9264..1d8f9fd5af3a 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.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>
@@ -32,6 +33,7 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <mach/i2c.h> 35#include <mach/i2c.h>
36#include <mach/regs-gpio.h>
35 37
36#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
@@ -106,6 +108,45 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
106#endif 108#endif
107}; 109};
108 110
111static int smdk6450_backlight_init(struct device *dev)
112{
113 int ret;
114
115 ret = gpio_request(S5P6450_GPF(15), "Backlight");
116 if (ret) {
117 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
118 return ret;
119 }
120
121 /* Configure GPIO pin with S5P6450_GPF15_PWM_TOUT1 */
122 s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_SFN(2));
123
124 return 0;
125}
126
127static void smdk6450_backlight_exit(struct device *dev)
128{
129 s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_OUTPUT);
130 gpio_free(S5P6450_GPF(15));
131}
132
133static struct platform_pwm_backlight_data smdk6450_backlight_data = {
134 .pwm_id = 1,
135 .max_brightness = 255,
136 .dft_brightness = 255,
137 .pwm_period_ns = 78770,
138 .init = smdk6450_backlight_init,
139 .exit = smdk6450_backlight_exit,
140};
141
142static struct platform_device smdk6450_backlight_device = {
143 .name = "pwm-backlight",
144 .dev = {
145 .parent = &s3c_device_timer[1].dev,
146 .platform_data = &smdk6450_backlight_data,
147 },
148};
149
109static struct platform_device *smdk6450_devices[] __initdata = { 150static struct platform_device *smdk6450_devices[] __initdata = {
110 &s3c_device_adc, 151 &s3c_device_adc,
111 &s3c_device_rtc, 152 &s3c_device_rtc,
@@ -115,6 +156,8 @@ static struct platform_device *smdk6450_devices[] __initdata = {
115 &s3c_device_wdt, 156 &s3c_device_wdt,
116 &samsung_asoc_dma, 157 &samsung_asoc_dma,
117 &s5p6450_device_iis0, 158 &s5p6450_device_iis0,
159 &s3c_device_timer[1],
160 &smdk6450_backlight_device,
118 /* s5p6450_device_spi0 will be added */ 161 /* s5p6450_device_spi0 will be added */
119}; 162};
120 163