Commit 1ef6663a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tag-chrome-platform-for-v6.5' of...

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

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

   - Support Pin Assignment D in getting mux state

   - Emit an uevent when EC panics so that userland programs get chance
     to capture EC coredumps (LPC interface only)

   - Send EC_CMD_HOST_SLEEP_EVENT to EC at the very beginning/end of
     system suspend/resume so that EC can watch the duration more
     accurately (LPC interface only)

  Misc:

   - Switch back from I2C .probe_new() to .probe()

   - Use %*ph for printing hexdump of small buffers"

* tag 'tag-chrome-platform-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: cros_ec_spi: Use %*ph for printing hexdump of a small buffer
  platform/chrome: Switch i2c drivers back to use .probe()
  platform/chrome: cros_ec_lpc: Move host command to prepare/complete
  platform/chrome: cros_ec: Report EC panic as uevent
  platform/chrome: cros_typec_switch: Add Pin D support
parents 8d7868c4 2b8cc585
...@@ -372,7 +372,7 @@ static struct i2c_driver cros_ec_driver = { ...@@ -372,7 +372,7 @@ static struct i2c_driver cros_ec_driver = {
.of_match_table = of_match_ptr(cros_ec_i2c_of_match), .of_match_table = of_match_ptr(cros_ec_i2c_of_match),
.pm = &cros_ec_i2c_pm_ops, .pm = &cros_ec_i2c_pm_ops,
}, },
.probe_new = cros_ec_i2c_probe, .probe = cros_ec_i2c_probe,
.remove = cros_ec_i2c_remove, .remove = cros_ec_i2c_remove,
.id_table = cros_ec_i2c_id, .id_table = cros_ec_i2c_id,
}; };
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kobject.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_data/cros_ec_commands.h> #include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h> #include <linux/platform_data/cros_ec_proto.h>
...@@ -315,6 +316,7 @@ static int cros_ec_lpc_readmem(struct cros_ec_device *ec, unsigned int offset, ...@@ -315,6 +316,7 @@ static int cros_ec_lpc_readmem(struct cros_ec_device *ec, unsigned int offset,
static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data) static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
{ {
static const char *env[] = { "ERROR=PANIC", NULL };
struct cros_ec_device *ec_dev = data; struct cros_ec_device *ec_dev = data;
bool ec_has_more_events; bool ec_has_more_events;
int ret; int ret;
...@@ -324,6 +326,7 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data) ...@@ -324,6 +326,7 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
if (value == ACPI_NOTIFY_CROS_EC_PANIC) { if (value == ACPI_NOTIFY_CROS_EC_PANIC) {
dev_emerg(ec_dev->dev, "CrOS EC Panic Reported. Shutdown is imminent!"); dev_emerg(ec_dev->dev, "CrOS EC Panic Reported. Shutdown is imminent!");
blocking_notifier_call_chain(&ec_dev->panic_notifier, 0, ec_dev); blocking_notifier_call_chain(&ec_dev->panic_notifier, 0, ec_dev);
kobject_uevent_env(&ec_dev->dev->kobj, KOBJ_CHANGE, (char **)env);
/* Begin orderly shutdown. Force shutdown after 1 second. */ /* Begin orderly shutdown. Force shutdown after 1 second. */
hw_protection_shutdown("CrOS EC Panic", 1000); hw_protection_shutdown("CrOS EC Panic", 1000);
/* Do not query for other events after a panic is reported */ /* Do not query for other events after a panic is reported */
...@@ -543,23 +546,25 @@ static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = { ...@@ -543,23 +546,25 @@ static const struct dmi_system_id cros_ec_lpc_dmi_table[] __initconst = {
MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table); MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int cros_ec_lpc_suspend(struct device *dev) static int cros_ec_lpc_prepare(struct device *dev)
{ {
struct cros_ec_device *ec_dev = dev_get_drvdata(dev); struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
return cros_ec_suspend(ec_dev); return cros_ec_suspend(ec_dev);
} }
static int cros_ec_lpc_resume(struct device *dev) static void cros_ec_lpc_complete(struct device *dev)
{ {
struct cros_ec_device *ec_dev = dev_get_drvdata(dev); struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
cros_ec_resume(ec_dev);
return cros_ec_resume(ec_dev);
} }
#endif #endif
static const struct dev_pm_ops cros_ec_lpc_pm_ops = { static const struct dev_pm_ops cros_ec_lpc_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume) #ifdef CONFIG_PM_SLEEP
.prepare = cros_ec_lpc_prepare,
.complete = cros_ec_lpc_complete
#endif
}; };
static struct platform_driver cros_ec_lpc_driver = { static struct platform_driver cros_ec_lpc_driver = {
......
...@@ -104,13 +104,7 @@ static void debug_packet(struct device *dev, const char *name, u8 *ptr, ...@@ -104,13 +104,7 @@ static void debug_packet(struct device *dev, const char *name, u8 *ptr,
int len) int len)
{ {
#ifdef DEBUG #ifdef DEBUG
int i; dev_dbg(dev, "%s: %*ph\n", name, len, ptr);
dev_dbg(dev, "%s: ", name);
for (i = 0; i < len; i++)
pr_cont(" %02x", ptr[i]);
pr_cont("\n");
#endif #endif
} }
......
...@@ -143,7 +143,7 @@ MODULE_DEVICE_TABLE(acpi, hps_acpi_id); ...@@ -143,7 +143,7 @@ MODULE_DEVICE_TABLE(acpi, hps_acpi_id);
#endif /* CONFIG_ACPI */ #endif /* CONFIG_ACPI */
static struct i2c_driver hps_i2c_driver = { static struct i2c_driver hps_i2c_driver = {
.probe_new = hps_i2c_probe, .probe = hps_i2c_probe,
.remove = hps_i2c_remove, .remove = hps_i2c_remove,
.id_table = hps_i2c_id, .id_table = hps_i2c_id,
.driver = { .driver = {
......
...@@ -51,13 +51,18 @@ static int cros_typec_cmd_mux_set(struct cros_typec_switch_data *sdata, int port ...@@ -51,13 +51,18 @@ static int cros_typec_cmd_mux_set(struct cros_typec_switch_data *sdata, int port
static int cros_typec_get_mux_state(unsigned long mode, struct typec_altmode *alt) static int cros_typec_get_mux_state(unsigned long mode, struct typec_altmode *alt)
{ {
int ret = -EOPNOTSUPP; int ret = -EOPNOTSUPP;
u8 pin_assign;
if (mode == TYPEC_STATE_SAFE) if (mode == TYPEC_STATE_SAFE) {
ret = USB_PD_MUX_SAFE_MODE; ret = USB_PD_MUX_SAFE_MODE;
else if (mode == TYPEC_STATE_USB) } else if (mode == TYPEC_STATE_USB) {
ret = USB_PD_MUX_USB_ENABLED; ret = USB_PD_MUX_USB_ENABLED;
else if (alt && alt->svid == USB_TYPEC_DP_SID) } else if (alt && alt->svid == USB_TYPEC_DP_SID) {
ret = USB_PD_MUX_DP_ENABLED; ret = USB_PD_MUX_DP_ENABLED;
pin_assign = mode - TYPEC_STATE_MODAL;
if (pin_assign & DP_PIN_ASSIGN_D)
ret |= USB_PD_MUX_USB_ENABLED;
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment