All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACER: Add support for accelerometer sensor
@ 2012-06-01 17:11 Marek Vasut
  2012-06-01 17:11 ` [PATCH 2/2] ACER: Add support for ambient light sensor Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-01 17:11 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: Marek Vasut, joeyli

This device is present on Iconia Tab W500.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: joeyli <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |  138 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index c1a3fd8..edb6bad 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -95,6 +95,7 @@ MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026");
 
 enum acer_wmi_event_ids {
 	WMID_HOTKEY_EVENT = 0x1,
+	WMID_ACCEL_EVENT = 0x5,
 };
 
 static const struct key_entry acer_wmi_keymap[] = {
@@ -130,6 +131,7 @@ static const struct key_entry acer_wmi_keymap[] = {
 };
 
 static struct input_dev *acer_wmi_input_dev;
+static struct input_dev *acer_wmi_accel_dev;
 
 struct event_return_value {
 	u8 function;
@@ -200,6 +202,7 @@ struct hotkey_function_type_aa {
 #define ACER_CAP_BLUETOOTH		(1<<2)
 #define ACER_CAP_BRIGHTNESS		(1<<3)
 #define ACER_CAP_THREEG			(1<<4)
+#define ACER_CAP_ACCEL			(1<<5)
 #define ACER_CAP_ANY			(0xFFFFFFFF)
 
 /*
@@ -1375,6 +1378,60 @@ static void acer_backlight_exit(void)
 }
 
 /*
+ * Accelerometer device
+ */
+static acpi_handle gsensor_handle;
+
+static int acer_gsensor_init(void)
+{
+	acpi_status status;
+	struct acpi_buffer output;
+	union acpi_object out_obj;
+
+	output.length = sizeof(out_obj);
+	output.pointer = &out_obj;
+	status = acpi_evaluate_object(gsensor_handle, "_INI", NULL, &output);
+	if (ACPI_FAILURE(status))
+		return -1;
+
+	return 0;
+}
+
+static int acer_gsensor_open(struct input_dev *input)
+{
+	return acer_gsensor_init();
+}
+
+static int acer_gsensor_event(void)
+{
+	acpi_status status;
+	struct acpi_buffer output;
+	union acpi_object out_obj[5];
+
+	if (!has_cap(ACER_CAP_ACCEL))
+		return -1;
+
+	output.length = sizeof(out_obj);
+	output.pointer = out_obj;
+
+	status = acpi_evaluate_object(gsensor_handle, "RDVL", NULL, &output);
+	if (ACPI_FAILURE(status))
+		return -1;
+
+	if (out_obj->package.count != 4)
+		return -1;
+
+	input_report_abs(acer_wmi_accel_dev, ABS_X,
+		(s16)out_obj->package.elements[0].integer.value);
+	input_report_abs(acer_wmi_accel_dev, ABS_Y,
+		(s16)out_obj->package.elements[1].integer.value);
+	input_report_abs(acer_wmi_accel_dev, ABS_Z,
+		(s16)out_obj->package.elements[2].integer.value);
+	input_sync(acer_wmi_accel_dev);
+	return 0;
+}
+
+/*
  * Rfkill devices
  */
 static void acer_rfkill_update(struct work_struct *ignored);
@@ -1649,6 +1706,9 @@ static void acer_wmi_notify(u32 value, void *context)
 						   1, true);
 		}
 		break;
+	case WMID_ACCEL_EVENT:
+		acer_gsensor_event();
+		break;
 	default:
 		pr_warn("Unknown function number - %d - %d\n",
 			return_value.function, return_value.key_num);
@@ -1734,6 +1794,74 @@ static int acer_wmi_enable_lm(void)
 	return status;
 }
 
+static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32 level,
+						void *ctx, void **retval)
+{
+	*(acpi_handle *)retval = ah;
+	return AE_OK;
+}
+
+static int __init acer_wmi_get_handle(const char *name, const char *prop,
+					acpi_handle *ah)
+{
+	acpi_status status;
+	acpi_handle handle;
+
+	BUG_ON(!name || !ah);
+
+	handle = 0;
+	status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
+					(void *)name, &handle);
+
+	if (ACPI_SUCCESS(status)) {
+		*ah = handle;
+		return 0;
+	} else {
+		return -ENODEV;
+	}
+}
+
+static int __init acer_wmi_accel_setup(void)
+{
+	int err;
+
+	err = acer_wmi_get_handle("SENR", "BST0001", &gsensor_handle);
+	if (err)
+		return err;
+
+	interface->capability |= ACER_CAP_ACCEL;
+
+	acer_wmi_accel_dev = input_allocate_device();
+	if (!acer_wmi_accel_dev)
+		return -ENOMEM;
+
+	acer_wmi_accel_dev->open = acer_gsensor_open;
+
+	acer_wmi_accel_dev->name = "Acer BMA150 accelerometer";
+	acer_wmi_accel_dev->phys = "wmi/input1";
+	acer_wmi_accel_dev->id.bustype = BUS_HOST;
+	acer_wmi_accel_dev->evbit[0] = BIT_MASK(EV_ABS);
+	input_set_abs_params(acer_wmi_accel_dev, ABS_X, -16384, 16384, 0, 0);
+	input_set_abs_params(acer_wmi_accel_dev, ABS_Y, -16384, 16384, 0, 0);
+	input_set_abs_params(acer_wmi_accel_dev, ABS_Z, -16384, 16384, 0, 0);
+
+	err = input_register_device(acer_wmi_accel_dev);
+	if (err)
+		goto err_free_dev;
+
+	return 0;
+
+err_free_dev:
+	input_free_device(acer_wmi_accel_dev);
+	return err;
+}
+
+static void acer_wmi_accel_destroy(void)
+{
+	input_unregister_device(acer_wmi_accel_dev);
+	input_free_device(acer_wmi_accel_dev);
+}
+
 static int __init acer_wmi_input_setup(void)
 {
 	acpi_status status;
@@ -1889,6 +2017,9 @@ static int acer_platform_resume(struct platform_device *device)
 	if (has_cap(ACER_CAP_BRIGHTNESS))
 		set_u32(data->brightness, ACER_CAP_BRIGHTNESS);
 
+	if (has_cap(ACER_CAP_ACCEL))
+		acer_gsensor_init();
+
 	return 0;
 }
 
@@ -2066,6 +2197,8 @@ static int __init acer_wmi_init(void)
 			return err;
 	}
 
+	acer_wmi_accel_setup();
+
 	err = platform_driver_register(&acer_platform_driver);
 	if (err) {
 		pr_err("Unable to register platform driver\n");
@@ -2109,6 +2242,8 @@ error_device_alloc:
 error_platform_register:
 	if (wmi_has_guid(ACERWMID_EVENT_GUID))
 		acer_wmi_input_destroy();
+	if (has_cap(ACER_CAP_ACCEL))
+		acer_wmi_accel_destroy();
 
 	return err;
 }
@@ -2118,6 +2253,9 @@ static void __exit acer_wmi_exit(void)
 	if (wmi_has_guid(ACERWMID_EVENT_GUID))
 		acer_wmi_input_destroy();
 
+	if (has_cap(ACER_CAP_ACCEL))
+		acer_wmi_accel_destroy();
+
 	remove_sysfs(acer_platform_device);
 	remove_debugfs();
 	platform_device_unregister(acer_platform_device);
-- 
1.7.10

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

* [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-01 17:11 [PATCH 1/2] ACER: Add support for accelerometer sensor Marek Vasut
@ 2012-06-01 17:11 ` Marek Vasut
  2012-06-04  9:08   ` joeyli
  2012-06-04 11:13   ` Corentin Chary
  2012-06-04  8:23 ` [PATCH 1/2] ACER: Add support for accelerometer sensor joeyli
  2012-06-26 18:41 ` Matthew Garrett
  2 siblings, 2 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-01 17:11 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: Marek Vasut, joeyli

This is the ambient light sensor found on Iconia W500.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: joeyli <jlee@suse.com>
---
 drivers/platform/x86/acer-wmi.c |   86 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index edb6bad..a58c415 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -203,6 +203,7 @@ struct hotkey_function_type_aa {
 #define ACER_CAP_BRIGHTNESS		(1<<3)
 #define ACER_CAP_THREEG			(1<<4)
 #define ACER_CAP_ACCEL			(1<<5)
+#define ACER_CAP_ALS			(1<<6)
 #define ACER_CAP_ANY			(0xFFFFFFFF)
 
 /*
@@ -1378,6 +1379,63 @@ static void acer_backlight_exit(void)
 }
 
 /*
+ * Ambient light sensor device
+ */
+static acpi_handle alsd_handle;
+
+static int acer_als_init(void)
+{
+	union acpi_object in_obj;
+	struct acpi_object_list params;
+	struct acpi_buffer out;
+	union acpi_object out_obj;
+	acpi_status status;
+
+	status = acpi_evaluate_object(alsd_handle, "_INI", NULL, NULL);
+	if (ACPI_FAILURE(status))
+		return -1;
+
+	params.count = 1;
+	params.pointer = &in_obj;
+	in_obj.type = ACPI_TYPE_INTEGER;
+	/*
+	 * Unknown argument of both GLOV and GUPV, set to 5.
+	 * GLOV - G? Lower Value ?
+	 * GUPV - G? Upper Value ?
+	 */
+	in_obj.integer.value = 5;
+	out.length = sizeof(out_obj);
+	out.pointer = &out_obj;
+
+	acpi_evaluate_object(alsd_handle, "GLOV", &params, &out);
+	acpi_evaluate_object(alsd_handle, "GUPV", &params, &out);
+
+	return 0;
+}
+
+static ssize_t acer_als_show(struct device *dev, struct device_attribute *attr,
+			char *buf)
+{
+	acpi_status status;
+	struct acpi_buffer output;
+	union acpi_object out_obj;
+
+	status = acpi_evaluate_object(alsd_handle, "S3WK", NULL, NULL);
+	if (ACPI_FAILURE(status))
+		return -1;
+
+	output.length = sizeof(out_obj);
+	output.pointer = &out_obj;
+	status = acpi_evaluate_object(alsd_handle, "_ALI", NULL, &output);
+	if (ACPI_FAILURE(status))
+		return -1;
+
+	return sprintf(buf, "%d\n", (u16)out_obj.integer.value);
+}
+
+static DEVICE_ATTR(ls_switch, S_IRUGO, acer_als_show, NULL);
+
+/*
  * Accelerometer device
  */
 static acpi_handle gsensor_handle;
@@ -1856,6 +1914,21 @@ err_free_dev:
 	return err;
 }
 
+static int __init acer_wmi_alsd_setup(void)
+{
+	int err;
+
+	err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
+	if (err)
+		return err;
+
+	interface->capability |= ACER_CAP_ALS;
+
+	acer_als_init();
+
+	return 0;
+}
+
 static void acer_wmi_accel_destroy(void)
 {
 	input_unregister_device(acer_wmi_accel_dev);
@@ -2020,6 +2093,9 @@ static int acer_platform_resume(struct platform_device *device)
 	if (has_cap(ACER_CAP_ACCEL))
 		acer_gsensor_init();
 
+	if (has_cap(ACER_CAP_ALS))
+		acer_als_init();
+
 	return 0;
 }
 
@@ -2052,6 +2128,8 @@ static int remove_sysfs(struct platform_device *device)
 {
 	if (has_cap(ACER_CAP_THREEG))
 		device_remove_file(&device->dev, &dev_attr_threeg);
+	if (has_cap(ACER_CAP_ALS))
+		device_remove_file(&device->dev, &dev_attr_ls_switch);
 
 	device_remove_file(&device->dev, &dev_attr_interface);
 
@@ -2069,6 +2147,13 @@ static int create_sysfs(void)
 			goto error_sysfs;
 	}
 
+	if (has_cap(ACER_CAP_ALS)) {
+		retval = device_create_file(&acer_platform_device->dev,
+			&dev_attr_ls_switch);
+		if (retval)
+			goto error_sysfs;
+	}
+
 	retval = device_create_file(&acer_platform_device->dev,
 		&dev_attr_interface);
 	if (retval)
@@ -2198,6 +2283,7 @@ static int __init acer_wmi_init(void)
 	}
 
 	acer_wmi_accel_setup();
+	acer_wmi_alsd_setup();
 
 	err = platform_driver_register(&acer_platform_driver);
 	if (err) {
-- 
1.7.10

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

* Re: [PATCH 1/2] ACER: Add support for accelerometer sensor
  2012-06-01 17:11 [PATCH 1/2] ACER: Add support for accelerometer sensor Marek Vasut
  2012-06-01 17:11 ` [PATCH 2/2] ACER: Add support for ambient light sensor Marek Vasut
@ 2012-06-04  8:23 ` joeyli
  2012-06-05 22:52   ` Marek Vasut
  2012-06-26 18:41 ` Matthew Garrett
  2 siblings, 1 reply; 17+ messages in thread
From: joeyli @ 2012-06-04  8:23 UTC (permalink / raw)
  To: Marek Vasut; +Cc: platform-driver-x86

於 五,2012-06-01 於 19:11 +0200,Marek Vasut 提到:
> This device is present on Iconia Tab W500.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: joeyli <jlee@suse.com>

This patch is good to me!

Acked-by: Lee, Chun-Yi <jlee@suse.com>


Thanks a lot!
Joey Lee

> ---
>  drivers/platform/x86/acer-wmi.c |  138 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 138 insertions(+)
> 
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index c1a3fd8..edb6bad 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -95,6 +95,7 @@ MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026");
>  
>  enum acer_wmi_event_ids {
>  	WMID_HOTKEY_EVENT = 0x1,
> +	WMID_ACCEL_EVENT = 0x5,
>  };
>  
>  static const struct key_entry acer_wmi_keymap[] = {
> @@ -130,6 +131,7 @@ static const struct key_entry acer_wmi_keymap[] = {
>  };
>  
>  static struct input_dev *acer_wmi_input_dev;
> +static struct input_dev *acer_wmi_accel_dev;
>  
>  struct event_return_value {
>  	u8 function;
> @@ -200,6 +202,7 @@ struct hotkey_function_type_aa {
>  #define ACER_CAP_BLUETOOTH		(1<<2)
>  #define ACER_CAP_BRIGHTNESS		(1<<3)
>  #define ACER_CAP_THREEG			(1<<4)
> +#define ACER_CAP_ACCEL			(1<<5)
>  #define ACER_CAP_ANY			(0xFFFFFFFF)
>  
>  /*
> @@ -1375,6 +1378,60 @@ static void acer_backlight_exit(void)
>  }
>  
>  /*
> + * Accelerometer device
> + */
> +static acpi_handle gsensor_handle;
> +
> +static int acer_gsensor_init(void)
> +{
> +	acpi_status status;
> +	struct acpi_buffer output;
> +	union acpi_object out_obj;
> +
> +	output.length = sizeof(out_obj);
> +	output.pointer = &out_obj;
> +	status = acpi_evaluate_object(gsensor_handle, "_INI", NULL, &output);
> +	if (ACPI_FAILURE(status))
> +		return -1;
> +
> +	return 0;
> +}
> +
> +static int acer_gsensor_open(struct input_dev *input)
> +{
> +	return acer_gsensor_init();
> +}
> +
> +static int acer_gsensor_event(void)
> +{
> +	acpi_status status;
> +	struct acpi_buffer output;
> +	union acpi_object out_obj[5];
> +
> +	if (!has_cap(ACER_CAP_ACCEL))
> +		return -1;
> +
> +	output.length = sizeof(out_obj);
> +	output.pointer = out_obj;
> +
> +	status = acpi_evaluate_object(gsensor_handle, "RDVL", NULL, &output);
> +	if (ACPI_FAILURE(status))
> +		return -1;
> +
> +	if (out_obj->package.count != 4)
> +		return -1;
> +
> +	input_report_abs(acer_wmi_accel_dev, ABS_X,
> +		(s16)out_obj->package.elements[0].integer.value);
> +	input_report_abs(acer_wmi_accel_dev, ABS_Y,
> +		(s16)out_obj->package.elements[1].integer.value);
> +	input_report_abs(acer_wmi_accel_dev, ABS_Z,
> +		(s16)out_obj->package.elements[2].integer.value);
> +	input_sync(acer_wmi_accel_dev);
> +	return 0;
> +}
> +
> +/*
>   * Rfkill devices
>   */
>  static void acer_rfkill_update(struct work_struct *ignored);
> @@ -1649,6 +1706,9 @@ static void acer_wmi_notify(u32 value, void *context)
>  						   1, true);
>  		}
>  		break;
> +	case WMID_ACCEL_EVENT:
> +		acer_gsensor_event();
> +		break;
>  	default:
>  		pr_warn("Unknown function number - %d - %d\n",
>  			return_value.function, return_value.key_num);
> @@ -1734,6 +1794,74 @@ static int acer_wmi_enable_lm(void)
>  	return status;
>  }
>  
> +static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32 level,
> +						void *ctx, void **retval)
> +{
> +	*(acpi_handle *)retval = ah;
> +	return AE_OK;
> +}
> +
> +static int __init acer_wmi_get_handle(const char *name, const char *prop,
> +					acpi_handle *ah)
> +{
> +	acpi_status status;
> +	acpi_handle handle;
> +
> +	BUG_ON(!name || !ah);
> +
> +	handle = 0;
> +	status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
> +					(void *)name, &handle);
> +
> +	if (ACPI_SUCCESS(status)) {
> +		*ah = handle;
> +		return 0;
> +	} else {
> +		return -ENODEV;
> +	}
> +}
> +
> +static int __init acer_wmi_accel_setup(void)
> +{
> +	int err;
> +
> +	err = acer_wmi_get_handle("SENR", "BST0001", &gsensor_handle);
> +	if (err)
> +		return err;
> +
> +	interface->capability |= ACER_CAP_ACCEL;
> +
> +	acer_wmi_accel_dev = input_allocate_device();
> +	if (!acer_wmi_accel_dev)
> +		return -ENOMEM;
> +
> +	acer_wmi_accel_dev->open = acer_gsensor_open;
> +
> +	acer_wmi_accel_dev->name = "Acer BMA150 accelerometer";
> +	acer_wmi_accel_dev->phys = "wmi/input1";
> +	acer_wmi_accel_dev->id.bustype = BUS_HOST;
> +	acer_wmi_accel_dev->evbit[0] = BIT_MASK(EV_ABS);
> +	input_set_abs_params(acer_wmi_accel_dev, ABS_X, -16384, 16384, 0, 0);
> +	input_set_abs_params(acer_wmi_accel_dev, ABS_Y, -16384, 16384, 0, 0);
> +	input_set_abs_params(acer_wmi_accel_dev, ABS_Z, -16384, 16384, 0, 0);
> +
> +	err = input_register_device(acer_wmi_accel_dev);
> +	if (err)
> +		goto err_free_dev;
> +
> +	return 0;
> +
> +err_free_dev:
> +	input_free_device(acer_wmi_accel_dev);
> +	return err;
> +}
> +
> +static void acer_wmi_accel_destroy(void)
> +{
> +	input_unregister_device(acer_wmi_accel_dev);
> +	input_free_device(acer_wmi_accel_dev);
> +}
> +
>  static int __init acer_wmi_input_setup(void)
>  {
>  	acpi_status status;
> @@ -1889,6 +2017,9 @@ static int acer_platform_resume(struct platform_device *device)
>  	if (has_cap(ACER_CAP_BRIGHTNESS))
>  		set_u32(data->brightness, ACER_CAP_BRIGHTNESS);
>  
> +	if (has_cap(ACER_CAP_ACCEL))
> +		acer_gsensor_init();
> +
>  	return 0;
>  }
>  
> @@ -2066,6 +2197,8 @@ static int __init acer_wmi_init(void)
>  			return err;
>  	}
>  
> +	acer_wmi_accel_setup();
> +
>  	err = platform_driver_register(&acer_platform_driver);
>  	if (err) {
>  		pr_err("Unable to register platform driver\n");
> @@ -2109,6 +2242,8 @@ error_device_alloc:
>  error_platform_register:
>  	if (wmi_has_guid(ACERWMID_EVENT_GUID))
>  		acer_wmi_input_destroy();
> +	if (has_cap(ACER_CAP_ACCEL))
> +		acer_wmi_accel_destroy();
>  
>  	return err;
>  }
> @@ -2118,6 +2253,9 @@ static void __exit acer_wmi_exit(void)
>  	if (wmi_has_guid(ACERWMID_EVENT_GUID))
>  		acer_wmi_input_destroy();
>  
> +	if (has_cap(ACER_CAP_ACCEL))
> +		acer_wmi_accel_destroy();
> +
>  	remove_sysfs(acer_platform_device);
>  	remove_debugfs();
>  	platform_device_unregister(acer_platform_device);

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-01 17:11 ` [PATCH 2/2] ACER: Add support for ambient light sensor Marek Vasut
@ 2012-06-04  9:08   ` joeyli
  2012-06-04  9:29     ` Marek Vasut
  2012-06-04 11:13   ` Corentin Chary
  1 sibling, 1 reply; 17+ messages in thread
From: joeyli @ 2012-06-04  9:08 UTC (permalink / raw)
  To: Marek Vasut; +Cc: platform-driver-x86, rui.zhang

Hi Marek, 

於 五,2012-06-01 於 19:11 +0200,Marek Vasut 提到:
> This is the ambient light sensor found on Iconia W500.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: joeyli <jlee@suse.com>
> ---
>  drivers/platform/x86/acer-wmi.c |   86 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)
> 
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index edb6bad..a58c415 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -203,6 +203,7 @@ struct hotkey_function_type_aa {
>  #define ACER_CAP_BRIGHTNESS		(1<<3)
>  #define ACER_CAP_THREEG			(1<<4)
>  #define ACER_CAP_ACCEL			(1<<5)
> +#define ACER_CAP_ALS			(1<<6)
>  #define ACER_CAP_ANY			(0xFFFFFFFF)
>  
>  /*
> @@ -1378,6 +1379,63 @@ static void acer_backlight_exit(void)
>  }
>  
>  /*
> + * Ambient light sensor device
> + */
> +static acpi_handle alsd_handle;
> +
> +static int acer_als_init(void)
> +{
> +	union acpi_object in_obj;
> +	struct acpi_object_list params;
> +	struct acpi_buffer out;
> +	union acpi_object out_obj;
> +	acpi_status status;
> +
> +	status = acpi_evaluate_object(alsd_handle, "_INI", NULL, NULL);
> +	if (ACPI_FAILURE(status))
> +		return -1;
> +
> +	params.count = 1;
> +	params.pointer = &in_obj;
> +	in_obj.type = ACPI_TYPE_INTEGER;
> +	/*
> +	 * Unknown argument of both GLOV and GUPV, set to 5.
> +	 * GLOV - G? Lower Value ?
> +	 * GUPV - G? Upper Value ?
> +	 */
> +	in_obj.integer.value = 5;
> +	out.length = sizeof(out_obj);
> +	out.pointer = &out_obj;
> +
> +	acpi_evaluate_object(alsd_handle, "GLOV", &params, &out);
> +	acpi_evaluate_object(alsd_handle, "GUPV", &params, &out);
> +

GUPV/GLOV also call by _INI, why need evaluate it again?

            Method (_INI, 0, NotSerialized)
            {
...
                Store (GUPV (Local1), Local2)
                Store (GLOV (Local1), Local3)

And, why use '5' to evaluate GUPV/GLOV?

> +	return 0;
> +}
> +
> +static ssize_t acer_als_show(struct device *dev, struct device_attribute *attr,
> +			char *buf)
> +{
> +	acpi_status status;
> +	struct acpi_buffer output;
> +	union acpi_object out_obj;
> +
> +	status = acpi_evaluate_object(alsd_handle, "S3WK", NULL, NULL);
> +	if (ACPI_FAILURE(status))
> +		return -1;
> +

Why need evaluate S3WK before _ALI ? Looks like this method call in S3
resume path:

 _WAK -> OEMW -> PRJW -> S3WK

> +	output.length = sizeof(out_obj);
> +	output.pointer = &out_obj;
> +	status = acpi_evaluate_object(alsd_handle, "_ALI", NULL, &output);
> +	if (ACPI_FAILURE(status))
> +		return -1;
> +
> +	return sprintf(buf, "%d\n", (u16)out_obj.integer.value);
> +}
> +
> +static DEVICE_ATTR(ls_switch, S_IRUGO, acer_als_show, NULL);
> +
> +/*
>   * Accelerometer device
>   */
>  static acpi_handle gsensor_handle;
> @@ -1856,6 +1914,21 @@ err_free_dev:
>  	return err;
>  }
>  
> +static int __init acer_wmi_alsd_setup(void)
> +{
> +	int err;
> +
> +	err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
> +	if (err)
> +		return err;
> +


Does anybody know why "introduce ACPI ALS device driver" patches from
Zhang Rui didn't include in acpi code base?

http://comments.gmane.org/gmane.linux.kernel/884328


There have V6 patches, but didn't see those patches show up in acpi git.


Thanks a lot!
Joey Lee

> +	interface->capability |= ACER_CAP_ALS;
> +
> +	acer_als_init();
> +
> +	return 0;
> +}
> +
>  static void acer_wmi_accel_destroy(void)
>  {
>  	input_unregister_device(acer_wmi_accel_dev);
> @@ -2020,6 +2093,9 @@ static int acer_platform_resume(struct platform_device *device)
>  	if (has_cap(ACER_CAP_ACCEL))
>  		acer_gsensor_init();
>  
> +	if (has_cap(ACER_CAP_ALS))
> +		acer_als_init();
> +
>  	return 0;
>  }
>  
> @@ -2052,6 +2128,8 @@ static int remove_sysfs(struct platform_device *device)
>  {
>  	if (has_cap(ACER_CAP_THREEG))
>  		device_remove_file(&device->dev, &dev_attr_threeg);
> +	if (has_cap(ACER_CAP_ALS))
> +		device_remove_file(&device->dev, &dev_attr_ls_switch);
>  
>  	device_remove_file(&device->dev, &dev_attr_interface);
>  
> @@ -2069,6 +2147,13 @@ static int create_sysfs(void)
>  			goto error_sysfs;
>  	}
>  
> +	if (has_cap(ACER_CAP_ALS)) {
> +		retval = device_create_file(&acer_platform_device->dev,
> +			&dev_attr_ls_switch);
> +		if (retval)
> +			goto error_sysfs;
> +	}
> +
>  	retval = device_create_file(&acer_platform_device->dev,
>  		&dev_attr_interface);
>  	if (retval)
> @@ -2198,6 +2283,7 @@ static int __init acer_wmi_init(void)
>  	}
>  
>  	acer_wmi_accel_setup();
> +	acer_wmi_alsd_setup();
>  
>  	err = platform_driver_register(&acer_platform_driver);
>  	if (err) {

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-04  9:08   ` joeyli
@ 2012-06-04  9:29     ` Marek Vasut
  0 siblings, 0 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-04  9:29 UTC (permalink / raw)
  To: joeyli; +Cc: platform-driver-x86, rui.zhang

Dear joeyli,

> Hi Marek,
> 
> 於 五,2012-06-01 於 19:11 +0200,Marek Vasut 提到:
> 
> > This is the ambient light sensor found on Iconia W500.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: joeyli <jlee@suse.com>
> > ---
> > 
> >  drivers/platform/x86/acer-wmi.c |   86
> >  +++++++++++++++++++++++++++++++++++++++ 1 file changed, 86
> >  insertions(+)
> > 
> > diff --git a/drivers/platform/x86/acer-wmi.c
> > b/drivers/platform/x86/acer-wmi.c index edb6bad..a58c415 100644
> > --- a/drivers/platform/x86/acer-wmi.c
> > +++ b/drivers/platform/x86/acer-wmi.c
> > @@ -203,6 +203,7 @@ struct hotkey_function_type_aa {
> > 
> >  #define ACER_CAP_BRIGHTNESS		(1<<3)
> >  #define ACER_CAP_THREEG			(1<<4)
> >  #define ACER_CAP_ACCEL			(1<<5)
> > 
> > +#define ACER_CAP_ALS			(1<<6)
> > 
> >  #define ACER_CAP_ANY			(0xFFFFFFFF)
> >  
> >  /*
> > 
> > @@ -1378,6 +1379,63 @@ static void acer_backlight_exit(void)
> > 
> >  }
> >  
> >  /*
> > 
> > + * Ambient light sensor device
> > + */
> > +static acpi_handle alsd_handle;
> > +
> > +static int acer_als_init(void)
> > +{
> > +	union acpi_object in_obj;
> > +	struct acpi_object_list params;
> > +	struct acpi_buffer out;
> > +	union acpi_object out_obj;
> > +	acpi_status status;
> > +
> > +	status = acpi_evaluate_object(alsd_handle, "_INI", NULL, NULL);
> > +	if (ACPI_FAILURE(status))
> > +		return -1;
> > +
> > +	params.count = 1;
> > +	params.pointer = &in_obj;
> > +	in_obj.type = ACPI_TYPE_INTEGER;
> > +	/*
> > +	 * Unknown argument of both GLOV and GUPV, set to 5.
> > +	 * GLOV - G? Lower Value ?
> > +	 * GUPV - G? Upper Value ?
> > +	 */
> > +	in_obj.integer.value = 5;
> > +	out.length = sizeof(out_obj);
> > +	out.pointer = &out_obj;
> > +
> > +	acpi_evaluate_object(alsd_handle, "GLOV", &params, &out);
> > +	acpi_evaluate_object(alsd_handle, "GUPV", &params, &out);
> > +
> 
> GUPV/GLOV also call by _INI, why need evaluate it again?

What does _INI set them to though?

>             Method (_INI, 0, NotSerialized)
>             {
> ...
>                 Store (GUPV (Local1), Local2)
>                 Store (GLOV (Local1), Local3)
> 
> And, why use '5' to evaluate GUPV/GLOV?

It seemed like the value that worked the best. I think those packages defined at 
the begining of the ALSD section define some kind of profiles (maybe, cloudy, 
bright light etc). And this selects the profile.

> 
> > +	return 0;
> > +}
> > +
> > +static ssize_t acer_als_show(struct device *dev, struct device_attribute
> > *attr, +			char *buf)
> > +{
> > +	acpi_status status;
> > +	struct acpi_buffer output;
> > +	union acpi_object out_obj;
> > +
> > +	status = acpi_evaluate_object(alsd_handle, "S3WK", NULL, NULL);
> > +	if (ACPI_FAILURE(status))
> > +		return -1;
> > +
> 
> Why need evaluate S3WK before _ALI ? Looks like this method call in S3
> resume path:

It makes the sensor re-read the data and it's faster than calling _INI.

>  _WAK -> OEMW -> PRJW -> S3WK
> 
> > +	output.length = sizeof(out_obj);
> > +	output.pointer = &out_obj;
> > +	status = acpi_evaluate_object(alsd_handle, "_ALI", NULL, &output);
> > +	if (ACPI_FAILURE(status))
> > +		return -1;
> > +
> > +	return sprintf(buf, "%d\n", (u16)out_obj.integer.value);
> > +}
> > +
> > +static DEVICE_ATTR(ls_switch, S_IRUGO, acer_als_show, NULL);
> > +
> > +/*
> > 
> >   * Accelerometer device
> >   */
> >  
> >  static acpi_handle gsensor_handle;
> > 
> > @@ -1856,6 +1914,21 @@ err_free_dev:
> >  	return err;
> >  
> >  }
> > 
> > +static int __init acer_wmi_alsd_setup(void)
> > +{
> > +	int err;
> > +
> > +	err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
> > +	if (err)
> > +		return err;
> > +
> 
> Does anybody know why "introduce ACPI ALS device driver" patches from
> Zhang Rui didn't include in acpi code base?
> 
> http://comments.gmane.org/gmane.linux.kernel/884328
> 
> 
> There have V6 patches, but didn't see those patches show up in acpi git.

Now this would be much cooler to have than this crappy hack of mine :-)

> Thanks a lot!
> Joey Lee
> 

Best regards,
Marek Vasut

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-01 17:11 ` [PATCH 2/2] ACER: Add support for ambient light sensor Marek Vasut
  2012-06-04  9:08   ` joeyli
@ 2012-06-04 11:13   ` Corentin Chary
  2012-06-04 17:14     ` Marek Vasut
  1 sibling, 1 reply; 17+ messages in thread
From: Corentin Chary @ 2012-06-04 11:13 UTC (permalink / raw)
  To: Marek Vasut; +Cc: platform-driver-x86, joeyli, Zhang, Rui, Len Brown

On Fri, Jun 1, 2012 at 7:11 PM, Marek Vasut <marex@denx.de> wrote:
> This is the ambient light sensor found on Iconia W500.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: joeyli <jlee@suse.com>
> ---
>  drivers/platform/x86/acer-wmi.c |   86 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index edb6bad..a58c415 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -203,6 +203,7 @@ struct hotkey_function_type_aa {
>  #define ACER_CAP_BRIGHTNESS            (1<<3)
>  #define ACER_CAP_THREEG                        (1<<4)
>  #define ACER_CAP_ACCEL                 (1<<5)
> +#define ACER_CAP_ALS                   (1<<6)
>  #define ACER_CAP_ANY                   (0xFFFFFFFF)
>
>  /*
> @@ -1378,6 +1379,63 @@ static void acer_backlight_exit(void)
>  }
>
>  /*
> + * Ambient light sensor device
> + */
> +static acpi_handle alsd_handle;
> +
> +static int acer_als_init(void)
> +{
> +       union acpi_object in_obj;
> +       struct acpi_object_list params;
> +       struct acpi_buffer out;
> +       union acpi_object out_obj;
> +       acpi_status status;
> +
> +       status = acpi_evaluate_object(alsd_handle, "_INI", NULL, NULL);
> +       if (ACPI_FAILURE(status))
> +               return -1;
> +
> +       params.count = 1;
> +       params.pointer = &in_obj;
> +       in_obj.type = ACPI_TYPE_INTEGER;
> +       /*
> +        * Unknown argument of both GLOV and GUPV, set to 5.
> +        * GLOV - G? Lower Value ?
> +        * GUPV - G? Upper Value ?
> +        */
> +       in_obj.integer.value = 5;
> +       out.length = sizeof(out_obj);
> +       out.pointer = &out_obj;
> +
> +       acpi_evaluate_object(alsd_handle, "GLOV", &params, &out);
> +       acpi_evaluate_object(alsd_handle, "GUPV", &params, &out);
> +
> +       return 0;
> +}
> +
> +static ssize_t acer_als_show(struct device *dev, struct device_attribute *attr,
> +                       char *buf)
> +{
> +       acpi_status status;
> +       struct acpi_buffer output;
> +       union acpi_object out_obj;
> +
> +       status = acpi_evaluate_object(alsd_handle, "S3WK", NULL, NULL);
> +       if (ACPI_FAILURE(status))
> +               return -1;
> +
> +       output.length = sizeof(out_obj);
> +       output.pointer = &out_obj;
> +       status = acpi_evaluate_object(alsd_handle, "_ALI", NULL, &output);
> +       if (ACPI_FAILURE(status))
> +               return -1;
> +
> +       return sprintf(buf, "%d\n", (u16)out_obj.integer.value);
> +}
> +
> +static DEVICE_ATTR(ls_switch, S_IRUGO, acer_als_show, NULL);
> +
> +/*
>  * Accelerometer device
>  */
>  static acpi_handle gsensor_handle;
> @@ -1856,6 +1914,21 @@ err_free_dev:
>        return err;
>  }
>
> +static int __init acer_wmi_alsd_setup(void)
> +{
> +       int err;
> +
> +       err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
> +       if (err)
> +               return err;

NACK ! This is a generic device, and should be handled by ACPI core
(Samsung laptop have this too). See "ACPI ALS" on linux-acpi.

> +       interface->capability |= ACER_CAP_ALS;
> +
> +       acer_als_init();
> +
> +       return 0;
> +}
> +
>  static void acer_wmi_accel_destroy(void)
>  {
>        input_unregister_device(acer_wmi_accel_dev);
> @@ -2020,6 +2093,9 @@ static int acer_platform_resume(struct platform_device *device)
>        if (has_cap(ACER_CAP_ACCEL))
>                acer_gsensor_init();
>
> +       if (has_cap(ACER_CAP_ALS))
> +               acer_als_init();
> +
>        return 0;
>  }
>
> @@ -2052,6 +2128,8 @@ static int remove_sysfs(struct platform_device *device)
>  {
>        if (has_cap(ACER_CAP_THREEG))
>                device_remove_file(&device->dev, &dev_attr_threeg);
> +       if (has_cap(ACER_CAP_ALS))
> +               device_remove_file(&device->dev, &dev_attr_ls_switch);
>
>        device_remove_file(&device->dev, &dev_attr_interface);
>
> @@ -2069,6 +2147,13 @@ static int create_sysfs(void)
>                        goto error_sysfs;
>        }
>
> +       if (has_cap(ACER_CAP_ALS)) {
> +               retval = device_create_file(&acer_platform_device->dev,
> +                       &dev_attr_ls_switch);
> +               if (retval)
> +                       goto error_sysfs;
> +       }
> +
>        retval = device_create_file(&acer_platform_device->dev,
>                &dev_attr_interface);
>        if (retval)
> @@ -2198,6 +2283,7 @@ static int __init acer_wmi_init(void)
>        }
>
>        acer_wmi_accel_setup();
> +       acer_wmi_alsd_setup();
>
>        err = platform_driver_register(&acer_platform_driver);
>        if (err) {
> --
> 1.7.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Corentin Chary
http://xf.iksaif.net

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-04 11:13   ` Corentin Chary
@ 2012-06-04 17:14     ` Marek Vasut
  2012-06-05 12:49       ` Corentin Chary
  0 siblings, 1 reply; 17+ messages in thread
From: Marek Vasut @ 2012-06-04 17:14 UTC (permalink / raw)
  To: Corentin Chary; +Cc: platform-driver-x86, joeyli, Zhang, Rui, Len Brown

Dear Corentin Chary,

> On Fri, Jun 1, 2012 at 7:11 PM, Marek Vasut <marex@denx.de> wrote:
> > This is the ambient light sensor found on Iconia W500.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: joeyli <jlee@suse.com>
> > ---

[...]

> > +static int __init acer_wmi_alsd_setup(void)
> > +{
> > +       int err;
> > +
> > +       err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
> > +       if (err)
> > +               return err;
> 
> NACK !

What are you trying to achieve with such attitude? Are you trying to show off 
how much you can scream at someone new? I'd tell you some really harsh words and 
would turn my back on all this linux stuff if I wasn't used to people in kernel 
mailing lists having quite weird manners sometimes.

> This is a generic device, and should be handled by ACPI core
> (Samsung laptop have this too). See "ACPI ALS" on linux-acpi.

Saying this would be enough. Lee explained to me what this ACPI0008 means, I'm 
quite new to the ACPI land so pardon my ignorance here. But it then boils down 
to Lee's question, why wasn't the patch for ACPI ALS that was already proposed 
accepted? And what can be done to get it in?

Best regards,
Marek Vasut

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-04 17:14     ` Marek Vasut
@ 2012-06-05 12:49       ` Corentin Chary
  2012-06-05 13:06         ` Marek Vasut
  2012-06-05 22:55         ` Marek Vasut
  0 siblings, 2 replies; 17+ messages in thread
From: Corentin Chary @ 2012-06-05 12:49 UTC (permalink / raw)
  To: Marek Vasut; +Cc: platform-driver-x86, joeyli, Zhang, Rui, Len Brown

On Mon, Jun 4, 2012 at 7:14 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Corentin Chary,
>
>> On Fri, Jun 1, 2012 at 7:11 PM, Marek Vasut <marex@denx.de> wrote:
>> > This is the ambient light sensor found on Iconia W500.
>> >
>> > Signed-off-by: Marek Vasut <marex@denx.de>
>> > Cc: joeyli <jlee@suse.com>
>> > ---
>
> [...]
>
>> > +static int __init acer_wmi_alsd_setup(void)
>> > +{
>> > +       int err;
>> > +
>> > +       err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
>> > +       if (err)
>> > +               return err;
>>
>> NACK !
>
> What are you trying to achieve with such attitude? Are you trying to show off
> how much you can scream at someone new? I'd tell you some really harsh words and
> would turn my back on all this linux stuff if I wasn't used to people in kernel
> mailing lists having quite weird manners sometimes.

Sorry, that really wasn't what I meant. ACK / NACK are traditionnaly
written like this arround here, but the "!" was probably too much.

>
>> This is a generic device, and should be handled by ACPI core
>> (Samsung laptop have this too). See "ACPI ALS" on linux-acpi.
>
> Saying this would be enough. Lee explained to me what this ACPI0008 means, I'm
> quite new to the ACPI land so pardon my ignorance here. But it then boils down
> to Lee's question, why wasn't the patch for ACPI ALS that was already proposed
> accepted? And what can be done to get it in?

Yep, I've seen Lee's message latter. Regarding ACPI ALS status, it was
forgotten for a long time, and recently Zhang Rui told that he will
take another look at it, but nothing sure. If you want to know more
about the status, you can do a quick search on gmane using "ACPI ALS"
query on linux.acpi


-- 
Corentin Chary
http://xf.iksaif.net

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-05 12:49       ` Corentin Chary
@ 2012-06-05 13:06         ` Marek Vasut
  2012-06-05 22:55         ` Marek Vasut
  1 sibling, 0 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-05 13:06 UTC (permalink / raw)
  To: Corentin Chary; +Cc: platform-driver-x86, joeyli, Zhang, Rui, Len Brown

Dear Corentin Chary,

> On Mon, Jun 4, 2012 at 7:14 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Corentin Chary,
> > 
> >> On Fri, Jun 1, 2012 at 7:11 PM, Marek Vasut <marex@denx.de> wrote:
> >> > This is the ambient light sensor found on Iconia W500.
> >> > 
> >> > Signed-off-by: Marek Vasut <marex@denx.de>
> >> > Cc: joeyli <jlee@suse.com>
> >> > ---
> > 
> > [...]
> > 
> >> > +static int __init acer_wmi_alsd_setup(void)
> >> > +{
> >> > +       int err;
> >> > +
> >> > +       err = acer_wmi_get_handle("ALSD", "ACPI0008", &alsd_handle);
> >> > +       if (err)
> >> > +               return err;
> >> 
> >> NACK !
> > 
> > What are you trying to achieve with such attitude? Are you trying to show
> > off how much you can scream at someone new? I'd tell you some really
> > harsh words and would turn my back on all this linux stuff if I wasn't
> > used to people in kernel mailing lists having quite weird manners
> > sometimes.
> 
> Sorry, that really wasn't what I meant. ACK / NACK are traditionnaly
> written like this arround here, but the "!" was probably too much.

Ok, don't worry :-) Sorry about my jab above.

> >> This is a generic device, and should be handled by ACPI core
> >> (Samsung laptop have this too). See "ACPI ALS" on linux-acpi.
> > 
> > Saying this would be enough. Lee explained to me what this ACPI0008
> > means, I'm quite new to the ACPI land so pardon my ignorance here. But
> > it then boils down to Lee's question, why wasn't the patch for ACPI ALS
> > that was already proposed accepted? And what can be done to get it in?
> 
> Yep, I've seen Lee's message latter. Regarding ACPI ALS status, it was
> forgotten for a long time, and recently Zhang Rui told that he will
> take another look at it, but nothing sure. If you want to know more
> about the status, you can do a quick search on gmane using "ACPI ALS"
> query on linux.acpi

Will do, but I have an exam on 20th so I'll either poke into it if I need some 
rest or afterwards.

Best regards,
Marek Vasut

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

* Re: [PATCH 1/2] ACER: Add support for accelerometer sensor
  2012-06-04  8:23 ` [PATCH 1/2] ACER: Add support for accelerometer sensor joeyli
@ 2012-06-05 22:52   ` Marek Vasut
  2012-06-06  0:15     ` joeyli
  0 siblings, 1 reply; 17+ messages in thread
From: Marek Vasut @ 2012-06-05 22:52 UTC (permalink / raw)
  To: joeyli; +Cc: platform-driver-x86

Dear joeyli,

> 於 五,2012-06-01 於 19:11 +0200,Marek Vasut 提到:
> 
> > This device is present on Iconia Tab W500.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: joeyli <jlee@suse.com>
> 
> This patch is good to me!

Thanks for your help and guidance throughout the process. Now who'll apply it 
and when can I expect it in -next or somewhere (where?)?

> Acked-by: Lee, Chun-Yi <jlee@suse.com>
> 
> 
> Thanks a lot!
> Joey Lee
> 
> > ---
> > 
> >  drivers/platform/x86/acer-wmi.c |  138
> >  +++++++++++++++++++++++++++++++++++++++ 1 file changed, 138
> >  insertions(+)
> > 
> > diff --git a/drivers/platform/x86/acer-wmi.c
> > b/drivers/platform/x86/acer-wmi.c index c1a3fd8..edb6bad 100644
> > --- a/drivers/platform/x86/acer-wmi.c
> > +++ b/drivers/platform/x86/acer-wmi.c
> > @@ -95,6 +95,7 @@
> > MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026");
> > 
> >  enum acer_wmi_event_ids {
> >  
> >  	WMID_HOTKEY_EVENT = 0x1,
> > 
> > +	WMID_ACCEL_EVENT = 0x5,
> > 
> >  };
> >  
> >  static const struct key_entry acer_wmi_keymap[] = {
> > 
> > @@ -130,6 +131,7 @@ static const struct key_entry acer_wmi_keymap[] = {
> > 
> >  };
> >  
> >  static struct input_dev *acer_wmi_input_dev;
> > 
> > +static struct input_dev *acer_wmi_accel_dev;
> > 
> >  struct event_return_value {
> >  
> >  	u8 function;
> > 
> > @@ -200,6 +202,7 @@ struct hotkey_function_type_aa {
> > 
> >  #define ACER_CAP_BLUETOOTH		(1<<2)
> >  #define ACER_CAP_BRIGHTNESS		(1<<3)
> >  #define ACER_CAP_THREEG			(1<<4)
> > 
> > +#define ACER_CAP_ACCEL			(1<<5)
> > 
> >  #define ACER_CAP_ANY			(0xFFFFFFFF)
> >  
> >  /*
> > 
> > @@ -1375,6 +1378,60 @@ static void acer_backlight_exit(void)
> > 
> >  }
> >  
> >  /*
> > 
> > + * Accelerometer device
> > + */
> > +static acpi_handle gsensor_handle;
> > +
> > +static int acer_gsensor_init(void)
> > +{
> > +	acpi_status status;
> > +	struct acpi_buffer output;
> > +	union acpi_object out_obj;
> > +
> > +	output.length = sizeof(out_obj);
> > +	output.pointer = &out_obj;
> > +	status = acpi_evaluate_object(gsensor_handle, "_INI", NULL, &output);
> > +	if (ACPI_FAILURE(status))
> > +		return -1;
> > +
> > +	return 0;
> > +}
> > +
> > +static int acer_gsensor_open(struct input_dev *input)
> > +{
> > +	return acer_gsensor_init();
> > +}
> > +
> > +static int acer_gsensor_event(void)
> > +{
> > +	acpi_status status;
> > +	struct acpi_buffer output;
> > +	union acpi_object out_obj[5];
> > +
> > +	if (!has_cap(ACER_CAP_ACCEL))
> > +		return -1;
> > +
> > +	output.length = sizeof(out_obj);
> > +	output.pointer = out_obj;
> > +
> > +	status = acpi_evaluate_object(gsensor_handle, "RDVL", NULL, &output);
> > +	if (ACPI_FAILURE(status))
> > +		return -1;
> > +
> > +	if (out_obj->package.count != 4)
> > +		return -1;
> > +
> > +	input_report_abs(acer_wmi_accel_dev, ABS_X,
> > +		(s16)out_obj->package.elements[0].integer.value);
> > +	input_report_abs(acer_wmi_accel_dev, ABS_Y,
> > +		(s16)out_obj->package.elements[1].integer.value);
> > +	input_report_abs(acer_wmi_accel_dev, ABS_Z,
> > +		(s16)out_obj->package.elements[2].integer.value);
> > +	input_sync(acer_wmi_accel_dev);
> > +	return 0;
> > +}
> > +
> > +/*
> > 
> >   * Rfkill devices
> >   */
> >  
> >  static void acer_rfkill_update(struct work_struct *ignored);
> > 
> > @@ -1649,6 +1706,9 @@ static void acer_wmi_notify(u32 value, void
> > *context)
> > 
> >  						   1, true);
> >  		
> >  		}
> >  		break;
> > 
> > +	case WMID_ACCEL_EVENT:
> > +		acer_gsensor_event();
> > +		break;
> > 
> >  	default:
> >  		pr_warn("Unknown function number - %d - %d\n",
> >  		
> >  			return_value.function, return_value.key_num);
> > 
> > @@ -1734,6 +1794,74 @@ static int acer_wmi_enable_lm(void)
> > 
> >  	return status;
> >  
> >  }
> > 
> > +static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32
> > level, +						void *ctx, void 
**retval)
> > +{
> > +	*(acpi_handle *)retval = ah;
> > +	return AE_OK;
> > +}
> > +
> > +static int __init acer_wmi_get_handle(const char *name, const char
> > *prop, +					acpi_handle *ah)
> > +{
> > +	acpi_status status;
> > +	acpi_handle handle;
> > +
> > +	BUG_ON(!name || !ah);
> > +
> > +	handle = 0;
> > +	status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
> > +					(void *)name, &handle);
> > +
> > +	if (ACPI_SUCCESS(status)) {
> > +		*ah = handle;
> > +		return 0;
> > +	} else {
> > +		return -ENODEV;
> > +	}
> > +}
> > +
> > +static int __init acer_wmi_accel_setup(void)
> > +{
> > +	int err;
> > +
> > +	err = acer_wmi_get_handle("SENR", "BST0001", &gsensor_handle);
> > +	if (err)
> > +		return err;
> > +
> > +	interface->capability |= ACER_CAP_ACCEL;
> > +
> > +	acer_wmi_accel_dev = input_allocate_device();
> > +	if (!acer_wmi_accel_dev)
> > +		return -ENOMEM;
> > +
> > +	acer_wmi_accel_dev->open = acer_gsensor_open;
> > +
> > +	acer_wmi_accel_dev->name = "Acer BMA150 accelerometer";
> > +	acer_wmi_accel_dev->phys = "wmi/input1";
> > +	acer_wmi_accel_dev->id.bustype = BUS_HOST;
> > +	acer_wmi_accel_dev->evbit[0] = BIT_MASK(EV_ABS);
> > +	input_set_abs_params(acer_wmi_accel_dev, ABS_X, -16384, 16384, 0, 0);
> > +	input_set_abs_params(acer_wmi_accel_dev, ABS_Y, -16384, 16384, 0, 0);
> > +	input_set_abs_params(acer_wmi_accel_dev, ABS_Z, -16384, 16384, 0, 0);
> > +
> > +	err = input_register_device(acer_wmi_accel_dev);
> > +	if (err)
> > +		goto err_free_dev;
> > +
> > +	return 0;
> > +
> > +err_free_dev:
> > +	input_free_device(acer_wmi_accel_dev);
> > +	return err;
> > +}
> > +
> > +static void acer_wmi_accel_destroy(void)
> > +{
> > +	input_unregister_device(acer_wmi_accel_dev);
> > +	input_free_device(acer_wmi_accel_dev);
> > +}
> > +
> > 
> >  static int __init acer_wmi_input_setup(void)
> >  {
> >  
> >  	acpi_status status;
> > 
> > @@ -1889,6 +2017,9 @@ static int acer_platform_resume(struct
> > platform_device *device)
> > 
> >  	if (has_cap(ACER_CAP_BRIGHTNESS))
> >  	
> >  		set_u32(data->brightness, ACER_CAP_BRIGHTNESS);
> > 
> > +	if (has_cap(ACER_CAP_ACCEL))
> > +		acer_gsensor_init();
> > +
> > 
> >  	return 0;
> >  
> >  }
> > 
> > @@ -2066,6 +2197,8 @@ static int __init acer_wmi_init(void)
> > 
> >  			return err;
> >  	
> >  	}
> > 
> > +	acer_wmi_accel_setup();
> > +
> > 
> >  	err = platform_driver_register(&acer_platform_driver);
> >  	if (err) {
> >  	
> >  		pr_err("Unable to register platform driver\n");
> > 
> > @@ -2109,6 +2242,8 @@ error_device_alloc:
> >  error_platform_register:
> >  	if (wmi_has_guid(ACERWMID_EVENT_GUID))
> >  	
> >  		acer_wmi_input_destroy();
> > 
> > +	if (has_cap(ACER_CAP_ACCEL))
> > +		acer_wmi_accel_destroy();
> > 
> >  	return err;
> >  
> >  }
> > 
> > @@ -2118,6 +2253,9 @@ static void __exit acer_wmi_exit(void)
> > 
> >  	if (wmi_has_guid(ACERWMID_EVENT_GUID))
> >  	
> >  		acer_wmi_input_destroy();
> > 
> > +	if (has_cap(ACER_CAP_ACCEL))
> > +		acer_wmi_accel_destroy();
> > +
> > 
> >  	remove_sysfs(acer_platform_device);
> >  	remove_debugfs();
> >  	platform_device_unregister(acer_platform_device);

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-05 12:49       ` Corentin Chary
  2012-06-05 13:06         ` Marek Vasut
@ 2012-06-05 22:55         ` Marek Vasut
  2012-06-06  1:22           ` Zhang Rui
  1 sibling, 1 reply; 17+ messages in thread
From: Marek Vasut @ 2012-06-05 22:55 UTC (permalink / raw)
  To: Corentin Chary; +Cc: platform-driver-x86, joeyli, Zhang, Rui, Len Brown, pavel

Dear Corentin Chary,

[...]

> >> This is a generic device, and should be handled by ACPI core
> >> (Samsung laptop have this too). See "ACPI ALS" on linux-acpi.
> > 
> > Saying this would be enough. Lee explained to me what this ACPI0008
> > means, I'm quite new to the ACPI land so pardon my ignorance here. But
> > it then boils down to Lee's question, why wasn't the patch for ACPI ALS
> > that was already proposed accepted? And what can be done to get it in?
> 
> Yep, I've seen Lee's message latter. Regarding ACPI ALS status, it was
> forgotten for a long time, and recently Zhang Rui told that he will
> take another look at it, but nothing sure. If you want to know more
> about the status, you can do a quick search on gmane using "ACPI ALS"
> query on linux.acpi

Actually, going through the ACPI0008 patch, I see it introduced new sysfs class. 
Maybe we should rather integrate it with Linux-IIO these days?

Best regards,
Marek Vasut

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

* Re: [PATCH 1/2] ACER: Add support for accelerometer sensor
  2012-06-05 22:52   ` Marek Vasut
@ 2012-06-06  0:15     ` joeyli
  2012-06-06 10:13       ` Marek Vasut
  0 siblings, 1 reply; 17+ messages in thread
From: joeyli @ 2012-06-06  0:15 UTC (permalink / raw)
  To: Marek Vasut; +Cc: platform-driver-x86

Hi Marek, 

於 三,2012-06-06 於 00:52 +0200,Marek Vasut 提到:
> Dear joeyli,
> 
> > 於 五,2012-06-01 於 19:11 +0200,Marek Vasut 提到:
> > 
> > > This device is present on Iconia Tab W500.
> > > 
> > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > Cc: joeyli <jlee@suse.com>
> > 
> > This patch is good to me!
> 
> Thanks for your help and guidance throughout the process. Now who'll apply it 
> and when can I expect it in -next or somewhere (where?)?
> 
> > Acked-by: Lee, Chun-Yi <jlee@suse.com>
> > 

Wait Matthew apply patch to platform driver git.

He already sent merge request to Linus and merged to v3.5-rc1 kernel.
I think need wait v3.6.


Thanks
Joey Lee

> > 
> > Thanks a lot!
> > Joey Lee
> > 
> > > ---
> > > 
> > >  drivers/platform/x86/acer-wmi.c |  138
> > >  +++++++++++++++++++++++++++++++++++++++ 1 file changed, 138
> > >  insertions(+)
> > > 
> > > diff --git a/drivers/platform/x86/acer-wmi.c
> > > b/drivers/platform/x86/acer-wmi.c index c1a3fd8..edb6bad 100644
> > > --- a/drivers/platform/x86/acer-wmi.c
> > > +++ b/drivers/platform/x86/acer-wmi.c
> > > @@ -95,6 +95,7 @@
> > > MODULE_ALIAS("wmi:676AA15E-6A47-4D9F-A2CC-1E6D18D14026");
> > > 
> > >  enum acer_wmi_event_ids {
> > >  
> > >  	WMID_HOTKEY_EVENT = 0x1,
> > > 
> > > +	WMID_ACCEL_EVENT = 0x5,
> > > 
> > >  };
> > >  
> > >  static const struct key_entry acer_wmi_keymap[] = {
> > > 
> > > @@ -130,6 +131,7 @@ static const struct key_entry acer_wmi_keymap[] = {
> > > 
> > >  };
> > >  
> > >  static struct input_dev *acer_wmi_input_dev;
> > > 
> > > +static struct input_dev *acer_wmi_accel_dev;
> > > 
> > >  struct event_return_value {
> > >  
> > >  	u8 function;
> > > 
> > > @@ -200,6 +202,7 @@ struct hotkey_function_type_aa {
> > > 
> > >  #define ACER_CAP_BLUETOOTH		(1<<2)
> > >  #define ACER_CAP_BRIGHTNESS		(1<<3)
> > >  #define ACER_CAP_THREEG			(1<<4)
> > > 
> > > +#define ACER_CAP_ACCEL			(1<<5)
> > > 
> > >  #define ACER_CAP_ANY			(0xFFFFFFFF)
> > >  
> > >  /*
> > > 
> > > @@ -1375,6 +1378,60 @@ static void acer_backlight_exit(void)
> > > 
> > >  }
> > >  
> > >  /*
> > > 
> > > + * Accelerometer device
> > > + */
> > > +static acpi_handle gsensor_handle;
> > > +
> > > +static int acer_gsensor_init(void)
> > > +{
> > > +	acpi_status status;
> > > +	struct acpi_buffer output;
> > > +	union acpi_object out_obj;
> > > +
> > > +	output.length = sizeof(out_obj);
> > > +	output.pointer = &out_obj;
> > > +	status = acpi_evaluate_object(gsensor_handle, "_INI", NULL, &output);
> > > +	if (ACPI_FAILURE(status))
> > > +		return -1;
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +static int acer_gsensor_open(struct input_dev *input)
> > > +{
> > > +	return acer_gsensor_init();
> > > +}
> > > +
> > > +static int acer_gsensor_event(void)
> > > +{
> > > +	acpi_status status;
> > > +	struct acpi_buffer output;
> > > +	union acpi_object out_obj[5];
> > > +
> > > +	if (!has_cap(ACER_CAP_ACCEL))
> > > +		return -1;
> > > +
> > > +	output.length = sizeof(out_obj);
> > > +	output.pointer = out_obj;
> > > +
> > > +	status = acpi_evaluate_object(gsensor_handle, "RDVL", NULL, &output);
> > > +	if (ACPI_FAILURE(status))
> > > +		return -1;
> > > +
> > > +	if (out_obj->package.count != 4)
> > > +		return -1;
> > > +
> > > +	input_report_abs(acer_wmi_accel_dev, ABS_X,
> > > +		(s16)out_obj->package.elements[0].integer.value);
> > > +	input_report_abs(acer_wmi_accel_dev, ABS_Y,
> > > +		(s16)out_obj->package.elements[1].integer.value);
> > > +	input_report_abs(acer_wmi_accel_dev, ABS_Z,
> > > +		(s16)out_obj->package.elements[2].integer.value);
> > > +	input_sync(acer_wmi_accel_dev);
> > > +	return 0;
> > > +}
> > > +
> > > +/*
> > > 
> > >   * Rfkill devices
> > >   */
> > >  
> > >  static void acer_rfkill_update(struct work_struct *ignored);
> > > 
> > > @@ -1649,6 +1706,9 @@ static void acer_wmi_notify(u32 value, void
> > > *context)
> > > 
> > >  						   1, true);
> > >  		
> > >  		}
> > >  		break;
> > > 
> > > +	case WMID_ACCEL_EVENT:
> > > +		acer_gsensor_event();
> > > +		break;
> > > 
> > >  	default:
> > >  		pr_warn("Unknown function number - %d - %d\n",
> > >  		
> > >  			return_value.function, return_value.key_num);
> > > 
> > > @@ -1734,6 +1794,74 @@ static int acer_wmi_enable_lm(void)
> > > 
> > >  	return status;
> > >  
> > >  }
> > > 
> > > +static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32
> > > level, +						void *ctx, void 
> **retval)
> > > +{
> > > +	*(acpi_handle *)retval = ah;
> > > +	return AE_OK;
> > > +}
> > > +
> > > +static int __init acer_wmi_get_handle(const char *name, const char
> > > *prop, +					acpi_handle *ah)
> > > +{
> > > +	acpi_status status;
> > > +	acpi_handle handle;
> > > +
> > > +	BUG_ON(!name || !ah);
> > > +
> > > +	handle = 0;
> > > +	status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
> > > +					(void *)name, &handle);
> > > +
> > > +	if (ACPI_SUCCESS(status)) {
> > > +		*ah = handle;
> > > +		return 0;
> > > +	} else {
> > > +		return -ENODEV;
> > > +	}
> > > +}
> > > +
> > > +static int __init acer_wmi_accel_setup(void)
> > > +{
> > > +	int err;
> > > +
> > > +	err = acer_wmi_get_handle("SENR", "BST0001", &gsensor_handle);
> > > +	if (err)
> > > +		return err;
> > > +
> > > +	interface->capability |= ACER_CAP_ACCEL;
> > > +
> > > +	acer_wmi_accel_dev = input_allocate_device();
> > > +	if (!acer_wmi_accel_dev)
> > > +		return -ENOMEM;
> > > +
> > > +	acer_wmi_accel_dev->open = acer_gsensor_open;
> > > +
> > > +	acer_wmi_accel_dev->name = "Acer BMA150 accelerometer";
> > > +	acer_wmi_accel_dev->phys = "wmi/input1";
> > > +	acer_wmi_accel_dev->id.bustype = BUS_HOST;
> > > +	acer_wmi_accel_dev->evbit[0] = BIT_MASK(EV_ABS);
> > > +	input_set_abs_params(acer_wmi_accel_dev, ABS_X, -16384, 16384, 0, 0);
> > > +	input_set_abs_params(acer_wmi_accel_dev, ABS_Y, -16384, 16384, 0, 0);
> > > +	input_set_abs_params(acer_wmi_accel_dev, ABS_Z, -16384, 16384, 0, 0);
> > > +
> > > +	err = input_register_device(acer_wmi_accel_dev);
> > > +	if (err)
> > > +		goto err_free_dev;
> > > +
> > > +	return 0;
> > > +
> > > +err_free_dev:
> > > +	input_free_device(acer_wmi_accel_dev);
> > > +	return err;
> > > +}
> > > +
> > > +static void acer_wmi_accel_destroy(void)
> > > +{
> > > +	input_unregister_device(acer_wmi_accel_dev);
> > > +	input_free_device(acer_wmi_accel_dev);
> > > +}
> > > +
> > > 
> > >  static int __init acer_wmi_input_setup(void)
> > >  {
> > >  
> > >  	acpi_status status;
> > > 
> > > @@ -1889,6 +2017,9 @@ static int acer_platform_resume(struct
> > > platform_device *device)
> > > 
> > >  	if (has_cap(ACER_CAP_BRIGHTNESS))
> > >  	
> > >  		set_u32(data->brightness, ACER_CAP_BRIGHTNESS);
> > > 
> > > +	if (has_cap(ACER_CAP_ACCEL))
> > > +		acer_gsensor_init();
> > > +
> > > 
> > >  	return 0;
> > >  
> > >  }
> > > 
> > > @@ -2066,6 +2197,8 @@ static int __init acer_wmi_init(void)
> > > 
> > >  			return err;
> > >  	
> > >  	}
> > > 
> > > +	acer_wmi_accel_setup();
> > > +
> > > 
> > >  	err = platform_driver_register(&acer_platform_driver);
> > >  	if (err) {
> > >  	
> > >  		pr_err("Unable to register platform driver\n");
> > > 
> > > @@ -2109,6 +2242,8 @@ error_device_alloc:
> > >  error_platform_register:
> > >  	if (wmi_has_guid(ACERWMID_EVENT_GUID))
> > >  	
> > >  		acer_wmi_input_destroy();
> > > 
> > > +	if (has_cap(ACER_CAP_ACCEL))
> > > +		acer_wmi_accel_destroy();
> > > 
> > >  	return err;
> > >  
> > >  }
> > > 
> > > @@ -2118,6 +2253,9 @@ static void __exit acer_wmi_exit(void)
> > > 
> > >  	if (wmi_has_guid(ACERWMID_EVENT_GUID))
> > >  	
> > >  		acer_wmi_input_destroy();
> > > 
> > > +	if (has_cap(ACER_CAP_ACCEL))
> > > +		acer_wmi_accel_destroy();
> > > +
> > > 
> > >  	remove_sysfs(acer_platform_device);
> > >  	remove_debugfs();
> > >  	platform_device_unregister(acer_platform_device);
> 

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-05 22:55         ` Marek Vasut
@ 2012-06-06  1:22           ` Zhang Rui
  2012-06-22 20:20             ` Marek Vasut
  0 siblings, 1 reply; 17+ messages in thread
From: Zhang Rui @ 2012-06-06  1:22 UTC (permalink / raw)
  To: Marek Vasut; +Cc: Corentin Chary, platform-driver-x86, joeyli, Len Brown, pavel

On 三, 2012-06-06 at 00:55 +0200, Marek Vasut wrote:
> Dear Corentin Chary,
> 
> [...]
> 
> > >> This is a generic device, and should be handled by ACPI core
> > >> (Samsung laptop have this too). See "ACPI ALS" on linux-acpi.
> > > 
> > > Saying this would be enough. Lee explained to me what this ACPI0008
> > > means, I'm quite new to the ACPI land so pardon my ignorance here. But
> > > it then boils down to Lee's question, why wasn't the patch for ACPI ALS
> > > that was already proposed accepted? And what can be done to get it in?
> > 
> > Yep, I've seen Lee's message latter. Regarding ACPI ALS status, it was
> > forgotten for a long time, and recently Zhang Rui told that he will
> > take another look at it, but nothing sure. If you want to know more
> > about the status, you can do a quick search on gmane using "ACPI ALS"
> > query on linux.acpi
> 
> Actually, going through the ACPI0008 patch, I see it introduced new sysfs class. 
> Maybe we should rather integrate it with Linux-IIO these days?
> 
yes.
please refer to this thread
http://marc.info/?l=linux-acpi&m=132060809120911&w=2

I do not have time to do this right now, and it will be great if you are
interested in introducing the ACPI ALS driver.

thanks,
rui

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

* Re: [PATCH 1/2] ACER: Add support for accelerometer sensor
  2012-06-06  0:15     ` joeyli
@ 2012-06-06 10:13       ` Marek Vasut
  0 siblings, 0 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-06 10:13 UTC (permalink / raw)
  To: joeyli; +Cc: platform-driver-x86

Dear joeyli,

> Hi Marek,
> 
> 於 三,2012-06-06 於 00:52 +0200,Marek Vasut 提到:
> 
> > Dear joeyli,
> > 
> > > 於 五,2012-06-01 於 19:11 +0200,Marek Vasut 提到:
> > > 
> > > > This device is present on Iconia Tab W500.
> > > > 
> > > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > > Cc: joeyli <jlee@suse.com>
> > > 
> > > This patch is good to me!
> > 
> > Thanks for your help and guidance throughout the process. Now who'll
> > apply it and when can I expect it in -next or somewhere (where?)?
> > 
> > > Acked-by: Lee, Chun-Yi <jlee@suse.com>
> 
> Wait Matthew apply patch to platform driver git.
> 
> He already sent merge request to Linus and merged to v3.5-rc1 kernel.
> I think need wait v3.6.
> 

Great! Thanks for clearing this!

> 
> Thanks
> Joey Lee

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

* Re: [PATCH 2/2] ACER: Add support for ambient light sensor
  2012-06-06  1:22           ` Zhang Rui
@ 2012-06-22 20:20             ` Marek Vasut
  0 siblings, 0 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-22 20:20 UTC (permalink / raw)
  To: Zhang Rui
  Cc: Corentin Chary, platform-driver-x86, joeyli, Len Brown, pavel,
	Martin Liška

Dear Zhang Rui,

> On 三, 2012-06-06 at 00:55 +0200, Marek Vasut wrote:
> > Dear Corentin Chary,
> > 
> > [...]
> > 
> > > >> This is a generic device, and should be handled by ACPI core
> > > >> (Samsung laptop have this too). See "ACPI ALS" on linux-acpi.
> > > > 
> > > > Saying this would be enough. Lee explained to me what this ACPI0008
> > > > means, I'm quite new to the ACPI land so pardon my ignorance here.
> > > > But it then boils down to Lee's question, why wasn't the patch for
> > > > ACPI ALS that was already proposed accepted? And what can be done to
> > > > get it in?
> > > 
> > > Yep, I've seen Lee's message latter. Regarding ACPI ALS status, it was
> > > forgotten for a long time, and recently Zhang Rui told that he will
> > > take another look at it, but nothing sure. If you want to know more
> > > about the status, you can do a quick search on gmane using "ACPI ALS"
> > > query on linux.acpi
> > 
> > Actually, going through the ACPI0008 patch, I see it introduced new sysfs
> > class. Maybe we should rather integrate it with Linux-IIO these days?
> 
> yes.
> please refer to this thread
> http://marc.info/?l=linux-acpi&m=132060809120911&w=2
> 
> I do not have time to do this right now, and it will be great if you are
> interested in introducing the ACPI ALS driver.

So, I finally raised from dead again ... sorry I didn't reply earlier. 
Apparently, one of my students is interested in fixing/writing such driver, 
therefore I'll land him my hardware and let him do it.

I CCed him, please treat him well.

Best regards,
Marek Vasut

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

* Re: [PATCH 1/2] ACER: Add support for accelerometer sensor
  2012-06-01 17:11 [PATCH 1/2] ACER: Add support for accelerometer sensor Marek Vasut
  2012-06-01 17:11 ` [PATCH 2/2] ACER: Add support for ambient light sensor Marek Vasut
  2012-06-04  8:23 ` [PATCH 1/2] ACER: Add support for accelerometer sensor joeyli
@ 2012-06-26 18:41 ` Matthew Garrett
  2012-06-26 18:52   ` Marek Vasut
  2 siblings, 1 reply; 17+ messages in thread
From: Matthew Garrett @ 2012-06-26 18:41 UTC (permalink / raw)
  To: Marek Vasut; +Cc: platform-driver-x86, joeyli

I've applied patch 1 to -next, it'll be in 3.6. Thanks!

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

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

* Re: [PATCH 1/2] ACER: Add support for accelerometer sensor
  2012-06-26 18:41 ` Matthew Garrett
@ 2012-06-26 18:52   ` Marek Vasut
  0 siblings, 0 replies; 17+ messages in thread
From: Marek Vasut @ 2012-06-26 18:52 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: platform-driver-x86, joeyli

Dear Matthew Garrett,

> I've applied patch 1 to -next, it'll be in 3.6. Thanks!

Thank you :-)

Best regards,
Marek Vasut

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

end of thread, other threads:[~2012-06-26 18:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 17:11 [PATCH 1/2] ACER: Add support for accelerometer sensor Marek Vasut
2012-06-01 17:11 ` [PATCH 2/2] ACER: Add support for ambient light sensor Marek Vasut
2012-06-04  9:08   ` joeyli
2012-06-04  9:29     ` Marek Vasut
2012-06-04 11:13   ` Corentin Chary
2012-06-04 17:14     ` Marek Vasut
2012-06-05 12:49       ` Corentin Chary
2012-06-05 13:06         ` Marek Vasut
2012-06-05 22:55         ` Marek Vasut
2012-06-06  1:22           ` Zhang Rui
2012-06-22 20:20             ` Marek Vasut
2012-06-04  8:23 ` [PATCH 1/2] ACER: Add support for accelerometer sensor joeyli
2012-06-05 22:52   ` Marek Vasut
2012-06-06  0:15     ` joeyli
2012-06-06 10:13       ` Marek Vasut
2012-06-26 18:41 ` Matthew Garrett
2012-06-26 18:52   ` Marek Vasut

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.