From patchwork Sat May 13 14:15:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 99751 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp782905qge; Sat, 13 May 2017 07:16:00 -0700 (PDT) X-Received: by 10.99.114.67 with SMTP id c3mr9779855pgn.67.1494684960593; Sat, 13 May 2017 07:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494684960; cv=none; d=google.com; s=arc-20160816; b=BBUYGKY9Fnt9rgI9YWG4Zp94JCEOYct5kzu+H7pVEdjvhZictMjnOnGNswv807IdHA mbY5RYUINIVHjzsdcV/WGZDYrhUEvijXuzqTp9i9R6kzU/vNGJyLJ7k1D80xT8xESJnO jANWQRjR2vF8VhdrFu2vjY8gDo+e65fItBiwklyi7y6OQSwaHvrR9CHVgtm6t48/PUC9 cSVn0Mv6yNrgHTgUcPwQpvVZD9xsVevKowmzeUDzK1wIC7vQsD4oIxsNvImDPChW8z6e kp7zLepX9YhDGlyrAWQHrp0tBGpo43GJmBLYdr5moDWBvOT+OoSQRLmIt0ciiheTS3P1 CQbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=81Rmqc+XTUv4EU3lh3zRua2S+8ZPDZSJe+qsLLxyeZI=; b=g0SAVwPU7cLC48kTIWx3Qa9p7BuHpG/MHs5xHvO6n9YKtSd0UV6xSEYFWOv/yhD4Fj pGwnITwVt5HjysPaAjyNk1nbtmWkmlkeXwIVqa7ONnsOY4zSDFIJK+XFUylKklypZGdw mHuAwi/7HtfC9Td0fxb06CU/LD0sFivjlsiw2gv+OAlIGrra8J5/OJ0u1EuNf8Y8O+Md dsnMuFsSJzUf/agSARQpN6ZGJNqB75BVPBKRJEclMCcC1LsULFBie8SXjriLaFib/cnc ssjMRlArXUgtPA8EeA2uCf/gJSzzEfIeMynG8dSWdaFqs1XdjeSoBW6muvCCyDy+WCrr B54Q== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si6014780pls.254.2017.05.13.07.16.00; Sat, 13 May 2017 07:16:00 -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 S1752361AbdEMOP7 (ORCPT + 10 others); Sat, 13 May 2017 10:15:59 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:34238 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbdEMOP6 (ORCPT ); Sat, 13 May 2017 10:15:58 -0400 Received: by mail-lf0-f52.google.com with SMTP id 99so13258189lfu.1 for ; Sat, 13 May 2017 07:15:58 -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=urzN6phyWB5/Lw7FgGDI8tnA2LBilGqGlYWyWb1cRwg=; b=UDsZjeyIxbjHqyaPnLZ4o9lmqz1yPs50bJ+OV1B8xx7ZgqhSDz+3iGWd471CCXrEXV h2kVFA2hToxEMqch3CsoXf1ufQ3Tit7x+z2hdM0KfifDrnoOPGYMBIT0oHJYg/onc5Cv yJKin9kCMWCdFTE1Al5ZcfeykUHRIe9v1M1sM= 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=urzN6phyWB5/Lw7FgGDI8tnA2LBilGqGlYWyWb1cRwg=; b=rE4+i+vikDdCxbWPXpq/GINiis4Bd7j0fmC2Hb25MKPyJCU7bFypSs+FJN4EClF/CZ NFLWaB1GxM0PE2OQhUxvZOR2bt2uXmfAqqMIF6KLWOaOMXkVdd/7oiNi2KqOA8XqMKJs Og6A9vSr/X8WHTOQW0T2ng8bsA4iT4FPdezJQggN4vU+CYA7k4PEJ6AB2dQMQGcqVjgu Wqe2YR/F686yRP9hHsj772Jr8dNm9tmK7ozMBsVBmVxiykt+mp848iDLkJws0y0nmF4M Fn4hP+tpEPpXZmKC+WpPAlVgYystNbKue7a2RKVajTfgRrqgAujvsdSpdl4kXeP9Myws UHlQ== X-Gm-Message-State: AODbwcA//hE4R7PaxC/mjpDFsHh080q0dVVWQkac+nsF7AE9O+GTGKaV GQfNsiYTScnpcBuJ X-Received: by 10.25.155.145 with SMTP id d139mr3468824lfe.174.1494684957152; Sat, 13 May 2017 07:15:57 -0700 (PDT) Received: from genomnajs.bredbandsbolaget.se (c-0e0be055.014-348-6c756e10.cust.bredbandsbolaget.se. [85.224.11.14]) by smtp.gmail.com with ESMTPSA id m20sm574400ljb.26.2017.05.13.07.15.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 May 2017 07:15:55 -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 v6] ARM: dts: Qualcomm APQ8060 DragonBoard ALS sensor Date: Sat, 13 May 2017 16:15:53 +0200 Message-Id: <20170513141553.24806-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 v5->v6: - No changes just resending with the other patch. 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 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 2da1413f5720..5225e489ef52 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";