Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161061AbbEVKuM (ORCPT ); Fri, 22 May 2015 06:50:12 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:31006 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161009AbbEVKuC (ORCPT ); Fri, 22 May 2015 06:50:02 -0400 X-AuditID: cbfee691-f79ca6d00000456a-4d-555f09d64cd2 From: Chanwoo Choi To: linux-kernel@vger.kernel.org Cc: rogerq@ti.com, r.baldyga@samsung.com, peter.chen@freescale.com, kishon@ti.com, balbi@ti.com, iivanov@mm-sol.com, cw00.choi@samsung.com, myungjoo.ham@samsung.com Subject: [PATCH 2/2] extcon: usb-gpio: Update the ID pin state of USB when cable state is changed Date: Fri, 22 May 2015 19:49:50 +0900 Message-id: <1432291790-4933-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.5.5 In-reply-to: <1432291790-4933-1-git-send-email-cw00.choi@samsung.com> References: <1432291790-4933-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsWyRsSkWPcaZ3yowbK7IhYH79dbXP/ynNXi 2cSHjBYXnvawWVzeNYfN4nbjCjaLY7P/Mlk8OLyT3aLnkZYDp8e/w/1MHpv2T2P26NuyitHj +I3tTB6fN8kFsEZx2aSk5mSWpRbp2yVwZdzbF1AwnbvixbtTbA2Myzm7GDk5JARMJJ73bGWG sMUkLtxbz9bFyMUhJLCUUeLxwUmMMEU7nr6BSixilNjf/J4JJCEk8IVRYsZRLRCbTUBLYv+L G2wgtoiAgsTm3mesIA3MAisYJXZdPQC2QlggWWLx/fNgNouAqsTtjj72LkYODl4BF4nb3wMh lilILFs+kxXE5hRwlVj0voUZYpeLRFvnXmaQmRICq9glrhyfxQIxR0Di2+RDLCBzJARkJTYd gPpGUuLgihssExiFFzAyrGIUTS1ILihOSi8y1StOzC0uzUvX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b+2iarfa2fRfkuyNu7xSRYC1b GVK4/+Ca+977Mh//r3nR9qzczDVh6WG/Qq1prTKiKfucdK5tu/v+/qRekVNGR+eunfN927xJ LjL2fmveTDs2eY19l+Ka3Iurik5uvFbs+Hb75Z2Myu7ye/Su6X2Zt+nGrkmRSizFGYmGWsxF xYkAz7bRkr8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1637 Lines: 44 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 --- 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); } -- 1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/