On Tue, Mar 22, 2011 at 01:32, Bob Liu wrote: > On Tue, Mar 22, 2011 at 1:59 AM, Mike Frysinger wrote: >> On Mon, Mar 21, 2011 at 06:23, <[email protected]> wrote: >>> Revision 9746 Author lliubbo Date 2011-03-21 06:23:43 -0400 (Mon, 21 Mar >>> 2011) >>> >>> Log Message >>> >>> driver:musb:blackfin: rm vbus_status >>> >>> Currently blackfin doesn't support get vbus status, delete it >>> to make compile can pass. >>> >>> Modified: trunk/drivers/usb/musb/blackfin.c (9745 => 9746) >>> >>> --- trunk/drivers/usb/musb/blackfin.c 2011-03-21 10:21:34 UTC (rev 9745) >>> +++ trunk/drivers/usb/musb/blackfin.c 2011-03-21 10:23:43 UTC (rev 9746) >>> @@ -428,7 +428,6 @@ >>> .set_mode = bfin_musb_set_mode, >>> .try_idle = bfin_musb_try_idle, >>> >>> - .vbus_status = bfin_musb_vbus_status, >>> .set_vbus = bfin_musb_set_vbus, >>> }; >> >> this left behind the bfin_musb_get_vbus_status (obviously a typo ... >> this stub should not have "get_" in its name). how about we fix that >> typo, restore this .vbus_status setting, and implement the thing ? >> >> shouldnt it simply be: >> static int bfin_musb_vbus_status(struct musb *musb) >> { >> return gpio_get_value(musb->config->gpio_vrsel) ^ >> musb->config->gpio_vrsel_active; >> } > > I think just "return gpio_get_value(musb->config->gpio_vrsel)" is okay. > What's your opinion?
my understanding is that "vbus_status" needs to know "is vbus enabled". this is not the same as the level of the gpio since we allow people to explicitly invert it via gpio_vrsel_active. so if someone has inverted the line, returning gpio_get_value() will always return the opposite answer, thus we need to toggle it with gpio_vrsel_active. -mike _______________________________________________ Linux-kernel-commits mailing list [email protected] https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits
