linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2
@ 2009-04-12 11:26 Mattia Dongili
  2009-04-12 11:26 ` [PATCH 1/6] sony-laptop: Duplicate SNC 127 Event Fix Mattia Dongili
  2009-04-18  5:16 ` [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2 Len Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, 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.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(-)

-- 
mattia
:wq

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

* [PATCH 1/6] sony-laptop: Duplicate SNC 127 Event Fix
  2009-04-12 11:26 [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2 Mattia Dongili
@ 2009-04-12 11:26 ` Mattia Dongili
  2009-04-12 11:26   ` [PATCH 2/6] sony-laptop: SNC 127 Initialization Fix Mattia Dongili
  2009-04-18  5:16 ` [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2 Len Brown
  1 sibling, 1 reply; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Almer S. Tigelaar, Mattia Dongili

From: Almer S. Tigelaar <almer@gnome.org>

Fixes a duplicate mapping in the SNC sony_127_events structure.

Signed-off-by: Almer S. Tigelaar <almer@gnome.org>
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index a90ec5c..a537467 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -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 },
-- 
1.6.2.2


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

* [PATCH 2/6] sony-laptop: SNC 127 Initialization Fix
  2009-04-12 11:26 ` [PATCH 1/6] sony-laptop: Duplicate SNC 127 Event Fix Mattia Dongili
@ 2009-04-12 11:26   ` Mattia Dongili
  2009-04-12 11:26     ` [PATCH 3/6] sony-laptop: SNC input event 38 fix Mattia Dongili
  0 siblings, 1 reply; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Almer S. Tigelaar, Mattia Dongili

From: Almer S. Tigelaar <almer@gnome.org>

Fixes additional special key initialization for SNC 127 key events.
Verified / tested on a Sony VAIO SR model.

Signed-off-by: Almer S. Tigelaar <almer@gnome.org>
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index a537467..7b1da3f 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -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;
 }
-- 
1.6.2.2


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

* [PATCH 3/6] sony-laptop: SNC input event 38 fix
  2009-04-12 11:26   ` [PATCH 2/6] sony-laptop: SNC 127 Initialization Fix Mattia Dongili
@ 2009-04-12 11:26     ` Mattia Dongili
  2009-04-12 11:26       ` [PATCH 4/6] ec.c: Fix ACPI EC resume non-query interrupt message Mattia Dongili
  0 siblings, 1 reply; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Almer S. Tigelaar, Mattia Dongili

From: Almer S. Tigelaar <almer@gnome.org>

Fixes the "unknown input event 38" messages. ANYBUTTON_RELEASED is now
treated the same way as FN_KEY_RELEASED.

Signed-off-by: Almer S. Tigelaar <almer@gnome.org>
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 7b1da3f..ddbd86b 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -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;
 	}
-- 
1.6.2.2


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

* [PATCH 4/6] ec.c: Fix ACPI EC resume non-query interrupt message
  2009-04-12 11:26     ` [PATCH 3/6] sony-laptop: SNC input event 38 fix Mattia Dongili
@ 2009-04-12 11:26       ` Mattia Dongili
  2009-04-12 11:26         ` [PATCH 5/6] sony-laptop: fix bogus error message display on resume Mattia Dongili
  0 siblings, 1 reply; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown
  Cc: linux-acpi, Almer S. Tigelaar, Mattia Dongili,
	Alexey Starikovskiy

From: Almer S. Tigelaar <almer@gnome.org>

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.

Signed-off-by: Almer S. Tigelaar <almer@gnome.org>
Signed-off-by: Mattia Dongili <malattia@linux.it>
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>
---
 drivers/acpi/ec.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 04e9044..391f331 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -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;
 }
-- 
1.6.2.2


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

* [PATCH 5/6] sony-laptop: fix bogus error message display on resume
  2009-04-12 11:26       ` [PATCH 4/6] ec.c: Fix ACPI EC resume non-query interrupt message Mattia Dongili
@ 2009-04-12 11:26         ` Mattia Dongili
  2009-04-12 11:26           ` [PATCH 6/6] sony-laptop: always try to unblock rfkill on load Mattia Dongili
  0 siblings, 1 reply; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Mattia Dongili

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.

Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index ddbd86b..419873a 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -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;
-- 
1.6.2.2


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

* [PATCH 6/6] sony-laptop: always try to unblock rfkill on load
  2009-04-12 11:26         ` [PATCH 5/6] sony-laptop: fix bogus error message display on resume Mattia Dongili
@ 2009-04-12 11:26           ` Mattia Dongili
  2009-04-13 15:46             ` Matthew Garrett
  0 siblings, 1 reply; 9+ messages in thread
From: Mattia Dongili @ 2009-04-12 11:26 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Mattia Dongili, Matthias Welwarsky, Matthew Garrett

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 <malattia@linux.it>
Cc: Matthias Welwarsky <matze@welwarsky.de>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
---
 drivers/platform/x86/sony-laptop.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 419873a..9c0ce73 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -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;
 }
 
-- 
1.6.2.2


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

* Re: [PATCH 6/6] sony-laptop: always try to unblock rfkill on load
  2009-04-12 11:26           ` [PATCH 6/6] sony-laptop: always try to unblock rfkill on load Mattia Dongili
@ 2009-04-13 15:46             ` Matthew Garrett
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Garrett @ 2009-04-13 15:46 UTC (permalink / raw)
  To: Mattia Dongili; +Cc: Len Brown, linux-acpi, Matthias Welwarsky

On Sun, Apr 12, 2009 at 08:26:31PM +0900, Mattia Dongili wrote:
> 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 <malattia@linux.it>
> Cc: Matthias Welwarsky <matze@welwarsky.de>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>

Acked-by: Matthew Garrett <mjg@redhat.com>

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2
  2009-04-12 11:26 [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2 Mattia Dongili
  2009-04-12 11:26 ` [PATCH 1/6] sony-laptop: Duplicate SNC 127 Event Fix Mattia Dongili
@ 2009-04-18  5:16 ` Len Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Len Brown @ 2009-04-18  5:16 UTC (permalink / raw)
  To: Mattia Dongili; +Cc: linux-acpi

On Sun, 12 Apr 2009, Mattia Dongili wrote:

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

applied to acpi-test



thanks,
Len Brown, Intel Open Source Technology Center

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

end of thread, other threads:[~2009-04-18  5:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-12 11:26 [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2 Mattia Dongili
2009-04-12 11:26 ` [PATCH 1/6] sony-laptop: Duplicate SNC 127 Event Fix Mattia Dongili
2009-04-12 11:26   ` [PATCH 2/6] sony-laptop: SNC 127 Initialization Fix Mattia Dongili
2009-04-12 11:26     ` [PATCH 3/6] sony-laptop: SNC input event 38 fix Mattia Dongili
2009-04-12 11:26       ` [PATCH 4/6] ec.c: Fix ACPI EC resume non-query interrupt message Mattia Dongili
2009-04-12 11:26         ` [PATCH 5/6] sony-laptop: fix bogus error message display on resume Mattia Dongili
2009-04-12 11:26           ` [PATCH 6/6] sony-laptop: always try to unblock rfkill on load Mattia Dongili
2009-04-13 15:46             ` Matthew Garrett
2009-04-18  5:16 ` [PATCH 0/6] sony-laptop fixes for 2.6.30-rc2 Len Brown

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