From: Felipe Balbi Date: Thu, 4 Oct 2007 17:02:22 +0000 (-0400) Subject: musb_hdrc: Make vbus sysfs entry report current Vbus status X-Git-Tag: v2.6.23-omap1~14 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=759debc75f0306797ad1a02631ffec10515f2cef;p=linux-2.6-omap-h63xx.git musb_hdrc: Make vbus sysfs entry report current Vbus status Getting the current status of Vbus is useful when running USB Compliance Tests. Signed-off-by: Felipe Balbi Signed-off-by: Tony Lindgren --- diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3d35a4edea4..dc934dcea8c 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1718,12 +1718,15 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) struct musb *musb = dev_to_musb(dev); unsigned long flags; unsigned long val; + int vbus; spin_lock_irqsave(&musb->lock, flags); val = musb->a_wait_bcon; + vbus = musb_platform_get_vbus_status(musb); spin_unlock_irqrestore(&musb->lock, flags); - return sprintf(buf, "%lu\n", val); + return sprintf(buf, "Vbus %s, timeout %lu\n", + vbus ? "on" : "off", val); } static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store);