drivers: nxp_pint: Add power handlers for the NXP PINT driver
This is needed to restore state on wakeup from certain low power modes. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
parent
b694af6576
commit
dcad2e036e
2 changed files with 25 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/irq.h>
|
||||
#include <errno.h>
|
||||
#include <zephyr/drivers/interrupt_controller/nxp_pint.h>
|
||||
#include <zephyr/pm/device.h>
|
||||
|
||||
#include <fsl_inputmux.h>
|
||||
|
||||
|
@ -180,6 +181,24 @@ static void nxp_pint_isr(uint8_t *slot)
|
|||
}
|
||||
}
|
||||
|
||||
static int intc_nxp_pm_action(const struct device *dev, enum pm_device_action action)
|
||||
{
|
||||
switch (action) {
|
||||
case PM_DEVICE_ACTION_RESUME:
|
||||
break;
|
||||
case PM_DEVICE_ACTION_SUSPEND:
|
||||
break;
|
||||
case PM_DEVICE_ACTION_TURN_OFF:
|
||||
break;
|
||||
case PM_DEVICE_ACTION_TURN_ON:
|
||||
PINT_Init(pint_base);
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Defines PINT IRQ handler for a given irq index */
|
||||
#define NXP_PINT_IRQ(idx, node_id) \
|
||||
|
@ -200,10 +219,12 @@ static int intc_nxp_pint_init(const struct device *dev)
|
|||
* parameter.
|
||||
*/
|
||||
LISTIFY(8, NXP_PINT_IRQ, (;), DT_INST(0, DT_DRV_COMPAT));
|
||||
PINT_Init(pint_base);
|
||||
memset(pin_pint_id, NO_PINT_ID, ARRAY_SIZE(pin_pint_id));
|
||||
return 0;
|
||||
|
||||
return pm_device_driver_init(dev, intc_nxp_pm_action);
|
||||
}
|
||||
|
||||
DEVICE_DT_INST_DEFINE(0, intc_nxp_pint_init, NULL, NULL, NULL,
|
||||
PM_DEVICE_DT_INST_DEFINE(0, intc_nxp_pm_action);
|
||||
|
||||
DEVICE_DT_INST_DEFINE(0, intc_nxp_pint_init, PM_DEVICE_DT_INST_GET(0), NULL, NULL,
|
||||
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);
|
||||
|
|
|
@ -328,6 +328,7 @@
|
|||
<35 2>, <36 2>, <37 2>, <38 2>;
|
||||
num-lines = <8>;
|
||||
num-inputs = <64>;
|
||||
power-domains = <&power_mode3_domain>;
|
||||
};
|
||||
|
||||
imu: nxp_wifi {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue