From patchwork Mon Apr 16 02:40:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10342051 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 81A92601D3 for ; Mon, 16 Apr 2018 02:41:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7130020CCF for ; Mon, 16 Apr 2018 02:41:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6531F22BF1; Mon, 16 Apr 2018 02:41:16 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7D2720CCF for ; Mon, 16 Apr 2018 02:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=8T/6SyGJ6jeKHxug3lQ7WBVUSkqBPHZ9PNuecl2Sx5s=; b=Zrh JDunYF6bap+fK+eV3Rt3ZH43nCZXoX/naOavOU0QA+dgOpCDPGzSU7KFMtgammgJxXHw02Fv/laij CMyPE9y1aupEIdzAWKn8gbv/C2c18CSMEjysseTTk20/jqfcV68BLm/cDzeBcldrLSUE+IM5qv8GA 3zqaC8rDnMa3MKjdAw6SHDds/W987orvUTGROocAX/Up6jMY4TIdLEMM/2pVCIjPaFw2S9acMXFzh H7lIt6Z3Zwlpygu91UnbcJ0iq+so27at/Gg4YLUfXO6wyrQ/Eo2eYQIuhbNZlMme+Shva3AANmNt/ RGmrTbxE1sfIYGpqQkgJEG0/qYKDoDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7u4k-00034c-1H; Mon, 16 Apr 2018 02:41:02 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7u4g-00033Q-RL for linux-arm-kernel@lists.infradead.org; Mon, 16 Apr 2018 02:41:00 +0000 Received: by mail-pl0-x241.google.com with SMTP id 91-v6so9179070pld.3 for ; Sun, 15 Apr 2018 19:40:48 -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; bh=2xD7531NSQgnnEsTGbc86fAdC93TdYhBr661G8cuI98=; b=Jgh+aiD08LdRf+rXg7ASHJauaxo0vW1fCc+8SFiko8b3zSc6IM5AS6HmcsnROb4zjv N7zi8xSE4SrFHbf9fOcnQ7Hhwpyb4CBv7+aHiUG4vCGgrRBBoTRQFuCcrGzn0i6OEvcM tMoYt/Vdrpo7sDga5JE0nAvE5ANT2GG2a3c+U= 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; bh=2xD7531NSQgnnEsTGbc86fAdC93TdYhBr661G8cuI98=; b=k8R/6qa4ly6xUQqWna3z890nZrSNbyjBX+/2cociMF1YkL/LkxECpAt07wy1VaJrU3 ow2b8fUIorgIH0/PUAWPL2nIVWF4r9H0eI3WQ+y3vGEHe666o8iuBYbe2p8e60M+PgN2 t5F343WC3BaGdv850hmEHMZu+BV+4gR5y2PIHiDCd9NZ6a+jfL5coVqaVbsr+Yq/IlQv mdjFht/4jjKZW9sQcr2hUoV7pvKvuUYvp87gF+Bs8vUoI2EhWuEIpAo7lFEcsLIbkeDK PNO6t1+i9PAG8lL6YX1KONKWpD86r4cAFBLmHNsummobwmnbrzOpR3GCPccyVwkopuzp 36Kw== X-Gm-Message-State: ALQs6tDS/N/Vh4QTEratFDCgW32/2ieGNLBAMi3+2OXwIgaCydrHPVKf ARTWDB+WUPZUUNnhcQCHx8vB8g== X-Google-Smtp-Source: AIpwx4/a4lZKdLtkchspvgywhpVjClKCBBo8ThZAX9yZO9UF30ZW470lTW5o5hMqr0dL7r1rMdcZ0w== X-Received: by 2002:a17:902:9a90:: with SMTP id w16-v6mr3180259plp.390.1523846447847; Sun, 15 Apr 2018 19:40:47 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id k70sm20920418pga.72.2018.04.15.19.40.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Apr 2018 19:40:47 -0700 (PDT) From: Baolin Wang To: robh+dt@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, arnd@arndb.de, orsonzhai@gmail.com, zhang.lyra@gmail.com Subject: [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Date: Mon, 16 Apr 2018 10:40:03 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_194058_885934_8CCE3E8D X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, arm@kernel.org, baolin.wang@linaro.org, linux-kernel@vger.kernel.org, broonie@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds device nodes to enable one GPIO controller located on digital chip, 2 EIC (external interrupt controller) controllers loacted on PMIC and digital chip for Spreadtrum SC9860 platform. Moreover this patch adds 3 GPIO keys relied on EIC controller to support power key and volume up/down keys. Signed-off-by: Baolin Wang --- arch/arm64/boot/dts/sprd/sc2731.dtsi | 11 ++++++++ arch/arm64/boot/dts/sprd/sc9860.dtsi | 30 ++++++++++++++++++++ arch/arm64/boot/dts/sprd/whale2.dtsi | 50 ++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) diff --git a/arch/arm64/boot/dts/sprd/sc2731.dtsi b/arch/arm64/boot/dts/sprd/sc2731.dtsi index 4331006..98d3b4f 100644 --- a/arch/arm64/boot/dts/sprd/sc2731.dtsi +++ b/arch/arm64/boot/dts/sprd/sc2731.dtsi @@ -24,6 +24,17 @@ interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; }; + pmic_eic: gpio@300 { + compatible = "sprd,sc27xx-eic"; + reg = <0x300>; + interrupt-parent = <&sc2731_pmic>; + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + regulators { compatible = "sprd,sc27xx-regulator"; diff --git a/arch/arm64/boot/dts/sprd/sc9860.dtsi b/arch/arm64/boot/dts/sprd/sc9860.dtsi index 5dbfb79..3066a55 100644 --- a/arch/arm64/boot/dts/sprd/sc9860.dtsi +++ b/arch/arm64/boot/dts/sprd/sc9860.dtsi @@ -7,6 +7,8 @@ */ #include +#include +#include #include "whale2.dtsi" / { @@ -679,5 +681,33 @@ }; }; }; + + gpio-keys { + compatible = "gpio-keys"; + + key-volumedown { + label = "Volume Down Key"; + linux,code = ; + gpios = <&eic_debounce 2 GPIO_ACTIVE_LOW>; + debounce-interval = <2>; + wakeup-source; + }; + + key-volumeup { + label = "Volume Up Key"; + linux,code = ; + gpios = <&pmic_eic 10 GPIO_ACTIVE_HIGH>; + debounce-interval = <2>; + wakeup-source; + }; + + key-power { + label = "Power Key"; + linux,code = ; + gpios = <&pmic_eic 1 GPIO_ACTIVE_HIGH>; + debounce-interval = <2>; + wakeup-source; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi index 66a881e..bf7e70c 100644 --- a/arch/arm64/boot/dts/sprd/whale2.dtsi +++ b/arch/arm64/boot/dts/sprd/whale2.dtsi @@ -154,6 +154,56 @@ clocks = <&aon_gate CLK_SPLK_EB>; }; + eic_debounce: gpio@40210000 { + compatible = "sprd,sc9860-eic-debounce"; + reg = <0 0x40210000 0 0x80>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + + eic_latch: gpio@40210080 { + compatible = "sprd,sc9860-eic-latch"; + reg = <0 0x40210080 0 0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + + eic_async: gpio@402100a0 { + compatible = "sprd,sc9860-eic-async"; + reg = <0 0x402100a0 0 0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + + eic_sync: gpio@402100c0 { + compatible = "sprd,sc9860-eic-sync"; + reg = <0 0x402100c0 0 0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + + ap_gpio: gpio@40280000 { + compatible = "sprd,sc9860-gpio"; + reg = <0 0x40280000 0 0x1000>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + pin_controller: pinctrl@402a0000 { compatible = "sprd,sc9860-pinctrl"; reg = <0 0x402a0000 0 0x10000>;