From patchwork Tue Apr 25 08:03:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 98180 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1833827qgf; Tue, 25 Apr 2017 01:05:41 -0700 (PDT) X-Received: by 10.99.111.1 with SMTP id k1mr27312861pgc.194.1493107541918; Tue, 25 Apr 2017 01:05:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w126si21455480pgb.193.2017.04.25.01.05.41; Tue, 25 Apr 2017 01:05:41 -0700 (PDT) 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 S1176387AbdDYIFa (ORCPT + 10 others); Tue, 25 Apr 2017 04:05:30 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:33271 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1176358AbdDYIDh (ORCPT ); Tue, 25 Apr 2017 04:03:37 -0400 Received: by mail-lf0-f50.google.com with SMTP id 88so86287561lfr.0 for ; Tue, 25 Apr 2017 01:03:36 -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=WiXYYPmjW2L3sqaGG4DfgJCn1BkwoFTnV4Mmf/cSCgE=; b=DhvOBSrpyQbKC6OOWQutmegbVCl0xlSpWgqX7kC43SJsAhzGKYb0es5nZL8h+RJTUN PyWinvoUMhPEkBzU7H4yxtLDmpO9e2Y3MLlhHHFsw8R767CeUehjT4OjSVhsmbSqGPgE ED1yNl56NXKgE7IAq3YOzlwHJQOqO6Ooz6JPQ= 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=WiXYYPmjW2L3sqaGG4DfgJCn1BkwoFTnV4Mmf/cSCgE=; b=mykFiSATuXWtJ0P8I5L77wihiA/+VH1A+okASvFVGcKQfxXUnn+76/G9vH+v6O0Lhb vNleuG4qfRRYeZFuwbLvnYQxZ/PiGC44ggxHe6LYHmSM6BsE6pCFPmlHGSIk9xoLknyk C+uEWDyk7T5a/mRombOvYb0W1ctktkeOxY1pDSNBPD1tJToVd/ApaIuKgJnZbngvCU8g WD7bYucS40YWC7I17bOkjBw5MgWvtqAbbpQYpDNrx6DiTuBcra4kwYSb9OTtU16mZU1L QYNEAeF1kVatukYiII/9Le5/1gco27PA/PRU5Yv9w0MIJV91L22qqwdscNeIVe4i4P1m IBNg== X-Gm-Message-State: AN3rC/72AyAZTo1EnOeRg54EtWgQlMqxLm5i5e5cgHaOpu2XlkkvkL2J 25rUV+S5HMssbOM+ X-Received: by 10.46.1.168 with SMTP id f40mr10836918lji.74.1493107415864; Tue, 25 Apr 2017 01:03:35 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 33sm3779865lfs.16.2017.04.25.01.03.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 01:03:34 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson Cc: Stephen Boyd , Linus Walleij Subject: [PATCH 2/2 v5] ARM: dts: Qualcomm APQ8060 DragonBoard ALS sensor Date: Tue, 25 Apr 2017 10:03:32 +0200 Message-Id: <20170425080332.3923-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 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 --- ChangeLog v1->v5: - Switch to the twocell addressing scheme specified in the new bindings. - The bindings and IIO driver are both queued for v4.12 in the IIO tree and pending in linux-next --- arch/arm/boot/dts/qcom-apq8060-dragonboard.dts | 80 ++++++++++++++++++++++++++ 1 file changed, 80 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 diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts index 39d9e6ddefed..355b3b9c31bc 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 0x00 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,47 @@ }; }; + 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>; + + /* Board-specific channels */ + mpp5@05 { + /* Connected to AOUT of ALS sensor */ + reg = <0x00 0x05>; + }; + mpp6@06 { + /* Connected to test point TP43 */ + reg = <0x00 0x06>; + }; + mpp7@07 { + /* Connected to battery thermistor */ + reg = <0x00 0x07>; + }; + mpp8@08 { + /* Connected to battery ID detector */ + reg = <0x00 0x08>; + }; + mpp9@09 { + /* Connected to XO thermistor */ + reg = <0x00 0x09>; + }; + }; + led@48 { /* * The keypad LED @0x48 is routed to @@ -340,6 +419,7 @@ reg = <0x48>; label = "pm8058:infrared:proximitysensor"; default-state = "off"; + linux,default-trigger = "cm3605"; }; led@131 { compatible = "qcom,pm8058-led";