From: Catalin Marinas <catalin.marinas@arm.com>
To: netdev@vger.kernel.org
Subject: [PATCH 2/3] smc911x: Add IRQ polarity configuration
Date: Mon, 20 Oct 2008 18:15:30 +0100 [thread overview]
Message-ID: <20081020171523.6277.86237.stgit@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20081020170917.6277.21228.stgit@pc1117.cambridge.arm.com>
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: Catalin Marinas <catalin.marinas@arm.com>
---
drivers/net/smc911x.c | 11 ++++++++---
include/linux/smc911x.h | 1 +
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 8aa7460..0216440 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -180,7 +180,7 @@ static void PRINT_PKT(u_char *buf, int length)
static void smc911x_reset(struct net_device *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;
DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__);
@@ -252,7 +252,12 @@ static void smc911x_reset(struct net_device *dev)
* Deassert IRQ for 1*10us for edge type interrupts
* 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 */
if (lp->pending_tx_skb != NULL) {
@@ -2054,7 +2059,7 @@ err_out:
*/
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 resource *res;
struct smc911x_local *lp;
diff --git a/include/linux/smc911x.h b/include/linux/smc911x.h
index b58f54c..521f371 100644
--- a/include/linux/smc911x.h
+++ b/include/linux/smc911x.h
@@ -7,6 +7,7 @@
struct smc911x_platdata {
unsigned long flags;
unsigned long irq_flags; /* IRQF_... */
+ int irq_polarity;
};
#endif /* __SMC911X_H__ */
next prev parent reply other threads:[~2008-10-20 17:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-20 17:12 [PATCH 0/3] smc911x driver updates Catalin Marinas
2008-10-20 17:15 ` [PATCH 1/3] smc911x: Allow Kconfig dependency on ARM Catalin Marinas
2008-10-20 17:15 ` Catalin Marinas [this message]
2008-10-20 17:15 ` [PATCH 3/3] smc911x: Make the driver safer on SMP Catalin Marinas
2008-10-22 10:57 ` Jeff Garzik
2008-10-22 11:01 ` Jeff Garzik
2008-10-22 11:04 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081020171523.6277.86237.stgit@pc1117.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.