public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] sony-laptop fixes for 2.6.30
@ 2009-04-01 13:10 Mattia Dongili
  2009-04-01 13:10 ` [PATCH 1/4] sony-laptop: Fix some typos in log messages (Unabe/Unable) Mattia Dongili
  2009-04-03 17:09 ` [PATCH 0/4] sony-laptop fixes for 2.6.30 Len Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Mattia Dongili @ 2009-04-01 13:10 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi

Hi Len,

a few fixes on top of my previous submission (diffed against your test branch).
There are fixes for spelling mistakes, a build fix and the new style events
reporting issue spotted by Matthias[1]. The only remaining problem is the
rfkill not enabling the devices if inserting the module with the switch on and
turning if off afterwards but I's day this is a good start to add support for a
number of vaio models.

 drivers/platform/x86/Kconfig       |    1 +
 drivers/platform/x86/sony-laptop.c |   53 +++++++++++++++++++----------------
 2 files changed, 30 insertions(+), 24 deletions(-)

[1]: I splitted Matthias patch in two and modified some bits for the event
reporting, I hope the attribution is ok.
-- 
mattia


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

* [PATCH 1/4] sony-laptop: Fix some typos in log messages (Unabe/Unable)
  2009-04-01 13:10 [PATCH 0/4] sony-laptop fixes for 2.6.30 Mattia Dongili
@ 2009-04-01 13:10 ` Mattia Dongili
  2009-04-01 13:10   ` [PATCH 2/4] sony-laptop: new style events typo fixes Mattia Dongili
  2009-04-03 17:09 ` [PATCH 0/4] sony-laptop fixes for 2.6.30 Len Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Mattia Dongili @ 2009-04-01 13:10 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Alessio Igor Bogani, Mattia Dongili

From: Alessio Igor Bogani <abogani@texware.it>

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 0f71031..5837156 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -397,7 +397,7 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device)
 	sony_laptop_input.wq = create_singlethread_workqueue("sony-laptop");
 	if (!sony_laptop_input.wq) {
 		printk(KERN_ERR DRV_PFX
-				"Unabe to create workqueue.\n");
+				"Unable to create workqueue.\n");
 		error = -ENXIO;
 		goto err_free_kfifo;
 	}
@@ -1267,7 +1267,7 @@ static int sony_nc_add(struct acpi_device *device)
 	result = sony_laptop_setup_input(device);
 	if (result) {
 		printk(KERN_ERR DRV_PFX
-				"Unabe to create input devices.\n");
+				"Unable to create input devices.\n");
 		goto outwalk;
 	}
 
@@ -2816,7 +2816,7 @@ static int sony_pic_add(struct acpi_device *device)
 	result = sony_pic_possible_resources(device);
 	if (result) {
 		printk(KERN_ERR DRV_PFX
-				"Unabe to read possible resources.\n");
+				"Unable to read possible resources.\n");
 		goto err_free_resources;
 	}
 
@@ -2824,7 +2824,7 @@ static int sony_pic_add(struct acpi_device *device)
 	result = sony_laptop_setup_input(device);
 	if (result) {
 		printk(KERN_ERR DRV_PFX
-				"Unabe to create input devices.\n");
+				"Unable to create input devices.\n");
 		goto err_free_resources;
 	}
 
-- 
1.6.2.1


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

* [PATCH 2/4] sony-laptop: new style events typo fixes
  2009-04-01 13:10 ` [PATCH 1/4] sony-laptop: Fix some typos in log messages (Unabe/Unable) Mattia Dongili
@ 2009-04-01 13:10   ` Mattia Dongili
  2009-04-01 13:10     ` [PATCH 3/4] sony-laptop should depend on RFKILL Mattia Dongili
  0 siblings, 1 reply; 6+ messages in thread
From: Mattia Dongili @ 2009-04-01 13:10 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Matthias Welwarsky, Mattia Dongili

From: Matthias Welwarsky <matze@welwarsky.de>

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

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 5837156..011c035 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -865,7 +865,7 @@ struct sony_nc_event {
 static struct sony_nc_event sony_100_events[] = {
 	{ 0x90, SONYPI_EVENT_PKEY_P1 },
 	{ 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
-	{ 0x91, SONYPI_EVENT_PKEY_P1 },
+	{ 0x91, SONYPI_EVENT_PKEY_P2 },
 	{ 0x11, SONYPI_EVENT_ANYBUTTON_RELEASED },
 	{ 0x81, SONYPI_EVENT_FNKEY_F1 },
 	{ 0x01, SONYPI_EVENT_FNKEY_RELEASED },
@@ -929,7 +929,7 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
 		if (sony_find_snc_handle(0x127) == ev)
 			key_handle = 0x127;
 
-		if (handle) {
+		if (key_handle) {
 			struct sony_nc_event *key_event;
 
 			if (sony_call_snc_handle(key_handle, 0x200, &result))
-- 
1.6.2.1


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

* [PATCH 3/4] sony-laptop should depend on RFKILL
  2009-04-01 13:10   ` [PATCH 2/4] sony-laptop: new style events typo fixes Mattia Dongili
@ 2009-04-01 13:10     ` Mattia Dongili
  2009-04-01 13:10       ` [PATCH 4/4] sony-laptop: fix event reporting for new style events Mattia Dongili
  0 siblings, 1 reply; 6+ messages in thread
From: Mattia Dongili @ 2009-04-01 13:10 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Alexander Beregalov, Mattia Dongili

From: Alexander Beregalov <a.beregalov@gmail.com>

Fixes this build error when RFKILL is not set:

drivers/platform/x86/sony-laptop.c:1050: undefined reference to `rfkill_unregister'
and so on..

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 3608081..36b1628 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -165,6 +165,7 @@ config SONY_LAPTOP
 	depends on ACPI
 	select BACKLIGHT_CLASS_DEVICE
 	depends on INPUT
+	depends on RFKILL
 	  ---help---
 	  This mini-driver drives the SNC and SPIC devices present in the ACPI
 	  BIOS of the Sony Vaio laptops.
-- 
1.6.2.1


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

* [PATCH 4/4] sony-laptop: fix event reporting for new style events
  2009-04-01 13:10     ` [PATCH 3/4] sony-laptop should depend on RFKILL Mattia Dongili
@ 2009-04-01 13:10       ` Mattia Dongili
  0 siblings, 0 replies; 6+ messages in thread
From: Mattia Dongili @ 2009-04-01 13:10 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Matthias Welwarsky, Mattia Dongili

From: Matthias Welwarsky <matze@welwarsky.de>

In short Fn key events are always reported through acpi.
The input layer gets all the old style events and only those new style
events that, after being decoded, are mapped to an locally represented
events.
rfkill only update the rfkill device status.

Signed-off-by: Matthias Welwarsky <matze@welwarsky.de>
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
 drivers/platform/x86/sony-laptop.c |   41 ++++++++++++++++++++---------------
 1 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 011c035..e02edf6 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -917,10 +917,10 @@ static struct sony_nc_event sony_127_events[] = {
 static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
 {
 	u32 ev = event;
-	int result;
 
 	if (ev >= 0x90) {
 		/* New-style event */
+		int result;
 		int key_handle = 0;
 		ev -= 0x90;
 
@@ -932,38 +932,43 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
 		if (key_handle) {
 			struct sony_nc_event *key_event;
 
-			if (sony_call_snc_handle(key_handle, 0x200, &result))
+			if (sony_call_snc_handle(key_handle, 0x200, &result)) {
 				dprintk("sony_acpi_notify, unable to decode"
 					" event 0x%.2x 0x%.2x\n", key_handle,
 					ev);
-			else
+				/* restore the original event */
+				ev = event;
+			} else {
 				ev = result & 0xFF;
 
-			if (key_handle == 0x100)
-				key_event = sony_100_events;
-			else
-				key_event = sony_127_events;
+				if (key_handle == 0x100)
+					key_event = sony_100_events;
+				else
+					key_event = sony_127_events;
 
-			for (; key_event->data; key_event++) {
-				if (key_event->data == ev) {
-					ev = key_event->event;
-					break;
+				for (; key_event->data; key_event++) {
+					if (key_event->data == ev) {
+						ev = key_event->event;
+						break;
+					}
 				}
-			}
 
-			if (!key_event->data) {
-				printk(KERN_INFO DRV_PFX
-				       "Unknown event: 0x%x 0x%x\n", key_handle,
-				       ev);
+				if (!key_event->data)
+					printk(KERN_INFO DRV_PFX
+							"Unknown event: 0x%x 0x%x\n",
+							key_handle,
+							ev);
+				else
+					sony_laptop_report_input_event(ev);
 			}
 		} else if (sony_find_snc_handle(0x124) == ev) {
 			sony_nc_rfkill_update();
 			return;
 		}
-	}
+	} else
+		sony_laptop_report_input_event(ev);
 
 	dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
-	sony_laptop_report_input_event(ev);
 	acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
 }
 
-- 
1.6.2.1


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

* Re: [PATCH 0/4] sony-laptop fixes for 2.6.30
  2009-04-01 13:10 [PATCH 0/4] sony-laptop fixes for 2.6.30 Mattia Dongili
  2009-04-01 13:10 ` [PATCH 1/4] sony-laptop: Fix some typos in log messages (Unabe/Unable) Mattia Dongili
@ 2009-04-03 17:09 ` Len Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Len Brown @ 2009-04-03 17:09 UTC (permalink / raw)
  To: Mattia Dongili; +Cc: linux-acpi

1-4 applied

Though, Mattia, you will not get this message, as every message
I send you from this account recently is bounced with:

Original-recipient: rfc822;malattia@linux.it
Final-recipient: rfc822;malattia@linux.it
Action: failed
Status: 5.7.1 (Remote SMTP server has rejected address)
Remote-MTA: dns;picard.linux.it (TCP|206.46.173.7|30552|213.254.12.146|25)
 (picard.linux.it ESMTP Postfix [Debian/GNU])
Diagnostic-code: smtp;554 5.7.1 Service unavailable; Client host 
[206.46.173.7]
 blocked using ip.mybl.bofh.it; see http://bl.bofh.it/bl?ip=206.46.173.


--
Len Brown, Intel Open Source Technology Center


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

end of thread, other threads:[~2009-04-03 17:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-01 13:10 [PATCH 0/4] sony-laptop fixes for 2.6.30 Mattia Dongili
2009-04-01 13:10 ` [PATCH 1/4] sony-laptop: Fix some typos in log messages (Unabe/Unable) Mattia Dongili
2009-04-01 13:10   ` [PATCH 2/4] sony-laptop: new style events typo fixes Mattia Dongili
2009-04-01 13:10     ` [PATCH 3/4] sony-laptop should depend on RFKILL Mattia Dongili
2009-04-01 13:10       ` [PATCH 4/4] sony-laptop: fix event reporting for new style events Mattia Dongili
2009-04-03 17:09 ` [PATCH 0/4] sony-laptop fixes for 2.6.30 Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox