1 // SPDX-License-Identifier: MIT
3 * Copyright(c) 2020 Intel Corporation.
9 #include "intel_pxp_irq.h"
10 #include "intel_pxp_pm.h"
11 #include "intel_pxp_session.h"
12 #include "intel_pxp_types.h"
14 void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
16 if (!intel_pxp_is_enabled(pxp))
21 intel_pxp_invalidate(pxp);
24 void intel_pxp_suspend(struct intel_pxp *pxp)
26 intel_wakeref_t wakeref;
28 if (!intel_pxp_is_enabled(pxp))
31 with_intel_runtime_pm(&pxp->ctrl_gt->i915->runtime_pm, wakeref) {
32 intel_pxp_fini_hw(pxp);
33 pxp->hw_state_invalidated = false;
37 void intel_pxp_resume_complete(struct intel_pxp *pxp)
39 if (!intel_pxp_is_enabled(pxp))
43 * The PXP component gets automatically unbound when we go into S3 and
44 * re-bound after we come out, so in that scenario we can defer the
45 * hw init to the bind call.
46 * NOTE: GSC-CS backend doesn't rely on components.
48 if (!HAS_ENGINE(pxp->ctrl_gt, GSC0) && !pxp->pxp_component)
51 intel_pxp_init_hw(pxp);
54 void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
56 if (!intel_pxp_is_enabled(pxp))
59 pxp->arb_is_valid = false;
61 intel_pxp_fini_hw(pxp);
63 pxp->hw_state_invalidated = false;