public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sung-Chi, Li" <lschyi@chromium.org>
To: Rob Herring <robh@kernel.org>
Cc: Benson Leung <bleung@chromium.org>,
	Tzung-Bi Shih <tzungbi@kernel.org>,
	Guenter Roeck <groeck@chromium.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>,
	linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: chrome: add new binding google,cros-ec-chrage-state
Date: Tue, 19 Nov 2024 10:23:18 +0800	[thread overview]
Message-ID: <Zzv2ltfXqaW-2ALm@google.com> (raw)
In-Reply-To: <20241118202520.GA3273373-robh@kernel.org>

On Mon, Nov 18, 2024 at 02:25:20PM -0600, Rob Herring wrote:
> > +properties:
> > +  compatible:
> > +    const: google,cros-ec-charge-state
> > +
> > +  min-milliamp:
> > +    description: min current in milliamp.
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +
> > +  max-milliamp:
> > +    description: max current in milliamp.
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> 
> Use standard units defined in property-units.yaml.
> 
> No constraints? 4000000 amps is okay?
> 

Hi, I cannot find a good value as the max value, the will depend on what charge
chip is used on that device. This is like a upper bound set from the kernel
side, so setting it to the max uint32 value is acceptable (from the driver side
when loading this config), not the desired current value. It is equivalent to
kernel side do not specify any constraint. Surely, if kernel set a value that is
larger than the max value, the EC will reject that request, either. The real
current is bounded by the EC and the charge chip, so it will not damage any
hardware.
If we can find a meaningful constraint value to document it here, that would be
great.

Would it be sufficient that I add the explanation to the description?

> > +
> > +  type:
> 
> Too generic. Property types are global. You need a vendor prefix for 
> starters.
> 

Thank you, I will use a more specific name in the following patches.

> > +    description: current limit type.
> > +    enum:
> > +      - charge
> > +      - input
> 
> What if you need to describe both?
> 

We need to declare different DTS nods for each. This node is representing the
constraint, not the charge chip itself.
The voltage, min and max milliamp on each current type are different on a single
charge chip. For example, I have a device that uses the charge chip rt9490, and
it has the following set up:

- Input current
  - min-milliamp: 100
  - max-milliamp: 3300
- Charge current
  - min-milliamp: 150
  - max-milliamp: 5000

I cannot find a clean way to merge different current type, max, and min milliamp
just in a single DTS node.
Also, we need to split different constraints into its own DTS node. It is
because the a cooling device in the thermal framework need its own DTS node, so
we can use it in the trip section.

  reply	other threads:[~2024-11-19  2:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18  9:33 [PATCH 0/3] Introduce new driver cros-ec-charge-state Sung-Chi, Li
2024-11-18  9:33 ` [PATCH 1/3] platform/chrome: cros_ec_charge_state: add new driver to control charge Sung-Chi, Li
2024-11-20 16:08   ` Tzung-Bi Shih
2024-11-21 13:05   ` kernel test robot
2024-11-21 13:47   ` Thomas Weißschuh
2024-11-21 14:00     ` Krzysztof Kozlowski
2024-11-21 14:11       ` Thomas Weißschuh
2024-11-22  1:53         ` Sung-Chi, Li
2024-11-18  9:33 ` [PATCH 2/3] dt-bindings: chrome: add new binding google,cros-ec-chrage-state Sung-Chi, Li
2024-11-18 10:22   ` Rob Herring (Arm)
2024-11-18 20:25   ` Rob Herring
2024-11-19  2:23     ` Sung-Chi, Li [this message]
2024-11-20 16:35       ` Krzysztof Kozlowski
2024-11-20 16:37   ` Krzysztof Kozlowski
2024-11-18  9:33 ` [PATCH 3/3] mfd: cros_ec: Add charge state control cell Sung-Chi, Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zzv2ltfXqaW-2ALm@google.com \
    --to=lschyi@chromium.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=groeck@chromium.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox