1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-11 13:33:08 +02:00
openwrt-xburst/target/linux/pxa/patches-2.6.21/035-pxafb-definition.patch

175 lines
4.9 KiB
Diff
Raw Normal View History

--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -25,6 +25,7 @@
#include <asm/arch/udc.h>
#include <asm/arch/mmc.h>
#include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxafb.h>
#include <asm/arch/gumstix.h>
#include "generic.h"
@@ -90,6 +91,89 @@ static struct platform_device gum_audio_
.id = -1,
};
+
+#if defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) || defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
+static void gumstix_lcd_backlight(int on_or_off)
+{
+ if(on_or_off)
+ {
+ pxa_gpio_mode(17 | GPIO_IN);
+ } else {
+ GPCR(17) = GPIO_bit(17);
+ pxa_gpio_mode(17 | GPIO_OUT);
+ GPCR(17) = GPIO_bit(17);
+ }
+}
+#endif
+
+
+#ifdef CONFIG_FB_PXA_ALPS_CDOLLAR
+static struct pxafb_mode_info gumstix_fb_mode = {
+ .pixclock = 300000,
+ .xres = 240,
+ .yres = 320,
+ .bpp = 16,
+ .hsync_len = 2,
+ .left_margin = 1,
+ .right_margin = 1,
+ .vsync_len = 3,
+ .upper_margin = 0,
+ .lower_margin = 0,
+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+};
+
+static struct pxafb_mach_info gumstix_fb_info = {
+ .modes = &gumstix_fb_mode,
+ .num_modes = 1,
+ .lccr0 = LCCR0_Pas | LCCR0_Sngl | LCCR0_Color,
+ .lccr3 = 0,
+};
+#elif defined(CONFIG_FB_PXA_SHARP_LQ043_PSP)
+static struct pxafb_mode_info gumstix_fb_mode = {
+ .pixclock = 110000,
+ .xres = 480,
+ .yres = 272,
+ .bpp = 16,
+ .hsync_len = 41,
+ .left_margin = 2,
+ .right_margin = 2,
+ .vsync_len = 10,
+ .upper_margin = 2,
+ .lower_margin = 2,
+ .sync = 0, // Hsync and Vsync both active low
+};
+
+static struct pxafb_mach_info gumstix_fb_info = {
+ .modes = &gumstix_fb_mode,
+ .num_modes = 1,
+ .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
+ .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (3 << 30),
+ .pxafb_backlight_power = &gumstix_lcd_backlight,
+};
+#elif defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
+static struct pxafb_mode_info gumstix_fb_mode = {
+ .pixclock = 108696, // 9.2MHz typical DOTCLK from datasheet
+ .xres = 480,
+ .hsync_len = 41, // HLW from datasheet: 41 typ
+ .left_margin = 4, // HBP - HLW from datasheet: 45 - 41 = 4
+ .right_margin = 8, // HFP from datasheet: 8 typ
+ .yres = 272,
+ .vsync_len = 10, // VLW from datasheet: 10 typ
+ .upper_margin = 2, // VBP - VLW from datasheet: 12 - 10 = 2
+ .lower_margin = 4, // VFP from datasheet: 4 typ
+ .bpp = 16,
+ .sync = 0, // Hsync and Vsync both active low
+};
+
+static struct pxafb_mach_info gumstix_fb_info = {
+ .modes = &gumstix_fb_mode,
+ .num_modes = 1,
+ .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
+ .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | (3 << 30),
+ .pxafb_backlight_power = &gumstix_lcd_backlight,
+};
+#endif
+
static struct platform_device *devices[] __initdata = {
&gum_audio_device,
};
@@ -98,6 +182,9 @@ static void __init gumstix_init(void)
{
pxa_set_mci_info(&gumstix_mci_platform_data);
pxa_set_udc_info(&gumstix_udc_info);
+#if defined(CONFIG_FB_PXA_ALPS_CDOLLAR) | defined(CONFIG_FB_PXA_SHARP_LQ043_PSP) | defined(CONFIG_FB_PXA_SAMSUNG_LTE430WQ_F0C)
+ set_pxa_fb_info(&gumstix_fb_info);
+#endif
(void) platform_add_devices(devices, ARRAY_SIZE(devices));
}
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1495,6 +1495,37 @@ config FB_PXA
If unsure, say N.
+choice
+ depends on FB_PXA
+ prompt "LCD Panel"
+ default FB_PXA_SAMSUNG_LTE430WQ_F0C
+
+config FB_PXA_ALPS_CDOLLAR
+ boolean "Chris Dollar's ALPS screen"
+ ---help---
+ Enable definitions (over-ridable on the kernel command line if
+ "PXA LCD command line parameters" is also selected) for an ALPS
+ screen which Chris Dollar uses
+
+config FB_PXA_SHARP_LQ043_PSP
+ boolean "SHARP LQ043... series"
+ ---help---
+ Enable definitions (over-ridable on the kernel command line if
+ "PXA LCD command line parameters" is also selected) for a SHARP
+ LQ043... screen, such as the one used by the PSP. These screens are
+ the ones normally sold by gumstix with its boards.
+
+config FB_PXA_SAMSUNG_LTE430WQ_F0C
+ boolean "Samsung LTE430WQ-F0C (standard gumstix LCD)"
+ ---help---
+ Enable definitions for a Samsung LTE430WQ-F0C LCD panel, such as the ones resold
+ by gumstix for use with their "LCD-Ready" boards.
+
+config FB_PXA_NONEOFTHEABOVE
+ boolean "None of the above"
+
+endchoice
+
config FB_PXA_PARAMETERS
bool "PXA LCD command line parameters"
default n
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -22,6 +22,7 @@
*
*/
+#include <linux/autoconf.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
@@ -789,7 +790,13 @@ static void pxafb_setup_gpio(struct pxaf
pxa_gpio_mode(GPIO74_LCD_FCLK_MD);
pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
+#ifdef CONFIG_FB_PXA_SHARP_LQ043_PSP
+ /* DISP must be always high while screen is on */
+ pxa_gpio_mode(GPIO77_LCD_ACBIAS | GPIO_OUT);
+ GPSR(GPIO77_LCD_ACBIAS) = GPIO_bit(GPIO77_LCD_ACBIAS);
+#else
pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
+#endif
}
static void pxafb_enable_controller(struct pxafb_info *fbi)