linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] at91: use gpiolib calls for USB vbus pin on at91sam9g45
Date: Wed, 16 Sep 2009 23:53:28 +0200	[thread overview]
Message-ID: <20090916215328.GG4172@game.jcrosoft.org> (raw)
In-Reply-To: <1253122169-14806-1-git-send-email-nicolas.ferre@atmel.com>

On 19:29 Wed 16 Sep     , Nicolas Ferre wrote:
> Change pin configuration for USB vbus on at91sam9g45: use the generic gpiolib
> call instead of the at91 specific one.
> Use gpio_request() function with same identifier for OHCI and EHCI hosts as
> they are sharing the same pin.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> This patch is on top of at91sam9g45 USB integration one:
> "[PATCH 2/2] at91/USB: at91sam9g45 series USB host integration"
> http://lkml.org/lkml/2009/6/9/221
> 
>  arch/arm/mach-at91/at91sam9g45_devices.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
> index 5be8cf2..7d939c0 100644
> --- a/arch/arm/mach-at91/at91sam9g45_devices.c
> +++ b/arch/arm/mach-at91/at91sam9g45_devices.c
> @@ -118,8 +118,10 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
>  
>  	/* 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);
> +		if (data->vbus_pin[i]) {
> +			gpio_request(data->vbus_pin[i], "usb host vbus");
> +			gpio_direction_output(data->vbus_pin[i], 0);
> +		}
>  	}
>  
>  	usbh_ohci_data = *data;
> @@ -173,8 +175,10 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)
>  
>  	/* 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);
> +		if (data->vbus_pin[i]) {
> +			gpio_request(data->vbus_pin[i], "usb host vbus");
> +			gpio_direction_output(data->vbus_pin[i], 0);
> +		}
>  	}
as you do the same think for ehci & ohci why not factorize it?

Best Regards,
J.

  reply	other threads:[~2009-09-16 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1244547493-19654-1-git-send-email-nicolas.ferre@atmel.com>
     [not found] ` <200906190043.00428.david-b@pacbell.net>
     [not found]   ` <20090619095148.67a74ed9@hskinnemoen-d830>
     [not found]     ` <200906190226.56278.david-b@pacbell.net>
2009-09-16 16:17       ` [PATCH 2/2] at91/USB: at91sam9g45 series USB host integration 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 [this message]
2009-09-17  8:13             ` Nicolas Ferre
2009-09-17  9:00               ` Jean-Christophe PLAGNIOL-VILLARD
2009-09-18  8:40                 ` Nicolas Ferre

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=20090916215328.GG4172@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --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).