[meego-commits] 14710: Changes to Trunk:Testing/kernel

Arjan van de Ven no_reply at build.meego.com
Fri Mar 11 18:43:49 UTC 2011


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

Thank You,
Arjan van de Ven

[This message was auto-generated]

---

Request #14710:

  submit:   devel:kernel/kernel(r245) -> Trunk:Testing/kernel


Message:
    ALS for exopc

State:   new          2011-03-11T10:43:41 arjan
Comment: None



changes files:
--------------
--- kernel.changes
+++ kernel.changes
@@ -0,0 +1,3 @@
+* Fri Mar 11 2011 - Arjan van de Ven <arjan at linux.intel.com> - 2.6.37.2
+- add ALS control for the ExoPC
+

new:
----
  linux-2.6.37-exopc-als.patch

spec files:
-----------
--- kernel.spec
+++ kernel.spec
@@ -89,7 +89,7 @@
 # Packages that need to be installed before the kernel is, because the %post
 # scripts use them.
 #
-%define kernel_prereq  fileutils, module-init-tools, fastinit, mkinitrd >= 6.0.39-1
+%define kernel_prereq  fileutils, module-init-tools, sysvinit, mkinitrd >= 6.0.39-1
 
 #
 # This macro does requires, provides, conflicts, obsoletes for a kernel package.
@@ -185,6 +185,9 @@
 #####################################################################
 
 
+# small patch to enable the ExoPC brightness sensor control
+Patch102: linux-2.6.37-exopc-als.patch
+
 
 
 
@@ -353,6 +356,10 @@
 #####################################################################
 
 
+# small patch to enable the ExoPC brightness sensor control
+# linux-2.6.37-exopc-als.patch
+%patch102 -p1
+
 
 
 

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

++++++ config-generic
--- config-generic
+++ config-generic
@@ -2705,7 +2705,7 @@
 # CONFIG_TRACE_BRANCH_PROFILING is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+CONFIG_DYNAMIC_PRINTK_DEBUG=y
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
@@ -3046,7 +3046,7 @@
 # CONFIG_FTRACE_SYSCALLS is not set
 # CONFIG_KMEMTRACE is not set
 # CONFIG_WORKQUEUE_TRACER is not set
-# CONFIG_DYNAMIC_DEBUG is not set
+CONFIG_DYNAMIC_DEBUG=y
 # CONFIG_DMA_API_DEBUG is not set
 # CONFIG_IMA is not set
 CONFIG_CRYPTO_ZLIB=y

++++++ kernel.spec.in
--- kernel.spec.in
+++ kernel.spec.in
@@ -89,7 +89,7 @@
 # Packages that need to be installed before the kernel is, because the %post
 # scripts use them.
 #
-%define kernel_prereq  fileutils, module-init-tools, fastinit, mkinitrd >= 6.0.39-1
+%define kernel_prereq  fileutils, module-init-tools, sysvinit, mkinitrd >= 6.0.39-1
 
 #
 # This macro does requires, provides, conflicts, obsoletes for a kernel package.

++++++ linux-2.6.37-exopc-als.patch (new)
--- linux-2.6.37-exopc-als.patch
+++ linux-2.6.37-exopc-als.patch
+--- linux-2.6.37/drivers/platform/x86/asus-laptop.c.org	2011-03-10 17:33:04.039999853 -0500
++++ linux-2.6.37/drivers/platform/x86/asus-laptop.c	2011-03-10 17:33:08.890001119 -0500
+@@ -83,6 +83,7 @@
+ static int bluetooth_status = 1;
+ static int wimax_status = -1;
+ static int wwan_status = -1;
++static int als_status = 0;
+ 
+ module_param(wlan_status, int, 0444);
+ MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot "
+@@ -104,6 +105,11 @@
+ 		 "(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 1");
++
+ /*
+  * Some events we use, same for all Asus
+  */
+@@ -139,6 +145,10 @@
+ /* LEDD */
+ #define METHOD_LEDD		"SLCM"
+ 
++/* ALS */
++#define METHOD_ALS_OFF		"DAPR"
++#define METHOD_ALS_ON		"ENPR"
++
+ /*
+  * Bluetooth and WLAN
+  * WLED and BLED are not handled like other XLED, because in some dsdt
+@@ -252,6 +262,7 @@
+ 
+ 	acpi_handle handle;	/* the handle of the hotk device */
+ 	u32 ledd_status;	/* status of the LED display */
++	u32 als_status;	/* status of the LED display */
+ 	u8 light_level;		/* light sensor level */
+ 	u8 light_switch;	/* light sensor switch value */
+ 	u16 event_count[128];	/* count for each event TODO make this better */
+@@ -824,6 +835,49 @@
+ 	return rv;
+ }
+ 
++
++/*
++ * ALS display brightness controll
++ */
++
++static int asus_als_set(struct asus_laptop *asus, int value)
++{
++	if (value > 0) {
++		if (write_acpi_int(asus->handle, METHOD_ALS_ON, 4)) {
++			pr_warning("LED display write failed\n");
++			return -ENODEV;
++		}
++		asus->als_status = (u32) value;
++	} else {
++		if (write_acpi_int(asus->handle, METHOD_ALS_OFF, 4)) {
++			pr_warning("LED display write failed\n");
++			return -ENODEV;
++		}
++		asus->als_status = (u32) value;
++	}
++	return 0;
++}
++
++static ssize_t show_als(struct device *dev,
++			 struct device_attribute *attr, char *buf)
++{
++	struct asus_laptop *asus = dev_get_drvdata(dev);
++
++	return sprintf(buf, "0x%08x\n", asus->als_status);
++}
++
++static ssize_t store_als(struct device *dev, struct device_attribute *attr,
++			  const char *buf, size_t count)
++{
++	struct asus_laptop *asus = dev_get_drvdata(dev);
++	int rv, value;
++
++	rv = parse_arg(buf, count, &value);
++	if (rv > 0)
++		asus_als_set(asus, value);
++	return rv;
++}
++
+ /*
+  * Wireless
+  */
+@@ -1283,6 +1337,7 @@
+ 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(als, S_IRUGO | S_IWUSR, show_als, store_als);
+ 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);
+@@ -1295,6 +1350,7 @@
+ 	&dev_attr_wwan.attr,
+ 	&dev_attr_display.attr,
+ 	&dev_attr_ledd.attr,
++	&dev_attr_als.attr,
+ 	&dev_attr_ls_level.attr,
+ 	&dev_attr_ls_switch.attr,
+ 	&dev_attr_gps.attr,
+@@ -1329,6 +1385,8 @@
+ 
+ 	} else if (attr == &dev_attr_ledd.attr) {
+ 		supported = !acpi_check_handle(handle, METHOD_LEDD, NULL);
++	} else if (attr == &dev_attr_als.attr) {
++		supported = !acpi_check_handle(handle, METHOD_ALS_ON, NULL);
+ 
+ 	} else if (attr == &dev_attr_ls_switch.attr ||
+ 		   attr == &dev_attr_ls_level.attr) {
+@@ -1535,6 +1593,9 @@
+ 	if (wwan_status >= 0)
+ 		asus_wwan_set(asus, !!wwan_status);
+ 
++	if (als_status >= 0)
++		asus_als_set(asus, !!als_status);
++
+ 	/* Keyboard Backlight is on by default */
+ 	if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL))
+ 		asus_kled_set(asus, 1);
+@@ -1542,6 +1603,8 @@
+ 	/* LED display is off by default */
+ 	asus->ledd_status = 0xFFF;
+ 
++	asus->als_status = 1;
++
+ 	/* Set initial values of light sensor and level */
+ 	asus->light_switch = 0;	/* Default to light sensor disabled */
+ 	asus->light_level = 5;	/* level 5 for sensor sensitivity */

++++++ series
--- series
+++ series
@@ -35,6 +35,9 @@
 #####################################################################
 
 
+# small patch to enable the ExoPC brightness sensor control
+linux-2.6.37-exopc-als.patch
+
 
 
 




More information about the MeeGo-commits mailing list