Skip to content

Commit

Permalink
USB: musb: allow the Blackfin vrsel gpio to be active low
Browse files Browse the repository at this point in the history
Rather than hardcoding the gpio levels for vrsel, allow the platform
resources to handle this so boards can be active high or low.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Cliff Cai authored and Greg Kroah-Hartman committed May 20, 2010
1 parent fb9c58e commit 6ddc6da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/musb/blackfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ static void bfin_vbus_power(struct musb *musb, int is_on, int sleeping)

static void bfin_set_vbus(struct musb *musb, int is_on)
{
if (is_on)
gpio_set_value(musb->config->gpio_vrsel, 1);
else
gpio_set_value(musb->config->gpio_vrsel, 0);
int value = musb->config->gpio_vrsel_active;
if (!is_on)
value = !value;
gpio_set_value(musb->config->gpio_vrsel, value);

DBG(1, "VBUS %s, devctl %02x "
/* otg %3x conf %08x prcm %08x */ "\n",
Expand Down
1 change: 1 addition & 0 deletions include/linux/usb/musb.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ struct musb_hdrc_config {
#ifdef CONFIG_BLACKFIN
/* A GPIO controlling VRSEL in Blackfin */
unsigned int gpio_vrsel;
unsigned int gpio_vrsel_active;
#endif

};
Expand Down

0 comments on commit 6ddc6da

Please sign in to comment.