diff --git a/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml b/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml index 9e0847cb04b0a..2186802c66215 100644 --- a/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml +++ b/Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml @@ -258,6 +258,15 @@ patternProperties: switched with interrupts disabled. Setting the state takes a spinlock and polls the acknowledgment atomically. + apple,sleep-wakeup-path: + type: boolean + description: + The consumer of this entry can keep its firmware running through a + system sleep and is then on the wakeup path. The OS keeps the entry, + and the power states it is a child of, on through system sleep while + its consumer is on the wakeup path, as apple,sleep-wakeup-path does + for a PMGR power state. + required: - compatible - reg diff --git a/arch/arm64/boot/dts/apple/t6000.dtsi b/arch/arm64/boot/dts/apple/t6000.dtsi index 07ae672a27c96..07f20a5b445e2 100644 --- a/arch/arm64/boot/dts/apple/t6000.dtsi +++ b/arch/arm64/boot/dts/apple/t6000.dtsi @@ -85,6 +85,16 @@ reg-names = "report", "ane-dvfs"; }; +/* + * The external DCPs' firmware runs through s2idle and a sleep given up, and the DCP puts + * itself on the wakeup path for it. With APPLE_USE_PMP this entry is dcpext1's power domain: + * keep it, and the dispext1 power states under it, on then. dispext0's and disp0's entries + * have that from apple,always-on. + */ +&pmp_report_dispext1 { + apple,sleep-wakeup-path; +}; + #ifdef APPLE_USE_PMP /* * The video encoder, AVD, the JPEG codecs, the scaler and the ProRes codec diff --git a/drivers/pmdomain/apple/pmp-report.c b/drivers/pmdomain/apple/pmp-report.c index c790606badd8a..d24ac7c4f0f1c 100644 --- a/drivers/pmdomain/apple/pmp-report.c +++ b/drivers/pmdomain/apple/pmp-report.c @@ -3718,6 +3718,14 @@ static int apple_pmp_report_entry_probe(struct platform_device *pdev) ent->sleep_release = false; } } + /* + * A consumer whose firmware keeps running through a system sleep puts itself on the + * wakeup path, as a PMGR state's consumer does for apple,sleep-wakeup-path. Keep the + * entry on with it then, and with the entry its parent power states: powered off in the + * noirq phase, they would take the firmware's power while it runs. + */ + if (of_property_read_bool(node, "apple,sleep-wakeup-path")) + ent->genpd.flags |= GENPD_FLAG_ACTIVE_WAKEUP; ent->genpd.power_on = apple_pmp_report_entry_power_on; ent->genpd.power_off = apple_pmp_report_entry_power_off;