public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Andrew Victor <avictor.za@gmail.com>
Cc: David Brownell <david-b@pacbell.net>,
	Haavard Skinnemoen <haavard.skinnemoen@atmel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	patrice.vilchez@atmel.com
Subject: Re: [PATCH 2/2] at91/USB: at91sam9g45 series USB host integration
Date: Wed, 23 Sep 2009 17:31:32 +0200	[thread overview]
Message-ID: <4ABA3F54.3020600@atmel.com> (raw)
In-Reply-To: <cd73a99e0909211349w3cbcfad3yb8d0e2bdcb2480cb@mail.gmail.com>

Andrew Victor :
> hi David,
> 
>> On Friday 19 June 2009, Haavard Skinnemoen wrote:
>>> David Brownell wrote:
>>>>> --- a/arch/arm/mach-at91/at91sam9g45_devices.c
>>>>> +++ b/arch/arm/mach-at91/at91sam9g45_devices.c
>>>>> + /* Enable VBus control for UHP ports */
>>>>> + for (i = 0; i < data->ports; i++) {
>>>>> +         if (data->vbus_pin[i])
>>>>> +                 at91_set_gpio_output(data->vbus_pin[i], 0);
>>>> This should gpio_request() and gpio_direction_output().
>>> Hmm...I thought the driver was supposed to call gpio_request(), not the
>>> platform code?
>> In some cases.  This isn't a good case for that.  Especially
>> if it's going to call gpio_direction_output() ... which needs
>> gpio_request() to have been done first.
> 
> I have to agree with Haavard on this - it's really not clear if
> gpio_request() should be called in the platform-code or in the driver.
> 
> If the platform code performs a gpio_request() then surely it needs to
> call a gpio_free() after configuring the pin.
> Otherwise the driver's initialization code performs another
> gpio_request() for that pin, but it is still "in-use" by the platform
> code.
> 
> Also Documentation/gpio.txt doesn't say if a GPIO pin should even
> retain it's configured state across after a gpio_free().
> 
> 
> So for the core AT91 platform code, I'd continue to use the
> AT91-specific GPIO configuration functions.
> The drivers should perform the gpio_request() / gpio_free(), and it
> can still call gpio_direction_output() if necessary.

Fair enough. So I forget my gpiolib patch on top of the former USB
integration one.

With your Ack, I will publish it to Russell's patch tracking system...

Bye,
-- 
Nicolas Ferre


      reply	other threads:[~2009-09-23 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 11:38 at91/USB: high speed USB support for at91sam9g45 series Nicolas Ferre
     [not found] ` <7d35ee50ea2e14a3d4f350406693b1e884b034f3.1244545093.git.nicolas.ferre@atmel.com>
2009-06-09 11:38   ` [PATCH 1/2] at91/USB: Add USB drivers " Nicolas Ferre
     [not found]   ` <37875dad9f270c834319c78b1af15f2f12c52e46.1244545093.git.nicolas.ferre@atmel.com>
2009-06-09 11:38     ` [PATCH 2/2] at91/USB: at91sam9g45 series USB host integration Nicolas Ferre
2009-06-19  7:43       ` David Brownell
2009-06-19  7:51         ` Haavard Skinnemoen
2009-06-19  9:26           ` David Brownell
2009-09-16 16:17             ` Nicolas Ferre
2009-09-16 17:29               ` [PATCH] at91: use gpiolib calls for USB vbus pin on at91sam9g45 Nicolas Ferre
2009-09-16 21:53                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-09-17  8:13                   ` Nicolas Ferre
2009-09-17  9:00                     ` Jean-Christophe PLAGNIOL-VILLARD
2009-09-18  8:40                       ` Nicolas Ferre
2009-09-21 20:49             ` [PATCH 2/2] at91/USB: at91sam9g45 series USB host integration Andrew Victor
2009-09-23 15:31               ` Nicolas Ferre [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=4ABA3F54.3020600@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=avictor.za@gmail.com \
    --cc=david-b@pacbell.net \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=patrice.vilchez@atmel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox