From: Christian Mayer <git@mayer-bgk.de>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Bastien Nocera <hadess@hadess.net>,
Christian Mayer <git@mayer-bgk.de>
Subject: [PATCH 3/3] HID: steelseries: export model and manufacturer
Date: Wed, 1 Jan 2025 15:11:34 +0000 [thread overview]
Message-ID: <20250101151209.100072-4-git@mayer-bgk.de> (raw)
In-Reply-To: <20250101151209.100072-1-git@mayer-bgk.de>
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>
---
drivers/hid/hid-steelseries.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/hid/hid-steelseries.c b/drivers/hid/hid-steelseries.c
index d11296bc0e1e..32e559376be4 100644
--- a/drivers/hid/hid-steelseries.c
+++ b/drivers/hid/hid-steelseries.c
@@ -447,6 +447,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 ", 12))
+ val->strval += 12;
+ break;
+ case POWER_SUPPLY_PROP_MANUFACTURER:
+ val->strval = "SteelSeries";
+ break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = 1;
break;
@@ -490,6 +498,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,
--
2.47.1
next prev parent reply other threads:[~2025-01-01 15:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-01 15:11 [PATCH 0/3] HID: steelseries: add SteelSeries Arctis 9 support Christian Mayer
2025-01-01 15:11 ` [PATCH 1/3] " Christian Mayer
2025-01-04 11:58 ` Bastien Nocera
2025-01-05 10:16 ` Christian Mayer
2025-01-09 13:35 ` Bastien Nocera
2025-01-12 11:49 ` Christian Mayer
2025-01-04 12:45 ` Christophe JAILLET
2025-01-05 10:33 ` Christian Mayer
2025-01-01 15:11 ` [PATCH 2/3] HID: steelseries: export charging state for the SteelSeries Arctis 9 headset Christian Mayer
2025-01-04 12:02 ` Bastien Nocera
2025-01-01 15:11 ` Christian Mayer [this message]
2025-01-04 12:01 ` [PATCH 3/3] HID: steelseries: export model and manufacturer Bastien Nocera
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=20250101151209.100072-4-git@mayer-bgk.de \
--to=git@mayer-bgk.de \
--cc=benjamin.tissoires@redhat.com \
--cc=hadess@hadess.net \
--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;
as well as URLs for NNTP newsgroup(s).