Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303551
b: refs/heads/master
c: 3e0c70d
h: refs/heads/master
i:
  303549: 69cbdc5
  303547: c4c21b0
  303543: 403fbb3
  303535: 3448a70
  303519: e43c7df
  303487: 0e16390
v: v3
  • Loading branch information
Nobuhiro Iwamatsu authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent b84944c commit 246d115
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7af395922a9f2ba72f40a09641347b31cd1abad4
refs/heads/master: 3e0c70d050c7ed6d163897a6ac894f063c31b10f
8 changes: 8 additions & 0 deletions trunk/drivers/usb/host/ehci-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/platform_data/ehci-sh.h>

struct ehci_sh_priv {
struct clk *iclk, *fclk;
Expand Down Expand Up @@ -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;

Expand All @@ -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));
Expand Down Expand Up @@ -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");
Expand Down
28 changes: 28 additions & 0 deletions trunk/include/linux/platform_data/ehci-sh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* EHCI SuperH driver platform data
*
* Copyright (C) 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
* 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 */

0 comments on commit 246d115

Please sign in to comment.