From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755802AbcFIIfW (ORCPT ); Thu, 9 Jun 2016 04:35:22 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:42923 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751379AbcFIIfQ (ORCPT ); Thu, 9 Jun 2016 04:35:16 -0400 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 X-AuditID: cbfee68f-f79d26d0000014f6-cc-57592a4073f4 Content-transfer-encoding: 8BIT Message-id: <57592A40.9080608@samsung.com> Date: Thu, 09 Jun 2016 17:35:12 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Krzysztof Kozlowski , MyungJoo Ham , Rob Herring , Mark Rutland , Kukjin Kim , Marek Szyprowski , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: rogerq@ti.com, Peter Chen , "Ivan T. Ivanov" , balbi@ti.com, kishon@ti.com, Bartlomiej Zolnierkiewicz Subject: Re: [RFC v4 0/7] extcon: usb-gpio: fixes and improvements References: <1465393686-16644-1-git-send-email-k.kozlowski@samsung.com> In-reply-to: <1465393686-16644-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWyRsSkQNdBKzLcYHKjrsXGGetZLQ7er7eY f+Qcq8WziQ8ZLV6/MLTof/ya2eLC0x42i02Pr7FaXN41h81ixvl9TBZrj9xlt1h6/SKTxe3G FWwWx2b/ZbJo3XuE3aLnkZaDgMeaeWsYPf4d7mfy2LSqk81j85J6j037pzF79G1Zxehx/MZ2 Jo/Pm+QCOKK4bFJSczLLUov07RK4MnoWX2Qs2CRRsWzLDOYGxtnCXYycHBICJhJtP+4zQ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QRhi0lcuLeerYuRi0NIYCmjxP5zK8ASvAKCEj8m32PpYuTg YBaQlzhyKRskzCygLjFp3iJmEFtI4AGjxNxV+RDlWhKnXx1nBylnEVCV6FsmAxJmAwrvf3GD DSQsKhAh0X2iEmSTiMAvJoltU88zgzjMAtsYJW70/gCbKSzgJDF9w1xGiHvmMkrMmvKdHSTB KeAhcXH7MsYJjAKzkJw3C+G8WUjOW8DIvIpRIrUguaA4KT3XMC+1XK84Mbe4NC9dLzk/dxMj OJE8k9rBeHCX+yFGAQ5GJR5ejZSIcCHWxLLiytxDjBIczEoivDuUI8OFeFMSK6tSi/Lji0pz UosPMZoCPTiRWUo0OR+Y5PJK4g2NTcyMLI3MDS2MjM2VxHkf/18XJiSQnliSmp2aWpBaBNPH xMEp1cBocZTt3u+vnwMuvpuzXIWXQTYkLfPj3FYPXlf97KSge6ZF9gxpDjv3hxloXHRn81wu 4BftEGtoWmnYrnf2yjytX5+MdkWGXXn2ykfu5WeBL5c7O+/UbgnYxnj/mdB1IZ293U02Umnv c9lcI3K0X4R/1Lp5V59vn/7lvdeDyw5fnMn3W+B0yAolluKMREMt5qLiRABeWOcIOgMAAA== 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 Hi, It is good to support USB_ID and USB_VBUS by extcon. But, there is some issue about adding the new cable type for both EXTCON_USB_ID and EXTCON_USB_VBUS I think that the ID and VBUS state are not cable type Instead, ID and VBUS state are the property of USB cable. So, I'd like to add the following function to support the property of each cable as following: The client driver can get the state of property by using the extcon_get_cable_property_state(). - int extcon_get_cable_property_state(struct extcon_dev *edev, unsigned int id, enum extcon_property property); - int extcon_set_cable_property_state(struct extcon_dev *edev, unsigned int id, enum extcon_property property, unsigned int state); For example, In extcon-usb-gpio.c, set state of property as follwoing: extcon_set_cable_property_state(edev, EXTCON_USB, EXTCON_USB_PROP_ID, 1); extcon_set_cable_property_state(edev, EXTCON_USB, EXTCON_USB_PROP_VBUS, 1); In the extcon client driver, get state of property as following: id_state = extcon_get_cable_property_state(edev, EXTCON_USB, EXTCON_USB_PROP_ID); vbus_state = extcon_get_cable_property_state(edev, EXTCON_USB, EXTCON_USB_PROP_VUBS); Regards, Chanwoo Choi On 2016년 06월 08일 22:47, Krzysztof Kozlowski wrote: > Hi, > > > Some time ago, Robert tried to add VBUS detection to extcon-usb-gpio > driver [1]. There was a discussion about patch #2 ("extcon: usb-gpio: > add support for VBUS detection"). > > The final conclusion was that Chanwoo will add VBUS/ID notifiers [2]. > That unfortunately never happened so this patchset is a follow up. > > 1. Add VBUS/ID cable state notifiers to extcon, so USB controllers > could use it. > 2. Add VBUS detection to extcon-usb-gpio driver. > > Some parts are based on old Robert's work, some are new, some are > reworked. > > > Best regards, > Krzysztof > > > [1] http://thread.gmane.org/gmane.linux.kernel/1923192/focus=1923193 > [2] http://thread.gmane.org/gmane.linux.kernel/1923192/focus=1941152 > > > Krzysztof Kozlowski (5): > Revert "extcon: usb-gpio: switch to use pm wakeirq apis" > extcon: Add raw VBUS and ID cable states > extcon: usb-gpio: Add support for VBUS detection > ARM: exynos_defconfig: Enable EXTCON_USB_GPIO for Odroid XU3 USB OTG > ARM: dts: exynos: Add extcon-usb-gpio node for Odroid XU3 > > Robert Baldyga (2): > Documentation: extcon: usb-gpio: update usb-gpio binding description > extcon: usb-gpio: make debounce value configurable in devicetree > > .../devicetree/bindings/extcon/extcon-usb-gpio.txt | 28 ++++- > arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 21 ++++ > arch/arm/boot/dts/exynos5422-odroidxu3.dts | 21 ++++ > arch/arm/configs/exynos_defconfig | 1 + > drivers/extcon/extcon-usb-gpio.c | 138 +++++++++++++++++---- > drivers/extcon/extcon.c | 3 + > include/linux/extcon.h | 8 +- > 7 files changed, 190 insertions(+), 30 deletions(-) >