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

Commit 63f4f7e8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'chrome-platform-4.4' of...

Merge tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform

Pull chrome platform updates from Olof Johansson:
 "Here's the branch of chrome platform changes for v4.4.  Some have been
  queued up for the full 4.3 release cycle since I forgot to send them
  in for that round (rebased early on to deal with fixes conflicts).

  Most of these enable EC communication stuff -- Pixel 2015 support,
  enabling building for ARM64 platforms, and a few fixes for memory
  leaks.

  There's also a patch in here to allow reading/writing the verified
  boot context, which depends on a sysfs patch acked by Greg"

* tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform:
  platform/chrome: Fix i2c-designware adapter name
  platform/chrome: Support reading/writing the vboot context
  sysfs: Support is_visible() on binary attributes
  platform/chrome: cros_ec: Fix possible leak in led_rgb_store()
  platform/chrome: cros_ec: Fix leak in sequence_store()
  platform/chrome: Enable Chrome platforms on 64-bit ARM
  platform/chrome: cros_ec_dev - Add a platform device ID table
  platform/chrome: cros_ec_lpc - Add support for Google Pixel 2
  platform/chrome: cros_ec_lpc - Use existing function to check EC result
  platform/chrome: Make depends on MFD_CROS_EC instead CROS_EC_PROTO
  Revert "platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM"
parents 4bfc89d2 ebaf31c4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

menuconfig CHROME_PLATFORMS
	bool "Platform support for Chrome hardware"
	depends on X86 || ARM || ARM64 || COMPILE_TEST
	---help---
	  Say Y here to get to see options for platform support for
	  various Chromebooks and Chromeboxes. This option alone does
@@ -39,7 +40,7 @@ config CHROMEOS_PSTORE

config CROS_EC_CHARDEV
        tristate "Chrome OS Embedded Controller userspace device interface"
        depends on CROS_EC_PROTO
        depends on MFD_CROS_EC
        ---help---
          This driver adds support to talk with the ChromeOS EC from userspace.

@@ -48,7 +49,7 @@ config CROS_EC_CHARDEV

config CROS_EC_LPC
        tristate "ChromeOS Embedded Controller (LPC)"
        depends on MFD_CROS_EC && CROS_EC_PROTO && (X86 || COMPILE_TEST)
        depends on MFD_CROS_EC && (X86 || COMPILE_TEST)
        help
          If you say Y here, you get support for talking to the ChromeOS EC
          over an LPC bus. This uses a simple byte-level protocol with a
+2 −1
Original line number Diff line number Diff line

obj-$(CONFIG_CHROMEOS_LAPTOP)	+= chromeos_laptop.o
obj-$(CONFIG_CHROMEOS_PSTORE)	+= chromeos_pstore.o
cros_ec_devs-objs               := cros_ec_dev.o cros_ec_sysfs.o cros_ec_lightbar.o
cros_ec_devs-objs		:= cros_ec_dev.o cros_ec_sysfs.o \
				   cros_ec_lightbar.o cros_ec_vbc.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
+2 −2
Original line number Diff line number Diff line
@@ -47,8 +47,8 @@ static const char *i2c_adapter_names[] = {
	"SMBus I801 adapter",
	"i915 gmbus vga",
	"i915 gmbus panel",
	"i2c-designware-pci",
	"i2c-designware-pci",
	"Synopsys DesignWare I2C adapter",
	"Synopsys DesignWare I2C adapter",
};

/* Keep this enum consistent with i2c_adapter_names */
+7 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ static int ec_major;
static const struct attribute_group *cros_ec_groups[] = {
	&cros_ec_attr_group,
	&cros_ec_lightbar_attr_group,
	&cros_ec_vbc_attr_group,
	NULL,
};

@@ -287,6 +288,12 @@ static int ec_device_remove(struct platform_device *pdev)
	return 0;
}

static const struct platform_device_id cros_ec_id[] = {
	{ "cros-ec-ctl", 0 },
	{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(platform, cros_ec_id);

static struct platform_driver cros_ec_dev_driver = {
	.driver = {
		.name = "cros-ec-ctl",
+17 −14
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ static ssize_t led_rgb_store(struct device *dev, struct device_attribute *attr,

		ret = sscanf(buf, "%i", &val[i++]);
		if (ret == 0)
			return -EINVAL;
			goto exit;

		if (i == 4) {
			param = (struct ec_params_lightbar *)msg->data;
@@ -268,17 +268,15 @@ static ssize_t led_rgb_store(struct device *dev, struct device_attribute *attr,
			if ((j++ % 4) == 0) {
				ret = lb_throttle();
				if (ret)
					return ret;
					goto exit;
			}

			ret = cros_ec_cmd_xfer(ec->ec_dev, msg);
			if (ret < 0)
				goto exit;

			if (msg->result != EC_RES_SUCCESS) {
				ret = -EINVAL;
			if (msg->result != EC_RES_SUCCESS)
				goto exit;
			}

			i = 0;
			ok = 1;
@@ -352,10 +350,6 @@ static ssize_t sequence_store(struct device *dev, struct device_attribute *attr,
	struct cros_ec_dev *ec = container_of(dev,
					      struct cros_ec_dev, class_dev);

	msg = alloc_lightbar_cmd_msg(ec);
	if (!msg)
		return -ENOMEM;

	for (len = 0; len < count; len++)
		if (!isalnum(buf[len]))
			break;
@@ -370,21 +364,30 @@ static ssize_t sequence_store(struct device *dev, struct device_attribute *attr,
			return ret;
	}

	msg = alloc_lightbar_cmd_msg(ec);
	if (!msg)
		return -ENOMEM;

	param = (struct ec_params_lightbar *)msg->data;
	param->cmd = LIGHTBAR_CMD_SEQ;
	param->seq.num = num;
	ret = lb_throttle();
	if (ret)
		return ret;
		goto exit;

	ret = cros_ec_cmd_xfer(ec->ec_dev, msg);
	if (ret < 0)
		return ret;
		goto exit;

	if (msg->result != EC_RES_SUCCESS)
		return -EINVAL;
	if (msg->result != EC_RES_SUCCESS) {
		ret = -EINVAL;
		goto exit;
	}

	return count;
	ret = count;
exit:
	kfree(msg);
	return ret;
}

/* Module initialization */
Loading