From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422676AbcFIJcu (ORCPT ); Thu, 9 Jun 2016 05:32:50 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:59049 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751379AbcFIJcp (ORCPT ); Thu, 9 Jun 2016 05:32:45 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 X-AuditID: cbfee68f-f79d26d0000014f6-f6-575937ba1c9f Content-transfer-encoding: 8BIT Message-id: <575937BA.1070609@samsung.com> Date: Thu, 09 Jun 2016 18:32:42 +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> <57592A40.9080608@samsung.com> <57592B4A.4000407@samsung.com> In-reply-to: <57592B4A.4000407@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsWyRsSkQHeXeWS4wfGpphYbZ6xntTh4v95i /pFzrBbPJj5ktHj9wtCi//FrZosLT3vYLDY9vsZqcXnXHDaLGef3MVmsPXKX3WLp9YtMFrcb V7BZHJv9l8mide8RdoueR1oOAh5r5q1h9Ph3uJ/JY9OqTjaPzUvqPTbtn8bs0bdlFaPH8Rvb mTw+b5IL4IjisklJzcksSy3St0vgyth7so2x4LlExY2/X9gbGHtEuhg5O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ti5GLg4hgVmMEteOfwBL8AoISvyYfI+li5GD g1lAXuLIpWwIU11iypRciPIHjBILZ85ihijXkrg76yojSA2LgKrE/hYlkDAbUHj/ixtsIGFR gQiJ7hOVIK0iAr+YJLZNPc8M4jALbGOUuNH7A2yOsICTxPQNcxkhFtxllDg08SQLSIJTQFvi VcN/1gmMQFcinDcL4bxZCOctYGRexSiRWpBcUJyUnmuYl1quV5yYW1yal66XnJ+7iRGcRp5J 7WA8uMv9EKMAB6MSD69GSkS4EGtiWXFl7iFGCQ5mJRHeHcqR4UK8KYmVValF+fFFpTmpxYcY TYH+m8gsJZqcD0xxeSXxhsYmZkaWRuaGFkbG5krivI//rwsTEkhPLEnNTk0tSC2C6WPi4JRq YNxwSmaydHTEkctS+u4RFeumV3aad5xdt/bgcWG25x330848/Jiy+Upi5OlG4yNL1nforbnV Frp7KSPDgQeu0pe62bJu7Jvq3Rs60TI8Tc9rTzeDyuOUbBn28KM7T9/tmt2hquW+Rz9w29fr CfM/77I9bsHR6pfkIqL1pO7g4zbBO/wPJ/ouPqbEUpyRaKjFXFScCAAk9q9vOQMAAA== 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, On 2016년 06월 09일 17:39, Krzysztof Kozlowski wrote: > > Hi, > > > On 06/09/2016 10:35 AM, Chanwoo Choi wrote: >> 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); > > How one can receive notifications with this API? I think that the extcon don't support the notification only for property. When USB or USB_HOST cable state is changed, the client driver call the extcon_get_cable_property_state() to read the state of property. Namely, the property depend on the specific external connector. > > Last time you wrote, at the end of discussion: > http://thread.gmane.org/gmane.linux.kernel/1923192/focus=1923193 >> IMO, if some usb driver check both id and vbus pin at the same time, >> the usb driver can know the both id and vbus pin state through only > one notifier event. >> >> Also, >> If some usb driver want to know the state of id pin except of vbus state, >> when receiving following events, id pin is low. >> #define EXTCON_USB_ID_L_VBUS_L0 >> #define EXTCON_USB_ID_L_VBUS_H1 >> when receiving following events, id pin is high. >> #define EXTCON_USB_ID_H_VBUS_L2 >> #define EXTCON_USB_ID_H_VBUS_H3 >> Also, some usb driver would catch the vbus pin state with same method. >> >> But, it is just my opinion. We may use following notifier events for > each pin. >> We need to discuss it. >> #define EXTCON_USB_ID_LOW >> #define EXTCON_USB_ID_HIGH >> #define EXTCON_USB_VBUS_LOW >> #define EXTCON_USB_VBUS_HIGH > > ... all other participants agreed on that conclusion. So why change of > view point now? Unitl now, the extcon framework only handle the state of external connector(cable). - The state of external connector is either attached or detached. I think that ID and VBUS are not external connector(cable). The ID and VBUS are more appropriate as property than new type of external connector. Regards, Chanwoo Choi