Skip to content

Commit 5d8497c

Browse files
drivers: mfd: nxp_lp_flexcomm: introduce clearirqhandler
Introduce clearirqhandler which clears the irq handler of a peripheral. Useful for device_deinit(). Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
1 parent fc663b9 commit 5d8497c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/mfd/mfd_nxp_lp_flexcomm.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ void nxp_lp_flexcomm_setirqhandler(const struct device *dev, const struct device
8181
child->dev = child_dev;
8282
}
8383

84+
void nxp_lp_flexcomm_clearirqhandler(const struct device *dev, LP_FLEXCOMM_PERIPH_T periph)
85+
{
86+
struct nxp_lp_flexcomm_data *data = dev->data;
87+
struct nxp_lp_flexcomm_child *child;
88+
89+
child = &data->children[periph];
90+
91+
/* Clear the interrupt handler and the child device node */
92+
child->lp_flexcomm_child_isr = NULL;
93+
child->dev = NULL;
94+
}
95+
8496
static int nxp_lp_flexcomm_init(const struct device *dev)
8597
{
8698
const struct nxp_lp_flexcomm_config *config = dev->config;

include/zephyr/drivers/mfd/nxp_lp_flexcomm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ typedef void (*child_isr_t)(const struct device *dev);
1313
void nxp_lp_flexcomm_setirqhandler(const struct device *dev, const struct device *child_dev,
1414
LP_FLEXCOMM_PERIPH_T periph, child_isr_t handler);
1515

16+
void nxp_lp_flexcomm_clearirqhandler(const struct device *dev, LP_FLEXCOMM_PERIPH_T periph);
17+
1618
#endif /* ZEPHYR_DRIVERS_NXP_LP_FLEXCOMM_H_ */

0 commit comments

Comments
 (0)