Skip to content
Merged
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
12 changes: 3 additions & 9 deletions drivers/soc/apple/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -9032,18 +9032,14 @@ static void t8142_lower_io(struct apple_sleep *s)
* read RTC_CTL, 0x43 if it had fired, the 4-byte compare at 0x2008, 0x200e <- 0, RTC_CTL <-
* 0x41. T6050's post-timer step at the same addresses (apple,pmu-alarm-rearm 0x43 0x41). The
* opcode carries the byte count (his follow-up fix). The compare and the counter are read here,
* before the cores' window, with the notes. The compare stays the PMU's own unless
* apple_sleep.t8142_wake_s asks for a timed wake that many seconds after the commit (a test
* knob: J815 has no RTC device under Linux, so nothing else arms one). By default a sleep
* lasts until a key, the trackpad, the lid or the power button wakes it.
* before the cores' window, with the notes, and the compare is written back as read: a sleep
* lasts until a key, the trackpad, the lid, the power button or an alarm already in the
* compare wakes it.
* J813 still resets with it (PMU took all four commands), so this is parity, not the fix.
*/
static bool sleep_pmu_alarm = true;
module_param_named(pmu_alarm, sleep_pmu_alarm, bool, 0644);
MODULE_PARM_DESC(pmu_alarm, "T8142: send the PMU's RTC alarm after the S2R timer, as macOS does (default Y)");
static unsigned int t8142_wake_s;
module_param(t8142_wake_s, uint, 0644);
MODULE_PARM_DESC(t8142_wake_s, "T8142 test: wake this many s after the commit (default 0: no timed wake, the PMU's compare stays)");
static u8 t8142_alarm[4];
static bool t8142_alarm_ok;
static int t8142_post_ret = -ENODATA;
Expand All @@ -9068,8 +9064,6 @@ static void t8142_alarm_prepare(struct apple_sleep *s)
if (!t8142_pmu(s, mask, T6050_SPMI_EXT_READL, T6050_RTC_COMPARE, NULL, t8142_alarm, 4) &&
!t8142_pmu(s, mask, T6050_SPMI_EXT_READL, T6050_RTC_COUNTER, NULL, ticks, 6)) {
t8142_alarm_counter = get_unaligned_le64(ticks) >> 16;
if (READ_ONCE(t8142_wake_s))
put_unaligned_le32(t8142_alarm_counter + READ_ONCE(t8142_wake_s), t8142_alarm);
t8142_alarm_ok = true;
}
t6050_sleep_pmu_drain(s);
Expand Down
Loading