From patchwork Wed Nov 18 09:42:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram X-Patchwork-Id: 60976 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAI9idXv013909 for ; Wed, 18 Nov 2009 09:44:39 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id nAI9h7m2007791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Nov 2009 03:43:07 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id nAI9h7ft019686; Wed, 18 Nov 2009 03:43:07 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id CAD36806C3; Wed, 18 Nov 2009 03:42:48 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp31.itg.ti.com (dbdp31.itg.ti.com [172.24.170.98]) by linux.omap.com (Postfix) with ESMTP id 902158062A for ; Wed, 18 Nov 2009 03:42:12 -0600 (CST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id nAI9g8ev027756; Wed, 18 Nov 2009 15:12:09 +0530 (IST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by psplinux050.india.ti.com (8.13.1/8.13.1) with ESMTP id nAI9g884031577; Wed, 18 Nov 2009 15:12:08 +0530 Received: (from a0875517@localhost) by psplinux050.india.ti.com (8.13.1/8.13.1/Submit) id nAI9g8Gg031574; Wed, 18 Nov 2009 15:12:08 +0530 From: Sriramakrishnan To: netdev@vger.kernel.org Subject: [PATCH 2/3] TI Davinci EMAC : add platform specific interrupt enable/disable logic. Date: Wed, 18 Nov 2009 15:12:07 +0530 Message-Id: <1258537328-31527-3-git-send-email-srk@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1258537328-31527-2-git-send-email-srk@ti.com> References: <1258537328-31527-1-git-send-email-srk@ti.com> <1258537328-31527-2-git-send-email-srk@ti.com> Cc: Sriramakrishnan , davinci-linux-open-source@linux.davincidsp.com X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 6aec8f5..81931f8 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -487,6 +487,9 @@ struct emac_priv { struct mii_bus *mii_bus; struct phy_device *phydev; spinlock_t lock; + /*platform specific members*/ + void (*wrapper_int_enable) (void); + void (*wrapper_int_disable) (void); }; /* clock frequency for EMAC */ @@ -1001,6 +1004,8 @@ static void emac_int_disable(struct emac_priv *priv) emac_ctrl_write(EMAC_DM646X_CMRXINTEN, 0x0); emac_ctrl_write(EMAC_DM646X_CMTXINTEN, 0x0); /* NOTE: Rx Threshold and Misc interrupts are not disabled */ + if (priv->wrapper_int_disable) + priv->wrapper_int_disable(); local_irq_restore(flags); @@ -1020,6 +1025,9 @@ static void emac_int_disable(struct emac_priv *priv) static void emac_int_enable(struct emac_priv *priv) { if (priv->version == EMAC_VERSION_2) { + if (priv->wrapper_int_enable) + priv->wrapper_int_enable(); + emac_ctrl_write(EMAC_DM646X_CMRXINTEN, 0xff); emac_ctrl_write(EMAC_DM646X_CMTXINTEN, 0xff); @@ -2662,6 +2670,9 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev) priv->phy_mask = pdata->phy_mask; priv->rmii_en = pdata->rmii_en; priv->version = pdata->version; + priv->wrapper_int_enable = pdata->wrapper_interrupt_enable; + priv->wrapper_int_disable = pdata->wrapper_interrupt_disable; + emac_dev = &ndev->dev; /* Get EMAC platform data */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index ff55487..eb24dc0 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -25,6 +25,8 @@ struct emac_platform_data { u32 mdio_max_freq; u8 rmii_en; u8 version; + void (*wrapper_interrupt_enable) (void); + void (*wrapper_interrupt_disable) (void); }; enum {