]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
musb_hdrc: Make vbus sysfs entry report current Vbus status
authorFelipe Balbi <felipe.lima@indt.org.br>
Thu, 4 Oct 2007 17:02:22 +0000 (13:02 -0400)
committerTony Lindgren <tony@atomide.com>
Thu, 11 Oct 2007 21:31:34 +0000 (14:31 -0700)
Getting the current status of Vbus is useful when running
USB Compliance Tests.

Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/musb_core.c

index 3d35a4edea4b8cd92fa6d91d9bcec063ba57d648..dc934dcea8c1bcaa37fbf0d6d15e51674722082a 100644 (file)
@@ -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);