From 75540c1ac3c7bd72ac8e092058f9714875239995 Mon Sep 17 00:00:00 2001 From: eric miao Date: Sun, 13 Apr 2008 21:44:04 +0100 Subject: [ARM] pxa: Add PXA support for PWM API Patch mainly from Eric Miao, with minor edits by rmk. Note: PWM0 and PWM2 share the same register I/O space and clock gating on pxa{27x, 3xx}, thus PWM2 is treated in the driver as a child PWM of PWM0. And this is also true for PWM1/3. Signed-off-by: eric miao Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 5da7a682049..9c01505b182 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -273,4 +273,9 @@ config PXA_SSP tristate help Enable support for PXA2xx SSP ports + +config PXA_PWM + tristate + help + Enable support for PXA2xx/PXA3xx PWM controllers endif -- cgit v1.2.3-70-g09d2 From 63b43f5d3264f4d70b5d29885997253d33259744 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 20 Apr 2008 17:36:20 +0100 Subject: [ARM] pxa: allow PXA to be built for multiple platforms Convert the 'choice' into a 'menu' to allow multiple platforms to be selected. This means to do a build check across PXA, you don't end up spending a lifetime building _twenty_ sodding kernels. Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 5da7a682049..2563753fba7 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -20,8 +20,7 @@ endmenu endif -choice - prompt "Select target board" +menu "Select target boards" config ARCH_GUMSTIX bool "Gumstix XScale boards" @@ -138,7 +137,7 @@ config MACH_PCM027 select PXA27x select IWMMXT -endchoice +endmenu choice prompt "Used baseboard" -- cgit v1.2.3-70-g09d2 From 69eaf23a9797e1bdf16e210ef4da3e756a41f4de Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 31 May 2008 16:14:48 +0100 Subject: [ARM] 5071/2: Drop PXA_SHARPSL_25x/27x case from PXA Kconfig. As nothing in the code references to the PXA_SHARPSL_25x/27x, we can drop that Kconfig case and permit all-zaurus builds. Signed-off-by: Dmitry Baryshkov Acked-by: Richard Purdie Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 2563753fba7..caccbbc41b4 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -148,23 +148,6 @@ config MACH_PCM990_BASEBOARD endchoice -if PXA_SHARPSL - -choice - prompt "Select target Sharp Zaurus device range" - -config PXA_SHARPSL_25x - bool "Sharp PXA25x models (SL-5600, SL-C7xx and SL-C6000x)" - select PXA25x - -config PXA_SHARPSL_27x - bool "Sharp PXA270 models (SL-Cxx00)" - select PXA27x - -endchoice - -endif - if ARCH_GUMSTIX choice @@ -198,28 +181,33 @@ endmenu config MACH_POODLE bool "Enable Sharp SL-5600 (Poodle) Support" - depends on PXA_SHARPSL_25x + depends on PXA_SHARPSL + select PXA25x select SHARP_LOCOMO select PXA_SSP config MACH_CORGI bool "Enable Sharp SL-C700 (Corgi) Support" - depends on PXA_SHARPSL_25x + depends on PXA_SHARPSL + select PXA25x select PXA_SHARP_C7xx config MACH_SHEPHERD bool "Enable Sharp SL-C750 (Shepherd) Support" - depends on PXA_SHARPSL_25x + depends on PXA_SHARPSL + select PXA25x select PXA_SHARP_C7xx config MACH_HUSKY bool "Enable Sharp SL-C760 (Husky) Support" - depends on PXA_SHARPSL_25x + depends on PXA_SHARPSL + select PXA25x select PXA_SHARP_C7xx config MACH_AKITA bool "Enable Sharp SL-1000 (Akita) Support" - depends on PXA_SHARPSL_27x + depends on PXA_SHARPSL + select PXA27x select PXA_SHARP_Cxx00 select MACH_SPITZ select I2C @@ -227,17 +215,20 @@ config MACH_AKITA config MACH_SPITZ bool "Enable Sharp Zaurus SL-3000 (Spitz) Support" - depends on PXA_SHARPSL_27x + depends on PXA_SHARPSL + select PXA27x select PXA_SHARP_Cxx00 config MACH_BORZOI bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support" - depends on PXA_SHARPSL_27x + depends on PXA_SHARPSL + select PXA27x select PXA_SHARP_Cxx00 config MACH_TOSA bool "Enable Sharp SL-6000x (Tosa) Support" - depends on PXA_SHARPSL_25x + depends on PXA_SHARPSL + select PXA25x config PXA25x bool -- cgit v1.2.3-70-g09d2 From 5cca91479b8ac6a60b61bc56e72389c681387211 Mon Sep 17 00:00:00 2001 From: eric miao Date: Sun, 13 Apr 2008 21:46:34 +0100 Subject: [ARM] pxa: make zylonite use the generic PWM backlight driver Patch mostly by Eric Miao, minor edits by rmk. Signed-off-by: eric miao Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 2 ++ arch/arm/mach-pxa/zylonite.c | 26 +++++++++++++++++--------- arch/arm/mach-pxa/zylonite_pxa300.c | 4 +--- arch/arm/mach-pxa/zylonite_pxa320.c | 2 +- include/asm-arm/arch-pxa/zylonite.h | 1 - 5 files changed, 21 insertions(+), 14 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 9c01505b182..b7a3281c420 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -116,6 +116,7 @@ config MACH_COLIBRI config MACH_ZYLONITE bool "PXA3xx Development Platform" select PXA3xx + select HAVE_PWM config MACH_LITTLETON bool "PXA3xx Form Factor Platform (aka Littleton)" @@ -276,6 +277,7 @@ config PXA_SSP config PXA_PWM tristate + default BACKLIGHT_PWM help Enable support for PXA2xx/PXA3xx PWM controllers endif diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 4a0028087ea..b13bb938513 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -28,12 +29,12 @@ #include #include +#include "devices.h" #include "generic.h" #define MAX_SLOTS 3 struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; -int gpio_backlight; int gpio_eth_irq; int wm9713_irq; @@ -62,10 +63,20 @@ static struct platform_device smc91x_device = { }; #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) -static void zylonite_backlight_power(int on) -{ - gpio_set_value(gpio_backlight, on); -} +static struct platform_pwm_backlight_data zylonite_backlight_data = { + .pwm_id = 3, + .max_brightness = 100, + .dft_brightness = 100, + .pwm_period_ns = 10000, +}; + +static struct platform_device zylonite_backlight_device = { + .name = "pwm-backlight", + .dev = { + .parent = &pxa27x_device_pwm1.dev, + .platform_data = &zylonite_backlight_data, + }, +}; static struct pxafb_mode_info toshiba_ltm035a776c_mode = { .pixclock = 110000, @@ -98,7 +109,6 @@ static struct pxafb_mode_info toshiba_ltm04c380k_mode = { static struct pxafb_mach_info zylonite_toshiba_lcd_info = { .num_modes = 1, .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, - .pxafb_backlight_power = zylonite_backlight_power, }; static struct pxafb_mode_info sharp_ls037_modes[] = { @@ -134,13 +144,11 @@ static struct pxafb_mach_info zylonite_sharp_lcd_info = { .modes = sharp_ls037_modes, .num_modes = 2, .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, - .pxafb_backlight_power = zylonite_backlight_power, }; static void __init zylonite_init_lcd(void) { - /* backlight GPIO: output, default on */ - gpio_direction_output(gpio_backlight, 1); + platform_device_register(&zylonite_backlight_device); if (lcd_id & 0x20) { 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 324fb9daae2..6f7ae972b8d 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 = { GPIO75_LCD_BIAS, GPIO76_LCD_VSYNC, GPIO127_LCD_CS_N, + GPIO20_PWM3_OUT, /* backlight */ /* BTUART */ GPIO111_UART2_RTS, @@ -200,9 +201,6 @@ void __init zylonite_pxa300_init(void) /* detect LCD panel */ zylonite_detect_lcd_panel(); - /* GPIO pin assignment */ - gpio_backlight = mfp_to_gpio(MFP_PIN_GPIO20); - /* MMC card detect & write protect for controller 0 */ zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0); 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 193d07903b0..2b4fc34919a 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 = { GPIO15_2_LCD_LCLK, GPIO16_2_LCD_PCLK, GPIO17_2_LCD_BIAS, + GPIO14_PWM3_OUT, /* backlight */ /* FFUART */ GPIO41_UART1_RXD | MFP_LPM_EDGE_FALL, @@ -187,7 +188,6 @@ void __init zylonite_pxa320_init(void) zylonite_detect_lcd_panel(); /* GPIO pin assignment */ - gpio_backlight = mfp_to_gpio(MFP_PIN_GPIO14); gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO9); /* MMC card detect & write protect for controller 0 */ diff --git a/include/asm-arm/arch-pxa/zylonite.h b/include/asm-arm/arch-pxa/zylonite.h index 4881b80f0f9..de577de8d18 100644 --- a/include/asm-arm/arch-pxa/zylonite.h +++ b/include/asm-arm/arch-pxa/zylonite.h @@ -15,7 +15,6 @@ struct platform_mmc_slot { extern struct platform_mmc_slot zylonite_mmc_slot[]; -extern int gpio_backlight; extern int gpio_eth_irq; extern int wm9713_irq; -- cgit v1.2.3-70-g09d2 From 402e490997ddaae310a080534a61d7ec24df8124 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 13 Apr 2008 21:47:01 +0100 Subject: [ARM] pxa: make mainstone use the generic PWM backlight driver Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 1 + arch/arm/mach-pxa/mainstone.c | 63 ++++++++++++------------------------------- 2 files changed, 18 insertions(+), 46 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index b7a3281c420..2d711308076 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -41,6 +41,7 @@ config MACH_LOGICPD_PXA270 config MACH_MAINSTONE bool "Intel HCDDBBVA0 Development Platform" select PXA27x + select HAVE_PWM config ARCH_PXA_IDP bool "Accelent Xscale IDP" diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 7399fb34da4..266594426e8 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c @@ -23,9 +23,9 @@ #include #include #include -#include #include #include +#include #include #include @@ -349,56 +349,27 @@ static struct platform_device mst_flash_device[2] = { }, }; -#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE -static int mainstone_backlight_update_status(struct backlight_device *bl) -{ - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - if (brightness != 0) - pxa_set_cken(CKEN_PWM0, 1); - - PWM_CTRL0 = 0; - PWM_PWDUTY0 = brightness; - PWM_PERVAL0 = bl->props.max_brightness; - - if (brightness == 0) - pxa_set_cken(CKEN_PWM0, 0); - return 0; /* pointless return value */ -} - -static int mainstone_backlight_get_brightness(struct backlight_device *bl) -{ - return PWM_PWDUTY0; -} +#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) +static struct platform_pwm_backlight_data mainstone_backlight_data = { + .pwm_id = 0, + .max_brightness = 1023, + .dft_brightness = 1023, + .pwm_period_ns = 78770, +}; -static /*const*/ struct backlight_ops mainstone_backlight_ops = { - .update_status = mainstone_backlight_update_status, - .get_brightness = mainstone_backlight_get_brightness, +static struct platform_device mainstone_backlight_device = { + .name = "pwm-backlight", + .dev = { + .parent = &pxa27x_device_pwm0.dev, + .platform_data = &mainstone_backlight_data, + }, }; static void __init mainstone_backlight_register(void) { - struct backlight_device *bl; - - bl = backlight_device_register("mainstone-bl", &pxa_device_fb.dev, - NULL, &mainstone_backlight_ops); - if (IS_ERR(bl)) { - printk(KERN_ERR "mainstone: unable to register backlight: %ld\n", - PTR_ERR(bl)); - return; - } - - /* - * broken design - register-then-setup interfaces are - * utterly broken by definition. - */ - bl->props.max_brightness = 1023; - bl->props.brightness = 1023; - backlight_update_status(bl); + int ret = platform_device_register(&mainstone_backlight_device); + if (ret) + printk(KERN_ERR "mainstone: failed to register backlight device: %d\n", ret); } #else #define mainstone_backlight_register() do { } while (0) -- cgit v1.2.3-70-g09d2 From 4a73071947d21f3aa39fa3a4bac104aaab94cfca Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 18 May 2008 13:11:02 +0100 Subject: [ARM] pxa: make LogicPD 270 use the generic PWM backlight driver Acked-by: Lennert Buytenhek Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 1 + arch/arm/mach-pxa/lpd270.c | 38 +++++++++++++++++--------------------- 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 2d711308076..7db0fd87a45 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -37,6 +37,7 @@ config ARCH_LUBBOCK config MACH_LOGICPD_PXA270 bool "LogicPD PXA270 Card Engine Development Platform" select PXA27x + select HAVE_PWM config MACH_MAINSTONE bool "Intel HCDDBBVA0 Development Platform" diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index a20e4b1649d..f958403b43e 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -233,21 +234,20 @@ static struct platform_device lpd270_flash_device[2] = { }, }; -static void lpd270_backlight_power(int on) -{ - if (on) { - pxa_gpio_mode(GPIO16_PWM0_MD); - pxa_set_cken(CKEN_PWM0, 1); - PWM_CTRL0 = 0; - PWM_PWDUTY0 = 0x3ff; - PWM_PERVAL0 = 0x3ff; - } else { - PWM_CTRL0 = 0; - PWM_PWDUTY0 = 0x0; - PWM_PERVAL0 = 0x3FF; - pxa_set_cken(CKEN_PWM0, 0); - } -} +static struct platform_pwm_backlight_data lpd270_backlight_data = { + .pwm_id = 0, + .max_brightness = 1, + .dft_brightness = 1, + .pwm_period_ns = 78770, +}; + +static struct platform_device lpd270_backlight_device = { + .name = "pwm-backlight", + .dev = { + .parent = &pxa27x_device_pwm0.dev, + .platform_data = &lpd270_backlight_data, + }, +}; /* 5.7" TFT QVGA (LoLo display number 1) */ static struct pxafb_mode_info sharp_lq057q3dc02_mode = { @@ -269,7 +269,6 @@ static struct pxafb_mach_info sharp_lq057q3dc02 = { .num_modes = 1, .lccr0 = 0x07800080, .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, }; /* 12.1" TFT SVGA (LoLo display number 2) */ @@ -292,7 +291,6 @@ static struct pxafb_mach_info sharp_lq121s1dg31 = { .num_modes = 1, .lccr0 = 0x07800080, .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, }; /* 3.6" TFT QVGA (LoLo display number 3) */ @@ -315,7 +313,6 @@ static struct pxafb_mach_info sharp_lq036q1da01 = { .num_modes = 1, .lccr0 = 0x07800080, .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, }; /* 6.4" TFT VGA (LoLo display number 5) */ @@ -338,7 +335,6 @@ static struct pxafb_mach_info sharp_lq64d343 = { .num_modes = 1, .lccr0 = 0x07800080, .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, }; /* 10.4" TFT VGA (LoLo display number 7) */ @@ -361,7 +357,6 @@ static struct pxafb_mach_info sharp_lq10d368 = { .num_modes = 1, .lccr0 = 0x07800080, .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, }; /* 3.5" TFT QVGA (LoLo display number 8) */ @@ -384,7 +379,6 @@ static struct pxafb_mach_info sharp_lq035q7db02_20 = { .num_modes = 1, .lccr0 = 0x07800080, .lccr3 = 0x00400000, - .pxafb_backlight_power = lpd270_backlight_power, }; static struct pxafb_mach_info *lpd270_lcd_to_use; @@ -414,6 +408,7 @@ __setup("lcd=", lpd270_set_lcd); static struct platform_device *platform_devices[] __initdata = { &smc91x_device, + &lpd270_backlight_device, &lpd270_audio_device, &lpd270_flash_device[0], &lpd270_flash_device[1], @@ -454,6 +449,7 @@ static void __init lpd270_init(void) * On LogicPD PXA270, we route AC97_SYSCLK via GPIO45. */ pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); + pxa_gpio_mode(GPIO16_PWM0_MD); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); -- cgit v1.2.3-70-g09d2 From c0f7edb3099d538017c52556aab596b857dc92ee Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 13 Jun 2008 11:50:44 +0100 Subject: [ARM] 5094/1: pcm990: Add framebuffer and backlight support PCM990 boards can be assembled with either a Sharp STN or a NEC TFT LCD. This patch adds support for these displays and for the backlight, using the pwm_bl driver. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Russell King --- arch/arm/mach-pxa/Kconfig | 16 ++++++ arch/arm/mach-pxa/pcm990-baseboard.c | 99 +++++++++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 7db0fd87a45..03cbd0f7285 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -149,6 +149,22 @@ choice config MACH_PCM990_BASEBOARD bool "PHYTEC PCM-990 development board" + select HAVE_PWM + +endchoice + +choice + prompt "display on pcm990" + depends on MACH_PCM990_BASEBOARD + +config PCM990_DISPLAY_SHARP + bool "sharp lq084v1dg21 stn display" + +config PCM990_DISPLAY_NEC + bool "nec nl6448bc20_18d tft display" + +config PCM990_DISPLAY_NONE + bool "no display" endchoice diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 49d951db0f3..2564e16e4e2 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -36,9 +37,99 @@ #include #include #include +#include + +#include "devices.h" + +/* + * pcm990_lcd_power - control power supply to the LCD + * @on: 0 = switch off, 1 = switch on + * + * Called by the pxafb driver + */ +#ifndef CONFIG_PCM990_DISPLAY_NONE +static void pcm990_lcd_power(int on, struct fb_var_screeninfo *var) +{ + if (on) { + /* enable LCD-Latches + * power on LCD + */ + __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = + PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON; + } else { + /* disable LCD-Latches + * power off LCD + */ + __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 0x00; + } +} +#endif + +#if defined(CONFIG_PCM990_DISPLAY_SHARP) +static struct pxafb_mode_info fb_info_sharp_lq084v1dg21 = { + .pixclock = 28000, + .xres = 640, + .yres = 480, + .bpp = 16, + .hsync_len = 20, + .left_margin = 103, + .right_margin = 47, + .vsync_len = 6, + .upper_margin = 28, + .lower_margin = 5, + .sync = 0, + .cmap_greyscale = 0, +}; + +static struct pxafb_mach_info pcm990_fbinfo __initdata = { + .modes = &fb_info_sharp_lq084v1dg21, + .num_modes = 1, + .lccr0 = LCCR0_PAS, + .lccr3 = LCCR3_PCP, + .pxafb_lcd_power = pcm990_lcd_power, +}; +#elif defined(CONFIG_PCM990_DISPLAY_NEC) +struct pxafb_mode_info fb_info_nec_nl6448bc20_18d = { + .pixclock = 39720, + .xres = 640, + .yres = 480, + .bpp = 16, + .hsync_len = 32, + .left_margin = 16, + .right_margin = 48, + .vsync_len = 2, + .upper_margin = 12, + .lower_margin = 17, + .sync = 0, + .cmap_greyscale = 0, +}; + +static struct pxafb_mach_info pcm990_fbinfo __initdata = { + .modes = &fb_info_nec_nl6448bc20_18d, + .num_modes = 1, + .lccr0 = LCCR0_Act, + .lccr3 = LCCR3_PixFlEdg, + .pxafb_lcd_power = pcm990_lcd_power, +}; +#endif + +static struct platform_pwm_backlight_data pcm990_backlight_data = { + .pwm_id = 0, + .max_brightness = 1023, + .dft_brightness = 1023, + .pwm_period_ns = 78770, +}; + +static struct platform_device pcm990_backlight_device = { + .name = "pwm-backlight", + .dev = { + .parent = &pxa27x_device_pwm0.dev, + .platform_data = &pcm990_backlight_data, + }, +}; /* - * The PCM-990 development baseboard uses PCM-027's hardeware in the + * The PCM-990 development baseboard uses PCM-027's hardware in the * following way: * * - LCD support is in use @@ -393,6 +484,12 @@ void __init pcm990_baseboard_init(void) /* register CPLD's IRQ controller */ pcm990_init_irq(); +#ifndef CONFIG_PCM990_DISPLAY_NONE + set_pxa_fb_info(&pcm990_fbinfo); +#endif + pxa_gpio_mode(GPIO16_PWM0_MD); + platform_device_register(&pcm990_backlight_device); + platform_device_register(&pxa27x_device_ac97); /* MMC */ -- cgit v1.2.3-70-g09d2