[kernel] r22240 - in dists/sid/linux/debian: . patches patches/features/x86

Ben Hutchings benh at moszumanska.debian.org
Fri Jan 2 04:04:31 UTC 2015


Author: benh
Date: Fri Jan  2 04:04:31 2015
New Revision: 22240

Log:
[x86] platform/chrome: chromeos_laptop - Add support for Acer C720 (Closes: #774209)

Added:
   dists/sid/linux/debian/patches/features/x86/platform-chrome-chromeos_laptop-add-support-for-acer.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Fri Jan  2 03:48:04 2015	(r22239)
+++ dists/sid/linux/debian/changelog	Fri Jan  2 04:04:31 2015	(r22240)
@@ -97,6 +97,8 @@
   * [arm64] Enable PSTORE as built-in and EFI_VARS_PSTORE as module;
     ensure efivars and efi-pstore are loaded on EFI systems (Closes: #773309)
   * hwmon: Enable SENSORS_NCT6683 as module (Closes: #774372)
+  * [x86] platform/chrome: chromeos_laptop - Add support for Acer C720
+    (Closes: #774209)
 
   [ Ian Campbell ]
   * [armhf] Enable support for support OMAP5432 uEVM by enabling:

Added: dists/sid/linux/debian/patches/features/x86/platform-chrome-chromeos_laptop-add-support-for-acer.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/features/x86/platform-chrome-chromeos_laptop-add-support-for-acer.patch	Fri Jan  2 04:04:31 2015	(r22240)
@@ -0,0 +1,124 @@
+From: Mika Westerberg <mika.westerberg at linux.intel.com>
+Date: Tue, 17 Jun 2014 14:02:00 -0700
+Subject: platform/chrome: chromeos_laptop - Add support for Acer C720
+Origin: https://git.kernel.org/linus/da3b0ab75aadab63d1ffd5563100c9386e444dad
+
+Acer C720 has touchpad and light sensor connected to a separate I2C buses.
+Since the designware I2C host controller driver has two instances on this
+particular machine we need a way to match the correct instance. Add support
+for this and then register both C720 touchpad and light sensor.
+
+This code is based on following patch from Benson Leung:
+
+https://patchwork.kernel.org/patch/3074411/
+
+Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
+Tested-by: Kirill A. Shutemov <kirill.shutemov at linux.intel.com>
+Signed-off-by: Benson Leung <bleung at chromium.org>
+Reviewed-by: Mika Westerberg <mika.westerberg at linux.intel.com>
+Signed-off-by: Olof Johansson <olof at lixom.net>
+---
+ drivers/platform/chrome/chromeos_laptop.c | 45 ++++++++++++++++++++++++++-----
+ 1 file changed, 39 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
+index 7f1a2e2..a241e5f 100644
+--- a/drivers/platform/chrome/chromeos_laptop.c
++++ b/drivers/platform/chrome/chromeos_laptop.c
+@@ -45,6 +45,8 @@ static const char *i2c_adapter_names[] = {
+ 	"SMBus I801 adapter",
+ 	"i915 gmbus vga",
+ 	"i915 gmbus panel",
++	"i2c-designware-pci",
++	"i2c-designware-pci",
+ };
+ 
+ /* Keep this enum consistent with i2c_adapter_names */
+@@ -52,6 +54,8 @@ enum i2c_adapter_type {
+ 	I2C_ADAPTER_SMBUS = 0,
+ 	I2C_ADAPTER_VGADDC,
+ 	I2C_ADAPTER_PANEL,
++	I2C_ADAPTER_DESIGNWARE_0,
++	I2C_ADAPTER_DESIGNWARE_1,
+ };
+ 
+ struct i2c_peripheral {
+@@ -172,29 +176,42 @@ static struct i2c_client *__add_probed_i2c_device(
+ 	return client;
+ }
+ 
++struct i2c_lookup {
++	const char *name;
++	int instance;
++	int n;
++};
++
+ static int __find_i2c_adap(struct device *dev, void *data)
+ {
+-	const char *name = data;
++	struct i2c_lookup *lookup = data;
+ 	static const char *prefix = "i2c-";
+ 	struct i2c_adapter *adapter;
+ 	if (strncmp(dev_name(dev), prefix, strlen(prefix)) != 0)
+ 		return 0;
+ 	adapter = to_i2c_adapter(dev);
+-	return (strncmp(adapter->name, name, strlen(name)) == 0);
++	if (strncmp(adapter->name, lookup->name, strlen(lookup->name)) == 0 &&
++	    lookup->n++ == lookup->instance)
++		return 1;
++	return 0;
+ }
+ 
+ static int find_i2c_adapter_num(enum i2c_adapter_type type)
+ {
+ 	struct device *dev = NULL;
+ 	struct i2c_adapter *adapter;
+-	const char *name = i2c_adapter_names[type];
++	struct i2c_lookup lookup;
++
++	memset(&lookup, 0, sizeof(lookup));
++	lookup.name = i2c_adapter_names[type];
++	lookup.instance = (type == I2C_ADAPTER_DESIGNWARE_1) ? 1 : 0;
++
+ 	/* find the adapter by name */
+-	dev = bus_find_device(&i2c_bus_type, NULL, (void *)name,
+-			      __find_i2c_adap);
++	dev = bus_find_device(&i2c_bus_type, NULL, &lookup, __find_i2c_adap);
+ 	if (!dev) {
+ 		/* Adapters may appear later. Deferred probing will retry */
+ 		pr_notice("%s: i2c adapter %s not found on system.\n", __func__,
+-			  name);
++			  lookup.name);
+ 		return -ENODEV;
+ 	}
+ 	adapter = to_i2c_adapter(dev);
+@@ -377,6 +394,15 @@ static struct chromeos_laptop acer_ac700 = {
+ 	},
+ };
+ 
++static struct chromeos_laptop acer_c720 = {
++	.i2c_peripherals = {
++		/* Touchpad. */
++		{ .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
++		/* Light Sensor. */
++		{ .add = setup_isl29018_als, I2C_ADAPTER_DESIGNWARE_1 },
++	},
++};
++
+ static struct chromeos_laptop hp_pavilion_14_chromebook = {
+ 	.i2c_peripherals = {
+ 		/* Touchpad. */
+@@ -434,6 +460,13 @@ static struct dmi_system_id chromeos_laptop_dmi_table[] __initdata = {
+ 		_CBDD(acer_ac700),
+ 	},
+ 	{
++		.ident = "Acer C720",
++		.matches = {
++			DMI_MATCH(DMI_PRODUCT_NAME, "Peppy"),
++		},
++		_CBDD(acer_c720),
++	},
++	{
+ 		.ident = "HP Pavilion 14 Chromebook",
+ 		.matches = {
+ 			DMI_MATCH(DMI_PRODUCT_NAME, "Butterfly"),

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Fri Jan  2 03:48:04 2015	(r22239)
+++ dists/sid/linux/debian/patches/series	Fri Jan  2 04:04:31 2015	(r22240)
@@ -482,3 +482,4 @@
 debian/perf-fix-abi-change-in-3.16.7-ckt2.patch
 debian/arm-thread_info-fix-abi-change-in-3.16.7-ckt3.patch
 debian/pci-fix-abi-change-in-3.16.7-ckt3.patch
+features/x86/platform-chrome-chromeos_laptop-add-support-for-acer.patch



More information about the Kernel-svn-changes mailing list