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/arm/mach-pxa/zylonite.c | |
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/arm/mach-pxa/zylonite.c')
-rw-r--r-- | arch/arm/mach-pxa/zylonite.c | 26 |
1 files changed, 17 insertions, 9 deletions
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); |