From: sshtylyov@mvista•com (Sergei Shtylyov)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 1/3] ohci-at91: add vbus_pin_inverted platform attribute
Date: Tue, 05 Jul 2011 15:39:18 +0400 [thread overview]
Message-ID: <4E12F7E6.7080604@mvista.com> (raw)
In-Reply-To: <1309856728-8265-1-git-send-email-thomas.petazzoni@free-electrons.com>
Hello.
On 05-07-2011 13:05, Thomas Petazzoni wrote:
> The existing OHCI AT91 driver made the assumption that the enable
> input of the USB power switch was active low. However, some USB power
> switches such as the Micrel MIC2026-1 [1] have an active high input to
> enable the power. A new vbus_pin_inverted attribute is added to the
> at91_usbh_data structure so that board files can tell the OHCI driver
> if the vbus pin logic is active low or active high.
> [1] http://www.micrel.com/page.do?page=product-info/products/mic2026.shtml
> Signed-off-by: Thomas Petazzoni<thomas.petazzoni@free-electrons•com>
> Cc: Andrew Victor<linux@maxim•org.za>
> Cc: Nicolas Ferre<nicolas.ferre@atmel•com>
> Cc: Jean-Christophe Plagniol-Villard<plagnioj@jcrosoft•com>
[...]
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index 944291e..52e50ba 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -284,7 +284,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
> if (pdata->vbus_pin[i]<= 0)
> continue;
> gpio_request(pdata->vbus_pin[i], "ohci_vbus");
> - gpio_direction_output(pdata->vbus_pin[i], 0);
> + gpio_direction_output(pdata->vbus_pin[i], 0 ^ pdata->vbus_pin_inverted);
Why not simply 'pdata->vbus_pin_inverted'?
> }
> }
>
> @@ -301,7 +301,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
> for (i = 0; i< ARRAY_SIZE(pdata->vbus_pin); i++) {
> if (pdata->vbus_pin[i]<= 0)
> continue;
> - gpio_direction_output(pdata->vbus_pin[i], 1);
> + gpio_direction_output(pdata->vbus_pin[i], 1 ^ pdata->vbus_pin_inverted);
Why not simply '!pdata->vbus_pin_inverted'?
WBR, Sergei
next prev parent reply other threads:[~2011-07-05 11:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 9:05 [PATCH 1/3] ohci-at91: add vbus_pin_inverted platform attribute Thomas Petazzoni
2011-07-05 9:05 ` [PATCH 2/3] at91-ohci: support overcurrent notification Thomas Petazzoni
2011-07-05 10:12 ` Matthieu CASTET
2011-07-05 10:18 ` Thomas Petazzoni
2011-07-05 12:18 ` Matthieu CASTET
2011-07-05 14:23 ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-05 9:05 ` [PATCH 3/3] at91-ohci: configure overcurrent pins as GPIOs Thomas Petazzoni
2011-07-05 11:39 ` Sergei Shtylyov [this message]
2011-07-05 11:54 ` [PATCH 1/3] ohci-at91: add vbus_pin_inverted platform attribute Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2011-07-13 9:29 [PATCH v2] AT91 OHCI active-high vbus and overcurrent handling Thomas Petazzoni
2011-07-13 9:29 ` [PATCH 1/3] ohci-at91: add vbus_pin_inverted platform attribute Thomas Petazzoni
2011-09-07 10:47 ` 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=4E12F7E6.7080604@mvista.com \
--to=sshtylyov@mvista$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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