Commit 86aa7218 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

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

Pull chrome platform updates from Tzung-Bi Shih:
 "New:
   - Support ECC in chromeos_pstore
   - Allow to control power and data role via sysfs in cros_ec_typec

  Improvements:
   - Defer probe when the dependencies are not ready in cros_ec_typec
   - Retry when a sensor is not ready in cros_ec_sensorhub

  Fixes:
   - Unregister the blocking notifier as well when unregistering the
     struct cros_ec_device.

  Cleanups:
   - Remove redundant code and leverage more suitable helper macro in
     chromeos_laptop
   - Fix typo"

* tag 'chrome-platform-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: Fix typo in CROS_USBPD_NOTIFY help text
  platform/chrome: cros_ec_typec: Check ec platform device pointer
  platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()
  platform/chrome: cros_ec_typec: Add role swap ops
  platform/chrome: chromeos_laptop: Replace open coded variant of DEFINE_RES_IRQ()
  platform/chrome: chromeos_laptop: Remove duplicate check
  platform/chrome: cros_ec_sensorhub: Retries when a sensor is not ready
  platform/chrome: chromeos_pstore: Add ecc_size module parameter
  platform/chrome: cros_ec_typec: Defer probe on missing EC parent
parents 9669b249 cc2d5b72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ config CROS_USBPD_NOTIFY
	default MFD_CROS_EC_DEV
	help
	  If you say Y here, you get support for Type-C PD event notifications
	  from the ChromeOS EC. On ACPI platorms this driver will bind to the
	  from the ChromeOS EC. On ACPI platforms this driver will bind to the
	  GOOG0003 ACPI device, and on platforms which don't have this device it
	  will get initialized on ECs which support the feature
	  EC_FEATURE_USB_PD.
+4 −5
Original line number Diff line number Diff line
@@ -726,9 +726,9 @@ static int __init chromeos_laptop_setup_irq(struct i2c_peripheral *i2c_dev)
		if (irq < 0)
			return irq;

		i2c_dev->irq_resource  = (struct resource)
			DEFINE_RES_NAMED(irq, 1, NULL,
					 IORESOURCE_IRQ | i2c_dev->irqflags);
		i2c_dev->irq_resource = DEFINE_RES_IRQ(irq);
		i2c_dev->irq_resource.flags |= i2c_dev->irqflags;

		i2c_dev->board_info.resources = &i2c_dev->irq_resource;
		i2c_dev->board_info.num_resources = 1;
	}
@@ -782,7 +782,6 @@ chromeos_laptop_prepare_i2c_peripherals(struct chromeos_laptop *cros_laptop,
	while (--i >= 0) {
		i2c_dev = &i2c_peripherals[i];
		info = &i2c_dev->board_info;
		if (!IS_ERR_OR_NULL(info->fwnode))
		fwnode_remove_software_node(info->fwnode);
	}
	kfree(i2c_peripherals);
+7 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@
#include <linux/platform_device.h>
#include <linux/pstore_ram.h>

static int ecc_size;
module_param(ecc_size, int, 0400);
MODULE_PARM_DESC(ecc_size, "ECC parity data size in bytes. A positive value enables ECC for the ramoops region.");

static const struct dmi_system_id chromeos_pstore_dmi_table[] __initconst = {
	{
		/*
@@ -117,6 +121,9 @@ static int __init chromeos_pstore_init(void)
{
	bool acpi_dev_found;

	if (ecc_size > 0)
		chromeos_ramoops_data.ecc_info.ecc_size = ecc_size;

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

+3 −0
Original line number Diff line number Diff line
@@ -318,6 +318,9 @@ EXPORT_SYMBOL(cros_ec_register);
 */
void cros_ec_unregister(struct cros_ec_device *ec_dev)
{
	if (ec_dev->mkbp_event_supported)
		blocking_notifier_chain_unregister(&ec_dev->event_notifier,
						   &ec_dev->notifier_ready);
	platform_device_unregister(ec_dev->pd);
	platform_device_unregister(ec_dev->ec);
	mutex_destroy(&ec_dev->lock);
+19 −4
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

#include <linux/init.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_data/cros_ec_commands.h>
@@ -18,6 +19,7 @@
#include <linux/types.h>

#define DRV_NAME		"cros-ec-sensorhub"
#define CROS_EC_CMD_INFO_RETRIES 50

static void cros_ec_sensorhub_free_sensor(void *arg)
{
@@ -53,7 +55,7 @@ static int cros_ec_sensorhub_register(struct device *dev,
	int sensor_type[MOTIONSENSE_TYPE_MAX] = { 0 };
	struct cros_ec_command *msg = sensorhub->msg;
	struct cros_ec_dev *ec = sensorhub->ec;
	int ret, i;
	int ret, i, retries;
	char *name;


@@ -65,12 +67,25 @@ static int cros_ec_sensorhub_register(struct device *dev,
		sensorhub->params->cmd = MOTIONSENSE_CMD_INFO;
		sensorhub->params->info.sensor_num = i;

		retries = CROS_EC_CMD_INFO_RETRIES;
		do {
			ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg);
			if (ret == -EBUSY) {
				/* The EC is still busy initializing sensors. */
				usleep_range(5000, 6000);
				retries--;
			}
		} while (ret == -EBUSY && retries);

		if (ret < 0) {
			dev_warn(dev, "no info for EC sensor %d : %d/%d\n",
			dev_err(dev, "no info for EC sensor %d : %d/%d\n",
				i, ret, msg->result);
			continue;
		}
		if (retries < CROS_EC_CMD_INFO_RETRIES) {
			dev_warn(dev, "%d retries needed to bring up sensor %d\n",
				 CROS_EC_CMD_INFO_RETRIES - retries, i);
		}

		switch (sensorhub->resp->info.type) {
		case MOTIONSENSE_TYPE_ACCEL:
Loading