classmate-laptop: add missing input_sync call
Subsystems (2)
PATCH 1/2 classmate-laptop: add missing input_sync call
Add missing input_sync call in cmpc_keys_handler function.
--- drivers/platform/x86/classmate-laptop.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/platform/x86/classmate-laptop.c +1 -0
@@ -655,6 +655,7 @@ static void cmpc_keys_handler(struct acpi_device *dev, u32 event) code = cmpc_keys_codes[event &0x0F ]; inputdev =dev_get_drvdata (&dev->dev);;input_report_key (inputdev, code, !(event &0x10 )); +input_sync (inputdev); }static void cmpc_keys_idev_init (struct input_dev *inputdev)
Signature · 1 line
1.7.3.2
PATCH 2/2 classmate-laptop: little optimization for cmpc_rfkill_block
We don't need to call bios/acpi (cmpc_set_rfkill_wlan) if the blocked state is already set to the same value (little optimization). This can happen for example if we initialize the module with same initial hardware state (rfkill core always call cmpc_rfkill_block on initialization here).
Also GWRI method only accepts 0 or 1 for setting rfkill block, as can be seen on AML code from acpidump->DSDT from a classmate sample I have, so should be fine setting state only to 0 or 1 directly.
--- drivers/platform/x86/classmate-laptop.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
drivers/platform/x86/classmate-laptop.c +9 -7
@@ -522,18 +522,20 @@ static int cmpc_rfkill_block(void *data, bool blocked)acpi_status status;acpi_handle handle;unsigned long long state; +bool is_blocked; handle = data; status =cmpc_get_rfkill_wlan (handle, &state);if (ACPI_FAILURE (status))return -ENODEV ; -if (blocked) - state &= ~1 ; -else - state |=1 ; - status =cmpc_set_rfkill_wlan (handle, state); -if (ACPI_FAILURE (status)) -return -ENODEV ; +/* Check if we really need to call cmpc_set_rfkill_wlan */ + is_blocked = state &1 ? false : true; +if (is_blocked != blocked) { + state = blocked ?0 :1 ; + status =cmpc_set_rfkill_wlan (handle, state); +if (ACPI_FAILURE (status)) +return -ENODEV ; + }return 0 ; }
Signature · 1 line
1.7.3.2
Re: [PATCH 2/2] classmate-laptop: little optimization for cmpc_rfkill_block
Quoted 51 lines · Herton Ronaldo Krzesinski
We don't need to call bios/acpi (
cmpc_set_rfkill_wlan) if the blocked state is already set to the same value (little optimization). This can happen for example if we initialize the module with same initial hardware state (rfkill core always callcmpc_rfkill_blockon initialization here).Also GWRI method only accepts 0 or 1 for setting rfkill block, as can be seen on AML code from
acpidump->DSDTfrom a classmate sample I have, so should be fine setting state only to 0 or 1 directly.Signed-off-by Herton Ronaldo Krzesinski <[email protected]>Cc Thadeu Lima de Souza Cascardo <[email protected]>--- drivers/platform/x86/classmate-laptop.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)drivers/platform/x86/classmate-laptop.c +9
-7@@ -522,18 +522,20 @@ static int cmpc_rfkill_block(void *data, bool blocked)acpi_status status;acpi_handle handle;unsigned long long state; +bool is_blocked; handle = data; status =cmpc_get_rfkill_wlan (handle, &state);if (ACPI_FAILURE (status))return -ENODEV ; -if (blocked) - state &= ~1 ; -else - state |=1 ; - status =cmpc_set_rfkill_wlan (handle, state); -if (ACPI_FAILURE (status)) -return -ENODEV ; +/* Check if we really need to call cmpc_set_rfkill_wlan */ + is_blocked = state &1 ? false : true; +if (is_blocked != blocked) { + state = blocked ?0 :1 ; + status =cmpc_set_rfkill_wlan (handle, state); +if (ACPI_FAILURE (status)) +return -ENODEV ; + }return 0 ; }Signature · 1 line
1.7.3.2
Quoted 23 lines · Herton Ronaldo Krzesinski
Add missing
input_synccall incmpc_keys_handlerfunction.Signed-off-by Herton Ronaldo Krzesinski <[email protected]>Cc Thadeu Lima de Souza Cascardo <[email protected]>--- drivers/platform/x86/classmate-laptop.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/platform/x86/classmate-laptop.c +1
-0@@ -655,6 +655,7 @@ static void cmpc_keys_handler(struct acpi_device *dev, u32 event) code = cmpc_keys_codes[event &0x0F ]; inputdev =dev_get_drvdata (&dev->dev);;input_report_key (inputdev, code, !(event &0x10 )); +input_sync (inputdev); }static void cmpc_keys_idev_init (struct input_dev *inputdev)Signature · 1 line
1.7.3.2
Matthew Garrett
AppliedApplied these to -next, thanks.
Signature · 1 line
Matthew Garrett | [email protected]