@@ -1620,65 +1620,63 @@ static void stm32_dcmipp_isr(const struct device *dev)
1620
1620
#define STM32_DCMIPP_CSI_DT_PARAMS (inst )
1621
1621
#endif
1622
1622
1623
- #define STM32_DCMIPP_INIT (inst ) \
1624
- static void stm32_dcmipp_irq_config_##inst(const struct device *dev) \
1625
- { \
1626
- IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), \
1627
- stm32_dcmipp_isr, DEVICE_DT_INST_GET(inst), 0); \
1628
- irq_enable(DT_INST_IRQN(inst)); \
1629
- } \
1630
- \
1631
- static struct stm32_dcmipp_data stm32_dcmipp_data_##inst = { \
1632
- .hdcmipp = { \
1633
- .Instance = (DCMIPP_TypeDef *)DT_INST_REG_ADDR(inst), \
1634
- }, \
1635
- .source_fmt = { \
1636
- .pixelformat = \
1637
- VIDEO_FOURCC_FROM_STR( \
1638
- CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT), \
1639
- .width = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH, \
1640
- .height = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \
1641
- }, \
1642
- }; \
1643
- \
1644
- PINCTRL_DT_INST_DEFINE(inst); \
1645
- \
1646
- static const struct stm32_dcmipp_config stm32_dcmipp_config_##inst = { \
1647
- .dcmipp_pclken = \
1648
- {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bus), \
1649
- .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bits)}, \
1650
- .dcmipp_pclken_ker = \
1651
- {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, bus), \
1652
- .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, bits)}, \
1653
- .irq_config = stm32_dcmipp_irq_config_##inst, \
1654
- .pctrl = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
1655
- .source_dev = SOURCE_DEV(inst), \
1656
- .reset_dcmipp = RESET_DT_SPEC_INST_GET_BY_IDX(inst, 0), \
1657
- .bus_type = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), bus_type, \
1658
- VIDEO_BUS_TYPE_PARALLEL), \
1659
- STM32_DCMIPP_CSI_DT_PARAMS(inst) \
1660
- .parallel.vs_polarity = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), \
1661
- vsync_active, 0) ? \
1662
- DCMIPP_VSPOLARITY_HIGH : \
1663
- DCMIPP_VSPOLARITY_LOW, \
1664
- .parallel.hs_polarity = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), \
1665
- hsync_active, 0) ? \
1666
- DCMIPP_HSPOLARITY_HIGH : \
1667
- DCMIPP_HSPOLARITY_LOW, \
1668
- .parallel.pck_polarity = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), \
1669
- pclk_sample, 0) ? \
1670
- DCMIPP_PCKPOLARITY_RISING : \
1671
- DCMIPP_PCKPOLARITY_FALLING, \
1672
- }; \
1673
- \
1674
- DEVICE_DT_INST_DEFINE(inst, &stm32_dcmipp_init, \
1675
- NULL, &stm32_dcmipp_data_##inst, \
1676
- &stm32_dcmipp_config_##inst, \
1677
- POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, \
1678
- NULL); \
1679
- \
1680
- DT_FOREACH_CHILD_VARGS(DT_INST_PORT_BY_ID(inst, 1), DCMIPP_PIPE_INIT_DEFINE, inst); \
1681
- \
1623
+ #define STM32_DCMIPP_INIT (inst ) \
1624
+ static void stm32_dcmipp_irq_config_##inst(const struct device *dev) \
1625
+ { \
1626
+ IRQ_CONNECT(DT_INST_IRQN(inst), DT_INST_IRQ(inst, priority), stm32_dcmipp_isr, \
1627
+ DEVICE_DT_INST_GET(inst), 0); \
1628
+ irq_enable(DT_INST_IRQN(inst)); \
1629
+ } \
1630
+ \
1631
+ static struct stm32_dcmipp_data stm32_dcmipp_data_##inst = { \
1632
+ .hdcmipp = \
1633
+ { \
1634
+ .Instance = (DCMIPP_TypeDef *)DT_INST_REG_ADDR(inst), \
1635
+ }, \
1636
+ .source_fmt = \
1637
+ { \
1638
+ .pixelformat = VIDEO_FOURCC_FROM_STR( \
1639
+ CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT), \
1640
+ .width = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH, \
1641
+ .height = CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT, \
1642
+ }, \
1643
+ }; \
1644
+ \
1645
+ PINCTRL_DT_INST_DEFINE(inst); \
1646
+ \
1647
+ static const struct stm32_dcmipp_config stm32_dcmipp_config_##inst = { \
1648
+ .dcmipp_pclken = {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bus), \
1649
+ .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp, bits)}, \
1650
+ .dcmipp_pclken_ker = {.bus = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, \
1651
+ bus), \
1652
+ .enr = DT_CLOCKS_CELL_BY_NAME(DT_DRV_INST(inst), dcmipp_ker, \
1653
+ bits)}, \
1654
+ .irq_config = stm32_dcmipp_irq_config_##inst, \
1655
+ .pctrl = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
1656
+ .source_dev = SOURCE_DEV(inst), \
1657
+ .reset_dcmipp = RESET_DT_SPEC_INST_GET_BY_IDX(inst, 0), \
1658
+ .bus_type = DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), bus_type, \
1659
+ VIDEO_BUS_TYPE_PARALLEL), \
1660
+ STM32_DCMIPP_CSI_DT_PARAMS(inst).parallel.vs_polarity = \
1661
+ DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), vsync_active, 0) \
1662
+ ? DCMIPP_VSPOLARITY_HIGH \
1663
+ : DCMIPP_VSPOLARITY_LOW, \
1664
+ .parallel.hs_polarity = \
1665
+ DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), hsync_active, 0) \
1666
+ ? DCMIPP_HSPOLARITY_HIGH \
1667
+ : DCMIPP_HSPOLARITY_LOW, \
1668
+ .parallel.pck_polarity = \
1669
+ DT_PROP_OR(DT_INST_ENDPOINT_BY_ID(inst, 0, 0), pclk_sample, 0) \
1670
+ ? DCMIPP_PCKPOLARITY_RISING \
1671
+ : DCMIPP_PCKPOLARITY_FALLING, \
1672
+ }; \
1673
+ \
1674
+ DEVICE_DT_INST_DEFINE(inst, &stm32_dcmipp_init, NULL, &stm32_dcmipp_data_##inst, \
1675
+ &stm32_dcmipp_config_##inst, POST_KERNEL, \
1676
+ CONFIG_VIDEO_INIT_PRIORITY, NULL); \
1677
+ \
1678
+ DT_FOREACH_CHILD_VARGS(DT_INST_CHILD(inst, pipes), DCMIPP_PIPE_INIT_DEFINE, inst); \
1679
+ \
1682
1680
VIDEO_DEVICE_DEFINE(dcmipp_##inst, DEVICE_DT_INST_GET(inst), SOURCE_DEV(inst));
1683
1681
1684
1682
DT_INST_FOREACH_STATUS_OKAY (STM32_DCMIPP_INIT )
0 commit comments