Commit d48d8380 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'chrome-platform-v6.16' of...

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

Pull chrome-platform updates from Tzung-Bi Shih:
 "New:

   - Support MT8192 Spherion and MT8186 Corsola devices in of_hw_prober

   - Turn cros_ec_proto from bool into tristate

   - Support Pin Assignment E in cros_ec_typec for USB-C to DP cables

  Improvements:

   - Avoid -Wflex-array-member-not-at-end warnings

  Cleanups:

   - Remove a redundant dependency in Kconfig for cros_kbd_led_backlight"

* tag 'chrome-platform-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: kunit: Avoid -Wflex-array-member-not-at-end
  platform/chrome: cros_ec_typec: Set Pin Assignment E in DP PORT VDO
  platform/chrome: of_hw_prober: Support touchscreen probing on Squirtle
  platform/chrome: of_hw_prober: Support trackpad probing on Corsola family
  platform/chrome: cros_kbd_led_backlight: Fix build dependencies
  platform/chrome: cros_kbd_led_backlight: Remove CROS_EC dependency
  platform/chrome: cros_ec_proto: Allow to build as module
  platform/chrome: cros_ec_debugfs: Avoid -Wflex-array-member-not-at-end warnings
  platform/chrome: cros_kbd_led_backlight: Avoid -Wflex-array-member-not-at-end warnings
  platform/chrome: cros_ec_proto: Avoid -Wflex-array-member-not-at-end warnings
  platform/chrome: of_hw_prober: Support Google Spherion
parents bad14b5d 3e552ccf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -155,13 +155,14 @@ config CROS_EC_LPC
	  module will be called cros_ec_lpcs.

config CROS_EC_PROTO
	bool
	tristate
	help
	  ChromeOS EC communication protocol helpers.

config CROS_KBD_LED_BACKLIGHT
	tristate "Backlight LED support for Chrome OS keyboards"
	depends on LEDS_CLASS && (ACPI || CROS_EC || MFD_CROS_EC_DEV)
	depends on LEDS_CLASS
	depends on MFD_CROS_EC_DEV || (MFD_CROS_EC_DEV=n && ACPI)
	help
	  This option enables support for the keyboard backlight LEDs on
	  select Chrome OS systems.
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@ endif
obj-$(CONFIG_CROS_EC_TYPEC)		+= cros-ec-typec.o

obj-$(CONFIG_CROS_EC_LPC)		+= cros_ec_lpcs.o
obj-$(CONFIG_CROS_EC_PROTO)		+= cros_ec_proto.o cros_ec_trace.o
cros-ec-proto-objs			:= cros_ec_proto.o cros_ec_trace.o
obj-$(CONFIG_CROS_EC_PROTO)		+= cros-ec-proto.o
obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT)	+= cros_kbd_led_backlight.o
obj-$(CONFIG_CROS_EC_CHARDEV)		+= cros_ec_chardev.o
obj-$(CONFIG_CROS_EC_LIGHTBAR)		+= cros_ec_lightbar.o
+33 −0
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ static int chromeos_i2c_component_prober(struct device *dev, const void *_data)
	}

DEFINE_CHROMEOS_I2C_PROBE_DATA_DUMB_BY_TYPE(touchscreen);
DEFINE_CHROMEOS_I2C_PROBE_DATA_DUMB_BY_TYPE(trackpad);

DEFINE_CHROMEOS_I2C_PROBE_CFG_SIMPLE_BY_TYPE(touchscreen);
DEFINE_CHROMEOS_I2C_PROBE_CFG_SIMPLE_BY_TYPE(trackpad);

static const struct chromeos_i2c_probe_data chromeos_i2c_probe_hana_trackpad = {
@@ -75,6 +77,17 @@ static const struct chromeos_i2c_probe_data chromeos_i2c_probe_hana_trackpad = {
	},
};

static const struct chromeos_i2c_probe_data chromeos_i2c_probe_squirtle_touchscreen = {
	.cfg = &chromeos_i2c_probe_simple_touchscreen_cfg,
	.opts = &(const struct i2c_of_probe_simple_opts) {
		.res_node_compatible = "elan,ekth6a12nay",
		.supply_name = "vcc33",
		.gpio_name = "reset",
		.post_power_on_delay_ms = 10,
		.post_gpio_config_delay_ms = 300,
	},
};

static const struct hw_prober_entry hw_prober_platforms[] = {
	{
		.compatible = "google,hana",
@@ -84,6 +97,26 @@ static const struct hw_prober_entry hw_prober_platforms[] = {
		.compatible = "google,hana",
		.prober = chromeos_i2c_component_prober,
		.data = &chromeos_i2c_probe_hana_trackpad,
	}, {
		.compatible = "google,spherion",
		.prober = chromeos_i2c_component_prober,
		.data = &chromeos_i2c_probe_hana_trackpad,
	}, {
		.compatible = "google,squirtle",
		.prober = chromeos_i2c_component_prober,
		.data = &chromeos_i2c_probe_dumb_trackpad,
	}, {
		.compatible = "google,squirtle",
		.prober = chromeos_i2c_component_prober,
		.data = &chromeos_i2c_probe_squirtle_touchscreen,
	}, {
		.compatible = "google,steelix",
		.prober = chromeos_i2c_component_prober,
		.data = &chromeos_i2c_probe_dumb_trackpad,
	}, {
		.compatible = "google,voltorb",
		.prober = chromeos_i2c_component_prober,
		.data = &chromeos_i2c_probe_dumb_trackpad,
	},
};

+20 −32
Original line number Diff line number Diff line
@@ -207,22 +207,15 @@ static ssize_t cros_ec_pdinfo_read(struct file *file,
	char read_buf[EC_USB_PD_MAX_PORTS * 40], *p = read_buf;
	struct cros_ec_debugfs *debug_info = file->private_data;
	struct cros_ec_device *ec_dev = debug_info->ec->ec_dev;
	struct {
		struct cros_ec_command msg;
		union {
			struct ec_response_usb_pd_control_v1 resp;
			struct ec_params_usb_pd_control params;
		};
	} __packed ec_buf;
	struct cros_ec_command *msg;
	struct ec_response_usb_pd_control_v1 *resp;
	struct ec_params_usb_pd_control *params;
	DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
			MAX(sizeof(struct ec_response_usb_pd_control_v1),
			    sizeof(struct ec_params_usb_pd_control)));
	struct ec_response_usb_pd_control_v1 *resp =
			(struct ec_response_usb_pd_control_v1 *)msg->data;
	struct ec_params_usb_pd_control *params =
			(struct ec_params_usb_pd_control *)msg->data;
	int i;

	msg = &ec_buf.msg;
	params = (struct ec_params_usb_pd_control *)msg->data;
	resp = (struct ec_response_usb_pd_control_v1 *)msg->data;

	msg->command = EC_CMD_USB_PD_CONTROL;
	msg->version = 1;
	msg->insize = sizeof(*resp);
@@ -253,17 +246,15 @@ static ssize_t cros_ec_pdinfo_read(struct file *file,

static bool cros_ec_uptime_is_supported(struct cros_ec_device *ec_dev)
{
	struct {
		struct cros_ec_command cmd;
		struct ec_response_uptime_info resp;
	} __packed msg = {};
	DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
			sizeof(struct ec_response_uptime_info));
	int ret;

	msg.cmd.command = EC_CMD_GET_UPTIME_INFO;
	msg.cmd.insize = sizeof(msg.resp);
	msg->command = EC_CMD_GET_UPTIME_INFO;
	msg->insize = sizeof(struct ec_response_uptime_info);

	ret = cros_ec_cmd_xfer_status(ec_dev, &msg.cmd);
	if (ret == -EPROTO && msg.cmd.result == EC_RES_INVALID_COMMAND)
	ret = cros_ec_cmd_xfer_status(ec_dev, msg);
	if (ret == -EPROTO && msg->result == EC_RES_INVALID_COMMAND)
		return false;

	/* Other errors maybe a transient error, do not rule about support. */
@@ -275,20 +266,17 @@ static ssize_t cros_ec_uptime_read(struct file *file, char __user *user_buf,
{
	struct cros_ec_debugfs *debug_info = file->private_data;
	struct cros_ec_device *ec_dev = debug_info->ec->ec_dev;
	struct {
		struct cros_ec_command cmd;
		struct ec_response_uptime_info resp;
	} __packed msg = {};
	struct ec_response_uptime_info *resp;
	DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
			sizeof(struct ec_response_uptime_info));
	struct ec_response_uptime_info *resp =
				(struct ec_response_uptime_info *)msg->data;
	char read_buf[32];
	int ret;

	resp = (struct ec_response_uptime_info *)&msg.resp;

	msg.cmd.command = EC_CMD_GET_UPTIME_INFO;
	msg.cmd.insize = sizeof(*resp);
	msg->command = EC_CMD_GET_UPTIME_INFO;
	msg->insize = sizeof(*resp);

	ret = cros_ec_cmd_xfer_status(ec_dev, &msg.cmd);
	ret = cros_ec_cmd_xfer_status(ec_dev, msg);
	if (ret < 0)
		return ret;

+11 −13
Original line number Diff line number Diff line
@@ -139,12 +139,10 @@ static int cros_ec_xfer_command(struct cros_ec_device *ec_dev, struct cros_ec_co

static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t *result)
{
	struct {
		struct cros_ec_command msg;
		struct ec_response_get_comms_status status;
	} __packed buf;
	struct cros_ec_command *msg = &buf.msg;
	struct ec_response_get_comms_status *status = &buf.status;
	DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
			sizeof(struct ec_response_get_comms_status));
	struct ec_response_get_comms_status *status =
			(struct ec_response_get_comms_status *)msg->data;
	int ret = 0, i;

	msg->version = 0;
@@ -757,16 +755,13 @@ static int get_next_event_xfer(struct cros_ec_device *ec_dev,

static int get_next_event(struct cros_ec_device *ec_dev)
{
	struct {
		struct cros_ec_command msg;
		struct ec_response_get_next_event_v3 event;
	} __packed buf;
	struct cros_ec_command *msg = &buf.msg;
	struct ec_response_get_next_event_v3 *event = &buf.event;
	DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
			sizeof(struct ec_response_get_next_event_v3));
	struct ec_response_get_next_event_v3 *event =
			(struct ec_response_get_next_event_v3 *)msg->data;
	int cmd_version = ec_dev->mkbp_event_supported - 1;
	u32 size;

	memset(msg, 0, sizeof(*msg));
	if (ec_dev->suspended) {
		dev_dbg(ec_dev->dev, "Device suspended.\n");
		return -EHOSTDOWN;
@@ -1157,3 +1152,6 @@ int cros_ec_get_cmd_versions(struct cros_ec_device *ec_dev, u16 cmd)
		return resp.version_mask;
}
EXPORT_SYMBOL_GPL(cros_ec_get_cmd_versions);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("ChromeOS EC communication protocol helpers");
Loading