Commit 759debc7 authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

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: default avatarFelipe Balbi <felipe.lima@indt.org.br>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6554af88
...@@ -1718,12 +1718,15 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1718,12 +1718,15 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf)
struct musb *musb = dev_to_musb(dev); struct musb *musb = dev_to_musb(dev);
unsigned long flags; unsigned long flags;
unsigned long val; unsigned long val;
int vbus;
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
val = musb->a_wait_bcon; val = musb->a_wait_bcon;
vbus = musb_platform_get_vbus_status(musb);
spin_unlock_irqrestore(&musb->lock, flags); 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); static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment