All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: jochen-NIgtFMG+Po8@public.gmane.org
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: [PATCH] Bugfixes for i2c-cpm.c
Date: Fri, 20 Jun 2008 10:41:55 +0200	[thread overview]
Message-ID: <20080620084155.GA17701@pengutronix.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2164 bytes --]


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

Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Sorry for the resend; the CC to Jochen was dropped, haven't figured out
why, yet.

 drivers/i2c/busses/i2c-cpm.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: drivers/i2c/busses/i2c-cpm.c
===================================================================
--- drivers/i2c/busses/i2c-cpm.c.orig
+++ 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;

-- 
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

             reply	other threads:[~2008-06-20  8:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20  8:41 Wolfram Sang [this message]
     [not found] ` <20080620084155.GA17701-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-23 12:44   ` [PATCH] Bugfixes for i2c-cpm.c Wolfram Sang
     [not found]     ` <20080623124425.GE3926-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-23 13:59       ` Jean Delvare
     [not found]         ` <20080623155909.525f5095-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-06-23 15:07           ` Wolfram Sang
2008-06-27  8:15           ` Jochen Friedrich
2008-06-24 14:15   ` Laurent Pinchart
     [not found]     ` <200806241615.08826.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
2008-06-27  8:22       ` Jochen Friedrich
     [not found]         ` <4864A342.4020900-NIgtFMG+Po8@public.gmane.org>
2008-06-27  8:40           ` Wolfram Sang
2008-07-01 13:26           ` Laurent Pinchart
     [not found]             ` <200807011526.14514.laurentp-BSmb2szPELAwsLKNixborgC/G2K4zDHf@public.gmane.org>
2008-07-02 11:40               ` Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2008-06-19 13:09 Wolfram Sang
     [not found] ` <20080619130922.GF3860-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-27 16:22   ` Jochen Friedrich
     [not found]     ` <486513C5.7040105-NIgtFMG+Po8@public.gmane.org>
2008-06-27 16:58       ` Wolfram Sang
     [not found]         ` <20080627165808.GE3931-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-06-27 17:06           ` Jochen Friedrich
     [not found]             ` <48651E1E.7060002-NIgtFMG+Po8@public.gmane.org>
2008-06-28  7:03               ` Jean Delvare

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=20080620084155.GA17701@pengutronix.de \
    --to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=jochen-NIgtFMG+Po8@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.