From nobody Tue Sep 29 09:08:07 2026 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99A7035C695; Mon, 10 Aug 2026 10:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356542; cv=none; b=uwaG6FJqjhavFkK65afL0ghwyPUUk9RjRQG4okZEjKmfYHwP8eQBw/qT3/QwQRX9GwZAzDOjEuh7MSyS9KLHnH1+SDy2RLJAKk3bOWHdDo9VaInV1fVR4X+VXfvB4SJk/DWghsWSASY6rrVQ9B9hBGzOZmy+NuB3iKQRpgt9sVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356542; c=relaxed/simple; bh=NPTw5Qkru5xKUyLBUaN5xRLF7avhUkcIM9QkhHIE8u8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gH4F591Zps8ma5wZlKJZyA4lFz6P/J/JjMS9iA/sKesDIvbqEyUMaJJL+Z1Bfx4oiRvEj3FG4pESJ4kK0ZZNNzG8zWbXqmpzO2UYZUgaem2Dc9zG7SDzRYc+/HHVY79HQnN6Icy5j43H0bshFmUKQUfuFFYZXk6P8y91bnavGyo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=tsz+PLM+; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="tsz+PLM+" Date: Mon, 10 Aug 2026 13:08:50 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786356538; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=WUFkLgZPFib4GyFOfx2B4fKRRRwlTZ/sdM/18oq88ac=; b=tsz+PLM+md34pqEVYpQuWInMECD3M/mHxaOobcIFT6kk/33bq/vWhCO73Lajyp3t30XLtQ +dEsvm45j+8Q31TpRkhwjz3lCFyvm5nlnnsW1Y7+Yd4kqWaVB4GI7zRrhNc9WVi0qzDEdU U/CUWDZN65A1a7y3nc5rCzNLX5f0/5k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Andreas Kemnade , Matti Vaittinen , Sebastian Reichel , Andy Shevchenko , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Niemi , Topi =?iso-8859-1?Q?Sonkaj=E4rvi?= , Mikko Mutanen , Markus Laine Subject: [PATCH 1/5] power: supply: bd71815: Fix temperature reading Message-ID: <4ae3dfa7fc80372977fd29c837321f96d551bf6f.1786356145.git.mazziesaccount@gmail.com> Reply-To: Matti Vaittinen References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aKLRCn6ZdE2XSj5b" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --aKLRCn6ZdE2XSj5b Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen The temperature read from the hardware is never returned to caller. Furthermore, the check for temperature validity is wrong. This yields garbage value to be returned to caller, and also detection of bad values read from hardware to fail. Signed-off-by: Matti Vaittinen Fixes: 5bff79dad20a ("power: supply: Add bd718(15/28/78) charger driver") Tested-by: Kalle Niemi --- drivers/power/supply/bd71828-power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/bd71828-power.c b/drivers/power/supply/bd= 71828-power.c index b671563ead79..e1ae5fe52e1d 100644 --- a/drivers/power/supply/bd71828-power.c +++ b/drivers/power/supply/bd71828-power.c @@ -225,13 +225,13 @@ static int bd71815_get_temp(struct bd71828_power *pwr= , int *temp) if (ret) return ret; =20 - t =3D 200 - t; - if (t > 200) { dev_err(pwr->dev, "Failed to read battery temperature\n"); return -ENODATA; } =20 + *temp =3D 200 - t; + return 0; } =20 --=20 2.55.0 --aKLRCn6ZdE2XSj5b Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmp5ozIACgkQeFA3/03a ocV9YQf8CLDbHJPBz8vpbr529zmDRfanqifT+ZAwCSeDcpcTh2zFiuzNOZJjkjN+ 0F6RO6RMiQar2DepGjbtgzg9Xd9cUT31CLZxVJgwKj2yR3BzDCnYX5N/FwaFkWu3 OiLdBD2PYzrfJfG+zH/rhOT6+bag0FE/Jxs5feqnmFkov+nIZhCjKSCWD530JmnF DCE+/Gpaq2XbKrmWK+ZV9HcMGJ6swJkudjHudtAnSxm1pjqY/QRoHqYUbLZjm1ru I2F/0AeAp6IOHwoyHuYYf6l+kBJx5afo/o2BCMKC0C8BNbJlWM1uB/3vMY/y1pJ1 onjVwD5krcCXc1t7AhTwCxY8gLwLLw== =XESO -----END PGP SIGNATURE----- --aKLRCn6ZdE2XSj5b-- From nobody Tue Sep 29 09:08:07 2026 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C46F3A5E90 for ; Mon, 10 Aug 2026 10:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356558; cv=none; b=UTBCTu4k5iBObk711kfx+hFNyQrEWUU+Ks3EjB7ycEdgRvVQTcCG9AMoUNXztgon/jZUPmAOMam8+y5otbcFl2EvpKCgXU31fSnJO63qxVYm7lvP/26eGlNXXKwUL5n5D7EXdud/XbtMA8DtHZd0uWQZiA3JxtYv4A/++N7pMMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356558; c=relaxed/simple; bh=rJMKqi1RQ+r8HBj6LdDWxjQiZSQTvhLNXYkiKbR7cx4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ndVrbrgTXeuYw3KV6vwC4U7w6JojrVD7CSMcJ87Y9YS/Ojyu912ZutSjvRVb4qgmh6k7w8FO1xnRyLl77xe01ML31RDbDlnRLx/clTmeQZPZa3JXLXGgtOZh1M6/yl7dzbYWZz9AMLXkaD/QyMC0UWu64bCDR4+IL7e4FgyzjzQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=wZlRmTrS; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wZlRmTrS" Date: Mon, 10 Aug 2026 13:09:07 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786356554; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=Y1yGt+S9JJknR1LW14cAZVW+BNXaBFfxZpcwQyLkFks=; b=wZlRmTrSBens0IgXrRy57LiLLqA97D5GqQFTbjFVHKe3EkASTwcydyVupNxxYKylDhlE60 KZwCw/ve4mP8alZMwd2cFgw5Zz69p4+jPf15vWb8/d4IkGC4BD57FyST/5MMYgZPYp2npa N6d8Z9gseD+rIaMiuZ6hQ6DMeKAp39A= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Andreas Kemnade , Matti Vaittinen , Sebastian Reichel , Andy Shevchenko , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Niemi , Topi =?iso-8859-1?Q?Sonkaj=E4rvi?= , Mikko Mutanen , Markus Laine Subject: [PATCH 2/5] power: supply: bd71828: Fix current direction Message-ID: <22c6816204b3f2a8b50df8171e384937822d195b.1786356145.git.mazziesaccount@gmail.com> Reply-To: Matti Vaittinen References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QQvgCqlg8fvQTwot" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --QQvgCqlg8fvQTwot Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen Both the current and the average current registers contain same 'direction' -bit to denote the direction of the current. The code reading these registers incorrectly caches the direction read from the first register, and uses it also for the second. Fix this by initializing the direction bit for both register reads. Signed-off-by: Matti Vaittinen Fixes: 5bff79dad20a ("power: supply: Add bd718(15/28/78) charger driver") Tested-by: Andreas Kemnade # Kobo Clara 2e rev B Tested-by: Kalle Niemi --- drivers/power/supply/bd71828-power.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/bd71828-power.c b/drivers/power/supply/bd= 71828-power.c index e1ae5fe52e1d..9927a7e8934a 100644 --- a/drivers/power/supply/bd71828-power.c +++ b/drivers/power/supply/bd71828-power.c @@ -192,12 +192,13 @@ static int bd71828_get_current_ds_adc(struct bd71828_= power *pwr, int *curr, int { __be16 tmp_curr; char *tmp =3D (char *)&tmp_curr; - int dir =3D 1; int regs[] =3D { pwr->regs->ibat, pwr->regs->ibat_avg }; int *vals[] =3D { curr, curr_avg }; int ret, i; =20 - for (dir =3D 1, i =3D 0; i < ARRAY_SIZE(regs); i++) { + for (i =3D 0; i < ARRAY_SIZE(regs); i++) { + int dir =3D 1; + ret =3D regmap_bulk_read(pwr->regmap, regs[i], &tmp_curr, sizeof(tmp_curr)); if (ret) --=20 2.55.0 --QQvgCqlg8fvQTwot Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmp5o0MACgkQeFA3/03a ocUZFgf/Zg6Rh9shYDmlINQupUAFf/r5pvtrAmiz8MuDkHk06olBAEcBtAlXxDSF wp9aeNxH2IP2DN7Wd88y6zZX3RAR7opoy1cg8T5kG+c8nAFUGikFRIIITmcOiJU2 TkL8ClovN+cGXPTxB2IP9QaIfeaROlsgci8O1NoHy5ntQt9u8qi+u/DDmiLeZApx GsebcxWxqMBWQ4XZK74ZBeoEOh5Q/hcYq+uNloHoRx26dcUxH1I08IL+jtYJIFRJ cqQK9lsYnovYy3soSr9rNHd60tyNys8sLwVAToC7kfYq5yHP1N2vhqoxOJow0VHF 98tURUYxXlDozOi51BQMXZfasDd1+w== =5BC8 -----END PGP SIGNATURE----- --QQvgCqlg8fvQTwot-- From nobody Tue Sep 29 09:08:07 2026 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02AFE3AEF56 for ; Mon, 10 Aug 2026 10:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356578; cv=none; b=YtbPV93S07IepClXT/Y2JuX1Ct3+2WlJViA8KZWB2EnLWW8ReVbJ6FcdDd6JI6SQQOrA71U0i6kdHgQSdBdqyT3Ayepfet3JJolid+SPlEb7a30CMbpfmUWz+Wfn3u81t4zwDsrrfAiPaeMUmJYj+SEa3JUYglgxvqbC7noQZkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356578; c=relaxed/simple; bh=bdJ/iNaaamNGNmZ2H9h9dvPY80VOXODcOnZlru2LcxA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KWn4Osv30nMSfEK0RopLPrr2+ZA3eFMlfqCx+Ieaw7UygamNicWHRltuYCUR+mn5gLtVyw0eiz7LoveOppsUVDaA8x1XlsSeFLKWxgRNnMBM4Nv1sc9SLRZQlZRE/eirCKRczTtXLcs6Tx7xHkT7Inx3vTj1+xO3ZZf3KXmrsiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YUN/ocF+; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YUN/ocF+" Date: Mon, 10 Aug 2026 13:09:25 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786356574; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=JhIBN1tfwNjQw86bei0syRvcG5esJBYJHLXucToUKvw=; b=YUN/ocF+0UX5yKSb8etgJ5OCNL4oBx2pOTg3Hw05ETBIQxTxhb/OJh/Iv8Tay/nvJh3FuP iXe28rYbEcEYq/oC7BYMdQ53sbLJ5TTk940SSOhJjmdYBdeCgxhpzuGTzaGmiMOEj4Jwrz M/Ug0EVnZtc1jTd0OXKJZuotjzSCjds= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Andreas Kemnade , Matti Vaittinen , Sebastian Reichel , Andy Shevchenko , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Niemi , Topi =?iso-8859-1?Q?Sonkaj=E4rvi?= , Mikko Mutanen , Markus Laine Subject: [PATCH 3/5] power: supply: bd71828: Drop duplicate power-supply property Message-ID: <518283ec9163943fcd1b53ad61fc3025fd346d83.1786356145.git.mazziesaccount@gmail.com> Reply-To: Matti Vaittinen References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J+1SLjX5CXTuD2Ot" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --J+1SLjX5CXTuD2Ot Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen The POWER_SUPPLY_PROP_HEALTH is added into property-array twice. Drop the duplicate property. Signed-off-by: Matti Vaittinen Fixes: 5bff79dad20a ("power: supply: Add bd718(15/28/78) charger driver") Tested-by: Kalle Niemi --- drivers/power/supply/bd71828-power.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/power/supply/bd71828-power.c b/drivers/power/supply/bd= 71828-power.c index 9927a7e8934a..a564ad7210be 100644 --- a/drivers/power/supply/bd71828-power.c +++ b/drivers/power/supply/bd71828-power.c @@ -640,7 +640,6 @@ static const enum power_supply_property bd71828_charger= _props[] =3D { =20 static const enum power_supply_property bd71828_battery_props[] =3D { POWER_SUPPLY_PROP_STATUS, - POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_PRESENT, --=20 2.55.0 --J+1SLjX5CXTuD2Ot Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmp5o1UACgkQeFA3/03a ocWt4ggAnVpObjKYN4msQv53bhqAvL2VPnVv/a3nPPEhhsPo30EbrjkDi1BRdLWD Ku4JQvUbHQNMcOe5UQwiLgEsF0HbY2QQcJ72lo69mmdMTGnlT7es04IIzMIRjf/v Moema50xinlgYgN0qEhqUG0/k/5aR9QZH462R/RV1YxrDSe5WAvVMkAWYC51VKap cLcrRs15lzqZRcBYVSRRcPJMVHLz/j+UExCIMKN2Nwl+p5pKxWRWGNeSmwMQteQO NkteYeoLsCSZzZBVVtgi/VVvriGwB9aINuM1i/KYwao8OJGA5fJWiZUnFsUBqaY7 Eev4KyWp0mwkH074GQCGBZCudd3BRg== =Es2w -----END PGP SIGNATURE----- --J+1SLjX5CXTuD2Ot-- From nobody Tue Sep 29 09:08:07 2026 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACA9E391E4E for ; Mon, 10 Aug 2026 10:09:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356597; cv=none; b=ffmbnyGPeXmBO126sya06QlbVtykHFnkGPUoX/6TQOSWKkKdGmqyi5cI3VpknYp/UAMGHkeOp6j4Ch/ycCW/3aTLfedjX28MrxrcwvlSdoe6v56CQ3n88GwiqyC/SgPs+fmj83DqXYvivk+TFkeDSHXTIVzWV9NdOkYkpq1mc+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356597; c=relaxed/simple; bh=BfIxQcsUpQR7yGmqTVW2AbmmE/cqjCymxlvX++/gW7U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Kwl0yBMKHiJMUTSafHhz13CosgwH8NED5xgAaTQxjzm8ixqU7u+ve13gO+tt/pV7zqJ6GToXNUV+/rz3gGr3cGlT/F0am6j1g4ceunAETKT2+ydu52R2i5E9hQzU88xr/8R0OC/gzLo9kErHn7ZTZNWcyEt/Pb0fNkS1440kHkc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Zt7kOVOc; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Zt7kOVOc" Date: Mon, 10 Aug 2026 13:09:45 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786356593; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=NFRBGj6xZQjiu4PpczKHqS5R8RXoFOjImZ2eD8ddS6s=; b=Zt7kOVOceAfMchEAt9/V9kfb+Q59rCrZW/+dgnhc3KKK5doeAgTgpM/sT0Ht1uuZxPtA3b GgSrYZyYlZyYvc5/Vzjo7p8UFLvwiCW4Vu5wv1h1dcEewffnidImNuOWum2e7yZGl2Nx0T 5bJnwirIIDUnSUYCGfmYfL96T86gEhA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Andreas Kemnade , Matti Vaittinen , Sebastian Reichel , Andy Shevchenko , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Niemi , Topi =?iso-8859-1?Q?Sonkaj=E4rvi?= , Mikko Mutanen , Markus Laine Subject: [PATCH 4/5] power: supply: bd71828: Do not hide errors Message-ID: <22db56cf35252d2d8f67828a0554e8daac7ae251.1786356145.git.mazziesaccount@gmail.com> Reply-To: Matti Vaittinen References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CaP5KfQN4JEx3u+C" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --CaP5KfQN4JEx3u+C Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen The bd71828 reports success / continues operation even when some regmap operations fail. This can lead incorrect data to be reported. Return appropriate errors when operations fail. Signed-off-by: Matti Vaittinen Fixes: 5bff79dad20a ("power: supply: Add bd718(15/28/78) charger driver") Tested-by: Kalle Niemi --- drivers/power/supply/bd71828-power.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/bd71828-power.c b/drivers/power/supply/bd= 71828-power.c index a564ad7210be..589e12225cb2 100644 --- a/drivers/power/supply/bd71828-power.c +++ b/drivers/power/supply/bd71828-power.c @@ -456,8 +456,10 @@ static int bd71828_charger_get_property(struct power_s= upply *psy, switch (psp) { case POWER_SUPPLY_PROP_ONLINE: ret =3D get_chg_online(pwr, &online); - if (!ret) - val->intval =3D online; + if (ret) + return ret; + + val->intval =3D online; break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: ret =3D bd7182x_read16_himask(pwr, pwr->regs->vdcin, @@ -1218,7 +1220,9 @@ static int bd71828_power_probe(struct platform_device= *pdev) return dev_err_probe(&pdev->dev, ret, "sense resistor missing\n"); =20 dev_set_drvdata(&pdev->dev, pwr); - bd71828_init_hardware(pwr); + ret =3D bd71828_init_hardware(pwr); + if (ret) + return dev_err_probe(&pdev->dev, ret, "hardware init failed\n"); =20 bat_cfg.drv_data =3D pwr; bat_cfg.fwnode =3D dev_fwnode(&pdev->dev); --=20 2.55.0 --CaP5KfQN4JEx3u+C Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmp5o2kACgkQeFA3/03a ocWkegf/YusS2b56gPOHzH39KEPYRN7NDbriYotkZPFsK7i0B2/rnIjRVuCk+vbN MinJaMD103QjsKeqf8K4U77m/cD1L58DBRLc/12A0Qi29/zEUe6OSuSIdlADRi+g jFvzMhoSGn8kNKcszF43iPO56N7/9VBq8pNyMyxSehSRK0x0ID0JmO3KCEnnqiBE zOfDJCWq6Abh8LFFg9hKCUHSvrqyY3HHY9L7qHkHwks8BRqT1n5rGU/hr82MeYEG Wd/3taohyZHT/s+Z8Ew7jjDkJOgFq0Xv05RHZgdrXjZHKj7ep9Ndso8tHxuGsaPK q7PYyEmqsiiIYCbg2fqwDVe99yx+ag== =a2Co -----END PGP SIGNATURE----- --CaP5KfQN4JEx3u+C-- From nobody Tue Sep 29 09:08:07 2026 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 291023AE706 for ; Mon, 10 Aug 2026 10:10:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356617; cv=none; b=qJVAsTuG4SNe20PttKOrRVaWo0HWhurtimaQpNh/sviY8y6Ae7Jj2hFErAiijNnPTEl5eUlmS7TGMnJ4h+vW8gGBG+OAr7tsf9JbCBDrpbArSQMY6eSTqQRekdYBrqAn9BYSqWwzi6nHrzG7Ipsw7B2wAfvX40gX+LGx4XM48OY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786356617; c=relaxed/simple; bh=ILTbhnV0RE8RxOqIaE3kIzQ4OPPAAIXIWP/eta1gc6s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=j6kCOlwhNWpLQ5aYDGEkymIoULOWoXhlP0D8rVPJIuP60PqYZcpRQ8md8oMlm/DRhJg+isJQV7WJoeG+x66BT6s5y5iHGhH5FU3ghFSTOp1OsxdOMnv/Vdp6tk0/d8aD5Yz16WK+OIYDpc37AJjzeuMkULR+IdD2hOsEI4tRbgk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=mGTGi/dk; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="mGTGi/dk" Date: Mon, 10 Aug 2026 13:10:03 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786356613; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=DobonkKHbQh/ClkaZTujCkwfTDOpOzdUyok3g0FEPkk=; b=mGTGi/dkVMdLFqf7XTJ4YzCoxtr4WzQK3a99VR1goyWhit8hGBGG8dHLxQagLpPiersLh6 DlObVrmdZQxg90ec5kP3N+ZUnrRvbwWWF5wU5H9TgcIj9C8re9dIFHKH6oQzaU5FhEtYuR ZsU2n7u9Kp2mjw0alA8S2oZZUU0GlPM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Andreas Kemnade , Matti Vaittinen , Sebastian Reichel , Andy Shevchenko , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Kalle Niemi , Topi =?iso-8859-1?Q?Sonkaj=E4rvi?= , Mikko Mutanen , Markus Laine Subject: [PATCH 5/5] power: supply: bd99954: Drop bad register fields Message-ID: <758fd430d02286a6f18603a8aecfe443f5ddeb8e.1786356145.git.mazziesaccount@gmail.com> Reply-To: Matti Vaittinen References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FDgWYpcmi0JC+/L6" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --FDgWYpcmi0JC+/L6 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen The bd99954 driver creates regmap fields for all the registers. All the fields for VBUS_UCD_FCTRL_SET (extended command 0x33) are accidentally created for VCC_UCD_FCTRL_SET (extended command 0x2b), causing all reads/writes for the fields to access wrong register. Luckily the fields for VBUS_UCD_FCTRL_SET are unused. Taking a look at the data-sheet: https://fscdn.rohm.com/en/products/databook/datasheet/ic/power/battery_mana= gement/bd99954xxx-e.pdf all the fields in the VBUS_UCD_FCTRL_SET are marked as: "In normal operation, please don=E2=80=99t set these registers" with not mu= ch of additional documentation. As the fields are wrong and because there seems to be no users of the fields - it is better to just drop them. This will also decrease the memory footprint. Drop incorrect VBUS_UCD_FCTRL_SET fields. Signed-off-by: Matti Vaittinen Fixes: 0902f8366491 ("power: supply: Support ROHM bd99954 charger") Tested-by: Kalle Niemi --- drivers/power/supply/bd99954-charger.h | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/power/supply/bd99954-charger.h b/drivers/power/supply/= bd99954-charger.h index f58897925383..d053ac901274 100644 --- a/drivers/power/supply/bd99954-charger.h +++ b/drivers/power/supply/bd99954-charger.h @@ -279,17 +279,7 @@ enum bd9995x_fields { F_VBUS_EXTID, F_VBUS_IDRDET, F_VBUS_INDO, - F_VBUS_UCDSWEN, - F_VBUS_RREF_EN, - F_VBUS_DPPU_EN, - F_VBUS_DPREF_EN, - F_VBUS_DMREF_EN, - F_VBUS_DPDET_EN, - F_VBUS_DMDET_EN, - F_VBUS_DPSINK_EN, - F_VBUS_DMSINK_EN, - F_VBUS_DP_BUFF_EN, - F_VBUS_DM_BUFF_EN, + F_VBUS_EXTCLKENBL, F_VBUS_PLSTESTEN, F_VBUS_UCDSWEN_TSTENB, @@ -626,17 +616,6 @@ static const struct reg_field bd9995x_reg_fields[] =3D= { [F_VBUS_EXTID] =3D REG_FIELD(VBUS_IDD_STATUS, 5, 5), [F_VBUS_IDRDET] =3D REG_FIELD(VBUS_IDD_STATUS, 4, 4), [F_VBUS_INDO] =3D REG_FIELD(VBUS_IDD_STATUS, 0, 3), - [F_VBUS_UCDSWEN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 10, 10), - [F_VBUS_RREF_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 9, 9), - [F_VBUS_DPPU_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 8, 8), - [F_VBUS_DPREF_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 7, 7), - [F_VBUS_DMREF_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 6, 6), - [F_VBUS_DPDET_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 5, 5), - [F_VBUS_DMDET_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 4, 4), - [F_VBUS_DPSINK_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 3, 3), - [F_VBUS_DMSINK_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 2, 2), - [F_VBUS_DP_BUFF_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 1, 1), - [F_VBUS_DM_BUFF_EN] =3D REG_FIELD(VCC_UCD_FCTRL_SET, 0, 0), =20 [F_VBUS_EXTCLKENBL] =3D REG_FIELD(VBUS_UCD_FCTRL_EN, 15, 15), [F_VBUS_PLSTESTEN] =3D REG_FIELD(VBUS_UCD_FCTRL_EN, 14, 14), --=20 2.55.0 --FDgWYpcmi0JC+/L6 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmp5o3sACgkQeFA3/03a ocXGbQgAlA324O1076KdLYBevog+BuxVbn3j+yf0RP1EHdB/nnFXGwFSNjCdzzQR bnYIst7fy6ANwDDpGCK2BxyeLlaiirKnZMQ6ySlRaqF9yOj2X6VfWESu3aWk3L1x C/uKoZjDz7723QEEONPqXOmbavfWkFvar5uJLUKBIBEP5pHg4gL/Xu/b0JgGjEQy VQktU6NA+C+54qsDXjYMCKZfN6+IItjapbforVrYGfjEZdKbYgIc9uCtKt9Z0hbx dcBG8rmAphSUSBITE4HQM/0eU4bymeol/FgyofFZu/0CbCQe/sXW4a2q/1psRP/q b4LqsFDkvQUNZlvob++QlokOxAle2w== =+w25 -----END PGP SIGNATURE----- --FDgWYpcmi0JC+/L6--