lkml.org 
[lkml]   [2021]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/13] power: supply: bq25890: Fix initial setting of the F_CONV_RATE field
    Date
    The code doing the initial setting of the F_CONV_RATE field based
    on the bq->state.online flag. In order for this to work properly,
    this must be done after the initial bq25890_get_chip_state() call.

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

    diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
    index 491d36a3811a..99497fdc73da 100644
    --- a/drivers/power/supply/bq25890_charger.c
    +++ b/drivers/power/supply/bq25890_charger.c
    @@ -682,16 +682,16 @@ static int bq25890_hw_init(struct bq25890_device *bq)
    }
    }

    - /* Configure ADC for continuous conversions when charging */
    - ret = bq25890_field_write(bq, F_CONV_RATE, !!bq->state.online);
    + ret = bq25890_get_chip_state(bq, &bq->state);
    if (ret < 0) {
    - dev_dbg(bq->dev, "Config ADC failed %d\n", ret);
    + dev_dbg(bq->dev, "Get state failed %d\n", ret);
    return ret;
    }

    - ret = bq25890_get_chip_state(bq, &bq->state);
    + /* Configure ADC for continuous conversions when charging */
    + ret = bq25890_field_write(bq, F_CONV_RATE, !!bq->state.online);
    if (ret < 0) {
    - dev_dbg(bq->dev, "Get state failed %d\n", ret);
    + dev_dbg(bq->dev, "Config ADC failed %d\n", ret);
    return ret;
    }

    --
    2.31.1
    \
     
     \ /
      Last update: 2021-10-30 20:28    [W:4.598 / U:0.260 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site