diff --git a/drivers/thunderbolt/apple-cio-sleep.c b/drivers/thunderbolt/apple-cio-sleep.c index ba4d01e7f0732..d6ce8599a1ff5 100644 --- a/drivers/thunderbolt/apple-cio-sleep.c +++ b/drivers/thunderbolt/apple-cio-sleep.c @@ -323,7 +323,8 @@ static void apple_nhi_cio_phy_put(struct apple_nhi *anhi) static void apple_nhi_cio_usb_bind(struct apple_nhi *anhi, bool bind) { if (bind) { - if (!of_machine_is_compatible("apple,j714s")) + if (!(of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c"))) return; anhi->cio_phy_usb = symbol_get(apple_t6050_phy_cio_usb); if (anhi->cio_phy_usb) @@ -448,7 +449,7 @@ static int apple_nhi_cio_bind(struct apple_nhi *anhi) if (!cio_s2r) return 0; if (anhi->acio->hw == &apple_cio_t6050_hw && - of_machine_is_compatible("apple,j714s")) { + (of_machine_is_compatible("apple,j714s") || of_machine_is_compatible("apple,j716c"))) { ret = apple_nhi_cio_bind_owner_t6050(anhi); if (ret == -EPROBE_DEFER) return ret; @@ -895,8 +896,9 @@ static int apple_nhi_cio_power_off_t6050(struct apple_nhi *anhi) apple_cio_cpu_halt(acio); if (ret) return ret; - /* J714s holds LSTX high through sleep; do not read the halted rc block. */ - ret = apple_cio_lstx_hold(acio, of_machine_is_compatible("apple,j714s")); + /* J714s and J716c hold LSTX high through sleep; do not read the halted rc block. */ + ret = apple_cio_lstx_hold(acio, of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c")); if (ret) return ret; } @@ -904,7 +906,8 @@ static int apple_nhi_cio_power_off_t6050(struct apple_nhi *anhi) if (ret < 0) return ret; /* Held on by its DART: taken down here, before the PHY's shutdown, as macOS does. */ - if (ret && of_machine_is_compatible("apple,j714s")) { + if (ret && (of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c"))) { int down = apple_nhi_cio_router_pd_set(anhi, false); if (!down) { @@ -950,7 +953,7 @@ static int apple_nhi_cio_suspend_t6050(struct apple_nhi *anhi) * its DART's clock protection by now, as macOS does before this gate. A sleep refused * below powers it again here, before the PCIe-C port's resume starts the port from cold. */ - if (of_machine_is_compatible("apple,j714s")) { + if ((of_machine_is_compatible("apple,j714s") || of_machine_is_compatible("apple,j716c"))) { struct device *pd = anhi->acio->pd_list->pd_devs[apple_nhi_cio_tunnel_pd[0]]; int held, on, ps; /* TEST */ @@ -967,7 +970,8 @@ static int apple_nhi_cio_suspend_t6050(struct apple_nhi *anhi) if (ret) { /* TEST (J714s): the router is awake again: its tunnel's USB host comes off it first. */ apple_nhi_cio_usb_park(anhi, "after the refused sleep"); - if (of_machine_is_compatible("apple,j714s") && + if ((of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c")) && apple_nhi_cio_domains_t6050(anhi, apple_nhi_cio_tunnel_pd, ARRAY_SIZE(apple_nhi_cio_tunnel_pd), true) < 0) dev_err(anhi->dev, "T6050 sleep: the tunnelled PCIe's domain not back after the refused sleep: the PCIe-C port's resume follows all the same\n"); diff --git a/drivers/thunderbolt/apple.c b/drivers/thunderbolt/apple.c index be0c647b30de4..ac8e1a4205098 100644 --- a/drivers/thunderbolt/apple.c +++ b/drivers/thunderbolt/apple.c @@ -3988,7 +3988,8 @@ static int apple_cio_tbt_switch_set(struct typec_thunderbolt_switch_dev *sw, /* The T6050 firmware sleep, selected by the sleep driver's profile and mem_sleep. */ static bool apple_cio_t6050_sleep(struct apple_cio *acio) { - return of_machine_is_compatible("apple,j714s") && + return (of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c")) && READ_ONCE(t6050_sleep_teardown) && acio->hw == &apple_cio_t6050_hw && apple_sleep_v27_late() && !pm_suspend_default_s2idle(); } diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c index a93ae6a33bc37..39045b44a4a5a 100644 --- a/drivers/thunderbolt/retimer.c +++ b/drivers/thunderbolt/retimer.c @@ -507,7 +507,7 @@ static struct tb_retimer *tb_port_find_retimer(struct tb_port *port, u8 index) static bool tb_retimer_scan_skip(struct tb_port *port) { if (!(port->sw->tb->nhi->quirks & QUIRK_CIO_MACOS_FRAMES) || - !of_machine_is_compatible("apple,j714s")) + !(of_machine_is_compatible("apple,j714s") || of_machine_is_compatible("apple,j716c"))) return false; tb_port_info(port, "TEST sv6u5: no retimer scan on this link (macOS sends no retimer sideband operation)\n"); return true; diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 0aaec06be281e..99c28d6634a5d 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -3819,7 +3819,8 @@ static int tb_switch_sleep_cio_frames(struct tb_switch *sw) ret = usb4_switch_set_sleep(sw); tb_cio_test_dock.ready = ktime_get(); tb_cio_test_dock.ret = ret; - if (!ret && of_machine_is_compatible("apple,j714s")) + if (!ret && (of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c"))) msleep(TB_CIO_MACOS_HOST_AFTER_DOCK_MS); return ret; } @@ -4101,7 +4102,8 @@ int tb_switch_cio_pm_roles(struct tb_switch *sw) if (!parent || tb_route(parent) || !(parent->quirks & QUIRK_NO_CLX) || !(sw->tb->nhi->quirks & QUIRK_CIO_MACOS_FRAMES) || !tb_switch_is_usb4(parent) || - !tb_switch_is_usb4(sw) || !of_machine_is_compatible("apple,j714s")) + !tb_switch_is_usb4(sw) || !(of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c"))) return 0; /* TEST (sv6u3) */ tb_cio_test_roles_words(sw, &tb_cio_test_roles.down_was, &tb_cio_test_roles.up_was); @@ -4139,7 +4141,8 @@ int tb_switch_suspend_cio(struct tb_switch *sw) if (ret) return ret; if ((sw->tb->nhi->quirks & QUIRK_CIO_MACOS_FRAMES) && tb_switch_is_usb4(sw) && - !tb_route(sw) && of_machine_is_compatible("apple,j714s")) { + !tb_route(sw) && (of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c"))) { ret = tb_switch_cio_macos_host_state(sw); tb_cio_test_host.ret = ret; /* TEST */ if (ret)