Message ID | 20230308084419.11934-2-clamor95@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp214938wrd; Wed, 8 Mar 2023 00:50:25 -0800 (PST) X-Google-Smtp-Source: AK7set8CIwOEIBUiH/Kne7X6YbLbfAwQ0qg3LFgCzHUd/oT5/yi7gavFdRf5NyHuzyV/8F+I5gCv X-Received: by 2002:a17:906:601:b0:885:d02f:d4ad with SMTP id s1-20020a170906060100b00885d02fd4admr16671914ejb.43.1678265425185; Wed, 08 Mar 2023 00:50:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678265425; cv=none; d=google.com; s=arc-20160816; b=NGEMcsAGYyVKar5D4SGHP+evCQKGIRgFHt/sKkbPnPeFtD11qms8uI6NjIfRpSL171 NZrowdPN3uO7y3e6bNPFjf1dq9PQBSyffuMp7gHmHmOkig1y+2K+QXovBLtJiGb1rMFO +YWLDUCNGWPF/gnqFR1UuScIBCKLYc9Olt3QR2/PbhcHqXFJHwbxcL4yjSstf/jxn6Vw YVPxRy1Z/+fOKhlLZO30ps3UZ6Vx5FfrF/E0Glzc5qDMYvvd41Ex95S1gwwy+YXqh2uk 3qFDN9De2otrfgL9ek01yJIdYZCQ46XkV6wLuq7a+XS1Q5eqQMpN6JbzF565tnpMdfK8 ZzZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b5IozmuJmXlRY443E7JFFDmGdlSvIWCIn/5kCoULQys=; b=Vpd5JzCQgNbGVTg7p1nXOA7DWKQ7uLVWyNX820Z7T+z/rdJEIvapcoJGnJUm28pJb5 7U1mBSAyP/GAUst5hx+ZK64MI3/PsD5JoFcWxAoYf3ilsI58tQgL3gRKyHvPy0422b98 h/5kP1EqZAUf16LzRO0idVdfLqOpr76M2SXIgn99VhrxXb81aLai7RbKYjDKZ/d2a42C 5eQ9OldLr91mB4f7DajeTJHoN/FsD0KKj16Ez1SizkyxuQpkxJJXM+9MyigG7hj6rgrf u4a6AleJKS0P6BQM9h5y4EqvBuvohBT+ZYPr+383j/cukC+UsJQn9cEUwJ923Els481c FKfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FhNheA1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m24-20020a1709062ad800b008dd8491f9f8si11916610eje.118.2023.03.08.00.50.01; Wed, 08 Mar 2023 00:50:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FhNheA1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbjCHIom (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Wed, 8 Mar 2023 03:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjCHIok (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Mar 2023 03:44:40 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 980369AFDB; Wed, 8 Mar 2023 00:44:36 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id a25so62836838edb.0; Wed, 08 Mar 2023 00:44:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678265075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b5IozmuJmXlRY443E7JFFDmGdlSvIWCIn/5kCoULQys=; b=FhNheA1Drib+iW621iwSkZPmuZjhpTJBbX+a1a/Ky6IwAFAyfJAM5z1PKLakD1BJ4O Vlty+HaKv7xP8yO5adj8hz/5AYILa6UBfeJKoVAanUBwrXRF1s96PmlVmzGLi1Y7+LsM hyfM7vMeA6eNcZKxSmS/oX4IR1U4z8SsJqr8R2gpHXcsVjRCLCaYGiMdlHi7qqLh1+ce RVev3VQSGS1WtTjhc412Q2jToWZBg0MajsTOY9InERPoXEOFqHHdNKlNJ8Uz6LP8moqq I3bHS4BL9vF0ZPfq9NY7EvzA3ytCez7SPtq9G8gLNL/PZIlt9sVzNrKebokZWxOjSdTQ 3w7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678265075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b5IozmuJmXlRY443E7JFFDmGdlSvIWCIn/5kCoULQys=; b=X2nKCBQAsyyXLddDkQm+BCTxRh97I/LkkAz4fx9eDA9jRPHGk03o/g1DGIKOWy30lC mSmhmUadQPLrk7u58B2zKdnEZNWRa5xj34tJO0T60QFyo5p7AMR54VptqLPfpchKKVuK YZaULTl+KmkXRjUhPL4NzWB1wShxqXn6TannQkl6+/aVKVEMus3VU/JGN4iviVbegO8z xFFtEX3zrN0WUeXd8RaL/e5aXMVs8hQP/ocKH6VRNShRAqP6yK4S8fyVo2xHH3Q3et2j HByX/HgnJZFnioW2QfgfKsuGnqfKkQ4HQgwcvTosOhluKcPLa4oemHGHdo/5PdbBjnBW feWg== X-Gm-Message-State: AO0yUKVZTox+vvZrkxH/5ASxjJ2LWKjg3zN8oN92S1OXqAO6wBQNk0Os aHua80RpyWLltiX8I3fzwLg= X-Received: by 2002:a17:906:b14f:b0:8b1:7de9:b38c with SMTP id bt15-20020a170906b14f00b008b17de9b38cmr16535901ejb.52.1678265075045; Wed, 08 Mar 2023 00:44:35 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id p8-20020a170906838800b008ee95ccfe06sm7163891ejx.119.2023.03.08.00.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 00:44:34 -0800 (PST) From: Svyatoslav Ryhel <clamor95@gmail.com> To: Iskren Chernev <me@iskren.info>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Marek Szyprowski <m.szyprowski@samsung.com>, Matheus Castello <matheus@castello.eng.br>, Sebastian Reichel <sre@kernel.org>, Rob Herring <robh+dt@kernel.org>, Svyatoslav Ryhel <clamor95@gmail.com> Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/4] dt-bindings: power: supply: maxim,max17040: update properties Date: Wed, 8 Mar 2023 10:44:16 +0200 Message-Id: <20230308084419.11934-2-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230308084419.11934-1-clamor95@gmail.com> References: <20230308084419.11934-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759788846204060730?= X-GMAIL-MSGID: =?utf-8?q?1759788846204060730?= |
Series |
Add optional properties to MAX17040
|
|
Commit Message
Svyatoslav Ryhel
March 8, 2023, 8:44 a.m. UTC
Add simple cell, status, health and temperature properties.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../bindings/power/supply/maxim,max17040.yaml | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
Comments
On 08/03/2023 09:44, Svyatoslav Ryhel wrote: > Add simple cell, status, health and temperature properties. > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > --- > .../bindings/power/supply/maxim,max17040.yaml | 37 +++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > index 3a529326ecbd..6f1c25b4729f 100644 > --- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > @@ -55,6 +55,20 @@ properties: > interrupts: > maxItems: 1 > > + monitored-battery: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: phandle to the battery node being monitored > + > + power-supplies: true This should be rather specific input name, e.g. vdd-supply. > + > + io-channels: > + items: > + - description: battery temperature max17040 does not have ADC temperature input... so is it system configuration? > + > + io-channel-names: > + items: > + - const: temp Drop the names property, not needed for one item. > + > wakeup-source: > type: boolean > description: | > @@ -95,3 +109,26 @@ examples: > wakeup-source; > }; > }; > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + i2c0 { > + #address-cells = <1>; > + #size-cells = <0>; > + > + fuel-gauge@36 { > + compatible = "maxim,max17043"; > + reg = <0x36>; > + > + interrupt-parent = <&gpio>; > + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; > + > + monitored-battery = <&battery>; > + power-supplies = <&charger>; But here you suggests something else than VDD... The hardware does not take charger as input. It takes power supply - vdd. > + > + io-channels = <&adc 8>; Just add these to existing example. > + io-channel-names = "temp"; > + > + maxim,alert-low-soc-level = <10>; > + wakeup-source; > + }; > + }; Best regards, Krzysztof
ср, 8 бер. 2023 р. о 11:04 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> пише: > > On 08/03/2023 09:44, Svyatoslav Ryhel wrote: > > Add simple cell, status, health and temperature properties. > > > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > > --- > > .../bindings/power/supply/maxim,max17040.yaml | 37 +++++++++++++++++++ > > 1 file changed, 37 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > > index 3a529326ecbd..6f1c25b4729f 100644 > > --- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > > +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > > @@ -55,6 +55,20 @@ properties: > > interrupts: > > maxItems: 1 > > > > + monitored-battery: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: phandle to the battery node being monitored > > + > > + power-supplies: true > > This should be rather specific input name, e.g. vdd-supply. > it is not vdd it is actual charger device > > + > > + io-channels: > > + items: > > + - description: battery temperature > > > > max17040 does not have ADC temperature input... so is it system > configuration? > yes, I own a device (LG Optimus Vu P895) which uses max17043 coupled with ADC thermal sensor > > + > > + io-channel-names: > > + items: > > + - const: temp > > Drop the names property, not needed for one item. > Alright, but driver patch expects temp name. I will look if this is adjustable. > > + > > wakeup-source: > > type: boolean > > description: | > > @@ -95,3 +109,26 @@ examples: > > wakeup-source; > > }; > > }; > > + - | > > + #include <dt-bindings/interrupt-controller/irq.h> > > + i2c0 { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + fuel-gauge@36 { > > + compatible = "maxim,max17043"; > > + reg = <0x36>; > > + > > + interrupt-parent = <&gpio>; > > + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; > > + > > + monitored-battery = <&battery>; > > + power-supplies = <&charger>; > > But here you suggests something else than VDD... The hardware does not > take charger as input. It takes power supply - vdd. > Power system allows passing properties from other power devices. In this case battery health and status are passed from charger. > > + > > + io-channels = <&adc 8>; > > Just add these to existing example. > Not sure if it is a good idea, as you wish. > > + io-channel-names = "temp"; > > + > > + maxim,alert-low-soc-level = <10>; > > + wakeup-source; > > + }; > > + }; > > Best regards, > Krzysztof > Best regards, Svyatoslav R.
On 08/03/2023 10:15, Svyatoslav Ryhel wrote: >> max17040 does not have ADC temperature input... so is it system >> configuration? >> > > yes, I own a device (LG Optimus Vu P895) which uses max17043 > coupled with ADC thermal sensor > >>> + >>> + io-channel-names: >>> + items: >>> + - const: temp >> >> Drop the names property, not needed for one item. >> > > Alright, but driver patch expects temp name. I will look if this > is adjustable. I think I saw cases without names. > >>> + >>> wakeup-source: >>> type: boolean >>> description: | >>> @@ -95,3 +109,26 @@ examples: >>> wakeup-source; >>> }; >>> }; >>> + - | >>> + #include <dt-bindings/interrupt-controller/irq.h> >>> + i2c0 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + fuel-gauge@36 { >>> + compatible = "maxim,max17043"; >>> + reg = <0x36>; >>> + >>> + interrupt-parent = <&gpio>; >>> + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; >>> + >>> + monitored-battery = <&battery>; >>> + power-supplies = <&charger>; >> >> But here you suggests something else than VDD... The hardware does not >> take charger as input. It takes power supply - vdd. >> > > Power system allows passing properties from other power devices. > In this case battery health and status are passed from charger. So this is not an input to device? Then it does not really look like property of this hardware. Fuel gauge does not control the charger, also from system configuration point of view. Best regards, Krzysztof
ср, 8 бер. 2023 р. о 12:44 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> пише: > > On 08/03/2023 10:15, Svyatoslav Ryhel wrote: > > >> max17040 does not have ADC temperature input... so is it system > >> configuration? > >> > > > > yes, I own a device (LG Optimus Vu P895) which uses max17043 > > coupled with ADC thermal sensor > > > >>> + > >>> + io-channel-names: > >>> + items: > >>> + - const: temp > >> > >> Drop the names property, not needed for one item. > >> > > > > Alright, but driver patch expects temp name. I will look if this > > is adjustable. > > I think I saw cases without names. > There is no io-channel without a name. And io-channels are mostly used by power supply devices. > > > >>> + > >>> wakeup-source: > >>> type: boolean > >>> description: | > >>> @@ -95,3 +109,26 @@ examples: > >>> wakeup-source; > >>> }; > >>> }; > >>> + - | > >>> + #include <dt-bindings/interrupt-controller/irq.h> > >>> + i2c0 { > >>> + #address-cells = <1>; > >>> + #size-cells = <0>; > >>> + > >>> + fuel-gauge@36 { > >>> + compatible = "maxim,max17043"; > >>> + reg = <0x36>; > >>> + > >>> + interrupt-parent = <&gpio>; > >>> + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; > >>> + > >>> + monitored-battery = <&battery>; > >>> + power-supplies = <&charger>; > >> > >> But here you suggests something else than VDD... The hardware does not > >> take charger as input. It takes power supply - vdd. > >> > > > > Power system allows passing properties from other power devices. > > In this case battery health and status are passed from charger. > > So this is not an input to device? Then it does not really look like > property of this hardware. Fuel gauge does not control the charger, also > from system configuration point of view. > It is not controlling charger, the charger provides the status and health of the battery to the fuel gauge. This option is also used in other fuel gauges. > Best regards, > Krzysztof >
On 08/03/2023 11:51, Svyatoslav Ryhel wrote: > ср, 8 бер. 2023 р. о 12:44 Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> пише: >> >> On 08/03/2023 10:15, Svyatoslav Ryhel wrote: >> >>>> max17040 does not have ADC temperature input... so is it system >>>> configuration? >>>> >>> >>> yes, I own a device (LG Optimus Vu P895) which uses max17043 >>> coupled with ADC thermal sensor >>> >>>>> + >>>>> + io-channel-names: >>>>> + items: >>>>> + - const: temp >>>> >>>> Drop the names property, not needed for one item. >>>> >>> >>> Alright, but driver patch expects temp name. I will look if this >>> is adjustable. >> >> I think I saw cases without names. >> > > There is no io-channel without a name. And io-channels are mostly used > by power supply devices. > >>> >>>>> + >>>>> wakeup-source: >>>>> type: boolean >>>>> description: | >>>>> @@ -95,3 +109,26 @@ examples: >>>>> wakeup-source; >>>>> }; >>>>> }; >>>>> + - | >>>>> + #include <dt-bindings/interrupt-controller/irq.h> >>>>> + i2c0 { >>>>> + #address-cells = <1>; >>>>> + #size-cells = <0>; >>>>> + >>>>> + fuel-gauge@36 { >>>>> + compatible = "maxim,max17043"; >>>>> + reg = <0x36>; >>>>> + >>>>> + interrupt-parent = <&gpio>; >>>>> + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; >>>>> + >>>>> + monitored-battery = <&battery>; >>>>> + power-supplies = <&charger>; >>>> >>>> But here you suggests something else than VDD... The hardware does not >>>> take charger as input. It takes power supply - vdd. >>>> >>> >>> Power system allows passing properties from other power devices. >>> In this case battery health and status are passed from charger. >> >> So this is not an input to device? Then it does not really look like >> property of this hardware. Fuel gauge does not control the charger, also >> from system configuration point of view. >> > > It is not controlling charger, the charger provides the status and > health of the battery to the fuel gauge. This option is also used in > other fuel gauges. How regulator provides health and status of the battery? I don't understand. Best regards, Krzysztof
ср, 8 бер. 2023 р. о 12:53 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> пише: > > On 08/03/2023 11:51, Svyatoslav Ryhel wrote: > > ср, 8 бер. 2023 р. о 12:44 Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> пише: > >> > >> On 08/03/2023 10:15, Svyatoslav Ryhel wrote: > >> > >>>> max17040 does not have ADC temperature input... so is it system > >>>> configuration? > >>>> > >>> > >>> yes, I own a device (LG Optimus Vu P895) which uses max17043 > >>> coupled with ADC thermal sensor > >>> > >>>>> + > >>>>> + io-channel-names: > >>>>> + items: > >>>>> + - const: temp > >>>> > >>>> Drop the names property, not needed for one item. > >>>> > >>> > >>> Alright, but driver patch expects temp name. I will look if this > >>> is adjustable. > >> > >> I think I saw cases without names. > >> > > > > There is no io-channel without a name. And io-channels are mostly used > > by power supply devices. > > > >>> > >>>>> + > >>>>> wakeup-source: > >>>>> type: boolean > >>>>> description: | > >>>>> @@ -95,3 +109,26 @@ examples: > >>>>> wakeup-source; > >>>>> }; > >>>>> }; > >>>>> + - | > >>>>> + #include <dt-bindings/interrupt-controller/irq.h> > >>>>> + i2c0 { > >>>>> + #address-cells = <1>; > >>>>> + #size-cells = <0>; > >>>>> + > >>>>> + fuel-gauge@36 { > >>>>> + compatible = "maxim,max17043"; > >>>>> + reg = <0x36>; > >>>>> + > >>>>> + interrupt-parent = <&gpio>; > >>>>> + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; > >>>>> + > >>>>> + monitored-battery = <&battery>; > >>>>> + power-supplies = <&charger>; > >>>> > >>>> But here you suggests something else than VDD... The hardware does not > >>>> take charger as input. It takes power supply - vdd. > >>>> > >>> > >>> Power system allows passing properties from other power devices. > >>> In this case battery health and status are passed from charger. > >> > >> So this is not an input to device? Then it does not really look like > >> property of this hardware. Fuel gauge does not control the charger, also > >> from system configuration point of view. > >> > > > > It is not controlling charger, the charger provides the status and > > health of the battery to the fuel gauge. This option is also used in > > other fuel gauges. > > How regulator provides health and status of the battery? I don't understand. > It is not a regulator, it is a charger! Dedicated chip responsible for controlling charging. And its configuration allows it to get battery health and status, because this fuel gauge does not have this function. > Best regards, > Krzysztof >
On 08/03/2023 12:06, Svyatoslav Ryhel wrote: > ср, 8 бер. 2023 р. о 12:53 Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> пише: >> >> On 08/03/2023 11:51, Svyatoslav Ryhel wrote: >>> ср, 8 бер. 2023 р. о 12:44 Krzysztof Kozlowski >>> <krzysztof.kozlowski@linaro.org> пише: >>>> >>>> On 08/03/2023 10:15, Svyatoslav Ryhel wrote: >>>> >>>>>> max17040 does not have ADC temperature input... so is it system >>>>>> configuration? >>>>>> >>>>> >>>>> yes, I own a device (LG Optimus Vu P895) which uses max17043 >>>>> coupled with ADC thermal sensor >>>>> >>>>>>> + >>>>>>> + io-channel-names: >>>>>>> + items: >>>>>>> + - const: temp >>>>>> >>>>>> Drop the names property, not needed for one item. >>>>>> >>>>> >>>>> Alright, but driver patch expects temp name. I will look if this >>>>> is adjustable. >>>> >>>> I think I saw cases without names. >>>> >>> >>> There is no io-channel without a name. And io-channels are mostly used >>> by power supply devices. >>> >>>>> >>>>>>> + >>>>>>> wakeup-source: >>>>>>> type: boolean >>>>>>> description: | >>>>>>> @@ -95,3 +109,26 @@ examples: >>>>>>> wakeup-source; >>>>>>> }; >>>>>>> }; >>>>>>> + - | >>>>>>> + #include <dt-bindings/interrupt-controller/irq.h> >>>>>>> + i2c0 { >>>>>>> + #address-cells = <1>; >>>>>>> + #size-cells = <0>; >>>>>>> + >>>>>>> + fuel-gauge@36 { >>>>>>> + compatible = "maxim,max17043"; >>>>>>> + reg = <0x36>; >>>>>>> + >>>>>>> + interrupt-parent = <&gpio>; >>>>>>> + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; >>>>>>> + >>>>>>> + monitored-battery = <&battery>; >>>>>>> + power-supplies = <&charger>; >>>>>> >>>>>> But here you suggests something else than VDD... The hardware does not >>>>>> take charger as input. It takes power supply - vdd. >>>>>> >>>>> >>>>> Power system allows passing properties from other power devices. >>>>> In this case battery health and status are passed from charger. >>>> >>>> So this is not an input to device? Then it does not really look like >>>> property of this hardware. Fuel gauge does not control the charger, also >>>> from system configuration point of view. >>>> >>> >>> It is not controlling charger, the charger provides the status and >>> health of the battery to the fuel gauge. This option is also used in >>> other fuel gauges. >> >> How regulator provides health and status of the battery? I don't understand. >> > > It is not a regulator, it is a charger! Dedicated chip responsible for > controlling charging. And its configuration allows it to get battery > health and status, because this fuel gauge does not have this > function. Ah, you are right. I confused with power-supply. It is fine. Best regards, Krzysztof
Hi, On Wed, Mar 08, 2023 at 10:44:16AM +0200, Svyatoslav Ryhel wrote: > Add simple cell, status, health and temperature properties. > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > --- > .../bindings/power/supply/maxim,max17040.yaml | 37 +++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > index 3a529326ecbd..6f1c25b4729f 100644 > --- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml > @@ -55,6 +55,20 @@ properties: > interrupts: > maxItems: 1 > > + monitored-battery: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: phandle to the battery node being monitored > + > + power-supplies: true The above two should not be needed, since the binding inherits them: ``` allOf: - $ref: power-supply.yaml# unevaluatedProperties: false ``` Otherwise LGTM. -- Sebastian > + > + io-channels: > + items: > + - description: battery temperature > + > + io-channel-names: > + items: > + - const: temp > + > wakeup-source: > type: boolean > description: | > @@ -95,3 +109,26 @@ examples: > wakeup-source; > }; > }; > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + i2c0 { > + #address-cells = <1>; > + #size-cells = <0>; > + > + fuel-gauge@36 { > + compatible = "maxim,max17043"; > + reg = <0x36>; > + > + interrupt-parent = <&gpio>; > + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; > + > + monitored-battery = <&battery>; > + power-supplies = <&charger>; > + > + io-channels = <&adc 8>; > + io-channel-names = "temp"; > + > + maxim,alert-low-soc-level = <10>; > + wakeup-source; > + }; > + }; > -- > 2.37.2 >
diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml index 3a529326ecbd..6f1c25b4729f 100644 --- a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml @@ -55,6 +55,20 @@ properties: interrupts: maxItems: 1 + monitored-battery: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the battery node being monitored + + power-supplies: true + + io-channels: + items: + - description: battery temperature + + io-channel-names: + items: + - const: temp + wakeup-source: type: boolean description: | @@ -95,3 +109,26 @@ examples: wakeup-source; }; }; + - | + #include <dt-bindings/interrupt-controller/irq.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + fuel-gauge@36 { + compatible = "maxim,max17043"; + reg = <0x36>; + + interrupt-parent = <&gpio>; + interrupts = <144 IRQ_TYPE_EDGE_FALLING>; + + monitored-battery = <&battery>; + power-supplies = <&charger>; + + io-channels = <&adc 8>; + io-channel-names = "temp"; + + maxim,alert-low-soc-level = <10>; + wakeup-source; + }; + };