diff options
author | eric miao <eric.miao@marvell.com> | 2008-04-13 16:46:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-03 08:25:02 -0400 |
commit | 5cca91479b8ac6a60b61bc56e72389c681387211 (patch) | |
tree | abc618cb4b94145fe3400dbc80ea8c0e271106fa /arch | |
parent | 42796d37da6ef4fd851dc6d5d0387baf7e2b0c3c (diff) |
[ARM] pxa: make zylonite use the generic PWM backlight driver
Patch mostly by Eric Miao, minor edits by rmk.
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa300.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa320.c | 2 |
4 files changed, 21 insertions, 13 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 9c01505b1825..b7a3281c420e 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -116,6 +116,7 @@ config MACH_COLIBRI | |||
116 | config MACH_ZYLONITE | 116 | config MACH_ZYLONITE |
117 | bool "PXA3xx Development Platform" | 117 | bool "PXA3xx Development Platform" |
118 | select PXA3xx | 118 | select PXA3xx |
119 | select HAVE_PWM | ||
119 | 120 | ||
120 | config MACH_LITTLETON | 121 | config MACH_LITTLETON |
121 | bool "PXA3xx Form Factor Platform (aka Littleton)" | 122 | bool "PXA3xx Form Factor Platform (aka Littleton)" |
@@ -276,6 +277,7 @@ config PXA_SSP | |||
276 | 277 | ||
277 | config PXA_PWM | 278 | config PXA_PWM |
278 | tristate | 279 | tristate |
280 | default BACKLIGHT_PWM | ||
279 | help | 281 | help |
280 | Enable support for PXA2xx/PXA3xx PWM controllers | 282 | Enable support for PXA2xx/PXA3xx PWM controllers |
281 | endif | 283 | endif |
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 4a0028087ea6..b13bb9385138 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/pwm_backlight.h> | ||
21 | 22 | ||
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
@@ -28,12 +29,12 @@ | |||
28 | #include <asm/arch/mmc.h> | 29 | #include <asm/arch/mmc.h> |
29 | #include <asm/arch/pxa27x_keypad.h> | 30 | #include <asm/arch/pxa27x_keypad.h> |
30 | 31 | ||
32 | #include "devices.h" | ||
31 | #include "generic.h" | 33 | #include "generic.h" |
32 | 34 | ||
33 | #define MAX_SLOTS 3 | 35 | #define MAX_SLOTS 3 |
34 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; | 36 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; |
35 | 37 | ||
36 | int gpio_backlight; | ||
37 | int gpio_eth_irq; | 38 | int gpio_eth_irq; |
38 | 39 | ||
39 | int wm9713_irq; | 40 | int wm9713_irq; |
@@ -62,10 +63,20 @@ static struct platform_device smc91x_device = { | |||
62 | }; | 63 | }; |
63 | 64 | ||
64 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 65 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
65 | static void zylonite_backlight_power(int on) | 66 | static struct platform_pwm_backlight_data zylonite_backlight_data = { |
66 | { | 67 | .pwm_id = 3, |
67 | gpio_set_value(gpio_backlight, on); | 68 | .max_brightness = 100, |
68 | } | 69 | .dft_brightness = 100, |
70 | .pwm_period_ns = 10000, | ||
71 | }; | ||
72 | |||
73 | static struct platform_device zylonite_backlight_device = { | ||
74 | .name = "pwm-backlight", | ||
75 | .dev = { | ||
76 | .parent = &pxa27x_device_pwm1.dev, | ||
77 | .platform_data = &zylonite_backlight_data, | ||
78 | }, | ||
79 | }; | ||
69 | 80 | ||
70 | static struct pxafb_mode_info toshiba_ltm035a776c_mode = { | 81 | static struct pxafb_mode_info toshiba_ltm035a776c_mode = { |
71 | .pixclock = 110000, | 82 | .pixclock = 110000, |
@@ -98,7 +109,6 @@ static struct pxafb_mode_info toshiba_ltm04c380k_mode = { | |||
98 | static struct pxafb_mach_info zylonite_toshiba_lcd_info = { | 109 | static struct pxafb_mach_info zylonite_toshiba_lcd_info = { |
99 | .num_modes = 1, | 110 | .num_modes = 1, |
100 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 111 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
101 | .pxafb_backlight_power = zylonite_backlight_power, | ||
102 | }; | 112 | }; |
103 | 113 | ||
104 | static struct pxafb_mode_info sharp_ls037_modes[] = { | 114 | static struct pxafb_mode_info sharp_ls037_modes[] = { |
@@ -134,13 +144,11 @@ static struct pxafb_mach_info zylonite_sharp_lcd_info = { | |||
134 | .modes = sharp_ls037_modes, | 144 | .modes = sharp_ls037_modes, |
135 | .num_modes = 2, | 145 | .num_modes = 2, |
136 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 146 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
137 | .pxafb_backlight_power = zylonite_backlight_power, | ||
138 | }; | 147 | }; |
139 | 148 | ||
140 | static void __init zylonite_init_lcd(void) | 149 | static void __init zylonite_init_lcd(void) |
141 | { | 150 | { |
142 | /* backlight GPIO: output, default on */ | 151 | platform_device_register(&zylonite_backlight_device); |
143 | gpio_direction_output(gpio_backlight, 1); | ||
144 | 152 | ||
145 | if (lcd_id & 0x20) { | 153 | if (lcd_id & 0x20) { |
146 | set_pxa_fb_info(&zylonite_sharp_lcd_info); | 154 | set_pxa_fb_info(&zylonite_sharp_lcd_info); |
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c index 324fb9daae28..6f7ae972b8db 100644 --- a/arch/arm/mach-pxa/zylonite_pxa300.c +++ b/arch/arm/mach-pxa/zylonite_pxa300.c | |||
@@ -50,6 +50,7 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = { | |||
50 | GPIO75_LCD_BIAS, | 50 | GPIO75_LCD_BIAS, |
51 | GPIO76_LCD_VSYNC, | 51 | GPIO76_LCD_VSYNC, |
52 | GPIO127_LCD_CS_N, | 52 | GPIO127_LCD_CS_N, |
53 | GPIO20_PWM3_OUT, /* backlight */ | ||
53 | 54 | ||
54 | /* BTUART */ | 55 | /* BTUART */ |
55 | GPIO111_UART2_RTS, | 56 | GPIO111_UART2_RTS, |
@@ -200,9 +201,6 @@ void __init zylonite_pxa300_init(void) | |||
200 | /* detect LCD panel */ | 201 | /* detect LCD panel */ |
201 | zylonite_detect_lcd_panel(); | 202 | zylonite_detect_lcd_panel(); |
202 | 203 | ||
203 | /* GPIO pin assignment */ | ||
204 | gpio_backlight = mfp_to_gpio(MFP_PIN_GPIO20); | ||
205 | |||
206 | /* MMC card detect & write protect for controller 0 */ | 204 | /* MMC card detect & write protect for controller 0 */ |
207 | zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0); | 205 | zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0); |
208 | zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2); | 206 | zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2); |
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c index 193d07903b06..2b4fc34919ac 100644 --- a/arch/arm/mach-pxa/zylonite_pxa320.c +++ b/arch/arm/mach-pxa/zylonite_pxa320.c | |||
@@ -49,6 +49,7 @@ static mfp_cfg_t mfp_cfg[] __initdata = { | |||
49 | GPIO15_2_LCD_LCLK, | 49 | GPIO15_2_LCD_LCLK, |
50 | GPIO16_2_LCD_PCLK, | 50 | GPIO16_2_LCD_PCLK, |
51 | GPIO17_2_LCD_BIAS, | 51 | GPIO17_2_LCD_BIAS, |
52 | GPIO14_PWM3_OUT, /* backlight */ | ||
52 | 53 | ||
53 | /* FFUART */ | 54 | /* FFUART */ |
54 | GPIO41_UART1_RXD | MFP_LPM_EDGE_FALL, | 55 | GPIO41_UART1_RXD | MFP_LPM_EDGE_FALL, |
@@ -187,7 +188,6 @@ void __init zylonite_pxa320_init(void) | |||
187 | zylonite_detect_lcd_panel(); | 188 | zylonite_detect_lcd_panel(); |
188 | 189 | ||
189 | /* GPIO pin assignment */ | 190 | /* GPIO pin assignment */ |
190 | gpio_backlight = mfp_to_gpio(MFP_PIN_GPIO14); | ||
191 | gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO9); | 191 | gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO9); |
192 | 192 | ||
193 | /* MMC card detect & write protect for controller 0 */ | 193 | /* MMC card detect & write protect for controller 0 */ |