All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer
@ 2012-12-14  8:10 Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 2/5] acer-wmi: support Lenovo ideapad S205 10382JG wifi switch Lee, Chun-Yi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Lee, Chun-Yi @ 2012-12-14  8:10 UTC (permalink / raw)
  To: mjg; +Cc: platform-driver-x86, Lee, Chun-Yi

Due to I moved to use suse.com mail address, so, add patch to change the
mail address in MAINTAINERS file.

Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 MAINTAINERS |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fdc0119..555bf5b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -218,7 +218,7 @@ S:	Maintained
 F:	drivers/platform/x86/acerhdf.c
 
 ACER WMI LAPTOP EXTRAS
-M:	Joey Lee <jlee@novell.com>
+M:	"Lee, Chun-Yi" <jlee@suse.com>
 L:	platform-driver-x86@vger.kernel.org
 S:	Maintained
 F:	drivers/platform/x86/acer-wmi.c
@@ -4577,7 +4577,7 @@ F:	Documentation/serial/moxa-smartio
 F:	drivers/tty/mxser.*
 
 MSI LAPTOP SUPPORT
-M:	"Lee, Chun-Yi" <jlee@novell.com>
+M:	"Lee, Chun-Yi" <jlee@suse.com>
 L:	platform-driver-x86@vger.kernel.org
 S:	Maintained
 F:	drivers/platform/x86/msi-laptop.c
-- 
1.6.0.2

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

* [RESEND][PATCH 2/5] acer-wmi: support Lenovo ideapad S205 10382JG wifi switch
  2012-12-14  8:10 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
@ 2012-12-14  8:10 ` Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 3/5] acer-wmi: fix obj is NULL but dereferenced Lee, Chun-Yi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Lee, Chun-Yi @ 2012-12-14  8:10 UTC (permalink / raw)
  To: mjg
  Cc: platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Dmitry Torokhov, Corentin Chary, Thomas Renninger

Found another Lenovo ideapad S205 the product name is 10382JG, it has
a 0x78 EC register exposes the state of wifi hardware switch on the machine.

So, add this patch to support Lenovo ideapad S205-10382JG wifi hardware
switch in acer-wmi driver.

Evidently the Ideapad S205 is just a model name on the market, but they have
totally different product name in DMI table.

Reference: bko#43007
        https://bugzilla.kernel.org/show_bug.cgi?id=43007

Tested-by: Ivo Anjo <knuckles@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 934d861..07d5f96 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -507,6 +507,15 @@ static struct dmi_system_id acer_quirks[] = {
 		},
 		.driver_data = &quirk_fujitsu_amilo_li_1718,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Lenovo Ideapad S205-10382JG",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "10382JG"),
+		},
+		.driver_data = &quirk_lenovo_ideapad_s205,
+	},
 	{}
 };
 
-- 
1.6.0.2

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

* [RESEND][PATCH 3/5] acer-wmi: fix obj is NULL but dereferenced
  2012-12-14  8:10 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 2/5] acer-wmi: support Lenovo ideapad S205 10382JG wifi switch Lee, Chun-Yi
@ 2012-12-14  8:10 ` Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 4/5] acer-wmi: change to emit touchpad on off key Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 5/5] acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch Lee, Chun-Yi
  3 siblings, 0 replies; 6+ messages in thread
From: Lee, Chun-Yi @ 2012-12-14  8:10 UTC (permalink / raw)
  To: mjg
  Cc: platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Dmitry Torokhov, Corentin Chary, Thomas Renninger

Fengguang Wu run coccinelle and warns about:
  drivers/platform/x86/acer-wmi.c:1200:17-21: ERROR: obj is NULL but dereferenced.
  drivers/platform/x86/acer-wmi.c:891:17-21: ERROR: obj is NULL but dereferenced.
  drivers/platform/x86/acer-wmi.c:1953:17-21: ERROR: obj is NULL but dereferenced.

It causes by the code in patch 987dfbaa65b2c3568b85e29d2598da08a011ee09 doesn't check
obj variable should not be NULL. There have risk for dereference a NULL obj, so add
this patch to fix.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |   46 +++++++++++++++++++++-----------------
 1 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 07d5f96..11fe00b 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -884,7 +884,7 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
 	struct acpi_buffer input = { (acpi_size) sizeof(u32), (void *)(&in) };
 	struct acpi_buffer result = { ACPI_ALLOCATE_BUFFER, NULL };
 	union acpi_object *obj;
-	u32 tmp;
+	u32 tmp = 0;
 	acpi_status status;
 
 	status = wmi_evaluate_method(WMID_GUID1, 1, method_id, &input, &result);
@@ -893,14 +893,14 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
 		return status;
 
 	obj = (union acpi_object *) result.pointer;
-	if (obj && obj->type == ACPI_TYPE_BUFFER &&
-		(obj->buffer.length == sizeof(u32) ||
-		obj->buffer.length == sizeof(u64))) {
-		tmp = *((u32 *) obj->buffer.pointer);
-	} else if (obj->type == ACPI_TYPE_INTEGER) {
-		tmp = (u32) obj->integer.value;
-	} else {
-		tmp = 0;
+	if (obj) {
+		if (obj->type == ACPI_TYPE_BUFFER &&
+			(obj->buffer.length == sizeof(u32) ||
+			obj->buffer.length == sizeof(u64))) {
+			tmp = *((u32 *) obj->buffer.pointer);
+		} else if (obj->type == ACPI_TYPE_INTEGER) {
+			tmp = (u32) obj->integer.value;
+		}
 	}
 
 	if (out)
@@ -1202,12 +1202,14 @@ static acpi_status WMID_set_capabilities(void)
 		return status;
 
 	obj = (union acpi_object *) out.pointer;
-	if (obj && obj->type == ACPI_TYPE_BUFFER &&
-		(obj->buffer.length == sizeof(u32) ||
-		obj->buffer.length == sizeof(u64))) {
-		devices = *((u32 *) obj->buffer.pointer);
-	} else if (obj->type == ACPI_TYPE_INTEGER) {
-		devices = (u32) obj->integer.value;
+	if (obj) {
+		if (obj->type == ACPI_TYPE_BUFFER &&
+			(obj->buffer.length == sizeof(u32) ||
+			obj->buffer.length == sizeof(u64))) {
+			devices = *((u32 *) obj->buffer.pointer);
+		} else if (obj->type == ACPI_TYPE_INTEGER) {
+			devices = (u32) obj->integer.value;
+		}
 	} else {
 		kfree(out.pointer);
 		return AE_ERROR;
@@ -1955,12 +1957,14 @@ static u32 get_wmid_devices(void)
 		return 0;
 
 	obj = (union acpi_object *) out.pointer;
-	if (obj && obj->type == ACPI_TYPE_BUFFER &&
-		(obj->buffer.length == sizeof(u32) ||
-		obj->buffer.length == sizeof(u64))) {
-		devices = *((u32 *) obj->buffer.pointer);
-	} else if (obj->type == ACPI_TYPE_INTEGER) {
-		devices = (u32) obj->integer.value;
+	if (obj) {
+		if (obj->type == ACPI_TYPE_BUFFER &&
+			(obj->buffer.length == sizeof(u32) ||
+			obj->buffer.length == sizeof(u64))) {
+			devices = *((u32 *) obj->buffer.pointer);
+		} else if (obj->type == ACPI_TYPE_INTEGER) {
+			devices = (u32) obj->integer.value;
+		}
 	}
 
 	kfree(out.pointer);
-- 
1.6.0.2

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

* [RESEND][PATCH 4/5] acer-wmi: change to emit touchpad on off key
  2012-12-14  8:10 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 2/5] acer-wmi: support Lenovo ideapad S205 10382JG wifi switch Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 3/5] acer-wmi: fix obj is NULL but dereferenced Lee, Chun-Yi
@ 2012-12-14  8:10 ` Lee, Chun-Yi
  2012-12-14  8:10 ` [RESEND][PATCH 5/5] acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch Lee, Chun-Yi
  3 siblings, 0 replies; 6+ messages in thread
From: Lee, Chun-Yi @ 2012-12-14  8:10 UTC (permalink / raw)
  To: mjg
  Cc: platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Dmitry Torokhov, Corentin Chary, Thomas Renninger

KEY_TOUCHPAD_TOOGLE key is for notice userland change touchpad state
via xf86-input-synaptics on the machine that don't toggle touchpad in
hardware. But, acer laptop actually toggle touchpad in hardware.
So, this patch change to emit KEY_TOUCHPAD_ON/OFF key when acer-wmi grab
device state of touchpad.

Reference: brc#848270
        https://bugzilla.redhat.com/show_bug.cgi?id=848270

Tested-by: Nathanael Noblet <nathanael@gnat.ca>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 11fe00b..83abfaa 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -125,7 +125,9 @@ static const struct key_entry acer_wmi_keymap[] = {
 	{KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
 	{KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} },	/* Display Switch */
 	{KE_IGNORE, 0x81, {KEY_SLEEP} },
-	{KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} },	/* Touch Pad On/Off */
+	{KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} },	/* Touch Pad Toggle */
+	{KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} },
+	{KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} },
 	{KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
 	{KE_END, 0}
 };
@@ -147,6 +149,7 @@ struct event_return_value {
 #define ACER_WMID3_GDS_THREEG		(1<<6)	/* 3G */
 #define ACER_WMID3_GDS_WIMAX		(1<<7)	/* WiMAX */
 #define ACER_WMID3_GDS_BLUETOOTH	(1<<11)	/* BT */
+#define ACER_WMID3_GDS_TOUCHPAD		(1<<1)	/* Touchpad */
 
 struct lm_input_params {
 	u8 function_num;        /* Function Number */
@@ -1687,6 +1690,7 @@ static void acer_wmi_notify(u32 value, void *context)
 	acpi_status status;
 	u16 device_state;
 	const struct key_entry *key;
+	u32 scancode;
 
 	status = wmi_get_event_data(value, &response);
 	if (status != AE_OK) {
@@ -1723,6 +1727,7 @@ static void acer_wmi_notify(u32 value, void *context)
 			pr_warn("Unknown key number - 0x%x\n",
 				return_value.key_num);
 		} else {
+			scancode = return_value.key_num;
 			switch (key->keycode) {
 			case KEY_WLAN:
 			case KEY_BLUETOOTH:
@@ -1736,9 +1741,11 @@ static void acer_wmi_notify(u32 value, void *context)
 					rfkill_set_sw_state(bluetooth_rfkill,
 						!(device_state & ACER_WMID3_GDS_BLUETOOTH));
 				break;
+			case KEY_TOUCHPAD_TOGGLE:
+				scancode = (device_state & ACER_WMID3_GDS_TOUCHPAD) ?
+						KEY_TOUCHPAD_ON : KEY_TOUCHPAD_OFF;
 			}
-			sparse_keymap_report_entry(acer_wmi_input_dev, key,
-						   1, true);
+			sparse_keymap_report_event(acer_wmi_input_dev, scancode, 1, true);
 		}
 		break;
 	case WMID_ACCEL_EVENT:
-- 
1.6.0.2

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

* [RESEND][PATCH 5/5] acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch
  2012-12-14  8:10 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
                   ` (2 preceding siblings ...)
  2012-12-14  8:10 ` [RESEND][PATCH 4/5] acer-wmi: change to emit touchpad on off key Lee, Chun-Yi
@ 2012-12-14  8:10 ` Lee, Chun-Yi
  3 siblings, 0 replies; 6+ messages in thread
From: Lee, Chun-Yi @ 2012-12-14  8:10 UTC (permalink / raw)
  To: mjg
  Cc: platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Dmitry Torokhov, Corentin Chary, Thomas Renninger

Found another Lenovo ideapad S205 the product name is 1038DPG, it has
a 0x78 EC register exposes the state of wifi hardware switch on the machine.

So, add this patch to support Lenovo ideapad S205-1038DPG wifi hardware
switch in acer-wmi driver.

Evidently the Ideapad S205 is just a model name on the market, but they have
totally different product name in DMI table.

Reference: bko#43007
        https://bugzilla.kernel.org/show_bug.cgi?id=43007

Tested-by: Colin <colin.newell@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 83abfaa..f95a2d4 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -519,6 +519,15 @@ static struct dmi_system_id acer_quirks[] = {
 		},
 		.driver_data = &quirk_lenovo_ideapad_s205,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Lenovo Ideapad S205-1038DPG",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "1038DPG"),
+		},
+		.driver_data = &quirk_lenovo_ideapad_s205,
+	},
 	{}
 };
 
-- 
1.6.0.2

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

* [RESEND][PATCH 5/5] acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch
  2012-12-14  8:14 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
@ 2012-12-14  8:14 ` Lee, Chun-Yi
  0 siblings, 0 replies; 6+ messages in thread
From: Lee, Chun-Yi @ 2012-12-14  8:14 UTC (permalink / raw)
  To: mjg59
  Cc: platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Matthew Garrett, Dmitry Torokhov, Corentin Chary,
	Thomas Renninger

Found another Lenovo ideapad S205 the product name is 1038DPG, it has
a 0x78 EC register exposes the state of wifi hardware switch on the machine.

So, add this patch to support Lenovo ideapad S205-1038DPG wifi hardware
switch in acer-wmi driver.

Evidently the Ideapad S205 is just a model name on the market, but they have
totally different product name in DMI table.

Reference: bko#43007
        https://bugzilla.kernel.org/show_bug.cgi?id=43007

Tested-by: Colin <colin.newell@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 83abfaa..f95a2d4 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -519,6 +519,15 @@ static struct dmi_system_id acer_quirks[] = {
 		},
 		.driver_data = &quirk_lenovo_ideapad_s205,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Lenovo Ideapad S205-1038DPG",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "1038DPG"),
+		},
+		.driver_data = &quirk_lenovo_ideapad_s205,
+	},
 	{}
 };
 
-- 
1.6.0.2

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

end of thread, other threads:[~2012-12-14  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-14  8:10 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
2012-12-14  8:10 ` [RESEND][PATCH 2/5] acer-wmi: support Lenovo ideapad S205 10382JG wifi switch Lee, Chun-Yi
2012-12-14  8:10 ` [RESEND][PATCH 3/5] acer-wmi: fix obj is NULL but dereferenced Lee, Chun-Yi
2012-12-14  8:10 ` [RESEND][PATCH 4/5] acer-wmi: change to emit touchpad on off key Lee, Chun-Yi
2012-12-14  8:10 ` [RESEND][PATCH 5/5] acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch Lee, Chun-Yi
2012-12-14  8:14 [RESEND][PATCH 1/5] MAINTAINERS: change the mail address of acer-wmi/msi-laptop maintainer Lee, Chun-Yi
2012-12-14  8:14 ` [RESEND][PATCH 5/5] acer-wmi: support Lenovo ideapad S205 1038DPG wifi switch Lee, Chun-Yi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.