diff mbox series

[v3,1/4] dt-bindings: power: Add BQ27561 compatible

Message ID 20200721163206.25438-1-dmurphy@ti.com
State Not Applicable, archived
Headers show
Series [v3,1/4] dt-bindings: power: Add BQ27561 compatible | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema success

Commit Message

Dan Murphy July 21, 2020, 4:32 p.m. UTC
Add the Texas Instruments bq27561 battery monitor to the bq27xxx
binding.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 Documentation/devicetree/bindings/power/supply/bq27xxx.yaml | 1 +
 1 file changed, 1 insertion(+)

Comments

Sebastian Reichel July 27, 2020, 10:36 p.m. UTC | #1
Hi,

On Tue, Jul 21, 2020 at 11:32:04AM -0500, Dan Murphy wrote:
> Add the Texas Instruments BQ27561 battery monitor.  The register address
> map is laid out the same as compared to other devices within the file.
> The battery status register has differing bits to determine if the
> battery is full, discharging or dead.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---

Looks mostly good to me, but

[...]

> @@ -1710,6 +1769,13 @@ static int bq27xxx_battery_capacity_level(struct bq27xxx_device_info *di,
>  			level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
>  		else
>  			level = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
> +	} else if (di->opts & BQ27561_O_BITS) {
> +		if (di->cache.flags & BQ27561_FLAG_FC)
> +			level = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
> +		else if (di->cache.flags & BQ27561_FLAG_DIS_CH)
> +			level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;

Shouldn't this be checking for FLAG_FDC instead of FLAG_DIS_CH?

-- Sebastian
Dan Murphy July 28, 2020, 2:04 p.m. UTC | #2
Sebastian

On 7/27/20 5:36 PM, Sebastian Reichel wrote:
> Hi,
>
> On Tue, Jul 21, 2020 at 11:32:04AM -0500, Dan Murphy wrote:
>> Add the Texas Instruments BQ27561 battery monitor.  The register address
>> map is laid out the same as compared to other devices within the file.
>> The battery status register has differing bits to determine if the
>> battery is full, discharging or dead.
>>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
> Looks mostly good to me, but
>
> [...]
>
>> @@ -1710,6 +1769,13 @@ static int bq27xxx_battery_capacity_level(struct bq27xxx_device_info *di,
>>   			level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
>>   		else
>>   			level = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
>> +	} else if (di->opts & BQ27561_O_BITS) {
>> +		if (di->cache.flags & BQ27561_FLAG_FC)
>> +			level = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
>> +		else if (di->cache.flags & BQ27561_FLAG_DIS_CH)
>> +			level = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
> Shouldn't this be checking for FLAG_FDC instead of FLAG_DIS_CH?

Yes.

Dan


> -- Sebastian
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
index 03d1020a2e47..51cb1f685dcf 100644
--- a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
+++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
@@ -49,6 +49,7 @@  properties:
       - ti,bq27426
       - ti,bq27441
       - ti,bq27621
+      - ti,bq27561
 
   reg:
     maxItems: 1