linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
@ 2022-07-08  8:48 PaddyKP_Yao
  2022-07-08  9:07 ` PaddyKP_Yao
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP_Yao @ 2022-07-08  8:48 UTC (permalink / raw)
  To: hdegoede, mgross, corentin.chary
  Cc: luke, PaddyKP_Yao, platform-driver-x86, linux-kernel, acpi4asus-user

In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
LED is preset by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
it. The binding of mic-mute LED controls will be swithched with LED
trigger.

Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
---
 drivers/platform/x86/Kconfig               |  2 ++
 drivers/platform/x86/asus-wmi.c            | 26 ++++++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h |  1 +
 3 files changed, 29 insertions(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index f915cf67aa26..74769050b770 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -274,6 +274,8 @@ config ASUS_WMI
 	select INPUT_SPARSEKMAP
 	select LEDS_CLASS
 	select NEW_LEDS
+	select LEDS_TRIGGERS
+	select LEDS_TRIGGER_AUDIO
 	select ACPI_PLATFORM_PROFILE
 	help
 	  Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e14fb5fa7324..f1da083b7cd1 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -191,6 +191,7 @@ struct asus_wmi {
 	int kbd_led_wk;
 	struct led_classdev lightbar_led;
 	int lightbar_led_wk;
+	struct led_classdev micmute_led;
 	struct workqueue_struct *led_workqueue;
 	struct work_struct tpd_led_work;
 	struct work_struct wlan_led_work;
@@ -906,12 +907,24 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
 	return result & ASUS_WMI_DSTS_LIGHTBAR_MASK;
 }
 
+static int micmute_led_set(struct led_classdev *led_cdev,
+			   enum led_brightness brightness)
+{
+	int state = brightness != LED_OFF;
+	int err;
+
+	err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MICMUTE_LED, state, NULL);
+	pr_info("%s: brightness : %d, state: %d, err=%d\n", __func__, brightness, state, err);
+	return err < 0 ? err : 0;
+}
+
 static void asus_wmi_led_exit(struct asus_wmi *asus)
 {
 	led_classdev_unregister(&asus->kbd_led);
 	led_classdev_unregister(&asus->tpd_led);
 	led_classdev_unregister(&asus->wlan_led);
 	led_classdev_unregister(&asus->lightbar_led);
+	led_classdev_unregister(&asus->micmute_led);
 
 	if (asus->led_workqueue)
 		destroy_workqueue(asus->led_workqueue);
@@ -983,6 +996,19 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
 					   &asus->lightbar_led);
 	}
 
+	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
+		asus->micmute_led.name = "asus::micmute";
+		asus->micmute_led.max_brightness = 1;
+		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
+		asus->micmute_led.brightness_set_blocking = micmute_led_set;
+		asus->micmute_led.default_trigger = "audio-micmute";
+
+		rv = led_classdev_register(&asus->platform_device->dev,
+						&asus->micmute_led);
+		if (rv)
+			goto error;
+	}
+
 error:
 	if (rv)
 		asus_wmi_led_exit(asus);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 17dc5cb6f3f2..38ee75874d11 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -49,6 +49,7 @@
 #define ASUS_WMI_DEVID_LED4		0x00020014
 #define ASUS_WMI_DEVID_LED5		0x00020015
 #define ASUS_WMI_DEVID_LED6		0x00020016
+#define ASUS_WMI_DEVID_MICMUTE_LED		0x00040017
 
 /* Backlight and Brightness */
 #define ASUS_WMI_DEVID_ALS_ENABLE	0x00050001 /* Ambient Light Sensor */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-08  8:48 [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support PaddyKP_Yao
@ 2022-07-08  9:07 ` PaddyKP_Yao
  2022-07-09 11:44   ` Andy Shevchenko
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP_Yao @ 2022-07-08  9:07 UTC (permalink / raw)
  To: hdegoede, mgross, corentin.chary
  Cc: luke, PaddyKP_Yao, platform-driver-x86, linux-kernel, acpi4asus-user

In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
it. The binding of mic-mute LED controls will be swithched with LED
trigger.

Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
---
 drivers/platform/x86/Kconfig               |  2 ++
 drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h |  1 +
 3 files changed, 28 insertions(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index f915cf67aa26..74769050b770 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -274,6 +274,8 @@ config ASUS_WMI
 	select INPUT_SPARSEKMAP
 	select LEDS_CLASS
 	select NEW_LEDS
+	select LEDS_TRIGGERS
+	select LEDS_TRIGGER_AUDIO
 	select ACPI_PLATFORM_PROFILE
 	help
 	  Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e14fb5fa7324..40c0e00a4b71 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -191,6 +191,7 @@ struct asus_wmi {
 	int kbd_led_wk;
 	struct led_classdev lightbar_led;
 	int lightbar_led_wk;
+	struct led_classdev micmute_led;
 	struct workqueue_struct *led_workqueue;
 	struct work_struct tpd_led_work;
 	struct work_struct wlan_led_work;
@@ -906,12 +907,23 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
 	return result & ASUS_WMI_DSTS_LIGHTBAR_MASK;
 }
 
+static int micmute_led_set(struct led_classdev *led_cdev,
+			   enum led_brightness brightness)
+{
+	int state = brightness != LED_OFF;
+	int err;
+
+	err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MICMUTE_LED, state, NULL);
+	return err < 0 ? err : 0;
+}
+
 static void asus_wmi_led_exit(struct asus_wmi *asus)
 {
 	led_classdev_unregister(&asus->kbd_led);
 	led_classdev_unregister(&asus->tpd_led);
 	led_classdev_unregister(&asus->wlan_led);
 	led_classdev_unregister(&asus->lightbar_led);
+	led_classdev_unregister(&asus->micmute_led);
 
 	if (asus->led_workqueue)
 		destroy_workqueue(asus->led_workqueue);
@@ -983,6 +995,19 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
 					   &asus->lightbar_led);
 	}
 
+	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
+		asus->micmute_led.name = "asus::micmute";
+		asus->micmute_led.max_brightness = 1;
+		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
+		asus->micmute_led.brightness_set_blocking = micmute_led_set;
+		asus->micmute_led.default_trigger = "audio-micmute";
+
+		rv = led_classdev_register(&asus->platform_device->dev,
+						&asus->micmute_led);
+		if (rv)
+			goto error;
+	}
+
 error:
 	if (rv)
 		asus_wmi_led_exit(asus);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 17dc5cb6f3f2..38ee75874d11 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -49,6 +49,7 @@
 #define ASUS_WMI_DEVID_LED4		0x00020014
 #define ASUS_WMI_DEVID_LED5		0x00020015
 #define ASUS_WMI_DEVID_LED6		0x00020016
+#define ASUS_WMI_DEVID_MICMUTE_LED		0x00040017
 
 /* Backlight and Brightness */
 #define ASUS_WMI_DEVID_ALS_ENABLE	0x00050001 /* Ambient Light Sensor */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-08  9:07 ` PaddyKP_Yao
@ 2022-07-09 11:44   ` Andy Shevchenko
  2022-07-09 14:48     ` Hans de Goede
  2022-07-09 14:49     ` Hans de Goede
  0 siblings, 2 replies; 23+ messages in thread
From: Andy Shevchenko @ 2022-07-09 11:44 UTC (permalink / raw)
  To: PaddyKP_Yao
  Cc: Hans de Goede, Mark Gross, Corentin Chary, Luke Jones,
	PaddyKP_Yao, Platform Driver, Linux Kernel Mailing List,
	acpi4asus-user

You have sent two patches with the same version, your submission
confuses everybody, which one are we supposed to consider?

On Fri, Jul 8, 2022 at 11:08 AM PaddyKP_Yao <ispaddy@gmail.com> wrote:
>
> In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
> LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
> mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
> it. The binding of mic-mute LED controls will be swithched with LED

switched

> trigger.

...

Not reviewing code because of the above.

Hint: `git format-patch -vX ...`, where X is a version number will
help. And when cooking a new version don't forget to add a changelog
between versions.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-09 11:44   ` Andy Shevchenko
@ 2022-07-09 14:48     ` Hans de Goede
  2022-07-09 14:49     ` Hans de Goede
  1 sibling, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2022-07-09 14:48 UTC (permalink / raw)
  To: Andy Shevchenko, PaddyKP_Yao
  Cc: Mark Gross, Corentin Chary, Luke Jones, PaddyKP_Yao,
	Platform Driver, Linux Kernel Mailing List, acpi4asus-user

Hi,

On 7/9/22 13:44, Andy Shevchenko wrote:
> You have sent two patches with the same version, your submission
> confuses everybody, which one are we supposed to consider?

Also the From of this email: PaddyKP_Yao <ispaddy@gmail.com> and
the Signed-off-by:

> 
> On Fri, Jul 8, 2022 at 11:08 AM PaddyKP_Yao <ispaddy@gmail.com> wrote:
>>
>> In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
>> LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
>> mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
>> it. The binding of mic-mute LED controls will be swithched with LED
> 
> switched
> 
>> trigger.
> 
> ...
> 
> Not reviewing code because of the above.
> 
> Hint: `git format-patch -vX ...`, where X is a version number will
> help. And when cooking a new version don't forget to add a changelog
> between versions.
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-09 11:44   ` Andy Shevchenko
  2022-07-09 14:48     ` Hans de Goede
@ 2022-07-09 14:49     ` Hans de Goede
  2022-07-11  2:12       ` PaddyKP Yao(姚國鵬)
  1 sibling, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2022-07-09 14:49 UTC (permalink / raw)
  To: Andy Shevchenko, PaddyKP_Yao
  Cc: Mark Gross, Corentin Chary, Luke Jones, PaddyKP_Yao,
	Platform Driver, Linux Kernel Mailing List, acpi4asus-user

<accidentally hit send to soon, trying again>

Hi,

On 7/9/22 13:44, Andy Shevchenko wrote:
> You have sent two patches with the same version, your submission
> confuses everybody, which one are we supposed to consider?

Also the From of this email: PaddyKP_Yao <ispaddy@gmail.com> and
the Signed-off-by:

Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>

do not match. If you want the Author field of the commit to
bet set to match the Signed-off-by, but have trouble submitting
patches from your Asus email I can fix this up for you when
applying. Please let me know if you want me to do this;
or fix this issue for your next patch.

Regards,

Hans




> 
> On Fri, Jul 8, 2022 at 11:08 AM PaddyKP_Yao <ispaddy@gmail.com> wrote:
>>
>> In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
>> LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
>> mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
>> it. The binding of mic-mute LED controls will be swithched with LED
> 
> switched
> 
>> trigger.
> 
> ...
> 
> Not reviewing code because of the above.
> 
> Hint: `git format-patch -vX ...`, where X is a version number will
> help. And when cooking a new version don't forget to add a changelog
> between versions.
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-09 14:49     ` Hans de Goede
@ 2022-07-11  2:12       ` PaddyKP Yao(姚國鵬)
  2022-07-11  2:40         ` [PATCH v2 " PaddyKP_Yao
  2022-07-11  2:47         ` PaddyKP_Yao
  0 siblings, 2 replies; 23+ messages in thread
From: PaddyKP Yao(姚國鵬) @ 2022-07-11  2:12 UTC (permalink / raw)
  To: Hans de Goede, Andy Shevchenko, PaddyKP_Yao
  Cc: Mark Gross, Corentin Chary, Luke Jones, Platform Driver,
	Linux Kernel Mailing List, acpi4asus-user

Hi,

> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Saturday, July 9, 2022 10:50 PM
> To: Andy Shevchenko <andy.shevchenko@gmail.com>; PaddyKP_Yao <ispaddy@gmail.com>
> Cc: Mark Gross <mgross@linux.intel.com>; Corentin Chary <corentin.chary@gmail.com>; Luke Jones <luke@ljones.dev>; PaddyKP Yao(姚
> 國鵬) <Paddykp_Yao@asus.com>; Platform Driver <platform-driver-x86@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; acpi4asus-user <acpi4asus-user@lists.sourceforge.net>
> Subject: Re: [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
>
> <accidentally hit send to soon, trying again>
>
> Hi,
>
> On 7/9/22 13:44, Andy Shevchenko wrote:
> > You have sent two patches with the same version, your submission
> > confuses everybody, which one are we supposed to consider?
>

Many thanks for your feedback
Sorry for confusing. I will send new v2 patch again.

> Also the From of this email: PaddyKP_Yao <ispaddy@gmail.com> and
> the Signed-off-by:
>
> Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
>
> do not match. If you want the Author field of the commit to
> bet set to match the Signed-off-by, but have trouble submitting
> patches from your Asus email I can fix this up for you when
> applying. Please let me know if you want me to do this;
> or fix this issue for your next patch.
>
> Regards,
>
> Hans
>

I will resend patch again by my Asus email.

===================================================================================================================================
This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
===================================================================================================================================

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11  2:12       ` PaddyKP Yao(姚國鵬)
@ 2022-07-11  2:40         ` PaddyKP_Yao
  2022-07-11  2:47         ` PaddyKP_Yao
  1 sibling, 0 replies; 23+ messages in thread
From: PaddyKP_Yao @ 2022-07-11  2:40 UTC (permalink / raw)
  To: andy.shevchenko, hdegoede
  Cc: paddykp_yao, acpi4asus-user, corentin.chary, ispaddy,
	linux-kernel, luke, mgross, platform-driver-x86, PaddyKP_Yao

In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
it. The binding of mic-mute LED controls will be swithched with LED
trigger.

Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
---
V1 -> V2: fix typo for 'present' and remove unnecessary pr_info() log

 drivers/platform/x86/Kconfig               |  2 ++
 drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h |  1 +
 3 files changed, 28 insertions(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index f915cf67aa26..74769050b770 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -274,6 +274,8 @@ config ASUS_WMI
 	select INPUT_SPARSEKMAP
 	select LEDS_CLASS
 	select NEW_LEDS
+	select LEDS_TRIGGERS
+	select LEDS_TRIGGER_AUDIO
 	select ACPI_PLATFORM_PROFILE
 	help
 	  Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e14fb5fa7324..40c0e00a4b71 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -191,6 +191,7 @@ struct asus_wmi {
 	int kbd_led_wk;
 	struct led_classdev lightbar_led;
 	int lightbar_led_wk;
+	struct led_classdev micmute_led;
 	struct workqueue_struct *led_workqueue;
 	struct work_struct tpd_led_work;
 	struct work_struct wlan_led_work;
@@ -906,12 +907,23 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
 	return result & ASUS_WMI_DSTS_LIGHTBAR_MASK;
 }
 
+static int micmute_led_set(struct led_classdev *led_cdev,
+			   enum led_brightness brightness)
+{
+	int state = brightness != LED_OFF;
+	int err;
+
+	err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MICMUTE_LED, state, NULL);
+	return err < 0 ? err : 0;
+}
+
 static void asus_wmi_led_exit(struct asus_wmi *asus)
 {
 	led_classdev_unregister(&asus->kbd_led);
 	led_classdev_unregister(&asus->tpd_led);
 	led_classdev_unregister(&asus->wlan_led);
 	led_classdev_unregister(&asus->lightbar_led);
+	led_classdev_unregister(&asus->micmute_led);
 
 	if (asus->led_workqueue)
 		destroy_workqueue(asus->led_workqueue);
@@ -983,6 +995,19 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
 					   &asus->lightbar_led);
 	}
 
+	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
+		asus->micmute_led.name = "asus::micmute";
+		asus->micmute_led.max_brightness = 1;
+		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
+		asus->micmute_led.brightness_set_blocking = micmute_led_set;
+		asus->micmute_led.default_trigger = "audio-micmute";
+
+		rv = led_classdev_register(&asus->platform_device->dev,
+						&asus->micmute_led);
+		if (rv)
+			goto error;
+	}
+
 error:
 	if (rv)
 		asus_wmi_led_exit(asus);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 17dc5cb6f3f2..38ee75874d11 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -49,6 +49,7 @@
 #define ASUS_WMI_DEVID_LED4		0x00020014
 #define ASUS_WMI_DEVID_LED5		0x00020015
 #define ASUS_WMI_DEVID_LED6		0x00020016
+#define ASUS_WMI_DEVID_MICMUTE_LED		0x00040017
 
 /* Backlight and Brightness */
 #define ASUS_WMI_DEVID_ALS_ENABLE	0x00050001 /* Ambient Light Sensor */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11  2:12       ` PaddyKP Yao(姚國鵬)
  2022-07-11  2:40         ` [PATCH v2 " PaddyKP_Yao
@ 2022-07-11  2:47         ` PaddyKP_Yao
  2022-07-11  8:50           ` Andy Shevchenko
  2022-08-24 10:06           ` [PATCH v2 " Pavel Machek
  1 sibling, 2 replies; 23+ messages in thread
From: PaddyKP_Yao @ 2022-07-11  2:47 UTC (permalink / raw)
  To: andy.shevchenko, hdegoede
  Cc: paddykp_yao, acpi4asus-user, corentin.chary, ispaddy,
	linux-kernel, luke, mgross, platform-driver-x86, PaddyKP_Yao

From: PaddyKP_Yao <PaddyKP_Yao@asus.com>

In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
it. The binding of mic-mute LED controls will be swithched with LED
trigger.

Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
---
V1 -> V2: fix typo for 'present' and remove unnecessary pr_info() log

 drivers/platform/x86/Kconfig               |  2 ++
 drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h |  1 +
 3 files changed, 28 insertions(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index f915cf67aa26..74769050b770 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -274,6 +274,8 @@ config ASUS_WMI
        select INPUT_SPARSEKMAP
        select LEDS_CLASS
        select NEW_LEDS
+       select LEDS_TRIGGERS
+       select LEDS_TRIGGER_AUDIO
        select ACPI_PLATFORM_PROFILE
        help
          Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e14fb5fa7324..40c0e00a4b71 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -191,6 +191,7 @@ struct asus_wmi {
        int kbd_led_wk;
        struct led_classdev lightbar_led;
        int lightbar_led_wk;
+       struct led_classdev micmute_led;
        struct workqueue_struct *led_workqueue;
        struct work_struct tpd_led_work;
        struct work_struct wlan_led_work;
@@ -906,12 +907,23 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
        return result & ASUS_WMI_DSTS_LIGHTBAR_MASK;
 }

+static int micmute_led_set(struct led_classdev *led_cdev,
+                          enum led_brightness brightness)
+{
+       int state = brightness != LED_OFF;
+       int err;
+
+       err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MICMUTE_LED, state, NULL);
+       return err < 0 ? err : 0;
+}
+
 static void asus_wmi_led_exit(struct asus_wmi *asus)
 {
        led_classdev_unregister(&asus->kbd_led);
        led_classdev_unregister(&asus->tpd_led);
        led_classdev_unregister(&asus->wlan_led);
        led_classdev_unregister(&asus->lightbar_led);
+       led_classdev_unregister(&asus->micmute_led);

        if (asus->led_workqueue)
                destroy_workqueue(asus->led_workqueue);
@@ -983,6 +995,19 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
                                           &asus->lightbar_led);
        }

+       if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
+               asus->micmute_led.name = "asus::micmute";
+               asus->micmute_led.max_brightness = 1;
+               asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
+               asus->micmute_led.brightness_set_blocking = micmute_led_set;
+               asus->micmute_led.default_trigger = "audio-micmute";
+
+               rv = led_classdev_register(&asus->platform_device->dev,
+                                               &asus->micmute_led);
+               if (rv)
+                       goto error;
+       }
+
 error:
        if (rv)
                asus_wmi_led_exit(asus);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 17dc5cb6f3f2..38ee75874d11 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -49,6 +49,7 @@
 #define ASUS_WMI_DEVID_LED4            0x00020014
 #define ASUS_WMI_DEVID_LED5            0x00020015
 #define ASUS_WMI_DEVID_LED6            0x00020016
+#define ASUS_WMI_DEVID_MICMUTE_LED             0x00040017

 /* Backlight and Brightness */
 #define ASUS_WMI_DEVID_ALS_ENABLE      0x00050001 /* Ambient Light Sensor */
--
2.34.1

===================================================================================================================================
This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
===================================================================================================================================

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11  2:47         ` PaddyKP_Yao
@ 2022-07-11  8:50           ` Andy Shevchenko
  2022-07-11 11:41             ` PaddyKP Yao
  2022-08-24 10:06           ` [PATCH v2 " Pavel Machek
  1 sibling, 1 reply; 23+ messages in thread
From: Andy Shevchenko @ 2022-07-11  8:50 UTC (permalink / raw)
  To: PaddyKP_Yao
  Cc: Hans de Goede, acpi4asus-user, Corentin Chary, PaddyKP_Yao,
	Linux Kernel Mailing List, Luke Jones, Mark Gross,
	Platform Driver

On Mon, Jul 11, 2022 at 4:47 AM <PaddyKP_Yao@asus.com> wrote:
>
> From: PaddyKP_Yao <PaddyKP_Yao@asus.com>

Besides we got two emails again of the same version...

> ===================================================================================================================================
> This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
> ===================================================================================================================================

...this is problematic and can't be used in open source projects. Ask
your legal team how to deal with it.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11  8:50           ` Andy Shevchenko
@ 2022-07-11 11:41             ` PaddyKP Yao
  2022-07-11 11:47               ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP Yao @ 2022-07-11 11:41 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: PaddyKP_Yao, Hans de Goede, acpi4asus-user, Corentin Chary,
	Linux Kernel Mailing List, Luke Jones, Mark Gross,
	Platform Driver

<accidentally hit send to soon, trying again>

Hi,

Sorry for mistake about send two patch mail again...
After some try, I cannot remove legal message from asus mail.
I will use my gmail and send patch again.
And may I use author PaddyKP_Yao@asus.com instead of my gmail account?

Many thanks for your kind feedback.

On Mon, Jul 11, 2022 at 10:50:29AM +0200, Andy Shevchenko wrote:
> On Mon, Jul 11, 2022 at 4:47 AM <PaddyKP_Yao@asus.com> wrote:
> >
> > From: PaddyKP_Yao <PaddyKP_Yao@asus.com>
> 
> Besides we got two emails again of the same version...
> 
> > ===================================================================================================================================
> > This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
> > ===================================================================================================================================
> 
> ...this is problematic and can't be used in open source projects. Ask
> your legal team how to deal with it.
> 
> -- 
> With Best Regards,
> Andy Shevchenko

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11 11:41             ` PaddyKP Yao
@ 2022-07-11 11:47               ` Hans de Goede
  2022-07-11 11:51                 ` [PATCH v3 " PaddyKP_Yao
  0 siblings, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2022-07-11 11:47 UTC (permalink / raw)
  To: PaddyKP Yao, Andy Shevchenko
  Cc: PaddyKP_Yao, acpi4asus-user, Corentin Chary,
	Linux Kernel Mailing List, Luke Jones, Mark Gross,
	Platform Driver

Hi,

On 7/11/22 13:41, PaddyKP Yao wrote:
> <accidentally hit send to soon, trying again>
> 
> Hi,
> 
> Sorry for mistake about send two patch mail again...
> After some try, I cannot remove legal message from asus mail.
> I will use my gmail and send patch again.
> And may I use author PaddyKP_Yao@asus.com instead of my gmail account?

Yes I can fix that up for you.

Regards,

Hans



> 
> Many thanks for your kind feedback.
> 
> On Mon, Jul 11, 2022 at 10:50:29AM +0200, Andy Shevchenko wrote:
>> On Mon, Jul 11, 2022 at 4:47 AM <PaddyKP_Yao@asus.com> wrote:
>>>
>>> From: PaddyKP_Yao <PaddyKP_Yao@asus.com>
>>
>> Besides we got two emails again of the same version...
>>
>>> ===================================================================================================================================
>>> This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
>>> ===================================================================================================================================
>>
>> ...this is problematic and can't be used in open source projects. Ask
>> your legal team how to deal with it.
>>
>> -- 
>> With Best Regards,
>> Andy Shevchenko
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11 11:47               ` Hans de Goede
@ 2022-07-11 11:51                 ` PaddyKP_Yao
  2022-07-14 20:04                   ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP_Yao @ 2022-07-11 11:51 UTC (permalink / raw)
  To: hdegoede
  Cc: PaddyKP_Yao, acpi4asus-user, andy.shevchenko, corentin.chary,
	ispaddy, linux-kernel, luke, mgross, platform-driver-x86

In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
it. The binding of mic-mute LED controls will be swithched with LED
trigger.

Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
---
V1 -> V2: fix typo for 'present' and remove unnecessary pr_info() log
V2 -> V3: resend patch again by gmail to avoid Asus legal in the mail

 drivers/platform/x86/Kconfig               |  2 ++
 drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h |  1 +
 3 files changed, 28 insertions(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index f915cf67aa26..74769050b770 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -274,6 +274,8 @@ config ASUS_WMI
 	select INPUT_SPARSEKMAP
 	select LEDS_CLASS
 	select NEW_LEDS
+	select LEDS_TRIGGERS
+	select LEDS_TRIGGER_AUDIO
 	select ACPI_PLATFORM_PROFILE
 	help
 	  Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e14fb5fa7324..40c0e00a4b71 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -191,6 +191,7 @@ struct asus_wmi {
 	int kbd_led_wk;
 	struct led_classdev lightbar_led;
 	int lightbar_led_wk;
+	struct led_classdev micmute_led;
 	struct workqueue_struct *led_workqueue;
 	struct work_struct tpd_led_work;
 	struct work_struct wlan_led_work;
@@ -906,12 +907,23 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
 	return result & ASUS_WMI_DSTS_LIGHTBAR_MASK;
 }
 
+static int micmute_led_set(struct led_classdev *led_cdev,
+			   enum led_brightness brightness)
+{
+	int state = brightness != LED_OFF;
+	int err;
+
+	err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MICMUTE_LED, state, NULL);
+	return err < 0 ? err : 0;
+}
+
 static void asus_wmi_led_exit(struct asus_wmi *asus)
 {
 	led_classdev_unregister(&asus->kbd_led);
 	led_classdev_unregister(&asus->tpd_led);
 	led_classdev_unregister(&asus->wlan_led);
 	led_classdev_unregister(&asus->lightbar_led);
+	led_classdev_unregister(&asus->micmute_led);
 
 	if (asus->led_workqueue)
 		destroy_workqueue(asus->led_workqueue);
@@ -983,6 +995,19 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
 					   &asus->lightbar_led);
 	}
 
+	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
+		asus->micmute_led.name = "asus::micmute";
+		asus->micmute_led.max_brightness = 1;
+		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
+		asus->micmute_led.brightness_set_blocking = micmute_led_set;
+		asus->micmute_led.default_trigger = "audio-micmute";
+
+		rv = led_classdev_register(&asus->platform_device->dev,
+						&asus->micmute_led);
+		if (rv)
+			goto error;
+	}
+
 error:
 	if (rv)
 		asus_wmi_led_exit(asus);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 17dc5cb6f3f2..38ee75874d11 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -49,6 +49,7 @@
 #define ASUS_WMI_DEVID_LED4		0x00020014
 #define ASUS_WMI_DEVID_LED5		0x00020015
 #define ASUS_WMI_DEVID_LED6		0x00020016
+#define ASUS_WMI_DEVID_MICMUTE_LED		0x00040017
 
 /* Backlight and Brightness */
 #define ASUS_WMI_DEVID_ALS_ENABLE	0x00050001 /* Ambient Light Sensor */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11 11:51                 ` [PATCH v3 " PaddyKP_Yao
@ 2022-07-14 20:04                   ` Hans de Goede
  2022-08-24 10:06                     ` Pavel Machek
  0 siblings, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2022-07-14 20:04 UTC (permalink / raw)
  To: PaddyKP_Yao
  Cc: PaddyKP_Yao, acpi4asus-user, andy.shevchenko, corentin.chary,
	linux-kernel, luke, mgross, platform-driver-x86

Hi,

On 7/11/22 13:51, PaddyKP_Yao wrote:
> In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
> LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
> mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
> it. The binding of mic-mute LED controls will be swithched with LED
> trigger.
> 
> Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
> ---
> V1 -> V2: fix typo for 'present' and remove unnecessary pr_info() log
> V2 -> V3: resend patch again by gmail to avoid Asus legal in the mail

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans


> 
>  drivers/platform/x86/Kconfig               |  2 ++
>  drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
>  include/linux/platform_data/x86/asus-wmi.h |  1 +
>  3 files changed, 28 insertions(+)
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index f915cf67aa26..74769050b770 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -274,6 +274,8 @@ config ASUS_WMI
>  	select INPUT_SPARSEKMAP
>  	select LEDS_CLASS
>  	select NEW_LEDS
> +	select LEDS_TRIGGERS
> +	select LEDS_TRIGGER_AUDIO
>  	select ACPI_PLATFORM_PROFILE
>  	help
>  	  Say Y here if you have a WMI aware Asus laptop (like Eee PCs or new
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index e14fb5fa7324..40c0e00a4b71 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -191,6 +191,7 @@ struct asus_wmi {
>  	int kbd_led_wk;
>  	struct led_classdev lightbar_led;
>  	int lightbar_led_wk;
> +	struct led_classdev micmute_led;
>  	struct workqueue_struct *led_workqueue;
>  	struct work_struct tpd_led_work;
>  	struct work_struct wlan_led_work;
> @@ -906,12 +907,23 @@ static enum led_brightness lightbar_led_get(struct led_classdev *led_cdev)
>  	return result & ASUS_WMI_DSTS_LIGHTBAR_MASK;
>  }
>  
> +static int micmute_led_set(struct led_classdev *led_cdev,
> +			   enum led_brightness brightness)
> +{
> +	int state = brightness != LED_OFF;
> +	int err;
> +
> +	err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MICMUTE_LED, state, NULL);
> +	return err < 0 ? err : 0;
> +}
> +
>  static void asus_wmi_led_exit(struct asus_wmi *asus)
>  {
>  	led_classdev_unregister(&asus->kbd_led);
>  	led_classdev_unregister(&asus->tpd_led);
>  	led_classdev_unregister(&asus->wlan_led);
>  	led_classdev_unregister(&asus->lightbar_led);
> +	led_classdev_unregister(&asus->micmute_led);
>  
>  	if (asus->led_workqueue)
>  		destroy_workqueue(asus->led_workqueue);
> @@ -983,6 +995,19 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
>  					   &asus->lightbar_led);
>  	}
>  
> +	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
> +		asus->micmute_led.name = "asus::micmute";
> +		asus->micmute_led.max_brightness = 1;
> +		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
> +		asus->micmute_led.brightness_set_blocking = micmute_led_set;
> +		asus->micmute_led.default_trigger = "audio-micmute";
> +
> +		rv = led_classdev_register(&asus->platform_device->dev,
> +						&asus->micmute_led);
> +		if (rv)
> +			goto error;
> +	}
> +
>  error:
>  	if (rv)
>  		asus_wmi_led_exit(asus);
> diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
> index 17dc5cb6f3f2..38ee75874d11 100644
> --- a/include/linux/platform_data/x86/asus-wmi.h
> +++ b/include/linux/platform_data/x86/asus-wmi.h
> @@ -49,6 +49,7 @@
>  #define ASUS_WMI_DEVID_LED4		0x00020014
>  #define ASUS_WMI_DEVID_LED5		0x00020015
>  #define ASUS_WMI_DEVID_LED6		0x00020016
> +#define ASUS_WMI_DEVID_MICMUTE_LED		0x00040017
>  
>  /* Backlight and Brightness */
>  #define ASUS_WMI_DEVID_ALS_ENABLE	0x00050001 /* Ambient Light Sensor */


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-11  2:47         ` PaddyKP_Yao
  2022-07-11  8:50           ` Andy Shevchenko
@ 2022-08-24 10:06           ` Pavel Machek
  2022-08-24 11:09             ` PaddyKP Yao
  1 sibling, 1 reply; 23+ messages in thread
From: Pavel Machek @ 2022-08-24 10:06 UTC (permalink / raw)
  To: PaddyKP_Yao
  Cc: andy.shevchenko, hdegoede, acpi4asus-user, corentin.chary,
	ispaddy, linux-kernel, luke, mgross, platform-driver-x86

Hi!

> In some new ASUS devices, hotkey Fn+F13 is used for mic mute. If mic-mute
> LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
> mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
> it. The binding of mic-mute LED controls will be swithched with LED
> trigger.
> 
> Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
> ---
> V1 -> V2: fix typo for 'present' and remove unnecessary pr_info() log
> 
>  drivers/platform/x86/Kconfig               |  2 ++
>  drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
>  include/linux/platform_data/x86/asus-wmi.h |  1 +
>  3 files changed, 28 insertions(+)
> 
> asus->micmute_led.name = "asus::micmute";

Please see/modify well-known-leds.txt file. We want this consistent on all devices.

Best regards,
										Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-07-14 20:04                   ` Hans de Goede
@ 2022-08-24 10:06                     ` Pavel Machek
  2022-08-24 10:59                       ` PaddyKP Yao
  0 siblings, 1 reply; 23+ messages in thread
From: Pavel Machek @ 2022-08-24 10:06 UTC (permalink / raw)
  To: Hans de Goede
  Cc: PaddyKP_Yao, PaddyKP_Yao, acpi4asus-user, andy.shevchenko,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi!

> > LED is present by checking WMI ASUS_WMI_DEVID_MICMUTE_LED, we will add a
> > mic-mute LED classdev, asus::micmute, in the asus-wmi driver to control
> > it. The binding of mic-mute LED controls will be swithched with LED
> > trigger.
> > 
> > Signed-off-by: PaddyKP_Yao <PaddyKP_Yao@asus.com>
> > ---
> > V1 -> V2: fix typo for 'present' and remove unnecessary pr_info() log
> > V2 -> V3: resend patch again by gmail to avoid Asus legal in the mail
> 
> Thank you for your patch, I've applied this patch to my review-hans 
> branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
> 
> Once I've run some tests on this branch the patches there will be
> added to the platform-drivers-x86/for-next branch and eventually
> will be included in the pdx86 pull-request to Linus for the next
> merge-window.

> > +	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
> > +		asus->micmute_led.name = "asus::micmute";

It would be good to get the API right before it hits mainline release.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-24 10:06                     ` Pavel Machek
@ 2022-08-24 10:59                       ` PaddyKP Yao
  2022-08-25  7:55                         ` Pavel Machek
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP Yao @ 2022-08-24 10:59 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Hans de Goede, PaddyKP_Yao, acpi4asus-user, andy.shevchenko,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi Pavel,

On Wed, Aug 24, 2022 at 12:06:22PM +0200, Pavel Machek wrote:
> 
> It would be good to get the API right before it hits mainline release.
> 

What do you mean about API you mentioned?

Best Regards, Paddy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-24 10:06           ` [PATCH v2 " Pavel Machek
@ 2022-08-24 11:09             ` PaddyKP Yao
  2022-08-24 11:11               ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP Yao @ 2022-08-24 11:09 UTC (permalink / raw)
  To: Pavel Machek
  Cc: PaddyKP_Yao, andy.shevchenko, hdegoede, acpi4asus-user,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi Pavel,

On Wed, Aug 24, 2022 at 12:06:15PM +0200, Pavel Machek wrote:
> >  drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
> >  include/linux/platform_data/x86/asus-wmi.h |  1 +
> >  3 files changed, 28 insertions(+)
> > 
> > asus->micmute_led.name = "asus::micmute";
> 
> Please see/modify well-known-leds.txt file. We want this consistent on all devices.

Thanks for your feedback.
Do you mean I should use "platform::micmute" instead of "asus::micmute"?

Best Regards, Paddy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-24 11:09             ` PaddyKP Yao
@ 2022-08-24 11:11               ` Hans de Goede
  2022-08-24 11:17                 ` PaddyKP Yao
  0 siblings, 1 reply; 23+ messages in thread
From: Hans de Goede @ 2022-08-24 11:11 UTC (permalink / raw)
  To: PaddyKP Yao, Pavel Machek
  Cc: PaddyKP_Yao, andy.shevchenko, acpi4asus-user, corentin.chary,
	linux-kernel, luke, mgross, platform-driver-x86

Hi,

On 8/24/22 13:09, PaddyKP Yao wrote:
> Hi Pavel,
> 
> On Wed, Aug 24, 2022 at 12:06:15PM +0200, Pavel Machek wrote:
>>>  drivers/platform/x86/asus-wmi.c            | 25 ++++++++++++++++++++++
>>>  include/linux/platform_data/x86/asus-wmi.h |  1 +
>>>  3 files changed, 28 insertions(+)
>>>
>>> asus->micmute_led.name = "asus::micmute";
>>
>> Please see/modify well-known-leds.txt file. We want this consistent on all devices.
> 
> Thanks for your feedback.
> Do you mean I should use "platform::micmute" instead of "asus::micmute"?

Yes. Since I have already merged your original patch can you please make
this a new patch on top of your original patch ?  In other words just
make this 1 small change in the new patch:

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 2d9d709aa59f..18e584eb9f0f 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1060,7 +1060,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
 	}
 
 	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
-		asus->micmute_led.name = "asus::micmute";
+		asus->micmute_led.name = "platform::micmute";
 		asus->micmute_led.max_brightness = 1;
 		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
 		asus->micmute_led.brightness_set_blocking = micmute_led_set;

Regards,

Hans


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-24 11:11               ` Hans de Goede
@ 2022-08-24 11:17                 ` PaddyKP Yao
  2022-08-25  1:29                   ` PaddyKP Yao
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP Yao @ 2022-08-24 11:17 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Pavel Machek, PaddyKP_Yao, andy.shevchenko, acpi4asus-user,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi Hans,

On Wed, Aug 24, 2022 at 01:11:32PM +0200, Hans de Goede wrote:
> Yes. Since I have already merged your original patch can you please make
> this a new patch on top of your original patch ?  In other words just
> make this 1 small change in the new patch:
> 
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 2d9d709aa59f..18e584eb9f0f 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -1060,7 +1060,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
>  	}
>  
>  	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MICMUTE_LED)) {
> -		asus->micmute_led.name = "asus::micmute";
> +		asus->micmute_led.name = "platform::micmute";
>  		asus->micmute_led.max_brightness = 1;
>  		asus->micmute_led.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
>  		asus->micmute_led.brightness_set_blocking = micmute_led_set;
> 
> Regards,
> 
> Hans
> 

Thanks for your advice.
No problem, I will fix it soon.

Best Regards, Paddy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-24 11:17                 ` PaddyKP Yao
@ 2022-08-25  1:29                   ` PaddyKP Yao
  2022-08-25  8:13                     ` Hans de Goede
  0 siblings, 1 reply; 23+ messages in thread
From: PaddyKP Yao @ 2022-08-25  1:29 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Pavel Machek, PaddyKP_Yao, andy.shevchenko, acpi4asus-user,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi Hans,

On Wed, Aug 24, 2022 at 07:17:34PM +0800, PaddyKP Yao wrote:
> Hi Hans,
> 
> On Wed, Aug 24, 2022 at 01:11:32PM +0200, Hans de Goede wrote:
> > Yes. Since I have already merged your original patch can you please make
> > this a new patch on top of your original patch ?  In other words just
> > make this 1 small change in the new patch:

Thanks for your help. I already submited new patch by below mail.
And may I use author PaddyKP_Yao@asus.com instead of my gmail account for
this new patch?

# mail for new patch:
Subject: [PATCH v1 1/1] platform/x86: asus-wmi: Fix name of mic-mute LED classdev
Date: Thu, 25 Aug 2022 08:43:05 +0800
Message-Id: <20220825004305.709539-1-PaddyKP_Yao@asus.com>

Best Regards, Paddy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-24 10:59                       ` PaddyKP Yao
@ 2022-08-25  7:55                         ` Pavel Machek
  2022-08-25  8:05                           ` PaddyKP Yao
  0 siblings, 1 reply; 23+ messages in thread
From: Pavel Machek @ 2022-08-25  7:55 UTC (permalink / raw)
  To: PaddyKP Yao
  Cc: Hans de Goede, PaddyKP_Yao, acpi4asus-user, andy.shevchenko,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

On Wed 2022-08-24 18:59:08, PaddyKP Yao wrote:
> Hi Pavel,
> 
> On Wed, Aug 24, 2022 at 12:06:22PM +0200, Pavel Machek wrote:
> > 
> > It would be good to get the API right before it hits mainline release.
> > 
> 
> What do you mean about API you mentioned?

We really don't want to see asus: prefix in the sysfs.

Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v3 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-25  7:55                         ` Pavel Machek
@ 2022-08-25  8:05                           ` PaddyKP Yao
  0 siblings, 0 replies; 23+ messages in thread
From: PaddyKP Yao @ 2022-08-25  8:05 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Hans de Goede, PaddyKP_Yao, acpi4asus-user, andy.shevchenko,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi Pavel,

On Thu, Aug 25, 2022 at 09:55:47AM +0200, Pavel Machek wrote:
> On Wed 2022-08-24 18:59:08, PaddyKP Yao wrote:
> > Hi Pavel,
> > 
> > On Wed, Aug 24, 2022 at 12:06:22PM +0200, Pavel Machek wrote:
> > > 
> > > It would be good to get the API right before it hits mainline release.
> > > 
> > 
> > What do you mean about API you mentioned?
> 
> We really don't want to see asus: prefix in the sysfs.
> 
> Best regards,
> 								Pavel
> -- 
> People of Russia, stop Putin before his war on Ukraine escalates.

Understand and thanks for your feedback.
I aready submited new patch to fix this.

https://lore.kernel.org/all/20220825004305.709539-1-PaddyKP_Yao@asus.com/

Best Regards, Paddy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support
  2022-08-25  1:29                   ` PaddyKP Yao
@ 2022-08-25  8:13                     ` Hans de Goede
  0 siblings, 0 replies; 23+ messages in thread
From: Hans de Goede @ 2022-08-25  8:13 UTC (permalink / raw)
  To: PaddyKP Yao
  Cc: Pavel Machek, PaddyKP_Yao, andy.shevchenko, acpi4asus-user,
	corentin.chary, linux-kernel, luke, mgross, platform-driver-x86

Hi,

On 8/25/22 03:29, PaddyKP Yao wrote:
> Hi Hans,
> 
> On Wed, Aug 24, 2022 at 07:17:34PM +0800, PaddyKP Yao wrote:
>> Hi Hans,
>>
>> On Wed, Aug 24, 2022 at 01:11:32PM +0200, Hans de Goede wrote:
>>> Yes. Since I have already merged your original patch can you please make
>>> this a new patch on top of your original patch ?  In other words just
>>> make this 1 small change in the new patch:
> 
> Thanks for your help. I already submited new patch by below mail.
> And may I use author PaddyKP_Yao@asus.com instead of my gmail account for
> this new patch?

Yes I will fix-up the author to match the Signed-off-by when applying
the patch.

Regards,

Hans


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-08-25  8:14 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08  8:48 [PATCH 1/1] platform/x86: asus-wmi: Add mic-mute LED classdev support PaddyKP_Yao
2022-07-08  9:07 ` PaddyKP_Yao
2022-07-09 11:44   ` Andy Shevchenko
2022-07-09 14:48     ` Hans de Goede
2022-07-09 14:49     ` Hans de Goede
2022-07-11  2:12       ` PaddyKP Yao(姚國鵬)
2022-07-11  2:40         ` [PATCH v2 " PaddyKP_Yao
2022-07-11  2:47         ` PaddyKP_Yao
2022-07-11  8:50           ` Andy Shevchenko
2022-07-11 11:41             ` PaddyKP Yao
2022-07-11 11:47               ` Hans de Goede
2022-07-11 11:51                 ` [PATCH v3 " PaddyKP_Yao
2022-07-14 20:04                   ` Hans de Goede
2022-08-24 10:06                     ` Pavel Machek
2022-08-24 10:59                       ` PaddyKP Yao
2022-08-25  7:55                         ` Pavel Machek
2022-08-25  8:05                           ` PaddyKP Yao
2022-08-24 10:06           ` [PATCH v2 " Pavel Machek
2022-08-24 11:09             ` PaddyKP Yao
2022-08-24 11:11               ` Hans de Goede
2022-08-24 11:17                 ` PaddyKP Yao
2022-08-25  1:29                   ` PaddyKP Yao
2022-08-25  8:13                     ` Hans de Goede

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).