Skip to content

Commit c0f8658

Browse files
josuahnashif
authored andcommitted
drivers: video: accept VIDEO_EP_ALL where VIDEO_EP_IN/OUT is given
The current video drivers did not allow VIDEO_EP_ALL to be selected, as used by video_stream_stop(). This adds the VIDEO_EP_ALL to each video driver that filtered endpoints. Signed-off-by: Josuah Demangeon <[email protected]>
1 parent 9eb258c commit c0f8658

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

drivers/video/video_mcux_csi.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static int video_mcux_csi_set_fmt(const struct device *dev, enum video_endpoint_
155155
status_t ret;
156156
struct video_format format = *fmt;
157157

158-
if (!bpp || ep != VIDEO_EP_OUT) {
158+
if (bpp == 0 || (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL)) {
159159
return -EINVAL;
160160
}
161161

@@ -198,7 +198,7 @@ static int video_mcux_csi_get_fmt(const struct device *dev, enum video_endpoint_
198198
{
199199
const struct video_mcux_csi_config *config = dev->config;
200200

201-
if (fmt == NULL || ep != VIDEO_EP_OUT) {
201+
if (fmt == NULL || (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL)) {
202202
return -EINVAL;
203203
}
204204

@@ -288,7 +288,7 @@ static int video_mcux_csi_enqueue(const struct device *dev, enum video_endpoint_
288288
unsigned int to_read;
289289
status_t ret;
290290

291-
if (ep != VIDEO_EP_OUT) {
291+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
292292
return -EINVAL;
293293
}
294294

@@ -311,7 +311,7 @@ static int video_mcux_csi_dequeue(const struct device *dev, enum video_endpoint_
311311
{
312312
struct video_mcux_csi_data *data = dev->data;
313313

314-
if (ep != VIDEO_EP_OUT) {
314+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
315315
return -EINVAL;
316316
}
317317

@@ -355,7 +355,7 @@ static int video_mcux_csi_get_caps(const struct device *dev, enum video_endpoint
355355
const struct video_mcux_csi_config *config = dev->config;
356356
int err = -ENODEV;
357357

358-
if (ep != VIDEO_EP_OUT) {
358+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
359359
return -EINVAL;
360360
}
361361

drivers/video/video_mcux_mipi_csi2rx.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int mipi_csi2rx_get_fmt(const struct device *dev, enum video_endpoint_id
132132
{
133133
const struct mipi_csi2rx_config *config = dev->config;
134134

135-
if (fmt == NULL || ep != VIDEO_EP_OUT) {
135+
if (fmt == NULL || (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL)) {
136136
return -EINVAL;
137137
}
138138

@@ -175,7 +175,7 @@ static int mipi_csi2rx_get_caps(const struct device *dev, enum video_endpoint_id
175175
{
176176
const struct mipi_csi2rx_config *config = dev->config;
177177

178-
if (ep != VIDEO_EP_OUT) {
178+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
179179
return -EINVAL;
180180
}
181181

drivers/video/video_stm32_dcmi.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int video_stm32_dcmi_set_fmt(const struct device *dev,
215215
struct video_stm32_dcmi_data *data = dev->data;
216216
unsigned int bpp = video_pix_fmt_bpp(fmt->pixelformat);
217217

218-
if (!bpp || ep != VIDEO_EP_OUT) {
218+
if (bpp == 0 || (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL)) {
219219
return -EINVAL;
220220
}
221221

@@ -238,7 +238,7 @@ static int video_stm32_dcmi_get_fmt(const struct device *dev,
238238
struct video_stm32_dcmi_data *data = dev->data;
239239
const struct video_stm32_dcmi_config *config = dev->config;
240240

241-
if ((fmt == NULL) || (ep != VIDEO_EP_OUT)) {
241+
if (fmt == NULL || (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL)) {
242242
return -EINVAL;
243243
}
244244

@@ -310,7 +310,7 @@ static int video_stm32_dcmi_enqueue(const struct device *dev,
310310
struct video_stm32_dcmi_data *data = dev->data;
311311
const uint32_t buffer_size = data->pitch * data->height;
312312

313-
if (ep != VIDEO_EP_OUT) {
313+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
314314
return -EINVAL;
315315
}
316316

@@ -332,7 +332,7 @@ static int video_stm32_dcmi_dequeue(const struct device *dev,
332332
{
333333
struct video_stm32_dcmi_data *data = dev->data;
334334

335-
if (ep != VIDEO_EP_OUT) {
335+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
336336
return -EINVAL;
337337
}
338338

@@ -351,7 +351,7 @@ static int video_stm32_dcmi_get_caps(const struct device *dev,
351351
const struct video_stm32_dcmi_config *config = dev->config;
352352
int ret = -ENODEV;
353353

354-
if (ep != VIDEO_EP_OUT) {
354+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
355355
return -EINVAL;
356356
}
357357

drivers/video/video_sw_generator.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int video_sw_generator_set_fmt(const struct device *dev, enum video_endpo
5252
struct video_sw_generator_data *data = dev->data;
5353
int i = 0;
5454

55-
if (ep != VIDEO_EP_OUT) {
55+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
5656
return -EINVAL;
5757
}
5858

@@ -79,7 +79,7 @@ static int video_sw_generator_get_fmt(const struct device *dev, enum video_endpo
7979
{
8080
struct video_sw_generator_data *data = dev->data;
8181

82-
if (ep != VIDEO_EP_OUT) {
82+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
8383
return -EINVAL;
8484
}
8585

@@ -171,7 +171,7 @@ static int video_sw_generator_enqueue(const struct device *dev, enum video_endpo
171171
{
172172
struct video_sw_generator_data *data = dev->data;
173173

174-
if (ep != VIDEO_EP_OUT) {
174+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
175175
return -EINVAL;
176176
}
177177

@@ -185,7 +185,7 @@ static int video_sw_generator_dequeue(const struct device *dev, enum video_endpo
185185
{
186186
struct video_sw_generator_data *data = dev->data;
187187

188-
if (ep != VIDEO_EP_OUT) {
188+
if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) {
189189
return -EINVAL;
190190
}
191191

0 commit comments

Comments
 (0)