From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753117AbbE0OlJ (ORCPT ); Wed, 27 May 2015 10:41:09 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:40350 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753076AbbE0OlF (ORCPT ); Wed, 27 May 2015 10:41:05 -0400 Message-ID: <5565D778.8000009@ti.com> Date: Wed, 27 May 2015 17:40:56 +0300 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Chanwoo Choi , CC: , , , , , , Subject: Re: [PATCH v2 2/2] extcon: usb-gpio: Update the ID pin state of USB when cable state is changed References: <1432728910-10761-1-git-send-email-cw00.choi@samsung.com> <1432728910-10761-3-git-send-email-cw00.choi@samsung.com> In-Reply-To: <1432728910-10761-3-git-send-email-cw00.choi@samsung.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/05/15 15:15, Chanwoo Choi wrote: > This patch updates the ID pin state of USB when cable state is changed > by using the extcon_set_cable_line_state() function. The extcon consumer driver > can receive the changed ID pin state through registered notifier chain of > extcon consumer driver. > > Cc: Roger Quadros > Cc: Robert Baldyga > Cc: MyungJoo Ham > Signed-off-by: Chanwoo Choi Acked-by: Roger Quadros cheers, -roger > --- > drivers/extcon/extcon-usb-gpio.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c > index 14da94c..9ff3171 100644 > --- a/drivers/extcon/extcon-usb-gpio.c > +++ b/drivers/extcon/extcon-usb-gpio.c > @@ -62,12 +62,18 @@ static void usb_extcon_detect_cable(struct work_struct *work) > */ > extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, false); > extcon_set_cable_state_(info->edev, EXTCON_USB, true); > + > + extcon_set_cable_line_state(info->edev, EXTCON_USB, > + EXTCON_USB_ID_HIGH); > } else { > /* > * ID = 0 means USB HOST cable attached. > * As we don't have event for USB peripheral cable detached, > * we simulate USB peripheral detach here. > */ > + extcon_set_cable_line_state(info->edev, EXTCON_USB, > + EXTCON_USB_ID_LOW); > + > extcon_set_cable_state_(info->edev, EXTCON_USB, false); > extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, true); > } >