From 3b172c8720bc73382a29d6cda8b37c8f52816470 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 27 Aug 2007 06:00:16 -0700 Subject: [PATCH] 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 --- drivers/usb/musb/musb_core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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"); + } } /* -------------------------------------------------------------------------- -- 2.41.1