]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
musb_hdrc: Add sysfs notification to mode, only show changes
authorTony Lindgren <tony@atomide.com>
Mon, 27 Aug 2007 13:00:16 +0000 (06:00 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 27 Aug 2007 13:00:16 +0000 (06:00 -0700)
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 <tony@atomide.com>
drivers/usb/musb/musb_core.c

index 253288044ca691887e6de210641aafcae0c632d2..53cb110f09a2fb9f0b0e9757c52a272d4622cee3 100644 (file)
@@ -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");
+       }
 }
 
 /* --------------------------------------------------------------------------