From: Bastien Nocera <hadess@hadess.net>
To: Christian Mayer <git@mayer-bgk.de>, linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH v2 4/5] HID: steelseries: export model and manufacturer
Date: Mon, 13 Jan 2025 14:42:33 +0100 [thread overview]
Message-ID: <8ad74c1736444f06cafb0e185abcbd9897b2905c.camel@hadess.net> (raw)
In-Reply-To: <20250112114438.2196-5-git@mayer-bgk.de>
On Sun, 2025-01-12 at 11:44 +0000, Christian Mayer wrote:
> Export model and manufacturer with the power supply properties.
> This helps identifing the device in the battery overview.
> In the case of the Arctis 9 headset, the manufacturer is prefixed
> twice in
> the device name.
>
> Signed-off-by: Christian Mayer <git@mayer-bgk.de>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Tested-by: Bastien Nocera <hadess@hadess.net>
> ---
> drivers/hid/hid-steelseries.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/hid/hid-steelseries.c b/drivers/hid/hid-
> steelseries.c
> index 2ee1a6f01852..1a935802880a 100644
> --- a/drivers/hid/hid-steelseries.c
> +++ b/drivers/hid/hid-steelseries.c
> @@ -439,6 +439,9 @@ static void
> steelseries_headset_battery_timer_tick(struct work_struct *work)
> steelseries_headset_fetch_battery(hdev);
> }
>
> +#define STEELSERIES_PREFIX "SteelSeries "
> +#define STEELSERIES_PREFIX_LEN strlen(STEELSERIES_PREFIX)
> +
> static int steelseries_headset_battery_get_property(struct
> power_supply *psy,
> enum power_supply_property psp,
> union power_supply_propval *val)
> @@ -447,6 +450,14 @@ static int
> steelseries_headset_battery_get_property(struct power_supply *psy,
> int ret = 0;
>
> switch (psp) {
> + case POWER_SUPPLY_PROP_MODEL_NAME:
> + val->strval = sd->hdev->name;
> + while (!strncmp(val->strval, STEELSERIES_PREFIX,
> STEELSERIES_PREFIX_LEN))
> + val->strval += STEELSERIES_PREFIX_LEN;
> + break;
> + case POWER_SUPPLY_PROP_MANUFACTURER:
> + val->strval = "SteelSeries";
> + break;
> case POWER_SUPPLY_PROP_PRESENT:
> val->intval = 1;
> break;
> @@ -490,6 +501,8 @@ steelseries_headset_set_wireless_status(struct
> hid_device *hdev,
> }
>
> static enum power_supply_property
> steelseries_headset_battery_props[] = {
> + POWER_SUPPLY_PROP_MODEL_NAME,
> + POWER_SUPPLY_PROP_MANUFACTURER,
> POWER_SUPPLY_PROP_PRESENT,
> POWER_SUPPLY_PROP_STATUS,
> POWER_SUPPLY_PROP_SCOPE,
next prev parent reply other threads:[~2025-01-13 13:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-12 11:44 [PATCH v2 0/5] HID: steelseries: add SteelSeries Arctis 9 support Christian Mayer
2025-01-12 11:44 ` [PATCH v2 1/5] HID: steelseries: preparation for adding " Christian Mayer
2025-01-12 12:02 ` Christophe JAILLET
2025-01-13 13:42 ` Bastien Nocera
2025-01-15 17:20 ` Christian Mayer
2025-01-16 17:38 ` Christophe JAILLET
2025-01-12 11:44 ` [PATCH v2 2/5] HID: steelseries: add " Christian Mayer
2025-01-13 13:42 ` Bastien Nocera
2025-01-12 11:44 ` [PATCH v2 3/5] HID: steelseries: export charging state for the SteelSeries Arctis 9 headset Christian Mayer
2025-01-13 13:42 ` Bastien Nocera
2025-01-12 11:44 ` [PATCH v2 4/5] HID: steelseries: export model and manufacturer Christian Mayer
2025-01-13 13:42 ` Bastien Nocera [this message]
2025-01-12 11:44 ` [PATCH v2 5/5] HID: steelseries: remove unnecessary return Christian Mayer
2025-01-13 13:42 ` Bastien Nocera
2025-01-16 10:04 ` [PATCH v2 0/5] HID: steelseries: add SteelSeries Arctis 9 support Jiri Kosina
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=8ad74c1736444f06cafb0e185abcbd9897b2905c.camel@hadess.net \
--to=hadess@hadess.net \
--cc=benjamin.tissoires@redhat.com \
--cc=git@mayer-bgk.de \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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®