Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions drivers/thunderbolt/apple-cio-sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -895,16 +896,18 @@ 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;
}
ret = apple_nhi_cio_domains_t6050(anhi, after, ARRAY_SIZE(after), false);
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) {
Expand Down Expand Up @@ -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 */

Expand All @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion drivers/thunderbolt/apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/thunderbolt/retimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions drivers/thunderbolt/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
Loading