[meego-commits] 15402: Changes to Trunk/kernel

Peter Zhu no_reply at build.meego.com
Tue Mar 29 03:21:20 UTC 2011


Hi,
I have made the following changes to kernel in project Trunk. Please review and accept ASAP.

Thank You,
Peter Zhu

[This message was auto-generated]

---

Request #15402:

  submit:   Trunk:Testing/kernel(r2) -> Trunk/kernel


Message:
    Move to Trunk

State:   new          2011-03-28T20:21:14 peter
Comment: None



changes files:
--------------
--- kernel.changes
+++ kernel.changes
@@ -0,0 +1,3 @@
+* Mon Mar 28 2011 - Arjan van de Ven <arjan at linux.intel.com> - 2.6.37.2
+- updated the pegatron/exopc patches
+

new:
----
  linux-2.6.37-pegatron-accelerometer.patch
  linux-2.6.37-pegatron-als-bootcommand.patch
  linux-2.6.37-pegatron-als-sensor.patch
  linux-2.6.37-pegatron-detection.patch
  linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch
  patch-2.6.37.6.bz2

spec files:
-----------
--- kernel.spec
+++ kernel.spec
@@ -185,8 +185,14 @@
 #####################################################################
 
 
+# fix gem crash
+Patch102: linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch
+
 # small patch to enable the ExoPC brightness sensor control
-Patch102: linux-2.6.37-exopc-als.patch
+Patch103: linux-2.6.37-pegatron-detection.patch
+Patch104: linux-2.6.37-pegatron-als-sensor.patch
+Patch105: linux-2.6.37-pegatron-accelerometer.patch
+Patch106: linux-2.6.37-pegatron-als-bootcommand.patch
 
 
 
@@ -221,6 +227,7 @@
 Patch202: linux-2.6.35-fatal-signals.patch
 
 
+
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
 
 
@@ -356,10 +363,20 @@
 #####################################################################
 
 
-# small patch to enable the ExoPC brightness sensor control
-# linux-2.6.37-exopc-als.patch
+# fix gem crash
+# linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch
 %patch102 -p1
 
+# small patch to enable the ExoPC brightness sensor control
+# linux-2.6.37-pegatron-detection.patch
+%patch103 -p1
+# linux-2.6.37-pegatron-als-sensor.patch
+%patch104 -p1
+# linux-2.6.37-pegatron-accelerometer.patch
+%patch105 -p1
+# linux-2.6.37-pegatron-als-bootcommand.patch
+%patch106 -p1
+
 
 
 
@@ -395,6 +412,7 @@
 # linux-2.6.35-fatal-signals.patch
 %patch202 -p1
 
+
 # Drop some necessary files from the source dir into the buildroot
 cp $RPM_SOURCE_DIR/config-* .
 cp %{SOURCE15} .

other changes:
--------------

++++++ linux-2.6.37-pegatron-accelerometer.patch (new)
--- linux-2.6.37-pegatron-accelerometer.patch
+++ linux-2.6.37-pegatron-accelerometer.patch
+Return-Path: <andy.ross at windriver.com>
+X-Original-To: arjan at linux.intel.com
+Delivered-To: arjan at linux.intel.com
+Received: from orsmga001.jf.intel.com (orsmga001.jf.intel.com [10.7.209.18])
+	by linux.intel.com (Postfix) with ESMTP id 440A56A4482
+	for <arjan at linux.intel.com>; Thu, 24 Mar 2011 15:16:22 -0700 (PDT)
+X-ExtLoop1: 1
+X-IronPort-AV: E=Sophos;i="4.63,239,1299484800"; 
+   d="scan'208";a="724825425"
+Received: from aross1x-wrs.jf.intel.com (HELO plausible.org) ([10.7.202.151])
+  by orsmga001.jf.intel.com with ESMTP; 24 Mar 2011 15:16:22 -0700
+Received: from localhost.localdomain (unknown [192.102.209.1])
+	(Authenticated sender: andy-wrs)
+	by plausible.org (Postfix) with ESMTPSA id 04F9B1194DC;
+	Thu, 24 Mar 2011 15:16:21 -0700 (PDT)
+From: Andy Ross <andy.ross at windriver.com>
+To: Arjan van de Ven <arjan at linux.intel.com>,
+	Prajwal Karur Mohan <prajwal.karur.mohan at intel.com>
+Subject: [PATCH 3/4] asus-laptop: Pegatron Lucid accelerometer
+Date: Thu, 24 Mar 2011 15:16:14 -0700
+Message-Id: <1301004975-3656-4-git-send-email-andy.ross at windriver.com>
+X-Mailer: git-send-email 1.7.1
+In-Reply-To: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+References: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+
+Support the built-in accelerometer on the Lucid tablets as a standard
+3-axis input device.
+
+Signed-off-by: Andy Ross <andy.ross at windriver.com>
+---
+ drivers/platform/x86/Kconfig       |    9 ++-
+ drivers/platform/x86/asus-laptop.c |  137 +++++++++++++++++++++++++++++++++++-
+ 2 files changed, 141 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
+index b6f983e..43906f5 100644
+--- a/drivers/platform/x86/Kconfig
++++ b/drivers/platform/x86/Kconfig
+@@ -67,10 +67,11 @@ config ASUS_LAPTOP
+ 	  This is a driver for Asus laptops and the Pegatron Lucid
+ 	  tablet. It may also support some MEDION, JVC or VICTOR
+ 	  laptops. It makes all the extra buttons generate standard
+-	  ACPI events and input events. It also adds support for video
+-	  output switching, LCD backlight control, Bluetooth and Wlan
+-	  control, and most importantly, allows you to blink those
+-	  fancy LEDs.
++	  ACPI events and input events, and on the Lucid the built-in
++	  accelerometer appears as an input device.  It also adds
++	  support for video output switching, LCD backlight control,
++	  Bluetooth and Wlan control, and most importantly, allows you
++	  to blink those fancy LEDs.
+ 
+ 	  For more information and a userspace daemon for handling the extra
+ 	  buttons see <http://acpi4asus.sf.net>.
+diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
+index 6651d8c..9b07368 100644
+--- a/drivers/platform/x86/asus-laptop.c
++++ b/drivers/platform/x86/asus-laptop.c
+@@ -224,6 +224,14 @@ static char *display_get_paths[] = {
+ #define PEGA_READ_ALS_H	0x02
+ #define PEGA_READ_ALS_L	0x03
+ 
++#define PEGA_ACCEL_NAME "pega_accel"
++#define PEGA_ACCEL_DESC "Pegatron Lucid Tablet Accelerometer"
++#define METHOD_XLRX "XLRX"
++#define METHOD_XLRY "XLRY"
++#define METHOD_XLRZ "XLRZ"
++#define PEGA_ACC_CLAMP 512 /* 1G accel is reported as ~256, so clamp to 2G */
++#define PEGA_ACC_RETRIES 3
++
+ /*
+  * Define a specific led structure to keep the main structure clean
+  */
+@@ -249,6 +257,7 @@ struct asus_laptop {
+ 
+ 	struct input_dev *inputdev;
+ 	struct key_entry *keymap;
++	struct input_polled_dev *pega_accel_poll;
+ 
+ 	struct asus_led mled;
+ 	struct asus_led tled;
+@@ -262,6 +271,10 @@ struct asus_laptop {
+ 	bool have_rsts;
+ 	bool have_pega_lucid;
+ 	int lcd_state;
++	bool pega_acc_live;
++	int pega_acc_x;
++	int pega_acc_y;
++	int pega_acc_z;
+ 
+ 	struct rfkill *gps_rfkill;
+ 
+@@ -390,6 +403,99 @@ static int asus_pega_lucid_set(struct asus_laptop *asus, int unit, bool enable)
+ 	return write_acpi_int(asus->handle, method, unit);
+ }
+ 
++static int pega_acc_axis(struct asus_laptop *asus, int curr, char *method)
++{
++	int i, delta;
++	unsigned long long val;
++	for (i = 0; i < PEGA_ACC_RETRIES; i++) {
++		acpi_evaluate_integer(asus->handle, method, NULL, &val);
++
++		/* The output is noisy.  From reading the ASL
++		 * dissassembly, timeout errors are returned with 1's
++		 * in the high word, and the lack of locking around
++		 * thei hi/lo byte reads means that a transition
++		 * between (for example) -1 and 0 could be read as
++		 * 0xff00 or 0x00ff. */
++		delta = abs(curr - (short)val);
++		if (delta < 128 && !(val & ~0xffff))
++			break;
++	}
++	return clamp_val((short)val, -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP);
++}
++
++static void pega_accel_poll(struct input_polled_dev *ipd)
++{
++	struct device *parent = ipd->input->dev.parent;
++	struct asus_laptop *asus = dev_get_drvdata(parent);
++
++	/* In some cases, the very first call to poll causes a
++	 * recursive fault under the polldev worker.  This is
++	 * apparently related to very early userspace access to the
++	 * device, and perhaps a firmware bug.  See related comments
++	 * in asus_platform_probe regarding the fragility of these
++	 * methods early in the boot.  Fake the first report. */
++	if (!asus->pega_acc_live) {
++		asus->pega_acc_live = true;
++		input_report_abs(ipd->input, ABS_X, 0);
++		input_report_abs(ipd->input, ABS_Y, 0);
++		input_report_abs(ipd->input, ABS_Z, 0);
++		input_sync(ipd->input);
++		return;
++	}
++
++	asus->pega_acc_x = pega_acc_axis(asus, asus->pega_acc_x, METHOD_XLRX);
++	asus->pega_acc_y = pega_acc_axis(asus, asus->pega_acc_y, METHOD_XLRY);
++	asus->pega_acc_z = pega_acc_axis(asus, asus->pega_acc_z, METHOD_XLRZ);
++
++	/* Note transform, convert to "right/up/out" in the native
++	 * landscape orientation (i.e. the vector is the direction of
++	 * "real up" in the device's cartiesian coordinates). */
++	input_report_abs(ipd->input, ABS_X, -asus->pega_acc_x);
++	input_report_abs(ipd->input, ABS_Y, -asus->pega_acc_y);
++	input_report_abs(ipd->input, ABS_Z,  asus->pega_acc_z);
++	input_sync(ipd->input);
++}
++
++static void pega_accel_probe(struct asus_laptop *asus)
++{
++	int err;
++	struct input_polled_dev *ipd;
++
++	if (!asus->have_pega_lucid ||
++	    acpi_check_handle(asus->handle, METHOD_XLRX, NULL) ||
++	    acpi_check_handle(asus->handle, METHOD_XLRY, NULL) ||
++	    acpi_check_handle(asus->handle, METHOD_XLRZ, NULL))
++		return;
++
++	ipd = input_allocate_polled_device();
++	if (!ipd)
++		return;
++
++	ipd->poll = pega_accel_poll;
++	ipd->poll_interval = 125;
++	ipd->poll_interval_min = 50;
++	ipd->poll_interval_max = 2000;
++
++	ipd->input->name = PEGA_ACCEL_DESC;
++	ipd->input->phys = PEGA_ACCEL_NAME "/input0";
++	ipd->input->dev.parent = &asus->platform_device->dev;
++	ipd->input->id.bustype = BUS_HOST;
++
++	set_bit(EV_ABS, ipd->input->evbit);
++	input_set_abs_params(ipd->input, ABS_X,
++			     -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP, 0, 0);
++	input_set_abs_params(ipd->input, ABS_Y,
++			     -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP, 0, 0);
++	input_set_abs_params(ipd->input, ABS_Z,
++			     -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP, 0, 0);
++
++	err = input_register_polled_device(ipd);
++	if (err)
++		input_free_polled_device(ipd);
++	else
++		asus->pega_accel_poll = ipd;
++}
++
+ /* Generic LED function */
+ static int asus_led_set(struct asus_laptop *asus, const char *method,
+ 			 int value)
+@@ -1459,11 +1565,40 @@ static void asus_platform_exit(struct asus_laptop *asus)
+ 	platform_device_unregister(asus->platform_device);
+ }
+ 
++static int asus_platform_probe(struct platform_device *pd)
++{
(39 more lines skipped)

++++++ linux-2.6.37-pegatron-als-bootcommand.patch (new)
--- linux-2.6.37-pegatron-als-bootcommand.patch
+++ linux-2.6.37-pegatron-als-bootcommand.patch
+Return-Path: <andy.ross at windriver.com>
+X-Original-To: arjan at linux.intel.com
+Delivered-To: arjan at linux.intel.com
+Received: from orsmga002.jf.intel.com (orsmga002.jf.intel.com [10.7.209.21])
+	by linux.intel.com (Postfix) with ESMTP id 900446A4482
+	for <arjan at linux.intel.com>; Thu, 24 Mar 2011 15:16:22 -0700 (PDT)
+X-ExtLoop1: 1
+X-IronPort-AV: E=Sophos;i="4.63,239,1299484800"; 
+   d="scan'208";a="618466226"
+Received: from aross1x-wrs.jf.intel.com (HELO plausible.org) ([10.7.202.151])
+  by orsmga002.jf.intel.com with ESMTP; 24 Mar 2011 15:16:23 -0700
+Received: from localhost.localdomain (unknown [192.102.209.1])
+	(Authenticated sender: andy-wrs)
+	by plausible.org (Postfix) with ESMTPSA id 76FCD1194DE;
+	Thu, 24 Mar 2011 15:16:22 -0700 (PDT)
+From: Andy Ross <andy.ross at windriver.com>
+To: Arjan van de Ven <arjan at linux.intel.com>,
+	Prajwal Karur Mohan <prajwal.karur.mohan at intel.com>
+Subject: [PATCH 4/4] asus-laptop: allow boot time control of Pegatron ALS sensor
+Date: Thu, 24 Mar 2011 15:16:15 -0700
+Message-Id: <1301004975-3656-5-git-send-email-andy.ross at windriver.com>
+X-Mailer: git-send-email 1.7.1
+In-Reply-To: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+References: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+
+Signed-off-by: Andy Ross <andy.ross at windriver.com>
+---
+ drivers/platform/x86/asus-laptop.c |    8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
+index 9b07368..1d32457 100644
+--- a/drivers/platform/x86/asus-laptop.c
++++ b/drivers/platform/x86/asus-laptop.c
+@@ -85,6 +85,7 @@ static int wlan_status = 1;
+ static int bluetooth_status = 1;
+ static int wimax_status = -1;
+ static int wwan_status = -1;
++static int als_status = -1;
+ 
+ module_param(wlan_status, int, 0444);
+ MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot "
+@@ -106,6 +107,11 @@ MODULE_PARM_DESC(wwan_status, "Set the wireless status on boot "
+ 		 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
+ 		 "default is 1");
+ 
++module_param(als_status, int, 0444);
++MODULE_PARM_DESC(als_status, "Set the ALS status on boot "
++		 "(0 = disabled, 1 = enabled, -1 = don't do anything). "
++		 "default is 0");
++
+ /*
+  * Some events we use, same for all Asus
+  */
+@@ -1752,7 +1758,7 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
+ 	asus->ledd_status = 0xFFF;
+ 
+ 	/* Set initial values of light sensor and level */
+-	asus->light_switch = 0;	/* Default to light sensor disabled */
++	asus->light_switch = als_status >= 0 ? !!als_status : 0;
+ 	asus->light_level = 5;	/* level 5 for sensor sensitivity */
+ 
+ 	if (asus->have_pega_lucid) {
+-- 
+1.7.1
+

++++++ linux-2.6.37-pegatron-als-sensor.patch (new)
--- linux-2.6.37-pegatron-als-sensor.patch
+++ linux-2.6.37-pegatron-als-sensor.patch
+Return-Path: <andy.ross at windriver.com>
+X-Original-To: arjan at linux.intel.com
+Delivered-To: arjan at linux.intel.com
+Received: from orsmga002.jf.intel.com (orsmga002.jf.intel.com [10.7.209.21])
+	by linux.intel.com (Postfix) with ESMTP id BA22B6A4482
+	for <arjan at linux.intel.com>; Thu, 24 Mar 2011 15:16:21 -0700 (PDT)
+X-ExtLoop1: 1
+X-IronPort-AV: E=Sophos;i="4.63,239,1299484800"; 
+   d="scan'208";a="618466221"
+Received: from aross1x-wrs.jf.intel.com (HELO plausible.org) ([10.7.202.151])
+  by orsmga002.jf.intel.com with ESMTP; 24 Mar 2011 15:16:22 -0700
+Received: from localhost.localdomain (unknown [192.102.209.1])
+	(Authenticated sender: andy-wrs)
+	by plausible.org (Postfix) with ESMTPSA id 7DF301194DF;
+	Thu, 24 Mar 2011 15:16:21 -0700 (PDT)
+From: Andy Ross <andy.ross at windriver.com>
+To: Arjan van de Ven <arjan at linux.intel.com>,
+	Prajwal Karur Mohan <prajwal.karur.mohan at intel.com>
+Subject: [PATCH 2/4] asus-laptop: Pegatron Lucid ALS sensor
+Date: Thu, 24 Mar 2011 15:16:13 -0700
+Message-Id: <1301004975-3656-3-git-send-email-andy.ross at windriver.com>
+X-Mailer: git-send-email 1.7.1
+In-Reply-To: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+References: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+
+Ambient light sensor for Pegatron Lucid.  Supports pre-existing
+ls_switch sysfs interface to en/disable automatic control, and exports
+the brightness from the device as "ls_value".
+
+Signed-off-by: Andy Ross <andy.ross at windriver.com>
+---
+ drivers/platform/x86/asus-laptop.c |   70 +++++++++++++++++++++++++++++++++---
+ 1 files changed, 65 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
+index ec46d71..6651d8c 100644
+--- a/drivers/platform/x86/asus-laptop.c
++++ b/drivers/platform/x86/asus-laptop.c
+@@ -214,9 +214,15 @@ static char *display_get_paths[] = {
+ 
+ /* For Pegatron Lucid tablet */
+ #define DEVICE_NAME_PEGA	"Lucid"
++
+ #define METHOD_PEGA_ENABLE	"ENPR"
+ #define METHOD_PEGA_DISABLE	"DAPR"
++#define PEGA_ALS	0x04
++#define PEGA_ALS_POWER	0x05
++
+ #define METHOD_PEGA_READ	"RDLN"
++#define PEGA_READ_ALS_H	0x02
++#define PEGA_READ_ALS_L	0x03
+ 
+ /*
+  * Define a specific led structure to keep the main structure clean
+@@ -378,6 +384,12 @@ static bool asus_check_pega_lucid(struct asus_laptop *asus)
+ 	   !acpi_check_handle(asus->handle, METHOD_PEGA_READ, NULL);
+ }
+ 
++static int asus_pega_lucid_set(struct asus_laptop *asus, int unit, bool enable)
++{
++	char *method = enable ? METHOD_PEGA_ENABLE : METHOD_PEGA_DISABLE;
++	return write_acpi_int(asus->handle, method, unit);
++}
++
+ /* Generic LED function */
+ static int asus_led_set(struct asus_laptop *asus, const char *method,
+ 			 int value)
+@@ -1046,7 +1058,15 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
+  */
+ static void asus_als_switch(struct asus_laptop *asus, int value)
+ {
+-	if (write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value))
++	int ret;
++	if (asus->have_pega_lucid) {
++		ret = asus_pega_lucid_set(asus, PEGA_ALS, value);
++		if (!ret)
++			ret = asus_pega_lucid_set(asus, PEGA_ALS_POWER, value);
++	} else {
++		ret = write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value);
++	}
++	if (ret)
+ 		pr_warning("Error setting light sensor switch\n");
+ 	asus->light_switch = value;
+ }
+@@ -1103,6 +1123,35 @@ static ssize_t store_lslvl(struct device *dev, struct device_attribute *attr,
+ 	return rv;
+ }
+ 
++static int pega_int_read(struct asus_laptop *asus, int arg, int *result)
++{
++	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
++	int err = write_acpi_int_ret(asus->handle, METHOD_PEGA_READ, arg,
++				     &buffer);
++	if (!err) {
++		union acpi_object *obj = buffer.pointer;
++		if (obj && obj->type == ACPI_TYPE_INTEGER)
++			*result = obj->integer.value;
++		else
++			err = -EIO;
++	}
++	return err;
++}
++
++static ssize_t show_lsvalue(struct device *dev,
++			    struct device_attribute *attr, char *buf)
++{
++	struct asus_laptop *asus = dev_get_drvdata(dev);
++	int err, hi, lo;
++
++	err = pega_int_read(asus, PEGA_READ_ALS_H, &hi);
++	if (!err)
++		err = pega_int_read(asus, PEGA_READ_ALS_L, &lo);
++	if (!err)
++		return sprintf(buf, "%d\n", 10 * hi + lo);
++	return err;
++}
++
+ /*
+  * GPS
+  */
+@@ -1300,6 +1349,7 @@ static DEVICE_ATTR(wimax, S_IRUGO | S_IWUSR, show_wimax, store_wimax);
+ static DEVICE_ATTR(wwan, S_IRUGO | S_IWUSR, show_wwan, store_wwan);
+ static DEVICE_ATTR(display, S_IRUGO | S_IWUSR, show_disp, store_disp);
+ static DEVICE_ATTR(ledd, S_IRUGO | S_IWUSR, show_ledd, store_ledd);
++static DEVICE_ATTR(ls_value, S_IRUGO, show_lsvalue, NULL);
+ static DEVICE_ATTR(ls_level, S_IRUGO | S_IWUSR, show_lslvl, store_lslvl);
+ static DEVICE_ATTR(ls_switch, S_IRUGO | S_IWUSR, show_lssw, store_lssw);
+ static DEVICE_ATTR(gps, S_IRUGO | S_IWUSR, show_gps, store_gps);
+@@ -1312,6 +1362,7 @@ static struct attribute *asus_attributes[] = {
+ 	&dev_attr_wwan.attr,
+ 	&dev_attr_display.attr,
+ 	&dev_attr_ledd.attr,
++	&dev_attr_ls_value.attr,
+ 	&dev_attr_ls_level.attr,
+ 	&dev_attr_ls_switch.attr,
+ 	&dev_attr_gps.attr,
+@@ -1349,8 +1400,15 @@ static mode_t asus_sysfs_is_visible(struct kobject *kobj,
+ 
+ 	} else if (attr == &dev_attr_ls_switch.attr ||
+ 		   attr == &dev_attr_ls_level.attr) {
+-		supported = !acpi_check_handle(handle, METHOD_ALS_CONTROL, NULL) &&
+-			    !acpi_check_handle(handle, METHOD_ALS_LEVEL, NULL);
++		if (asus->have_pega_lucid) {
++			/* no ls_level interface on the Lucid */
++			supported = attr == &dev_attr_ls_switch.attr;
++		} else {
++			supported = !acpi_check_handle(handle, METHOD_ALS_CONTROL, NULL) &&
++				    !acpi_check_handle(handle, METHOD_ALS_LEVEL, NULL);
++		}
++	} else if (attr == &dev_attr_ls_value.attr) {
++		supported = asus->have_pega_lucid;
+ 	} else if (attr == &dev_attr_gps.attr) {
+ 		supported = !acpi_check_handle(handle, METHOD_GPS_ON, NULL) &&
+ 			    !acpi_check_handle(handle, METHOD_GPS_OFF, NULL) &&
+@@ -1562,8 +1620,10 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus)
+ 	asus->light_switch = 0;	/* Default to light sensor disabled */
+ 	asus->light_level = 5;	/* level 5 for sensor sensitivity */
+ 
+-	if (!acpi_check_handle(asus->handle, METHOD_ALS_CONTROL, NULL) &&
+-	    !acpi_check_handle(asus->handle, METHOD_ALS_LEVEL, NULL)) {
++	if (asus->have_pega_lucid) {
++		asus_als_switch(asus, asus->light_switch);
++	} else if (!acpi_check_handle(asus->handle, METHOD_ALS_CONTROL, NULL) &&
++		   !acpi_check_handle(asus->handle, METHOD_ALS_LEVEL, NULL)) {
+ 		asus_als_switch(asus, asus->light_switch);
+ 		asus_als_level(asus, asus->light_level);
+ 	}
+-- 
+1.7.1
+

++++++ linux-2.6.37-pegatron-detection.patch (new)
--- linux-2.6.37-pegatron-detection.patch
+++ linux-2.6.37-pegatron-detection.patch
+Return-Path: <andy.ross at windriver.com>
+X-Original-To: arjan at linux.intel.com
+Delivered-To: arjan at linux.intel.com
+Received: from orsmga002.jf.intel.com (orsmga002.jf.intel.com [10.7.209.21])
+	by linux.intel.com (Postfix) with ESMTP id 2CE2F6A4482
+	for <arjan at linux.intel.com>; Thu, 24 Mar 2011 15:16:21 -0700 (PDT)
+X-ExtLoop1: 1
+X-IronPort-AV: E=Sophos;i="4.63,239,1299484800"; 
+   d="scan'208";a="618466217"
+Received: from aross1x-wrs.jf.intel.com (HELO plausible.org) ([10.7.202.151])
+  by orsmga002.jf.intel.com with ESMTP; 24 Mar 2011 15:16:21 -0700
+Received: from localhost.localdomain (unknown [192.102.209.1])
+	(Authenticated sender: andy-wrs)
+	by plausible.org (Postfix) with ESMTPSA id 0CED21194DE;
+	Thu, 24 Mar 2011 15:16:20 -0700 (PDT)
+From: Andy Ross <andy.ross at windriver.com>
+To: Arjan van de Ven <arjan at linux.intel.com>,
+	Prajwal Karur Mohan <prajwal.karur.mohan at intel.com>
+Subject: [PATCH 1/4] asus-laptop: Platform detection for Pegatron Lucid
+Date: Thu, 24 Mar 2011 15:16:12 -0700
+Message-Id: <1301004975-3656-2-git-send-email-andy.ross at windriver.com>
+X-Mailer: git-send-email 1.7.1
+In-Reply-To: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+References: <1301004975-3656-1-git-send-email-andy.ross at windriver.com>
+
+Recognize the Pegatron Lucid tablets by their method signatures.
+
+Signed-off-by: Andy Ross <andy.ross at windriver.com>
+---
+ drivers/platform/x86/Kconfig       |   13 ++++++++-----
+ drivers/platform/x86/asus-laptop.c |   23 ++++++++++++++++++++---
+ 2 files changed, 28 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
+index faec777..b6f983e 100644
+--- a/drivers/platform/x86/Kconfig
++++ b/drivers/platform/x86/Kconfig
+@@ -62,12 +62,15 @@ config ASUS_LAPTOP
+ 	depends on INPUT
+ 	depends on RFKILL || RFKILL = n
+ 	select INPUT_SPARSEKMAP
++	select INPUT_POLLDEV
+ 	---help---
+-	  This is the new Linux driver for Asus laptops. It may also support some
+-	  MEDION, JVC or VICTOR laptops. It makes all the extra buttons generate
+-	  standard ACPI events and input events. It also adds
+-	  support for video output switching, LCD backlight control, Bluetooth and
+-	  Wlan control, and most importantly, allows you to blink those fancy LEDs.
++	  This is a driver for Asus laptops and the Pegatron Lucid
++	  tablet. It may also support some MEDION, JVC or VICTOR
++	  laptops. It makes all the extra buttons generate standard
++	  ACPI events and input events. It also adds support for video
++	  output switching, LCD backlight control, Bluetooth and Wlan
++	  control, and most importantly, allows you to blink those
++	  fancy LEDs.
+ 
+ 	  For more information and a userspace daemon for handling the extra
+ 	  buttons see <http://acpi4asus.sf.net>.
+diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
+index d235f44..ec46d71 100644
+--- a/drivers/platform/x86/asus-laptop.c
++++ b/drivers/platform/x86/asus-laptop.c
+@@ -4,6 +4,7 @@
+  *
+  *  Copyright (C) 2002-2005 Julien Lerouge, 2003-2006 Karol Kozimor
+  *  Copyright (C) 2006-2007 Corentin Chary
++ *  Copyright (C) 2011 Wind River Systems
+  *
+  *  This program is free software; you can redistribute it and/or modify
+  *  it under the terms of the GNU General Public License as published by
+@@ -48,6 +49,7 @@
+ #include <linux/uaccess.h>
+ #include <linux/input.h>
+ #include <linux/input/sparse-keymap.h>
++#include <linux/input-polldev.h>
+ #include <linux/rfkill.h>
+ #include <linux/slab.h>
+ #include <acpi/acpi_drivers.h>
+@@ -210,6 +212,12 @@ static char *display_get_paths[] = {
+ #define METHOD_KBD_LIGHT_SET	"SLKB"
+ #define METHOD_KBD_LIGHT_GET	"GLKB"
+ 
++/* For Pegatron Lucid tablet */
++#define DEVICE_NAME_PEGA	"Lucid"
++#define METHOD_PEGA_ENABLE	"ENPR"
++#define METHOD_PEGA_DISABLE	"DAPR"
++#define METHOD_PEGA_READ	"RDLN"
++
+ /*
+  * Define a specific led structure to keep the main structure clean
+  */
+@@ -246,6 +254,7 @@ struct asus_laptop {
+ 
+ 	int wireless_status;
+ 	bool have_rsts;
++	bool have_pega_lucid;
+ 	int lcd_state;
+ 
+ 	struct rfkill *gps_rfkill;
+@@ -361,6 +370,14 @@ static int acpi_check_handle(acpi_handle handle, const char *method,
+ 	return 0;
+ }
+ 
++static bool asus_check_pega_lucid(struct asus_laptop *asus)
++{
++	return !strcmp(asus->name, DEVICE_NAME_PEGA) &&
++	   !acpi_check_handle(asus->handle, METHOD_PEGA_ENABLE, NULL) &&
++	   !acpi_check_handle(asus->handle, METHOD_PEGA_DISABLE, NULL) &&
++	   !acpi_check_handle(asus->handle, METHOD_PEGA_READ, NULL);
++}
++
+ /* Generic LED function */
+ static int asus_led_set(struct asus_laptop *asus, const char *method,
+ 			 int value)
+@@ -1334,7 +1351,6 @@ static mode_t asus_sysfs_is_visible(struct kobject *kobj,
+ 		   attr == &dev_attr_ls_level.attr) {
+ 		supported = !acpi_check_handle(handle, METHOD_ALS_CONTROL, NULL) &&
+ 			    !acpi_check_handle(handle, METHOD_ALS_LEVEL, NULL);
+-
+ 	} else if (attr == &dev_attr_gps.attr) {
+ 		supported = !acpi_check_handle(handle, METHOD_GPS_ON, NULL) &&
+ 			    !acpi_check_handle(handle, METHOD_GPS_OFF, NULL) &&
+@@ -1579,9 +1595,10 @@ static int __devinit asus_acpi_add(struct acpi_device *device)
+ 		goto fail_platform;
+ 
+ 	/*
+-	 * Register the platform device first.  It is used as a parent for the
+-	 * sub-devices below.
++	 * Need platform type detection first, then the platform
++	 * device.  It is used as a parent for the sub-devices below.
+ 	 */
++	asus->have_pega_lucid = asus_check_pega_lucid(asus);
+ 	result = asus_platform_init(asus);
+ 	if (result)
+ 		goto fail_platform;
+-- 
+1.7.1
+

++++++ linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch (new)
--- linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch
+++ linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch
+Reported-by: Rusty Lynch <rusty.lynch at intel.com>
+Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
+Cc: stable at kernel.org
+---
+ drivers/gpu/drm/drm_gem.c |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
+index 57ce27c..74e4ff5 100644
+--- a/drivers/gpu/drm/drm_gem.c
++++ b/drivers/gpu/drm/drm_gem.c
+@@ -499,11 +499,12 @@ EXPORT_SYMBOL(drm_gem_vm_open);
+ void drm_gem_vm_close(struct vm_area_struct *vma)
+ {
+ 	struct drm_gem_object *obj = vma->vm_private_data;
++	struct drm_device *dev = obj->dev;
+ 
+-	mutex_lock(&obj->dev->struct_mutex);
++	mutex_lock(&dev->struct_mutex);
+ 	drm_vm_close_locked(vma);
+ 	drm_gem_object_unreference(obj);
+-	mutex_unlock(&obj->dev->struct_mutex);
++	mutex_unlock(&dev->struct_mutex);
+ }
+ EXPORT_SYMBOL(drm_gem_vm_close);
+ 
+-- 
+1.7.2.3
+

++++++ patch-2.6.37.6.bz2 (new)
--- patch-2.6.37.6.bz2
+++ patch-2.6.37.6.bz2
+diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42
+index 0e76ef1..a22ecf4 100644
+--- a/Documentation/hwmon/jc42
++++ b/Documentation/hwmon/jc42
+@@ -51,7 +51,8 @@ Supported chips:
+   * JEDEC JC 42.4 compliant temperature sensor chips
+     Prefix: 'jc42'
+     Addresses scanned: I2C 0x18 - 0x1f
+-    Datasheet: -
++    Datasheet:
++	http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf
+ 
+ Author:
+ 	Guenter Roeck <guenter.roeck at ericsson.com>
+@@ -60,7 +61,11 @@ Author:
+ Description
+ -----------
+ 
+-This driver implements support for JEDEC JC 42.4 compliant temperature sensors.
++This driver implements support for JEDEC JC 42.4 compliant temperature sensors,
++which are used on many DDR3 memory modules for mobile devices and servers. Some
++systems use the sensor to prevent memory overheating by automatically throttling
++the memory controller.
++
+ The driver auto-detects the chips listed above, but can be manually instantiated
+ to support other JC 42.4 compliant chips.
+ 
+@@ -81,15 +86,19 @@ limits. The chip supports only a single register to configure the hysteresis,
+ which applies to all limits. This register can be written by writing into
+ temp1_crit_hyst. Other hysteresis attributes are read-only.
+ 
++If the BIOS has configured the sensor for automatic temperature management, it
++is likely that it has locked the registers, i.e., that the temperature limits
++cannot be changed.
++
+ Sysfs entries
+ -------------
+ 
+ temp1_input		Temperature (RO)
+-temp1_min		Minimum temperature (RW)
+-temp1_max		Maximum temperature (RW)
+-temp1_crit		Critical high temperature (RW)
++temp1_min		Minimum temperature (RO or RW)
++temp1_max		Maximum temperature (RO or RW)
++temp1_crit		Critical high temperature (RO or RW)
+ 
+-temp1_crit_hyst		Critical hysteresis temperature (RW)
++temp1_crit_hyst		Critical hysteresis temperature (RO or RW)
+ temp1_max_hyst		Maximum hysteresis temperature (RO)
+ 
+ temp1_min_alarm		Temperature low alarm
+diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
+index 6526eee..d2b56a4 100644
+--- a/Documentation/hwmon/k10temp
++++ b/Documentation/hwmon/k10temp
+@@ -9,6 +9,8 @@ Supported chips:
+   Socket S1G3: Athlon II, Sempron, Turion II
+ * AMD Family 11h processors:
+   Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
++* AMD Family 12h processors: "Llano"
++* AMD Family 14h processors: "Brazos" (C/E/G-Series)
+ 
+   Prefix: 'k10temp'
+   Addresses scanned: PCI space
+@@ -17,10 +19,14 @@ Supported chips:
+     http://support.amd.com/us/Processor_TechDocs/31116.pdf
+   BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors:
+     http://support.amd.com/us/Processor_TechDocs/41256.pdf
++  BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors:
++    http://support.amd.com/us/Processor_TechDocs/43170.pdf
+   Revision Guide for AMD Family 10h Processors:
+     http://support.amd.com/us/Processor_TechDocs/41322.pdf
+   Revision Guide for AMD Family 11h Processors:
+     http://support.amd.com/us/Processor_TechDocs/41788.pdf
++  Revision Guide for AMD Family 14h Models 00h-0Fh Processors:
++    http://support.amd.com/us/Processor_TechDocs/47534.pdf
+   AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks:
+     http://support.amd.com/us/Processor_TechDocs/43373.pdf
+   AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet:
+@@ -34,7 +40,7 @@ Description
+ -----------
+ 
+ This driver permits reading of the internal temperature sensor of AMD
+-Family 10h and 11h processors.
++Family 10h/11h/12h/14h processors.
+ 
+ All these processors have a sensor, but on those for Socket F or AM2+,
+ the sensor may return inconsistent values (erratum 319).  The driver
+diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
+index 87da405..9edb75d 100644
+--- a/Documentation/i2c/instantiating-devices
++++ b/Documentation/i2c/instantiating-devices
+@@ -100,7 +100,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
+ 	(...)
+ 	i2c_adap = i2c_get_adapter(2);
+ 	memset(&i2c_info, 0, sizeof(struct i2c_board_info));
+-	strlcpy(i2c_info.name, "isp1301_pnx", I2C_NAME_SIZE);
++	strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE);
+ 	isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info,
+ 						   normal_i2c, NULL);
+ 	i2c_put_adapter(i2c_adap);
+diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
+index 01ece1b..596bb3c 100644
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -884,6 +884,7 @@ and is between 256 and 4096 characters. It is defined in the file
+ 			     controller
+ 	i8042.nopnp	[HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
+ 			     controllers
++	i8042.notimeout	[HW] Ignore timeout condition signalled by conroller
+ 	i8042.reset	[HW] Reset the controller during init and cleanup
+ 	i8042.unlock	[HW] Unlock (ignore) the keylock
+ 
+diff --git a/Documentation/networking/dns_resolver.txt b/Documentation/networking/dns_resolver.txt
+index aefd1e6..04ca0632 100644
+--- a/Documentation/networking/dns_resolver.txt
++++ b/Documentation/networking/dns_resolver.txt
+@@ -61,7 +61,6 @@ before the more general line given above as the first match is the one taken.
+ 	create	dns_resolver  	foo:*	*	/usr/sbin/dns.foo %k
+ 
+ 
+-
+ =====
+ USAGE
+ =====
+@@ -104,6 +103,14 @@ implemented in the module can be called after doing:
+      returned also.
+ 
+ 
++===============================
++READING DNS KEYS FROM USERSPACE
++===============================
++
++Keys of dns_resolver type can be read from userspace using keyctl_read() or
++"keyctl read/print/pipe".
++
++
+ =========
+ MECHANISM
+ =========
+diff --git a/Makefile b/Makefile
+index 74b2555..bf9a00c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ VERSION = 2
+ PATCHLEVEL = 6
+ SUBLEVEL = 37
+-EXTRAVERSION =
++EXTRAVERSION = .6
+ NAME = Flesh-Eating Bats with Fangs
+ 
+ # *DOCUMENTATION*
+diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
+index 6bd82d2..7306b8e 100644
+--- a/arch/arm/kernel/head.S
++++ b/arch/arm/kernel/head.S
+@@ -91,6 +91,11 @@ ENTRY(stext)
+ 	movs	r8, r5				@ invalid machine (r5=0)?
+  THUMB( it	eq )		@ force fixup-able long branch encoding
+ 	beq	__error_a			@ yes, error 'a'
++
++	/*
++	 * r1 = machine no, r2 = atags,
++	 * r8 = machinfo, r9 = cpuid, r10 = procinfo
++	 */
+ 	bl	__vet_atags
+ #ifdef CONFIG_SMP_ON_UP
+ 	bl	__fixup_smp
+@@ -387,34 +392,32 @@ ENDPROC(__turn_mmu_on)
+ 
+ #ifdef CONFIG_SMP_ON_UP
+ __fixup_smp:
+-	mov	r7, #0x00070000
+-	orr	r6, r7, #0xff000000	@ mask 0xff070000
+-	orr	r7, r7, #0x41000000	@ val 0x41070000
+-	and	r0, r9, r6
+-	teq	r0, r7			@ ARM CPU and ARMv6/v7?
++	and	r3, r9, #0x000f0000	@ architecture version
++	teq	r3, #0x000f0000		@ CPU ID supported?
+ 	bne	__fixup_smp_on_up	@ no, assume UP
+ 
+-	orr	r6, r6, #0x0000ff00
+-	orr	r6, r6, #0x000000f0	@ mask 0xff07fff0
+-	orr	r7, r7, #0x0000b000
+-	orr	r7, r7, #0x00000020	@ val 0x4107b020
+-	and	r0, r9, r6
+-	teq	r0, r7			@ ARM 11MPCore?
++	bic	r3, r9, #0x00ff0000
++	bic	r3, r3, #0x0000000f	@ mask 0xff00fff0
++	mov	r4, #0x41000000
++	orr	r4, r4, #0x0000b000
++	orr	r4, r4, #0x00000020	@ val 0x4100b020
++	teq	r3, r4			@ ARM 11MPCore?
+ 	moveq	pc, lr			@ yes, assume SMP
+ 
+ 	mrc	p15, 0, r0, c0, c0, 5	@ read MPIDR
+-	tst	r0, #1 << 31
(21464 more lines skipped)

++++++ series
--- series
+++ series
@@ -35,8 +35,14 @@
 #####################################################################
 
 
+# fix gem crash
+linux-2.6.37-use-after-free-in-drm-gem-vm-close.patch
+
 # small patch to enable the ExoPC brightness sensor control
-linux-2.6.37-exopc-als.patch
+linux-2.6.37-pegatron-detection.patch
+linux-2.6.37-pegatron-als-sensor.patch
+linux-2.6.37-pegatron-accelerometer.patch
+linux-2.6.37-pegatron-als-bootcommand.patch
 
 
 
@@ -69,3 +75,4 @@
 # turn on "print fatal signals" by default, so that we can debug /sbin/init
 # crashes
 linux-2.6.35-fatal-signals.patch
+




More information about the MeeGo-commits mailing list