[PATCH] ARM: pxafb: fix overwriting of pixel clock and output enable polarity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When loading the pxafb driver as a module it's possible to overwrite the
platform data via module parameters. When overwriting the pixel clock or
output enable polarity the parse_opt() function modifies the lccr3 member
of the platform data struct. Later on in pxafb_decode_mach_info() lccr3
is only evaluated if lcd_conn lcd type is not used.

This patch fixes the problem by setting pixel clock and output enable
polarity in inf->lcd_conn, too (which is handled the correct way in
pxafb_decode_mach_info()).

Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
---
 drivers/video/pxafb.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 0f4e8c9..119c0a1 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -1979,17 +1979,21 @@ static int __devinit parse_opt(struct device *dev, char *this_opt)
 		if (simple_strtoul(this_opt+9, NULL, 0) == 0) {
 			sprintf(s, "output enable: active low\n");
 			inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnL;
+			inf->lcd_conn |= LCD_BIAS_ACTIVE_LOW;
 		} else {
 			sprintf(s, "output enable: active high\n");
 			inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnH;
+			inf->lcd_conn &= ~LCD_BIAS_ACTIVE_LOW;
 		}
 	} else if (!strncmp(this_opt, "pixclockpol:", 12)) {
 		if (simple_strtoul(this_opt+12, NULL, 0) == 0) {
 			sprintf(s, "pixel clock polarity: falling edge\n");
 			inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixFlEdg;
+			inf->lcd_conn |= LCD_PCLK_EDGE_FALL;
 		} else {
 			sprintf(s, "pixel clock polarity: rising edge\n");
 			inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixRsEdg;
+			inf->lcd_conn &= ~LCD_PCLK_EDGE_FALL;
 		}
 	} else if (!strncmp(this_opt, "color", 5)) {
 		inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Color;
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux