public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: linux-mips@linux-mips.org, i2c@lm-sensors.org
Cc: ralf@linux-mips.org
Subject: [PATCH] Alchemy: SMBus resource fix
Date: Sat, 5 Apr 2008 22:16:21 +0400	[thread overview]
Message-ID: <200804052216.21699.sshtylyov@ru.mvista.com> (raw)

The Alchemy platform code registers the SMBus device using the virtual address
of its registers instead of the physical one -- fix this, taking into account
that actually the whole megabyte is decoded by any of the programmable serial
controllers (one of which is SMBus), and that all the Alchemy peripherals are
directly mappable into KSEG1 kernel space and therefore ioremap() call would
just boil down to CKSEG1ADDR() invocation.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...

 arch/mips/au1000/common/platform.c |    4 ++--
 drivers/i2c/busses/i2c-au1550.c    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/mips/au1000/common/platform.c
===================================================================
--- linux-2.6.orig/arch/mips/au1000/common/platform.c
+++ linux-2.6/arch/mips/au1000/common/platform.c
@@ -274,8 +274,8 @@ static struct platform_device smc91x_dev
 #ifdef SMBUS_PSC_BASE
 static struct resource pbdb_smbus_resources[] = {
 	{
-		.start	= SMBUS_PSC_BASE,
-		.end	= SMBUS_PSC_BASE + 0x24 - 1,
+		.start	= CPHYSADDR(SMBUS_PSC_BASE),
+		.end	= CPHYSADDR(SMBUS_PSC_BASE + 0xfffff),
 		.flags	= IORESOURCE_MEM,
 	},
 };
Index: linux-2.6/drivers/i2c/busses/i2c-au1550.c
===================================================================
--- linux-2.6.orig/drivers/i2c/busses/i2c-au1550.c
+++ linux-2.6/drivers/i2c/busses/i2c-au1550.c
@@ -335,7 +335,7 @@ i2c_au1550_probe(struct platform_device 
 		goto out_mem;
 	}
 
-	priv->psc_base = r->start;
+	priv->psc_base = CKSEG1ADDR(r->start);
 	priv->xfer_timeout = 200;
 	priv->ack_timeout = 200;
 

             reply	other threads:[~2008-04-05 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05 18:16 Sergei Shtylyov [this message]
2008-04-08 11:05 ` [PATCH] Alchemy: SMBus resource fix Ralf Baechle

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=200804052216.21699.sshtylyov@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=i2c@lm-sensors.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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