[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47253c5e-4ec3-4794-9cd3-c7aeb95fb5c7@redhat.com>
Date: Mon, 5 Feb 2024 10:59:00 +0100
From: Hans de Goede <hdegoede@...hat.com>
To: Thomas Weißschuh <linux@...ssschuh.net>,
Sebastian Reichel <sre@...nel.org>, Konrad Dybcio <konradybcio@...nel.org>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Sebastian Reichel <sebastian.reichel@...labora.com>
Subject: Re: [PATCH 2/4] power: supply: test-power: implement charge_behaviour
property
Hi,
On 2/4/24 18:26, Thomas Weißschuh wrote:
> To validate the special formatting of the "charge_behaviour" sysfs
> property add it to the example driver.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@...hat.com>
Regards,
Hans
> ---
> drivers/power/supply/test_power.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/power/supply/test_power.c b/drivers/power/supply/test_power.c
> index 0d0a77584c5d..4da0420996c9 100644
> --- a/drivers/power/supply/test_power.c
> +++ b/drivers/power/supply/test_power.c
> @@ -123,6 +123,14 @@ static int test_power_get_battery_property(struct power_supply *psy,
> case POWER_SUPPLY_PROP_CURRENT_NOW:
> val->intval = battery_current;
> break;
> + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR:
> + val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE;
> + break;
> + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE:
> + val->intval = BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO)
> + | BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE)
> + | BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE);
> + break;
> default:
> pr_info("%s: some properties deliberately report errors.\n",
> __func__);
> @@ -156,6 +164,8 @@ static enum power_supply_property test_power_battery_props[] = {
> POWER_SUPPLY_PROP_VOLTAGE_NOW,
> POWER_SUPPLY_PROP_CURRENT_AVG,
> POWER_SUPPLY_PROP_CURRENT_NOW,
> + POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR,
> + POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE,
> };
>
> static char *test_power_ac_supplied_to[] = {
>
Powered by blists - more mailing lists