[PATCH] cs89x0: cleanly implement ixdp2x01 and pnx0501 support
Implement suitable versions of the readword/writeword macros for ixdp2x01 and pnx0501. Handle the 32-bit spacing of the registers in these functions instead of in the header file. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Cc: dmitry pervushin <dpervushin@ru.mvista.com> Cc: <dsaxena@plexity.net> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
3eaa5e7dcc
commit
3b68d70dff
@ -338,6 +338,32 @@ out:
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_IXDP2X01)
|
||||
static int
|
||||
readword(unsigned long base_addr, int portno)
|
||||
{
|
||||
return (u16)__raw_readl(base_addr + (portno << 1));
|
||||
}
|
||||
|
||||
static void
|
||||
writeword(unsigned long base_addr, int portno, int value)
|
||||
{
|
||||
__raw_writel((u16)value, base_addr + (portno << 1));
|
||||
}
|
||||
#else
|
||||
#if defined(CONFIG_ARCH_PNX0501)
|
||||
static int
|
||||
readword(unsigned long base_addr, int portno)
|
||||
{
|
||||
return inw(base_addr + (portno << 1));
|
||||
}
|
||||
|
||||
static void
|
||||
writeword(unsigned long base_addr, int portno, int value)
|
||||
{
|
||||
outw(value, base_addr + (portno << 1));
|
||||
}
|
||||
#else
|
||||
static int
|
||||
readword(unsigned long base_addr, int portno)
|
||||
{
|
||||
@ -349,6 +375,8 @@ writeword(unsigned long base_addr, int portno, int value)
|
||||
{
|
||||
outw(value, base_addr + portno);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int
|
||||
readreg(struct net_device *dev, int regno)
|
||||
|
Reference in New Issue
Block a user