Re: [PATCH 2/5] ARM: dts: add battery phandle to cpcap_charger
From: Sebastian Reichel <sre@kernel.org>
Date: 2021-03-24 23:36:22
Also in:
linux-omap
Attachments
- signature.asc [application/pgp-signature] 833 bytes
From: Sebastian Reichel <sre@kernel.org>
Date: 2021-03-24 23:36:22
Also in:
linux-omap
Hi, On Wed, Mar 24, 2021 at 05:08:58PM +0100, carl@uvos.xyz wrote:
quoted
I think the patch is also wrong, since the information is already described in DT - just the other way around: The battery references the charger. This provides all required information to the kernel for a 1:1 link.I added this so that cpcap_charger may become aware of the battery insertion state by querying the battery driver.
Would you thus recommend that instead of adding this phandle i should amend the series such that cpcap_charger walks the tree looking for a cpcap_battery compatible node and then determines if the charger phandle points to itself? Is there some recommended way performing this reverse search?
I was thinking of creating a new core function to loop over all supplied batteries of a power_supply (using psy->supplied_from), but in this specific case it might be enough to just use power_supply_get_by_name(). As I said, I have not yet properly reviewed the full patchset. -- Sebastian