Commit 319edafe authored by Catalin Marinas's avatar Catalin Marinas Committed by Jeff Garzik

smc911x: Add IRQ polarity configuration

Platforms like ARM Ltd's RealView require the IRQ polarity bit to be set
for the SMC9118 chip. This patch allows the dynamic configuration via
the smc911x_platdata structure.

This patch also changes the smc91x_platdata structure name to the
correct smc911x_platdata in the smc911x_drv_probe() function.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent bd2c4972
...@@ -180,7 +180,7 @@ static void PRINT_PKT(u_char *buf, int length) ...@@ -180,7 +180,7 @@ static void PRINT_PKT(u_char *buf, int length)
static void smc911x_reset(struct net_device *dev) static void smc911x_reset(struct net_device *dev)
{ {
struct smc911x_local *lp = netdev_priv(dev); struct smc911x_local *lp = netdev_priv(dev);
unsigned int reg, timeout=0, resets=1; unsigned int reg, timeout=0, resets=1, irq_cfg;
unsigned long flags; unsigned long flags;
DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__);
...@@ -252,7 +252,12 @@ static void smc911x_reset(struct net_device *dev) ...@@ -252,7 +252,12 @@ static void smc911x_reset(struct net_device *dev)
* Deassert IRQ for 1*10us for edge type interrupts * Deassert IRQ for 1*10us for edge type interrupts
* and drive IRQ pin push-pull * and drive IRQ pin push-pull
*/ */
SMC_SET_IRQ_CFG(lp, (1 << 24) | INT_CFG_IRQ_EN_ | INT_CFG_IRQ_TYPE_); irq_cfg = (1 << 24) | INT_CFG_IRQ_EN_ | INT_CFG_IRQ_TYPE_;
#ifdef SMC_DYNAMIC_BUS_CONFIG
if (lp->cfg.irq_polarity)
irq_cfg |= INT_CFG_IRQ_POL_;
#endif
SMC_SET_IRQ_CFG(lp, irq_cfg);
/* clear anything saved */ /* clear anything saved */
if (lp->pending_tx_skb != NULL) { if (lp->pending_tx_skb != NULL) {
...@@ -2054,7 +2059,7 @@ err_out: ...@@ -2054,7 +2059,7 @@ err_out:
*/ */
static int smc911x_drv_probe(struct platform_device *pdev) static int smc911x_drv_probe(struct platform_device *pdev)
{ {
struct smc91x_platdata *pd = pdev->dev.platform_data; struct smc911x_platdata *pd = pdev->dev.platform_data;
struct net_device *ndev; struct net_device *ndev;
struct resource *res; struct resource *res;
struct smc911x_local *lp; struct smc911x_local *lp;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
struct smc911x_platdata { struct smc911x_platdata {
unsigned long flags; unsigned long flags;
unsigned long irq_flags; /* IRQF_... */ unsigned long irq_flags; /* IRQF_... */
int irq_polarity;
}; };
#endif /* __SMC911X_H__ */ #endif /* __SMC911X_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment