From patchwork Tue Apr 10 16:07:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 896798 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=goldelico.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=goldelico.com header.i=@goldelico.com header.b="g3oFeHTS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40LBsH3VZqz9s1P for ; Wed, 11 Apr 2018 02:07:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbeDJQH2 (ORCPT ); Tue, 10 Apr 2018 12:07:28 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.175]:23133 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751367AbeDJQHZ (ORCPT ); Tue, 10 Apr 2018 12:07:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1523376441; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=gJPaokSt+89kxMwVWvIUCIKe0kkd3C6bSy4HiR/rGkI=; b=g3oFeHTSovBZRw2ueuW3NnFxSxAavQ5ICUfy08NOTzn83EgwwHC3IW08LQUcee9DHv Jsltet9DtbK415hQLwmK6hsx6tj8mNp2Akxw0Ru6kjl9Tc9BmCkufEYUbXs6xNwwPBYN 3pwwJsV1ZevaCWrsAlUWUyXP97/ZE4D9P1csWcVRQ9nMEszXJJPqX1iD75mZfmQHvnLN dEP5RFD0U5Bo5aus0vLGYaIOyF21Fg5yGQ4trzwszikN+366WjDvlAYzPqo0UyrJSG9h G5YzFco1+qvq1qsBIxEf2iWxhODQFsNhPAyDN4rKSCsku9ene2ZxGVwsYO8abMHxfB2I T0Yw== X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNO4Ij0NfySCnhA== X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 43.2 DYNA|AUTH) with ESMTPSA id i04eeeu3AG760o0 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 10 Apr 2018 18:07:06 +0200 (CEST) From: "H. Nikolaus Schaller" To: galak@codeaurora.org, andy.shevchenko@gmail.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Linus Walleij , Alexandre Courbot Cc: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, "H. Nikolaus Schaller" Subject: [PATCH v3 3/4] DTS: Bindings: pca953x add an optional vcc-supply property Date: Tue, 10 Apr 2018 18:07:03 +0200 Message-Id: <33bd9f06399356902480a9338319c9c3254c72f3.1523376423.git.hns@goldelico.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: References: In-Reply-To: References: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hardware can have a switchable Vcc supply, so let's add it to the bindings (the current Linux driver code already supports it). Signed-off-by: H. Nikolaus Schaller Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/gpio/gpio-pca953x.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt b/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt index d2a937682836..6a7cddb187c1 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt @@ -35,6 +35,7 @@ Required properties: Optional properties: - reset-gpios: GPIO specification for the RESET input. This is an active low signal to the PCA953x. + - vcc-supply: power supply regulator. Example: From patchwork Tue Apr 10 16:07:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 896796 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=goldelico.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=goldelico.com header.i=@goldelico.com header.b="Cwn4cnkM"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40LBry2JcZz9s1p for ; Wed, 11 Apr 2018 02:07:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134AbeDJQH1 (ORCPT ); Tue, 10 Apr 2018 12:07:27 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.174]:10850 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbeDJQHZ (ORCPT ); Tue, 10 Apr 2018 12:07:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1523376443; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=RAIt3sm79RhcW+OdilsxO4BG1vl1uyGllXSFwLzhg/g=; b=Cwn4cnkM+Roz426n8yaTLGjHa7ToGz2s/YRpgIchgEXFSGECz5rI38NFB4g/IAEZS5 5kVj1GWddqNUqVnP1ZKWy1uY1/Ls5KMQUE3ApNjENRTwI3zM7dF5PptI3TXZmkf0nPg0 69G8R2n0mffL+PiezKC6ir/fFDlUf4iAcLyoWvGScPrlW04pEalAxp0+O/ht+wg2GBBc c3sxIJICK0brko2h4g67SrljEvzioIICX6UpcHZwxruV0kPCMb9cQstfpolAtnaqK4pH WduBfMGgita2h58Cc4E2xuPeKrWF+WN5cYTQ5LQXVv65c7NS7M2gRXKKGj2Dx0sJINPv +vcg== X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNO4Ij0NfySCnhA== X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 43.2 DYNA|AUTH) with ESMTPSA id i04eeeu3AG760o1 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 10 Apr 2018 18:07:06 +0200 (CEST) From: "H. Nikolaus Schaller" To: galak@codeaurora.org, andy.shevchenko@gmail.com, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Linus Walleij , Alexandre Courbot Cc: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, "H. Nikolaus Schaller" Subject: [PATCH v3 4/4] DTS: Bindings: pca953x: add example how to use interrupt-controller and gpio-controller Date: Tue, 10 Apr 2018 18:07:04 +0200 Message-Id: <95fa67c09ef009675f6989662b657b6c8b9ac839.1523376423.git.hns@goldelico.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: References: In-Reply-To: References: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org It is not completely obvious that these are required and how to use them. So we provide a tested example. Signed-off-by: H. Nikolaus Schaller Reviewed-by: Rob Herring --- .../devicetree/bindings/gpio/gpio-pca953x.txt | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt b/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt index 6a7cddb187c1..88f228665507 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt @@ -31,6 +31,10 @@ Required properties: ti,tca9554 onnn,pca9654 exar,xra1202 + - gpio-controller: if used as gpio expander. + - #gpio-cells: if used as gpio expander. + - interrupt-controller: if to be used as interrupt expander. + - #interrupt-cells: if to be used as interrupt expander. Optional properties: - reset-gpios: GPIO specification for the RESET input. This is an @@ -48,3 +52,32 @@ Example: interrupt-parent = <&gpio3>; interrupts = <23 IRQ_TYPE_LEVEL_LOW>; }; + + +Example with Interrupts: + + + gpio99: gpio@22 { + compatible = "nxp,pcal6524"; + reg = <0x22>; + interrupt-parent = <&gpio6>; + interrupts = <1 IRQ_TYPE_EDGE_FALLING>; /* gpio6_161 */ + interrupt-controller; + #interrupt-cells = <2>; + vcc-supply = <&vdds_1v8_main>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "hdmi-ct-hpd", "hdmi.ls-oe", "p02", "p03", "vibra", "fault2", "p06", "p07", + "en-usb", "en-host1", "en-host2", "chg-int", "p14", "p15", "mic-int", "en-modem", + "shdn-hs-amp", "chg-status+red", "green", "blue", "en-esata", "fault1", "p26", "p27"; + }; + + ts3a227@3b { + compatible = "ti,ts3a227e"; + reg = <0x3b>; + interrupt-parent = <&gpio99>; + interrupts = <14 IRQ_TYPE_EDGE_RISING>; + ti,micbias = <0>; /* 2.1V */ + }; +