From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938148AbcKONwZ (ORCPT ); Tue, 15 Nov 2016 08:52:25 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:31980 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933311AbcKONwW (ORCPT ); Tue, 15 Nov 2016 08:52:22 -0500 Subject: Re: [PATCH] phy: phy-twl4030-usb: emit VBUS status events to userspace To: Tony Lindgren , Matt Ranostay References: <1474426684-15862-1-git-send-email-matt@ranostay.consulting> <20160921212439.sjccqx3jg5gpcqaw@atomide.com> CC: , Matt Ranostay From: Kishon Vijay Abraham I Message-ID: <582B1310.5080909@ti.com> Date: Tue, 15 Nov 2016 19:22:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160921212439.sjccqx3jg5gpcqaw@atomide.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 22 September 2016 02:54 AM, Tony Lindgren wrote: > * Matt Ranostay [160920 19:58]: >> Emit KOBJ_ONLINE/KOBJ_OFFLINE action uevent on VBUS status changes. > > Makes sense for configuring USB gadgets on demand when connected: > > Acked-by: Tony Lindgren merged, thanks. -Kishon > >> >> Cc: Tony Lindgren >> Signed-off-by: Matt Ranostay >> --- >> 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 d9b10a39a2cf..4830392c2fe1 100644 >> --- a/drivers/phy/phy-twl4030-usb.c >> +++ b/drivers/phy/phy-twl4030-usb.c >> @@ -316,6 +316,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); >> >> -- >> 2.7.4 >>