Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548491pxb; Mon, 24 Jan 2022 11:58:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDIq7BUKWb7TxOE4ebkxDy73DS7FmyDahfVZI6PB5CFpp283jM6827qTWwhHyvU8h9PHNT X-Received: by 2002:a05:6a00:24c9:b0:4bb:ffe2:17c2 with SMTP id d9-20020a056a0024c900b004bbffe217c2mr12933400pfv.31.1643054326136; Mon, 24 Jan 2022 11:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054326; cv=none; d=google.com; s=arc-20160816; b=kxcLL/BF8abDH7zrX2mREu53xkeDiwKsyPXESjOFHh8G1gz2Jse/g14edaTXWxApiO OOObbqtZ7Z1QhEYVe2J9vTMMSgw+wipmDv12h7OJdBwgJBswE8bVYxcSGrfVVfd8BWRY QhLX4GhEh7lT0Cdoyj2WQLxCexHxUeqsiDAXmOqkgeb9htJTx7/i4yDM1WiENrAaffgD EW2V/ew+51pNK9ElLr4nh9EvkmYQiyaQjMfb2MNpyQ2Y4+HqcIeeyzZPt4qTK5lD9m9X xpgpVrpjuf0cIYyMP5WguDKlATpcJtKjY3alM/DvHhv+7MfRfCrllkS3xt/mR1YlJySd cKqA== 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=/YWPIgsCOZJ69myUIP0c3MQ1kgUBg3onvNWnaOVMeIU=; b=L4+/f22oFE1+sswOSEHcNGus2OoLJjViO/IRNddnK2bxtcaLHuzyKp6clB1VVECsuV 9GLE8jDznmtr2i3koYYUogIfrankak6NEJxl/nq/gl4YItjDYNQ4GMI+nGaHmxvMdjHh OAmsMvR5u6XKoSoSPEhPj87VDGV5UByoOM9iPnAbQbdtXe1fnfc7jVsItjZ4IKWnNJAT sh0u2RN/QKEONcbdoz/vOAQdIIecwXmGnGv3NSLi/dYs2lHr2et337g9vdShYn2Fde/4 4GGLZ9aS4fCm+11Zs8CSbaF6cgGOvkegFSW0DO3sirkvuOE060DeqRmQ7goLF4FxAvUT 3Q1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UmNllmtr; 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 k5si14109102pgk.620.2022.01.24.11.58.33; Mon, 24 Jan 2022 11:58:46 -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=UmNllmtr; 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 S1344388AbiAXSyh (ORCPT + 99 others); Mon, 24 Jan 2022 13:54:37 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:50600 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343945AbiAXSws (ORCPT ); Mon, 24 Jan 2022 13:52:48 -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 848826151A; Mon, 24 Jan 2022 18:52:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E6B1C340E5; Mon, 24 Jan 2022 18:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050366; bh=tiEztUcTC2j5P794DPJgbNB59Cy+LICX+yJmsLn7KSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UmNllmtrGRMIiydKpk4pDD0pFJL+VSlTygyOEFQbeffhRa69ouxt20M9c/CDCBVVr OcyqV6qU+tnKlnu2dRTZEZ8PZK8EaOs9RrhsRZxr4yLVKl7rBVityjQ3RMuaoB7p4O V/VABxsBO2gdz4iQXrJhgMneSbnlLypYDPXYM19k= 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.4 096/114] power: bq25890: Enable continuous conversion for ADC at charging Date: Mon, 24 Jan 2022 19:43:11 +0100 Message-Id: <20220124183930.077354285@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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/bq25890_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/bq25890_charger.c b/drivers/power/bq25890_charger.c index f993a55cde20f..faf2a62435674 100644 --- a/drivers/power/bq25890_charger.c +++ b/drivers/power/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