From 246d115c6b7059f7abeaabcfac649fd6fb7fe52c Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Thu, 12 Apr 2012 15:48:49 +0900 Subject: [PATCH] --- yaml --- r: 303551 b: refs/heads/master c: 3e0c70d050c7ed6d163897a6ac894f063c31b10f h: refs/heads/master i: 303549: 69cbdc59fb623e98fe7346eadb9d950c902919ab 303547: c4c21b098a05f3d4445b2ecbad4525a3049dca74 303543: 403fbb3594ed20e1f4b58c842682e14eeac21a59 303535: 3448a706f0b297dfe400879254eac7c5c71cb411 303519: e43c7dfdb41e0da37b811c926398a73110a12793 303487: 0e163904011df8c405b98a529463625c37084b67 v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/ehci-sh.c | 8 ++++++ trunk/include/linux/platform_data/ehci-sh.h | 28 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 trunk/include/linux/platform_data/ehci-sh.h diff --git a/[refs] b/[refs] index f78b77d24e57..abe23bc2e820 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7af395922a9f2ba72f40a09641347b31cd1abad4 +refs/heads/master: 3e0c70d050c7ed6d163897a6ac894f063c31b10f diff --git a/trunk/drivers/usb/host/ehci-sh.c b/trunk/drivers/usb/host/ehci-sh.c index 9d9cf47d80da..ca819cdd0c5e 100644 --- a/trunk/drivers/usb/host/ehci-sh.c +++ b/trunk/drivers/usb/host/ehci-sh.c @@ -11,6 +11,7 @@ */ #include #include +#include struct ehci_sh_priv { struct clk *iclk, *fclk; @@ -100,6 +101,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) const struct hc_driver *driver = &ehci_sh_hc_driver; struct resource *res; struct ehci_sh_priv *priv; + struct ehci_sh_platdata *pdata; struct usb_hcd *hcd; int irq, ret; @@ -124,6 +126,9 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) goto fail_create_hcd; } + if (pdev->dev.platform_data != NULL) + pdata = pdev->dev.platform_data; + /* initialize hcd */ hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, dev_name(&pdev->dev)); @@ -168,6 +173,9 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) clk_enable(priv->fclk); clk_enable(priv->iclk); + if (pdata && pdata->phy_init) + pdata->phy_init(); + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret != 0) { dev_err(&pdev->dev, "Failed to add hcd"); diff --git a/trunk/include/linux/platform_data/ehci-sh.h b/trunk/include/linux/platform_data/ehci-sh.h new file mode 100644 index 000000000000..5c15a738e116 --- /dev/null +++ b/trunk/include/linux/platform_data/ehci-sh.h @@ -0,0 +1,28 @@ +/* + * EHCI SuperH driver platform data + * + * Copyright (C) 2012 Nobuhiro Iwamatsu + * Copyright (C) 2012 Renesas Solutions Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __USB_EHCI_SH_H +#define __USB_EHCI_SH_H + +struct ehci_sh_platdata { + void (*phy_init)(void); /* Phy init function */ +}; + +#endif /* __USB_EHCI_SH_H */