diff options
author | Joe Perches <joe@perches.com> | 2015-05-05 20:06:06 +0300 |
---|---|---|
committer | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2015-09-23 09:44:26 +0300 |
commit | 0fec65130b9f11a73d74f47025491f97f82ba070 (patch) | |
tree | 52b39e84ef4717d17e62a0d9401e8d7f7f718f34 /drivers/net/arcnet/com20020_cs.c | |
parent | e5fcfc1f8d3cfaf432a93d39df3e5d7718c58848 (diff) | |
download | linux-0fec65130b9f11a73d74f47025491f97f82ba070.tar.xz |
arcnet: com20020: Use arcnet_<I/O> routines
Simplify and make consistent the current uses of inb/outb
by using the newly introduced arcnet_<I/O> equivalents.
o Add new #defines for register offsets
There is an register offset, 8, that is unnamed and used as-is.
o Remove old #defines that included the ioaddr
o Remove obfuscating macros by expanding them in-place where appropriate
o Create static inline com20020_set_subaddress for the SET_SUBADR macro
There is an unused arcnet config entry CONFIGSA100_CT6001 which added a
special #define BUS_ALIGN which was introduced but never used in fullhist git
tree commit 22cfce4b82b0 ("[ARCNET]: Fixes.") in Nov 2004 for Linux v2.6.10.
This BUS_ALIGN #define tries to allow 8 bit devices to work on a 16 bit
bus by aligning addresses to 16 bit boundaries.
Move this currently unused CONFIG_SA1100_CT6001 BUS_ALIGN macro from
com20020.h to arcdevice.h.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Diffstat (limited to 'drivers/net/arcnet/com20020_cs.c')
-rw-r--r-- | drivers/net/arcnet/com20020_cs.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c index 5fdde6946427..cf607ffcf358 100644 --- a/drivers/net/arcnet/com20020_cs.c +++ b/drivers/net/arcnet/com20020_cs.c @@ -56,25 +56,26 @@ static void regdump(struct net_device *dev) int count; netdev_dbg(dev, "register dump:\n"); - for (count = ioaddr; count < ioaddr + 16; count++) { + for (count = 0; count < 16; count++) { if (!(count % 16)) - pr_cont("%04X:", count); - pr_cont(" %02X", inb(count)); + pr_cont("%04X:", ioaddr + count); + pr_cont(" %02X", arcnet_inb(ioaddr, count)); } pr_cont("\n"); netdev_dbg(dev, "buffer0 dump:\n"); /* set up the address register */ count = 0; - outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); - outb(count & 0xff, _ADDR_LO); + arcnet_outb((count >> 8) | RDDATAflag | AUTOINCflag, + ioaddr, com20020_REG_W_ADDR_HI); + arcnet_outb(count & 0xff, ioaddr, COM20020_REG_W_ADDR_LO); for (count = 0; count < 256 + 32; count++) { if (!(count % 16)) pr_cont("%04X:", count); /* copy the data */ - pr_cont(" %02X", inb(_MEMDATA)); + pr_cont(" %02X", arcnet_inb(ioaddr, COM20020_REG_RW_MEMDATA)); } pr_cont("\n"); #endif @@ -292,7 +293,9 @@ static int com20020_resume(struct pcmcia_device *link) int ioaddr = dev->base_addr; struct arcnet_local *lp = netdev_priv(dev); - ARCRESET; + arcnet_outb(lp->config | 0x80, ioaddr, COM20020_REG_W_CONFIG); + udelay(5); + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); } return 0; |