linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/9] usb: chipidea: ci13xxx-imx: add "dr_mode" property to device tree bindings
Date: Fri, 16 Nov 2012 12:55:13 +0100	[thread overview]
Message-ID: <50A629A1.1010202@pengutronix.de> (raw)
In-Reply-To: <878va17oii.fsf@ashishki-desk.ger.corp.intel.com>

On 11/16/2012 12:53 PM, Alexander Shishkin wrote:
> Michael Grzeschik <m.grzeschik@pengutronix.de> writes:
> 
>> From: Marc Kleine-Budde <mkl@pengutronix.de>
>>
>> Its necessary to limit a hostonly soc to its single role, since
>> debugging has shown that reading on the "CAP_DCCPARAMS" register inside
>> a host-only port, what ci_hdrc_gadget_init does, can lead to an
>> instable behaviour of the IC.
> 
> Probably typos: should be "it's" and "unstable".
> 
> [snip]
> 
>> --- a/drivers/usb/chipidea/ci13xxx_imx.c
>> +++ b/drivers/usb/chipidea/ci13xxx_imx.c
>> @@ -237,6 +237,8 @@ static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
>>  		}
>>  	}
>>  
>> +	ci13xxx_get_dr_mode(pdev->dev.of_node, pdata);
>> +
>>  	plat_ci = ci13xxx_add_device(&pdev->dev,
>>  				pdev->resource, pdev->num_resources,
>>  				pdata);
>> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
>> index b50b77a..3e3e159 100644
>> --- a/drivers/usb/chipidea/core.c
>> +++ b/drivers/usb/chipidea/core.c
>> @@ -63,6 +63,7 @@
>>  #include <linux/kernel.h>
>>  #include <linux/slab.h>
>>  #include <linux/pm_runtime.h>
>> +#include <linux/of_platform.h>
>>  #include <linux/usb/ch9.h>
>>  #include <linux/usb/gadget.h>
>>  #include <linux/usb/otg.h>
>> @@ -521,6 +522,23 @@ void ci13xxx_remove_device(struct platform_device *pdev)
>>  }
>>  EXPORT_SYMBOL_GPL(ci13xxx_remove_device);
>>  
>> +void ci13xxx_get_dr_mode(struct device_node *of_node, struct ci13xxx_platform_data *pdata)
>> +{
>> +	const unsigned char *dr_mode;
>> +
>> +	dr_mode = of_get_property(of_node, "dr_mode", NULL);
>> +	if (!dr_mode)
>> +		return;
>> +
>> +	if (!strcmp(dr_mode, "host"))
>> +		pdata->flags |= CI13XXX_DR_MODE_HOST;
>> +	else if (!strcmp(dr_mode, "peripheral"))
>> +		pdata->flags |= CI13XXX_DR_MODE_PERIPHERAL;
>> +	else if (!strcmp(dr_mode, "otg"))
>> +		pdata->flags |= CI13XXX_DR_MODE_HOST | CI13XXX_DR_MODE_PERIPHERAL;
>> +}
>> +EXPORT_SYMBOL_GPL(ci13xxx_get_dr_mode);
>> +
> 
> I'd prefer this function to live in ci13xxx_imx, since that's where it's
> used and it doesn't really need anything from core.c anyway. Or maybe it
> would make sense to make it even more generic (for other devitetree
> users), since you're saying that other drivers are using this already.

+1

Move it next to the phy-mode and make it work the same way (i.e. return
an enum).

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   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121116/f54165f8/attachment-0001.sig>

  reply	other threads:[~2012-11-16 11:55 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-14 16:19 [PATCH 0/9] chipidea fixes and features Michael Grzeschik
2012-11-14 16:19 ` [PATCH 1/9] usb: chipidea: pci: mark platformdata as static and __devinitdata Michael Grzeschik
2012-11-16 10:06   ` Alexander Shishkin
2012-11-16 10:17     ` Marc Kleine-Budde
2012-11-16 11:41       ` Alexander Shishkin
2012-11-16 12:02     ` Greg KH
2012-11-14 16:19 ` [PATCH 2/9] usb: chipidea: ci13xxx_imx: add 2nd and 3rd clock to support imx5x and newer Michael Grzeschik
2012-11-26  9:29   ` Peter Chen
2012-11-26 10:22     ` Sascha Hauer
2012-11-27  6:50       ` Peter Chen
2012-11-27  7:34         ` Sascha Hauer
2012-11-14 16:19 ` [PATCH 3/9] usb: chipidea: ci13xxx-imx: create dynamic platformdata Michael Grzeschik
2012-11-16 10:14   ` Alexander Shishkin
2012-11-16 10:19     ` Marc Kleine-Budde
2012-11-16 12:06   ` Alexander Shishkin
2012-11-14 16:19 ` [PATCH 4/9] usb: chipidea: ci13xxx-imx: add "dr_mode" property to device tree bindings Michael Grzeschik
2012-11-16 11:53   ` Alexander Shishkin
2012-11-16 11:55     ` Marc Kleine-Budde [this message]
2012-11-26  9:46     ` Peter Chen
2012-11-29 12:54       ` Alexander Shishkin
2012-11-14 16:19 ` [PATCH 5/9] usb: add phy connection by phy-mode Michael Grzeschik
2012-11-16  9:25   ` Alexander Shishkin
2012-11-16 11:28   ` Felipe Balbi
2012-11-16 11:31   ` Felipe Balbi
2012-11-16 11:44     ` Marc Kleine-Budde
2012-11-16 13:41       ` Felipe Balbi
2012-11-16 14:32         ` Marc Kleine-Budde
2012-11-26  9:56   ` Peter Chen
2012-11-14 16:19 ` [PATCH 6/9] usb: chipidea: add PTW and PTS handling Michael Grzeschik
2012-11-16 12:18   ` Alexander Shishkin
2012-11-16 12:45   ` Alexander Shishkin
2012-11-16 13:16     ` Michael Grzeschik
2012-11-16 13:34       ` Alexander Shishkin
2012-11-16 13:57         ` Michael Grzeschik
2012-11-16 14:06           ` Alexander Shishkin
2012-11-16 14:46             ` Matthieu CASTET
2012-11-16 15:39               ` Alexander Shishkin
2012-11-21 15:57                 ` Michael Grzeschik
2012-11-21 16:06                   ` Matthieu CASTET
2012-11-27  1:12   ` Peter Chen
2012-11-27  9:54     ` Michael Grzeschik
2012-11-28  1:26       ` Peter Chen
2012-11-14 16:19 ` [PATCH 7/9] usb: chipidea: udc: add force-full-speed option Michael Grzeschik
2012-11-16 12:51   ` Alexander Shishkin
2012-11-16 14:53     ` Matthieu CASTET
2012-11-14 16:19 ` [PATCH 8/9] usb: chipidea: udc: remove unlocked ep_queue which can lead to an race Michael Grzeschik
2012-11-16 12:55   ` Alexander Shishkin
2012-11-14 16:19 ` [PATCH 9/9] usb: chipidea: udc: configure iso endpoints Michael Grzeschik
2012-11-14 18:04   ` Sergei Shtylyov

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=50A629A1.1010202@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).