From patchwork Tue Jan 31 10:21:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9546889 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 122956016C for ; Tue, 31 Jan 2017 10:22:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0227F27FAD for ; Tue, 31 Jan 2017 10:22:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA0EE282ED; Tue, 31 Jan 2017 10:22:46 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 7CFD627FAD for ; Tue, 31 Jan 2017 10:22:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cYVaH-0005Lj-3C; Tue, 31 Jan 2017 10:22:45 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cYVZU-0004Wu-FO for linux-arm-kernel@lists.infradead.org; Tue, 31 Jan 2017 10:21:58 +0000 Received: by mail-lf0-x234.google.com with SMTP id n124so208328928lfd.2 for ; Tue, 31 Jan 2017 02:21:36 -0800 (PST) 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=5ZU43Cdt84PrIDTbItus5bwWkNP52UvvjNRHLpJFN2A=; b=SlEsvlsnRlXP3i2ksJDDDd5fGeUpP6kyL2lU7wvrI9sPWspVp14QMZwpF3cdfpP+yl cGLIOZBiEspF51u3P98Ofom/3VEQOyJG4FCy8FbYC/XUjCFRikhHetUnHO8F+4ZCscGW 9/FgGYJNYG2rIFunBMUsEDvASJgTRMHMigeMQ= 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=5ZU43Cdt84PrIDTbItus5bwWkNP52UvvjNRHLpJFN2A=; b=lIpsLz93b5E2QdkIblMHg0BUBTxE8VMP0o1lyOhgTh0+T6T+ZmTHI+0lPAO3my6F5p rE3jleRtxk02CIe13IxdXSL9NWddrfNrzmdRMGqA+8XiR1a5E7iuA5Qcb8NgizP3S6hJ DtBGPAeXVvf8b5cK8T7qCjTIup7lKwjb5DXcwm4VPC7EhPCplqNmvKd7KNyEfq7B0GBB lmN7Imbn6cGROxv6n2ztHChBb24MUdWWlHnlk8Gh58UuVktpmZXEFZ6HovJyG2lvzw6P Tjvj1cZuZOrNvAQtl4FyKejE3yk71V4k87PSRpXrU6yHy1/3oUDsCSFtOgqQJTqsOt0B GnaA== X-Gm-Message-State: AIkVDXIV7HsqhU4ny85VDlB02xkP758b2qNNNMEDH9Q4U5GeryoQYW0QyCZD8T/82PU2cjY4 X-Received: by 10.46.76.9 with SMTP id z9mr9262851lja.1.1485858094482; Tue, 31 Jan 2017 02:21:34 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id x64sm4462959lfd.15.2017.01.31.02.21.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 02:21:33 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson Subject: [PATCH 2/2] ARM: dts: Qualcomm APQ8060 DragonBoard ALS sensor Date: Tue, 31 Jan 2017 11:21:14 +0100 Message-Id: <20170131102114.25085-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170131102114.25085-1-linus.walleij@linaro.org> References: <20170131102114.25085-1-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170131_022156_703987_A8BD9240 X-CRM114-Status: GOOD ( 14.23 ) 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: David Brown , Linus Walleij , Stephen Boyd 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 adds the Capella CM3605 ambient light and proximity sensor to the APQ8060 DragonBoard device tree. Notice that we also set up pin config for the AOUT line and GPIO lines, and that we set the default trigger on the infrared LED to associate with the "cm3605" trigger so the IR LED is controlled by this the CM3605 driver. Signed-off-by: Linus Walleij Acked-by: Bjorn Andersson --- Andy: these bindings have been merged to the IIO tree and ACKed by DT maintainers. --- arch/arm/boot/dts/qcom-apq8060-dragonboard.dts | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts index c04960371c5e..f3bd65e284ee 100644 --- a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts @@ -23,6 +23,7 @@ #include #include #include +#include #include "qcom-msm8660.dtsi" / { @@ -83,6 +84,25 @@ }; }; + /* + * Capella CM3605 light and proximity sensor mounted directly + * on the sensor board. + */ + cm3605 { + compatible = "capella,cm3605"; + vdd-supply = <&pm8058_l14>; // 2.85V + aset-gpios = <&pm8058_gpio 35 GPIO_ACTIVE_LOW>; + capella,aset-resistance-ohms = <100000>; + /* GPIO34 has interrupt 225 on the PM8058 */ + /* Trig on both edges - getting close or far away */ + interrupts-extended = <&pm8058 225 IRQ_TYPE_EDGE_BOTH>; + /* MPP05 analog input to the XOADC */ + io-channels = <&xoadc 0x05>; + io-channel-names = "aout"; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_cm3605_gpios>, <&dragon_cm3605_mpps>; + }; + soc { pinctrl@800000 { /* eMMMC pins, all 8 data lines connected */ @@ -317,6 +337,24 @@ power-source = ; }; }; + dragon_cm3605_gpios: cm3605-gpios { + /* Pin 34 connected to the proxy IRQ */ + pinconf_gpio34 { + pins = "gpio34"; + function = "normal"; + input-enable; + bias-disable; + power-source = ; + }; + /* Pin 35 connected to ASET */ + pinconf_gpio35 { + pins = "gpio35"; + function = "normal"; + output-high; + bias-disable; + power-source = ; + }; + }; dragon_veth_gpios: veth-gpios { pinconf { pins = "gpio40"; @@ -327,6 +365,20 @@ }; }; + mpps@50 { + dragon_cm3605_mpps: cm3605-mpps { + pinconf { + pins = "mpp5"; + function = "analog"; + input-enable; + bias-high-impedance; + /* Let's use channel 5 */ + qcom,amux-route = ; + power-source = ; + }; + }; + }; + xoadc@197 { /* Reference voltage 2.2 V */ xoadc-ref-supply = <&pm8058_l18>; @@ -367,6 +419,7 @@ reg = <0x48>; label = "pm8058:infrared:proximitysensor"; default-state = "off"; + linux,default-trigger = "cm3605"; }; led@131 { compatible = "qcom,pm8058-led";