diff options
author | Rob Herring <r.herring@freescale.com> | 2009-10-07 17:00:20 -0500 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2010-02-12 17:19:12 +0100 |
commit | 98a33e626a30ac58a5c6afdd18b6f789b7291ece (patch) | |
tree | 34c0131b42265d9b4a54c601728b6e58e2278679 /drivers/net | |
parent | 54bf8285fe72db7cdb3dab2fde2f2e9ee5717fdc (diff) |
smsc911x: add imx cpld spi register access
Add custom register read/write functions. Some i.MX 3-stack boards
have CPLD to do spi to parallel bus translation to talk to smsc911x.
Signed-off-by: Rob Herring <r.herring@freescale.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/smsc911x.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index e8b0d5e6e4bd..04907ae11f51 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -128,6 +128,16 @@ static inline u32 smsc911x_reg_read(struct smsc911x_data *pdata, u32 reg) if (pdata->config.flags & SMSC911X_USE_32BIT) return readl(pdata->ioaddr + reg); +#ifdef CONFIG_ARCH_MXC + if (pdata->config.flags & 0x8000) { + u32 data; + unsigned long flags; + spin_lock_irqsave(&pdata->dev_lock, flags); + data = spi_cpld_read(reg); + spin_unlock_irqrestore(&pdata->dev_lock, flags); + return data; + } else +#endif if (pdata->config.flags & SMSC911X_USE_16BIT) { u32 data; unsigned long flags; @@ -155,6 +165,15 @@ static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg, return; } +#ifdef CONFIG_ARCH_MXC + if (pdata->config.flags & 0x8000) { + unsigned long flags; + spin_lock_irqsave(&pdata->dev_lock, flags); + spi_cpld_write(reg, val); + spin_unlock_irqrestore(&pdata->dev_lock, flags); + return; + } else +#endif if (pdata->config.flags & SMSC911X_USE_16BIT) { unsigned long flags; |