From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/3] usb: ehci-sh: Add PHY init function with platform data
Date: Thu, 01 Mar 2012 05:56:54 +0000 [thread overview]
Message-ID: <4F4F0FA6.6010409@renesas.com> (raw)
In-Reply-To: <1330569162-9485-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com>
Hi,
Shimoda, Yoshihiro wrote:
> Hi,
>
> 2012/03/01 11:32, Nobuhiro Iwamatsu wrote:
>> In devices using ehci-sh, initialization of the PHY may be necessary.
>> This adds platform data to ehci-sh and provide function to initialize PHY.
>>
>> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> CC: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
>> ---
>> drivers/usb/host/ehci-sh.c | 12 ++++++++++++
>> include/linux/usb/ehci-sh.h | 29 +++++++++++++++++++++++++++++
>> 2 files changed, 41 insertions(+), 0 deletions(-)
>> create mode 100644 include/linux/usb/ehci-sh.h
>>
>> diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
>> index 9d9cf47..787b07e 100644
>> --- a/drivers/usb/host/ehci-sh.c
>> +++ b/drivers/usb/host/ehci-sh.c
>> @@ -11,6 +11,7 @@
>> */
>> #include <linux/platform_device.h>
>> #include <linux/clk.h>
>> +#include <linux/usb/ehci-sh.h>
>>
>> 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,13 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
>> goto fail_create_hcd;
>> }
>>
>> + if (pdev->dev.platform_data = NULL) {
>> + dev_err(&pdev->dev, "no platform data\n");
>> + ret = -ENODEV;
>> + goto fail_create_hcd;
>> + }
>> + pdata = pdev->dev.platform_data;
>> +
>> /* initialize hcd */
>> hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev,
>> dev_name(&pdev->dev));
>> @@ -168,6 +177,9 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
>> clk_enable(priv->fclk);
>> clk_enable(priv->iclk);
>>
>> + if (pdata->phy_init)
>> + pdata->phy_init(pdata->clkmode);
>
> The clkmode is only used by the phy_init(). So, I think that we can remove the
> clkmode. (In other words, the ehci-sh doesn't use the clkmode actually.)
>
> And then, According to your other 2 patches, the current platforms don't
> use the phy_init(). So, if a platform_device doesn't have the platform_data,
> it is better for ehci-sh to ignore the parameter, I think.
OK, I'll fix these.
Thanks,
Nobuhiro
prev parent reply other threads:[~2012-03-01 5:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 2:32 [PATCH 1/3] usb: ehci-sh: Add PHY init function with platform data Nobuhiro Iwamatsu
2012-03-01 3:00 ` Shimoda, Yoshihiro
2012-03-01 5:56 ` Nobuhiro Iwamatsu [this message]
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=4F4F0FA6.6010409@renesas.com \
--to=nobuhiro.iwamatsu.yj@renesas.com \
--cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.