From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753531AbbLKEFw (ORCPT ); Thu, 10 Dec 2015 23:05:52 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:44419 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbbLKEFu convert rfc822-to-8bit (ORCPT ); Thu, 10 Dec 2015 23:05:50 -0500 X-AuditID: cbfee68e-f793c6d00000136c-60-566a4b9c5327 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8BIT Message-id: <566A4B97.7080801@samsung.com> Date: Fri, 11 Dec 2015 13:05:43 +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 Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] extcon-usb-gpio: add enable pin support References: <4393960.B6dD3UkQy3@wasted.cogentembedded.com> In-reply-to: <4393960.B6dD3UkQy3@wasted.cogentembedded.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWyRsSkSHeOd1aYwckbrBbzj5xjteh/s5DV 4tyrlYwWl3fNYbOY82cKs8WiZa3MFkuvX2SyuN24gs1iwvS1LBate4+wW5xZdYvdgdtjzbw1 jB6X+3qZPB5M/c/ksXL5FzaPTas62Tz6tqxi9Pi8SS6APYrLJiU1J7MstUjfLoEro+PHD5aC LzIVWw5MZm1gfCHexcjJISFgIrHv3EI2CFtM4sK99UA2F4eQwApGiXNX1jPCFN3pWc4KYgsJ LGWU2HeYG8TmFRCU+DH5HguIzSygLjFp3iJmCFtEYv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t0nKkF6RQSeMkqcbV7HCjE0XOLK qdlg9cICNhJnD3cwQ9xjJTGp5whYDaeAtUT79lPMExgFZiE5bxbCebOQnLeAkXkVo0RqQXJB cVJ6rlFearlecWJucWleul5yfu4mRnBKeCa9g/HwLvdDjAIcjEo8vAs4ssKEWBPLiitzDzFK cDArifC+dAAK8aYkVlalFuXHF5XmpBYfYjQF+m8is5Rocj4wXeWVxBsam5gZWRqZG1oYGZsr ifPuuxQZJiSQnliSmp2aWpBaBNPHxMEp1cB4SPsyZ+GMVNu/pSt0GBxvcaxy+s7oqGRa+mGW sh67/UWh09pl4UeUavPy9dPOSV9zFs0590aiLJFzU3vmMfYffk3CVfvXOu7d7V5R/ihpye7g HlY7kX+eR5c73H8ZmHTxOiOXx7o9P8qK9/5fIL34Iot3mMmRP7xPrDfudz57e5uY//mkKfeV WIozEg21mIuKEwHwWIszHwMAAA== 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, On 2015년 12월 11일 08:07, Sergei Shtylyov wrote: > Sometimes there's a real OTG chip behind the USB ID signal mapped to a GPIO > pin: in my case it's Maxim Integrated MAX3355E which integrates Vbus charge > pump and comparators and passes thru the ID signal from an OTG connector. s/thru/through ? > This chip also has the SHDN# pin which should be driven high for the normal > operation and low to save power; it is connected to a GPIO pin as well on, > hence we'll have to teach the driver to parse the new optional device tree > property, "enable-gpio"... This patch description includes the double space between words. Also, I think you need to write the patch description again for formal style. This patch adds the specific 'enable-gpio' pin to express the SHDN#pin for MAX3355E. I think it is not regular and standard case because maybe USB specification don't include the SHDN#pin information. I think it not appropriate way. Instead, you better to make the MAX3355 extcon driver to support this case. Thanks, Chanwoo > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'extcon-next' branch of the 'extcon.git' repo. > > Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt | 3 +++ > drivers/extcon/extcon-usb-gpio.c | 5 +++++ > 2 files changed, 8 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt > =================================================================== > --- extcon.orig/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt > @@ -7,6 +7,9 @@ Required properties: > - compatible: Should be "linux,extcon-usb-gpio" > - id-gpio: gpio for USB ID pin. See gpio binding. > > +Optional properties: > +- enable-gpio: gpio for the enable pin. See gpio binding. > + > Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below: > extcon_usb1 { > compatible = "linux,extcon-usb-gpio"; > Index: extcon/drivers/extcon/extcon-usb-gpio.c > =================================================================== > --- extcon.orig/drivers/extcon/extcon-usb-gpio.c > +++ extcon/drivers/extcon/extcon-usb-gpio.c > @@ -33,6 +33,7 @@ struct usb_extcon_info { > struct device *dev; > struct extcon_dev *edev; > > + struct gpio_desc *enable_gpiod; > struct gpio_desc *id_gpiod; > int id_irq; > > @@ -99,6 +100,8 @@ static int usb_extcon_probe(struct platf > return -ENOMEM; > > info->dev = dev; > + info->enable_gpiod = devm_gpiod_get_optional(&pdev->dev, "enable", > + GPIOD_OUT_HIGH); > info->id_gpiod = devm_gpiod_get(&pdev->dev, "id", GPIOD_IN); > if (IS_ERR(info->id_gpiod)) { > dev_err(dev, "failed to get ID GPIO\n"); > @@ -155,6 +158,8 @@ static int usb_extcon_remove(struct plat > > cancel_delayed_work_sync(&info->wq_detcable); > > + gpiod_set_value_cansleep(info->enable_gpiod, 0); > + > return 0; > } > > > -- > 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/ > >