From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chanwoo Choi Date: Fri, 18 Dec 2015 01:14:37 +0000 Subject: Re: [PATCH v4] extcon: add Maxim MAX3355 driver Message-Id: <56735DFD.1070608@samsung.com> List-Id: References: <1767472.2Rx4LOCrWY@wasted.cogentembedded.com> In-Reply-To: <1767472.2Rx4LOCrWY@wasted.cogentembedded.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Sergei Shtylyov , robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, myungjoo.ham@samsung.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-sh@vger.kernel.org, linux-usb@vger.kernel.org Hi Sergei, Except for just one comment below, Looks good to me. Acked-by: Chanwoo Choi I'll wait for a few days to get the review from DT maintainer before applying it on extcon-next branch. On 2015년 12월 18일 07:47, Sergei Shtylyov wrote: > Maxim Integrated MAX3355E chip integrates a charge pump and comparators to > enable a system with an integrated USB OTG dual-role transceiver to > function as an 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 aren't currently interested in them), the OFFVBUS# signal is > controlled by the host controllers, there's also the SHDN# signal wired to > a GPIO, it should be driven high for the normal operation. > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'extcon-next' branch of the 'extcon.git' repo. > > Changes in version 4: > - stopped calling kstrdup() for the device name; > - removed unneeded 'owner' field initializer; > - moved devm_extcon_allocate() call further down in the probe() method; > - extended the driver copyright; > - indented the continuation lines in the binding document. > > Changes in version 3: > - reformatted the change log. > > Changes in version 2: > - added the USB gadget cable support; > - added the remove() driver method which drives SHDN# GPIO low to save power; > - dropped vendor prefix from the ID GPIO property name; > - changed the GPIO property name suffix to "-gpios"; > - switched to usign extcon_set_cable_state_() API; > - switched to using the gpiod/sleeping 'gpiolib' APIs; > - addded error messages to max3355_probe(); > - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; > - renamed 'ret' variable to 'err' in max3355_probe(); > - expanded the Kconfig entry help text; > - added vendor name to the patch summary, the bindings document, the Kconfig > entry, the driver heading comment, the module description, and the change log; > - fixed up and reformatted the change log. > > Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + > drivers/extcon/Kconfig | 8 > drivers/extcon/Makefile | 1 > drivers/extcon/extcon-max3355.c | 151 ++++++++++++ > 4 files changed, 181 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > =================================> --- /dev/null > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > @@ -0,0 +1,21 @@ > +Maxim Integrated MAX3355 USB OTG chip > +------------------------------------- > + > +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-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's SHDN# pin; > +- id-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's ID_OUT pin. > + > +Example (Koelsch board): You mean that "koelsch" board might be arch/arm/boot/dts/r8a7791-koelsch.dts. But, the max3355 dt node isn't really included in r8a7791-koelsch.dts. I recommend that you add the accurate information because the wrong info causes the confusion. So, I'd like you to change it as following: "Example (Koelsch board):" -> "Example:" After adding the max3355 dt node to Koelsch board on separate patch, you modify this documentation for real usage case of max3355 dt node. > + > + usb-otg { > + compatible = "maxim,max3355"; > + maxim,shdn-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; > + id-gpios = <&gpio5 31 GPIO_ACTIVE_HIGH>; > + }; > Index: extcon/drivers/extcon/Kconfig > =================================> --- extcon.orig/drivers/extcon/Kconfig > +++ extcon/drivers/extcon/Kconfig > @@ -52,6 +52,14 @@ config EXTCON_MAX14577 > Maxim MAX14577/77836. The MAX14577/77836 MUIC is a USB port accessory > detector and switch. [snip] Thanks, Chanwoo Choi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964955AbbLRBPB (ORCPT ); Thu, 17 Dec 2015 20:15:01 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:42556 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933465AbbLRBOs (ORCPT ); Thu, 17 Dec 2015 20:14:48 -0500 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 X-AuditID: cbfee68f-f793a6d000001364-88-56735e051f91 Content-transfer-encoding: 8BIT Message-id: <56735DFD.1070608@samsung.com> Date: Fri, 18 Dec 2015 10:14:37 +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 , robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, myungjoo.ham@samsung.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-sh@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v4] extcon: add Maxim MAX3355 driver References: <1767472.2Rx4LOCrWY@wasted.cogentembedded.com> In-reply-to: <1767472.2Rx4LOCrWY@wasted.cogentembedded.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsWyRsSkWJc1rjjMYOdSMYv5R86xWvS/Wchq ce7VSkaLy7vmsFnM+TOF2WLRslZmi6XXLzJZ3G5cwWYxYfpaFovWvUfYLc6susXuwO2xZt4a Ro/Lfb1MHg+m/mfyWLn8C5vHplWdbB59W1YxenzeJBfAHsVlk5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DSGAWo8Sb7hVMIAleAUGJH5PvsXQxcnAwC8hLHLmUDRJmFlCXmDRvETNE/QNGiZ5Lf9kg 6rUkvn28wQpiswioSnxc9wlsDhtQfP+LG2wgc0QFIiS6T1SC9IoItDJJdE/YwAQx1Fxi7tRH TCA1wgIWEv/W5YGYQgJWEhcP8INUcApYS6y82ck0gRHoRoTjZiEcNwvJcQsYmVcxSqQWJBcU J6XnGuWllusVJ+YWl+al6yXn525iBCeEZ9I7GA/vcj/EKMDBqMTDe4O5OEyINbGsuDL3EKME B7OSCG9AOFCINyWxsiq1KD++qDQntfgQoynQdxOZpUST84HJKq8k3tDYxMzI0sjc0MLI2FxJ nHffpcgwIYH0xJLU7NTUgtQimD4mDk6pBkb/3UWF7yTVX4c8mP8xzV2NXSF34aTLHxae/2DG 1nZfukxf4/eBK5xb9uVcDy77fFvDJkn/1EcxtfptuW1XDQV2/+SQNSk/HJzmrX9RUYdrxp5/ d379mch9Zs+b14t/vQs8an5rZueV/9ff7CxwXrP8jvyBuXG8n7/Md1tqwddfZ3x85vx/DCpi SizFGYmGWsxFxYkA+GlB2R4DAAA= 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 Sergei, Except for just one comment below, Looks good to me. Acked-by: Chanwoo Choi I'll wait for a few days to get the review from DT maintainer before applying it on extcon-next branch. On 2015년 12월 18일 07:47, Sergei Shtylyov wrote: > Maxim Integrated MAX3355E chip integrates a charge pump and comparators to > enable a system with an integrated USB OTG dual-role transceiver to > function as an 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 aren't currently interested in them), the OFFVBUS# signal is > controlled by the host controllers, there's also the SHDN# signal wired to > a GPIO, it should be driven high for the normal operation. > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'extcon-next' branch of the 'extcon.git' repo. > > Changes in version 4: > - stopped calling kstrdup() for the device name; > - removed unneeded 'owner' field initializer; > - moved devm_extcon_allocate() call further down in the probe() method; > - extended the driver copyright; > - indented the continuation lines in the binding document. > > Changes in version 3: > - reformatted the change log. > > Changes in version 2: > - added the USB gadget cable support; > - added the remove() driver method which drives SHDN# GPIO low to save power; > - dropped vendor prefix from the ID GPIO property name; > - changed the GPIO property name suffix to "-gpios"; > - switched to usign extcon_set_cable_state_() API; > - switched to using the gpiod/sleeping 'gpiolib' APIs; > - addded error messages to max3355_probe(); > - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; > - renamed 'ret' variable to 'err' in max3355_probe(); > - expanded the Kconfig entry help text; > - added vendor name to the patch summary, the bindings document, the Kconfig > entry, the driver heading comment, the module description, and the change log; > - fixed up and reformatted the change log. > > Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + > drivers/extcon/Kconfig | 8 > drivers/extcon/Makefile | 1 > drivers/extcon/extcon-max3355.c | 151 ++++++++++++ > 4 files changed, 181 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > =================================================================== > --- /dev/null > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > @@ -0,0 +1,21 @@ > +Maxim Integrated MAX3355 USB OTG chip > +------------------------------------- > + > +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-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's SHDN# pin; > +- id-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's ID_OUT pin. > + > +Example (Koelsch board): You mean that "koelsch" board might be arch/arm/boot/dts/r8a7791-koelsch.dts. But, the max3355 dt node isn't really included in r8a7791-koelsch.dts. I recommend that you add the accurate information because the wrong info causes the confusion. So, I'd like you to change it as following: "Example (Koelsch board):" -> "Example:" After adding the max3355 dt node to Koelsch board on separate patch, you modify this documentation for real usage case of max3355 dt node. > + > + usb-otg { > + compatible = "maxim,max3355"; > + maxim,shdn-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; > + id-gpios = <&gpio5 31 GPIO_ACTIVE_HIGH>; > + }; > Index: extcon/drivers/extcon/Kconfig > =================================================================== > --- extcon.orig/drivers/extcon/Kconfig > +++ extcon/drivers/extcon/Kconfig > @@ -52,6 +52,14 @@ config EXTCON_MAX14577 > Maxim MAX14577/77836. The MAX14577/77836 MUIC is a USB port accessory > detector and switch. [snip] Thanks, Chanwoo Choi