Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1842b2b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull chrome platform updates from Olof Johansson
 "A handful of Chrome driver and binding changes this merge window:

   - a few patches to fix probing and configuration of pstore

   - a few patches adding Elan touchpad registration on a few devices

   - EC changes: a security fix dealing with max message sizes and
     addition of compat_ioctl support.

   - keyboard backlight control support

  There was also an accidential duplicate registration of trackpads on
  'Leon', which was reverted just recently"

* tag 'chrome-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
  Revert "platform/chrome: chromeos_laptop: Add Leon Touch"
  platform/chrome: chromeos_laptop - Add Elan touchpad for Wolf
  platform/chrome: chromeos_laptop - Add elan trackpad option for C720
  platform/chrome: cros_ec_dev - Populate compat_ioctl
  platform/chrome: cros_ec_lightbar - use name instead of ID to hide lightbar attributes
  platform/chrome: cros_ec_dev - Fix security issue
  platform/chrome: Add Chrome OS keyboard backlight LEDs support
  platform/chrome: use to_platform_device()
  platform/chrome: pstore: Move to larger record size.
  platform/chrome: pstore: probe for ramoops buffer using acpi
  platform/chrome: chromeos_laptop: Add Leon Touch
parents 0723ab4a 8d057e3a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -64,4 +64,14 @@ config CROS_EC_PROTO
        help
          ChromeOS EC communication protocol helpers.

config CROS_KBD_LED_BACKLIGHT
	tristate "Backlight LED support for Chrome OS keyboards"
	depends on LEDS_CLASS && ACPI
	help
	  This option enables support for the keyboard backlight LEDs on
	  select Chrome OS systems.

	  To compile this driver as a module, choose M here: the
	  module will be called cros_kbd_led_backlight.

endif # CHROMEOS_PLATFORMS
+8 −7
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ cros_ec_devs-objs := cros_ec_dev.o cros_ec_sysfs.o \
obj-$(CONFIG_CROS_EC_CHARDEV)		+= cros_ec_devs.o
obj-$(CONFIG_CROS_EC_LPC)		+= cros_ec_lpc.o
obj-$(CONFIG_CROS_EC_PROTO)		+= cros_ec_proto.o
obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT)	+= cros_kbd_led_backlight.o
+21 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define ATMEL_TS_I2C_ADDR	0x4a
#define ATMEL_TS_I2C_BL_ADDR	0x26
#define CYAPA_TP_I2C_ADDR	0x67
#define ELAN_TP_I2C_ADDR	0x15
#define ISL_ALS_I2C_ADDR	0x44
#define TAOS_ALS_I2C_ADDR	0x29

@@ -73,7 +74,7 @@ struct i2c_peripheral {
	int tries;
};

#define MAX_I2C_PERIPHERALS 3
#define MAX_I2C_PERIPHERALS 4

struct chromeos_laptop {
	struct i2c_peripheral i2c_peripherals[MAX_I2C_PERIPHERALS];
@@ -86,6 +87,11 @@ static struct i2c_board_info cyapa_device = {
	.flags		= I2C_CLIENT_WAKE,
};

static struct i2c_board_info elantech_device = {
	I2C_BOARD_INFO("elan_i2c", ELAN_TP_I2C_ADDR),
	.flags		= I2C_CLIENT_WAKE,
};

static struct i2c_board_info isl_als_device = {
	I2C_BOARD_INFO("isl29018", ISL_ALS_I2C_ADDR),
};
@@ -306,6 +312,16 @@ static int setup_atmel_224s_tp(enum i2c_adapter_type type)
	return (!tp) ? -EAGAIN : 0;
}

static int setup_elantech_tp(enum i2c_adapter_type type)
{
	if (tp)
		return 0;

	/* add elantech touchpad */
	tp = add_i2c_device("trackpad", type, &elantech_device);
	return (!tp) ? -EAGAIN : 0;
}

static int setup_atmel_1664s_ts(enum i2c_adapter_type type)
{
	const unsigned short addr_list[] = { ATMEL_TS_I2C_BL_ADDR,
@@ -445,6 +461,8 @@ static struct chromeos_laptop dell_chromebook_11 = {
	.i2c_peripherals = {
		/* Touchpad. */
		{ .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
		/* Elan Touchpad option. */
		{ .add = setup_elantech_tp, I2C_ADAPTER_DESIGNWARE_0 },
	},
};

@@ -475,6 +493,8 @@ static struct chromeos_laptop acer_c720 = {
		{ .add = setup_atmel_1664s_ts, I2C_ADAPTER_DESIGNWARE_1 },
		/* Touchpad. */
		{ .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
		/* Elan Touchpad option. */
		{ .add = setup_elantech_tp, I2C_ADAPTER_DESIGNWARE_0 },
		/* Light Sensor. */
		{ .add = setup_isl29018_als, I2C_ADAPTER_DESIGNWARE_1 },
	},
+53 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
 *  the Free Software Foundation, version 2 of the License.
 */

#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/platform_device.h>
@@ -58,7 +59,7 @@ MODULE_DEVICE_TABLE(dmi, chromeos_pstore_dmi_table);
static struct ramoops_platform_data chromeos_ramoops_data = {
	.mem_size	= 0x100000,
	.mem_address	= 0xf00000,
	.record_size	= 0x20000,
	.record_size	= 0x40000,
	.console_size	= 0x20000,
	.ftrace_size	= 0x20000,
	.dump_oops	= 1,
@@ -71,9 +72,59 @@ static struct platform_device chromeos_ramoops = {
	},
};

#ifdef CONFIG_ACPI
static const struct acpi_device_id cros_ramoops_acpi_match[] = {
	{ "GOOG9999", 0 },
	{ }
};
MODULE_DEVICE_TABLE(acpi, cros_ramoops_acpi_match);

static struct platform_driver chromeos_ramoops_acpi = {
	.driver		= {
		.name	= "chromeos_pstore",
		.acpi_match_table = ACPI_PTR(cros_ramoops_acpi_match),
	},
};

static int __init chromeos_probe_acpi(struct platform_device *pdev)
{
	struct resource *res;
	resource_size_t len;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res)
		return -ENOMEM;

	len = resource_size(res);
	if (!res->start || !len)
		return -ENOMEM;

	pr_info("chromeos ramoops using acpi device.\n");

	chromeos_ramoops_data.mem_size = len;
	chromeos_ramoops_data.mem_address = res->start;

	return 0;
}

static bool __init chromeos_check_acpi(void)
{
	if (!platform_driver_probe(&chromeos_ramoops_acpi, chromeos_probe_acpi))
		return true;
	return false;
}
#else
static inline bool chromeos_check_acpi(void) { return false; }
#endif

static int __init chromeos_pstore_init(void)
{
	if (dmi_check_system(chromeos_pstore_dmi_table))
	bool acpi_dev_found;

	/* First check ACPI for non-hardcoded values from firmware. */
	acpi_dev_found = chromeos_check_acpi();

	if (acpi_dev_found || dmi_check_system(chromeos_pstore_dmi_table))
		return platform_device_register(&chromeos_ramoops);

	return -ENODEV;
+7 −0
Original line number Diff line number Diff line
@@ -137,6 +137,10 @@ static long ec_device_ioctl_xcmd(struct cros_ec_dev *ec, void __user *arg)
	if (copy_from_user(&u_cmd, arg, sizeof(u_cmd)))
		return -EFAULT;

	if ((u_cmd.outsize > EC_MAX_MSG_BYTES) ||
	    (u_cmd.insize > EC_MAX_MSG_BYTES))
		return -EINVAL;

	s_cmd = kmalloc(sizeof(*s_cmd) + max(u_cmd.outsize, u_cmd.insize),
			GFP_KERNEL);
	if (!s_cmd)
@@ -208,6 +212,9 @@ static const struct file_operations fops = {
	.release = ec_device_release,
	.read = ec_device_read,
	.unlocked_ioctl = ec_device_ioctl,
#ifdef CONFIG_COMPAT
	.compat_ioctl = ec_device_ioctl,
#endif
};

static void __remove(struct device *dev)
Loading