All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yunzhi Li <lyz@rock-chips.com>
To: Paul Zimmerman <Paul.Zimmerman@synopsys.com>,
	"heiko@sntech.de" <heiko@sntech.de>,
	"dianders@chromium.org" <dianders@chromium.org>
Cc: "olof@lixom.net" <olof@lixom.net>,
	"huangtao@rock-chips.com" <huangtao@rock-chips.com>,
	"ulrich.prinz@googlemail.com" <ulrich.prinz@googlemail.com>,
	"zyw@rock-chips.com" <zyw@rock-chips.com>,
	"cf@rock-chips.com" <cf@rock-chips.com>,
	"linux-rockchip@lists.infradead.org" 
	<linux-rockchip@lists.infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/5] usb: dwc2: Add generic PHY framework support for dwc2 usb controler platform driver.
Date: Mon, 08 Dec 2014 11:58:09 +0800	[thread overview]
Message-ID: <548521D1.2060509@rock-chips.com> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E0304844FFB50@US01WEMBX2.internal.synopsys.com>

Hi Paul:

Thank you for replying.

On 2014/12/6 3:04, Paul Zimmerman wrote:
>> From: Yunzhi Li [mailto:lyz@rock-chips.com]
>> Sent: Friday, December 05, 2014 4:52 AM
>>
>> Get PHY parameters from devicetree and power off usb PHY during
>> system suspend.
>>
>> Signed-off-by: Yunzhi Li <lyz@rock-chips.com>
>> ---
>>
>>   drivers/usb/dwc2/gadget.c   | 33 ++++++++++++---------------------
>>   drivers/usb/dwc2/platform.c | 34 ++++++++++++++++++++++++++++++++++
>>   2 files changed, 46 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
>> index 200168e..2601c61 100644
>> --- a/drivers/usb/dwc2/gadget.c
>> +++ b/drivers/usb/dwc2/gadget.c
>> [...]
>>
>>   	/*
>> -	 * Attempt to find a generic PHY, then look for an old style
>> -	 * USB PHY, finally fall back to pdata
>> +	 * If platform probe couldn't find a generic PHY or an old style
>> +	 * USB PHY, fall back to pdata
>>   	 */
>> -	phy = devm_phy_get(dev, "usb2-phy");
>> -	if (IS_ERR(phy)) {
>> -		uphy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
>> -		if (IS_ERR(uphy)) {
>> -			/* Fallback for pdata */
>> -			plat = dev_get_platdata(dev);
>> -			if (!plat) {
>> -				dev_err(dev,
>> -				"no platform data or transceiver defined\n");
>> -				return -EPROBE_DEFER;
>> -			}
>> -			hsotg->plat = plat;
>> -		} else
>> -			hsotg->uphy = uphy;
>> -	} else {
>> -		hsotg->phy = phy;
>> +	if (IS_ERR_OR_NULL(hsotg->phy) && IS_ERR_OR_NULL(hsotg->uphy)) {
>> +		plat = dev_get_platdata(dev);
>> +		if (!plat) {
>> +			dev_err(dev,
>> +			"no platform data or transceiver defined\n");
>> +			return -EPROBE_DEFER;
>> +		}
>> +		hsotg->plat = plat;
>> +	} else if (hsotg->phy) {
> You have changed the behavior here. Previously, the driver would work
> even if there were no phys or pdata defined. Now it will return
> -EPROBE_DEFER instead. Are you sure that won't break any existing
> platforms?
>
I don't really catch your meaning. Could you please point out where is 
the difference? Thanks .

In previous version, if there were no phy or usb_phy defined, 
devm_phy_get() and devm_usb_get_phy() both failed, then driver falls 
back to find pdata, if no pdata defined dev_get_platdata() returns NULL, 
then dwc2_gadget_init returns -EPROBE_DEFER and the dwc2_driver_probe 
fail. So I think, for the dwc2 driver without my patch, when 
CONFIG_USB_DWC2_PERIPHERAL or CONFIG_USB_DWC2_DUAL_ROLE selected, if 
there were no phys or pdata defined, the driver probe will also return 
-EPROBE_DEFER. And when only CONFIG_USB_DWC2_HOST selected, the previous 
version driver didn't care any thing about phy, in my patch it will try 
to find a phy when platform driver probe, but do not fail probe if there 
isn't a phy node.



  reply	other threads:[~2014-12-08  3:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 12:52 [PATCH v2 0/5] Yunzhi Li
2014-12-05 12:52 ` Yunzhi Li
2014-12-05 12:52 ` [PATCH v2 1/5] phy: add a driver for the Rockchip SoC internal USB2.0 PHY Yunzhi Li
2014-12-05 12:52   ` Yunzhi Li
2014-12-05 12:52   ` Yunzhi Li
2014-12-05 13:38   ` Romain Perier
2014-12-05 13:38     ` Romain Perier
2014-12-05 13:38     ` Romain Perier
2014-12-08  4:12     ` Yunzhi Li
2014-12-08  4:12       ` Yunzhi Li
2014-12-08  4:12       ` Yunzhi Li
2014-12-05 12:52 ` [PATCH v2 2/5] Documentation: bindings: add doc for the Rockchip usb PHY Yunzhi Li
2014-12-05 12:52 ` [PATCH v2 3/5] usb: dwc2: Add generic PHY framework support for dwc2 usb controler platform driver Yunzhi Li
2014-12-05 19:04   ` Paul Zimmerman
2014-12-08  3:58     ` Yunzhi Li [this message]
2014-12-08 19:46       ` Paul Zimmerman
2014-12-05 12:52 ` [PATCH v2 4/5] ARM: dts: add rk3288 usb PHY Yunzhi Li
2014-12-05 12:52   ` Yunzhi Li
2014-12-05 13:47   ` Romain Perier
2014-12-05 13:47     ` Romain Perier
2014-12-05 13:47     ` Romain Perier

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=548521D1.2060509@rock-chips.com \
    --to=lyz@rock-chips.com \
    --cc=Paul.Zimmerman@synopsys.com \
    --cc=cf@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=ulrich.prinz@googlemail.com \
    --cc=zyw@rock-chips.com \
    /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.