From patchwork Wed Feb 28 10:16:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 129932 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1349118edc; Wed, 28 Feb 2018 02:19:07 -0800 (PST) X-Google-Smtp-Source: AH8x225ZUDmHOwz72qxyQImzKcnt8PRVsBEhSsTFfWau5X7nAxiHVnKhcmm5hs/C4fJ1ESs/4C5K X-Received: by 10.99.117.24 with SMTP id q24mr13653115pgc.53.1519813147000; Wed, 28 Feb 2018 02:19:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519813146; cv=none; d=google.com; s=arc-20160816; b=yI51Xs8iYZAufBgex5gjyikcHsQz4RG0dL+QAwtjOXIwTzV81yT45hfzEKQWUZZRSl NlZaH+qXp+FGIMuiapFKh6p4Y0pRrfGJuyPge9SfoeGOwZ5qM+pRiXgPztv2ea9YdAVv lSzTeTIrAtj2es8TjFG22gGHi59JjhxYqAUxss6MTQ6jeTyzzkjS2YjJvHbQx/HlwoSx qEOnB3tKhJZ/HDSq9Zpjp3LcnnscXuAUsHWI0tausf5R14loLpR47ui8nsoIJZlHYH+I JbRET18GncxSBZy+wpJbAsLeLyVnFiXLMB35uSBWU4zoNSkZQH6RwAEPq5rehUgj1v27 +pCw== 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=MMQgwwWWaEL4R+5gsy8sgA1zRLKCd558f13M+6wrZfI=; b=iVO0d65kXbno1MLsISlJB3QnJFahRE1w+r4oIyg6qw31pvYelHQ2oHvuv7LJr84vke pFKLVtmRXbXfru84L4HrMgs33aQM+evFlcRbeA9nuRJ08nncV9wrEhZnqRzmYazHn5Ws bs4jceA23ho8h6wr45ioah8w2nD7cCYx0Ja/KZBIxYSiJXh8LHtjtXCqGU0ey401Skvs WJRwmaGu91YZvqMzEoF07XAYAB+XuAolFeCG5YTqNE4TAv7ebeomV4mhZPGVEFQBY2XW Jfp9oWeowNr2YxBy1NXNba+oGZqkTy0QBtmZHRHvFbdsKVe6iWF8UsxNYMa+zgB7hfMX 3Edg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BDR4iODC; 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 z63si836609pgb.690.2018.02.28.02.19.06; Wed, 28 Feb 2018 02:19:06 -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 header.s=google header.b=BDR4iODC; 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 S1752173AbeB1KTF (ORCPT + 10 others); Wed, 28 Feb 2018 05:19:05 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:38714 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbeB1KTE (ORCPT ); Wed, 28 Feb 2018 05:19:04 -0500 Received: by mail-lf0-f67.google.com with SMTP id i80so2692226lfg.5 for ; Wed, 28 Feb 2018 02:19:04 -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=xxIuJ7p4EHQDb4no0UpiYhq72aP8qwS8KN+A0yQHpzA=; b=BDR4iODCGi5oI/VLKSw/taMxqnN+qHeOMqhUB2x105ALgJmVRaSHDbqReBUNar9FnJ k8FzgJJtx68Ookd7ZVpB6mFJSX+eANp5SR4ukhfCnGuv2cleXMARTJh0xhqPY2GhNHFV 89FlEPZ88RA834X/dqy+SySg/khd/flK+65fI= 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=xxIuJ7p4EHQDb4no0UpiYhq72aP8qwS8KN+A0yQHpzA=; b=ZZ6+AmVuy1GlSEWQdxL3ldb0HcbAhCcKDRQZlN7iLEH0jRBX2WbZqviwvRtihrQBnI tCYT0lcrT2XJ3N12alff3xORmymyBSuGrIyM3hs6xGNlplMj9DgDfPXqqWhcz2jrcPpd U+wpYWRa7FHp5ejiOqH72ESNCvPHVJrimoapLbLatqRfeZLCMYteHBjqZn7wfSJhFEEm fYy6yaF7ZzvEuh3fHejmxJ1f6QAj8qmSAfcgrcHOPWfsxwBxAzb1quO5kbQ0H+XDoBgZ AD3/uHp8tP8bYL/QR3SbwVskBrR2feOZvgJToBzJ1Bn7OZYVyfNbh7oaarpmCgjp0O75 2BhQ== X-Gm-Message-State: APf1xPA5sfyPJpgCYYQJd4rRnkunGto+vXao5eNU+6kMXtocBm5JrLOL vyE7i68SOKcCTTpH3FzYL/NBQA== X-Received: by 10.25.34.81 with SMTP id i78mr3953375lfi.50.1519813143297; Wed, 28 Feb 2018 02:19:03 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id w8sm285347lje.75.2018.02.28.02.19.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 02:19:02 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Andy Gross , David Brown Cc: Stephen Boyd , Bjorn Andersson , linux-soc@vger.kernel.org, Linus Walleij , John Stultz Subject: [PATCH] ARM: dts: add XOADC and IIO HWMON to APQ8064 Date: Wed, 28 Feb 2018 11:16:58 +0100 Message-Id: <20180228101658.28603-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.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 PM8921 XOADC node to the PM8921 PMIC node, defines the 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 Nexus 7 tablet: lsiio Device 000: PM8921-XOADC cd /sys/bus/iio/devices/iio:device0 cat in_voltage10_input 616461 (0.625V reference voltage) cat in_voltage11_input (1.25V reference voltage) cat temp1_input 35852 (die temperature) Cc: John Stultz Signed-off-by: Linus Walleij --- arch/arm/boot/dts/qcom-apq8064.dtsi | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) -- 2.14.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-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi index 3ca96e361878..5341a39c0392 100644 --- a/arch/arm/boot/dts/qcom-apq8064.dtsi +++ b/arch/arm/boot/dts/qcom-apq8064.dtsi @@ -316,6 +316,23 @@ }; }; + + /* + * 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>; /* Charger temperature */ + }; + soc: soc { #address-cells = <1>; #size-cells = <1>; @@ -770,6 +787,52 @@ debounce = <15625>; pull-up; }; + + xoadc: xoadc@197 { + compatible = "qcom,pm8921-adc"; + reg = <197>; + interrupts-extended = <&pmicintc 78 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>; + }; + vph_pwr: adc-channel@04 { + reg = <0x00 0x04>; + }; + batt_therm: adc-channel@08 { + reg = <0x00 0x08>; + }; + batt_id: adc-channel@09 { + reg = <0x00 0x09>; + }; + 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>; + }; + chg_temp: adc-channel@0e { + reg = <0x00 0x0e>; + }; + ref_muxoff: adc-channel@0f { + reg = <0x00 0x0f>; + }; + }; }; };