Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH] ARM: pxafb: fix overwriting of pixel clock and output enable polarity
Date: Thu, 17 Nov 2011 16:47:50 +0000	[thread overview]
Message-ID: <1321548470-20279-1-git-send-email-mkl@pengutronix.de> (raw)

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@pengutronix.de>
---
 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


                 reply	other threads:[~2011-11-17 16:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321548470-20279-1-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox