From cb47729bdaf49fe5e9dd2c41554f44a77b5cd590 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Sat, 16 Aug 2008 03:59:11 -0400 Subject: [ARM] pxafb: fix the incorrect configuration of GPIO77 as ACBIAS for TFT LCD Signed-off-by: Eric Miao Tested-by: Robert Jarzmik Tested-by: Alex Osborne Signed-off-by: Russell King --- drivers/video/pxafb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index e7aa7ae8fca..bef35afa258 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -1031,7 +1031,9 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi) pxa_gpio_mode(GPIO74_LCD_FCLK_MD); pxa_gpio_mode(GPIO75_LCD_LCLK_MD); pxa_gpio_mode(GPIO76_LCD_PCLK_MD); - pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD); + + if ((lccr0 & LCCR0_PAS) == 0) + pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD); } static void pxafb_enable_controller(struct pxafb_info *fbi) -- cgit v1.2.3 From 9a1ac7e498b9fc367235aabeb5b86c1319db1de9 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Fri, 15 Aug 2008 02:50:44 -0400 Subject: [ARM] pxafb: add flag to specify output format on LDD pins when base is RGBT16 Another fix of inconsistent shift of the LCD_BIAS_ACTIVE_* and LCD_PCLK_EDGE_* is also included. Signed-off-by: Eric Miao Signed-off-by: Russell King --- drivers/video/pxafb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index bef35afa258..fa108dad09b 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -1402,6 +1402,8 @@ static void pxafb_decode_mach_info(struct pxafb_info *fbi, if (lcd_conn == LCD_MONO_STN_8BPP) fbi->lccr0 |= LCCR0_DPD; + fbi->lccr0 |= (lcd_conn & LCD_ALTERNATE_MAPPING) ? LCCR0_LDDALT : 0; + fbi->lccr3 = LCCR3_Acb((inf->lcd_conn >> 10) & 0xff); fbi->lccr3 |= (lcd_conn & LCD_BIAS_ACTIVE_LOW) ? LCCR3_OEP : 0; fbi->lccr3 |= (lcd_conn & LCD_PCLK_EDGE_FALL) ? LCCR3_PCP : 0; -- cgit v1.2.3 From 4f3e2664622d23a17c6fc45a4df4c35cd2612ffb Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Sat, 16 Aug 2008 03:50:51 -0400 Subject: [ARM] pxafb: fix the warning of incorrect lccr when lcd_conn is specified The newly introduced "lcd_conn" field for connected LCD panel type will cause the original code to generate the warnings of incorrect lccr*. This is unnecessary since well encoded LCD_* flags will not generate incorrect combinition of lccr* bits. Skip the check if "lcd_conn" is specified. Signed-off-by: Eric Miao Signed-off-by: Russell King --- drivers/video/pxafb.c | 62 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 26 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index fa108dad09b..97204497d9f 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -1677,53 +1677,63 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)"); #define pxafb_setup_options() (0) #endif -static int __devinit pxafb_probe(struct platform_device *dev) -{ - struct pxafb_info *fbi; - struct pxafb_mach_info *inf; - struct resource *r; - int irq, ret; - - dev_dbg(&dev->dev, "pxafb_probe\n"); - - inf = dev->dev.platform_data; - ret = -ENOMEM; - fbi = NULL; - if (!inf) - goto failed; - - ret = pxafb_parse_options(&dev->dev, g_options); - if (ret < 0) - goto failed; - #ifdef DEBUG_VAR - /* Check for various illegal bit-combinations. Currently only - * a warning is given. */ +/* Check for various illegal bit-combinations. Currently only + * a warning is given. */ +static void __devinit pxafb_check_options(struct device *dev, + struct pxafb_mach_info *inf) +{ + if (inf->lcd_conn) + return; if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) - dev_warn(&dev->dev, "machine LCCR0 setting contains " + dev_warn(dev, "machine LCCR0 setting contains " "illegal bits: %08x\n", inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) - dev_warn(&dev->dev, "machine LCCR3 setting contains " + dev_warn(dev, "machine LCCR3 setting contains " "illegal bits: %08x\n", inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); if (inf->lccr0 & LCCR0_DPD && ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) - dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is " + dev_warn(dev, "Double Pixel Data (DPD) mode is " "only valid in passive mono" " single panel mode\n"); if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) - dev_warn(&dev->dev, "Dual panel only valid in passive mode\n"); + dev_warn(dev, "Dual panel only valid in passive mode\n"); if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && (inf->modes->upper_margin || inf->modes->lower_margin)) - dev_warn(&dev->dev, "Upper and lower margins must be 0 in " + dev_warn(dev, "Upper and lower margins must be 0 in " "passive mode\n"); +} +#else +#define pxafb_check_options(...) do {} while (0) #endif +static int __devinit pxafb_probe(struct platform_device *dev) +{ + struct pxafb_info *fbi; + struct pxafb_mach_info *inf; + struct resource *r; + int irq, ret; + + dev_dbg(&dev->dev, "pxafb_probe\n"); + + inf = dev->dev.platform_data; + ret = -ENOMEM; + fbi = NULL; + if (!inf) + goto failed; + + ret = pxafb_parse_options(&dev->dev, g_options); + if (ret < 0) + goto failed; + + pxafb_check_options(&dev->dev, inf); + dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n", inf->modes->xres, inf->modes->yres, -- cgit v1.2.3