From patchwork Sat May 13 14:15:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 99750 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp782849qge; Sat, 13 May 2017 07:15:52 -0700 (PDT) X-Received: by 10.99.114.67 with SMTP id c3mr9779283pgn.67.1494684952627; Sat, 13 May 2017 07:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494684952; cv=none; d=google.com; s=arc-20160816; b=PtJXfgd6hm7/d7L+eEtFeczjizlnQe8aKfUE6dzbnF50XqEcDXWVzUxYtVqb+2vXOU /kHd1/miWlxnoK+5wBuT7cCmpurbXYWeGm6ISv6TgGDoUUjn0CSHzo7xpBk8h1GMOlaC 8TZxGfPEPJDr7o29qUN+TXMWMFwshIQz52M+GjnGOh4pc+uIe4hRUzaCDTKt3xgh3yn5 TwUglzmgwEy/6YHU/L8Eu3VaSPWVkbZrcHoAiefDukXz8dcWBzVz07oIGQCCt7/FNUHk 5YCIfXDLWfxMT9+KZz0+LfbspF8eu4IYF4nj1/E3Tw6mXQLvZozTxOfXRwi7UxyLcHhW 3i1Q== 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=H9KeNLdJmgmz42QzyziBtRBHyj020Yg6FtDImKmB8d4=; b=fNiW9JQGkRzWX3dgymhiAzoV5z25+twJ4PmqEBJmNoyo+iIPKioKfE2SFw7ZtPEfBX Td31ClB2YdyIRQAxF0JVaxdutpKmxkkbiADoLimAH5jeumBfFam7zFFa4qfEmV25y87z rkQA1Ex9ljFzEMc0s5Bi6CD+0/sUew8jJmkJDdrrQcWLzkfqN5TtZqHzJC8muKVx33Hy I7ddy+XV3jAVJGW0CqxzibOjJ6ED3MCJayOi+q4BRQZCAaQXLM2VNV9ovXtwFLA+VXDK b7Y02j3dwQ5CiRDyIIYnH9Ddq5A75t6Kw2lFZHWJYGe0S3dkbge4DGz6OtKCz8C1wGmn WAPw== 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.15.52; Sat, 13 May 2017 07:15:52 -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 S1752275AbdEMOPu (ORCPT + 10 others); Sat, 13 May 2017 10:15:50 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:35903 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751877AbdEMOPu (ORCPT ); Sat, 13 May 2017 10:15:50 -0400 Received: by mail-lf0-f41.google.com with SMTP id h4so13219218lfj.3 for ; Sat, 13 May 2017 07:15:49 -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=yk9y2loQMr3w/t/sPrvvoVtvw7Mk2PbODxWh8Q6XmZg=; b=YHzjs6XQ0/aMzLze39C6VSVdh5HZ9cGaxUgs8jBchuf6G0QykAMACzY6phwT1UI+L3 1ANN2Ho7tgTFZJNfJECqgQ1LKBC2y9UsbFWC2lS/2/G/+8FpZdcPf2bkBLJaO2ncz0ql xZMpl4QI+Xy5hbjDnjd21fdEo4yzlQ8WnVwZw= 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=yk9y2loQMr3w/t/sPrvvoVtvw7Mk2PbODxWh8Q6XmZg=; b=dh8QeU91CHaetmN8iPTvXCpYvzo95mz8dnJ7hbFJyWBlNlIS9VoGEQnhdSRjvxEtg2 636wFn9tPQBNQ5BATbVvAzmnZ8k1O7WNNkK1LJ+5nPrdjr9t7OOH7Yo4LYirYPCwBY87 9v4oa64xV06le2G17qED4+n2Lc4Eji2a5Hk/oPiVzksuvywfjgxifxuPFmTeRTUVzFvT Tzm+ytxA9T11YaSu7y//WGfuVZUrmHch7lswKwu9mp30eVNFn4j+FV69Lnq672fjE6mr yitBQWhoYs7PabOtgM/KceUwbFqC83h1E7Lms/gGA8v8ZFeQiueM1KuDRmqIinfvtNKO 9JFg== X-Gm-Message-State: AODbwcA9vK7Sxq779eoumHmCmu+RZAlx7mWpeAEzl+m9Tt6ykkO9QUkU Pnl2pDDNOOiAM2aq X-Received: by 10.46.21.79 with SMTP id 15mr3643160ljv.15.1494684948311; Sat, 13 May 2017 07:15:48 -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 x24sm442130ljd.5.2017.05.13.07.15.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 May 2017 07:15:46 -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 v6] ARM: dts: add XOADC and IIO HWMON to MSM8660/APQ8060 Date: Sat, 13 May 2017 16:15:43 +0200 Message-Id: <20170513141543.24759-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 v5->v6: - Fix two typos in the DTSI file. - The driver is now merged, all dependencies are in place upstream. 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 Acked-by: Bjorn Andersson diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi index 747669a62aa8..f5631e810e9d 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 0x02>, /* 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@03 { + 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>;