Skip to contentSkip to conversation

Bugfixes for i2c-cpm.c

PATCH Applied Wolfram Sang 3 participants 5 messages Jun 19, 2008 – Jun 28, 2008 4 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bugfixes for i2c-cpm.c

Bugfixes to the i2c-cpm driver

- enable correct interrupts (I2CER_TXE instead of I2CER_BUSY)
- replace forgotten iic with i2c
- fix typo (devided)
- prefix debug-output on init with 0x and add frequency

---
 drivers/i2c/busses/i2c-cpm.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
i2c/busses/i2c-cpm.c renamed from i2c/busses/i2c-cpm.c.orig +5 -5
Index: drivers/i2c/busses/i2c-cpm.c
===================================================================
@@ -241,7 +241,7 @@
 		eieio();
 		setbits16(&tbdf->cbd_sc, BD_SC_READY);
 	} else {
-		dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr);
+		dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr);
 
 		memcpy(tb+1, pmsg->buf, pmsg->len);
 
@@ -350,7 +350,7 @@
 	}
 	/* Start transfer now */
 	/* Enable RX/TX/Error interupts */
-	out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB);
+	out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB);
 	out_8(&i2c_reg->i2cer, 0xff);	/* Clear interrupt status */
 	/* Chip bug, set enable here */
 	setbits8(&i2c_reg->i2mod, I2MOD_EN);	/* Enable */
@@ -553,8 +553,8 @@
 
 	cpm_reset_i2c_params(cpm);
 
-	dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n",
-		cpm->i2c_ram, cpm->i2c_addr);
+	dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n",
+		cpm->i2c_ram, cpm->i2c_addr, cpm->freq);
 	dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n",
 		(u8 __iomem *)cpm->tbase - DPRAM_BASE,
 		(u8 __iomem *)cpm->rbase - DPRAM_BASE);
@@ -568,7 +568,7 @@
 
 	/*
 	 * PDIV is set to 00 in i2mod, so brgclk/32 is used as input to the
-	 * i2c baud rate generator. This is devided by 2 x (DIV + 3) to get
+	 * i2c baud rate generator. This is divided by 2 x (DIV + 3) to get
 	 * the actual i2c bus frequency.
 	 */
 	brg = get_brgfreq() / (32 * 2 * cpm->freq) - 3;
Signature · 2 lines
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Wolfram,

Quoted 8 lines

Bugfixes to the i2c-cpm driver

- enable correct interrupts (I2CER_TXE instead of I2CER_BUSY)
- replace forgotten iic with i2c
- fix typo (devided)
- prefix debug-output on init with 0x and add frequency

Could you rebase this to the i2c quilt series (http://khali.linux-fr.org/devel/linux-2.6/)?
The typo (devided) already has been fixed by Jean, so this part doesn't apply. Otherwise ACK.

Thanks,
Jochen

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi Jochen,

Quoted 1 line · Jochen Friedrich

Could you rebase this to the i2c quilt series (http://khali.linux-fr.org/devel/linux-2.6/)?

Here you go!

Have a nice weekend,

Wolfram

-------------------------------------------------------------------

Bugfixes to the i2c-cpm driver

- enable correct interrupts (I2CER_TXE instead of I2CER_BUSY)
- replace forgotten iic with i2c
- prefix debug-output on init with 0x and add frequency

---
 drivers/i2c/busses/i2c-cpm.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
i2c/busses/i2c-cpm.c renamed from i2c/busses/i2c-cpm.c.orig +4 -4
Index: drivers/i2c/busses/i2c-cpm.c
===================================================================
@@ -241,7 +241,7 @@
 		eieio();
 		setbits16(&tbdf->cbd_sc, BD_SC_READY);
 	} else {
-		dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr);
+		dev_dbg(&adap->dev, "cpm_i2c_write(abyte=0x%x)\n", addr);
 
 		memcpy(tb+1, pmsg->buf, pmsg->len);
 
@@ -350,7 +350,7 @@
 	}
 	/* Start transfer now */
 	/* Enable RX/TX/Error interupts */
-	out_8(&i2c_reg->i2cmr, I2CER_BUSY | I2CER_TXB | I2CER_RXB);
+	out_8(&i2c_reg->i2cmr, I2CER_TXE | I2CER_TXB | I2CER_RXB);
 	out_8(&i2c_reg->i2cer, 0xff);	/* Clear interrupt status */
 	/* Chip bug, set enable here */
 	setbits8(&i2c_reg->i2mod, I2MOD_EN);	/* Enable */
@@ -553,8 +553,8 @@
 
 	cpm_reset_i2c_params(cpm);
 
-	dev_dbg(&cpm->ofdev->dev, "i2c_ram %p, i2c_addr 0x%04x\n",
-		cpm->i2c_ram, cpm->i2c_addr);
+	dev_dbg(&cpm->ofdev->dev, "i2c_ram 0x%p, i2c_addr 0x%04x, freq %d\n",
+		cpm->i2c_ram, cpm->i2c_addr, cpm->freq);
 	dev_dbg(&cpm->ofdev->dev, "tbase 0x%04x, rbase 0x%04x\n",
 		(u8 __iomem *)cpm->tbase - DPRAM_BASE,
 		(u8 __iomem *)cpm->rbase - DPRAM_BASE);
Signature · 2 lines
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Applied
#8 lore raw
Quoted 10 lines · Jochen Friedrich
Quoted 8 lines · Wolfram Sang

Bugfixes to the i2c-cpm driver

- enable correct interrupts (I2CER_TXE instead of I2CER_BUSY)
- replace forgotten iic with i2c
- prefix debug-output on init with 0x and add frequency

Applied, thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c