phy: phy-twl4030-usb: emit VBUS status events to userspace
authorMatt Ranostay <mranostay@gmail.com>
Wed, 21 Sep 2016 02:58:04 +0000 (19:58 -0700)
committerKishon Vijay Abraham I <kishon@ti.com>
Fri, 18 Nov 2016 12:49:16 +0000 (18:19 +0530)
Emit KOBJ_ONLINE/KOBJ_OFFLINE action uevent on VBUS status changes.

Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-twl4030-usb.c

index 87e6334eab9309f85e8cb5308f96dec54de7f495..daf2aa1c5ce595c7053556fe7f6b316501f39fc6 100644 (file)
@@ -317,6 +317,9 @@ static enum musb_vbus_id_status
                        linkstat = MUSB_VBUS_OFF;
        }
 
+       kobject_uevent(&twl->dev->kobj, linkstat == MUSB_VBUS_VALID
+                                       ? KOBJ_ONLINE : KOBJ_OFFLINE);
+
        dev_dbg(twl->dev, "HW_CONDITIONS 0x%02x/%d; link %d\n",
                        status, status, linkstat);