[PATCH 3/3] platform/x86: huawei-wmi: Remove unnecessary battery mutex

2019-10-20 Thread Ayman Bagabas
battery_lock mutex is never used and not needed. Fixes: 355a070b09ab ("platform/x86: huawei-wmi: Add battery charging thresholds") Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/platform/x86/huawe

[PATCH 2/3] platform/x86: huawei-wmi: No need to check for battery name

2019-10-20 Thread Ayman Bagabas
No need to check for battery name, we already check if the WMI function is available in huawei_wmi_battery_setup. Fixes: 355a070b09ab ("platform/x86: huawei-wmi: Add battery charging thresholds") Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 4 1 file

[PATCH 1/3] platform/x86: huawei-wmi: Stricter battery thresholds set

2019-10-20 Thread Ayman Bagabas
Check if battery thresholds are within 0 and 100. Fixes: 355a070b09ab ("platform/x86: huawei-wmi: Add battery charging thresholds") Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/

[PATCH] platform/x86: huawei-wmi: Remove unnecessary battery mutex

2019-10-19 Thread Ayman Bagabas
battery_lock mutex is never used and not needed. Fixes: 355a070b09ab ("platform/x86: huawei-wmi: Add battery charging thresholds") Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/platform/x86/huawe

Re: [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name

2019-10-19 Thread ayman . bagabas
On Fri, 2019-10-18 at 18:42 -0400, Ayman Bagabas wrote: > No need to check for battery name, we already check if the WMI > function is > available in huawei_wmi_battery_setup. Signed-off-by: Ayman Bagabas Thank you, Ayman > --- > drivers/platform/x86/huawei-wmi.c | 4 >

Re: [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set

2019-10-19 Thread ayman . bagabas
On Sat, 2019-10-19 at 11:31 +0300, Dan Carpenter wrote: > On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote: > > Check if battery thresholds are within 0 and 100. > > --- > > Thanks! > > Don't forget to add your Signed-off-by: though. Signed-off-by:

[PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set

2019-10-18 Thread Ayman Bagabas
Check if battery thresholds are within 0 and 100. --- drivers/platform/x86/huawei-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 5837d1b8693d..26041d44286a 100644 --- a/drivers/platform/x86/huaw

[PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name

2019-10-18 Thread Ayman Bagabas
No need to check for battery name, we already check if the WMI function is available in huawei_wmi_battery_setup. --- drivers/platform/x86/huawei-wmi.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 26041d44286a..

Re: [PATCH] platform/x86: huawei-wmi: Fix misuse of strcmp() function

2019-10-15 Thread ayman . bagabas
Hi Gustavo, On Tue, 2019-10-15 at 13:25 -0500, Gustavo A. R. Silva wrote: > Comparing the result of strcmp directly with 1 may cause it to be > misinterpreted. Note that strcmp may return an integer besides -1, > 0, or 1. > > Fix this by returning -ENODEV only when strcmp() returns a value > othe

Re: [PATCH] platform/x86: huawei-wmi: make validation stricter in huawei_wmi_battery_set()

2019-10-15 Thread ayman . bagabas
On Tue, 2019-10-15 at 15:46 +0300, Dan Carpenter wrote: > On Tue, Oct 15, 2019 at 08:21:59AM -0400, Ayman Bagabas wrote: > > Hi Dan > > > > On Tue, Oct 15, 2019, 4:39 AM Dan Carpenter < > > dan.carpen...@oracle.com> > > wrote: > > > > > I

[PATCH v5 5/6] platform/x86: huawei-wmi: Add fn-lock support

2019-09-23 Thread Ayman Bagabas
Huawei Matebook laptops uses Fn key and toggle to access F1-F12 keys. Along with that, there is this feature called fn-lock that inverts the behavior of this Fn key and the F1-F12 row. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 85 +++ 1

[PATCH v5 6/6] platform/x86: huawei-wmi: Add debugfs support

2019-09-23 Thread Ayman Bagabas
Add a debugfs interface that can be used to call the WMI management interface function if available. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 97 +++ 1 file changed, 97 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b

[PATCH v5 4/6] platform/x86: huawei-wmi: Add battery charging thresholds

2019-09-23 Thread Ayman Bagabas
Control battery charge thresholds through the battery API and driver's attributes. Setting battery charging thresholds can introduce a race condition with MACH-WX9 where two or more threads are trying to read/write values from/to EC memory. Signed-off-by: Ayman Bagabas --- drivers/platfor

[PATCH v5 1/6] platform/x86: huawei-wmi: Move to platform driver

2019-09-23 Thread Ayman Bagabas
HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/Kconfig | 7 +- drivers/platform/x86/huawei-wmi.c | 226 -- 2 files changed, 156 insertions(+), 77 deletions(-) diff --git a/dr

[PATCH v5 0/6] platform/x86: Huawei WMI laptop extras driver

2019-09-23 Thread Ayman Bagabas
not currently implemented. Use ACPI EC method to control this led. and the 2 parameters can enforce the behavior of quirk 1 & 2. # Add a debugfs interface to WMI An interface to the WMI management interface that allows easier debugging. Ayman Bagabas (6): platform/x86: huawei-wmi: Move t

[PATCH v5 2/6] platform/x86: huawei-wmi: Add quirks and module parameters

2019-09-23 Thread Ayman Bagabas
Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 73 +++ 1 file changed, 73 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 9496ea3c78b5..0e919bf56ad1 100644 --- a/drivers/platform/x86/hua

[PATCH v5 3/6] platform/x86: huawei-wmi: Implement huawei wmi management

2019-09-23 Thread Ayman Bagabas
Huawei Matebook laptops come with a WMI management interface that can control various aspects of the device. This interface is also found on the old Matebook X released in 2017. Use that to control the mic mute LED. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 217

[PATCH v4 6/6] platform/x86: huawei-wmi: Add debugfs support

2019-09-20 Thread Ayman Bagabas
Add a debugfs interface that can be used to call the WMI management interface function if available. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 97 +++ 1 file changed, 97 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b

[PATCH v4 4/6] platform/x86: huawei-wmi: Add battery charging thresholds

2019-09-20 Thread Ayman Bagabas
Control battery charge thresholds through the battery API and driver's attributes. Setting battery charging thresholds can introduce a race condition with MACH-WX9 where two or more threads are trying to read/write values from/to EC memory. Signed-off-by: Ayman Bagabas --- drivers/platfor

[PATCH v4 5/6] platform/x86: huawei-wmi: Add fn-lock support

2019-09-20 Thread Ayman Bagabas
Huawei Matebook laptops uses Fn key and toggle to access F1-F12 keys. Along with that, there is this feature called fn-lock that inverts the behavior of this Fn key and the F1-F12 row. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 85 +++ 1

[PATCH v4 3/6] platform/x86: huawei-wmi: Implement huawei wmi management

2019-09-20 Thread Ayman Bagabas
Huawei Matebook laptops come with a WMI management interface that can control various aspects of the device. This interface is also found on the old Matebook X released in 2017. Use that to control the mic mute LED. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 217

[PATCH v4 2/6] platform/x86: huawei-wmi: Add quirks and module parameters

2019-09-20 Thread Ayman Bagabas
Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 73 +++ 1 file changed, 73 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 9496ea3c78b5..0e919bf56ad1 100644 --- a/drivers/platform/x86/hua

[PATCH v4 1/6] platform/x86: huawei-wmi: Move to platform driver

2019-09-20 Thread Ayman Bagabas
HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/Kconfig | 7 +- drivers/platform/x86/huawei-wmi.c | 226 -- 2 files changed, 156 insertions(+), 77 deletions(-) diff --git a/dr

[PATCH v4 0/6] platform/x86: Huawei WMI laptop extras driver

2019-09-20 Thread Ayman Bagabas
ntrol this led. and the 2 parameters can enforce the behavior of quirk 1 & 2. # Add a debugfs interface to WMI An interface to the WMI management interface that allows easier debugging. Ayman Bagabas (6): platform/x86: huawei-wmi: Move to platform driver platform/x86: huawei-wmi: Add quirks

[PATCH v3 4/6] platform/x86: huawei-wmi: Add battery charging thresholds

2019-09-19 Thread Ayman Bagabas
Control battery charge thresholds through the battery API and driver's attributes. Setting battery charging thresholds can introduce a race condition with MACH-WX9 where two or more threads are trying to read/write values from/to EC memory. Signed-off-by: Ayman Bagabas --- drivers/platfor

[PATCH v3 6/6] platform/x86: huawei-wmi: Add debugfs support

2019-09-19 Thread Ayman Bagabas
Add a debugfs interface that can be used to call the WMI management interface function if available. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 91 +++ 1 file changed, 91 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b

[PATCH v3 2/6] platform/x86: huawei-wmi: Add quirks and module parameters

2019-09-19 Thread Ayman Bagabas
Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 77 +++ 1 file changed, 77 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 9496ea3c78b5..97ff3d868765 100644 --- a/drivers/platform/x86/hua

[PATCH v3 3/6] platform/x86: huawei-wmi: Implement huawei wmi management

2019-09-19 Thread Ayman Bagabas
Huawei Matebook laptops come with a WMI management interface that can control various aspects of the device. This interface is also found on the old Matebook X released in 2017. Use that to control the mic mute LED. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 217

[PATCH v3 5/6] platform/x86: huawei-wmi: Add fn-lock support

2019-09-19 Thread Ayman Bagabas
Huawei Matebook laptops uses Fn key and toggle to access F1-F12 keys. Along with that, there is this feature called fn-lock that inverts the behavior of this Fn key and the F1-F12 row. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 85 +++ 1

[PATCH v3 1/6] platform/x86: huawei-wmi: Move to platform driver

2019-09-19 Thread Ayman Bagabas
HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/Kconfig | 7 +- drivers/platform/x86/huawei-wmi.c | 226 -- 2 files changed, 156 insertions(+), 77 deletions(-) diff --git a/dr

[PATCH v3 0/6] platform/x86: Huawei WMI laptop extras driver

2019-09-19 Thread Ayman Bagabas
havior of quirk 1 & 2. # Add a debugfs interface to WMI An interface to the WMI management interface that allows easier debugging. Ayman Bagabas (6): platform/x86: huawei-wmi: Move to platform driver platform/x86: huawei-wmi: Add quirks and module parameters platform/x86: huawei-wmi: Imp

[PATCH v2 5/6] platform/x86: huawei-wmi: Add fn-lock support

2019-09-18 Thread Ayman Bagabas
Huawei Matebook laptops uses Fn key and toggle to access F1-F12 keys. Along with that, there is this feature called fn-lock that inverts the behavior of this Fn key and the F1-F12 row. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 85 +++ 1

[PATCH v2 4/6] platform/x86: huawei-wmi: Add battery charging thresholds

2019-09-18 Thread Ayman Bagabas
Controll battery charge thresholds through the battery API and driver's attributes. Setting battery charging thresholds can introduce a race condition with MACH-WX9 where two or more threads are trying to read/write values from/to EC memory. Signed-off-by: Ayman Bagabas --- drivers/pla

[PATCH v2 6/6] platform/x86: huawei-wmi: Add debugfs support

2019-09-18 Thread Ayman Bagabas
Add a debugfs interface that can be used to call the WMI management interface function if available. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 91 +++ 1 file changed, 91 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b

[PATCH v2 3/6] platform/x86: huawei-wmi: Implement huawei wmi management

2019-09-18 Thread Ayman Bagabas
Huawei Matebook laptops come with a WMI management interface that can control various aspects of the device. This interface is also found on the old Matebook X released in 2017. Use that to control the mic mute LED. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 217

[PATCH v2 2/6] platform/x86: huawei-wmi: Add quirks and module parameters

2019-09-18 Thread Ayman Bagabas
Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 77 +++ 1 file changed, 77 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 9496ea3c78b5..97ff3d868765 100644 --- a/drivers/platform/x86/hua

[PATCH v2 1/6] platform/x86: huawei-wmi: Move to platform driver

2019-09-18 Thread Ayman Bagabas
HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 226 -- 1 file changed, 153 insertions(+), 73 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/pla

[PATCH v2 0/6] platform/x86: Huawei WMI laptop extras driver

2019-09-18 Thread Ayman Bagabas
ebook X (2017) handles micmute led through the "legacy" interface which is not currently implemented. Use ACPI EC method to control this led. and the 2 parameters can enforce the behavior of quirk 1 & 2. # Add a debugfs interface to WMI An interface to the WMI manageme

[RFC 1/9] platform/x86: huawei-wmi: Rename guid and driver name

2019-07-31 Thread Ayman Bagabas
Use WMI device UID, AMW0 has a UID of HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Change module description to reflect the upcoming changes. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 14 -- 1 file changed, 8 insertions(

[RFC 1/9] platform/x86: huawei-wmi: Rename guid and driver name

2019-07-31 Thread Ayman Bagabas
Use WMI device UID, AMW0 has a UID of HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Change module description to reflect the upcoming changes. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 14 -- 1 file changed, 8 insertions(

[RFC 7/9] platform/x86: huawei-wmi: Add fn-lock support

2019-07-31 Thread Ayman Bagabas
-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index da3986cd0428..4159e10bda26 100644 --- a/drivers/platform/x86/huawei-wmi.c +++ b

[RFC 4/9] platform/x86: huawei-wmi: Add quirks and module parameters

2019-07-31 Thread Ayman Bagabas
(2017) handles micmute led through the "legacy" interface which is not currently implemented. Use ACPI EC method to control this led. 2 module parameters are added to enable this short delay and/or report brightness keys through this driver. Signed-off-by: Ayman Bagabas --- drive

[RFC 6/9] platform/x86: huawei-wmi: Add battery charging thresholds

2019-07-31 Thread Ayman Bagabas
to set the thresholds to (0,0) before setting it to (0,100). This will ensure that we update these values in EC memory and then turning it off with (0,100). Thus, the msleep(1000). Signed-off-by: Ayman Bagabas --- In huawei_wmi_battery_get and later in huawei_wmi_fn_lock_get, 256 bytes buffer is

[RFC 8/9] platform/x86: huawei-wmi: Add sysfs interface support

2019-07-31 Thread Ayman Bagabas
Add sysfs interface to enable the use of battery charging thresholds and fn-lock support introduced in this series. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 82 +++ 1 file changed, 82 insertions(+) diff --git a/drivers/platform/x86/huawei

[RFC 9/9] platform/x86: huawei-wmi: Add debugfs support

2019-07-31 Thread Ayman Bagabas
buffer. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 98 +++ 1 file changed, 98 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index f7041fb71026..bdca8bd76c8c 100644 --- a/drivers/platform/x86

[RFC 3/9] platform/x86: huawei-wmi: Implement huawei wmi management interface

2019-07-31 Thread Ayman Bagabas
. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 130 ++ 1 file changed, 130 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 12cae450fc1f..27520b0f8956 100644 --- a/drivers/platform/x86/huawei

[RFC 2/9] platform/x86: huawei-wmi: Move to platform driver

2019-07-31 Thread Ayman Bagabas
Move from WMI driver to platform driver. This move is necessary since the driver is no longer a hotkeys driver only. Platform driver makes it easier for users to access sysfs attributes under (i.e. /sys/devices/platform/huawei-wmi) compared to wmi driver. Signed-off-by: Ayman Bagabas --- Do you

[RFC 5/9] platform/x86: huawei-wmi: Control micmute led through wmi interface

2019-07-31 Thread Ayman Bagabas
implemented ATM. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 86 ++- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 8f918138053a..9013a05d2832 100644 --- a

[RFC 0/9] platform/x86: Huawei WMI laptop extras driver

2019-07-31 Thread Ayman Bagabas
e "legacy" interface which is not currently implemented. Use ACPI EC method to control this led. and the 2 parameters can enforce the behavior of quirk 1 & 2. # Add a debugfs interface to WMI An interface to the WMI management interface that allows easier debugging. Ayman Bagabas

Re: [RFC 0/9] platform/x86: Huawei WMI laptop extras driver

2019-07-30 Thread Ayman Bagabas
On 19/07/25 04:05PM, Ayman Bagabas wrote: > On 19/07/25 08:33PM, Andy Shevchenko wrote: > > On Sun, Jun 30, 2019 at 8:41 AM Ayman Bagabas > > wrote: > > > > > > This patch series introduce changes to huawei-wmi driver that includes: > > > * Mov

Re: [RFC 0/9] platform/x86: Huawei WMI laptop extras driver

2019-07-25 Thread Ayman Bagabas
On 19/07/25 08:33PM, Andy Shevchenko wrote: > On Sun, Jun 30, 2019 at 8:41 AM Ayman Bagabas wrote: > > > > This patch series introduce changes to huawei-wmi driver that includes: > > * Move to platform driver > > * Implement WMI management interface > > * Ad

Re: [PATCH v2 0/8] platform/x86: Huawei WMI laptop extras driver

2019-06-30 Thread ayman . bagabas
On Sat, 2019-06-29 at 17:27 +0300, Andy Shevchenko wrote: > On Thu, Jun 13, 2019 at 6:04 AM Ayman Bagabas < > ayman.baga...@gmail.com> wrote: > > Changes from v1: > > * introducing debugfs > > * code reformatting > > > > This patch series introduce new

[RFC 7/9] platform/x86: huawei-wmi: Add fn-lock support

2019-06-29 Thread Ayman Bagabas
-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index da3986cd0428..4159e10bda26 100644 --- a/drivers/platform/x86/huawei-wmi.c +++ b

[RFC 8/9] platform/x86: huawei-wmi: Add sysfs interface support

2019-06-29 Thread Ayman Bagabas
Add sysfs interface to enable the use of battery charging thresholds and fn-lock support introduced in this series. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 82 +++ 1 file changed, 82 insertions(+) diff --git a/drivers/platform/x86/huawei

[RFC 9/9] platform/x86: huawei-wmi: Add debugfs support

2019-06-29 Thread Ayman Bagabas
buffer. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 98 +++ 1 file changed, 98 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index f7041fb71026..bdca8bd76c8c 100644 --- a/drivers/platform/x86

[RFC 6/9] platform/x86: huawei-wmi: Add battery charging thresholds

2019-06-29 Thread Ayman Bagabas
to set the thresholds to (0,0) before setting it to (0,100). This will ensure that we update these values in EC memory and then turning it off with (0,100). Thus, the msleep(1000). Signed-off-by: Ayman Bagabas --- In huawei_wmi_battery_get and later in huawei_wmi_fn_lock_get, 256 bytes buffer is

[RFC 5/9] platform/x86: huawei-wmi: Control micmute led through wmi interface

2019-06-29 Thread Ayman Bagabas
implemented ATM. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 86 ++- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 8f918138053a..9013a05d2832 100644 --- a

[RFC 0/9] platform/x86: Huawei WMI laptop extras driver

2019-06-29 Thread Ayman Bagabas
e "legacy" interface which is not currently implemented. Use ACPI EC method to control this led. and the 2 parameters can enforce the behavior of quirk 1 & 2. # Add a debugfs interface to WMI An interface to the WMI management interface that allows easier debugging. Ayman Bagabas

[RFC 2/9] platform/x86: huawei-wmi: Move to platform driver

2019-06-29 Thread Ayman Bagabas
Move from WMI driver to platform driver. This move is necessary since the driver is no longer a hotkeys driver only. Platform driver makes it easier for users to access sysfs attributes under (i.e. /sys/devices/platform/huawei-wmi) compared to wmi driver. Signed-off-by: Ayman Bagabas --- Do you

[RFC 3/9] platform/x86: huawei-wmi: Implement huawei wmi management interface

2019-06-29 Thread Ayman Bagabas
. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 130 ++ 1 file changed, 130 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 12cae450fc1f..27520b0f8956 100644 --- a/drivers/platform/x86/huawei

[RFC 4/9] platform/x86: huawei-wmi: Add quirks and module parameters

2019-06-29 Thread Ayman Bagabas
(2017) handles micmute led through the "legacy" interface which is not currently implemented. Use ACPI EC method to control this led. 2 module parameters are added to enable this short delay and/or report brightness keys through this driver. Signed-off-by: Ayman Bagabas --- drive

[RFC 1/9] platform/x86: huawei-wmi: Rename guid and driver name

2019-06-29 Thread Ayman Bagabas
Use WMI device UID, AMW0 has a UID of HWMI. WMI0 is the device name and doesn't have a UID so keep it as it is. Change module description to reflect the upcoming changes. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 14 -- 1 file changed, 8 insertions(

[PATCH v2 2/8] platform/x86: huawei-wmi: implement WMI management interface

2019-06-13 Thread Ayman Bagabas
it argument but returns one 260 byte buffer (265+4). Right now, this interface doesn't offer any usability for MateBook X (2017) except for fn-lock and debugfs. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 127 ++ 1 file changed, 127 insertion

[PATCH v2 0/8] platform/x86: Huawei WMI laptop extras driver

2019-06-13 Thread Ayman Bagabas
ce is also implemented to support unrepresented features and to provide debugging feedback from users. Ayman Bagabas (8): platform/x86: huawei-wmi: move to platform driver platform/x86: huawei-wmi: implement WMI management interface platform/x86: huawei-wmi: use quirks and module parameters

[PATCH v2 1/8] platform/x86: huawei-wmi: move to platform driver

2019-06-13 Thread Ayman Bagabas
ops. WMI0 is the device name and has no UID, therefore, left as it is. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 231 -- 1 file changed, 154 insertions(+), 77 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/hua

[PATCH v1] platform/x86: Huawei laptop extras driver

2019-06-13 Thread Ayman Bagabas
mory. These parameters are implemented as quirks along with `ec_micmute` quirk which controls the micmute LED through ACPI EC interface. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 630 +- 1 file changed, 541 insertions(+), 89 deletions(

[PATCH v2 3/8] platform/x86: huawei-wmi: use quirks and module parameters

2019-06-13 Thread Ayman Bagabas
UFF) /* \SBTT.BUFF */ // bit thresh thresh } ASL code taken from MateBook X Pro (MACH-WX9) showing how it turns off protection without changing values. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 71 +++ 1 file changed, 71 insertions

[PATCH v2 5/8] platform/x86: huawei-wmi: add battery charging protection support

2019-06-13 Thread Ayman Bagabas
Some models that implement the new WMI management interface can control battery charging thresholds where it limits charging the battery once it reaches certain thresholds. This feature is not present in MateBook X (2017). Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 56

[PATCH v2 4/8] platform/x86: huawei-wmi: control micmute LED through WMI interface

2019-06-13 Thread Ayman Bagabas
quot; interface is used for hotkeys on this specific model. A quirk is set to use ACPI method to control micmute LED on MateBook X (2017). Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 74 ++- 1 file changed, 42 insertions(+), 32 deletions(-)

[PATCH v2 6/8] platform/x86: huawei-wmi: add fn-lock support

2019-06-13 Thread Ayman Bagabas
s are treated as special keys and using a modifier gives special keys. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c in

[PATCH v2 8/8] platform/x86: huawei-wmi: add debugfs files support

2019-06-13 Thread Ayman Bagabas
A debugfs interface that creates two attributes `arg` and `call` to set an argument to be called by the WMI device and show the results returned. This argument is a 64 bit long which complies the properties of the HWMI interface. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei

[PATCH v2 7/8] platform/x86: huawei-wmi: add sysfs interface support

2019-06-13 Thread Ayman Bagabas
writing permissions of these attributes. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 87 +++ 1 file changed, 87 insertions(+) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index aac9b80f9976..cc6745ff1bad

Re: [PATCH v1] platform/x86: Huawei laptop extras driver

2019-05-23 Thread ayman . bagabas
I'm really sorry, I just realized the changes are a lot and unreadable. Changes should be splitted into a series and resubmitted. On Thu, 2019-05-23 at 05:31 -0400, Ayman Bagabas wrote: > This patch introduces new features to the driver and also moves the > driver from wm

[PATCH v1] platform/x86: Huawei laptop extras driver

2019-05-23 Thread Ayman Bagabas
mory. These parameters are implemented as quirks along with `ec_micmute` quirk which controls the micmute LED through ACPI EC interface. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/huawei-wmi.c | 630 +- 1 file changed, 541 insertions(+), 89 deletions(

[PATCH] ALSA: Enable micmute LED for Huawei laptops

2019-05-23 Thread Ayman Bagabas
Since this LED is found on all Huawei laptops, we can hook it to huawei-wmi platform driver to control it. Also, some renames have been made to use product name instead of common name to avoid confusions. Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 9 - 1 file

Re: [PATCH v1 1/2] platform/x86: Huawei WMI laptop extras driver update

2019-05-15 Thread ayman . bagabas
On Wed, 2019-05-15 at 15:10 +0200, Takashi Iwai wrote: > On Mon, 13 May 2019 22:30:05 +0200, > Ayman Bagabas wrote: > > This update brings on the use of WMI BIOS management interface > > found on > > Huawei laptops. This interface can control the micmute LED found on >

Re: [PATCH v1 2/2] sound: Enable micmute led for Huawei laptops

2019-05-15 Thread ayman . bagabas
On Wed, 2019-05-15 at 15:11 +0200, Takashi Iwai wrote: > On Mon, 13 May 2019 22:30:06 +0200, > Ayman Bagabas wrote: > > Since this LED is found on huawei laptops, we can hook it to > > huawei-wmi platform driver which uses the common WMI interface > > present > > i

[PATCH v1 1/2] platform/x86: Huawei WMI laptop extras driver update

2019-05-13 Thread Ayman Bagabas
This update brings on the use of WMI BIOS management interface found on Huawei laptops. This interface can control the micmute LED found on most of these laptops, control charging thresholds values, and control fn-lock feature. Signed-off-by: Ayman Bagabas --- drivers/platform/x86/Kconfig

[PATCH v1 2/2] sound: Enable micmute led for Huawei laptops

2019-05-13 Thread Ayman Bagabas
Since this LED is found on huawei laptops, we can hook it to huawei-wmi platform driver which uses the common WMI interface present in these laptops to control the LED. I've also made some renames and used product name instead of common name to avoid confusion. Signed-off-by: Ayman Ba

[PATCH v1 0/2] Huawei WMI laptop extras driver

2019-05-13 Thread Ayman Bagabas
, and fn-lock. We enable sound micmute hooks to platform driver on Huawei laptops to get the LED to work. Ayman Bagabas (2): platform/x86: Huawei WMI laptop extras driver update sound: Enable micmute led for Huawei laptops drivers/platform/x86/Kconfig | 8 +- drivers/platform/x86/huawei

[PATCH v11 1/3] ALSA: hda: fix front speakers on Huawei MBXP.

2018-12-12 Thread Ayman Bagabas
Reviewed-by: Andy Shevchenko Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 993d34c141c2..77ee471a67e5 100644 -

[PATCH v11 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-12 Thread Ayman Bagabas
. Another solution would be to leave this to user-space to handle. Which can be achieved by using "hwdb" tables and remap those keys to "unknown". This solution seems more natural to me because it leaves the decision to user-space. Acked-by: Andy Shevchenko Reviewed-by: Takash

[PATCH v11 3/3] ALSA: hda: add support for Huawei WMI micmute LED

2018-12-12 Thread Ayman Bagabas
Some of Huawei laptops come with a LED in the micmute key. This patch enables the use of micmute LED for these devices: 1. Matebook X (19e5:3200), (19e5:3201) 2. Matebook X Pro (19e5:3204) Reviewed-by: Andy Shevchenko Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda

[PATCH v11 0/3] Huawei laptops

2018-12-12 Thread Ayman Bagabas
Changes in v5: * Consistency in file names * How module would be enabled (Kconfig) * Match license in SPDX and MODULE_LICENSE Changes in v4: * Code formatting Changes in v3: * Support for Huawei MBX * Style and formatting issues Ayman Bagabas (3): ALSA: hda: fix front speakers on Huawei MBXP

Re: [PATCH v10 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-11 Thread ayman . bagabas
On Tue, 2018-12-11 at 12:14 +0200, Andy Shevchenko wrote: > On Tue, Dec 11, 2018 at 8:02 AM Ayman Bagabas < > ayman.baga...@gmail.com> wrote: > > This driver adds support for missing hotkeys on some Huawei > > laptops. > > Laptops such as the Matebook X have non fu

[PATCH v10 3/3] ALSA: hda: add support for Huawei WMI micmute LED

2018-12-10 Thread Ayman Bagabas
Some of Huawei laptops come with a LED in the micmute key. This patch enables the use of micmute LED for these devices: 1. Matebook X (19e5:3200), (19e5:3201) 2. Matebook X Pro (19e5:3204) Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 6 +- 1

[PATCH v10 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-10 Thread Ayman Bagabas
. Another solution would be to leave this to user-space to handle. Which can be achieved by using "hwdb" tables and remap those keys to "unknown". This solution seems more natural to me because it leaves the decision to user-space. Reviewed-by: Takashi Iwai Signed-off-by

[PATCH v10 1/3] ALSA: hda: fix front speakers on Huawei MBXP.

2018-12-10 Thread Ayman Bagabas
Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 993d34c141c2..1326f32f4574 100644 --- a/sound/pci/hda/patch_realt

[PATCH v10 0/3] Huawei laptops

2018-12-10 Thread Ayman Bagabas
names * How module would be enabled (Kconfig) * Match license in SPDX and MODULE_LICENSE Changes in v4: * Code formatting Changes in v3: * Support for Huawei MBX * Style and formatting issues Ayman Bagabas (3): ALSA: hda: fix front speakers on Huawei MBXP. x86: add support for Huawei WMI

Re: [PATCH v9 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-07 Thread ayman . bagabas
On Fri, 2018-12-07 at 00:52 -0500, ayman.baga...@gmail.com wrote: On Mon, 2018-12-03 at 21:17 +0200, Andy Shevchenko wrote: > On Mon, Dec 3, 2018 at 9:04 PM Takashi Iwai wrote: > > On Mon, 03 Dec 2018 19:53:39 +0100, > > Ayman Bagabas wrote: > > >

Re: [PATCH v9 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-04 Thread ayman . bagabas
On Mon, 2018-12-03 at 21:17 +0200, Andy Shevchenko wrote: > On Mon, Dec 3, 2018 at 9:04 PM Takashi Iwai wrote: > > On Mon, 03 Dec 2018 19:53:39 +0100, > > Ayman Bagabas wrote: > > > + if (code == 0x80) { > > > + acpi_status status; >

Re: [PATCH v9 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-04 Thread ayman . bagabas
On Mon, 2018-12-03 at 11:41 -0800, Randy Dunlap wrote: > On 12/3/18 10:53 AM, Ayman Bagabas wrote: > > This driver adds support for missing hotkeys on some Huawei > > laptops. > > Laptops such as the Matebook X have non functioning hotkeys. > > Whereas > > newer l

[PATCH v9 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-03 Thread Ayman Bagabas
. Another solution would be to leave this to user-space to handle. Which can be achieved by using "hwdb" tables and remap those keys to "unknown". This solution seems more natural to me because it leaves the decision to user-space. Signed-off-by: Ayman Bagabas --- drivers/pla

[PATCH v9 3/3] ALSA: hda: add support for Huawei WMI micmute LED

2018-12-03 Thread Ayman Bagabas
Some of Huawei laptops come with a LED in the micmute key. This patch enables the use of micmute LED for these devices: 1. Matebook X (19e5:3200), (19e5:3201) 2. Matebook X Pro (19e5:3204) Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 6 +- 1

[PATCH v9 0/3] Huawei laptops

2018-12-03 Thread Ayman Bagabas
and formatting issues Ayman Bagabas (3): ALSA: hda: fix front speakers on Huawei MBXP. x86: add support for Huawei WMI hotkeys. ALSA: hda: add support for Huawei WMI micmute LED drivers/platform/x86/Kconfig | 16 +++ drivers/platform/x86/Makefile | 1 + drivers/platform/x86/huawei

[PATCH v9 1/3] ALSA: hda: fix front speakers on Huawei MBXP.

2018-12-03 Thread Ayman Bagabas
Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 993d34c141c2..1326f32f4574 100644 --- a/sound/pci/hda/patch_realt

Re: [PATCH v8 3/3] ALSA: hda: add support for Huawei WMI micmute LED

2018-12-03 Thread ayman . bagabas
On Mon, 2018-12-03 at 13:00 +0100, Takashi Iwai wrote: > On Fri, 30 Nov 2018 00:57:38 +0100, > Ayman Bagabas wrote: > > Some of Huawei laptops come with a LED in the micmute key. This > > patch > > enables the use of micmute LED for these devices: > > 1. Matebook X

Re: [PATCH v8 2/3] x86: add support for Huawei WMI hotkeys.

2018-12-03 Thread ayman . bagabas
On Mon, 2018-12-03 at 13:00 +0100, Takashi Iwai wrote: > On Fri, 30 Nov 2018 00:57:37 +0100, > Ayman Bagabas wrote: > > This driver adds support for missing hotkeys on some Huawei > > laptops. > > Laptops such as the Matebook X have non functioning hotkeys. > > Whe

[PATCH v8 2/3] x86: add support for Huawei WMI hotkeys.

2018-11-29 Thread Ayman Bagabas
. Another solution would be to leave this to user-space to handle. Which can be achieved by using "hwdb" tables and remap those keys to "unknown". This solution seems more natural to me because it leaves the decision to user-space. Signed-off-by: Ayman Bagabas --- drivers/pl

[PATCH v8 1/3] ALSA: hda: fix front speakers on Huawei MBXP.

2018-11-29 Thread Ayman Bagabas
Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas --- sound/pci/hda/patch_realtek.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 993d34c141c2..1326f32f4574 100644 --- a/sound/pci/hda/patch_realt

  1   2   >