Skip to content

Commit 482e39e

Browse files
committed
dts: nxp_lpi2c: Interrupts is no longer a required property
Some NXP SoC's have a FlexComm interface that manages the interrupts. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 49bdcd2 commit 482e39e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

drivers/i2c/i2c_mcux_lpi2c.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,19 @@ static const struct i2c_driver_api mcux_lpi2c_driver_api = {
556556
#define I2C_MCUX_LPI2C_SDA_INIT(n)
557557
#endif /* CONFIG_I2C_MCUX_LPI2C_BUS_RECOVERY */
558558

559+
#define I2C_MCUX_LPI2C_MODULE_IRQ_CONNECT(n) \
560+
do { \
561+
IRQ_CONNECT(DT_INST_IRQN(n), \
562+
DT_INST_IRQ(n, priority), \
563+
mcux_lpi2c_isr, \
564+
DEVICE_DT_INST_GET(n), 0); \
565+
irq_enable(DT_INST_IRQN(n)); \
566+
} while (false)
567+
568+
#define I2C_MCUX_LPI2C_MODULE_IRQ(n) \
569+
IF_ENABLED(DT_INST_IRQ_HAS_IDX(n, 0), \
570+
(I2C_MCUX_LPI2C_MODULE_IRQ_CONNECT(n)))
571+
559572
#define I2C_MCUX_LPI2C_INIT(n) \
560573
PINCTRL_DT_INST_DEFINE(n); \
561574
\
@@ -586,12 +599,7 @@ static const struct i2c_driver_api mcux_lpi2c_driver_api = {
586599
\
587600
static void mcux_lpi2c_config_func_##n(const struct device *dev) \
588601
{ \
589-
IRQ_CONNECT(DT_INST_IRQN(n), \
590-
DT_INST_IRQ(n, priority), \
591-
mcux_lpi2c_isr, \
592-
DEVICE_DT_INST_GET(n), 0); \
593-
\
594-
irq_enable(DT_INST_IRQN(n)); \
602+
I2C_MCUX_LPI2C_MODULE_IRQ(n); \
595603
}
596604

597605
DT_INST_FOREACH_STATUS_OKAY(I2C_MCUX_LPI2C_INIT)

dts/bindings/i2c/nxp,imx-lpi2c.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ properties:
1111
reg:
1212
required: true
1313

14-
interrupts:
15-
required: true
16-
1714
bus-idle-timeout:
1815
type: int
1916
description: Bus idle timeout in nanoseconds

0 commit comments

Comments
 (0)