From patchwork Sun Sep 24 14:56:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 114126 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1642131qgf; Sun, 24 Sep 2017 07:58:20 -0700 (PDT) X-Received: by 10.84.235.76 with SMTP id g12mr4939384plt.338.1506265100755; Sun, 24 Sep 2017 07:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506265100; cv=none; d=google.com; s=arc-20160816; b=QWFgqk+TK5UTmzHrOhKDVBMSv9nSi1RZGju0lvnThV5vK42GiE46Jp40lpYjzvPMwp XX95aN2ZTeMQrhzpoJOFYl5v29MGll1dEIo3veiyE9YVHO8E+hOgSySbIMgMcxAaWRvG gB1EiHDr9N3+WyjQhOyWYmR77RE6h39OmGjw4NrcTCbrhFDI035r4NY2zFRxOCfOceAk suKnhbYHQuE8QBHZW9oUgSbqWhYCW8WzVUKsiqHIojeD7fMrz1DomcL+i6hu1S/DSAiR C72HxMhIzZ7ABgoA+6CEfmN3v68mqROyIL5vvaZvrG7MnBOSVr4JEl0xHbI8yh4MszsY ND4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=T4NJblz/c0fEBh5ERB2OlYVeiLL2a3GBaSynJ4urtiU=; b=JdO4aDJ+uKjySgqpoCr1/DWbZIMSZsUQ7sN+nyeg1WZkIniA0h2rn3kK5yZE9i5wkG R18IdBaDBdr3yM2rJ3DyJ9DXpIdNqaXOHgbod4+3KTX5kZrYNeEhRxRL6MitFt1gtWQN LrLEmvrPp+vDn9eLjjdDeVCDG4OCFDI1RVUNSbLi3N4Zb1ztZB5AGp+6Vd57vHqhiglo TOKUnxtzQcmAuz1/4QOMgc9Ung94ZDaV3W5GO1mSqtZ1vthTblwirUQvjF38kyUmgZxq a8gK7Pz6dOmg1bFOiw+gqWqqjzE5syd1RVg8DC0GOM8tH6clEajUTFNy9GnMWSxtEF0Z J5TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QF7PBOW1; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e128si2716135pgc.465.2017.09.24.07.58.20; Sun, 24 Sep 2017 07:58:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QF7PBOW1; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752591AbdIXO6S (ORCPT + 6 others); Sun, 24 Sep 2017 10:58:18 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:56643 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbdIXO6R (ORCPT ); Sun, 24 Sep 2017 10:58:17 -0400 Received: by mail-pg0-f43.google.com with SMTP id 7so2718704pgd.13 for ; Sun, 24 Sep 2017 07:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rUMJFZ9W2Zj6aH9dq/gwe8dNyjN5LXjryFbJTyasmt0=; b=QF7PBOW1/v4LKp0ht2FASIXDKMXSh7tmcrO9PkFIzS0vK3N4wZGAnSg4OkfE5T7Btm 3kTRzo1s36mZOygApWUDU1zLKutY9P5ZIFunnUBUFm3lfIyA5pp5z3Oem5iwIOA/Ag8p WI5WLBrd79Pe6FlGwxZNo/mY093hJ8rHRiIo0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rUMJFZ9W2Zj6aH9dq/gwe8dNyjN5LXjryFbJTyasmt0=; b=Wwx8xN310i8cl/sA0UL4KOONmU03N+H4zOsH9knP2R+szFKmOE+pP50//G+seBoXq+ HfGjt1PyaiyhIY+BaFzK5RfM/1ek3PZkQIulofU5xpF7dU5BX3Y+SAnWL3SMFpb2dOTS RjylsEBus2c24GaElHzqBgciUqpLgAHoYHCArrNxSKNNd13re94C2ETeibCrtOTkBT9B liIgvGk1RXEe150ckKezVyxqsu9vPAz+xvMkbO6nO5Ks48d7+CNqHlPJ7GZfUqUXGZTU djJpJOGyxDEcMVV2NO3a0sgPbCu1SwuZenMwXCvkCY2wrQERDq67D4ZJwGE9Hv0QQrki jLvQ== X-Gm-Message-State: AHPjjUjaNhSb91kNw00lx9ftnRSPMGr4ELf/s+DpDMibFE2JngBraJcR Go65/TGUc4LFI83fCx/XEA869g== X-Google-Smtp-Source: AOwi7QBcbeQX2SYXsymbP5MJVO8dQv3z+RGK2yn+UX9/DazgjYgwHuLoSogsgtbWCyKD4y3tgyro8A== X-Received: by 10.98.79.157 with SMTP id f29mr4849724pfj.9.1506265097206; Sun, 24 Sep 2017 07:58:17 -0700 (PDT) Received: from genomnajs.saswifi.com ([104.153.224.168]) by smtp.gmail.com with ESMTPSA id n83sm7386805pfi.163.2017.09.24.07.57.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Sep 2017 07:58:16 -0700 (PDT) From: Linus Walleij To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, John Stultz , Mike Lockwood , Guenter Roeck , Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 1/8] extcon: gpio: Add DT bindings Date: Sun, 24 Sep 2017 16:56:15 +0200 Message-Id: <20170924145622.4031-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170924145622.4031-1-linus.walleij@linaro.org> References: <20170924145622.4031-1-linus.walleij@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add some reasonable device tree bindings and also add the cable defines to the extcon include in since the GPIO extcon definately need to specify which cable/connector it is detecting. Adding the include file makes the (as it happens) Linux numbers into an ABI, but I do not see any better method. It is possible to define strings for all cable types but it seems like overkill, just reusing Linux' enumerators seems like a good idea. The binding supports any number of GPIOs and connectors, but the driver currently only supports one connector on one GPIO line. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- .../devicetree/bindings/extcon/extcon-gpio.txt | 24 ++++++++++++++ include/dt-bindings/extcon/connectors.h | 38 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/extcon/extcon-gpio.txt create mode 100644 include/dt-bindings/extcon/connectors.h -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt new file mode 100644 index 000000000000..2f5e21b94a64 --- /dev/null +++ b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt @@ -0,0 +1,24 @@ +External Connector Using GPIO + +Required properties: +- compatible: should be "extcon-gpio" +- extcon-gpios: the GPIO lines used for the external connectors + See gpio/gpio.txt +- extcon-connector-types: set to an unsigned integer value arrat representing the types + of this connector, matched to the corresponding GPIO lines in the previous array. + Those are defined with unique IDs in +- input-debounce: The number of microseconds to wait for the + connector state to stabilize. This property is reused from pin control + See pinctrl/pinctrl-bindings.txt + +Example: + +#include +#include + +extcon { + compatible = "extcon-gpio"; + extcon-gpios = <&gpio0 42 GPIO_ACTIVE_LOW>; + extcon-connector-types = ; + input-debounce = <20000>; /* 20 ms */ +}; diff --git a/include/dt-bindings/extcon/connectors.h b/include/dt-bindings/extcon/connectors.h new file mode 100644 index 000000000000..61bed24eaadc --- /dev/null +++ b/include/dt-bindings/extcon/connectors.h @@ -0,0 +1,38 @@ +#ifndef _DT_BINDINGS_EXTCON_CONNECTORS_H +#define _DT_BINDINGS_EXTCON_CONNECTORS_H + +/* USB external connector */ +#define EXTCON_USB 1 +#define EXTCON_USB_HOST 2 +#define EXTCON_CHG_USB_SDP 5 /* Standard Downstream Port */ +#define EXTCON_CHG_USB_DCP 6 /* Dedicated Charging Port */ +#define EXTCON_CHG_USB_CDP 7 /* Charging Downstream Port */ +#define EXTCON_CHG_USB_ACA 8 /* Accessory Charger Adapter */ +#define EXTCON_CHG_USB_FAST 9 +#define EXTCON_CHG_USB_SLOW 10 +#define EXTCON_CHG_WPT 11 /* Wireless Power Transfer */ +#define EXTCON_CHG_USB_PD 12 /* USB Power Delivery */ +/* Jack external connector */ +#define EXTCON_JACK_MICROPHONE 20 +#define EXTCON_JACK_HEADPHONE 21 +#define EXTCON_JACK_LINE_IN 22 +#define EXTCON_JACK_LINE_OUT 23 +#define EXTCON_JACK_VIDEO_IN 24 +#define EXTCON_JACK_VIDEO_OUT 25 +#define EXTCON_JACK_SPDIF_IN 26 /* Sony Philips Digital InterFace */ +#define EXTCON_JACK_SPDIF_OUT 27 +/* Display external connector */ +#define EXTCON_DISP_HDMI 40 /* High-Definition Multimedia Interface */ +#define EXTCON_DISP_MHL 41 /* Mobile High-Definition Link */ +#define EXTCON_DISP_DVI 42 /* Digital Visual Interface */ +#define EXTCON_DISP_VGA 43 /* Video Graphics Array */ +#define EXTCON_DISP_DP 44 /* Display Port */ +#define EXTCON_DISP_HMD 45 /* Head-Mounted Display */ +/* Miscellaneous external connector */ +#define EXTCON_DOCK 60 +#define EXTCON_JIG 61 +#define EXTCON_MECHANICAL 62 + +#define EXTCON_NUM 63 + +#endif /* _DT_BINDINGS_EXTCON_CONNECTORS_H */