1 // SPDX-License-Identifier: MIT
3 * Copyright(c) 2020 Intel Corporation.
7 #include "intel_pxp_irq.h"
8 #include "intel_pxp_pm.h"
9 #include "intel_pxp_session.h"
12 void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
14 if (!intel_pxp_is_enabled(pxp))
17 pxp->arb_is_valid = false;
19 intel_pxp_invalidate(pxp);
22 void intel_pxp_suspend(struct intel_pxp *pxp)
24 intel_wakeref_t wakeref;
26 if (!intel_pxp_is_enabled(pxp))
29 with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
30 intel_pxp_fini_hw(pxp);
31 pxp->hw_state_invalidated = false;
35 void intel_pxp_resume(struct intel_pxp *pxp)
37 if (!intel_pxp_is_enabled(pxp))
41 * The PXP component gets automatically unbound when we go into S3 and
42 * re-bound after we come out, so in that scenario we can defer the
43 * hw init to the bind call.
45 if (!pxp->pxp_component)
48 intel_pxp_init_hw(pxp);
51 void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
53 if (!intel_pxp_is_enabled(pxp))
56 pxp->arb_is_valid = false;
58 intel_pxp_fini_hw(pxp);
60 pxp->hw_state_invalidated = false;