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: 9697693 X-Patchwork-Delegate: agross@codeaurora.org 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 38A12601D3 for ; Tue, 25 Apr 2017 08:05:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41AEF28449 for ; Tue, 25 Apr 2017 08:05:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 369D92858E; Tue, 25 Apr 2017 08:05:38 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D54DF28449 for ; Tue, 25 Apr 2017 08:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1176387AbdDYIFa (ORCPT ); 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 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 --- 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(+) 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";