From patchwork Tue Apr 25 08:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 98179 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1833749qgf; Tue, 25 Apr 2017 01:05:28 -0700 (PDT) X-Received: by 10.84.129.131 with SMTP id b3mr37425677plb.1.1493107528332; Tue, 25 Apr 2017 01:05:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e65si21470311pfj.382.2017.04.25.01.05.28; Tue, 25 Apr 2017 01:05:28 -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 S1176386AbdDYIFX (ORCPT + 10 others); Tue, 25 Apr 2017 04:05:23 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:35295 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1176356AbdDYIDa (ORCPT ); Tue, 25 Apr 2017 04:03:30 -0400 Received: by mail-lf0-f43.google.com with SMTP id 75so86217631lfs.2 for ; Tue, 25 Apr 2017 01:03:29 -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=dZII3ESG4ZVO/PhC3YybZ7ljOsQ35nnOERiRWDEnNXc=; b=GVYjtNHahepVgZq1G2IZiGXtgqrBpwDBYn1BO/XF96jUvmtJgdEU6H33/lFzJs8L9v MhmcMmL4U+J548f26NL+QaclxM/jUuxzDmJ9vxzOcctm/LP0YgS0EIKn/PHAAOOXZN+t ni9jkfyt2NTDmMSuW54dR3A25Xx+9BjcW70Ks= 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=dZII3ESG4ZVO/PhC3YybZ7ljOsQ35nnOERiRWDEnNXc=; b=aUKyhdd3DdhlOLTNgkhdc0u/4qHPfrQPfdrKRDMhwv84kDKqCDs+CNhMje+9/YbPCL D9dAo3WO+j+NQ2Qh0hjX0a067HECjoNVzR0rZgmHob6hpSPw3qcFtRj7g3BPK54uFF8r oBtw9ejWJrquHTpntx1TsdbB8KDcaaG6+g49QB+xY/iZl8ufLZdk3pQPSlEBNhl6V4aD GijOFrn8wudnSa5LceP0bi/9xVIo841TnLd0bp5d1KOp71nu7VGZDd2yWVxGdKTraEej FsJv05sIkQbsI7UtTPJcbn7lBpjRefIXpfBo277/QvCYyDwOfPKGTwy33+vBIOACw4Ca +ugw== X-Gm-Message-State: AN3rC/7nZOFOFwT/NcZ8QC/ojEXZI7teMXo5/Pb0ihh5ln7eo2btatro YGwGypmaTqyhH9yP X-Received: by 10.25.67.81 with SMTP id m17mr9695954lfj.33.1493107408605; Tue, 25 Apr 2017 01:03:28 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 26sm3771861lfr.7.2017.04.25.01.03.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 01:03:27 -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 1/2 v5] ARM: dts: add XOADC and IIO HWMON to MSM8660/APQ8060 Date: Tue, 25 Apr 2017 10:03:24 +0200 Message-Id: <20170425080324.3876-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 --- 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-msm8660.dtsi | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 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-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi index 91c9a62ae725..3934a123b182 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 0x00 0x01>, /* Battery */ + <&xoadc 0x00 0x01>, /* DC in (charger) */ + <&xoadc 0x00 0x04>, /* VPH the main system voltage */ + <&xoadc 0x00 0x0b>, /* Die temperature */ + <&xoadc 0x00 0x0c>, /* Reference voltage 1.25V */ + <&xoadc 0x00 0x0d>, /* Reference voltage 0.625V */ + <&xoadc 0x00 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 = <2>; + #size-cells = <0>; + #io-channel-cells = <2>; + + vcoin: adc-channel@00 { + reg = <0x00 0x00>; + }; + vbat: adc-channel@01 { + reg = <0x00 0x01>; + }; + dcin: adc-channel@02 { + reg = <0x00 0x02>; + }; + ichg: adc-channel@30 { + reg = <0x00 0x03>; + }; + vph_pwr: adc-channel@04 { + reg = <0x00 0x04>; + }; + usb_vbus: adc-channel@0a { + reg = <0x00 0x0a>; + }; + die_temp: adc-channel@0b { + reg = <0x00 0x0b>; + }; + ref_625mv: adc-channel@0c { + reg = <0x00 0x0c>; + }; + ref_1250mv: adc-channel@0d { + reg = <0x00 0x0d>; + }; + ref_325mv: adc-channel@0e { + reg = <0x00 0x0e>; + }; + ref_muxoff: adc-channel@0f { + reg = <0x00 0x0f>; + }; + }; + rtc@1e8 { compatible = "qcom,pm8058-rtc"; reg = <0x1e8>;