From patchwork Wed Jul 27 05:29:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lin X-Patchwork-Id: 1010542 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6R5OlPV010972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 27 Jul 2011 05:25:08 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qlwbh-0000ty-Kq; Wed, 27 Jul 2011 05:24:33 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qlwbh-0007ez-1S; Wed, 27 Jul 2011 05:24:33 +0000 Received: from db3ehsobe006.messaging.microsoft.com ([213.199.154.144] helo=DB3EHSOBE006.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QlwbO-0007bo-S8 for linux-arm-kernel@lists.infradead.org; Wed, 27 Jul 2011 05:24:16 +0000 Received: from mail15-db3-R.bigfish.com (10.3.81.247) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.22; Wed, 27 Jul 2011 05:24:12 +0000 Received: from mail15-db3 (localhost.localdomain [127.0.0.1]) by mail15-db3-R.bigfish.com (Postfix) with ESMTP id 789C3C50372; Wed, 27 Jul 2011 05:24:12 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail15-db3 (localhost.localdomain [127.0.0.1]) by mail15-db3 (MessageSwitch) id 1311744252304388_3797; Wed, 27 Jul 2011 05:24:12 +0000 (UTC) Received: from DB3EHSMHS010.bigfish.com (unknown [10.3.81.247]) by mail15-db3.bigfish.com (Postfix) with ESMTP id 3BC791A1004B; Wed, 27 Jul 2011 05:24:12 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS010.bigfish.com (10.3.87.110) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 27 Jul 2011 05:24:12 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Wed, 27 Jul 2011 00:24:10 -0500 Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p6R5NxPD008821; Wed, 27 Jul 2011 00:24:08 -0500 (CDT) From: Tony Lin To: Subject: [PATCH v3 4/6] ARM: mxs: make ehci-mxc more flexible to be used on different platforms Date: Wed, 27 Jul 2011 13:29:32 +0800 Message-ID: <1311744574-3610-5-git-send-email-tony.lin@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1311744574-3610-1-git-send-email-tony.lin@freescale.com> References: <1311744574-3610-1-git-send-email-tony.lin@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110727_012415_246028_4DAE18DE X-CRM114-Status: GOOD ( 17.90 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [213.199.154.144 listed in list.dnswl.org] Cc: koen.beel.barco@gmail.com, stern@rowland.harvard.edu, s.hauer@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Jul 2011 05:25:08 +0000 (UTC) change ehci_irq to mxc_ehci_irq to give chance do some platform specific actions in irq handler for different platforms. add void pointer in the last of mxc_usbh_platform_data structure so that additional information could be added to that field if needed. Signed-off-by: Tony Lin --- arch/arm/mach-mxs/include/mach/hardware.h | 2 ++ arch/arm/mach-mxs/include/mach/mxs.h | 12 +++++++++++- drivers/usb/host/Kconfig | 2 +- drivers/usb/host/ehci-mxc.c | 15 ++++++++++++++- include/linux/fsl_devices.h | 2 ++ 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-mxs/include/mach/hardware.h b/arch/arm/mach-mxs/include/mach/hardware.h index 53e89a0..affa72b 100644 --- a/arch/arm/mach-mxs/include/mach/hardware.h +++ b/arch/arm/mach-mxs/include/mach/hardware.h @@ -26,4 +26,6 @@ #define IOMEM(addr) ((void __force __iomem *)(addr)) #endif +#include "mxs.h" + #endif /* __MACH_MXS_HARDWARE_H__ */ diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h index 35a89dd..0661e90 100644 --- a/arch/arm/mach-mxs/include/mach/mxs.h +++ b/arch/arm/mach-mxs/include/mach/mxs.h @@ -35,7 +35,17 @@ machine_is_mx28evk() || \ machine_is_tx28() || \ 0) - +#define cpu_is_mx1() 0 +#define cpu_is_mx21() 0 +#define cpu_is_mx25() 0 +#define cpu_is_mx27() 0 +#define cpu_is_mx31() 0 +#define cpu_is_mx35() 0 +#define cpu_is_mx50() 0 +#define cpu_is_mx51() 0 +#define cpu_is_mx53() 0 +#define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) +#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) /* * IO addresses common to MXS-based */ diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index ab085f1..6a5905b 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -139,7 +139,7 @@ config USB_EHCI_FSL config USB_EHCI_MXC bool "Support for Freescale on-chip EHCI USB controller" - depends on USB_EHCI_HCD && ARCH_MXC + depends on USB_EHCI_HCD && (ARCH_MXC || ARCH_MXS) select USB_EHCI_ROOT_HUB_TT ---help--- Variation of ARC USB block used in some Freescale chips. diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index cbf60a6..c93f9ae 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c @@ -64,6 +64,19 @@ static int ehci_mxc_setup(struct usb_hcd *hcd) return 0; } +static irqreturn_t mxc_ehci_irq(struct usb_hcd *hcd) +{ + struct mxc_usbh_platform_data *pdata; + + pdata = hcd->self.controller->platform_data; + if (pdata->plt_irq_handler == NULL) + goto out; + pdata->plt_irq_handler(pdata); + +out: + return ehci_irq(hcd); +} + static const struct hc_driver ehci_mxc_hc_driver = { .description = hcd_name, .product_desc = "Freescale On-Chip EHCI Host Controller", @@ -72,7 +85,7 @@ static const struct hc_driver ehci_mxc_hc_driver = { /* * generic hardware linkage */ - .irq = ehci_irq, + .irq = mxc_ehci_irq, .flags = HCD_USB2 | HCD_MEMORY, /* diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index cb19260..cf441e8 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h @@ -120,6 +120,8 @@ struct mxc_usbh_platform_data { unsigned int portsc; struct otg_transceiver *otg; + void (*plt_irq_handler)(struct mxc_usbh_platform_data *pdata); + void *ppriv; }; struct spi_device;