ср, 8 бер. 2023 р. о 11:04 Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> пише: > > On 08/03/2023 09:44, Svyatoslav Ryhel wrote: > > Add simple cell, status, health and temperature properties. > > > > Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx> > > --- > > .../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.