platform/x86/intel: bytcrc_pwrsrc: Optionally register a power_supply dev
authorHans de Goede <hdegoede@redhat.com>
Wed, 4 Dec 2024 19:34:41 +0000 (20:34 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Dec 2024 13:29:37 +0000 (15:29 +0200)
commit0130ec83c5535b034a96284eb9f31b3b5373d207
tree53f044a84160f92284dc94aea50bb105750620a9
parentc0f1bfc141ea52ea039bd17537b46b705ff8a93d
platform/x86/intel: bytcrc_pwrsrc: Optionally register a power_supply dev

On some Android tablets with Crystal Cove PMIC the DSDT lacks an ACPI AC
device to indicate whether a charger is plugged in or not.

Add support for registering a "crystal_cove_pwrsrc" power_supply class
device to indicate charger online status. This is made conditional on
a "linux,register-pwrsrc-power_supply" boolean device-property to avoid
registering a duplicate power_supply class device on devices where this
is already handled by an ACPI AC device.

Note the "linux,register-pwrsrc-power_supply" property is only used on
x86/ACPI (non devicetree) devs and the devicetree-bindings maintainers
have requested properties like these to not be added to the devicetree
bindings, so the new property is deliberately not added to any bindings.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241204193442.65374-2-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/bytcrc_pwrsrc.c