From patchwork Wed Jun 8 13:48:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9164727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2842E60572 for ; Wed, 8 Jun 2016 13:50:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18D4825D91 for ; Wed, 8 Jun 2016 13:50:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D4422824F; Wed, 8 Jun 2016 13:50:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEFD8282DC for ; Wed, 8 Jun 2016 13:50:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754682AbcFHNsZ (ORCPT ); Wed, 8 Jun 2016 09:48:25 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:51303 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752779AbcFHNsY (ORCPT ); Wed, 8 Jun 2016 09:48:24 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8G00KCDH0KNV40@mailout4.w1.samsung.com>; Wed, 08 Jun 2016 14:48:20 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-8f-57582224af1d Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 7E.7D.05254.42228575; Wed, 8 Jun 2016 14:48:20 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8G00M68H0F9I60@eusync1.samsung.com>; Wed, 08 Jun 2016 14:48:19 +0100 (BST) From: Krzysztof Kozlowski To: MyungJoo Ham , Chanwoo Choi , Rob Herring , Mark Rutland , Kukjin Kim , Krzysztof Kozlowski , 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: [RFC v4 1/7] Documentation: extcon: usb-gpio: update usb-gpio binding description Date: Wed, 08 Jun 2016 15:48:00 +0200 Message-id: <1465393686-16644-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1465393686-16644-1-git-send-email-k.kozlowski@samsung.com> References: <1465393686-16644-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t/xy7oqShHhBvtXMFlsnLGe1eLg/XqL 61+es1rMP3KO1eLZxIeMFq9fGFr0P37NbHHhaQ+bxabH11gtLu+aw2Yx4/w+Jou1R+6yWyy9 fpHJ4nbjCjaLY7P/Mlm07j3CbtHzSMtB0GPNvDWMHv8O9zN5bFrVyeaxeUm9x6b905g9+ras YvQ4fmM7k8fnTXIBHFFcNimpOZllqUX6dglcGU8OtjEVbBWq+LvzLHMDYx9/FyMnh4SAicSf 91fZIGwxiQv31oPZQgJLGSXOHyvqYuQCshuZJNYvmsgIkmATMJbYvHwJG0hCRGARs8Txzh4m EIdZYBujxI3eH8wgVcICMRJf/30D62ARUJWYfukcE4jNK+AusW39UhaIdXISJ49NZgWxOQU8 JC5uX8YIsdpd4vfniSwTGHkXMDKsYhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAgJ6S87GBcf szrEKMDBqMTDq2AYHi7EmlhWXJl7iFGCg1lJhFdHJiJciDclsbIqtSg/vqg0J7X4EKM0B4uS OO/cXe9DhATSE0tSs1NTC1KLYLJMHJxSDYxpYkcf6H1Z6LNPkbNWuUrM2UQoZdUcJ4vJQhO2 XX35bd4blgM878urJQRW/3nFJXvCv1Z90xVVznChOrWc15m208LLYr/c/648dd8nm3kixusn zz4zVa7R69RV7tuZpTs2yJzm/Htq/l65ilj2xi2LVudZrKuRe9d77o9OqHnLnzXfUtpKY6qV WIozEg21mIuKEwFdl7SUZQIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Baldyga Add information about VBUS pin detection support, 'debounce' property and some other details. Signed-off-by: Robert Baldyga Acked-by: Roger Quadros Signed-off-by: Krzysztof Kozlowski --- .../devicetree/bindings/extcon/extcon-usb-gpio.txt | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt index af0b903de293..7096f399b771 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt @@ -1,16 +1,40 @@ USB GPIO Extcon device -This is a virtual device used to generate USB cable states from the USB ID pin -connected to a GPIO pin. +This is a virtual device used to generate USB cable states from the USB +ID and VBUS signals connected to GPIO pins. + +The extcon cable states USB and USB_HOST are actually VBUS and !ID +pin states and do not indicate what mode the USB needs to operate in. +That decision is done by the USB stack. + +Some devices have only one of these GPIO pins, so we support cases when +only one of them is present. Hence properties 'id-gpio' and 'vbus-gpio' +are described as optional, but at least one of them has to be present +in extcon-usb-gpio node. + +In general we have three cases: +1. If VBUS and ID gpios are present we pass them as is + USB-HOST = !ID, USB = VBUS +2. If only VBUS gpio is present we assume that ID pin is always High. + USB-HOST = false, USB = VBUS. +3. If only ID pin is available we infer the VBUS pin states based on ID. + USB-HOST = !ID, USB = ID Required properties: - compatible: Should be "linux,extcon-usb-gpio" + +Optional properties - id-gpio: gpio for USB ID pin. See gpio binding. +- vbus-gpio: gpio for USB VBUS pin. See gpio binding. +- debounce: gpio debounce time in milliseconds (u32). + Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below: extcon_usb1 { compatible = "linux,extcon-usb-gpio"; id-gpio = <&gpio6 1 GPIO_ACTIVE_HIGH>; + vbus-gpio = <&gpio6 2 GPIO_ACTIVE_HIGH>; + debounce = <25>; } &omap_dwc3_1 {