[PATCH 18/20] phy: phy-twl4030-usb: emit VBUS status events to userspace

From: Kishon Vijay Abraham I
Date: Fri Nov 18 2016 - 08:30:20 EST


From: Matt Ranostay <mranostay@xxxxxxxxx>

Emit KOBJ_ONLINE/KOBJ_OFFLINE action uevent on VBUS status changes.

Cc: Tony Lindgren <tony@xxxxxxxxxxx>
Signed-off-by: Matt Ranostay <matt@xxxxxxxxxxxxxxxxxxx>
Acked-by: Tony Lindgren <tony@xxxxxxxxxxx>
Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx>
---
drivers/phy/phy-twl4030-usb.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 87e6334..daf2aa1 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -317,6 +317,9 @@ static bool twl4030_is_driving_vbus(struct twl4030_usb *twl)
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);

--
1.7.9.5