devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	B29397-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	B20596-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	marex-ynQEQJNshbs@public.gmane.org,
	shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org,
	linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCH v6 12/14] usb: chipidea: permit driver bindings pass phy pointer
Date: Thu, 21 Jun 2012 09:18:22 +0200	[thread overview]
Message-ID: <4FE2CABE.7050708@pengutronix.de> (raw)
In-Reply-To: <1340260875-21934-13-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2400 bytes --]

On 06/21/2012 08:41 AM, Richard Zhao wrote:
> Sometimes, the driver bindings may know what phy they use.
> For example, when using device tree, the usb controller may have a
> phandler pointing to usb phy.
> 
> Signed-off-by: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Reviewed-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> Acked-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> Tested-by: Subodh Nijsure <snijsure-4jo+YWezP1RWk0Htik3J/w@public.gmane.org>

[...]

> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -1684,7 +1684,8 @@ static int udc_start(struct ci13xxx *ci)
>  
>  	ci->gadget.ep0 = &ci->ep0in->ep;
>  
> -	ci->transceiver = usb_get_transceiver();
> +	if (ci->global_phy) {
                           ^^^

This doesn't compile, closing curly brackets are missing.

> +		ci->transceiver = usb_get_transceiver();
>  
>  	if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
>  		if (ci->transceiver == NULL) {
> @@ -1728,7 +1729,8 @@ static int udc_start(struct ci13xxx *ci)
>  remove_trans:
>  	if (ci->transceiver) {
>  		otg_set_peripheral(ci->transceiver->otg, &ci->gadget);
> -		usb_put_transceiver(ci->transceiver);
> +		if (ci->global_phy)
> +			usb_put_transceiver(ci->transceiver);
>  	}
>  
>  	dev_err(dev, "error = %i\n", retval);
> @@ -1737,7 +1739,7 @@ remove_dbg:
>  unreg_device:
>  	device_unregister(&ci->gadget.dev);
>  put_transceiver:
> -	if (ci->transceiver)
> +	if (ci->transceiver && ci->global_phy)
>  		usb_put_transceiver(ci->transceiver);
>  free_pools:
>  	dma_pool_destroy(ci->td_pool);
> @@ -1771,7 +1773,8 @@ static void udc_stop(struct ci13xxx *ci)
>  
>  	if (ci->transceiver) {
>  		otg_set_peripheral(ci->transceiver->otg, NULL);
> -		usb_put_transceiver(ci->transceiver);
> +		if (ci->global_phy)
> +			usb_put_transceiver(ci->transceiver);
>  	}
>  	dbg_remove_files(&ci->gadget.dev);
>  	device_unregister(&ci->gadget.dev);
> diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
> index be078f0..544825d 100644

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  parent reply	other threads:[~2012-06-21  7:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21  6:41 [PATCH v6 00/14] add imx usb driver based on Greg next tree Richard Zhao
     [not found] ` <1340260875-21934-1-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-06-21  6:41   ` [PATCH v6 01/14] usb: chipidea: remove unneeded NULL check Richard Zhao
2012-06-21  6:41   ` [PATCH v6 02/14] usb: chipidea: drop useless arch-check Richard Zhao
2012-06-21  6:41   ` [PATCH v6 03/14] usb: chipidea: msm: add missing section annotation Richard Zhao
2012-06-21  6:41   ` [PATCH v6 04/14] usb: chipidea: msm: add remove method Richard Zhao
2012-06-21  6:41   ` [PATCH v6 05/14] USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_data Richard Zhao
2012-06-21  6:41   ` [PATCH v6 06/14] USB: Chipidea: rename struct ci13xxx variables from udc to ci Richard Zhao
2012-06-21  6:41   ` [PATCH v6 07/14] USB: Chipidea: add unified ci13xxx_{add,remove}_device for platform drivers Richard Zhao
     [not found]     ` <1340260875-21934-8-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-06-25  3:08       ` Richard Zhao
2012-06-21  6:41   ` [PATCH v6 08/14] USB: Chipidea: add ci13xxx device id management Richard Zhao
2012-06-21  6:41   ` [PATCH v6 09/14] usb: chipidea: select USB_EHCI_ROOT_HUB_TT in USB_CHIPIDEA_HOST of Kconfig Richard Zhao
2012-06-21  6:41   ` [PATCH v6 10/14] usb: otg: add notify_connect/notify_disconnect callback Richard Zhao
2012-06-21  6:41   ` [PATCH v6 11/14] USB: notify phy when root hub port connect change Richard Zhao
2012-06-21  6:41   ` [PATCH v6 12/14] usb: chipidea: permit driver bindings pass phy pointer Richard Zhao
     [not found]     ` <1340260875-21934-13-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-06-21  7:18       ` Marc Kleine-Budde [this message]
     [not found]         ` <4FE2CABE.7050708-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-06-21  8:38           ` Richard Zhao
2012-06-21  8:51           ` [PATCH v7] " Richard Zhao
     [not found]             ` <1340268682-14654-1-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-06-21 20:42               ` Marc Kleine-Budde
     [not found]                 ` <4FE3874C.2040504-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-06-25  3:07                   ` Richard Zhao
2012-06-21  6:41   ` [PATCH v6 13/14] usb: otg: add basic mxs phy driver support Richard Zhao
     [not found]     ` <1340260875-21934-14-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-06-26  9:15       ` Alexander Shishkin
     [not found]         ` <87fw9iv3h0.fsf-qxRn5AmX6ZD9BXuAQUXR0fooFf0ArEBIu+b9c/7xato@public.gmane.org>
2012-06-27  6:47           ` Richard Zhao
2012-06-21  6:41   ` [PATCH v6 14/14] usb: chipidea: add imx platform driver Richard Zhao
     [not found]     ` <1340260875-21934-15-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-06-21 15:23       ` Richard Zhao
2012-06-21  7:24   ` [PATCH v6 00/14] add imx usb driver based on Greg next tree Marc Kleine-Budde
     [not found]     ` <4FE2CC37.8010202-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-06-21  8:52       ` Richard Zhao
     [not found]         ` <20120621085246.GC1582-iWYTGMXpHj9ITqJhDdzsOjpauB2SiJktrE5yTffgRl4@public.gmane.org>
2012-06-21  9:10           ` Marc Kleine-Budde
     [not found]             ` <4FE2E4FF.8030700-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-06-25  3:00               ` Richard Zhao
2012-06-25 16:18   ` Fabio Estevam
     [not found]     ` <CAOMZO5BEVrPrgZ7E5xUE-_3zXb317mzqoZXaxXw1SNACuRzOPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-26  2:37       ` Shawn Guo
     [not found]         ` <20120626023754.GJ2342-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-06-26 12:25           ` Marek Vasut
2012-07-30 22:27           ` Fabio Estevam

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=4FE2CABE.7050708@pengutronix.de \
    --to=mkl-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=B20596-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=B29397-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=marex-ynQEQJNshbs@public.gmane.org \
    --cc=richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).