From: Hans de Goede <hdegoede@redhat.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
"Sebastian Reichel" <sre@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: Re: [PATCH 2/4] power: supply: test-power: implement charge_behaviour property
Date: Mon, 5 Feb 2024 10:59:00 +0100 [thread overview]
Message-ID: <47253c5e-4ec3-4794-9cd3-c7aeb95fb5c7@redhat.com> (raw)
In-Reply-To: <20240204-power_supply-charge_behaviour_prop-v1-2-06a20c958f96@weissschuh.net>
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@weissschuh.net>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.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[] = {
>
next prev parent reply other threads:[~2024-02-05 9:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 17:26 [PATCH 0/4] power: supply: core: align charge_behaviour format with docs Thomas Weißschuh
2024-02-04 17:26 ` [PATCH 1/4] power: supply: core: fix charge_behaviour formatting Thomas Weißschuh
2024-02-05 9:52 ` Hans de Goede
2024-02-05 11:43 ` Hans de Goede
2024-02-19 23:19 ` Sebastian Reichel
2024-02-04 17:26 ` [PATCH 2/4] power: supply: test-power: implement charge_behaviour property Thomas Weißschuh
2024-02-05 9:59 ` Hans de Goede [this message]
2024-02-04 17:26 ` [PATCH 3/4] power: supply: mm8013: implement POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE Thomas Weißschuh
2024-02-05 10:00 ` Hans de Goede
2024-02-05 11:21 ` Thomas Weißschuh
2024-02-12 13:22 ` Konrad Dybcio
2024-02-05 11:41 ` Konrad Dybcio
2024-02-04 17:26 ` [PATCH 4/4] power: supply: core: drop workaround for missing POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE Thomas Weißschuh
2024-02-05 9:58 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47253c5e-4ec3-4794-9cd3-c7aeb95fb5c7@redhat.com \
--to=hdegoede@redhat.com \
--cc=konradybcio@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®