aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <lg@denx.de>2008-06-13 06:50:44 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-03 08:25:09 -0400
commitc0f7edb3099d538017c52556aab596b857dc92ee (patch)
tree1ac30bbaed92541bf17241b2eeb629c31163e219
parent85847a360ff5012ed7932bb5bb63566ad584e02f (diff)
[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 <g.liakhovetski@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-pxa/Kconfig16
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c99
2 files changed, 114 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 7db0fd87a45d..03cbd0f7285b 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -149,6 +149,22 @@ choice
149 149
150config MACH_PCM990_BASEBOARD 150config MACH_PCM990_BASEBOARD
151 bool "PHYTEC PCM-990 development board" 151 bool "PHYTEC PCM-990 development board"
152 select HAVE_PWM
153
154endchoice
155
156choice
157 prompt "display on pcm990"
158 depends on MACH_PCM990_BASEBOARD
159
160config PCM990_DISPLAY_SHARP
161 bool "sharp lq084v1dg21 stn display"
162
163config PCM990_DISPLAY_NEC
164 bool "nec nl6448bc20_18d tft display"
165
166config PCM990_DISPLAY_NONE
167 bool "no display"
152 168
153endchoice 169endchoice
154 170
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 49d951db0f3d..2564e16e4e2f 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -24,6 +24,7 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/ide.h> 25#include <linux/ide.h>
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/pwm_backlight.h>
27 28
28#include <media/soc_camera.h> 29#include <media/soc_camera.h>
29 30
@@ -36,9 +37,99 @@
36#include <asm/arch/mmc.h> 37#include <asm/arch/mmc.h>
37#include <asm/arch/ohci.h> 38#include <asm/arch/ohci.h>
38#include <asm/arch/pcm990_baseboard.h> 39#include <asm/arch/pcm990_baseboard.h>
40#include <asm/arch/pxafb.h>
41
42#include "devices.h"
43
44/*
45 * pcm990_lcd_power - control power supply to the LCD
46 * @on: 0 = switch off, 1 = switch on
47 *
48 * Called by the pxafb driver
49 */
50#ifndef CONFIG_PCM990_DISPLAY_NONE
51static void pcm990_lcd_power(int on, struct fb_var_screeninfo *var)
52{
53 if (on) {
54 /* enable LCD-Latches
55 * power on LCD
56 */
57 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) =
58 PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON;
59 } else {
60 /* disable LCD-Latches
61 * power off LCD
62 */
63 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 0x00;
64 }
65}
66#endif
67
68#if defined(CONFIG_PCM990_DISPLAY_SHARP)
69static struct pxafb_mode_info fb_info_sharp_lq084v1dg21 = {
70 .pixclock = 28000,
71 .xres = 640,
72 .yres = 480,
73 .bpp = 16,
74 .hsync_len = 20,
75 .left_margin = 103,
76 .right_margin = 47,
77 .vsync_len = 6,
78 .upper_margin = 28,
79 .lower_margin = 5,
80 .sync = 0,
81 .cmap_greyscale = 0,
82};
83
84static struct pxafb_mach_info pcm990_fbinfo __initdata = {
85 .modes = &fb_info_sharp_lq084v1dg21,
86 .num_modes = 1,
87 .lccr0 = LCCR0_PAS,
88 .lccr3 = LCCR3_PCP,
89 .pxafb_lcd_power = pcm990_lcd_power,
90};
91#elif defined(CONFIG_PCM990_DISPLAY_NEC)
92struct pxafb_mode_info fb_info_nec_nl6448bc20_18d = {
93 .pixclock = 39720,
94 .xres = 640,
95 .yres = 480,
96 .bpp = 16,
97 .hsync_len = 32,
98 .left_margin = 16,
99 .right_margin = 48,
100 .vsync_len = 2,
101 .upper_margin = 12,
102 .lower_margin = 17,
103 .sync = 0,
104 .cmap_greyscale = 0,
105};
106
107static struct pxafb_mach_info pcm990_fbinfo __initdata = {
108 .modes = &fb_info_nec_nl6448bc20_18d,
109 .num_modes = 1,
110 .lccr0 = LCCR0_Act,
111 .lccr3 = LCCR3_PixFlEdg,
112 .pxafb_lcd_power = pcm990_lcd_power,
113};
114#endif
115
116static struct platform_pwm_backlight_data pcm990_backlight_data = {
117 .pwm_id = 0,
118 .max_brightness = 1023,
119 .dft_brightness = 1023,
120 .pwm_period_ns = 78770,
121};
122
123static struct platform_device pcm990_backlight_device = {
124 .name = "pwm-backlight",
125 .dev = {
126 .parent = &pxa27x_device_pwm0.dev,
127 .platform_data = &pcm990_backlight_data,
128 },
129};
39 130
40/* 131/*
41 * The PCM-990 development baseboard uses PCM-027's hardeware in the 132 * The PCM-990 development baseboard uses PCM-027's hardware in the
42 * following way: 133 * following way:
43 * 134 *
44 * - LCD support is in use 135 * - LCD support is in use
@@ -393,6 +484,12 @@ void __init pcm990_baseboard_init(void)
393 /* register CPLD's IRQ controller */ 484 /* register CPLD's IRQ controller */
394 pcm990_init_irq(); 485 pcm990_init_irq();
395 486
487#ifndef CONFIG_PCM990_DISPLAY_NONE
488 set_pxa_fb_info(&pcm990_fbinfo);
489#endif
490 pxa_gpio_mode(GPIO16_PWM0_MD);
491 platform_device_register(&pcm990_backlight_device);
492
396 platform_device_register(&pxa27x_device_ac97); 493 platform_device_register(&pxa27x_device_ac97);
397 494
398 /* MMC */ 495 /* MMC */