diff mbox

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

Message ID 1479475723-4857-19-git-send-email-kishon@ti.com
State New
Headers show

Commit Message

Kishon Vijay Abraham I Nov. 18, 2016, 1:28 p.m. UTC
From: Matt Ranostay <mranostay@gmail.com>


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 |    3 +++
 1 file changed, 3 insertions(+)

-- 
1.7.9.5
diff mbox

Patch

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);