10
10
#include <zephyr/irq.h>
11
11
#include <errno.h>
12
12
#include <zephyr/drivers/interrupt_controller/nxp_pint.h>
13
+ #include <zephyr/pm/device.h>
13
14
14
15
#include <fsl_inputmux.h>
15
16
@@ -180,6 +181,24 @@ static void nxp_pint_isr(uint8_t *slot)
180
181
}
181
182
}
182
183
184
+ static int intc_nxp_pm_action (const struct device * dev , enum pm_device_action action )
185
+ {
186
+ switch (action ) {
187
+ case PM_DEVICE_ACTION_RESUME :
188
+ break ;
189
+ case PM_DEVICE_ACTION_SUSPEND :
190
+ break ;
191
+ case PM_DEVICE_ACTION_TURN_OFF :
192
+ break ;
193
+ case PM_DEVICE_ACTION_TURN_ON :
194
+ PINT_Init (pint_base );
195
+ break ;
196
+ default :
197
+ return - ENOTSUP ;
198
+ }
199
+
200
+ return 0 ;
201
+ }
183
202
184
203
/* Defines PINT IRQ handler for a given irq index */
185
204
#define NXP_PINT_IRQ (idx , node_id ) \
@@ -200,10 +219,12 @@ static int intc_nxp_pint_init(const struct device *dev)
200
219
* parameter.
201
220
*/
202
221
LISTIFY (8 , NXP_PINT_IRQ , (;), DT_INST (0 , DT_DRV_COMPAT ));
203
- PINT_Init (pint_base );
204
222
memset (pin_pint_id , NO_PINT_ID , ARRAY_SIZE (pin_pint_id ));
205
- return 0 ;
223
+
224
+ return pm_device_driver_init (dev , intc_nxp_pm_action );
206
225
}
207
226
208
- DEVICE_DT_INST_DEFINE (0 , intc_nxp_pint_init , NULL , NULL , NULL ,
227
+ PM_DEVICE_DT_INST_DEFINE (0 , intc_nxp_pm_action );
228
+
229
+ DEVICE_DT_INST_DEFINE (0 , intc_nxp_pint_init , PM_DEVICE_DT_INST_GET (0 ), NULL , NULL ,
209
230
PRE_KERNEL_1 , CONFIG_INTC_INIT_PRIORITY , NULL );
0 commit comments