From 759debc75f0306797ad1a02631ffec10515f2cef Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 4 Oct 2007 13:02:22 -0400 Subject: [PATCH] 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 --- drivers/usb/musb/musb_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.41.1