All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Baruch Siach <baruch@tkos.co.il>, Felipe Balbi <balbi@ti.com>,
	Peter Chen <Peter.Chen@freescale.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Antoine Tenart <antoine.tenart@free-electrons.com>
Subject: Re: [PATCH RFC] usb: chipidea: add support for usb_phy in generic usb2
Date: Mon, 5 Jan 2015 11:09:35 +0530	[thread overview]
Message-ID: <54AA2397.5000708@ti.com> (raw)
In-Reply-To: <1f6e0195fcb215d8378db66bdd67900e57b9d290.1420351491.git.baruch@tkos.co.il>

Hi,

On Sunday 04 January 2015 11:58 AM, Baruch Siach wrote:
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  drivers/usb/chipidea/ci_hdrc_usb2.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> I'm sending this as RFC as I'm not sure this is the right thing to do. There
> seems to be a move away from USB specific PHY drivers towards the generic PHY
> framework (drivers/phy). The trouble is that my PHY is similar to the mxs PHY
> (phy-mxs-usb.c), and like mxs I need the notify_connect/notify_disconnect
> callbacks. This functionality is not available is the generic PHY
> framework. Having support for both 'usb-phy' and 'phy' properties (as dwc3
> seems to do) is particularly bad, since the distinction between the two is a
> Linux implementation detail that has nothing to do with hardware description.
> 
> So my questions are:
> 
>    1. Is there a plan to add notifications support to the generic PHY?
> 
>    2. If not, what are my options?

extcon framework has notification support. I feel your driver should use the
extcon framework along with phy framework.

Adding extcon support in the generic PHY framework is something I have not
thought through in detail.

Thanks
Kishon

> 
> Thanks,
> baruch
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c b/drivers/usb/chipidea/ci_hdrc_usb2.c
> index 45844c951788..cc3aeb781a57 100644
> --- a/drivers/usb/chipidea/ci_hdrc_usb2.c
> +++ b/drivers/usb/chipidea/ci_hdrc_usb2.c
> @@ -35,11 +35,16 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct ci_hdrc_usb2_priv *priv;
>  	struct ci_hdrc_platform_data *ci_pdata = dev_get_platdata(dev);
> +	struct usb_phy *usb_phy;
>  	int ret;
>  
>  	if (!ci_pdata)
>  		ci_pdata = &ci_default_pdata;
>  
> +	usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
> +	if (!IS_ERR(usb_phy))
> +		ci_pdata->usb_phy = usb_phy;
> +
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
> 

  reply	other threads:[~2015-01-05  5:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04  6:28 [PATCH RFC] usb: chipidea: add support for usb_phy in generic usb2 Baruch Siach
2015-01-05  5:39 ` Kishon Vijay Abraham I [this message]
2015-01-05  6:40   ` Baruch Siach
2015-01-09  1:49   ` Peter Chen

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=54AA2397.5000708@ti.com \
    --to=kishon@ti.com \
    --cc=Peter.Chen@freescale.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=baruch@tkos.co.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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.