Re: [PATCH v3 5/6] power: supply: Add support for mp2733 battery charger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Jun 15, 2022 at 04:53:56PM +0200, Saravanan Sekar wrote:
> mp2733 is updated version of mp2629 battery charge management
> which supports USB fast-charge and higher range of input voltage.
> 
> Signed-off-by: Saravanan Sekar <sravanhome@xxxxxxxxx>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> ---
> [...]
>  	psy_cfg.drv_data = charger;
> -	psy_cfg.attr_grp = mp2629_charger_sysfs_groups;
> +	if (charger->chip_info->has_impedance)
> +		psy_cfg.attr_grp = mp2629_charger_sysfs_groups;
> +
> +	if (charger->chip_info->has_fast_charge)
> +		psy_cfg.attr_grp = mp2733_charger_sysfs_groups;
> +
>  	charger->battery = devm_power_supply_register(dev,
>  					 &mp2629_battery_desc, &psy_cfg);
>  	if (IS_ERR(charger->battery)) {

Instead of having has_impedance and has_fast_charge feature
flag that are mutual exclusive, store the device type and
use if/else or switch statement to chose the correct attr_grp.
Other than that:

Acked-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>

-- Sebastian

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux