Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3562865pxb; Mon, 24 Jan 2022 12:17:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFUGvirTNBHm/tP4Ahx3Xn+/4j2wTZLyWtFUzHb+A3LJ1CTKp4+MRHSMgzPfJ+h0nH/9lF X-Received: by 2002:a17:902:bb87:b0:148:a2f7:9d8e with SMTP id m7-20020a170902bb8700b00148a2f79d8emr15509740pls.173.1643055437021; Mon, 24 Jan 2022 12:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055437; cv=none; d=google.com; s=arc-20160816; b=ISYq+HxuPzxrpscMV+ycXa9cYjmbfLW3fqA8OClgEO5v9zw+ElmAIB9PGpj3/Juiua hdSZK26qLU1xmOQD2TtD4qWU8gXVFAZxkdRHUAPBe11Q16mlRF7rUelvixBkvSXA3fdN 4A0yTlz4RRXNCmBA18hWhgvCpPpCGPwHt9Gl5ySIebk6XYJLeUoAvNd4dsRmGHz9qtip +3y29f99AHaV8IVsSEd74ZgWdTFGuuyY1mCp0ReGq5sQeqylkcYyVRJU1kMLPoeG4A5x mMxUJIjXRQTQwAZsNSlPKYWvkCXUdBnmblIMKKn0IIVsp25u80PM7hQpYPQc4BKaqWo2 U6LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G/Twev4Ez8lsnnLlGxrc/Peb+8giI3EzNlfAmA1dVHI=; b=SAO3RQm4qRBZtDLk/XuZldIC4B039dDT4Lo6wDMG84eSq2ng0UIRgijXJVyeQApl8M N6EGTQ9BQoDE8Z+pUSOzCL/eQZy2eeMHyRuTF3j5zgMikTXTLotmPC1sZKOHWPtCR1BC QYe2U/7bwANEP91yDJTgxnptg37v37svxqXuB2q7HLhByWnT64WNrAlBeu+YbMlp4LsX +GUDCai7Wlge5CrAVXae1+AUQoIseMlBijSZpZKJdaniDcFaWVlnXYfBVIQrmQ1eF7Hh LB8omERZifim6DfuBUaIMlkD3FkpYVMqK6ToFDAUii4AqK3SJLIq1oP9+1iyyQEB5lwc qpow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="QyLTs/s1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si14352020pfl.100.2022.01.24.12.17.04; Mon, 24 Jan 2022 12:17:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="QyLTs/s1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348753AbiAXTTj (ORCPT + 99 others); Mon, 24 Jan 2022 14:19:39 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37594 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345148AbiAXTLf (ORCPT ); Mon, 24 Jan 2022 14:11:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4DB21B81233; Mon, 24 Jan 2022 19:11:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A115C340E5; Mon, 24 Jan 2022 19:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051492; bh=AXv0bhwDFHYDlHSaMxBSRFCsCriGi5RSJxtkFLs0kwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QyLTs/s1knjfeW2UOCGNfMvjuyVN8WtOfjStxTBrM+6cj+uLnkmwxbiWA8kEYY4UF FB0xV99oLmDjtVJJas0YHOzZGb6t+SA76RCcR4RlkQfBAdSoJb0hVm9DJHddKabjIi SoEwq1Xy7wqP8aL993AnDLbuNmqhVzFRui54Yeog= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yauhen Kharuzhy , Hans de Goede , Sebastian Reichel , Sasha Levin Subject: [PATCH 4.14 147/186] power: bq25890: Enable continuous conversion for ADC at charging Date: Mon, 24 Jan 2022 19:43:42 +0100 Message-Id: <20220124183941.832765733@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yauhen Kharuzhy [ Upstream commit 80211be1b9dec04cc2805d3d81e2091ecac289a1 ] Instead of one shot run of ADC at beginning of charging, run continuous conversion to ensure that all charging-related values are monitored properly (input voltage, input current, themperature etc.). Signed-off-by: Yauhen Kharuzhy Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/bq25890_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index 8e2c41ded171c..e90253b3f6561 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -521,12 +521,12 @@ static void bq25890_handle_state_change(struct bq25890_device *bq, if (!new_state->online) { /* power removed */ /* disable ADC */ - ret = bq25890_field_write(bq, F_CONV_START, 0); + ret = bq25890_field_write(bq, F_CONV_RATE, 0); if (ret < 0) goto error; } else if (!old_state.online) { /* power inserted */ /* enable ADC, to have control of charge current/voltage */ - ret = bq25890_field_write(bq, F_CONV_START, 1); + ret = bq25890_field_write(bq, F_CONV_RATE, 1); if (ret < 0) goto error; } -- 2.34.1