public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Alchemy: SMBus resource fix
@ 2008-04-05 18:16 Sergei Shtylyov
  2008-04-08 11:05 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2008-04-05 18:16 UTC (permalink / raw)
  To: linux-mips, i2c; +Cc: ralf

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;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Alchemy: SMBus resource fix
  2008-04-05 18:16 [PATCH] Alchemy: SMBus resource fix Sergei Shtylyov
@ 2008-04-08 11:05 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2008-04-08 11:05 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mips, i2c

On Sat, Apr 05, 2008 at 10:16:21PM +0400, Sergei Shtylyov wrote:

> 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...

Looks ok, so I'll send it to Linus.

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-08 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-05 18:16 [PATCH] Alchemy: SMBus resource fix Sergei Shtylyov
2008-04-08 11:05 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox