lkml.org 
[lkml]   [2021]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 08/20] power: supply: bq25890: Enable charging on boards where we skip reset
    Date
    On boards where the "linux,skip-reset" boolean property is set we don't
    reset the charger; and on some boards where the fw takes care of
    initalizition F_CHG_CFG is set to 0 before handing control over to the OS.

    Explicitly set F_CHG_CFG to 1 on boards where we don't reset the charger,
    so that charging is always enabled on these boards, like it is always
    enabled on boards where we do reset the charger.

    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    ---
    drivers/power/supply/bq25890_charger.c | 11 +++++++++++
    1 file changed, 11 insertions(+)

    diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
    index b7c38d2c5ede..a69a2173e31a 100644
    --- a/drivers/power/supply/bq25890_charger.c
    +++ b/drivers/power/supply/bq25890_charger.c
    @@ -717,6 +717,17 @@ static int bq25890_hw_init(struct bq25890_device *bq)
    dev_dbg(bq->dev, "Reset failed %d\n", ret);
    return ret;
    }
    + } else {
    + /*
    + * Ensure charging is enabled, on some boards where the fw
    + * takes care of initalizition F_CHG_CFG is set to 0 before
    + * handing control over to the OS.
    + */
    + ret = bq25890_field_write(bq, F_CHG_CFG, 1);
    + if (ret < 0) {
    + dev_dbg(bq->dev, "Enabling charging failed %d\n", ret);
    + return ret;
    + }
    }

    /* disable watchdog */
    --
    2.31.1
    \
     
     \ /
      Last update: 2021-11-14 18:06    [W:4.089 / U:2.112 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site