lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e1fb90a-43c0-3b0a-ab7a-8ca3ce8b02ed@linaro.org>
Date:   Tue, 18 Apr 2023 09:09:30 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     "Arslanbenzer, Zeynep" <Zeynep.Arslanbenzer@...log.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "lee@...nel.org" <lee@...nel.org>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "sre@...nel.org" <sre@...nel.org>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "broonie@...nel.org" <broonie@...nel.org>
Subject: Re: [PATCH 4/6] dt-bindings: power: supply: add MAX77659 charger
 binding

On 17/04/2023 23:43, Arslanbenzer, Zeynep wrote:
>> On 20/12/2022 14:22, Zeynep Arslanbenzer wrote:
>>> This patch adds device tree binding documentation for MAX77659 charger.
>>
>> Do not use "This commit/patch".
>> https://urldefense.com/v3/__https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst*L95__;>Iw!!A3Ni8CS0y2Y!-AnHmIThbB5Q88_dFdveEmsXlsfflRXDabf6RVE5ySRusMxP24NEfAr8RCsu26LTvoaIIMvEDr2YxDECrGlMwR8-ywvoR62rXB0W$ 
>>
>>>
>>> Signed-off-by: Nurettin Bolucu <Nurettin.Bolucu@...log.com>>
>>> Signed-off-by: Zeynep Arslanbenzer <Zeynep.Arslanbenzer@...log.com>>
>>> ---
>>>  .../power/supply/adi,max77659-charger.yaml    | 42 +++++++++++++++++++
>>>  MAINTAINERS                                   |  1 +
>>>  2 files changed, 43 insertions(+)
>>>  create mode 100644 
>>> Documentation/devicetree/bindings/power/supply/adi,max77659-charger.ya
>>> ml
>>>
>>> diff --git 
>>> a/Documentation/devicetree/bindings/power/supply/adi,max77659-charger.
>>> yaml 
>>> b/Documentation/devicetree/bindings/power/supply/adi,max77659-charger.
>>> yaml
>>> new file mode 100644
>>> index 000000000000..24f8b5a2bd84
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/power/supply/adi,max77659-char
>>> +++ ger.yaml
>>> @@ -0,0 +1,42 @@
>>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2
>>> +---
>>> +$id: 
>>> +https://urldefense.com/v3/__http://devicetree.org/schemas/power/suppl
>>> +y/adi,max77659-charger.yaml*__;Iw!!A3Ni8CS0y2Y!-AnHmIThbB5Q88_dFdveEm
>>> +sXlsfflRXDabf6RVE5ySRusMxP24NEfAr8RCsu26LTvoaIIMvEDr2YxDECrGlMwR8-ywv
>>> +oR5rKUR11$
>>> +$schema: 
>>> +https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.y
>>> +aml*__;Iw!!A3Ni8CS0y2Y!-AnHmIThbB5Q88_dFdveEmsXlsfflRXDabf6RVE5ySRusM
>>> +xP24NEfAr8RCsu26LTvoaIIMvEDr2YxDECrGlMwR8-ywvoRy_yWWBS$
>>> +
>>> +title: Battery charger for MAX77659 PMIC from ADI.
>>
>> Drop full stop.
>>
>>> +
>>> +maintainers:
>>> +  - Nurettin Bolucu <Nurettin.Bolucu@...log.com>>
>>> +  - Zeynep Arslanbenzer <Zeynep.Arslanbenzer@...log.com>>
>>> +
>>> +description: |
>>> +  This module is part of the MAX77659 MFD device. For more details
>>> +  see Documentation/devicetree/bindings/mfd/adi,max77659.yaml.
>>> +
>>> +  The charger is represented as a sub-node of the PMIC node on the device tree.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: adi,max77659-charger
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  adi,fast-charge-timer:
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>> +    description: Fast-charge safety timer value (in hours).
>>
>> No, use suffixes for common units.
> 
> Hi Krzysztof,
> 
> Thank you for your review. The possible register values of the fast charge safety timer are described in the datasheet as follows. I was undecided about using the common unit, second, as it may affect the comprehensibility of the code. Of course, I can use second as the common unit if you think it's more appropriate.

This is quite common property, so I do not understand why this one
driver should have it written differently. I understand that parsing
0/1/2/3 is easier for the machine than 0/3/5/7 but it is not easier for
humans.

> 
> 0b00 = Timer disabled 
> 0b01 = 3 hours 
> 0b10 = 5 hours 
> 0b11 = 7 hours
> 
>>
>>> +
>>> +  adi,fast-charge-microamp:
>>> +    description: Fast-charge constant current value.
>>
>>> +
>>> +  adi,topoff-timer:
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>> +    description: Top-Off timer value (in minutes).
>>
>> No, use suffixes for common units.
> 
> Similar case:
> 
> 0b000 = 0 minutes 
> 0b001 = 5 minutes 
> 0b010 = 10 minutes 
> 0b011 = 15 minutes 
> 0b100 = 20 minutes 
> 0b101 = 25 minutes 
> 0b110 = 30 minutes 
> 0b111 = 35 minutes

Come on, this is easy to parse. Divide by 5 and where is the code
complexity?

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ