diff mbox

fix i810 i2c bug

Message ID 1294046939.20021.12.camel@wall-e (mailing list archive)
State Accepted
Commit 748103e7235892bf9a3ee568d7d4dd7e5a3beece
Headers show

Commit Message

Stefani Seibold Jan. 3, 2011, 9:28 a.m. UTC
None
diff mbox

Patch

diff -u -N -r -p linux-2.6.35.orig/drivers/video/i810/i810-i2c.c linux-2.6.35/drivers/video/i810/i810-i2c.c
--- linux-2.6.35.orig/drivers/video/i810/i810-i2c.c	2010-08-02 00:11:14.000000000 +0200
+++ linux-2.6.35/drivers/video/i810/i810-i2c.c	2010-10-04 12:24:29.000000000 +0200
@@ -45,8 +45,10 @@  static void i810i2c_setscl(void *data, i
         struct i810fb_par         *par = chan->par;
 	u8                        __iomem *mmio = par->mmio_start_virtual;
 
-	i810_writel(mmio, chan->ddc_base, (state ? SCL_VAL_OUT : 0) | SCL_DIR |
-		    SCL_DIR_MASK | SCL_VAL_MASK);
+	if (state)
+		i810_writel(mmio, chan->ddc_base, SCL_DIR_MASK | SCL_VAL_MASK);
+	else
+		i810_writel(mmio, chan->ddc_base, SCL_DIR | SCL_DIR_MASK | SCL_VAL_MASK);
 	i810_readl(mmio, chan->ddc_base);	/* flush posted write */
 }
 
@@ -56,8 +58,10 @@  static void i810i2c_setsda(void *data, i
         struct i810fb_par         *par = chan->par;
 	u8                        __iomem *mmio = par->mmio_start_virtual;
 
- 	i810_writel(mmio, chan->ddc_base, (state ? SDA_VAL_OUT : 0) | SDA_DIR |
-		    SDA_DIR_MASK | SDA_VAL_MASK);
+	if (state)
+		i810_writel(mmio, chan->ddc_base, SDA_DIR_MASK | SDA_VAL_MASK);
+	else
+		i810_writel(mmio, chan->ddc_base, SDA_DIR | SDA_DIR_MASK | SDA_VAL_MASK);
 	i810_readl(mmio, chan->ddc_base);	/* flush posted write */
 }