Skip to content

Commit 122424b

Browse files
committed
drivers: video: Drop video_endpoint_id
The video endpoints are already described in the devicetree. The video_endpoint_id parameter in each video API is not necessary and has no usage. Drop it. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent a1c16bb commit 122424b

File tree

21 files changed

+221
-492
lines changed

21 files changed

+221
-492
lines changed

doc/releases/migration-guide-4.2.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ Video
501501
``VIDEO_PIX_FMT_GRBG8`` becomes ``VIDEO_PIX_FMT_SGRBG8``
502502
``VIDEO_PIX_FMT_RGGB8`` becomes ``VIDEO_PIX_FMT_SRGGB8``
503503

504+
* video_endpoint_id enum has been dropped. It is no longer a parameter in any video API.
505+
504506
Other subsystems
505507
****************
506508

drivers/video/gc2145.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,7 @@ static uint8_t gc2145_check_connection(const struct device *dev)
10401040
return 0;
10411041
}
10421042

1043-
static int gc2145_set_fmt(const struct device *dev, enum video_endpoint_id ep,
1044-
struct video_format *fmt)
1043+
static int gc2145_set_fmt(const struct device *dev, struct video_format *fmt)
10451044
{
10461045
struct gc2145_data *drv_data = dev->data;
10471046
size_t res = ARRAY_SIZE(fmts);
@@ -1085,8 +1084,7 @@ static int gc2145_set_fmt(const struct device *dev, enum video_endpoint_id ep,
10851084
return 0;
10861085
}
10871086

1088-
static int gc2145_get_fmt(const struct device *dev, enum video_endpoint_id ep,
1089-
struct video_format *fmt)
1087+
static int gc2145_get_fmt(const struct device *dev, struct video_format *fmt)
10901088
{
10911089
struct gc2145_data *drv_data = dev->data;
10921090

@@ -1103,8 +1101,7 @@ static int gc2145_set_stream(const struct device *dev, bool enable)
11031101
: gc2145_write_reg(&cfg->i2c, 0xf2, 0x00);
11041102
}
11051103

1106-
static int gc2145_get_caps(const struct device *dev, enum video_endpoint_id ep,
1107-
struct video_caps *caps)
1104+
static int gc2145_get_caps(const struct device *dev, struct video_caps *caps)
11081105
{
11091106
caps->format_caps = fmts;
11101107
return 0;
@@ -1188,7 +1185,7 @@ static int gc2145_init(const struct device *dev)
11881185
fmt.height = RESOLUTION_QVGA_H;
11891186
fmt.pitch = RESOLUTION_QVGA_W * 2;
11901187

1191-
ret = gc2145_set_fmt(dev, VIDEO_EP_OUT, &fmt);
1188+
ret = gc2145_set_fmt(dev, &fmt);
11921189
if (ret) {
11931190
LOG_ERR("Unable to configure default format");
11941191
return ret;

drivers/video/mt9m114.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ static int mt9m114_set_output_format(const struct device *dev, int pixel_format)
397397
return ret;
398398
}
399399

400-
static int mt9m114_set_fmt(const struct device *dev, enum video_endpoint_id ep,
401-
struct video_format *fmt)
400+
static int mt9m114_set_fmt(const struct device *dev, struct video_format *fmt)
402401
{
403402
struct mt9m114_data *drv_data = dev->data;
404403
int ret;
@@ -450,8 +449,7 @@ static int mt9m114_set_fmt(const struct device *dev, enum video_endpoint_id ep,
450449
return mt9m114_set_state(dev, MT9M114_SYS_STATE_ENTER_CONFIG_CHANGE);
451450
}
452451

453-
static int mt9m114_get_fmt(const struct device *dev, enum video_endpoint_id ep,
454-
struct video_format *fmt)
452+
static int mt9m114_get_fmt(const struct device *dev, struct video_format *fmt)
455453
{
456454
struct mt9m114_data *drv_data = dev->data;
457455

@@ -466,8 +464,7 @@ static int mt9m114_set_stream(const struct device *dev, bool enable)
466464
: mt9m114_set_state(dev, MT9M114_SYS_STATE_ENTER_SUSPEND);
467465
}
468466

469-
static int mt9m114_get_caps(const struct device *dev, enum video_endpoint_id ep,
470-
struct video_caps *caps)
467+
static int mt9m114_get_caps(const struct device *dev, struct video_caps *caps)
471468
{
472469
caps->format_caps = fmts;
473470
return 0;
@@ -563,7 +560,7 @@ static int mt9m114_init(const struct device *dev)
563560
fmt.height = 272;
564561
fmt.pitch = fmt.width * 2;
565562

566-
ret = mt9m114_set_fmt(dev, VIDEO_EP_OUT, &fmt);
563+
ret = mt9m114_set_fmt(dev, &fmt);
567564
if (ret) {
568565
LOG_ERR("Unable to configure default format");
569566
return -EIO;

drivers/video/ov2640.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,7 @@ uint8_t ov2640_check_connection(const struct device *dev)
829829
return ret;
830830
}
831831

832-
static int ov2640_set_fmt(const struct device *dev,
833-
enum video_endpoint_id ep, struct video_format *fmt)
832+
static int ov2640_set_fmt(const struct device *dev, struct video_format *fmt)
834833
{
835834
struct ov2640_data *drv_data = dev->data;
836835
uint16_t width, height;
@@ -872,8 +871,7 @@ static int ov2640_set_fmt(const struct device *dev,
872871
return -ENOTSUP;
873872
}
874873

875-
static int ov2640_get_fmt(const struct device *dev,
876-
enum video_endpoint_id ep, struct video_format *fmt)
874+
static int ov2640_get_fmt(const struct device *dev, struct video_format *fmt)
877875
{
878876
struct ov2640_data *drv_data = dev->data;
879877

@@ -887,9 +885,7 @@ static int ov2640_set_stream(const struct device *dev, bool enable)
887885
return 0;
888886
}
889887

890-
static int ov2640_get_caps(const struct device *dev,
891-
enum video_endpoint_id ep,
892-
struct video_caps *caps)
888+
static int ov2640_get_caps(const struct device *dev, struct video_caps *caps)
893889
{
894890
caps->format_caps = fmts;
895891
return 0;
@@ -1037,7 +1033,7 @@ static int ov2640_init(const struct device *dev)
10371033
fmt.width = SVGA_HSIZE;
10381034
fmt.height = SVGA_VSIZE;
10391035
fmt.pitch = SVGA_HSIZE * 2;
1040-
ret = ov2640_set_fmt(dev, VIDEO_EP_OUT, &fmt);
1036+
ret = ov2640_set_fmt(dev, &fmt);
10411037
if (ret) {
10421038
LOG_ERR("Unable to configure default format");
10431039
return -EIO;

drivers/video/ov5640.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,7 @@ static int ov5640_set_fmt_dvp(const struct ov5640_config *cfg)
767767
return 0;
768768
}
769769

770-
static int ov5640_set_frmival(const struct device *dev, enum video_endpoint_id ep,
771-
struct video_frmival *frmival)
770+
static int ov5640_set_frmival(const struct device *dev, struct video_frmival *frmival)
772771
{
773772
const struct ov5640_config *cfg = dev->config;
774773
struct ov5640_data *drv_data = dev->data;
@@ -823,8 +822,7 @@ static int ov5640_set_frmival(const struct device *dev, enum video_endpoint_id e
823822
return 0;
824823
}
825824

826-
static int ov5640_set_fmt(const struct device *dev, enum video_endpoint_id ep,
827-
struct video_format *fmt)
825+
static int ov5640_set_fmt(const struct device *dev, struct video_format *fmt)
828826
{
829827
struct ov5640_data *drv_data = dev->data;
830828
const struct ov5640_config *cfg = dev->config;
@@ -906,11 +904,10 @@ static int ov5640_set_fmt(const struct device *dev, enum video_endpoint_id ep,
906904
def_frmival.denominator = drv_data->cur_mode->def_frmrate;
907905
def_frmival.numerator = 1;
908906

909-
return ov5640_set_frmival(dev, ep, &def_frmival);
907+
return ov5640_set_frmival(dev, &def_frmival);
910908
}
911909

912-
static int ov5640_get_fmt(const struct device *dev, enum video_endpoint_id ep,
913-
struct video_format *fmt)
910+
static int ov5640_get_fmt(const struct device *dev, struct video_format *fmt)
914911
{
915912
struct ov5640_data *drv_data = dev->data;
916913

@@ -919,8 +916,7 @@ static int ov5640_get_fmt(const struct device *dev, enum video_endpoint_id ep,
919916
return 0;
920917
}
921918

922-
static int ov5640_get_caps(const struct device *dev, enum video_endpoint_id ep,
923-
struct video_caps *caps)
919+
static int ov5640_get_caps(const struct device *dev, struct video_caps *caps)
924920
{
925921
caps->format_caps = ov5640_is_dvp(dev) ? dvp_fmts : csi2_fmts;
926922
return 0;
@@ -1177,8 +1173,7 @@ static int ov5640_get_volatile_ctrl(const struct device *dev, uint32_t id)
11771173
return 0;
11781174
}
11791175

1180-
static int ov5640_get_frmival(const struct device *dev, enum video_endpoint_id ep,
1181-
struct video_frmival *frmival)
1176+
static int ov5640_get_frmival(const struct device *dev, struct video_frmival *frmival)
11821177
{
11831178
struct ov5640_data *drv_data = dev->data;
11841179

@@ -1192,8 +1187,7 @@ static int ov5640_get_frmival(const struct device *dev, enum video_endpoint_id e
11921187
return 0;
11931188
}
11941189

1195-
static int ov5640_enum_frmival(const struct device *dev, enum video_endpoint_id ep,
1196-
struct video_frmival_enum *fie)
1190+
static int ov5640_enum_frmival(const struct device *dev, struct video_frmival_enum *fie)
11971191
{
11981192
uint8_t i = 0;
11991193

@@ -1430,7 +1424,7 @@ static int ov5640_init(const struct device *dev)
14301424
fmt.height = 720;
14311425
}
14321426
fmt.pitch = fmt.width * 2;
1433-
ret = ov5640_set_fmt(dev, VIDEO_EP_OUT, &fmt);
1427+
ret = ov5640_set_fmt(dev, &fmt);
14341428
if (ret) {
14351429
LOG_ERR("Unable to configure default format");
14361430
return -EIO;

drivers/video/ov7670.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,13 @@ static const struct ov7670_reg ov7670_init_regtbl[] = {
353353
{0xb8, 0x0a},
354354
};
355355

356-
static int ov7670_get_caps(const struct device *dev, enum video_endpoint_id ep,
357-
struct video_caps *caps)
356+
static int ov7670_get_caps(const struct device *dev, struct video_caps *caps)
358357
{
359358
caps->format_caps = fmts;
360359
return 0;
361360
}
362361

363-
static int ov7670_set_fmt(const struct device *dev, enum video_endpoint_id ep,
364-
struct video_format *fmt)
362+
static int ov7670_set_fmt(const struct device *dev, struct video_format *fmt)
365363
{
366364
const struct ov7670_config *config = dev->config;
367365
struct ov7670_data *data = dev->data;
@@ -446,8 +444,7 @@ static int ov7670_set_fmt(const struct device *dev, enum video_endpoint_id ep,
446444
return -ENOTSUP;
447445
}
448446

449-
static int ov7670_get_fmt(const struct device *dev, enum video_endpoint_id ep,
450-
struct video_format *fmt)
447+
static int ov7670_get_fmt(const struct device *dev, struct video_format *fmt)
451448
{
452449
struct ov7670_data *data = dev->data;
453450

@@ -558,7 +555,7 @@ static int ov7670_init(const struct device *dev)
558555
fmt.width = 640;
559556
fmt.height = 480;
560557
fmt.pitch = fmt.width * 2;
561-
ret = ov7670_set_fmt(dev, VIDEO_EP_OUT, &fmt);
558+
ret = ov7670_set_fmt(dev, &fmt);
562559
if (ret < 0) {
563560
return ret;
564561
}

drivers/video/ov7725.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,7 @@ static int ov7725_set_clock(const struct device *dev,
417417
return -1;
418418
}
419419

420-
static int ov7725_set_fmt(const struct device *dev,
421-
enum video_endpoint_id ep,
422-
struct video_format *fmt)
420+
static int ov7725_set_fmt(const struct device *dev, struct video_format *fmt)
423421
{
424422
struct ov7725_data *drv_data = dev->data;
425423
const struct ov7725_config *cfg = dev->config;
@@ -508,9 +506,7 @@ static int ov7725_set_fmt(const struct device *dev,
508506
((width & 3U) << 0U));
509507
}
510508

511-
static int ov7725_get_fmt(const struct device *dev,
512-
enum video_endpoint_id ep,
513-
struct video_format *fmt)
509+
static int ov7725_get_fmt(const struct device *dev, struct video_format *fmt)
514510
{
515511
struct ov7725_data *drv_data = dev->data;
516512

@@ -537,9 +533,7 @@ static const struct video_format_cap fmts[] = {
537533
{ 0 }
538534
};
539535

540-
static int ov7725_get_caps(const struct device *dev,
541-
enum video_endpoint_id ep,
542-
struct video_caps *caps)
536+
static int ov7725_get_caps(const struct device *dev, struct video_caps *caps)
543537
{
544538
caps->format_caps = fmts;
545539
return 0;
@@ -599,7 +593,7 @@ static int ov7725_init(const struct device *dev)
599593
fmt.width = 640;
600594
fmt.height = 480;
601595
fmt.pitch = 640 * 2;
602-
ret = ov7725_set_fmt(dev, VIDEO_EP_OUT, &fmt);
596+
ret = ov7725_set_fmt(dev, &fmt);
603597
if (ret) {
604598
LOG_ERR("Unable to configure default format");
605599
return -EIO;

drivers/video/video_common.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ void video_closest_frmival_stepwise(const struct video_frmival_stepwise *stepwis
125125
stepwise->step.denominator * desired->denominator;
126126
}
127127

128-
void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep,
129-
struct video_frmival_enum *match)
128+
void video_closest_frmival(const struct device *dev, struct video_frmival_enum *match)
130129
{
131130
struct video_frmival desired = match->discrete;
132131
struct video_frmival_enum fie = {.format = match->format};
@@ -136,7 +135,7 @@ void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep,
136135
__ASSERT(match->type != VIDEO_FRMIVAL_TYPE_STEPWISE,
137136
"cannot find range matching the range, only a value matching the range");
138137

139-
for (fie.index = 0; video_enum_frmival(dev, ep, &fie) == 0; fie.index++) {
138+
for (fie.index = 0; video_enum_frmival(dev, &fie) == 0; fie.index++) {
140139
struct video_frmival tmp = {0};
141140
uint64_t diff_nsec = 0;
142141
uint64_t tmp_nsec;

0 commit comments

Comments
 (0)