sony-laptop fixes for 2.6.30-rc2
Subsystems (3)
Mattia Dongili
maintainercover sony-laptop fixes for 2.6.30-rc2
Hi Len,
a few fixes for the new code handling the SNC devices, a fix for a small bug in the resume path and a patch for ec.c that allows sony-laptop to restore the brightness level on resume.
Almer S. Tigelaar (4):
sony-laptop: Duplicate SNC 127 Event Fix
sony-laptop: SNC 127 Initialization Fix
sony-laptop: SNC input event 38 fix
ec.c: Fix ACPI EC resume non-query interrupt message
Mattia Dongili (2):
sony-laptop: fix bogus error message display on resume
sony-laptop: always try to unblock rfkill on load
drivers/acpi/ec.c | 1 + drivers/platform/x86/sony-laptop.c | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-)
Signature · 2 lines
mattia :wq
Mattia Dongili
maintainerPATCH 1/6 sony-laptop: Duplicate SNC 127 Event Fix
From: Almer S. Tigelaar <[email protected]>
Fixes a duplicate mapping in the SNC sony_127_events structure.
--- drivers/platform/x86/sony-laptop.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/platform/x86/sony-laptop.c +0 -1
@@ -905,7 +905,6 @@ static struct sony_nc_event sony_127_events[] = { { 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED }, { 0x86, SONYPI_EVENT_PKEY_P5 }, { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED }, - { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED }, { 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED }, { 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED }, { 0, 0 },
Signature · 1 line
1.6.2.2
Mattia Dongili
maintainerPATCH 2/6 sony-laptop: SNC 127 Initialization Fix
From: Almer S. Tigelaar <[email protected]>
Fixes additional special key initialization for SNC 127 key events. Verified / tested on a Sony VAIO SR model.
--- drivers/platform/x86/sony-laptop.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/platform/x86/sony-laptop.c +1 -0
@@ -1003,6 +1003,7 @@ static int sony_nc_function_setup(struct acpi_device *device)sony_call_snc_handle (0x0100 ,0 , &result);sony_call_snc_handle (0x0101 ,0 , &result);sony_call_snc_handle (0x0102 ,0x100 , &result); +sony_call_snc_handle (0x0127 ,0 , &result);return 0 ; }
Signature · 1 line
1.6.2.2
Mattia Dongili
maintainerPATCH 3/6 sony-laptop: SNC input event 38 fix
From: Almer S. Tigelaar <[email protected]>
Fixes the "unknown input event 38" messages. ANYBUTTON_RELEASED is now treated the same way as FN_KEY_RELEASED.
--- drivers/platform/x86/sony-laptop.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/platform/x86/sony-laptop.c +2 -1
@@ -317,7 +317,8 @@ static void sony_laptop_report_input_event(u8 event)struct input_dev *key_dev = sony_laptop_input.key_dev;struct sony_laptop_keypress kp = {NULL }; -if (event ==SONYPI_EVENT_FNKEY_RELEASED ) { +if (event ==SONYPI_EVENT_FNKEY_RELEASED || + event ==SONYPI_EVENT_ANYBUTTON_RELEASED ) {/* Nothing, not all VAIOs generate this event */ return ; }
Signature · 1 line
1.6.2.2
Mattia Dongili
maintainerPATCH 4/6 ec.c: Fix ACPI EC resume non-query interrupt message
From: Almer S. Tigelaar <[email protected]>
When resuming from standby (on a laptop) I see the following message in my kernel.log:
"ACPI: EC: non-query interrupt received, switching to interrupt mode" This apparently prevented sony-laptop to properly restore the brightness level on resume.
The cause: In drivers/acpi/ec.c the acpi_ec_suspend function clears the GPE mode bit, but this is not restored in acpi_ec_resume (the function below it). The patch below fixes this by properly restoring the GPE_MODE bit. Tested and confirmed to work.
--- drivers/acpi/ec.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/acpi/ec.c +1 -0
@@ -1065,6 +1065,7 @@ static int acpi_ec_resume(struct acpi_device *device)struct acpi_ec *ec =acpi_driver_data (device);/* Enable use of GPE back */ clear_bit (EC_FLAGS_NO_GPE , &ec->flags); +set_bit (EC_FLAGS_GPE_MODE , &ec->flags);acpi_enable_gpe (NULL , ec->gpe);return 0 ; }
Signature · 1 line
1.6.2.2
Mattia Dongili
maintainerPATCH 5/6 sony-laptop: fix bogus error message display on resume
sony_backlight_update_status returns 0 on success -1 on failure (i.e.: the return value from acpi_callsetfunc. The return value in the resume path was broken and thus always displaying a bogus warning about not being able to restore the brightness level.
--- drivers/platform/x86/sony-laptop.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/platform/x86/sony-laptop.c +1 -1
@@ -1041,7 +1041,7 @@ static int sony_nc_resume(struct acpi_device *device)/* set the last requested brightness level */ if (sony_backlight_device && - !sony_backlight_update_status (sony_backlight_device)) +sony_backlight_update_status (sony_backlight_device) <0 ) printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n");return 0 ;
Signature · 1 line
1.6.2.2
Mattia Dongili
maintainerPATCH 6/6 sony-laptop: always try to unblock rfkill on load
This fixes an inconsistent behaviour when loading the driver with the switch on or off. In the former case you would also need to soft unblock the switch via the sysfs file entries to really disable rfkill, in the latter you wouldn't.
--- drivers/platform/x86/sony-laptop.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-)
drivers/platform/x86/sony-laptop.c +16 -4
@@ -1103,8 +1103,11 @@ static int sony_nc_setup_wifi_rfkill(struct acpi_device *device) err =rfkill_register (sony_wifi_rfkill);if (err)rfkill_free (sony_wifi_rfkill); -else +else { sony_rfkill_devices[SONY_WIFI ] = sony_wifi_rfkill; +sony_nc_rfkill_set (sony_wifi_rfkill->data, +RFKILL_STATE_UNBLOCKED ); + }return err; }
@@ -1125,8 +1128,11 @@ static int sony_nc_setup_bluetooth_rfkill(struct acpi_device *device) err =rfkill_register (sony_bluetooth_rfkill);if (err)rfkill_free (sony_bluetooth_rfkill); -else +else { sony_rfkill_devices[SONY_BLUETOOTH ] = sony_bluetooth_rfkill; +sony_nc_rfkill_set (sony_bluetooth_rfkill->data, +RFKILL_STATE_UNBLOCKED ); + }return err; }
@@ -1146,8 +1152,11 @@ static int sony_nc_setup_wwan_rfkill(struct acpi_device *device) err =rfkill_register (sony_wwan_rfkill);if (err)rfkill_free (sony_wwan_rfkill); -else +else { sony_rfkill_devices[SONY_WWAN ] = sony_wwan_rfkill; +sony_nc_rfkill_set (sony_wwan_rfkill->data, +RFKILL_STATE_UNBLOCKED ); + }return err; }
@@ -1167,8 +1176,11 @@ static int sony_nc_setup_wimax_rfkill(struct acpi_device *device) err =rfkill_register (sony_wimax_rfkill);if (err)rfkill_free (sony_wimax_rfkill); -else +else { sony_rfkill_devices[SONY_WIMAX ] = sony_wimax_rfkill; +sony_nc_rfkill_set (sony_wimax_rfkill->data, +RFKILL_STATE_UNBLOCKED ); + }return err; }
Signature · 1 line
1.6.2.2
Re: [PATCH 6/6] sony-laptop: always try to unblock rfkill on load
Quoted 8 lines · Mattia Dongili
This fixes an inconsistent behaviour when loading the driver with the switch on or off. In the former case you would also need to soft unblock the switch via the sysfs file entries to really disable rfkill, in the latter you wouldn't.
Signed-off-by Mattia Dongili <[email protected]>Cc Matthias Welwarsky <[email protected]>Cc Matthew Garrett <[email protected]>
Signature · 1 line
Matthew Garrett | [email protected]
Len Brown
reviewerQuoted 12 lines · Mattia Dongili
Hi Len,
a few fixes for the new code handling the SNC devices, a fix for a small bug in the resume path and a patch for
ec.cthat allows sony-laptop to restore the brightness level on resume.Almer S. Tigelaar (4):
sony-laptop: Duplicate SNC 127 Event Fix
sony-laptop: SNC 127 Initialization Fix
sony-laptop: SNC input event 38 fix
ec.c: Fix ACPI EC resume non-query interrupt message
Quoted 7 lines
Mattia Dongili (2):
sony-laptop: fix bogus error message display on resume
sony-laptop: always try to unblock rfkill on loaddrivers/acpi/ec.c | 1 + drivers/platform/x86/sony-laptop.c | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-)
applied to acpi-test
thanks,
Len Brown, Intel Open Source Technology Center