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: 92957 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1865546qgi; Tue, 31 Jan 2017 02:54:51 -0800 (PST) X-Received: by 10.99.160.1 with SMTP id r1mr29298613pge.171.1485860091433; Tue, 31 Jan 2017 02:54:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si15593117pli.200.2017.01.31.02.54.51; Tue, 31 Jan 2017 02:54:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1751513AbdAaKyu (ORCPT + 9 others); Tue, 31 Jan 2017 05:54:50 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:33808 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbdAaKyt (ORCPT ); Tue, 31 Jan 2017 05:54:49 -0500 Received: by mail-lf0-f48.google.com with SMTP id v186so209240504lfa.1 for ; Tue, 31 Jan 2017 02:54:44 -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=eI+1XBggRo5xcnnmq5ljH90hKqwRsbS89kZRHsfEmPkEIDGEfW68U1KbqxQkZrNx6P vLWT8on/uthGBRXWtSGrWgBOJ4itOTlXzXivTKn6b/0Dj13fDIJGZa94w+U+MCYe2Gmm s9uj7SzJ7fzBzTgG2q6DWV7dcn1mbcwebJAtCOg3ni68RdbCsGaYm1NgpugDfr/XvHWQ ZK45EVX0vLIaGyVBnGTUzbFW0NJqeI3rT+jws3/bb5lvPjVHF+yTEzZAk0ktODfFbR77 h0evg0+dWTxU2LHi5aMaI8FyfMBVbiw1I+BcpEm20lLfKwRIWRTVifhLMDxAfpdu6sx6 bFPg== X-Gm-Message-State: AIkVDXKY7xbSVxqaY5s5WNGUipLCMgkhy9IlIvaDHsXp9glVmhdelHJmbXzqnLwMqhbU/Wl6 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 Cc: Stephen Boyd , David Brown , Linus Walleij 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- 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(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Bjorn Andersson 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";