Skip to content

Commit 1ef6663

Browse files
committed
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
2 parents 8d7868c + 2b8cc58 commit 1ef6663

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

drivers/platform/chrome/cros_ec_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static struct i2c_driver cros_ec_driver = {
372372
.of_match_table = of_match_ptr(cros_ec_i2c_of_match),
373373
.pm = &cros_ec_i2c_pm_ops,
374374
},
375-
.probe_new = cros_ec_i2c_probe,
375+
.probe = cros_ec_i2c_probe,
376376
.remove = cros_ec_i2c_remove,
377377
.id_table = cros_ec_i2c_id,
378378
};

drivers/platform/chrome/cros_ec_lpc.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/delay.h>
1717
#include <linux/io.h>
1818
#include <linux/interrupt.h>
19+
#include <linux/kobject.h>
1920
#include <linux/module.h>
2021
#include <linux/platform_data/cros_ec_commands.h>
2122
#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,
315316

316317
static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
317318
{
319+
static const char *env[] = { "ERROR=PANIC", NULL };
318320
struct cros_ec_device *ec_dev = data;
319321
bool ec_has_more_events;
320322
int ret;
@@ -324,6 +326,7 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
324326
if (value == ACPI_NOTIFY_CROS_EC_PANIC) {
325327
dev_emerg(ec_dev->dev, "CrOS EC Panic Reported. Shutdown is imminent!");
326328
blocking_notifier_call_chain(&ec_dev->panic_notifier, 0, ec_dev);
329+
kobject_uevent_env(&ec_dev->dev->kobj, KOBJ_CHANGE, (char **)env);
327330
/* Begin orderly shutdown. Force shutdown after 1 second. */
328331
hw_protection_shutdown("CrOS EC Panic", 1000);
329332
/* 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 = {
543546
MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table);
544547

545548
#ifdef CONFIG_PM_SLEEP
546-
static int cros_ec_lpc_suspend(struct device *dev)
549+
static int cros_ec_lpc_prepare(struct device *dev)
547550
{
548551
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
549552

550553
return cros_ec_suspend(ec_dev);
551554
}
552555

553-
static int cros_ec_lpc_resume(struct device *dev)
556+
static void cros_ec_lpc_complete(struct device *dev)
554557
{
555558
struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
556-
557-
return cros_ec_resume(ec_dev);
559+
cros_ec_resume(ec_dev);
558560
}
559561
#endif
560562

561563
static const struct dev_pm_ops cros_ec_lpc_pm_ops = {
562-
SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume)
564+
#ifdef CONFIG_PM_SLEEP
565+
.prepare = cros_ec_lpc_prepare,
566+
.complete = cros_ec_lpc_complete
567+
#endif
563568
};
564569

565570
static struct platform_driver cros_ec_lpc_driver = {

drivers/platform/chrome/cros_ec_spi.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,7 @@ static void debug_packet(struct device *dev, const char *name, u8 *ptr,
104104
int len)
105105
{
106106
#ifdef DEBUG
107-
int i;
108-
109-
dev_dbg(dev, "%s: ", name);
110-
for (i = 0; i < len; i++)
111-
pr_cont(" %02x", ptr[i]);
112-
113-
pr_cont("\n");
107+
dev_dbg(dev, "%s: %*ph\n", name, len, ptr);
114108
#endif
115109
}
116110

drivers/platform/chrome/cros_hps_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ MODULE_DEVICE_TABLE(acpi, hps_acpi_id);
143143
#endif /* CONFIG_ACPI */
144144

145145
static struct i2c_driver hps_i2c_driver = {
146-
.probe_new = hps_i2c_probe,
146+
.probe = hps_i2c_probe,
147147
.remove = hps_i2c_remove,
148148
.id_table = hps_i2c_id,
149149
.driver = {

drivers/platform/chrome/cros_typec_switch.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,18 @@ static int cros_typec_cmd_mux_set(struct cros_typec_switch_data *sdata, int port
5151
static int cros_typec_get_mux_state(unsigned long mode, struct typec_altmode *alt)
5252
{
5353
int ret = -EOPNOTSUPP;
54+
u8 pin_assign;
5455

55-
if (mode == TYPEC_STATE_SAFE)
56+
if (mode == TYPEC_STATE_SAFE) {
5657
ret = USB_PD_MUX_SAFE_MODE;
57-
else if (mode == TYPEC_STATE_USB)
58+
} else if (mode == TYPEC_STATE_USB) {
5859
ret = USB_PD_MUX_USB_ENABLED;
59-
else if (alt && alt->svid == USB_TYPEC_DP_SID)
60+
} else if (alt && alt->svid == USB_TYPEC_DP_SID) {
6061
ret = USB_PD_MUX_DP_ENABLED;
62+
pin_assign = mode - TYPEC_STATE_MODAL;
63+
if (pin_assign & DP_PIN_ASSIGN_D)
64+
ret |= USB_PD_MUX_USB_ENABLED;
65+
}
6166

6267
return ret;
6368
}

0 commit comments

Comments
 (0)