From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbbKIXwd (ORCPT ); Mon, 9 Nov 2015 18:52:33 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:51147 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbbKIXw3 convert rfc822-to-8bit (ORCPT ); Mon, 9 Nov 2015 18:52:29 -0500 X-AuditID: cbfee68e-f791c6d000001498-9e-564131bbe6c5 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT Message-id: <564131BA.9010809@samsung.com> Date: Tue, 10 Nov 2015 08:52:26 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Sergei Shtylyov Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, myungjoo.ham@samsung.com, grant.likely@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] extcon: add MAX3355 driver References: <14631865.01KLlU2iKL@wasted.cogentembedded.com> <5490CEE2.1030900@samsung.com> <5491FC69.7090203@cogentembedded.com> <562685EF.7010504@cogentembedded.com> <5629CBFA.4020605@samsung.com> <5640E4D5.4020001@cogentembedded.com> In-reply-to: <5640E4D5.4020001@cogentembedded.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPIsWRmVeSWpSXmKPExsWyRsSkWHe3oWOYwb55LBbzj5xjteh/s5DV 4sCfHYwW516tZLS4vGsOm8WcP1OYLRYta2W2WHr9IpPF7cYVbBYTpq9lsWjde4Td4syqW+wO PB5r5q1h9Ljc18vk8WDqfyaPlcu/sHlsWtXJ5nHn2h42j74tqxg9Pm+SC+CI4rJJSc3JLEst 0rdL4Mo40HmPueC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FtM4sK99UA2F4eQwFJGidenZjOBJHgFBCV+TL7H0sXIwcEsIC9x5FI2hKkuMWVKLkiF kMADRomZk8RBwrwCWhJnVmeDhFkEVCW+NlwDG8IGFN7/4gYbSImoQIRE94lKkLCIgIXE3cZF LCBLmQXmM0lMPLAB7BphAX2JFxdfQ13zkVFi77Qb7CAJTgEjiet989kmMArMQnLcLITjZiEc t4CReRWjRGpBckFxUnquUV5quV5xYm5xaV66XnJ+7iZGcIp4Jr2D8fAu90OMAhyMSjy8E745 hAmxJpYVV+YeYpTgYFYS4bV/ARTiTUmsrEotyo8vKs1JLT7EaAr030RmKdHkfGD6yiuJNzQ2 MTOyNDI3tDAyNlcS59X3NAoTEkhPLEnNTk0tSC2C6WPi4JRqYMxmbzJyTf3wLj05v5VRWWjH d5c1yVaXnl59c4lnlfPD2OTJlT7ny54eMQruV9Lz332jzubu9MPzjonrfq4JMAkXdd41aRor b3vHdf/mLTZ9VQXfOF6uZ8lh2c36vTfB+WCRj+60K8f2LOn5L/XjbdE53xeebWePvDg1b++x Zc3td44vckq/7qfEUpyRaKjFXFScCAA3IpFXJwMAAA== 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 Hello, I received the reply from you after too long time (17~18day). You better to reply it more a little more quickly if you have the question or new patches. On 2015년 11월 10일 03:24, Sergei Shtylyov wrote: > Hello. > > On 10/23/2015 08:56 AM, Chanwoo Choi wrote: > >>>>>> MAX3355E chip integrates a charge pump and comparators to enable a system with >>>>>> an integrated USB OTG dual-role transceiver to function as a USB OTG dual-role >>>>>> device. In addition to sensing/controlling Vbus, the chip also passes thru the >>>>>> ID signal from the USB OTG connector. On some Renesas boards, this signal is >>>>>> just fed into the SoC thru a GPIO pin -- there's no real OTG controller, only >>>>>> host and gadget USB controllers sharing the same USB bus; however, we'd like >>>>>> to allow host or gadget drivers to be loaded depending on the cable type, >>>>>> hence >>>>>> the need for the MAX3355 extcon driver. The Vbus status signals are also wired >>>>>> to GPIOs (however, we're not currently intested in them), the OFFVBUS# signal >>>>>> is controlled by the host controllers, there's also the SHDN# signal wired to >>>>>> GPIO, which should be high for normal operation. >>>> >>>>>> Signed-off-by: Sergei Shtylyov >>>> >>>>>> --- >>>>>> The patch is against the 'extcon-next' branch of the 'extcon.git' repo. >>>> >>>>>> Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 ++ >>>>>> drivers/extcon/Kconfig | 6 >>>>>> drivers/extcon/Makefile | 1 >>>>>> drivers/extcon/extcon-max3355.c | 122 >>>>>> ++++++++++++ >>>>>> 4 files changed, 150 insertions(+) >>>> >>>>>> Index: extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt >>>>>> =================================================================== >>>>>> --- /dev/null >>>>>> +++ extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt >>>>>> @@ -0,0 +1,21 @@ >>>>>> +MAX3355 USB OTG chip >>>> >>>>> Need manufactor information as following : >>>>> -> Maxim MAX3355 >>>> >>>> Would be Maxim enough? Or perhaps I should use Maxim Integrated [Products]? >>> >>> You haven't replied to my questions. >>> >>>>>> +-------------------- >>>>>> + >>>>>> +MAX3355 integrates a charge pump and comparators to enable a system with an >>>>>> +integrated USB OTG dual-role transceiver to function as a USB OTG dual-role >>>>>> +device. >>>>>> + >>>>>> +Required properties: >>>>>> +- compatible: should be "maxim,max3355"; >>>>>> +- maxim,shdn-gpio: should contain a phandle and GPIO specifier for the >>>>>> GPIO pin >>>>>> + connected to the MAX3355's SHDN# pin; >>>>>> +- maxim,id-gpio: should contain a phandle and GPIO specifier for the GPIO pin >>>>>> + connected to the MAX3355's ID_OUT pin. >>>>>> + >>>>>> +Example (Koelsch board): >>>>>> + >>>>>> + usb-otg { >>>>>> + compatible = "maxim,max3355"; >>>>>> + maxim,shdn-gpio = <&gpio2 4 GPIO_ACTIVE_LOW>; >>>>>> + maxim,id-gpio = <&gpio5 31 GPIO_ACTIVE_HIGH>; >>>> >>>>> Kernel already supported the gpio helper function to get gpio from devicetree. >>>>> I prefer use follwoing style by using of_get_gpio()/of_get_gpio_flags() in >>>>> include/linux/of_gpio.h. >>>> >>>>> gpios = <&gpio2 4 GPIO_ACTIVE_LOW>, <&gpio5 31 GPIO_ACTIVE_HIGH>; >>>> >>>> OK, though Documentation/devicetree/bindings/gpio/gpio.txt does not seem >>>> to insist on using this one... >>> >>> Moreover, it now says "gpios" isn't allowed for the new bindings. So I have to strongly disagree here... >> >> OK. But, I recommend you use the 'gpiod' with devm_gpiod_get >> instead of using devm_gpio_request_one() directly as following: >> You can refer drivers/extcon/extcon-usb-gpio.c about using gpiod. >> >> For example, >> data->shdn_gpiod = devm_gpiod_get(dev, "maxim,shdn", GPIOD_IN); >> data->id_gpiod = devm_gpiod_get(dev, "maxim,id", GPIOD_IN); > > Thanks, done now. I just had another idea: how about I add an optional "enable-gpio" property to the 'extcon-usb-gpio' driver? I wouldn't need my own driver then at all... :-) What is meaning of 'enable-gpio' property? You better to explain your goal about 'enable-gpio' property Also, If you think that it is generic way about adding 'enable-gpio' property to extcon-usb-gpio.c, you can try it. Thanks, Chanwoo Choi