Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3556405pxb; Mon, 24 Jan 2022 12:08:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqkwHceQ56AkiPsAd/jCUuotg/urH6Be8HDZUJLLjCTNLuCHmEQ9P2ajJbV3FF98vXTxkf X-Received: by 2002:aa7:9151:0:b0:4c7:f577:d37b with SMTP id 17-20020aa79151000000b004c7f577d37bmr10119797pfi.1.1643054920767; Mon, 24 Jan 2022 12:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054920; cv=none; d=google.com; s=arc-20160816; b=0DwnMkJ9xBW1PUI1BiVWrq1fwMqbYWhECMgS+SKEePc3LXAOJQjxfO4psjanIyRi6B QCFfr9fa1m2mh8GdE3IL63RF/ETLEV2VPGwT231C3TIIwttOIvlFsyF/tT3U3xvfNQtd V1WDRz9tlbiiQ6CheVi4UaEdI3fCJo8glvTCKZufrqrvrgCIshYV55467DnUVSh6q4ss FK7afJeleumQSRAZTO3rW8Iuj17T5IHB9p6nhxY6Nwu+TgXZxELQ2R5TIxV01qdOi9Sj WXYVD+Fm7GyEWJZ8hvPg/GJVYIEOHnVGb4SWqfy4I9ZEh4fIhIwoPocYsgmjn8K25+Uv 3eZw== 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=6qVI7A7l4TWM1MXuGeR2U2FuNEZ325+eERO32ZlZRL0=; b=YSjac0npf7iIrQMRUUZ3C+7/p0vbKJyb0zUi50131BMHaKrhyW/3wF2XWkA3ZO2FHt EVupP/pVzBegX1XDYZNRgd0ZHYL45nIDkjuZwoJypIORMp7/JbUox5YiJAEbeki9K9nK VpZxxDhJDkE6wyE9gFruVW2AvPWeZ7qOGT04QuCpo0sN/MS0gkM+fx9zY4WnKUFi2zsv qOd0vtLbEiwEiB73On5KKOJKgoKr3VokcQ6Z8rJEOfcsqMA2MEU3SjknOpaByCzhrDGI wYFJqn/HGFs/ll8Bi3pCvS5/o+87s6gMiNoLdBATKz0cvbGMd50H0juVig5H/YUIVOSw vWrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wI3WAnSu; 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 u5si12688501pgm.420.2022.01.24.12.08.27; Mon, 24 Jan 2022 12:08:40 -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=wI3WAnSu; 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 S1343842AbiAXTHz (ORCPT + 99 others); Mon, 24 Jan 2022 14:07:55 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:60472 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344657AbiAXTBt (ORCPT ); Mon, 24 Jan 2022 14:01:49 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 07CED60B86; Mon, 24 Jan 2022 19:01:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEEBDC340E5; Mon, 24 Jan 2022 19:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050908; bh=76HVBb0t5v3c1y4QZ4tIBcCqirxUjeVEVr/1bZHAtoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wI3WAnSupWwhKIgq9KjADJsPpCe+rm/9qQf7RoqQlwFn96/ngoaC7LonTivoB+TBS IgP6Fyf2XsZjI6+JzyqiNmjq8kQHh7XskRXSZQBv5RnNKnm2JEJzemJz6dVh6yHnfJ OW/SXcQxqHJYYbFaH92n6El4WvF+vPmfwPkKK6R8= 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.9 118/157] power: bq25890: Enable continuous conversion for ADC at charging Date: Mon, 24 Jan 2022 19:43:28 +0100 Message-Id: <20220124183936.522999069@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 f993a55cde20f..faf2a62435674 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