* [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness
@ 2024-05-29 1:28 Luke D. Jones
2024-05-29 1:28 ` [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard Luke D. Jones
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Luke D. Jones @ 2024-05-29 1:28 UTC (permalink / raw)
To: jikos
Cc: hdegoede, ilpo.jarvinen, corentin.chary, platform-driver-x86,
linux-kernel, linux-input, bentiss, Luke D. Jones
Changelog:
- v1
- Split the patch in two
- Move function body to asus-wmi and export
- Use array of names and for loops
History:
- https://lore.kernel.org/linux-input/20240528013959.14661-1-luke@ljones.dev/T/#u
Luke D. Jones (2):
hid-asus: use hid for brightness control on keyboard
hid-asus: change the report_id used for HID LED control
drivers/hid/hid-asus.c | 32 +++++++++++++++++++-
drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
3 files changed, 75 insertions(+), 2 deletions(-)
--
2.45.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard
2024-05-29 1:28 [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Luke D. Jones
@ 2024-05-29 1:28 ` Luke D. Jones
2024-05-29 8:21 ` Hans de Goede
2024-05-29 1:28 ` [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control Luke D. Jones
2024-05-29 15:28 ` [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Hans de Goede
2 siblings, 1 reply; 10+ messages in thread
From: Luke D. Jones @ 2024-05-29 1:28 UTC (permalink / raw)
To: jikos
Cc: hdegoede, ilpo.jarvinen, corentin.chary, platform-driver-x86,
linux-kernel, linux-input, bentiss, Luke D. Jones
On almost all ASUS ROG series laptops the MCU used for the USB keyboard
also has a HID packet used for setting the brightness. This is usually
the same as the WMI method. But in some laptops the WMI method either
is missing or doesn't work, so we should default to the HID control.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 6 ++++
drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
3 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 02de2bf4f790..4cba8e143031 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -492,12 +492,18 @@ static void asus_kbd_backlight_work(struct work_struct *work)
*/
static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
{
+ struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
u32 value;
int ret;
if (!IS_ENABLED(CONFIG_ASUS_WMI))
return false;
+ if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && asus_use_hid_led()) {
+ hid_info(hdev, "using HID for asus::kbd_backlight\n");
+ return false;
+ }
+
ret = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS,
ASUS_WMI_DEVID_KBD_BACKLIGHT, 0, &value);
hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value);
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 3f9b6285c9a6..54cb07c79fcf 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -144,6 +144,15 @@ module_param(fnlock_default, bool, 0444);
static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
+static const char * const use_hid_led_matches[] = {
+ "ROG Zephyrus",
+ "ROG Strix",
+ "ROG Flow",
+ "GA403",
+ "GU605",
+ "RC71L",
+};
+
static int throttle_thermal_policy_write(struct asus_wmi *);
static bool ashs_present(void)
@@ -1642,6 +1651,29 @@ static int micmute_led_set(struct led_classdev *led_cdev,
return err < 0 ? err : 0;
}
+bool asus_use_hid_led(void)
+{
+ const char *product, *board;
+ int i;
+
+ product = dmi_get_system_info(DMI_PRODUCT_FAMILY);
+ if (!product)
+ return false;
+
+ board = dmi_get_system_info(DMI_BOARD_NAME);
+ if (!board)
+ return false;
+
+ for (i = 0; i < ARRAY_SIZE(use_hid_led_matches); i++) {
+ if (strstr(product, use_hid_led_matches[i]))
+ return true;
+ if (strstr(board, use_hid_led_matches[i]))
+ return true;
+ }
+ return false;
+}
+EXPORT_SYMBOL_GPL(asus_use_hid_led);
+
static void asus_wmi_led_exit(struct asus_wmi *asus)
{
led_classdev_unregister(&asus->kbd_led);
@@ -1681,7 +1713,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
goto error;
}
- if (!kbd_led_read(asus, &led_val, NULL)) {
+ if (!kbd_led_read(asus, &led_val, NULL) && !asus_use_hid_led()) {
+ pr_info("using asus-wmi for asus::kbd_backlight\n");
asus->kbd_led_wk = led_val;
asus->kbd_led.name = "asus::kbd_backlight";
asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 3eb5cd6773ad..6833035f7006 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -160,4 +160,14 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
}
#endif
+/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */
+#if IS_ENABLED(CONFIG_ASUS_WMI)
+bool asus_use_hid_led(void);
+#else
+static inline bool asus_use_hid_led(void)
+{
+ return true;
+}
+#endif
+
#endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */
--
2.45.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control
2024-05-29 1:28 [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Luke D. Jones
2024-05-29 1:28 ` [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard Luke D. Jones
@ 2024-05-29 1:28 ` Luke D. Jones
2024-05-29 8:25 ` Hans de Goede
2024-05-29 15:28 ` [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Hans de Goede
2 siblings, 1 reply; 10+ messages in thread
From: Luke D. Jones @ 2024-05-29 1:28 UTC (permalink / raw)
To: jikos
Cc: hdegoede, ilpo.jarvinen, corentin.chary, platform-driver-x86,
linux-kernel, linux-input, bentiss, Luke D. Jones
On some laptops the report_id used for LED brightness control must be
0x5D instead of 0x5A.
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
drivers/hid/hid-asus.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 4cba8e143031..ec3556cc4eef 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -94,6 +94,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
#define TRKID_SGN ((TRKID_MAX + 1) >> 1)
+static const char * const use_alt_led_report_id[] = { "GU605", "GA403" };
+
struct asus_kbd_leds {
struct led_classdev cdev;
struct hid_device *hdev;
@@ -101,6 +103,7 @@ struct asus_kbd_leds {
unsigned int brightness;
spinlock_t lock;
bool removed;
+ int report_id;
};
struct asus_touchpad_info {
@@ -473,7 +476,7 @@ static enum led_brightness asus_kbd_backlight_get(struct led_classdev *led_cdev)
static void asus_kbd_backlight_work(struct work_struct *work)
{
struct asus_kbd_leds *led = container_of(work, struct asus_kbd_leds, work);
- u8 buf[] = { FEATURE_KBD_REPORT_ID, 0xba, 0xc5, 0xc4, 0x00 };
+ u8 buf[] = { led->report_id, 0xba, 0xc5, 0xc4, 0x00 };
int ret;
unsigned long flags;
@@ -513,6 +516,23 @@ static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
return !!(value & ASUS_WMI_DSTS_PRESENCE_BIT);
}
+static bool asus_kbd_is_input_led(void)
+{
+ const char *product;
+ int i;
+
+ product = dmi_get_system_info(DMI_PRODUCT_NAME);
+ if (!product)
+ return false;
+
+ for (i = 0; i < ARRAY_SIZE(use_alt_led_report_id); i++) {
+ if (strstr(product, use_alt_led_report_id[i]))
+ return true;
+ }
+
+ return false;
+}
+
static int asus_kbd_register_leds(struct hid_device *hdev)
{
struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
@@ -555,6 +575,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
if (!drvdata->kbd_backlight)
return -ENOMEM;
+ drvdata->kbd_backlight->report_id = FEATURE_KBD_REPORT_ID;
+ if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && asus_kbd_is_input_led())
+ drvdata->kbd_backlight->report_id = FEATURE_KBD_LED_REPORT_ID1;
+
drvdata->kbd_backlight->removed = false;
drvdata->kbd_backlight->brightness = 0;
drvdata->kbd_backlight->hdev = hdev;
--
2.45.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard
2024-05-29 1:28 ` [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard Luke D. Jones
@ 2024-05-29 8:21 ` Hans de Goede
0 siblings, 0 replies; 10+ messages in thread
From: Hans de Goede @ 2024-05-29 8:21 UTC (permalink / raw)
To: Luke D. Jones, jikos
Cc: ilpo.jarvinen, corentin.chary, platform-driver-x86, linux-kernel,
linux-input, bentiss
Hi Luke,
Thank you for the new version, much better.
On 5/29/24 3:28 AM, Luke D. Jones wrote:
> On almost all ASUS ROG series laptops the MCU used for the USB keyboard
> also has a HID packet used for setting the brightness. This is usually
> the same as the WMI method. But in some laptops the WMI method either
> is missing or doesn't work, so we should default to the HID control.
>
> Signed-off-by: Luke D. Jones <luke@ljones.dev>
> ---
> drivers/hid/hid-asus.c | 6 ++++
> drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
> include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
> 3 files changed, 50 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 02de2bf4f790..4cba8e143031 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -492,12 +492,18 @@ static void asus_kbd_backlight_work(struct work_struct *work)
> */
> static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
> {
> + struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
> u32 value;
> int ret;
>
> if (!IS_ENABLED(CONFIG_ASUS_WMI))
> return false;
>
> + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && asus_use_hid_led()) {
> + hid_info(hdev, "using HID for asus::kbd_backlight\n");
> + return false;
> + }
> +
> ret = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS,
> ASUS_WMI_DEVID_KBD_BACKLIGHT, 0, &value);
> hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value);
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 3f9b6285c9a6..54cb07c79fcf 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -144,6 +144,15 @@ module_param(fnlock_default, bool, 0444);
>
> static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
>
> +static const char * const use_hid_led_matches[] = {
> + "ROG Zephyrus",
> + "ROG Strix",
> + "ROG Flow",
> + "GA403",
> + "GU605",
> + "RC71L",
> +};
> +
> static int throttle_thermal_policy_write(struct asus_wmi *);
>
> static bool ashs_present(void)
> @@ -1642,6 +1651,29 @@ static int micmute_led_set(struct led_classdev *led_cdev,
> return err < 0 ? err : 0;
> }
>
> +bool asus_use_hid_led(void)
> +{
> + const char *product, *board;
> + int i;
> +
> + product = dmi_get_system_info(DMI_PRODUCT_FAMILY);
> + if (!product)
> + return false;
> +
> + board = dmi_get_system_info(DMI_BOARD_NAME);
> + if (!board)
> + return false;
> +
> + for (i = 0; i < ARRAY_SIZE(use_hid_led_matches); i++) {
> + if (strstr(product, use_hid_led_matches[i]))
> + return true;
> + if (strstr(board, use_hid_led_matches[i]))
> + return true;
> + }
> + return false;
> +}
> +EXPORT_SYMBOL_GPL(asus_use_hid_led);
> +
With the new helper in this form you are pretty much re-inventing
dmi_check_system().
So IMHO you should just replace use_hid_led_matches[] with
a dmi_system_id array and simplify asus_use_hid_led() to just
a single "dmi_check_system(asus_use_hid_led_dmi_ids)" call.
Using dmi_system_id-s also allows you to specify if the string
which is being matched should be matched against DMI_PRODUCT_FAMILY
or DMI_BOARD_NAME. Note the normal DMI_MATCH() macro to fill in
dmi_system_id array entries does non exact matching using strstr()
just like you do above.
Note you need to terminate the dmi_system_id array with an empty
{} entry.
> static void asus_wmi_led_exit(struct asus_wmi *asus)
> {
> led_classdev_unregister(&asus->kbd_led);
> @@ -1681,7 +1713,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
> goto error;
> }
>
> - if (!kbd_led_read(asus, &led_val, NULL)) {
> + if (!kbd_led_read(asus, &led_val, NULL) && !asus_use_hid_led()) {
> + pr_info("using asus-wmi for asus::kbd_backlight\n");
> asus->kbd_led_wk = led_val;
> asus->kbd_led.name = "asus::kbd_backlight";
> asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
> diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
> index 3eb5cd6773ad..6833035f7006 100644
> --- a/include/linux/platform_data/x86/asus-wmi.h
> +++ b/include/linux/platform_data/x86/asus-wmi.h
> @@ -160,4 +160,14 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1,
> }
> #endif
>
> +/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */
> +#if IS_ENABLED(CONFIG_ASUS_WMI)
> +bool asus_use_hid_led(void);
> +#else
> +static inline bool asus_use_hid_led(void)
> +{
> + return true;
> +}
> +#endif
> +
> #endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */
Regards,
Hans
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control
2024-05-29 1:28 ` [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control Luke D. Jones
@ 2024-05-29 8:25 ` Hans de Goede
2024-05-29 9:27 ` Luke Jones
0 siblings, 1 reply; 10+ messages in thread
From: Hans de Goede @ 2024-05-29 8:25 UTC (permalink / raw)
To: Luke D. Jones, jikos
Cc: ilpo.jarvinen, corentin.chary, platform-driver-x86, linux-kernel,
linux-input, bentiss
Hi,
On 5/29/24 3:28 AM, Luke D. Jones wrote:
> On some laptops the report_id used for LED brightness control must be
> 0x5D instead of 0x5A.
>
> Signed-off-by: Luke D. Jones <luke@ljones.dev>
> ---
> drivers/hid/hid-asus.c | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 4cba8e143031..ec3556cc4eef 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -94,6 +94,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
>
> #define TRKID_SGN ((TRKID_MAX + 1) >> 1)
>
> +static const char * const use_alt_led_report_id[] = { "GU605", "GA403" };
> +
> struct asus_kbd_leds {
> struct led_classdev cdev;
> struct hid_device *hdev;
> @@ -101,6 +103,7 @@ struct asus_kbd_leds {
> unsigned int brightness;
> spinlock_t lock;
> bool removed;
> + int report_id;
> };
>
> struct asus_touchpad_info {
> @@ -473,7 +476,7 @@ static enum led_brightness asus_kbd_backlight_get(struct led_classdev *led_cdev)
> static void asus_kbd_backlight_work(struct work_struct *work)
> {
> struct asus_kbd_leds *led = container_of(work, struct asus_kbd_leds, work);
> - u8 buf[] = { FEATURE_KBD_REPORT_ID, 0xba, 0xc5, 0xc4, 0x00 };
> + u8 buf[] = { led->report_id, 0xba, 0xc5, 0xc4, 0x00 };
> int ret;
> unsigned long flags;
>
> @@ -513,6 +516,23 @@ static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
> return !!(value & ASUS_WMI_DSTS_PRESENCE_BIT);
> }
>
> +static bool asus_kbd_is_input_led(void)
> +{
> + const char *product;
> + int i;
> +
> + product = dmi_get_system_info(DMI_PRODUCT_NAME);
> + if (!product)
> + return false;
> +
> + for (i = 0; i < ARRAY_SIZE(use_alt_led_report_id); i++) {
> + if (strstr(product, use_alt_led_report_id[i]))
> + return true;
> + }
> +
> + return false;
> +}
> +
This again feels like you are re-inventing dmi_check_system() please
change use_alt_led_report_id to a dmi_system_id array and drop this
function (you can directly call dmi_check_system(use_alt_led_report_id)
instead).
> static int asus_kbd_register_leds(struct hid_device *hdev)
> {
> struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
> @@ -555,6 +575,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
> if (!drvdata->kbd_backlight)
> return -ENOMEM;
>
> + drvdata->kbd_backlight->report_id = FEATURE_KBD_REPORT_ID;
> + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && asus_kbd_is_input_led())
> + drvdata->kbd_backlight->report_id = FEATURE_KBD_LED_REPORT_ID1;
> +
> drvdata->kbd_backlight->removed = false;
> drvdata->kbd_backlight->brightness = 0;
> drvdata->kbd_backlight->hdev = hdev;
Regards,
Hans
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control
2024-05-29 8:25 ` Hans de Goede
@ 2024-05-29 9:27 ` Luke Jones
0 siblings, 0 replies; 10+ messages in thread
From: Luke Jones @ 2024-05-29 9:27 UTC (permalink / raw)
To: Hans de Goede, Jiri Kosina
Cc: Ilpo Järvinen, corentin.chary, platform-driver-x86,
linux-kernel, linux-input, bentiss
On Wed, 29 May 2024, at 8:25 PM, Hans de Goede wrote:
> Hi,
>
> On 5/29/24 3:28 AM, Luke D. Jones wrote:
> > On some laptops the report_id used for LED brightness control must be
> > 0x5D instead of 0x5A.
> >
> > Signed-off-by: Luke D. Jones <luke@ljones.dev>
> > ---
> > drivers/hid/hid-asus.c | 26 +++++++++++++++++++++++++-
> > 1 file changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> > index 4cba8e143031..ec3556cc4eef 100644
> > --- a/drivers/hid/hid-asus.c
> > +++ b/drivers/hid/hid-asus.c
> > @@ -94,6 +94,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
> >
> > #define TRKID_SGN ((TRKID_MAX + 1) >> 1)
> >
> > +static const char * const use_alt_led_report_id[] = { "GU605", "GA403" };
> > +
> > struct asus_kbd_leds {
> > struct led_classdev cdev;
> > struct hid_device *hdev;
> > @@ -101,6 +103,7 @@ struct asus_kbd_leds {
> > unsigned int brightness;
> > spinlock_t lock;
> > bool removed;
> > + int report_id;
> > };
> >
> > struct asus_touchpad_info {
> > @@ -473,7 +476,7 @@ static enum led_brightness asus_kbd_backlight_get(struct led_classdev *led_cdev)
> > static void asus_kbd_backlight_work(struct work_struct *work)
> > {
> > struct asus_kbd_leds *led = container_of(work, struct asus_kbd_leds, work);
> > - u8 buf[] = { FEATURE_KBD_REPORT_ID, 0xba, 0xc5, 0xc4, 0x00 };
> > + u8 buf[] = { led->report_id, 0xba, 0xc5, 0xc4, 0x00 };
> > int ret;
> > unsigned long flags;
> >
> > @@ -513,6 +516,23 @@ static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
> > return !!(value & ASUS_WMI_DSTS_PRESENCE_BIT);
> > }
> >
> > +static bool asus_kbd_is_input_led(void)
> > +{
> > + const char *product;
> > + int i;
> > +
> > + product = dmi_get_system_info(DMI_PRODUCT_NAME);
> > + if (!product)
> > + return false;
> > +
> > + for (i = 0; i < ARRAY_SIZE(use_alt_led_report_id); i++) {
> > + if (strstr(product, use_alt_led_report_id[i]))
> > + return true;
> > + }
> > +
> > + return false;
> > +}
> > +
>
>
> This again feels like you are re-inventing dmi_check_system() please
> change use_alt_led_report_id to a dmi_system_id array and drop this
> function (you can directly call dmi_check_system(use_alt_led_report_id)
> instead).
I wasn't actually aware of that, so i guess I've learned a whole lot of new stuff today :)
Thanks mate, I'll get round to a v2 in the next few days.
>
> > static int asus_kbd_register_leds(struct hid_device *hdev)
> > {
> > struct asus_drvdata *drvdata = hid_get_drvdata(hdev);
> > @@ -555,6 +575,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
> > if (!drvdata->kbd_backlight)
> > return -ENOMEM;
> >
> > + drvdata->kbd_backlight->report_id = FEATURE_KBD_REPORT_ID;
> > + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && asus_kbd_is_input_led())
> > + drvdata->kbd_backlight->report_id = FEATURE_KBD_LED_REPORT_ID1;
> > +
> > drvdata->kbd_backlight->removed = false;
> > drvdata->kbd_backlight->brightness = 0;
> > drvdata->kbd_backlight->hdev = hdev;
>
> Regards,
>
> Hans
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness
2024-05-29 1:28 [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Luke D. Jones
2024-05-29 1:28 ` [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard Luke D. Jones
2024-05-29 1:28 ` [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control Luke D. Jones
@ 2024-05-29 15:28 ` Hans de Goede
2024-06-06 8:49 ` Benjamin Tissoires
2 siblings, 1 reply; 10+ messages in thread
From: Hans de Goede @ 2024-05-29 15:28 UTC (permalink / raw)
To: Luke D. Jones, Jiri Kosina, Benjamin Tissoires
Cc: ilpo.jarvinen, corentin.chary, platform-driver-x86, linux-kernel,
linux-input
Hi all,
On 5/29/24 3:28 AM, Luke D. Jones wrote:
> Changelog:
> - v1
> - Split the patch in two
> - Move function body to asus-wmi and export
> - Use array of names and for loops
>
> History:
> - https://lore.kernel.org/linux-input/20240528013959.14661-1-luke@ljones.dev/T/#u
>
> Luke D. Jones (2):
> hid-asus: use hid for brightness control on keyboard
> hid-asus: change the report_id used for HID LED control
>
> drivers/hid/hid-asus.c | 32 +++++++++++++++++++-
> drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
> include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
> 3 files changed, 75 insertions(+), 2 deletions(-)
Jiri, Benjamin since the first patch now also touches pdx86 files
we need to coordinate merging this.
There also is a long list of patches pending for
drivers/platform/x86/asus-wmi.c
So I would prefer to take this series (both patches) upstream through
the pdx86 tree to avoid conflicts.
May we have an ack from one of you for merging this through pdx86/for-next ?
Regards,
Hans
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness
2024-05-29 15:28 ` [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Hans de Goede
@ 2024-06-06 8:49 ` Benjamin Tissoires
2024-06-06 9:53 ` Hans de Goede
0 siblings, 1 reply; 10+ messages in thread
From: Benjamin Tissoires @ 2024-06-06 8:49 UTC (permalink / raw)
To: Hans de Goede
Cc: Luke D. Jones, Jiri Kosina, ilpo.jarvinen, corentin.chary,
platform-driver-x86, linux-kernel, linux-input
On May 29 2024, Hans de Goede wrote:
> Hi all,
>
> On 5/29/24 3:28 AM, Luke D. Jones wrote:
> > Changelog:
> > - v1
> > - Split the patch in two
> > - Move function body to asus-wmi and export
> > - Use array of names and for loops
> >
> > History:
> > - https://lore.kernel.org/linux-input/20240528013959.14661-1-luke@ljones.dev/T/#u
> >
> > Luke D. Jones (2):
> > hid-asus: use hid for brightness control on keyboard
> > hid-asus: change the report_id used for HID LED control
> >
> > drivers/hid/hid-asus.c | 32 +++++++++++++++++++-
> > drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
> > include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
> > 3 files changed, 75 insertions(+), 2 deletions(-)
>
> Jiri, Benjamin since the first patch now also touches pdx86 files
> we need to coordinate merging this.
>
> There also is a long list of patches pending for
> drivers/platform/x86/asus-wmi.c
>
> So I would prefer to take this series (both patches) upstream through
> the pdx86 tree to avoid conflicts.
>
> May we have an ack from one of you for merging this through pdx86/for-next ?
Sure:
Acked-by: Benjamin Tissoires <bentiss@kernel.org>
But I haven't seen the v2. Are you sure you want to take this series as
it is?
Cheers,
Benjamin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness
2024-06-06 8:49 ` Benjamin Tissoires
@ 2024-06-06 9:53 ` Hans de Goede
2024-06-06 21:02 ` Luke Jones
0 siblings, 1 reply; 10+ messages in thread
From: Hans de Goede @ 2024-06-06 9:53 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Luke D. Jones, Jiri Kosina, ilpo.jarvinen, corentin.chary,
platform-driver-x86, linux-kernel, linux-input
Hi Benjamin,
On 6/6/24 10:49 AM, Benjamin Tissoires wrote:
> On May 29 2024, Hans de Goede wrote:
>> Hi all,
>>
>> On 5/29/24 3:28 AM, Luke D. Jones wrote:
>>> Changelog:
>>> - v1
>>> - Split the patch in two
>>> - Move function body to asus-wmi and export
>>> - Use array of names and for loops
>>>
>>> History:
>>> - https://lore.kernel.org/linux-input/20240528013959.14661-1-luke@ljones.dev/T/#u
>>>
>>> Luke D. Jones (2):
>>> hid-asus: use hid for brightness control on keyboard
>>> hid-asus: change the report_id used for HID LED control
>>>
>>> drivers/hid/hid-asus.c | 32 +++++++++++++++++++-
>>> drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
>>> include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
>>> 3 files changed, 75 insertions(+), 2 deletions(-)
>>
>> Jiri, Benjamin since the first patch now also touches pdx86 files
>> we need to coordinate merging this.
>>
>> There also is a long list of patches pending for
>> drivers/platform/x86/asus-wmi.c
>>
>> So I would prefer to take this series (both patches) upstream through
>> the pdx86 tree to avoid conflicts.
>>
>> May we have an ack from one of you for merging this through pdx86/for-next ?
>
> Sure:
> Acked-by: Benjamin Tissoires <bentiss@kernel.org>
Thank you for the ack.
> But I haven't seen the v2. Are you sure you want to take this series as
> it is?
No I plan to wait for v2, I just thought it would be good to have
an ack to merge this through the pdx86 tree beforehand.
Regards,
Hans
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness
2024-06-06 9:53 ` Hans de Goede
@ 2024-06-06 21:02 ` Luke Jones
0 siblings, 0 replies; 10+ messages in thread
From: Luke Jones @ 2024-06-06 21:02 UTC (permalink / raw)
To: Hans de Goede, Benjamin Tissoires
Cc: Jiri Kosina, Ilpo Järvinen, corentin.chary,
platform-driver-x86, linux-kernel, linux-input
On Thu, 6 Jun 2024, at 9:53 PM, Hans de Goede wrote:
> Hi Benjamin,
>
> On 6/6/24 10:49 AM, Benjamin Tissoires wrote:
> > On May 29 2024, Hans de Goede wrote:
> >> Hi all,
> >>
> >> On 5/29/24 3:28 AM, Luke D. Jones wrote:
> >>> Changelog:
> >>> - v1
> >>> - Split the patch in two
> >>> - Move function body to asus-wmi and export
> >>> - Use array of names and for loops
> >>>
> >>> History:
> >>> - https://lore.kernel.org/linux-input/20240528013959.14661-1-luke@ljones.dev/T/#u
> >>>
> >>> Luke D. Jones (2):
> >>> hid-asus: use hid for brightness control on keyboard
> >>> hid-asus: change the report_id used for HID LED control
> >>>
> >>> drivers/hid/hid-asus.c | 32 +++++++++++++++++++-
> >>> drivers/platform/x86/asus-wmi.c | 35 +++++++++++++++++++++-
> >>> include/linux/platform_data/x86/asus-wmi.h | 10 +++++++
> >>> 3 files changed, 75 insertions(+), 2 deletions(-)
> >>
> >> Jiri, Benjamin since the first patch now also touches pdx86 files
> >> we need to coordinate merging this.
> >>
> >> There also is a long list of patches pending for
> >> drivers/platform/x86/asus-wmi.c
> >>
> >> So I would prefer to take this series (both patches) upstream through
> >> the pdx86 tree to avoid conflicts.
> >>
> >> May we have an ack from one of you for merging this through pdx86/for-next ?
> >
> > Sure:
> > Acked-by: Benjamin Tissoires <bentiss@kernel.org>
>
> Thank you for the ack.
>
> > But I haven't seen the v2. Are you sure you want to take this series as
> > it is?
>
> No I plan to wait for v2, I just thought it would be good to have
> an ack to merge this through the pdx86 tree beforehand.
My apologies for the delay, I have v2 prepped, but I'm waiting on feedback from a few folks regarding the 2024 G16 and G14, plus the TUF laptops - these are possibly affected by the patch. Shouldn't be more than a day or two now.
Regards,
Luke.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-06-06 21:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 1:28 [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Luke D. Jones
2024-05-29 1:28 ` [PATCH v1 1/2] hid-asus: use hid for brightness control on keyboard Luke D. Jones
2024-05-29 8:21 ` Hans de Goede
2024-05-29 1:28 ` [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control Luke D. Jones
2024-05-29 8:25 ` Hans de Goede
2024-05-29 9:27 ` Luke Jones
2024-05-29 15:28 ` [PATCH v1 0/2] asus wmi and hid: use HID LED for brightness Hans de Goede
2024-06-06 8:49 ` Benjamin Tissoires
2024-06-06 9:53 ` Hans de Goede
2024-06-06 21:02 ` Luke Jones
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).