From: Tony Lindgren Date: Mon, 27 Aug 2007 13:00:16 +0000 (-0700) Subject: musb_hdrc: Add sysfs notification to mode, only show changes X-Git-Tag: v2.6.23-omap1~138 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3b172c8720bc73382a29d6cda8b37c8f52816470;p=linux-2.6-omap-h63xx.git musb_hdrc: Add sysfs notification to mode, only show changes Add sysfs notification to mode, and only show changed events. The older "cable" sysfs entry can now be deleted as it does not really work for OTG. Signed-off-by: Tony Lindgren --- diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 253288044ca..53cb110f09a 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1752,12 +1752,17 @@ static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store); #endif /* sysfs */ -/* Only used to provide cable state change events */ +/* Only used to provide driver mode change events */ static void musb_irq_work(struct work_struct *data) { struct musb *musb = container_of(data, struct musb, irq_work); + static int old_state; - sysfs_notify(&musb->controller->kobj, NULL, "cable"); + if (musb->xceiv.state != old_state) { + old_state = musb->xceiv.state; + sysfs_notify(&musb->controller->kobj, NULL, "cable"); + sysfs_notify(&musb->controller->kobj, NULL, "mode"); + } } /* --------------------------------------------------------------------------