Browse Source

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>
pull/91255/head
Mahesh Mahadevan 2 months ago committed by Benjamin Cabé
parent
commit
dcad2e036e
  1. 27
      drivers/interrupt_controller/intc_nxp_pint.c
  2. 1
      dts/arm/nxp/nxp_rw6xx_common.dtsi

27
drivers/interrupt_controller/intc_nxp_pint.c

@ -10,6 +10,7 @@ @@ -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) @@ -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) @@ -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);

1
dts/arm/nxp/nxp_rw6xx_common.dtsi

@ -328,6 +328,7 @@ @@ -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…
Cancel
Save