drivers: video: video_mcux_csi: enable pinctrl
Enable pinctrl for mcux_csi video driver Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
parent
459495aa84
commit
108188312d
2 changed files with 12 additions and 1 deletions
|
@ -15,10 +15,12 @@
|
|||
#endif
|
||||
|
||||
#include <drivers/video.h>
|
||||
#include <drivers/pinctrl.h>
|
||||
|
||||
struct video_mcux_csi_config {
|
||||
CSI_Type *base;
|
||||
char *sensor_label;
|
||||
const struct pinctrl_dev_config *pincfg;
|
||||
};
|
||||
|
||||
struct video_mcux_csi_data {
|
||||
|
@ -359,6 +361,7 @@ static int video_mcux_csi_init(const struct device *dev)
|
|||
{
|
||||
const struct video_mcux_csi_config *config = dev->config;
|
||||
struct video_mcux_csi_data *data = dev->data;
|
||||
int err;
|
||||
|
||||
k_fifo_init(&data->fifo_in);
|
||||
k_fifo_init(&data->fifo_out);
|
||||
|
@ -373,6 +376,11 @@ static int video_mcux_csi_init(const struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
err = pinctrl_apply_state(config->pincfg, PINCTRL_STATE_DEFAULT);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -410,9 +418,12 @@ static const struct video_driver_api video_mcux_csi_driver_api = {
|
|||
};
|
||||
|
||||
#if 1 /* Unique Instance */
|
||||
PINCTRL_DT_INST_DEFINE(0);
|
||||
|
||||
static const struct video_mcux_csi_config video_mcux_csi_config_0 = {
|
||||
.base = (CSI_Type *)DT_INST_REG_ADDR(0),
|
||||
.sensor_label = DT_INST_PROP(0, sensor_label),
|
||||
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
|
||||
};
|
||||
|
||||
static struct video_mcux_csi_data video_mcux_csi_data_0;
|
||||
|
|
|
@ -8,7 +8,7 @@ description: NXP MCUX CMOS sensor interface
|
|||
|
||||
compatible: "nxp,imx-csi"
|
||||
|
||||
include: base.yaml
|
||||
include: [base.yaml, pinctrl-device.yaml]
|
||||
|
||||
properties:
|
||||
interrupts:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue