From patchwork Tue Jan 10 23:47:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9508875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA812601EA for ; Tue, 10 Jan 2017 23:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCC4F283FF for ; Tue, 10 Jan 2017 23:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1AAB285EE; Tue, 10 Jan 2017 23:48:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A166D283FF for ; Tue, 10 Jan 2017 23:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753466AbdAJXsL (ORCPT ); Tue, 10 Jan 2017 18:48:11 -0500 Received: from mail-lf0-f42.google.com ([209.85.215.42]:33664 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758582AbdAJXsG (ORCPT ); Tue, 10 Jan 2017 18:48:06 -0500 Received: by mail-lf0-f42.google.com with SMTP id k86so126237058lfi.0 for ; Tue, 10 Jan 2017 15:48:05 -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=2sttbN7AV0s/htA27gBkJlrpU+sLEA8NGJQcfSn9sUI=; b=GtUQusB5YD3TyyIl3Ug/jax7rN8Unhp/hTGJJfCcYnr98CxTXGfSFTxWFo4o5oS7kG IypEHsgKFTyFYyv2SqsUNWJH/gyaHzg0ShDIb0bi7gCbBJAPcJ+ZXooyxqhpgBEwOcfT 4No9bD8x9LjCgByLG10Ti6joI6MpiGTuvoJgI= 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=2sttbN7AV0s/htA27gBkJlrpU+sLEA8NGJQcfSn9sUI=; b=Bh5LwIsB9PB92ZuHN8spspPSS7247qioVq9iKOXYVPnffKZCcJGy9xS1AkYFncpWK5 PgWdGVk4yEOPDdguGdscYbQd1pYmOWlvn15xl+ofAu2IbWbQzDmKwYA2eMR34QMiA8eX C5KHmZzUEiS5FK2cfRWhYYwYf1HRo8EBIkXoLZsUm+mBa6MFqZC0y+4ouB8em97MSuHN sXDl3mOCqdKimGfjD17na4BTurPSuXcad8DKsEz2lK0G5zFmEDnSHFICP0eEMt7bgkVc kMmlef1QsgDigR930D2fNk4roI+2BOzvfLK+WYouHKrcRO3R7nLlL44rdS4SVzEukkcP eAyg== X-Gm-Message-State: AIkVDXKzjoD7uvYsCwpX3JKOfhH2JhxXfzLDasUi6IPKarIvk0qssRcuYwsIKyXiNOCscrCK X-Received: by 10.25.203.6 with SMTP id b6mr1714226lfg.145.1484092084831; Tue, 10 Jan 2017 15:48:04 -0800 (PST) Received: from localhost.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id 17sm832038ljn.5.2017.01.10.15.48.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jan 2017 15:48:04 -0800 (PST) From: Linus Walleij To: Lee Jones , Jonathan Cameron , linux-iio@vger.kernel.org, Sebastian Reichel , Guenter Roeck Cc: Mboumba Cedric Madianga , linux-pm@vger.kernel.org, linux-hwmon@vger.kernel.org, Linus Walleij Subject: [PATCH 7/7] ARM: dts: ux500: declare GPADC IIO ADC channels Date: Wed, 11 Jan 2017 00:47:45 +0100 Message-Id: <20170110234745.29691-8-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170110234745.29691-1-linus.walleij@linaro.org> References: <20170110234745.29691-1-linus.walleij@linaro.org> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the IIO channels for the GPADC after converting it to using the standard IIO ADC bindings and moving the driver over to the IIO subsystem. We also add IIO hwmon standard driver node to support reading channels in a standard manner. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/ste-dbx5x0.dtsi | 102 +++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi index d309314f3a36..172c81e98ad0 100644 --- a/arch/arm/boot/dts/ste-dbx5x0.dtsi +++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi @@ -44,6 +44,20 @@ }; }; + /* Essential housekeeping hardware monitors */ + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&gpadc 0x02>, /* Battery temperature */ + <&gpadc 0x03>, /* Main charger voltage */ + <&gpadc 0x08>, /* Main battery voltage */ + <&gpadc 0x09>, /* VBUS */ + <&gpadc 0x0a>, /* Main charger current */ + <&gpadc 0x0b>, /* USB charger current * + <&gpadc 0x0c>, /* Backup battery voltage */ + <&gpadc 0x0d>, /* Die temperature */ + <&gpadc 0x12>; /* Crystal temperature */ + }; + soc { #address-cells = <1>; #size-cells = <1>; @@ -616,12 +630,84 @@ interrupt-names = "60S", "ALARM"; }; - ab8500-gpadc { + gpadc: ab8500-gpadc { compatible = "stericsson,ab8500-gpadc"; interrupts = <32 IRQ_TYPE_LEVEL_HIGH 39 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "HW_CONV_END", "SW_CONV_END"; vddadc-supply = <&ab8500_ldo_tvout_reg>; + #address-cells = <1>; + #size-cells = <0>; + #io-channel-cells = <1>; + + /* GPADC channels */ + bat_ctrl: adc-channel@01 { + reg = <0x01>; + }; + btemp_ball: adc-channel@02 { + reg = <0x02>; + }; + main_charger_v: adc-channel@03 { + reg = <0x03>; + }; + acc_detect1: adc-channel@04 { + reg = <0x04>; + }; + acc_detect2: adc-channel@05 { + reg = <0x05>; + }; + adc_aux1: adc-channel@06 { + reg = <0x06>; + }; + adc_aux2: adc-channel@07 { + reg = <0x07>; + }; + main_batt_v: adc-channel@08 { + reg = <0x08>; + }; + vbus_v: adc-channel@09 { + reg = <0x09>; + }; + main_charger_c: adc-channel@0a { + reg = <0x0a>; + }; + usb_charger_c: adc-channel@0b { + reg = <0x0b>; + }; + bk_bat_v: adc-channel@0c { + reg = <0x0c>; + }; + die_temp: adc-channel@0d { + reg = <0x0d>; + }; + usb_id: adc-channel@0e { + reg = <0x0e>; + }; + xtal_temp: adc-channel@12 { + reg = <0x12>; + }; + vbat_true_meas: adc-channel@13 { + reg = <0x13>; + }; + bat_ctrl_and_ibat: adc-channel@1c { + reg = <0x1c>; + }; + vbat_meas_and_ibat: adc-channel@1d { + reg = <0x1d>; + }; + vbat_true_meas_and_ibat: adc-channel@1e { + reg = <0x1e>; + }; + bat_temp_and_ibat: adc-channel@1f { + reg = <0x1f>; + }; + }; + + ab8500_temp { + compatible = "stericsson,abx500-temp"; + io-channels = <&gpadc 0x06>, + <&gpadc 0x07>; + io-channel-name = "aux1", "aux2"; }; ab8500_battery: ab8500_battery { @@ -632,17 +718,31 @@ ab8500_fg { compatible = "stericsson,ab8500-fg"; battery = <&ab8500_battery>; + io-channels = <&gpadc 0x08>; + io-channel-name = "main_bat_v"; }; ab8500_btemp { compatible = "stericsson,ab8500-btemp"; battery = <&ab8500_battery>; + io-channels = <&gpadc 0x02>, + <&gpadc 0x01>; + io-channel-name = "btemp_ball", + "bat_ctrl"; }; ab8500_charger { compatible = "stericsson,ab8500-charger"; battery = <&ab8500_battery>; vddadc-supply = <&ab8500_ldo_tvout_reg>; + io-channels = <&gpadc 0x03>, + <&gpadc 0x0a>, + <&gpadc 0x09>, + <&gpadc 0x0b>; + io-channel-name = "main_charger_v", + "main_charger_c", + "vbus_v", + "usb_charger_c"; }; ab8500_chargalg {