All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Seibold <mail@bernhard-seibold.de>
To: linux-input@vger.kernel.org
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Jamie Lentin <jm@lentin.co.uk>,
	Bernhard Seibold <mail@bernhard-seibold.de>
Subject: [PATCH 3/3] HID: lenovo: Remove LEDs from tpkbd
Date: Thu,  4 Jan 2024 16:49:41 +0100	[thread overview]
Message-ID: <20240104154941.6919-3-mail@bernhard-seibold.de> (raw)
In-Reply-To: <20240104154941.6919-1-mail@bernhard-seibold.de>

Since both LEDs are now supported by the input-leds module, the custom
LEDs set via a proprietary method are no longer required. In fact they
are duplicates that might interfere with each other.

Signed-off-by: Bernhard Seibold <mail@bernhard-seibold.de>
---
 drivers/hid/hid-lenovo.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 149a3c74346b..e3eae18fd4ab 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -1004,17 +1004,6 @@ static const struct attribute_group lenovo_attr_group_tpkbd = {
 	.attrs = lenovo_attributes_tpkbd,
 };
 
-static void lenovo_led_set_tpkbd(struct hid_device *hdev)
-{
-	struct lenovo_drvdata *data_pointer = hid_get_drvdata(hdev);
-	struct hid_report *report;
-
-	report = hdev->report_enum[HID_OUTPUT_REPORT].report_id_hash[3];
-	report->field[0]->value[0] = (data_pointer->led_state >> 0) & 1;
-	report->field[0]->value[1] = (data_pointer->led_state >> 1) & 1;
-	hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
-}
-
 static int lenovo_led_brightness_set(struct led_classdev *led_cdev,
 			enum led_brightness value)
 {
@@ -1034,9 +1023,6 @@ static int lenovo_led_brightness_set(struct led_classdev *led_cdev,
 		data_pointer->led_state |= 1 << led_nr;
 
 	switch (hdev->product) {
-	case USB_DEVICE_ID_LENOVO_TPKBD:
-		lenovo_led_set_tpkbd(hdev);
-		break;
 	case USB_DEVICE_ID_LENOVO_TP10UBKBD:
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
 		ret = lenovo_led_set_tp10ubkbd(hdev, tp10ubkbd_led[led_nr], value);
@@ -1128,10 +1114,6 @@ static int lenovo_probe_tpkbd(struct hid_device *hdev)
 
 	hid_set_drvdata(hdev, data_pointer);
 
-	ret = lenovo_register_leds(hdev);
-	if (ret)
-		goto err;
-
 	lenovo_features_set_tpkbd(hdev);
 
 	return 0;
@@ -1315,9 +1297,6 @@ static void lenovo_remove_tpkbd(struct hid_device *hdev)
 
 	sysfs_remove_group(&hdev->dev.kobj,
 			&lenovo_attr_group_tpkbd);
-
-	led_classdev_unregister(&data_pointer->led_micmute);
-	led_classdev_unregister(&data_pointer->led_mute);
 }
 
 static void lenovo_remove_cptkbd(struct hid_device *hdev)
-- 
2.43.0


  parent reply	other threads:[~2024-01-04 15:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 15:49 [PATCH 1/3] HID: input - Add microphone mute LED support Bernhard Seibold
2024-01-04 15:49 ` [PATCH 2/3] Input: leds - add micmute and triggers Bernhard Seibold
2024-01-04 15:49 ` Bernhard Seibold [this message]
2024-01-04 17:55 ` [PATCH 1/3] HID: input - Add microphone mute LED support Dmitry Torokhov
2024-01-04 18:46   ` Bernhard Seibold
2024-01-04 18:56     ` Dmitry Torokhov
2024-01-13 10:37   ` [PATCH v2 1/2] Input: leds - set default-trigger for mute Bernhard Seibold
2024-01-13 10:37     ` [PATCH v2 2/2] HID: input: add support for micmute LED Bernhard Seibold

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=20240104154941.6919-3-mail@bernhard-seibold.de \
    --to=mail@bernhard-seibold.de \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jm@lentin.co.uk \
    --cc=linux-input@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.