aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/zylonite.c
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-04-13 16:46:34 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-03 08:25:02 -0400
commit5cca91479b8ac6a60b61bc56e72389c681387211 (patch)
treeabc618cb4b94145fe3400dbc80ea8c0e271106fa /arch/arm/mach-pxa/zylonite.c
parent42796d37da6ef4fd851dc6d5d0387baf7e2b0c3c (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.c26
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
34struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; 36struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS];
35 37
36int gpio_backlight;
37int gpio_eth_irq; 38int gpio_eth_irq;
38 39
39int wm9713_irq; 40int 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)
65static void zylonite_backlight_power(int on) 66static 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
73static 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
70static struct pxafb_mode_info toshiba_ltm035a776c_mode = { 81static 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 = {
98static struct pxafb_mach_info zylonite_toshiba_lcd_info = { 109static 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
104static struct pxafb_mode_info sharp_ls037_modes[] = { 114static 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
140static void __init zylonite_init_lcd(void) 149static 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);