From: tony.lin@freescale.com (Tony Lin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/7] ARM: mxs: make ehci-mxc more flexible to be used on different platforms
Date: Tue, 2 Aug 2011 16:39:41 +0800 [thread overview]
Message-ID: <1312274386-6833-3-git-send-email-tony.lin@freescale.com> (raw)
In-Reply-To: <1312274386-6833-1-git-send-email-tony.lin@freescale.com>
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 <tony.lin@freescale.com>
---
drivers/usb/host/Kconfig | 2 +-
drivers/usb/host/ehci-mxc.c | 13 ++++++++++++-
include/linux/fsl_devices.h | 2 ++
3 files changed, 15 insertions(+), 2 deletions(-)
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..6d3c53c 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -64,6 +64,17 @@ 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)
+ pdata->plt_irq_handler(pdata);
+
+ 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 +83,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..d94e9e5 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 *priv;
};
struct spi_device;
--
1.7.0.4
next prev parent reply other threads:[~2011-08-02 8:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-02 8:39 [PATCH v4 0/7] ARM: mx28: add usb host function Tony Lin
2011-08-02 8:39 ` [PATCH v4 1/7] ARM: mxs: ehci: consolidate definitions and structures to share among platforms Tony Lin
2011-08-02 8:39 ` Tony Lin [this message]
2011-08-02 8:39 ` [PATCH v4 3/7] ARM: mxs: add usb clocks to clock tree Tony Lin
2011-08-02 8:39 ` [PATCH v4 4/7] ARM: mxs: enable usb phy power supply Tony Lin
2011-08-02 8:39 ` [PATCH v4 5/7] ARM: mxs: add usb platform operations Tony Lin
2011-08-02 8:39 ` [PATCH v4 6/7] " Tony Lin
2011-08-02 8:39 ` [PATCH v4 7/7] ARM: mxs: add usb host function to default config Tony Lin
2011-08-05 7:53 ` [PATCH v4 0/7] ARM: mx28: add usb host function Lin Tony-B19295
2011-08-05 13:03 ` s.hauer at pengutronix.de
2011-08-05 14:22 ` Peter Chen
2011-08-05 16:52 ` s.hauer at pengutronix.de
2011-08-08 2:03 ` Lin Tony-B19295
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=1312274386-6833-3-git-send-email-tony.lin@freescale.com \
--to=tony.lin@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).