Skip to content

Commit a405051

Browse files
0xFarahFlhenrikbrixandersen
authored andcommitted
drivers: video: mipi_csi2rx: Add set_ctrl callback
Add set_ctrl callback to propagate controls to the sensor. Signed-off-by: Farah Fliss <[email protected]> Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent f82b0d5 commit a405051

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/video/video_mcux_mipi_csi2rx.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,24 @@ static int mipi_csi2rx_get_caps(const struct device *dev, enum video_endpoint_id
180180
return video_get_caps(config->sensor_dev, ep, caps);
181181
}
182182

183+
static inline int mipi_csi2rx_set_ctrl(const struct device *dev, unsigned int cid, void *value)
184+
{
185+
const struct mipi_csi2rx_config *config = dev->config;
186+
187+
if (config->sensor_dev) {
188+
return video_set_ctrl(config->sensor_dev, cid, value);
189+
}
190+
191+
return -ENOTSUP;
192+
}
193+
183194
static const struct video_driver_api mipi_csi2rx_driver_api = {
184195
.get_caps = mipi_csi2rx_get_caps,
185196
.get_format = mipi_csi2rx_get_fmt,
186197
.set_format = mipi_csi2rx_set_fmt,
187198
.stream_start = mipi_csi2rx_stream_start,
188199
.stream_stop = mipi_csi2rx_stream_stop,
200+
.set_ctrl = mipi_csi2rx_set_ctrl,
189201
};
190202

191203
static int mipi_csi2rx_init(const struct device *dev)

0 commit comments

Comments
 (0)