From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.11 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796495836; b=IcCdHYTUO7itUoyhR/eu8ZbY3B679x0MOADfZT/njrP/QS5OUEmIrJH1bZU+EFJh4LM5 2uskznSkcyPxFDkP3/NmgRunR5wRckh5Sx+7+0ctGil9eoe62bFUG5NxzTDhN7F+71+dJ FCNlyGY5YokUJCVoVPYCfmGrhReTX50OFOpaAnMq4VTKm55QrXOR1EzEkxBo4DNOKAKr2 K8egQroL/odfb1WY9f/8N6eXKHEAf/X4FAV6hnJpaK7kKRGak1e6WgWmYLAiHhmQ1IJ2x m4LNz7/CbP7p3KW04aQLYu3nZn6TRK4SqP7g5QU6p8KTHEIzr29Oo3906wO/cau4cxg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796495836; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Zoho-Virus-Status:X-Zoho-AV-Stamp: X-ZohoMailClient; bh=46nYKwaEHR+cCCGXXhSeA2Pka8CBY0y40WalnKL9M7s=; b=xPIDlypQ1N8D+729xZkxEJtYCashAJmvmq2YQOyKkhQFr1num8hJjZ3QNastrAxtIJqX tPZk9aaMmMSOt09ogYJdCcgpdHzQhKbv9+pJKyhPodr/oiemC1aETZPeTwuGN1ALwQKzh 7ZnddwdtfJCI3I0r3ELMNxfaSGiPqN+Q61mM0OOJHvz7+FJzCNvVG6U3uj0qX9z8gl/MD YsI+2bilS8wXYf2HwTjJaI65UJQTqbwfZVGl4ObfOi5+Nx5LVwZ7X+vw5z+HE71Ep96m8 MU0zzvVwYmciwrLHZIRduCWtUzNMNDtpAZdqtDIZjo0YorE9uD9xa+vTLgHLcTKouSA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=H63LRHv+; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.11 Received: from sender5-op-o11.zoho.com (sender5-op-o11.zoho.com [165.173.182.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2134A606A31F; Sat, 5 Dec 2026 18:37:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2134A606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=H63LRHv+ ARC-Seal: i=1; a=rsa-sha256; t=1796495832; cv=none; d=zohomail.com; s=zohoarc; b=lPjmMI5THe2kokkx+FXmQ+EDyFgANfr2Ms4CU6MY0GElI7OF+D1r14I8wUkFwphAzxXe2QZqPBzBdoQB3p4Tmrp/HFWSOcQmw6k4paywaCyY0mETdhFk6ZFmprYcSKaP1R3g8Eeo0NWvtsrYRvPVW9oa7wBSwE9nm9Oki9hswok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796495832; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=46nYKwaEHR+cCCGXXhSeA2Pka8CBY0y40WalnKL9M7s=; b=ax1WwE0bhhyk/CzSrz3kigOVnQq32gY/3yM29HbcpT02Ro6Vgab5BCFKSO9E02fUVIb48a8EgpUG3yKLMXdeQ7Sr+x+9onHZWWOK9J4FacV0Efdq0uG986GJnju5JDq3VQld2rZVzRfZuBk/KuSVG7uouib6I2t5gCTmxPfhUFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=sebastian.reichel@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=H63LRHv+eOoFY+R9dAx4POKIRkkRuLzzV7Olf6jODa73FWH+l6jhwyJvJOxZDzkgR09H901vAPLFKaj6Vkw+Sei4XTmfCdIfwjoCvIohOuSAXDZhTLSIiAyt7nDEJ+R3iHe0ysNTMLag3/DhOMbQ7lgh+oNwryRYWQZEDExN9yI=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=46nYKwaEHR+cCCGXXhSeA2Pka8CBY0y40WalnKL9M7s=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796495830214609.9670194744411; Sat, 5 Dec 2026 10:37:10 -0800 (PST) Received: by venus (Postfix, from userid 1000) id B19C218205E; Sat, 05 Dec 2026 19:37:05 +0100 (CET) Date: Sat, 5 Dec 2026 19:37:05 +0100 From: Sebastian Reichel To: Prachoday Sutar Cc: Andrew Davis , robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, pali@kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 0/2] Add TI BQ27Z558 fuel gauge support Message-ID: References: <20261126201959.28743-1-prachodaysutar7@gmail.com> <314807f4-dedf-496a-b4e0-d034ac97ade3@ti.com> X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4legyupaenerhhfn" Content-Disposition: inline In-Reply-To: X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-0.2.28.1.5.5/296.487.71 X-ZohoMailClient: External --4legyupaenerhhfn Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2 0/2] Add TI BQ27Z558 fuel gauge support MIME-Version: 1.0 Hi, On Sun, Nov 29, 2026 at 07:55:18PM +0530, Prachoday Sutar wrote: > On Fri, Nov 27, 2026, Andrew Davis wrote: > > I thought you said you tested this with the fallback? And Sashiko > > says fallback will cause a NULL dereference, one of these must not > > be true then.. >=20 > You're right, the test note was wrong, sorry about that. The testing > was done on a vendor 4.9 kernel with a local backport of BQ27Z561 > support, and the board DT used only "ti,bq27z558", not the fallback. > In that tree "bq27z558" was in both the I2C ID table and the OF match > table, so the I2C ID lookup succeeded and the fallback-only path that > Sashiko flagged was never exercised. So that test only shows that the > BQ27Z558 works with the BQ27Z561 register map and status bits; it did > not run the mainline driver. I'll describe the testing accurately in > v3. > > > First, the `bq27xxx_battery_i2c_of_match_table` and the > > `bq27xxx_i2c_id_table` are out of sync, so we match with OF > > compatible, but use the I2C ID table to get the mach data. > > The OF match data is currently empty, that needs updated. >=20 > Agreed. In v3 I'll add the chip type as .data to every entry in the > OF match table, so the two tables no longer need to be kept in sync > by hand. >=20 > > Second, `i2c_client_get_device_id()` is only used as we need to > > fetch the name, but we only use the name in `request_threaded_irq()`, > > and we could use `client->name` instead. Then for getting the match > > data use `i2c_get_match_data()`. >=20 > Will do. For all existing compatibles client->name is the same as the > matched I2C ID name, so the battery names seen by userspace don't > change. >=20 > > Third, I'd just skip the fallback stuff. If you have to modify the > > driver anyway, just add a normal compatible and use it in your DT. >=20 > OK, I'll drop the fallback and add "ti,bq27z558" as a plain > compatible, which also matches how it was set up in the tree I tested. The fallback is the correct thing to do. The binding is not just for the Linux driver and the only reason the Linux driver needs the specific entry is the exact chip name. > One question first: once the OF match data is in place, the > fallback would work without any BQ27Z558-specific driver change. > If the DT binding maintainers would prefer to keep the fallback > for that reason, I'm happy to do that instead. Otherwise I'll go > with the plain compatible. > >=20 > Planned v3: > 1/3 dt-bindings: power: supply: bq27xxx: Add BQ27Z558 > 2/3 power: supply: bq27xxx: Use i2c_get_match_data() > 3/3 power: supply: bq27xxx: Add BQ27Z558 support >=20 > Thanks, > Prachoday Greetings, -- Sebastian --4legyupaenerhhfn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmsUWc4ACgkQ2O7X88g7 +poHrQ/8CKWck4BQQboUB1LU/Xk5PacLdYy9zMumJQM9ZsSVx3ZwjmPBccSo6tPh aVYM3dorkg9J5/srOxzdGeuMXKldrTmU4zhbrDq/AC22EA9flotSIPTRrJN3C6ad a0ZEayTIR46qYWNKGdvEDmNLw3VrU4P6AnXo4Hq7sGr8i2CkpqJRg/ZJjxl6cfHf K0/6AJFvQkuKmeEHRQ37igEZtuzO0ZeixC7uNymfZ5O0cCMdLcRSRVSCzYrgPqHG JBOhb/vPFZwxh5G7+7BAndkGlwDnxDSG+mdwMnaiXgd/vc2BimVDq6FTcHMRi3FX 0HPRABtNJFqXkXQUxUbsrGRjooerTEvWg3wDOIkAFuzi4fcNw0sGtepAJGKFm2hs yWGhbTyrjJF6jaUrJNkoIr7qVhmyOLgM0X9id44LKLaXvE3hSUAcPR4Fws55LRpa E8YjZtgNgszZm+WzH7rPJYJZGspB9wOwC4vit17dRMJyvcMqc8eEmpBEQXtFFTwS vLfd/mUSwAaETBxTCIBtyJ1oFCpqS/MJ5kIvx4jqX/lkLVyBmxWs6hwP4q9k3S5O PLhgymlt6JwGkgM3IEFQTgPh/R80zbJGOWKk6galZtFwxbt15RFxtmA/fYjVMZbw O8csnHStAkaP9YgJLSA679zvC1792GsXZy2zq+L96DwmXsi/Gos= =HL9B -----END PGP SIGNATURE----- --4legyupaenerhhfn--