-
Notifications
You must be signed in to change notification settings - Fork 892
Add support for MAX1720x Maxim ModelGauge m5 Fuel Gauge #2774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: "http://devicetree.org/schemas/power/supply/maxim,max1720x.yaml#" | ||
$schema: "http://devicetree.org/meta-schemas/core.yaml#" | ||
|
||
title: Maxim ModelGauge m5 Fuel Gauge family (MAX17201/5, MAX1733x series) | ||
|
||
maintainers: | ||
- "Joan Na <joan.na@analog.com>" | ||
|
||
description: | | ||
Bindings for Maxim Integrated ModelGauge m5 stand-alone fuel gauge ICs. | ||
This includes MAX17201, MAX17205, MAX17300/1/2/3, MAX17320, MAX17330/32/35. | ||
|
||
properties: | ||
compatible: | ||
enum: | ||
- "maxim,max17201" | ||
- "maxim,max17205" | ||
- "maxim,max17300" | ||
- "maxim,max17301" | ||
- "maxim,max17302" | ||
- "maxim,max17303" | ||
- "maxim,max17320" | ||
- "maxim,max17330" | ||
- "maxim,max17332" | ||
- "maxim,max17335" | ||
|
||
reg: | ||
description: I2C address of the device | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drop the description |
||
maxItems: 1 | ||
|
||
maxim,rsense: | ||
description: Rsense register value in milliohms | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
|
||
maxim,talrt-min: | ||
description: Lower temperature limit (in degree Celsius) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/int32 | ||
|
||
maxim,talrt-max: | ||
description: Upper temperature limit (in degree Celsius) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/int32 | ||
|
||
maxim,valrt-min: | ||
description: Lower voltage limit (in mV) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
|
||
maxim,valrt-max: | ||
description: Upper voltage limit (in mV) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
|
||
maxim,salrt-min: | ||
description: Lower SOC (State of Charge) limit (in %) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
|
||
maxim,salrt-max: | ||
description: Upper SOC (State of Charge) limit (in %) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
|
||
maxim,ialrt-min: | ||
description: Lower current limit (in mA) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/int32 | ||
|
||
maxim,ialrt-max: | ||
description: Upper current limit (in mA) to trigger ALRT1 | ||
$ref: /schemas/types.yaml#/definitions/int32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. almost all of the above feel like hwmon stuff. It seems the power supply subsystem already has some ind of bridge with hwmon. Did you looked at this: https://elixir.bootlin.com/linux/v6.14.5/source/drivers/power/supply/power_supply_core.c#L1600 Make sure you have no way of controlling the above at runtime before considering dt properties |
||
|
||
status: | ||
enum: [ "okay", "disabled" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the above property? You're not including any other bindings... If it's the DT node status, drop it. |
||
|
||
required: | ||
- compatible | ||
- reg | ||
|
||
additionalProperties: false | ||
|
||
examples: | ||
- | | ||
fuel-gauge@36 { | ||
compatible = "maxim,max17335"; | ||
status = "okay"; | ||
reg = <0x36>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <16 0>; | ||
maxim,rsense = <5>; | ||
maxim,talrt-min = <0>; | ||
maxim,talrt-max = <50>; | ||
maxim,valrt-min = <3000>; | ||
maxim,valrt-max = <4500>; | ||
maxim,salrt-min = <1>; | ||
maxim,salrt-max = <99>; | ||
maxim,ialrt-min = <(-5000)>; | ||
maxim,ialrt-max = <5000>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should have 4 spaces the exmaple |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,7 +414,18 @@ config BATTERY_MAX1721X | |
|
||
Say Y here to enable support for the MAX17211/MAX17215 standalone | ||
battery gas-gauge. | ||
|
||
config BATTERY_MAX1721X | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be BATTERY_MAX1720X and before the previous entry, always in alphabetical order I did a run with the experimental ci at https://github.com/gastmaier/adi-linux/actions/runs/14999793574 |
||
tristate "MAX17201/MAX17215 standalone gas-gauge" | ||
depends on I2C | ||
select REGMAP_I2C | ||
help | ||
MAX1720x is fuel-gauge systems for lithium-ion (Li+) batteries | ||
in handheld and portable equipment. | ||
|
||
Say Y here to enable support for the MAX17201/MAX17335 standalone | ||
battery gas-gauge. | ||
|
||
config BATTERY_TWL4030_MADC | ||
tristate "TWL4030 MADC battery driver" | ||
depends on TWL4030_MADC | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't mix bindings with driver code. Bindings should be in it's own patch...