[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44bjrq3o4mq76a7awcl3wx2gqlyxjgtse4h37kgtgz764lwang@nsmo3xvljznx>
Date: Mon, 7 Jul 2025 01:13:01 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Armin Wolf <W_Armin@....de>
Cc: hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com,
linux-pm@...r.kernel.org, platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] power: supply: test-power: Test access to extended
power supply
Hi,
On Fri, Jun 27, 2025 at 10:51:23PM +0200, Armin Wolf wrote:
> Test that power supply extensions can access properties of their
> power supply using power_supply_get_property_direct(). This both
> ensures that the functionality works and serves as an example for
> future driver developers.
>
> Signed-off-by: Armin Wolf <W_Armin@....de>
> ---
Acked-by: Sebastian Reichel <sebastian.reichel@...labora.com>
-- Sebastian
> drivers/power/supply/test_power.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/power/supply/test_power.c b/drivers/power/supply/test_power.c
> index 5bfdfcf6013b..2c0e9ad820c0 100644
> --- a/drivers/power/supply/test_power.c
> +++ b/drivers/power/supply/test_power.c
> @@ -259,6 +259,7 @@ static const struct power_supply_config test_power_configs[] = {
> static int test_power_battery_extmanufacture_year = 1234;
> static int test_power_battery_exttemp_max = 1000;
> static const enum power_supply_property test_power_battery_extprops[] = {
> + POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
> POWER_SUPPLY_PROP_MANUFACTURE_YEAR,
> POWER_SUPPLY_PROP_TEMP_MAX,
> };
> @@ -270,6 +271,9 @@ static int test_power_battery_extget_property(struct power_supply *psy,
> union power_supply_propval *val)
> {
> switch (psp) {
> + case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
> + return power_supply_get_property_direct(psy, POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
> + val);
> case POWER_SUPPLY_PROP_MANUFACTURE_YEAR:
> val->intval = test_power_battery_extmanufacture_year;
> break;
> --
> 2.39.5
>
>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists