Hi,

On Thu, Jun 19, 2025 at 04:55:13PM +0200, Casey Connolly wrote:
> Hook up USBIN_CMD_IL so that writing "0" to the status register will
> disable charging, this is useful to let users limit charging
> automatically.
> 
> Signed-off-by: Casey Connolly <[email protected]>
> ---
>  drivers/power/supply/qcom_smbx.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/power/supply/qcom_smbx.c 
> b/drivers/power/supply/qcom_smbx.c
> index 
> b1cb925581ec6b8cfca3897be2de5b00a336c920..fc2a8e20435639a9da4d966c43271beaeb57a03f
>  100644
> --- a/drivers/power/supply/qcom_smbx.c
> +++ b/drivers/power/supply/qcom_smbx.c
> @@ -692,8 +692,11 @@ static int smb_set_property(struct power_supply *psy,
>  {
>       struct smb_chip *chip = power_supply_get_drvdata(psy);
>  
>       switch (psp) {
> +     case POWER_SUPPLY_PROP_STATUS:
> +             return regmap_update_bits(chip->regmap, chip->base + 
> USBIN_CMD_IL,
> +                                       USBIN_SUSPEND_BIT, !val->intval);

I planned to pick this, but USBIN_CMD_IL is not defined before the
smb5 support patch, so this is not bisectable.

Greetings,

-- Sebastian

>       case POWER_SUPPLY_PROP_CURRENT_MAX:
>               return smb_set_current_limit(chip, val->intval);
>       default:
>               dev_err(chip->dev, "No setter for property: %d\n", psp);
> @@ -704,8 +707,9 @@ static int smb_set_property(struct power_supply *psy,
>  static int smb_property_is_writable(struct power_supply *psy,
>                                    enum power_supply_property psp)
>  {
>       switch (psp) {
> +     case POWER_SUPPLY_PROP_STATUS:
>       case POWER_SUPPLY_PROP_CURRENT_MAX:
>               return 1;
>       default:
>               return 0;
> 
> -- 
> 2.49.0
> 
> 

Attachment: signature.asc
Description: PGP signature

Reply via email to