--- apple-m1-exp_v5.16-rc2_3-keyboard.patch-orig 2021-11-29 13:27:37.288419029 +0100 +++ apple-m1-exp_v5.16-rc2_3-keyboard.patch 2021-11-29 13:32:03.611947142 +0100 @@ -2119,118 +2119,6 @@ -- 2.34.0 - -From 2f69d10360532afabda159e8ecc9f8f14de4b3fc Mon Sep 17 00:00:00 2001 -From: Hector Martin -Date: Wed, 10 Nov 2021 19:38:21 +0900 -Subject: [PATCH 13/83] usb: typec: tipd: Fix typo in cd321x_switch_power_state - -SPSS -> SSPS - -Signed-off-by: Hector Martin ---- - drivers/usb/typec/tipd/core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c -index fb8ef12bbe9c..4da5a0b2aed2 100644 ---- a/drivers/usb/typec/tipd/core.c -+++ b/drivers/usb/typec/tipd/core.c -@@ -653,7 +653,7 @@ static int cd321x_switch_power_state(struct tps6598x *tps, u8 target_state) - if (state == target_state) - return 0; - -- ret = tps6598x_exec_cmd(tps, "SPSS", sizeof(u8), &target_state, 0, NULL); -+ ret = tps6598x_exec_cmd(tps, "SSPS", sizeof(u8), &target_state, 0, NULL); - if (ret) - return ret; - --- -2.34.0 - - -From 7af4ef002c5344684b7dc24e0ebab31eda0dba52 Mon Sep 17 00:00:00 2001 -From: Hector Martin -Date: Wed, 10 Nov 2021 19:41:06 +0900 -Subject: [PATCH 14/83] usb: typec: tipd: Fix initialization sequence for - cd321x - -Power state switch needs to happen first, as that kickstarts the -firmware. - -Signed-off-by: Hector Martin ---- - drivers/usb/typec/tipd/core.c | 33 ++++++++++++++++----------------- - 1 file changed, 16 insertions(+), 17 deletions(-) - -diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c -index 4da5a0b2aed2..6d27a5b5e3ca 100644 ---- a/drivers/usb/typec/tipd/core.c -+++ b/drivers/usb/typec/tipd/core.c -@@ -707,6 +707,7 @@ static int tps6598x_probe(struct i2c_client *client) - u32 conf; - u32 vid; - int ret; -+ u64 mask1; - - tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); - if (!tps) -@@ -730,11 +731,6 @@ static int tps6598x_probe(struct i2c_client *client) - if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) - tps->i2c_protocol = true; - -- /* Make sure the controller has application firmware running */ -- ret = tps6598x_check_mode(tps); -- if (ret) -- return ret; -- - if (np && of_device_is_compatible(np, "apple,cd321x")) { - /* Switch CD321X chips to the correct system power state */ - ret = cd321x_switch_power_state(tps, TPS_SYSTEM_POWER_STATE_S0); -@@ -742,24 +738,27 @@ static int tps6598x_probe(struct i2c_client *client) - return ret; - - /* CD321X chips have all interrupts masked initially */ -- ret = tps6598x_write64(tps, TPS_REG_INT_MASK1, -- APPLE_CD_REG_INT_POWER_STATUS_UPDATE | -- APPLE_CD_REG_INT_DATA_STATUS_UPDATE | -- APPLE_CD_REG_INT_PLUG_EVENT); -- if (ret) -- return ret; -+ mask1 = APPLE_CD_REG_INT_POWER_STATUS_UPDATE | -+ APPLE_CD_REG_INT_DATA_STATUS_UPDATE | -+ APPLE_CD_REG_INT_PLUG_EVENT; - - irq_handler = cd321x_interrupt; - } else { - /* Enable power status, data status and plug event interrupts */ -- ret = tps6598x_write64(tps, TPS_REG_INT_MASK1, -- TPS_REG_INT_POWER_STATUS_UPDATE | -- TPS_REG_INT_DATA_STATUS_UPDATE | -- TPS_REG_INT_PLUG_EVENT); -- if (ret) -- return ret; -+ mask1 = TPS_REG_INT_POWER_STATUS_UPDATE | -+ TPS_REG_INT_DATA_STATUS_UPDATE | -+ TPS_REG_INT_PLUG_EVENT; - } - -+ /* Make sure the controller has application firmware running */ -+ ret = tps6598x_check_mode(tps); -+ if (ret) -+ return ret; -+ -+ ret = tps6598x_write64(tps, TPS_REG_INT_MASK1, mask1); -+ if (ret) -+ return ret; -+ - ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); - if (ret < 0) - return ret; --- -2.34.0 - - From 095726770a814fec0f8a7f9dbf3f326dfdb29bce Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Wed, 10 Nov 2021 18:59:46 +0900