From patchwork Fri Oct 11 07:18:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 175921 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp376844ill; Fri, 11 Oct 2019 00:18:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/ui1Bv5Hq9B/kTBmOD4XCuxzE/ed3L+oVVgqJDWB7pFuQF0VcnQS7JwxSFXfK5F3qqyEd X-Received: by 2002:aa7:d5d3:: with SMTP id d19mr11794465eds.213.1570778311106; Fri, 11 Oct 2019 00:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570778311; cv=none; d=google.com; s=arc-20160816; b=c+2jJoRSIa5xzspzo5dW2yPoTXWNLL8w3QZNL/j/YaVZY70ZXdZ9Q6VZXNYxA14cRE Cgfz8TfJjkwM3iHbn3akBRT16k226Zh3dE/mtK9q3BMZqHyS0zRCa47PY3BvUOw9JAgD Abp/SBW+T8+93tgN3ZeOuVU6xXpX4plNZ31qS6Hm31GPc9CmSAHTP1rwgY7kCVejx9qb 4tBCILNVj5QlFzo/HQiq6BhRBcCfnEgrIWJyKu1zH1g6HqE4Ime/OvauqbkPaYVXQ1iH eXUN0tLxLAHBz7GWo8rJ6gknPHeC6eqGbcO73xw3X7jTk6bhClMaY5efKpTMCXbd28rQ VTjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JFu7rCKuD+ByHBCarGh0KMIFzVZ6GvSz+ZNE3JQEoM4=; b=yPoJSJM2ag+d9mlAXMfGooVI6Zv247e8Wuk6jFwWCih6ox3xooIgH9nddAfpKVzciM oKqtcwzDqlzenqe4Fv5o9e0Rkb+y/QwX+Fba46hocKEiIr5CRy2GntenoLrkxt3XUlN0 Rb26pejkgUO0/KYJObIT8J8OA6AVzvaIlCj5QlTn9jm+Weu3Oc6RkIS4xAy2BQWFTZPK Y6rrEZ/MxE2BRXpljsWmD35OhR65W9UPqBHY3gGlROPiUQIg/mniZAG5G//AuCAo7yuI lUOtD7/O0g/ZnKrD1GyIUQxJU22Hac1qKvG0krXs0lAgXW0STl3whGmbbu3n+lbtBxFY sM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAJbXliD; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (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 l8si4678413ejc.404.2019.10.11.00.18.30; Fri, 11 Oct 2019 00:18:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAJbXliD; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbfJKHS0 (ORCPT + 8 others); Fri, 11 Oct 2019 03:18:26 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36765 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbfJKHS0 (ORCPT ); Fri, 11 Oct 2019 03:18:26 -0400 Received: by mail-lj1-f193.google.com with SMTP id v24so8772339ljj.3 for ; Fri, 11 Oct 2019 00:18:24 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=JFu7rCKuD+ByHBCarGh0KMIFzVZ6GvSz+ZNE3JQEoM4=; b=uAJbXliDW65FifKvUEo3maLLsHPCHYQiINWJD814XdG5Va9WTJ2a1DBfuFUdDswxBW detrSQGihH4ttGZBak/2xbIZsPAm3oasA+clpO0nePhN9COMEEC+NidMmIlLDylpy/Oq 1iFI/dTgTnNzhTFtRRSHq37caEKkKNkyVemTKFoj0DE/w33w1gQzhEbYPO70HPDgr1Ee 8I+E+ZOw3mj6sOWQq+NAB2+FKq2HvRTM/YnAtqVtJJeq7Bbl6mSbT3S0mskVcoNEk0EP sdo7PqZyiKbjb9jhp3giTTQVlgCuFTNHVdWUFulF8wLfd/RKHrz1ZLSmRjaS0cCQlNn4 pBdg== 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:mime-version:content-transfer-encoding; bh=JFu7rCKuD+ByHBCarGh0KMIFzVZ6GvSz+ZNE3JQEoM4=; b=bOFuhHV2wiJnTlqosZmipkr6LCtHdRzM9vibkbhUGmksVk/v3TgQH98sJsoUsXHPpi XNgrLyKfn6FwoRRgiieF9IuDVOq+3jlxnEeNPF5fIyodWY2A3RjHkf7fLiYCEPQFASKI BzuZR8rxfBoxmCjT97QJE/SGZqsFXnW6MKjctpxjzsqwOmO46y87euUiJs0d7bDWcLMh e2CeJ9T56TUxkMsHJJgooUQJJ4ZsCntrRdEu1f1/yfuYO6tp+5oudNpp1652SgOtZwhw VDziuoTc4BSflBu9F1tP2xZ3GZWBteQIxDJLOCSYQp5doOE2Tjrx2J/ShdSa/LCQc1Ba XEiw== X-Gm-Message-State: APjAAAVdpY7ephwRm/7YCw+AcYMR+ymlX0IrDJx4XkhNQSggHC04Paaw LMeLTtxvkanFtBjzSOShGIvRkQ== X-Received: by 2002:a05:651c:1ad:: with SMTP id c13mr8663314ljn.131.1570778303208; Fri, 11 Oct 2019 00:18:23 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v26sm2047343lfg.27.2019.10.11.00.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 00:18:22 -0700 (PDT) From: Linus Walleij To: Lee Jones , Jonathan Cameron , linux-iio@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Cc: Mboumba Cedric Madianga , Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 5/7 v4] mfd: ab8500: augment DT bindings Date: Fri, 11 Oct 2019 09:18:03 +0200 Message-Id: <20191011071805.5554-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191011071805.5554-1-linus.walleij@linaro.org> References: <20191011071805.5554-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org As we migrate the AB8500 GPADC driver to use IIO, we need to augment the bindings to account for defining the ADC channels in the device tree. Cc: devicetree@vger.kernel.org Acked-by: Lee Jones Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Fix the nodenames from "foo_node" to "foo-node" - Remove 0 prefix from @0n to @n ChangeLog v2->v3: - Change "adc-channel@" to "channel@" as per preferred notation. - Add some full stops to the end of sentences. - Reference the new ADC-specific documentation for channel specifier etc. - Collect Lee's ACK. - Rebased on v5.4-rc1 ChangeLog v1->v2: - Rebased on v5.3-rc5 --- .../devicetree/bindings/mfd/ab8500.txt | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) -- 2.21.0 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/mfd/ab8500.txt b/Documentation/devicetree/bindings/mfd/ab8500.txt index cd9e90c5d171..b6bc30d7777e 100644 --- a/Documentation/devicetree/bindings/mfd/ab8500.txt +++ b/Documentation/devicetree/bindings/mfd/ab8500.txt @@ -69,6 +69,18 @@ Required child device properties: - compatible : "stericsson,ab8500-[bm|btemp|charger|fg|gpadc|gpio|ponkey| pwm|regulator|rtc|sysctrl|usb]"; + A few child devices require ADC channels from the GPADC node. Those follow the + standard bindings from iio/iio-bindings.txt and iio/adc/adc.txt + + abx500-temp : io-channels "aux1" and "aux2" for measuring external + temperatures. + ab8500-fg : io-channel "main_bat_v" for measuring main battery voltage, + ab8500-btemp : io-channels "btemp_ball" and "bat_ctrl" for measuring the + battery voltage. + ab8500-charger : io-channels "main_charger_v", "main_charger_c", "vbus_v", + "usb_charger_c" for measuring voltage and current of the + different charging supplies. + Optional child device properties: - interrupts : contains the device IRQ(s) using the 2-cell format (see above) - interrupt-names : contains names of IRQ resource in the order in which they were @@ -102,8 +114,115 @@ ab8500 { 39 0x4>; 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: channel@1 { + reg = <0x01>; + }; + btemp_ball: channel@2 { + reg = <0x02>; + }; + main_charger_v: channel@3 { + reg = <0x03>; + }; + acc_detect1: channel@4 { + reg = <0x04>; + }; + acc_detect2: channel@5 { + reg = <0x05>; + }; + adc_aux1: channel@6 { + reg = <0x06>; + }; + adc_aux2: channel@7 { + reg = <0x07>; + }; + main_batt_v: channel@8 { + reg = <0x08>; + }; + vbus_v: channel@9 { + reg = <0x09>; + }; + main_charger_c: channel@a { + reg = <0x0a>; + }; + usb_charger_c: channel@b { + reg = <0x0b>; + }; + bk_bat_v: channel@c { + reg = <0x0c>; + }; + die_temp: channel@d { + reg = <0x0d>; + }; + usb_id: channel@e { + reg = <0x0e>; + }; + xtal_temp: channel@12 { + reg = <0x12>; + }; + vbat_true_meas: channel@13 { + reg = <0x13>; + }; + bat_ctrl_and_ibat: channel@1c { + reg = <0x1c>; + }; + vbat_meas_and_ibat: channel@1d { + reg = <0x1d>; + }; + vbat_true_meas_and_ibat: channel@1e { + reg = <0x1e>; + }; + bat_temp_and_ibat: 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 { + stericsson,battery-type = "LIPO"; + thermistor-on-batctrl; + }; + + 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-usb { compatible = "stericsson,ab8500-usb"; interrupts = < 90 0x4