From patchwork Tue Jan 31 10:21:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92956 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1857662qgi; Tue, 31 Jan 2017 02:29:52 -0800 (PST) X-Received: by 10.84.210.8 with SMTP id z8mr37837396plh.94.1485858592500; Tue, 31 Jan 2017 02:29:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g71si15494426pfd.122.2017.01.31.02.29.52; Tue, 31 Jan 2017 02:29:52 -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 S1751510AbdAaK3v (ORCPT + 9 others); Tue, 31 Jan 2017 05:29:51 -0500 Received: from mail-lf0-f44.google.com ([209.85.215.44]:36358 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbdAaK3t (ORCPT ); Tue, 31 Jan 2017 05:29:49 -0500 Received: by mail-lf0-f44.google.com with SMTP id z134so208865835lff.3 for ; Tue, 31 Jan 2017 02:29:43 -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; bh=TorG+EtHjFaRGvwJtp+Utns2q8bo7WqVDGBqkg57lZs=; b=a7YrWukuo7W9NDGAlwuIfBOboS+9x85PK/dXiTls8SDY/ja2RJwo3jDpiQF3/QbyUK 28zlWo5JdSCn737c6gSBOhSEoVmqyMnX5oPODtzMKtC2qGZLc1aa1fbeImjP9mUh0Wgv U3X51Vtj3m6E2xuS/nks7CKGOVF6+12lb7IoU= 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=TorG+EtHjFaRGvwJtp+Utns2q8bo7WqVDGBqkg57lZs=; b=eaniTB00EWtDBZC6c0eLPBHVOkzzKUrGOVRoCiNyA8qz7ONv8nKBSNj69TGCJ481/d CX2M29OwRdzZcVAsCC63kShvbA2ADiVHycauMSHGoiYyxs8nYpuzcrxbPD8lZrTz/9V0 nIooOFOd3cZhkunVN+9kewAvGct+NfvpSjh3IHJfx2udJOmgs35PepDS/ULTYObBA0+a fpQpZdndj3ihreOG2Mr9QaT9gwMgPSDHZt6TEiw/V05aRm1oGk/7szYzUVvWidT/9Dje cF/88dIq5mFq4yO+DSUsNYThVGp9R28i9oXLDSli9CBDu+rCbLEo4ihAM0RHVu6x3WXU Iqtw== X-Gm-Message-State: AIkVDXL70gmBeF41F7ATymYIJ+1G4nNq3K76nNdg/XNBheeXRbG/QOS/B7gbYqJcrx6B2Spd X-Received: by 10.46.22.15 with SMTP id w15mr9226935ljd.35.1485858091500; Tue, 31 Jan 2017 02:21:31 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 02:21:30 -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 1/2] ARM: dts: add XOADC and IIO HWMON to MSM8660/APQ8060 Date: Tue, 31 Jan 2017 11:21:13 +0100 Message-Id: <20170131102114.25085-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 PM8058 XOADC node to the PM8058 PMIC node, defines the 16 channels and further also define an IIO HWMON node for the channels that are used for housekeeping of voltages and die temperature for the PMIC chip die. Tested on the APQ8060 DragonBoard: cd /sys/class/hwmon/hwmon0 cat in2_input 4773 (DC mains ~5V) cat in4_input 625 (0.625V reference voltage) cat in5_input 1250 (1.25V reference voltage) cat temp1_input 35852 (die temperature) 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 | 27 ++++++++++++ arch/arm/boot/dts/qcom-msm8660.dtsi | 59 ++++++++++++++++++++++++++ 2 files changed, 86 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 39d9e6ddefed..c04960371c5e 100644 --- a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts @@ -327,6 +327,33 @@ }; }; + xoadc@197 { + /* Reference voltage 2.2 V */ + xoadc-ref-supply = <&pm8058_l18>; + + /* Board-specific channels */ + mpp5 { + /* Connected to AOUT of ALS sensor */ + reg = <0x05>; + }; + mpp6 { + /* Connected to test point TP43 */ + reg = <0x06>; + }; + mpp7 { + /* Connected to battery thermistor */ + reg = <0x07>; + }; + mpp8 { + /* Connected to battery ID detector */ + reg = <0x08>; + }; + mpp9 { + /* Connected to XO thermistor */ + reg = <0x09>; + }; + }; + led@48 { /* * The keypad LED @0x48 is routed to diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi index 91c9a62ae725..5ca6df54f9b5 100644 --- a/arch/arm/boot/dts/qcom-msm8660.dtsi +++ b/arch/arm/boot/dts/qcom-msm8660.dtsi @@ -63,6 +63,22 @@ }; }; + /* + * These channels from the ADC are simply hardware monitors. + * That is why the ADC is referred to as "HKADC" - HouseKeeping + * ADC. + */ + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&xoadc 0x01>, /* Battery */ + <&xoadc 0x02>, /* DC in (charger) */ + <&xoadc 0x04>, /* VPH the main system voltage */ + <&xoadc 0x0b>, /* Die temperature */ + <&xoadc 0x0c>, /* Reference voltage 1.25V */ + <&xoadc 0x0d>, /* Reference voltage 0.625V */ + <&xoadc 0x0e>; /* Reference voltage 0.325V */ + }; + soc: soc { #address-cells = <1>; #size-cells = <1>; @@ -267,6 +283,49 @@ row-hold = <91500>; }; + xoadc: xoadc@197 { + compatible = "qcom,pm8058-adc"; + reg = <0x197>; + interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>; + #address-cells = <1>; + #size-cells = <0>; + #io-channel-cells = <1>; + + vcoin: adc-channel@0 { + reg = <0x00>; + }; + vbat: adc-channel@1 { + reg = <0x01>; + }; + dcin: adc-channel@2 { + reg = <0x02>; + }; + ichg: adc-channel@3 { + reg = <0x03>; + }; + vph_pwr: adc-channel@4 { + reg = <0x04>; + }; + usb_vbus: adc-channel@a { + reg = <0x0a>; + }; + die_temp: adc-channel@b { + reg = <0x0b>; + }; + ref_625mv: adc-channel@c { + reg = <0x0c>; + }; + ref_1250mv: adc-channel@d { + reg = <0x0d>; + }; + ref_325mv: adc-channel@e { + reg = <0x0e>; + }; + ref_muxoff: adc-channel@f { + reg = <0x0f>; + }; + }; + rtc@1e8 { compatible = "qcom,pm8058-rtc"; reg = <0x1e8>; 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";