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
10 changes: 6 additions & 4 deletions drivers/usb/dwc3/dwc3-apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,12 +1081,13 @@ static void dwc3_apple_check_hub_later(struct dwc3_apple *appledwc)
}

/*
* Waiting for a Type-C PHY that is not started after sleep is specific to the J714s.
* The notifier work and its admission rules apply to every board.
* Waiting for a Type-C PHY that is not started after sleep is specific to the T6050 boards
* whose port controllers take the sleep's power states (J714s, J716c). The notifier work
* and its admission rules apply to every board.
*/
static bool dwc3_apple_sleep_board(void)
{
return of_machine_is_compatible("apple,j714s");
return of_machine_is_compatible("apple,j714s") || of_machine_is_compatible("apple,j716c");
}

/*
Expand Down Expand Up @@ -1470,7 +1471,8 @@ static int dwc3_apple_recover(struct dwc3_apple *appledwc)
static bool dwc3_apple_tunnel_keep(struct dwc3_apple *appledwc)
{
lockdep_assert_held(&appledwc->lock);
if (appledwc->fixed_hub || !of_machine_is_compatible("apple,j714s") ||
if (appledwc->fixed_hub || !(of_machine_is_compatible("apple,j714s") ||
of_machine_is_compatible("apple,j716c")) ||
!of_device_is_compatible(appledwc->dev->of_node, "apple,t6050-dwc3") ||
dwc3_apple_tunnel_phy(appledwc, APPLE_T6050_CIO_USB_KEEP))
return false;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/typec/tipd/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ static int tps6598x_disconnect(struct tps6598x *tps, u32 status)
/*
* The sleep's rules for the port controllers' system power state command (the controller is
* woken first, the command's end is read at intervals, a failed S3 refuses the sleep, the
* command's limit and its lines) are in force on the board they have run on, the J714s.
* Elsewhere, other boards with the same SoC included, the command is as it was.
* command's limit and its lines) are in force on the T6050 boards that sleep, the J714s and
* the J716c. Elsewhere the command is as it was.
*/
static bool tipd_sleep_ssps_rules(void)
{
return of_machine_is_compatible("apple,j714s");
return of_machine_is_compatible("apple,j714s") || of_machine_is_compatible("apple,j716c");
}

/*
Expand Down
21 changes: 13 additions & 8 deletions drivers/usb/typec/tipd/spmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,18 @@ static bool sn201202x_sleep_event(struct tps6598x *tps)
}

/*
* On the J714s, the board the sleep has run on, the probe and the sleep's SLEEP command print a
* line; on every other machine they don't. A controller without a connector (the J714s's
* MagSafe one, hpm5) is probed as any other: it registers its Type-C port and power supply, and
* with apple,sleep-ssps it follows the system's sleep as the USB-C ports' controllers do (woken
* and switched to S3 at the prepare, SLEEP at the suspend, woken at the resume and switched to
* S0 at the complete).
* On the T6050 boards that sleep (J714s, J716c), the probe and the sleep's SLEEP command print a
* line; on every other machine they don't. A controller without a connector (the MagSafe one,
* hpm5) is probed as any other: it registers its Type-C port and power supply, and with
* apple,sleep-ssps it follows the system's sleep as the USB-C ports' controllers do (woken and
* switched to S3 at the prepare, SLEEP at the suspend, woken at the resume and switched to S0
* at the complete).
*/
static bool sn201202x_sleep_board(void)
{
return of_machine_is_compatible("apple,j714s") || of_machine_is_compatible("apple,j716c");
}

static bool sn201202x_j714s(void)
{
return of_machine_is_compatible("apple,j714s");
Expand Down Expand Up @@ -965,7 +970,7 @@ static int sn201202x_probe(struct spmi_device *device)
tps->data->irq_handler(tps->irq, tps);

sn201202x_idle_sleep_start(tps);
if (sn201202x_j714s())
if (sn201202x_sleep_board())
dev_info(tps->dev, "port controller ready%s\n", sn->polled ? ", polled" : "");
return 0;
}
Expand Down Expand Up @@ -1057,7 +1062,7 @@ VISIBLE_IF_KUNIT int __maybe_unused sn201202x_suspend(struct device *dev)
tipd_usb_wake(tps, true);
reinit_completion(&sn->sleep_completion);
err = spmi_command_sleep(sn->sdev);
if (pm_suspend_via_firmware() && sn201202x_j714s())
if (pm_suspend_via_firmware() && sn201202x_sleep_board())
dev_info(dev, "SLEEP: %d\n", err);
if (err)
goto out_resume;
Expand Down
Loading