Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2985549ybz; Sun, 3 May 2020 14:16:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJtCPM+y/7ruRsmKMKYKITpw42qrdEA0m1MeBTbCtivdb6M6MsMPd9lz0hO1iYw5A51n3PH X-Received: by 2002:a17:906:459:: with SMTP id e25mr12572479eja.379.1588540606529; Sun, 03 May 2020 14:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588540606; cv=none; d=google.com; s=arc-20160816; b=az+YSiFCRTqAXuL4BORS0P4LhxnbZ2okBL+uc/bkDQFbx51AA9q6c6kRRbMY3ld3HQ MMniMD/jvy+VfM38tvkCCeW/UPnijtzw6ralJOG7lk3KcW+3tS2BKXIboErFGCaN/Ydd tLI70dOmAxwoyenuZU0DG13cYe1vlL+lFhx2xXeqIFvD+qF2RTrQZdkjiX9x0u4DgvUI kWCr9zPndNXbvmPsTRN73jkgShjCb8mMGlbHgHJCYqNW306IJQxdvPanVE4JC67axBu4 rsX+cqDenWjSepZKy5jWSnAQC6+kaW3WmOF9ZNk5UPdq8ZulOZjwg21oS+wPtp/YUSKP DNwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=DLTTtgrwpWXX3g8lBfuWPJDcdD7xlPWtSpmO6vbRvRU=; b=geMrT55R1D5EX7CWlwre/5Tf21ZIhxP6I/5F7+72gJDn4GNWXIKiKygJDlUIpfgp3w H4HuZEXEnKst6x35P0tiRmRbL5AMZIIhJu9FmDEXVt4qzRdrHuCoBFgfjPmgannfDjJ9 S6k2sOaRQBxZTYeUs1hn6Wca4GUGGmQyfLAcVksjE+gBMTo15YR8erkoXUU6ROzLo/h8 zaTzG/1hjTrmpddLFO1Ys9fVe+7v54lcJ9TLf31SONsxafLeCalYIzC65q447fNGh4LO TPDPGpxhQB4ziqQ76eLFxNNa4jZ3N4UexotbF5znq2qnAjLHvVenCMKhIp+9/oQi86lO tikw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si5619578edy.578.2020.05.03.14.16.23; Sun, 03 May 2020 14:16:46 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729149AbgECVOg (ORCPT + 99 others); Sun, 3 May 2020 17:14:36 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50488 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbgECVOg (ORCPT ); Sun, 3 May 2020 17:14:36 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id BDAB62A083E Received: by earth.universe (Postfix, from userid 1000) id 794C93C08C7; Sun, 3 May 2020 23:14:32 +0200 (CEST) Date: Sun, 3 May 2020 23:14:32 +0200 From: Sebastian Reichel To: =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 07/11] power: bq25890: implement CHARGE_TYPE property Message-ID: <20200503211432.dvwm5whaeim5krz3@earth.universe> References: <9b3bd77de9cfef8af8f8ab76270b46599f9e5ab1.1588517058.git.mirq-linux@rere.qmqm.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pppg25arb2u7vzzu" Content-Disposition: inline In-Reply-To: <9b3bd77de9cfef8af8f8ab76270b46599f9e5ab1.1588517058.git.mirq-linux@rere.qmqm.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pppg25arb2u7vzzu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, May 03, 2020 at 05:21:12PM +0200, Micha=C5=82 Miros=C5=82aw wrote: > Report charging type based on recently read state. >=20 > Signed-off-by: Micha=C5=82 Miros=C5=82aw > --- Reviewed-by: Sebastian Reichel -- Sebastian > drivers/power/supply/bq25890_charger.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/suppl= y/bq25890_charger.c > index e4368d01396a..ad0901fdceb6 100644 > --- a/drivers/power/supply/bq25890_charger.c > +++ b/drivers/power/supply/bq25890_charger.c > @@ -429,6 +429,18 @@ static int bq25890_power_supply_get_property(struct = power_supply *psy, > =20 > break; > =20 > + case POWER_SUPPLY_PROP_CHARGE_TYPE: > + if (!state.online || state.chrg_status =3D=3D STATUS_NOT_CHARGING || > + state.chrg_status =3D=3D STATUS_TERMINATION_DONE) > + val->intval =3D POWER_SUPPLY_CHARGE_TYPE_NONE; > + else if (state.chrg_status =3D=3D STATUS_PRE_CHARGING) > + val->intval =3D POWER_SUPPLY_CHARGE_TYPE_STANDARD; > + else if (state.chrg_status =3D=3D STATUS_FAST_CHARGING) > + val->intval =3D POWER_SUPPLY_CHARGE_TYPE_FAST; > + else /* unreachable */ > + val->intval =3D POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; > + break; > + > case POWER_SUPPLY_PROP_MANUFACTURER: > val->strval =3D BQ25890_MANUFACTURER; > break; > @@ -670,6 +682,7 @@ static const enum power_supply_property bq25890_power= _supply_props[] =3D { > POWER_SUPPLY_PROP_MANUFACTURER, > POWER_SUPPLY_PROP_MODEL_NAME, > POWER_SUPPLY_PROP_STATUS, > + POWER_SUPPLY_PROP_CHARGE_TYPE, > POWER_SUPPLY_PROP_ONLINE, > POWER_SUPPLY_PROP_HEALTH, > POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, > --=20 > 2.20.1 >=20 --pppg25arb2u7vzzu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl6vNDgACgkQ2O7X88g7 +poifw/+Pjn+h9NpXuSwdWHNys8yqlmuFVbpBhfJ8suFgJA95qFN+YoUPql4BDcL aQpTet8z1EjjBZEfdgqd34jkWbUHYAA3T4zDT0ehCuCsdCvhxINQkcDr5FePCXea d7iv3H98l+OrKvnbL+l1IQ7Z0kUievsdPBjMi8BPU1szkfilFs4JwMzAmG+uXVvr j8JUmsscvUcdjFcKcQ+sjXV6/5H0gfPydDOz8Mlsa72sxUMOj1YGkJiS9tCdZt/Y 4Y0Nno3NkRdPQAnz/cpiMJT8cbo1j7NIoKyvwP5AytnKg6D8XgtqI5oJnjw1E5SC N/nQd4339J/8K8O10RTKI+YIQSHVeFh89nLzmby9TZtuKzW7pcAUoVDll9xU8den p2zNbnzoyObUeorVSFsqKBfoAqgaMscX73WBKttFnqDVWYBBkbb0Cv3mE0iKRg86 n0QhiNqk/MCw9AMhaIP383lq7X/3KsbYLBsr7sIJcXlwZ8rsiAKxlfglxdqkvKoA aFKpjm9RZuZes8ic7n7oX9zcV2HGQOk54QdxY2hD/LNVKszRH0PcI5WbMlQh1APQ mCIgbpq8V+oaqt7LFFGlNcILSPvRWrDSTWOXWd0Ykt03ga3woMJFiF5Lx1LuODmD IbYowMvZUPC9rbQ36YD7GhCm5ki6aTW4Dl1YgiG4LqPqUANV5aQ= =go7r -----END PGP SIGNATURE----- --pppg25arb2u7vzzu--