Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: v4l2-subdev: Rename .init_cfg() operation to .init_state()

The subdev .init_cfg() operation is affected by two issues:

- It has long been extended to initialize a whole v4l2_subdev_state
instead of just a v4l2_subdev_pad_config, but its name has stuck
around.

- Despite operating on a whole subdev state and not being directly
exposed to the subdev users (either in-kernel or through the userspace
API), .init_cfg() is categorized as a subdev pad operation.

This participates in making the subdev API confusing for new developers.
Fix it by renaming the operation to .init_state(), and make it a subdev
internal operation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Michael Riesch <michael.riesch@wolfvision.net> # for imx415
Acked-by: Shuah Khan <skhan@linuxfoundation.org> # for vimc
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
[Sakari Ailus: Resolved a conflict in Renesas vsp1 driver.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Laurent Pinchart and committed by
Hans Verkuil
5755be5f 7a52ab41

+481 -258
+7 -3
drivers/media/i2c/adv7180.c
··· 813 813 return ret; 814 814 } 815 815 816 - static int adv7180_init_cfg(struct v4l2_subdev *sd, 817 - struct v4l2_subdev_state *sd_state) 816 + static int adv7180_init_state(struct v4l2_subdev *sd, 817 + struct v4l2_subdev_state *sd_state) 818 818 { 819 819 struct v4l2_subdev_format fmt = { 820 820 .which = sd_state ? V4L2_SUBDEV_FORMAT_TRY ··· 929 929 }; 930 930 931 931 static const struct v4l2_subdev_pad_ops adv7180_pad_ops = { 932 - .init_cfg = adv7180_init_cfg, 933 932 .enum_mbus_code = adv7180_enum_mbus_code, 934 933 .set_fmt = adv7180_set_pad_format, 935 934 .get_fmt = adv7180_get_pad_format, ··· 944 945 .video = &adv7180_video_ops, 945 946 .pad = &adv7180_pad_ops, 946 947 .sensor = &adv7180_sensor_ops, 948 + }; 949 + 950 + static const struct v4l2_subdev_internal_ops adv7180_internal_ops = { 951 + .init_state = adv7180_init_state, 947 952 }; 948 953 949 954 static irqreturn_t adv7180_irq(int irq, void *devid) ··· 1461 1458 state->input = 0; 1462 1459 sd = &state->sd; 1463 1460 v4l2_i2c_subdev_init(sd, client, &adv7180_ops); 1461 + sd->internal_ops = &adv7180_internal_ops; 1464 1462 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; 1465 1463 1466 1464 ret = adv7180_init_controls(state);
+3 -3
drivers/media/i2c/ccs/ccs-core.c
··· 3006 3006 return 0; 3007 3007 } 3008 3008 3009 - static int ccs_init_cfg(struct v4l2_subdev *sd, 3010 - struct v4l2_subdev_state *sd_state) 3009 + static int ccs_init_state(struct v4l2_subdev *sd, 3010 + struct v4l2_subdev_state *sd_state) 3011 3011 { 3012 3012 struct ccs_subdev *ssd = to_ccs_subdev(sd); 3013 3013 struct ccs_sensor *sensor = ssd->sensor; ··· 3055 3055 }; 3056 3056 3057 3057 static const struct v4l2_subdev_pad_ops ccs_pad_ops = { 3058 - .init_cfg = ccs_init_cfg, 3059 3058 .enum_mbus_code = ccs_enum_mbus_code, 3060 3059 .get_fmt = ccs_get_format, 3061 3060 .set_fmt = ccs_set_format, ··· 3078 3079 }; 3079 3080 3080 3081 static const struct v4l2_subdev_internal_ops ccs_internal_src_ops = { 3082 + .init_state = ccs_init_state, 3081 3083 .registered = ccs_registered, 3082 3084 .unregistered = ccs_unregistered, 3083 3085 };
+7 -3
drivers/media/i2c/ds90ub913.c
··· 443 443 return 0; 444 444 } 445 445 446 - static int ub913_init_cfg(struct v4l2_subdev *sd, 447 - struct v4l2_subdev_state *state) 446 + static int ub913_init_state(struct v4l2_subdev *sd, 447 + struct v4l2_subdev_state *state) 448 448 { 449 449 struct v4l2_subdev_route routes[] = { 450 450 { ··· 503 503 .get_frame_desc = ub913_get_frame_desc, 504 504 .get_fmt = v4l2_subdev_get_fmt, 505 505 .set_fmt = ub913_set_fmt, 506 - .init_cfg = ub913_init_cfg, 507 506 }; 508 507 509 508 static const struct v4l2_subdev_ops ub913_subdev_ops = { 510 509 .core = &ub913_subdev_core_ops, 511 510 .pad = &ub913_pad_ops, 511 + }; 512 + 513 + static const struct v4l2_subdev_internal_ops ub913_internal_ops = { 514 + .init_state = ub913_init_state, 512 515 }; 513 516 514 517 static const struct media_entity_operations ub913_entity_ops = { ··· 747 744 int ret; 748 745 749 746 v4l2_i2c_subdev_init(&priv->sd, priv->client, &ub913_subdev_ops); 747 + priv->sd.internal_ops = &ub913_internal_ops; 750 748 priv->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_STREAMS; 751 749 priv->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; 752 750 priv->sd.entity.ops = &ub913_entity_ops;
+7 -3
drivers/media/i2c/ds90ub953.c
··· 575 575 return 0; 576 576 } 577 577 578 - static int ub953_init_cfg(struct v4l2_subdev *sd, 579 - struct v4l2_subdev_state *state) 578 + static int ub953_init_state(struct v4l2_subdev *sd, 579 + struct v4l2_subdev_state *state) 580 580 { 581 581 struct v4l2_subdev_route routes[] = { 582 582 { ··· 713 713 .get_frame_desc = ub953_get_frame_desc, 714 714 .get_fmt = v4l2_subdev_get_fmt, 715 715 .set_fmt = ub953_set_fmt, 716 - .init_cfg = ub953_init_cfg, 717 716 }; 718 717 719 718 static const struct v4l2_subdev_core_ops ub953_subdev_core_ops = { ··· 724 725 static const struct v4l2_subdev_ops ub953_subdev_ops = { 725 726 .core = &ub953_subdev_core_ops, 726 727 .pad = &ub953_pad_ops, 728 + }; 729 + 730 + static const struct v4l2_subdev_internal_ops ub953_internal_ops = { 731 + .init_state = ub953_init_state, 727 732 }; 728 733 729 734 static const struct media_entity_operations ub953_entity_ops = { ··· 1243 1240 int ret; 1244 1241 1245 1242 v4l2_i2c_subdev_init(&priv->sd, priv->client, &ub953_subdev_ops); 1243 + priv->sd.internal_ops = &ub953_internal_ops; 1246 1244 1247 1245 priv->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 1248 1246 V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_STREAMS;
+7 -4
drivers/media/i2c/ds90ub960.c
··· 2906 2906 return 0; 2907 2907 } 2908 2908 2909 - static int ub960_init_cfg(struct v4l2_subdev *sd, 2910 - struct v4l2_subdev_state *state) 2909 + static int ub960_init_state(struct v4l2_subdev *sd, 2910 + struct v4l2_subdev_state *state) 2911 2911 { 2912 2912 struct ub960_data *priv = sd_to_ub960(sd); 2913 2913 ··· 2938 2938 2939 2939 .get_fmt = v4l2_subdev_get_fmt, 2940 2940 .set_fmt = ub960_set_fmt, 2941 - 2942 - .init_cfg = ub960_init_cfg, 2943 2941 }; 2944 2942 2945 2943 static int ub960_log_status(struct v4l2_subdev *sd) ··· 3087 3089 .log_status = ub960_log_status, 3088 3090 .subscribe_event = v4l2_ctrl_subdev_subscribe_event, 3089 3091 .unsubscribe_event = v4l2_event_subdev_unsubscribe, 3092 + }; 3093 + 3094 + static const struct v4l2_subdev_internal_ops ub960_internal_ops = { 3095 + .init_state = ub960_init_state, 3090 3096 }; 3091 3097 3092 3098 static const struct v4l2_subdev_ops ub960_subdev_ops = { ··· 3652 3650 int ret; 3653 3651 3654 3652 v4l2_i2c_subdev_init(&priv->sd, priv->client, &ub960_subdev_ops); 3653 + priv->sd.internal_ops = &ub960_internal_ops; 3655 3654 3656 3655 v4l2_ctrl_handler_init(&priv->ctrl_handler, 1); 3657 3656 priv->sd.ctrl_handler = &priv->ctrl_handler;
+7 -3
drivers/media/i2c/gc2145.c
··· 653 653 fmt->xfer_func = V4L2_XFER_FUNC_DEFAULT; 654 654 } 655 655 656 - static int gc2145_init_cfg(struct v4l2_subdev *sd, 657 - struct v4l2_subdev_state *state) 656 + static int gc2145_init_state(struct v4l2_subdev *sd, 657 + struct v4l2_subdev_state *state) 658 658 { 659 659 struct gc2145 *gc2145 = to_gc2145(sd); 660 660 struct v4l2_mbus_framefmt *format; ··· 1079 1079 }; 1080 1080 1081 1081 static const struct v4l2_subdev_pad_ops gc2145_pad_ops = { 1082 - .init_cfg = gc2145_init_cfg, 1083 1082 .enum_mbus_code = gc2145_enum_mbus_code, 1084 1083 .get_fmt = v4l2_subdev_get_fmt, 1085 1084 .set_fmt = gc2145_set_pad_format, ··· 1090 1091 .core = &gc2145_core_ops, 1091 1092 .video = &gc2145_video_ops, 1092 1093 .pad = &gc2145_pad_ops, 1094 + }; 1095 + 1096 + static const struct v4l2_subdev_internal_ops gc2145_subdev_internal_ops = { 1097 + .init_state = gc2145_init_state, 1093 1098 }; 1094 1099 1095 1100 static int gc2145_set_ctrl_test_pattern(struct gc2145 *gc2145, int value) ··· 1289 1286 return -ENOMEM; 1290 1287 1291 1288 v4l2_i2c_subdev_init(&gc2145->sd, client, &gc2145_subdev_ops); 1289 + gc2145->sd.internal_ops = &gc2145_subdev_internal_ops; 1292 1290 1293 1291 /* Check the hardware configuration in device tree */ 1294 1292 if (gc2145_check_hwcfg(dev))
+7 -3
drivers/media/i2c/hi846.c
··· 1871 1871 } 1872 1872 } 1873 1873 1874 - static int hi846_init_cfg(struct v4l2_subdev *sd, 1875 - struct v4l2_subdev_state *sd_state) 1874 + static int hi846_init_state(struct v4l2_subdev *sd, 1875 + struct v4l2_subdev_state *sd_state) 1876 1876 { 1877 1877 struct hi846 *hi846 = to_hi846(sd); 1878 1878 struct v4l2_mbus_framefmt *mf; ··· 1895 1895 }; 1896 1896 1897 1897 static const struct v4l2_subdev_pad_ops hi846_pad_ops = { 1898 - .init_cfg = hi846_init_cfg, 1899 1898 .enum_frame_size = hi846_enum_frame_size, 1900 1899 .enum_mbus_code = hi846_enum_mbus_code, 1901 1900 .set_fmt = hi846_set_format, ··· 1905 1906 static const struct v4l2_subdev_ops hi846_subdev_ops = { 1906 1907 .video = &hi846_video_ops, 1907 1908 .pad = &hi846_pad_ops, 1909 + }; 1910 + 1911 + static const struct v4l2_subdev_internal_ops hi846_internal_ops = { 1912 + .init_state = hi846_init_state, 1908 1913 }; 1909 1914 1910 1915 static const struct media_entity_operations hi846_subdev_entity_ops = { ··· 2074 2071 return ret; 2075 2072 2076 2073 v4l2_i2c_subdev_init(&hi846->sd, client, &hi846_subdev_ops); 2074 + hi846->sd.internal_ops = &hi846_internal_ops; 2077 2075 2078 2076 mutex_init(&hi846->mutex); 2079 2077
+8 -4
drivers/media/i2c/imx214.c
··· 633 633 return 0; 634 634 } 635 635 636 - static int imx214_entity_init_cfg(struct v4l2_subdev *subdev, 637 - struct v4l2_subdev_state *sd_state) 636 + static int imx214_entity_init_state(struct v4l2_subdev *subdev, 637 + struct v4l2_subdev_state *sd_state) 638 638 { 639 639 struct v4l2_subdev_format fmt = { }; 640 640 ··· 839 839 .get_fmt = imx214_get_format, 840 840 .set_fmt = imx214_set_format, 841 841 .get_selection = imx214_get_selection, 842 - .init_cfg = imx214_entity_init_cfg, 843 842 }; 844 843 845 844 static const struct v4l2_subdev_ops imx214_subdev_ops = { 846 845 .core = &imx214_core_ops, 847 846 .video = &imx214_video_ops, 848 847 .pad = &imx214_subdev_pad_ops, 848 + }; 849 + 850 + static const struct v4l2_subdev_internal_ops imx214_internal_ops = { 851 + .init_state = imx214_entity_init_state, 849 852 }; 850 853 851 854 static const struct regmap_config sensor_regmap_config = { ··· 960 957 } 961 958 962 959 v4l2_i2c_subdev_init(&imx214->sd, client, &imx214_subdev_ops); 960 + imx214->sd.internal_ops = &imx214_internal_ops; 963 961 964 962 /* 965 963 * Enable power initially, to avoid warnings ··· 1025 1021 goto free_ctrl; 1026 1022 } 1027 1023 1028 - imx214_entity_init_cfg(&imx214->sd, NULL); 1024 + imx214_entity_init_state(&imx214->sd, NULL); 1029 1025 1030 1026 ret = v4l2_async_register_subdev_sensor(&imx214->sd); 1031 1027 if (ret < 0) {
+6 -3
drivers/media/i2c/imx219.c
··· 905 905 return -EINVAL; 906 906 } 907 907 908 - static int imx219_init_cfg(struct v4l2_subdev *sd, 909 - struct v4l2_subdev_state *state) 908 + static int imx219_init_state(struct v4l2_subdev *sd, 909 + struct v4l2_subdev_state *state) 910 910 { 911 911 struct v4l2_subdev_format fmt = { 912 912 .which = V4L2_SUBDEV_FORMAT_TRY, ··· 933 933 }; 934 934 935 935 static const struct v4l2_subdev_pad_ops imx219_pad_ops = { 936 - .init_cfg = imx219_init_cfg, 937 936 .enum_mbus_code = imx219_enum_mbus_code, 938 937 .get_fmt = v4l2_subdev_get_fmt, 939 938 .set_fmt = imx219_set_pad_format, ··· 946 947 .pad = &imx219_pad_ops, 947 948 }; 948 949 950 + static const struct v4l2_subdev_internal_ops imx219_internal_ops = { 951 + .init_state = imx219_init_state, 952 + }; 949 953 950 954 /* ----------------------------------------------------------------------------- 951 955 * Power management ··· 1100 1098 return -ENOMEM; 1101 1099 1102 1100 v4l2_i2c_subdev_init(&imx219->sd, client, &imx219_subdev_ops); 1101 + imx219->sd.internal_ops = &imx219_internal_ops; 1103 1102 1104 1103 /* Check the hardware configuration in device tree */ 1105 1104 if (imx219_check_hwcfg(dev, imx219))
+7 -3
drivers/media/i2c/imx290.c
··· 1195 1195 } 1196 1196 } 1197 1197 1198 - static int imx290_entity_init_cfg(struct v4l2_subdev *subdev, 1199 - struct v4l2_subdev_state *sd_state) 1198 + static int imx290_entity_init_state(struct v4l2_subdev *subdev, 1199 + struct v4l2_subdev_state *sd_state) 1200 1200 { 1201 1201 struct v4l2_subdev_format fmt = { 1202 1202 .which = V4L2_SUBDEV_FORMAT_TRY, ··· 1221 1221 }; 1222 1222 1223 1223 static const struct v4l2_subdev_pad_ops imx290_pad_ops = { 1224 - .init_cfg = imx290_entity_init_cfg, 1225 1224 .enum_mbus_code = imx290_enum_mbus_code, 1226 1225 .enum_frame_size = imx290_enum_frame_size, 1227 1226 .get_fmt = v4l2_subdev_get_fmt, ··· 1232 1233 .core = &imx290_core_ops, 1233 1234 .video = &imx290_video_ops, 1234 1235 .pad = &imx290_pad_ops, 1236 + }; 1237 + 1238 + static const struct v4l2_subdev_internal_ops imx290_internal_ops = { 1239 + .init_state = imx290_entity_init_state, 1235 1240 }; 1236 1241 1237 1242 static const struct media_entity_operations imx290_subdev_entity_ops = { ··· 1251 1248 imx290->current_mode = &imx290_modes_ptr(imx290)[0]; 1252 1249 1253 1250 v4l2_i2c_subdev_init(&imx290->sd, client, &imx290_subdev_ops); 1251 + imx290->sd.internal_ops = &imx290_internal_ops; 1254 1252 imx290->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 1255 1253 V4L2_SUBDEV_FL_HAS_EVENTS; 1256 1254 imx290->sd.dev = imx290->dev;
+7 -3
drivers/media/i2c/imx296.c
··· 798 798 return 0; 799 799 } 800 800 801 - static int imx296_init_cfg(struct v4l2_subdev *sd, 802 - struct v4l2_subdev_state *state) 801 + static int imx296_init_state(struct v4l2_subdev *sd, 802 + struct v4l2_subdev_state *state) 803 803 { 804 804 struct v4l2_subdev_selection sel = { 805 805 .target = V4L2_SEL_TGT_CROP, ··· 830 830 .set_fmt = imx296_set_format, 831 831 .get_selection = imx296_get_selection, 832 832 .set_selection = imx296_set_selection, 833 - .init_cfg = imx296_init_cfg, 834 833 }; 835 834 836 835 static const struct v4l2_subdev_ops imx296_subdev_ops = { 837 836 .video = &imx296_subdev_video_ops, 838 837 .pad = &imx296_subdev_pad_ops, 838 + }; 839 + 840 + static const struct v4l2_subdev_internal_ops imx296_internal_ops = { 841 + .init_state = imx296_init_state, 839 842 }; 840 843 841 844 static int imx296_subdev_init(struct imx296 *sensor) ··· 847 844 int ret; 848 845 849 846 v4l2_i2c_subdev_init(&sensor->subdev, client, &imx296_subdev_ops); 847 + sensor->subdev.internal_ops = &imx296_internal_ops; 850 848 851 849 ret = imx296_ctrls_init(sensor); 852 850 if (ret < 0)
+8 -4
drivers/media/i2c/imx334.c
··· 935 935 } 936 936 937 937 /** 938 - * imx334_init_cfg() - Initialize sub-device state 938 + * imx334_init_state() - Initialize sub-device state 939 939 * @sd: pointer to imx334 V4L2 sub-device structure 940 940 * @sd_state: V4L2 sub-device state 941 941 * 942 942 * Return: 0 if successful, error code otherwise. 943 943 */ 944 - static int imx334_init_cfg(struct v4l2_subdev *sd, 945 - struct v4l2_subdev_state *sd_state) 944 + static int imx334_init_state(struct v4l2_subdev *sd, 945 + struct v4l2_subdev_state *sd_state) 946 946 { 947 947 struct imx334 *imx334 = to_imx334(sd); 948 948 struct v4l2_subdev_format fmt = { 0 }; ··· 1190 1190 }; 1191 1191 1192 1192 static const struct v4l2_subdev_pad_ops imx334_pad_ops = { 1193 - .init_cfg = imx334_init_cfg, 1194 1193 .enum_mbus_code = imx334_enum_mbus_code, 1195 1194 .enum_frame_size = imx334_enum_frame_size, 1196 1195 .get_fmt = imx334_get_pad_format, ··· 1199 1200 static const struct v4l2_subdev_ops imx334_subdev_ops = { 1200 1201 .video = &imx334_video_ops, 1201 1202 .pad = &imx334_pad_ops, 1203 + }; 1204 + 1205 + static const struct v4l2_subdev_internal_ops imx334_internal_ops = { 1206 + .init_state = imx334_init_state, 1202 1207 }; 1203 1208 1204 1209 /** ··· 1362 1359 1363 1360 /* Initialize subdev */ 1364 1361 v4l2_i2c_subdev_init(&imx334->sd, client, &imx334_subdev_ops); 1362 + imx334->sd.internal_ops = &imx334_internal_ops; 1365 1363 1366 1364 ret = imx334_parse_hw_config(imx334); 1367 1365 if (ret) {
+8 -4
drivers/media/i2c/imx335.c
··· 618 618 } 619 619 620 620 /** 621 - * imx335_init_cfg() - Initialize sub-device state 621 + * imx335_init_state() - Initialize sub-device state 622 622 * @sd: pointer to imx335 V4L2 sub-device structure 623 623 * @sd_state: V4L2 sub-device configuration 624 624 * 625 625 * Return: 0 if successful, error code otherwise. 626 626 */ 627 - static int imx335_init_cfg(struct v4l2_subdev *sd, 628 - struct v4l2_subdev_state *sd_state) 627 + static int imx335_init_state(struct v4l2_subdev *sd, 628 + struct v4l2_subdev_state *sd_state) 629 629 { 630 630 struct imx335 *imx335 = to_imx335(sd); 631 631 struct v4l2_subdev_format fmt = { 0 }; ··· 835 835 }; 836 836 837 837 static const struct v4l2_subdev_pad_ops imx335_pad_ops = { 838 - .init_cfg = imx335_init_cfg, 839 838 .enum_mbus_code = imx335_enum_mbus_code, 840 839 .enum_frame_size = imx335_enum_frame_size, 841 840 .get_fmt = imx335_get_pad_format, ··· 844 845 static const struct v4l2_subdev_ops imx335_subdev_ops = { 845 846 .video = &imx335_video_ops, 846 847 .pad = &imx335_pad_ops, 848 + }; 849 + 850 + static const struct v4l2_subdev_internal_ops imx335_internal_ops = { 851 + .init_state = imx335_init_state, 847 852 }; 848 853 849 854 /** ··· 1002 999 1003 1000 /* Initialize subdev */ 1004 1001 v4l2_i2c_subdev_init(&imx335->sd, client, &imx335_subdev_ops); 1002 + imx335->sd.internal_ops = &imx335_internal_ops; 1005 1003 1006 1004 ret = imx335_parse_hw_config(imx335); 1007 1005 if (ret) {
+8 -4
drivers/media/i2c/imx412.c
··· 770 770 } 771 771 772 772 /** 773 - * imx412_init_cfg() - Initialize sub-device state 773 + * imx412_init_state() - Initialize sub-device state 774 774 * @sd: pointer to imx412 V4L2 sub-device structure 775 775 * @sd_state: V4L2 sub-device configuration 776 776 * 777 777 * Return: 0 if successful, error code otherwise. 778 778 */ 779 - static int imx412_init_cfg(struct v4l2_subdev *sd, 780 - struct v4l2_subdev_state *sd_state) 779 + static int imx412_init_state(struct v4l2_subdev *sd, 780 + struct v4l2_subdev_state *sd_state) 781 781 { 782 782 struct imx412 *imx412 = to_imx412(sd); 783 783 struct v4l2_subdev_format fmt = { 0 }; ··· 997 997 }; 998 998 999 999 static const struct v4l2_subdev_pad_ops imx412_pad_ops = { 1000 - .init_cfg = imx412_init_cfg, 1001 1000 .enum_mbus_code = imx412_enum_mbus_code, 1002 1001 .enum_frame_size = imx412_enum_frame_size, 1003 1002 .get_fmt = imx412_get_pad_format, ··· 1006 1007 static const struct v4l2_subdev_ops imx412_subdev_ops = { 1007 1008 .video = &imx412_video_ops, 1008 1009 .pad = &imx412_pad_ops, 1010 + }; 1011 + 1012 + static const struct v4l2_subdev_internal_ops imx412_internal_ops = { 1013 + .init_state = imx412_init_state, 1009 1014 }; 1010 1015 1011 1016 /** ··· 1180 1177 1181 1178 /* Initialize subdev */ 1182 1179 v4l2_i2c_subdev_init(&imx412->sd, client, &imx412_subdev_ops); 1180 + imx412->sd.internal_ops = &imx412_internal_ops; 1183 1181 1184 1182 ret = imx412_parse_hw_config(imx412); 1185 1183 if (ret) {
+7 -3
drivers/media/i2c/imx415.c
··· 880 880 return -EINVAL; 881 881 } 882 882 883 - static int imx415_init_cfg(struct v4l2_subdev *sd, 884 - struct v4l2_subdev_state *state) 883 + static int imx415_init_state(struct v4l2_subdev *sd, 884 + struct v4l2_subdev_state *state) 885 885 { 886 886 struct v4l2_subdev_format format = { 887 887 .format = { ··· 905 905 .get_fmt = v4l2_subdev_get_fmt, 906 906 .set_fmt = imx415_set_format, 907 907 .get_selection = imx415_get_selection, 908 - .init_cfg = imx415_init_cfg, 909 908 }; 910 909 911 910 static const struct v4l2_subdev_ops imx415_subdev_ops = { 912 911 .video = &imx415_subdev_video_ops, 913 912 .pad = &imx415_subdev_pad_ops, 913 + }; 914 + 915 + static const struct v4l2_subdev_internal_ops imx415_internal_ops = { 916 + .init_state = imx415_init_state, 914 917 }; 915 918 916 919 static int imx415_subdev_init(struct imx415 *sensor) ··· 922 919 int ret; 923 920 924 921 v4l2_i2c_subdev_init(&sensor->subdev, client, &imx415_subdev_ops); 922 + sensor->subdev.internal_ops = &imx415_internal_ops; 925 923 926 924 ret = imx415_ctrls_init(sensor); 927 925 if (ret)
+7 -3
drivers/media/i2c/mt9m001.c
··· 650 650 #endif 651 651 }; 652 652 653 - static int mt9m001_init_cfg(struct v4l2_subdev *sd, 654 - struct v4l2_subdev_state *sd_state) 653 + static int mt9m001_init_state(struct v4l2_subdev *sd, 654 + struct v4l2_subdev_state *sd_state) 655 655 { 656 656 struct i2c_client *client = v4l2_get_subdevdata(sd); 657 657 struct mt9m001 *mt9m001 = to_mt9m001(client); ··· 708 708 }; 709 709 710 710 static const struct v4l2_subdev_pad_ops mt9m001_subdev_pad_ops = { 711 - .init_cfg = mt9m001_init_cfg, 712 711 .enum_mbus_code = mt9m001_enum_mbus_code, 713 712 .get_selection = mt9m001_get_selection, 714 713 .set_selection = mt9m001_set_selection, ··· 721 722 .video = &mt9m001_subdev_video_ops, 722 723 .sensor = &mt9m001_subdev_sensor_ops, 723 724 .pad = &mt9m001_subdev_pad_ops, 725 + }; 726 + 727 + static const struct v4l2_subdev_internal_ops mt9m001_internal_ops = { 728 + .init_state = mt9m001_init_state, 724 729 }; 725 730 726 731 static int mt9m001_probe(struct i2c_client *client) ··· 758 755 return PTR_ERR(mt9m001->reset_gpio); 759 756 760 757 v4l2_i2c_subdev_init(&mt9m001->subdev, client, &mt9m001_subdev_ops); 758 + mt9m001->subdev.internal_ops = &mt9m001_internal_ops; 761 759 mt9m001->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 762 760 V4L2_SUBDEV_FL_HAS_EVENTS; 763 761 v4l2_ctrl_handler_init(&mt9m001->hdl, 4);
+7 -3
drivers/media/i2c/mt9m111.c
··· 1111 1111 return 0; 1112 1112 } 1113 1113 1114 - static int mt9m111_init_cfg(struct v4l2_subdev *sd, 1115 - struct v4l2_subdev_state *sd_state) 1114 + static int mt9m111_init_state(struct v4l2_subdev *sd, 1115 + struct v4l2_subdev_state *sd_state) 1116 1116 { 1117 1117 struct v4l2_mbus_framefmt *format = 1118 1118 v4l2_subdev_state_get_format(sd_state, 0); ··· 1156 1156 }; 1157 1157 1158 1158 static const struct v4l2_subdev_pad_ops mt9m111_subdev_pad_ops = { 1159 - .init_cfg = mt9m111_init_cfg, 1160 1159 .enum_mbus_code = mt9m111_enum_mbus_code, 1161 1160 .get_selection = mt9m111_get_selection, 1162 1161 .set_selection = mt9m111_set_selection, ··· 1168 1169 .core = &mt9m111_subdev_core_ops, 1169 1170 .video = &mt9m111_subdev_video_ops, 1170 1171 .pad = &mt9m111_subdev_pad_ops, 1172 + }; 1173 + 1174 + static const struct v4l2_subdev_internal_ops mt9m111_internal_ops = { 1175 + .init_state = mt9m111_init_state, 1171 1176 }; 1172 1177 1173 1178 /* ··· 1278 1275 mt9m111->ctx = &context_b; 1279 1276 1280 1277 v4l2_i2c_subdev_init(&mt9m111->subdev, client, &mt9m111_subdev_ops); 1278 + mt9m111->subdev.internal_ops = &mt9m111_internal_ops; 1281 1279 mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 1282 1280 V4L2_SUBDEV_FL_HAS_EVENTS; 1283 1281
+10 -6
drivers/media/i2c/mt9m114.c
··· 1152 1152 return container_of(sd, struct mt9m114, pa.sd); 1153 1153 } 1154 1154 1155 - static int mt9m114_pa_init_cfg(struct v4l2_subdev *sd, 1156 - struct v4l2_subdev_state *state) 1155 + static int mt9m114_pa_init_state(struct v4l2_subdev *sd, 1156 + struct v4l2_subdev_state *state) 1157 1157 { 1158 1158 struct v4l2_mbus_framefmt *format; 1159 1159 struct v4l2_rect *crop; ··· 1304 1304 } 1305 1305 1306 1306 static const struct v4l2_subdev_pad_ops mt9m114_pa_pad_ops = { 1307 - .init_cfg = mt9m114_pa_init_cfg, 1308 1307 .enum_mbus_code = mt9m114_pa_enum_mbus_code, 1309 1308 .enum_frame_size = mt9m114_pa_enum_framesizes, 1310 1309 .get_fmt = v4l2_subdev_get_fmt, ··· 1314 1315 1315 1316 static const struct v4l2_subdev_ops mt9m114_pa_ops = { 1316 1317 .pad = &mt9m114_pa_pad_ops, 1318 + }; 1319 + 1320 + static const struct v4l2_subdev_internal_ops mt9m114_pa_internal_ops = { 1321 + .init_state = mt9m114_pa_init_state, 1317 1322 }; 1318 1323 1319 1324 static int mt9m114_pa_init(struct mt9m114 *sensor) ··· 1332 1329 1333 1330 /* Initialize the subdev. */ 1334 1331 v4l2_subdev_init(sd, &mt9m114_pa_ops); 1332 + sd->internal_ops = &mt9m114_pa_internal_ops; 1335 1333 v4l2_i2c_subdev_set_name(sd, sensor->client, NULL, " pixel array"); 1336 1334 1337 1335 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; ··· 1628 1624 return ret; 1629 1625 } 1630 1626 1631 - static int mt9m114_ifp_init_cfg(struct v4l2_subdev *sd, 1632 - struct v4l2_subdev_state *state) 1627 + static int mt9m114_ifp_init_state(struct v4l2_subdev *sd, 1628 + struct v4l2_subdev_state *state) 1633 1629 { 1634 1630 struct mt9m114 *sensor = ifp_to_mt9m114(sd); 1635 1631 struct v4l2_mbus_framefmt *format; ··· 1972 1968 }; 1973 1969 1974 1970 static const struct v4l2_subdev_pad_ops mt9m114_ifp_pad_ops = { 1975 - .init_cfg = mt9m114_ifp_init_cfg, 1976 1971 .enum_mbus_code = mt9m114_ifp_enum_mbus_code, 1977 1972 .enum_frame_size = mt9m114_ifp_enum_framesizes, 1978 1973 .enum_frame_interval = mt9m114_ifp_enum_frameintervals, ··· 1987 1984 }; 1988 1985 1989 1986 static const struct v4l2_subdev_internal_ops mt9m114_ifp_internal_ops = { 1987 + .init_state = mt9m114_ifp_init_state, 1990 1988 .registered = mt9m114_ifp_registered, 1991 1989 .unregistered = mt9m114_ifp_unregistered, 1992 1990 };
+4 -4
drivers/media/i2c/mt9p031.c
··· 696 696 return 0; 697 697 } 698 698 699 - static int mt9p031_init_cfg(struct v4l2_subdev *subdev, 700 - struct v4l2_subdev_state *sd_state) 699 + static int mt9p031_init_state(struct v4l2_subdev *subdev, 700 + struct v4l2_subdev_state *sd_state) 701 701 { 702 702 struct mt9p031 *mt9p031 = to_mt9p031(subdev); 703 703 struct v4l2_mbus_framefmt *format; ··· 1041 1041 }; 1042 1042 1043 1043 static const struct v4l2_subdev_pad_ops mt9p031_subdev_pad_ops = { 1044 - .init_cfg = mt9p031_init_cfg, 1045 1044 .enum_mbus_code = mt9p031_enum_mbus_code, 1046 1045 .enum_frame_size = mt9p031_enum_frame_size, 1047 1046 .get_fmt = mt9p031_get_format, ··· 1056 1057 }; 1057 1058 1058 1059 static const struct v4l2_subdev_internal_ops mt9p031_subdev_internal_ops = { 1060 + .init_state = mt9p031_init_state, 1059 1061 .registered = mt9p031_registered, 1060 1062 .open = mt9p031_open, 1061 1063 .close = mt9p031_close, ··· 1189 1189 1190 1190 mt9p031->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1191 1191 1192 - ret = mt9p031_init_cfg(&mt9p031->subdev, NULL); 1192 + ret = mt9p031_init_state(&mt9p031->subdev, NULL); 1193 1193 if (ret) 1194 1194 goto done; 1195 1195
+7 -3
drivers/media/i2c/mt9v111.c
··· 948 948 return 0; 949 949 } 950 950 951 - static int mt9v111_init_cfg(struct v4l2_subdev *subdev, 952 - struct v4l2_subdev_state *sd_state) 951 + static int mt9v111_init_state(struct v4l2_subdev *subdev, 952 + struct v4l2_subdev_state *sd_state) 953 953 { 954 954 *v4l2_subdev_state_get_format(sd_state, 0) = mt9v111_def_fmt; 955 955 ··· 967 967 }; 968 968 969 969 static const struct v4l2_subdev_pad_ops mt9v111_pad_ops = { 970 - .init_cfg = mt9v111_init_cfg, 971 970 .enum_mbus_code = mt9v111_enum_mbus_code, 972 971 .enum_frame_size = mt9v111_enum_frame_size, 973 972 .enum_frame_interval = mt9v111_enum_frame_interval, ··· 978 979 .core = &mt9v111_core_ops, 979 980 .video = &mt9v111_video_ops, 980 981 .pad = &mt9v111_pad_ops, 982 + }; 983 + 984 + static const struct v4l2_subdev_internal_ops mt9v111_internal_ops = { 985 + .init_state = mt9v111_init_state, 981 986 }; 982 987 983 988 static const struct media_entity_operations mt9v111_subdev_entity_ops = { ··· 1197 1194 mt9v111->pending = true; 1198 1195 1199 1196 v4l2_i2c_subdev_init(&mt9v111->sd, client, &mt9v111_ops); 1197 + mt9v111->sd.internal_ops = &mt9v111_internal_ops; 1200 1198 1201 1199 mt9v111->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1202 1200 mt9v111->sd.entity.ops = &mt9v111_subdev_entity_ops;
+7 -3
drivers/media/i2c/ov01a10.c
··· 729 729 return 0; 730 730 } 731 731 732 - static int ov01a10_init_cfg(struct v4l2_subdev *sd, 733 - struct v4l2_subdev_state *state) 732 + static int ov01a10_init_state(struct v4l2_subdev *sd, 733 + struct v4l2_subdev_state *state) 734 734 { 735 735 struct v4l2_subdev_format fmt = { 736 736 .which = V4L2_SUBDEV_FORMAT_TRY, ··· 813 813 }; 814 814 815 815 static const struct v4l2_subdev_pad_ops ov01a10_pad_ops = { 816 - .init_cfg = ov01a10_init_cfg, 817 816 .set_fmt = ov01a10_set_format, 818 817 .get_fmt = v4l2_subdev_get_fmt, 819 818 .get_selection = ov01a10_get_selection, ··· 824 825 .core = &ov01a10_core_ops, 825 826 .video = &ov01a10_video_ops, 826 827 .pad = &ov01a10_pad_ops, 828 + }; 829 + 830 + static const struct v4l2_subdev_internal_ops ov01a10_internal_ops = { 831 + .init_state = ov01a10_init_state, 827 832 }; 828 833 829 834 static const struct media_entity_operations ov01a10_subdev_entity_ops = { ··· 875 872 return -ENOMEM; 876 873 877 874 v4l2_i2c_subdev_init(&ov01a10->sd, client, &ov01a10_subdev_ops); 875 + ov01a10->sd.internal_ops = &ov01a10_internal_ops; 878 876 879 877 ret = ov01a10_identify_module(ov01a10); 880 878 if (ret)
+7 -3
drivers/media/i2c/ov02a10.c
··· 511 511 SC_CTRL_MODE_STANDBY); 512 512 } 513 513 514 - static int ov02a10_entity_init_cfg(struct v4l2_subdev *sd, 515 - struct v4l2_subdev_state *sd_state) 514 + static int ov02a10_init_state(struct v4l2_subdev *sd, 515 + struct v4l2_subdev_state *sd_state) 516 516 { 517 517 struct v4l2_subdev_format fmt = { 518 518 .which = V4L2_SUBDEV_FORMAT_TRY, ··· 709 709 }; 710 710 711 711 static const struct v4l2_subdev_pad_ops ov02a10_pad_ops = { 712 - .init_cfg = ov02a10_entity_init_cfg, 713 712 .enum_mbus_code = ov02a10_enum_mbus_code, 714 713 .enum_frame_size = ov02a10_enum_frame_sizes, 715 714 .get_fmt = ov02a10_get_fmt, ··· 718 719 static const struct v4l2_subdev_ops ov02a10_subdev_ops = { 719 720 .video = &ov02a10_video_ops, 720 721 .pad = &ov02a10_pad_ops, 722 + }; 723 + 724 + static const struct v4l2_subdev_internal_ops ov02a10_internal_ops = { 725 + .init_state = ov02a10_init_state, 721 726 }; 722 727 723 728 static const struct media_entity_operations ov02a10_subdev_entity_ops = { ··· 872 869 "failed to check HW configuration\n"); 873 870 874 871 v4l2_i2c_subdev_init(&ov02a10->subdev, client, &ov02a10_subdev_ops); 872 + ov02a10->subdev.internal_ops = &ov02a10_internal_ops; 875 873 876 874 ov02a10->mipi_clock_voltage = OV02A10_MIPI_TX_SPEED_DEFAULT; 877 875 ov02a10->fmt.code = MEDIA_BUS_FMT_SBGGR10_1X10;
+7 -3
drivers/media/i2c/ov2640.c
··· 996 996 return ret; 997 997 } 998 998 999 - static int ov2640_init_cfg(struct v4l2_subdev *sd, 1000 - struct v4l2_subdev_state *sd_state) 999 + static int ov2640_init_state(struct v4l2_subdev *sd, 1000 + struct v4l2_subdev_state *sd_state) 1001 1001 { 1002 1002 struct v4l2_mbus_framefmt *try_fmt = 1003 1003 v4l2_subdev_state_get_format(sd_state, 0); ··· 1125 1125 }; 1126 1126 1127 1127 static const struct v4l2_subdev_pad_ops ov2640_subdev_pad_ops = { 1128 - .init_cfg = ov2640_init_cfg, 1129 1128 .enum_mbus_code = ov2640_enum_mbus_code, 1130 1129 .get_selection = ov2640_get_selection, 1131 1130 .get_fmt = ov2640_get_fmt, ··· 1139 1140 .core = &ov2640_subdev_core_ops, 1140 1141 .pad = &ov2640_subdev_pad_ops, 1141 1142 .video = &ov2640_subdev_video_ops, 1143 + }; 1144 + 1145 + static const struct v4l2_subdev_internal_ops ov2640_internal_ops = { 1146 + .init_state = ov2640_init_state, 1142 1147 }; 1143 1148 1144 1149 static int ov2640_probe_dt(struct i2c_client *client, ··· 1214 1211 priv->cfmt_code = MEDIA_BUS_FMT_UYVY8_2X8; 1215 1212 1216 1213 v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops); 1214 + priv->subdev.internal_ops = &ov2640_internal_ops; 1217 1215 priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 1218 1216 V4L2_SUBDEV_FL_HAS_EVENTS; 1219 1217 mutex_init(&priv->lock);
+7 -3
drivers/media/i2c/ov2680.c
··· 755 755 return 0; 756 756 } 757 757 758 - static int ov2680_init_cfg(struct v4l2_subdev *sd, 759 - struct v4l2_subdev_state *sd_state) 758 + static int ov2680_init_state(struct v4l2_subdev *sd, 759 + struct v4l2_subdev_state *sd_state) 760 760 { 761 761 struct ov2680_dev *sensor = to_ov2680_dev(sd); 762 762 ··· 876 876 }; 877 877 878 878 static const struct v4l2_subdev_pad_ops ov2680_pad_ops = { 879 - .init_cfg = ov2680_init_cfg, 880 879 .enum_mbus_code = ov2680_enum_mbus_code, 881 880 .enum_frame_size = ov2680_enum_frame_size, 882 881 .enum_frame_interval = ov2680_enum_frame_interval, ··· 888 889 static const struct v4l2_subdev_ops ov2680_subdev_ops = { 889 890 .video = &ov2680_video_ops, 890 891 .pad = &ov2680_pad_ops, 892 + }; 893 + 894 + static const struct v4l2_subdev_internal_ops ov2680_internal_ops = { 895 + .init_state = ov2680_init_state, 891 896 }; 892 897 893 898 static int ov2680_mode_init(struct ov2680_dev *sensor) ··· 918 915 int ret = 0; 919 916 920 917 v4l2_i2c_subdev_init(&sensor->sd, client, &ov2680_subdev_ops); 918 + sensor->sd.internal_ops = &ov2680_internal_ops; 921 919 922 920 sensor->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; 923 921 sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
+7 -3
drivers/media/i2c/ov2740.c
··· 879 879 return 0; 880 880 } 881 881 882 - static int ov2740_init_cfg(struct v4l2_subdev *sd, 883 - struct v4l2_subdev_state *sd_state) 882 + static int ov2740_init_state(struct v4l2_subdev *sd, 883 + struct v4l2_subdev_state *sd_state) 884 884 { 885 885 ov2740_update_pad_format(&supported_modes[0], 886 886 v4l2_subdev_state_get_format(sd_state, 0)); ··· 897 897 .set_fmt = ov2740_set_format, 898 898 .enum_mbus_code = ov2740_enum_mbus_code, 899 899 .enum_frame_size = ov2740_enum_frame_size, 900 - .init_cfg = ov2740_init_cfg, 901 900 }; 902 901 903 902 static const struct v4l2_subdev_ops ov2740_subdev_ops = { 904 903 .video = &ov2740_video_ops, 905 904 .pad = &ov2740_pad_ops, 905 + }; 906 + 907 + static const struct v4l2_subdev_internal_ops ov2740_internal_ops = { 908 + .init_state = ov2740_init_state, 906 909 }; 907 910 908 911 static const struct media_entity_operations ov2740_subdev_entity_ops = { ··· 1077 1074 return -ENOMEM; 1078 1075 1079 1076 v4l2_i2c_subdev_init(&ov2740->sd, client, &ov2740_subdev_ops); 1077 + ov2740->sd.internal_ops = &ov2740_internal_ops; 1080 1078 full_power = acpi_dev_state_d0(&client->dev); 1081 1079 if (full_power) { 1082 1080 ret = ov2740_identify_module(ov2740);
+7 -3
drivers/media/i2c/ov5640.c
··· 3744 3744 return ret; 3745 3745 } 3746 3746 3747 - static int ov5640_init_cfg(struct v4l2_subdev *sd, 3748 - struct v4l2_subdev_state *state) 3747 + static int ov5640_init_state(struct v4l2_subdev *sd, 3748 + struct v4l2_subdev_state *state) 3749 3749 { 3750 3750 struct ov5640_dev *sensor = to_ov5640_dev(sd); 3751 3751 struct v4l2_mbus_framefmt *fmt = ··· 3776 3776 }; 3777 3777 3778 3778 static const struct v4l2_subdev_pad_ops ov5640_pad_ops = { 3779 - .init_cfg = ov5640_init_cfg, 3780 3779 .enum_mbus_code = ov5640_enum_mbus_code, 3781 3780 .get_fmt = ov5640_get_fmt, 3782 3781 .set_fmt = ov5640_set_fmt, ··· 3788 3789 .core = &ov5640_core_ops, 3789 3790 .video = &ov5640_video_ops, 3790 3791 .pad = &ov5640_pad_ops, 3792 + }; 3793 + 3794 + static const struct v4l2_subdev_internal_ops ov5640_internal_ops = { 3795 + .init_state = ov5640_init_state, 3791 3796 }; 3792 3797 3793 3798 static int ov5640_get_regulators(struct ov5640_dev *sensor) ··· 3908 3905 return PTR_ERR(sensor->reset_gpio); 3909 3906 3910 3907 v4l2_i2c_subdev_init(&sensor->sd, client, &ov5640_subdev_ops); 3908 + sensor->sd.internal_ops = &ov5640_internal_ops; 3911 3909 3912 3910 sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | 3913 3911 V4L2_SUBDEV_FL_HAS_EVENTS;
+8 -4
drivers/media/i2c/ov5645.c
··· 934 934 return 0; 935 935 } 936 936 937 - static int ov5645_entity_init_cfg(struct v4l2_subdev *subdev, 938 - struct v4l2_subdev_state *sd_state) 937 + static int ov5645_init_state(struct v4l2_subdev *subdev, 938 + struct v4l2_subdev_state *sd_state) 939 939 { 940 940 struct v4l2_subdev_format fmt = { 0 }; 941 941 ··· 1023 1023 }; 1024 1024 1025 1025 static const struct v4l2_subdev_pad_ops ov5645_subdev_pad_ops = { 1026 - .init_cfg = ov5645_entity_init_cfg, 1027 1026 .enum_mbus_code = ov5645_enum_mbus_code, 1028 1027 .enum_frame_size = ov5645_enum_frame_size, 1029 1028 .get_fmt = ov5645_get_format, ··· 1033 1034 static const struct v4l2_subdev_ops ov5645_subdev_ops = { 1034 1035 .video = &ov5645_video_ops, 1035 1036 .pad = &ov5645_subdev_pad_ops, 1037 + }; 1038 + 1039 + static const struct v4l2_subdev_internal_ops ov5645_internal_ops = { 1040 + .init_state = ov5645_init_state, 1036 1041 }; 1037 1042 1038 1043 static int ov5645_probe(struct i2c_client *client) ··· 1165 1162 } 1166 1163 1167 1164 v4l2_i2c_subdev_init(&ov5645->sd, client, &ov5645_subdev_ops); 1165 + ov5645->sd.internal_ops = &ov5645_internal_ops; 1168 1166 ov5645->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1169 1167 ov5645->pad.flags = MEDIA_PAD_FL_SOURCE; 1170 1168 ov5645->sd.dev = &client->dev; ··· 1224 1220 pm_runtime_get_noresume(dev); 1225 1221 pm_runtime_enable(dev); 1226 1222 1227 - ov5645_entity_init_cfg(&ov5645->sd, NULL); 1223 + ov5645_init_state(&ov5645->sd, NULL); 1228 1224 1229 1225 ret = v4l2_async_register_subdev(&ov5645->sd); 1230 1226 if (ret < 0) {
+7 -3
drivers/media/i2c/ov5670.c
··· 2196 2196 return ret; 2197 2197 } 2198 2198 2199 - static int ov5670_init_cfg(struct v4l2_subdev *sd, 2200 - struct v4l2_subdev_state *state) 2199 + static int ov5670_init_state(struct v4l2_subdev *sd, 2200 + struct v4l2_subdev_state *state) 2201 2201 { 2202 2202 struct v4l2_mbus_framefmt *fmt = 2203 2203 v4l2_subdev_state_get_format(state, 0); ··· 2592 2592 }; 2593 2593 2594 2594 static const struct v4l2_subdev_pad_ops ov5670_pad_ops = { 2595 - .init_cfg = ov5670_init_cfg, 2596 2595 .enum_mbus_code = ov5670_enum_mbus_code, 2597 2596 .get_fmt = ov5670_get_pad_format, 2598 2597 .set_fmt = ov5670_set_pad_format, ··· 2609 2610 .video = &ov5670_video_ops, 2610 2611 .pad = &ov5670_pad_ops, 2611 2612 .sensor = &ov5670_sensor_ops, 2613 + }; 2614 + 2615 + static const struct v4l2_subdev_internal_ops ov5670_internal_ops = { 2616 + .init_state = ov5670_init_state, 2612 2617 }; 2613 2618 2614 2619 static const struct media_entity_operations ov5670_subdev_entity_ops = { ··· 2678 2675 2679 2676 /* Initialize subdev */ 2680 2677 v4l2_i2c_subdev_init(&ov5670->sd, client, &ov5670_subdev_ops); 2678 + ov5670->sd.internal_ops = &ov5670_internal_ops; 2681 2679 2682 2680 ret = ov5670_regulators_probe(ov5670); 2683 2681 if (ret)
+8 -4
drivers/media/i2c/ov7251.c
··· 1282 1282 return ret; 1283 1283 } 1284 1284 1285 - static int ov7251_entity_init_cfg(struct v4l2_subdev *subdev, 1286 - struct v4l2_subdev_state *sd_state) 1285 + static int ov7251_init_state(struct v4l2_subdev *subdev, 1286 + struct v4l2_subdev_state *sd_state) 1287 1287 { 1288 1288 struct v4l2_subdev_format fmt = { 1289 1289 .which = sd_state ? V4L2_SUBDEV_FORMAT_TRY ··· 1441 1441 }; 1442 1442 1443 1443 static const struct v4l2_subdev_pad_ops ov7251_subdev_pad_ops = { 1444 - .init_cfg = ov7251_entity_init_cfg, 1445 1444 .enum_mbus_code = ov7251_enum_mbus_code, 1446 1445 .enum_frame_size = ov7251_enum_frame_size, 1447 1446 .enum_frame_interval = ov7251_enum_frame_ival, ··· 1452 1453 static const struct v4l2_subdev_ops ov7251_subdev_ops = { 1453 1454 .video = &ov7251_video_ops, 1454 1455 .pad = &ov7251_subdev_pad_ops, 1456 + }; 1457 + 1458 + static const struct v4l2_subdev_internal_ops ov7251_internal_ops = { 1459 + .init_state = ov7251_init_state, 1455 1460 }; 1456 1461 1457 1462 static int ov7251_check_hwcfg(struct ov7251 *ov7251) ··· 1696 1693 } 1697 1694 1698 1695 v4l2_i2c_subdev_init(&ov7251->sd, client, &ov7251_subdev_ops); 1696 + ov7251->sd.internal_ops = &ov7251_internal_ops; 1699 1697 ov7251->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1700 1698 ov7251->pad.flags = MEDIA_PAD_FL_SOURCE; 1701 1699 ov7251->sd.dev = &client->dev; ··· 1754 1750 goto free_entity; 1755 1751 } 1756 1752 1757 - ov7251_entity_init_cfg(&ov7251->sd, NULL); 1753 + ov7251_init_state(&ov7251->sd, NULL); 1758 1754 1759 1755 return 0; 1760 1756
+7 -3
drivers/media/i2c/ov8858.c
··· 1476 1476 return 0; 1477 1477 } 1478 1478 1479 - static int ov8858_init_cfg(struct v4l2_subdev *sd, 1480 - struct v4l2_subdev_state *sd_state) 1479 + static int ov8858_init_state(struct v4l2_subdev *sd, 1480 + struct v4l2_subdev_state *sd_state) 1481 1481 { 1482 1482 const struct ov8858_mode *def_mode = &ov8858_modes[0]; 1483 1483 struct v4l2_subdev_format fmt = { ··· 1494 1494 } 1495 1495 1496 1496 static const struct v4l2_subdev_pad_ops ov8858_pad_ops = { 1497 - .init_cfg = ov8858_init_cfg, 1498 1497 .enum_mbus_code = ov8858_enum_mbus_code, 1499 1498 .enum_frame_size = ov8858_enum_frame_sizes, 1500 1499 .get_fmt = v4l2_subdev_get_fmt, ··· 1509 1510 .core = &ov8858_core_ops, 1510 1511 .video = &ov8858_video_ops, 1511 1512 .pad = &ov8858_pad_ops, 1513 + }; 1514 + 1515 + static const struct v4l2_subdev_internal_ops ov8858_internal_ops = { 1516 + .init_state = ov8858_init_state, 1512 1517 }; 1513 1518 1514 1519 /* ---------------------------------------------------------------------------- ··· 1902 1899 "Failed to get powerdown gpio\n"); 1903 1900 1904 1901 v4l2_i2c_subdev_init(&ov8858->subdev, client, &ov8858_subdev_ops); 1902 + ov8858->subdev.internal_ops = &ov8858_internal_ops; 1905 1903 1906 1904 ret = ov8858_configure_regulators(ov8858); 1907 1905 if (ret)
+8 -4
drivers/media/i2c/ov9282.c
··· 876 876 } 877 877 878 878 /** 879 - * ov9282_init_cfg() - Initialize sub-device state 879 + * ov9282_init_state() - Initialize sub-device state 880 880 * @sd: pointer to ov9282 V4L2 sub-device structure 881 881 * @sd_state: V4L2 sub-device configuration 882 882 * 883 883 * Return: 0 if successful, error code otherwise. 884 884 */ 885 - static int ov9282_init_cfg(struct v4l2_subdev *sd, 886 - struct v4l2_subdev_state *sd_state) 885 + static int ov9282_init_state(struct v4l2_subdev *sd, 886 + struct v4l2_subdev_state *sd_state) 887 887 { 888 888 struct ov9282 *ov9282 = to_ov9282(sd); 889 889 struct v4l2_subdev_format fmt = { 0 }; ··· 1192 1192 }; 1193 1193 1194 1194 static const struct v4l2_subdev_pad_ops ov9282_pad_ops = { 1195 - .init_cfg = ov9282_init_cfg, 1196 1195 .enum_mbus_code = ov9282_enum_mbus_code, 1197 1196 .enum_frame_size = ov9282_enum_frame_size, 1198 1197 .get_fmt = ov9282_get_pad_format, ··· 1203 1204 .core = &ov9282_core_ops, 1204 1205 .video = &ov9282_video_ops, 1205 1206 .pad = &ov9282_pad_ops, 1207 + }; 1208 + 1209 + static const struct v4l2_subdev_internal_ops ov9282_internal_ops = { 1210 + .init_state = ov9282_init_state, 1206 1211 }; 1207 1212 1208 1213 /** ··· 1397 1394 1398 1395 /* Initialize subdev */ 1399 1396 v4l2_i2c_subdev_init(&ov9282->sd, client, &ov9282_subdev_ops); 1397 + ov9282->sd.internal_ops = &ov9282_internal_ops; 1400 1398 v4l2_i2c_subdev_set_name(&ov9282->sd, client, 1401 1399 device_get_match_data(ov9282->dev), NULL); 1402 1400
+7 -3
drivers/media/i2c/st-vgxy61.c
··· 1322 1322 return ret; 1323 1323 } 1324 1324 1325 - static int vgxy61_init_cfg(struct v4l2_subdev *sd, 1326 - struct v4l2_subdev_state *sd_state) 1325 + static int vgxy61_init_state(struct v4l2_subdev *sd, 1326 + struct v4l2_subdev_state *sd_state) 1327 1327 { 1328 1328 struct vgxy61_dev *sensor = to_vgxy61_dev(sd); 1329 1329 struct v4l2_subdev_format fmt = { 0 }; ··· 1469 1469 }; 1470 1470 1471 1471 static const struct v4l2_subdev_pad_ops vgxy61_pad_ops = { 1472 - .init_cfg = vgxy61_init_cfg, 1473 1472 .enum_mbus_code = vgxy61_enum_mbus_code, 1474 1473 .get_fmt = vgxy61_get_fmt, 1475 1474 .set_fmt = vgxy61_set_fmt, ··· 1479 1480 static const struct v4l2_subdev_ops vgxy61_subdev_ops = { 1480 1481 .video = &vgxy61_video_ops, 1481 1482 .pad = &vgxy61_pad_ops, 1483 + }; 1484 + 1485 + static const struct v4l2_subdev_internal_ops vgxy61_internal_ops = { 1486 + .init_state = vgxy61_init_state, 1482 1487 }; 1483 1488 1484 1489 static const struct media_entity_operations vgxy61_subdev_entity_ops = { ··· 1845 1842 device_property_read_bool(dev, "st,strobe-gpios-polarity"); 1846 1843 1847 1844 v4l2_i2c_subdev_init(&sensor->sd, client, &vgxy61_subdev_ops); 1845 + sensor->sd.internal_ops = &vgxy61_internal_ops; 1848 1846 sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1849 1847 sensor->pad.flags = MEDIA_PAD_FL_SOURCE; 1850 1848 sensor->sd.entity.ops = &vgxy61_subdev_entity_ops;
+7 -3
drivers/media/i2c/tc358746.c
··· 740 740 return v4l2_subdev_call(src, video, s_stream, 0); 741 741 } 742 742 743 - static int tc358746_init_cfg(struct v4l2_subdev *sd, 744 - struct v4l2_subdev_state *state) 743 + static int tc358746_init_state(struct v4l2_subdev *sd, 744 + struct v4l2_subdev_state *state) 745 745 { 746 746 struct v4l2_mbus_framefmt *fmt; 747 747 ··· 1038 1038 }; 1039 1039 1040 1040 static const struct v4l2_subdev_pad_ops tc358746_pad_ops = { 1041 - .init_cfg = tc358746_init_cfg, 1042 1041 .enum_mbus_code = tc358746_enum_mbus_code, 1043 1042 .set_fmt = tc358746_set_fmt, 1044 1043 .get_fmt = v4l2_subdev_get_fmt, ··· 1049 1050 .core = &tc358746_core_ops, 1050 1051 .video = &tc358746_video_ops, 1051 1052 .pad = &tc358746_pad_ops, 1053 + }; 1054 + 1055 + static const struct v4l2_subdev_internal_ops tc358746_internal_ops = { 1056 + .init_state = tc358746_init_state, 1052 1057 }; 1053 1058 1054 1059 static const struct media_entity_operations tc358746_entity_ops = { ··· 1285 1282 int err; 1286 1283 1287 1284 v4l2_i2c_subdev_init(sd, client, &tc358746_ops); 1285 + sd->internal_ops = &tc358746_internal_ops; 1288 1286 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1289 1287 sd->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; 1290 1288 sd->entity.ops = &tc358746_entity_ops;
+7 -3
drivers/media/i2c/tda1997x.c
··· 1734 1734 * v4l2_subdev_pad_ops 1735 1735 */ 1736 1736 1737 - static int tda1997x_init_cfg(struct v4l2_subdev *sd, 1738 - struct v4l2_subdev_state *sd_state) 1737 + static int tda1997x_init_state(struct v4l2_subdev *sd, 1738 + struct v4l2_subdev_state *sd_state) 1739 1739 { 1740 1740 struct tda1997x_state *state = to_state(sd); 1741 1741 struct v4l2_mbus_framefmt *mf; ··· 1925 1925 } 1926 1926 1927 1927 static const struct v4l2_subdev_pad_ops tda1997x_pad_ops = { 1928 - .init_cfg = tda1997x_init_cfg, 1929 1928 .enum_mbus_code = tda1997x_enum_mbus_code, 1930 1929 .get_fmt = tda1997x_get_format, 1931 1930 .set_fmt = tda1997x_set_format, ··· 2044 2045 .core = &tda1997x_core_ops, 2045 2046 .video = &tda1997x_video_ops, 2046 2047 .pad = &tda1997x_pad_ops, 2048 + }; 2049 + 2050 + static const struct v4l2_subdev_internal_ops tda1997x_internal_ops = { 2051 + .init_state = tda1997x_init_state, 2047 2052 }; 2048 2053 2049 2054 /* ----------------------------------------------------------------------------- ··· 2591 2588 /* initialize subdev */ 2592 2589 sd = &state->sd; 2593 2590 v4l2_i2c_subdev_init(sd, client, &tda1997x_subdev_ops); 2591 + sd->internal_ops = &tda1997x_internal_ops; 2594 2592 snprintf(sd->name, sizeof(sd->name), "%s %d-%04x", 2595 2593 id->name, i2c_adapter_id(client->adapter), 2596 2594 client->addr);
+7 -3
drivers/media/i2c/thp7312.c
··· 837 837 return ret; 838 838 } 839 839 840 - static int thp7312_init_cfg(struct v4l2_subdev *sd, 841 - struct v4l2_subdev_state *sd_state) 840 + static int thp7312_init_state(struct v4l2_subdev *sd, 841 + struct v4l2_subdev_state *sd_state) 842 842 { 843 843 const struct thp7312_mode_info *default_mode = &thp7312_mode_info_data[0]; 844 844 struct v4l2_mbus_framefmt *fmt; ··· 875 875 876 876 static const struct v4l2_subdev_pad_ops thp7312_pad_ops = { 877 877 .enum_mbus_code = thp7312_enum_mbus_code, 878 - .init_cfg = thp7312_init_cfg, 879 878 .get_fmt = v4l2_subdev_get_fmt, 880 879 .set_fmt = thp7312_set_fmt, 881 880 .enum_frame_size = thp7312_enum_frame_size, ··· 885 886 .core = &thp7312_core_ops, 886 887 .video = &thp7312_video_ops, 887 888 .pad = &thp7312_pad_ops, 889 + }; 890 + 891 + static const struct v4l2_subdev_internal_ops thp7312_internal_ops = { 892 + .init_state = thp7312_init_state, 888 893 }; 889 894 890 895 /* ----------------------------------------------------------------------------- ··· 2109 2106 return thp7312_register_flash_mode(thp7312); 2110 2107 2111 2108 v4l2_i2c_subdev_init(&thp7312->sd, client, &thp7312_subdev_ops); 2109 + thp7312->sd.internal_ops = &thp7312_internal_ops; 2112 2110 thp7312->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; 2113 2111 thp7312->pad.flags = MEDIA_PAD_FL_SOURCE; 2114 2112 thp7312->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
+3 -3
drivers/media/i2c/tvp5150.c
··· 1209 1209 /**************************************************************************** 1210 1210 V4L2 subdev pad ops 1211 1211 ****************************************************************************/ 1212 - static int tvp5150_init_cfg(struct v4l2_subdev *sd, 1213 - struct v4l2_subdev_state *sd_state) 1212 + static int tvp5150_init_state(struct v4l2_subdev *sd, 1213 + struct v4l2_subdev_state *sd_state) 1214 1214 { 1215 1215 struct tvp5150 *decoder = to_tvp5150(sd); 1216 1216 v4l2_std_id std; ··· 1722 1722 }; 1723 1723 1724 1724 static const struct v4l2_subdev_pad_ops tvp5150_pad_ops = { 1725 - .init_cfg = tvp5150_init_cfg, 1726 1725 .enum_mbus_code = tvp5150_enum_mbus_code, 1727 1726 .enum_frame_size = tvp5150_enum_frame_size, 1728 1727 .set_fmt = tvp5150_fill_fmt, ··· 1740 1741 }; 1741 1742 1742 1743 static const struct v4l2_subdev_internal_ops tvp5150_internal_ops = { 1744 + .init_state = tvp5150_init_state, 1743 1745 .registered = tvp5150_registered, 1744 1746 .open = tvp5150_open, 1745 1747 .close = tvp5150_close,
+7 -3
drivers/media/pci/intel/ivsc/mei_csi.c
··· 346 346 } 347 347 } 348 348 349 - static int mei_csi_init_cfg(struct v4l2_subdev *sd, 350 - struct v4l2_subdev_state *sd_state) 349 + static int mei_csi_init_state(struct v4l2_subdev *sd, 350 + struct v4l2_subdev_state *sd_state) 351 351 { 352 352 struct v4l2_mbus_framefmt *mbusformat; 353 353 struct mei_csi *csi = sd_to_csi(sd); ··· 554 554 }; 555 555 556 556 static const struct v4l2_subdev_pad_ops mei_csi_pad_ops = { 557 - .init_cfg = mei_csi_init_cfg, 558 557 .get_fmt = mei_csi_get_fmt, 559 558 .set_fmt = mei_csi_set_fmt, 560 559 }; ··· 561 562 static const struct v4l2_subdev_ops mei_csi_subdev_ops = { 562 563 .video = &mei_csi_video_ops, 563 564 .pad = &mei_csi_pad_ops, 565 + }; 566 + 567 + static const struct v4l2_subdev_internal_ops mei_csi_internal_ops = { 568 + .init_state = mei_csi_init_state, 564 569 }; 565 570 566 571 static const struct media_entity_operations mei_csi_entity_ops = { ··· 750 747 751 748 csi->subdev.dev = &cldev->dev; 752 749 v4l2_subdev_init(&csi->subdev, &mei_csi_subdev_ops); 750 + csi->subdev.internal_ops = &mei_csi_internal_ops; 753 751 v4l2_set_subdevdata(&csi->subdev, csi); 754 752 csi->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE | 755 753 V4L2_SUBDEV_FL_HAS_EVENTS;
+7 -3
drivers/media/platform/cadence/cdns-csi2rx.c
··· 418 418 return 0; 419 419 } 420 420 421 - static int csi2rx_init_cfg(struct v4l2_subdev *subdev, 422 - struct v4l2_subdev_state *state) 421 + static int csi2rx_init_state(struct v4l2_subdev *subdev, 422 + struct v4l2_subdev_state *state) 423 423 { 424 424 struct v4l2_subdev_format format = { 425 425 .pad = CSI2RX_PAD_SINK, ··· 441 441 static const struct v4l2_subdev_pad_ops csi2rx_pad_ops = { 442 442 .get_fmt = v4l2_subdev_get_fmt, 443 443 .set_fmt = csi2rx_set_fmt, 444 - .init_cfg = csi2rx_init_cfg, 445 444 }; 446 445 447 446 static const struct v4l2_subdev_video_ops csi2rx_video_ops = { ··· 450 451 static const struct v4l2_subdev_ops csi2rx_subdev_ops = { 451 452 .video = &csi2rx_video_ops, 452 453 .pad = &csi2rx_pad_ops, 454 + }; 455 + 456 + static const struct v4l2_subdev_internal_ops csi2rx_internal_ops = { 457 + .init_state = csi2rx_init_state, 453 458 }; 454 459 455 460 static const struct media_entity_operations csi2rx_media_ops = { ··· 666 663 csi2rx->subdev.owner = THIS_MODULE; 667 664 csi2rx->subdev.dev = &pdev->dev; 668 665 v4l2_subdev_init(&csi2rx->subdev, &csi2rx_subdev_ops); 666 + csi2rx->subdev.internal_ops = &csi2rx_internal_ops; 669 667 v4l2_set_subdevdata(&csi2rx->subdev, &pdev->dev); 670 668 snprintf(csi2rx->subdev.name, sizeof(csi2rx->subdev.name), 671 669 "%s.%s", KBUILD_MODNAME, dev_name(&pdev->dev));
+7 -3
drivers/media/platform/microchip/microchip-csi2dc.c
··· 435 435 return ret; 436 436 } 437 437 438 - static int csi2dc_init_cfg(struct v4l2_subdev *csi2dc_sd, 439 - struct v4l2_subdev_state *sd_state) 438 + static int csi2dc_init_state(struct v4l2_subdev *csi2dc_sd, 439 + struct v4l2_subdev_state *sd_state) 440 440 { 441 441 struct v4l2_mbus_framefmt *v4l2_try_fmt = 442 442 v4l2_subdev_state_get_format(sd_state, 0); ··· 461 461 .enum_mbus_code = csi2dc_enum_mbus_code, 462 462 .set_fmt = csi2dc_set_fmt, 463 463 .get_fmt = csi2dc_get_fmt, 464 - .init_cfg = csi2dc_init_cfg, 465 464 }; 466 465 467 466 static const struct v4l2_subdev_video_ops csi2dc_video_ops = { ··· 470 471 static const struct v4l2_subdev_ops csi2dc_subdev_ops = { 471 472 .pad = &csi2dc_pad_ops, 472 473 .video = &csi2dc_video_ops, 474 + }; 475 + 476 + static const struct v4l2_subdev_internal_ops csi2dc_internal_ops = { 477 + .init_state = csi2dc_init_state, 473 478 }; 474 479 475 480 static int csi2dc_async_bound(struct v4l2_async_notifier *notifier, ··· 680 677 } 681 678 682 679 v4l2_subdev_init(&csi2dc->csi2dc_sd, &csi2dc_subdev_ops); 680 + csi2dc->csi2dc_sd.internal_ops = &csi2dc_internal_ops; 683 681 684 682 csi2dc->csi2dc_sd.owner = THIS_MODULE; 685 683 csi2dc->csi2dc_sd.dev = dev;
+7 -3
drivers/media/platform/microchip/microchip-isc-scaler.c
··· 145 145 return 0; 146 146 } 147 147 148 - static int isc_scaler_init_cfg(struct v4l2_subdev *sd, 149 - struct v4l2_subdev_state *sd_state) 148 + static int isc_scaler_init_state(struct v4l2_subdev *sd, 149 + struct v4l2_subdev_state *sd_state) 150 150 { 151 151 struct v4l2_mbus_framefmt *v4l2_try_fmt = 152 152 v4l2_subdev_state_get_format(sd_state, 0); ··· 170 170 .set_fmt = isc_scaler_set_fmt, 171 171 .get_fmt = isc_scaler_get_fmt, 172 172 .get_selection = isc_scaler_g_sel, 173 - .init_cfg = isc_scaler_init_cfg, 174 173 }; 175 174 176 175 static const struct media_entity_operations isc_scaler_entity_ops = { ··· 180 181 .pad = &isc_scaler_pad_ops, 181 182 }; 182 183 184 + static const struct v4l2_subdev_internal_ops isc_scaler_internal_ops = { 185 + .init_state = isc_scaler_init_state, 186 + }; 187 + 183 188 int isc_scaler_init(struct isc_device *isc) 184 189 { 185 190 int ret; 186 191 187 192 v4l2_subdev_init(&isc->scaler_sd, &xisc_scaler_subdev_ops); 193 + isc->scaler_sd.internal_ops = &isc_scaler_internal_ops; 188 194 189 195 isc->scaler_sd.owner = THIS_MODULE; 190 196 isc->scaler_sd.dev = isc->dev;
+7 -3
drivers/media/platform/nxp/imx-mipi-csis.c
··· 1122 1122 return 0; 1123 1123 } 1124 1124 1125 - static int mipi_csis_init_cfg(struct v4l2_subdev *sd, 1126 - struct v4l2_subdev_state *sd_state) 1125 + static int mipi_csis_init_state(struct v4l2_subdev *sd, 1126 + struct v4l2_subdev_state *sd_state) 1127 1127 { 1128 1128 struct v4l2_subdev_format fmt = { 1129 1129 .pad = CSIS_PAD_SINK, ··· 1163 1163 }; 1164 1164 1165 1165 static const struct v4l2_subdev_pad_ops mipi_csis_pad_ops = { 1166 - .init_cfg = mipi_csis_init_cfg, 1167 1166 .enum_mbus_code = mipi_csis_enum_mbus_code, 1168 1167 .get_fmt = v4l2_subdev_get_fmt, 1169 1168 .set_fmt = mipi_csis_set_fmt, ··· 1173 1174 .core = &mipi_csis_core_ops, 1174 1175 .video = &mipi_csis_video_ops, 1175 1176 .pad = &mipi_csis_pad_ops, 1177 + }; 1178 + 1179 + static const struct v4l2_subdev_internal_ops mipi_csis_internal_ops = { 1180 + .init_state = mipi_csis_init_state, 1176 1181 }; 1177 1182 1178 1183 /* ----------------------------------------------------------------------------- ··· 1353 1350 int ret; 1354 1351 1355 1352 v4l2_subdev_init(sd, &mipi_csis_subdev_ops); 1353 + sd->internal_ops = &mipi_csis_internal_ops; 1356 1354 sd->owner = THIS_MODULE; 1357 1355 snprintf(sd->name, sizeof(sd->name), "csis-%s", 1358 1356 dev_name(csis->dev));
+3 -3
drivers/media/platform/nxp/imx7-media-csi.c
··· 1729 1729 return ret; 1730 1730 } 1731 1731 1732 - static int imx7_csi_init_cfg(struct v4l2_subdev *sd, 1733 - struct v4l2_subdev_state *sd_state) 1732 + static int imx7_csi_init_state(struct v4l2_subdev *sd, 1733 + struct v4l2_subdev_state *sd_state) 1734 1734 { 1735 1735 const struct imx7_csi_pixfmt *cc; 1736 1736 int i; ··· 2006 2006 }; 2007 2007 2008 2008 static const struct v4l2_subdev_pad_ops imx7_csi_pad_ops = { 2009 - .init_cfg = imx7_csi_init_cfg, 2010 2009 .enum_mbus_code = imx7_csi_enum_mbus_code, 2011 2010 .get_fmt = v4l2_subdev_get_fmt, 2012 2011 .set_fmt = imx7_csi_set_fmt, ··· 2018 2019 }; 2019 2020 2020 2021 static const struct v4l2_subdev_internal_ops imx7_csi_internal_ops = { 2022 + .init_state = imx7_csi_init_state, 2021 2023 .registered = imx7_csi_registered, 2022 2024 .unregistered = imx7_csi_unregistered, 2023 2025 };
+7 -3
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
··· 176 176 return sd; 177 177 } 178 178 179 - static int mxc_isi_crossbar_init_cfg(struct v4l2_subdev *sd, 180 - struct v4l2_subdev_state *state) 179 + static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd, 180 + struct v4l2_subdev_state *state) 181 181 { 182 182 struct mxc_isi_crossbar *xbar = to_isi_crossbar(sd); 183 183 struct v4l2_subdev_krouting routing = { }; ··· 404 404 } 405 405 406 406 static const struct v4l2_subdev_pad_ops mxc_isi_crossbar_subdev_pad_ops = { 407 - .init_cfg = mxc_isi_crossbar_init_cfg, 408 407 .enum_mbus_code = mxc_isi_crossbar_enum_mbus_code, 409 408 .get_fmt = v4l2_subdev_get_fmt, 410 409 .set_fmt = mxc_isi_crossbar_set_fmt, ··· 414 415 415 416 static const struct v4l2_subdev_ops mxc_isi_crossbar_subdev_ops = { 416 417 .pad = &mxc_isi_crossbar_subdev_pad_ops, 418 + }; 419 + 420 + static const struct v4l2_subdev_internal_ops mxc_isi_crossbar_internal_ops = { 421 + .init_state = mxc_isi_crossbar_init_state, 417 422 }; 418 423 419 424 static const struct media_entity_operations mxc_isi_cross_entity_ops = { ··· 441 438 xbar->isi = isi; 442 439 443 440 v4l2_subdev_init(sd, &mxc_isi_crossbar_subdev_ops); 441 + sd->internal_ops = &mxc_isi_crossbar_internal_ops; 444 442 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_STREAMS; 445 443 strscpy(sd->name, "crossbar", sizeof(sd->name)); 446 444 sd->dev = isi->dev;
+7 -3
drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c
··· 341 341 return v4l2_subdev_state_get_compose(state, pad); 342 342 } 343 343 344 - static int mxc_isi_pipe_init_cfg(struct v4l2_subdev *sd, 345 - struct v4l2_subdev_state *state) 344 + static int mxc_isi_pipe_init_state(struct v4l2_subdev *sd, 345 + struct v4l2_subdev_state *state) 346 346 { 347 347 struct mxc_isi_pipe *pipe = to_isi_pipe(sd); 348 348 struct v4l2_mbus_framefmt *fmt_source; ··· 682 682 } 683 683 684 684 static const struct v4l2_subdev_pad_ops mxc_isi_pipe_subdev_pad_ops = { 685 - .init_cfg = mxc_isi_pipe_init_cfg, 686 685 .enum_mbus_code = mxc_isi_pipe_enum_mbus_code, 687 686 .get_fmt = v4l2_subdev_get_fmt, 688 687 .set_fmt = mxc_isi_pipe_set_fmt, ··· 691 692 692 693 static const struct v4l2_subdev_ops mxc_isi_pipe_subdev_ops = { 693 694 .pad = &mxc_isi_pipe_subdev_pad_ops, 695 + }; 696 + 697 + static const struct v4l2_subdev_internal_ops mxc_isi_pipe_internal_ops = { 698 + .init_state = mxc_isi_pipe_init_state, 694 699 }; 695 700 696 701 /* ----------------------------------------------------------------------------- ··· 770 767 771 768 sd = &pipe->sd; 772 769 v4l2_subdev_init(sd, &mxc_isi_pipe_subdev_ops); 770 + sd->internal_ops = &mxc_isi_pipe_internal_ops; 773 771 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 774 772 snprintf(sd->name, sizeof(sd->name), "mxc_isi.%d", pipe->id); 775 773 sd->dev = isi->dev;
+7 -3
drivers/media/platform/nxp/imx8mq-mipi-csi2.c
··· 437 437 return ret; 438 438 } 439 439 440 - static int imx8mq_mipi_csi_init_cfg(struct v4l2_subdev *sd, 441 - struct v4l2_subdev_state *sd_state) 440 + static int imx8mq_mipi_csi_init_state(struct v4l2_subdev *sd, 441 + struct v4l2_subdev_state *sd_state) 442 442 { 443 443 struct v4l2_mbus_framefmt *fmt_sink; 444 444 struct v4l2_mbus_framefmt *fmt_source; ··· 535 535 }; 536 536 537 537 static const struct v4l2_subdev_pad_ops imx8mq_mipi_csi_pad_ops = { 538 - .init_cfg = imx8mq_mipi_csi_init_cfg, 539 538 .enum_mbus_code = imx8mq_mipi_csi_enum_mbus_code, 540 539 .get_fmt = v4l2_subdev_get_fmt, 541 540 .set_fmt = imx8mq_mipi_csi_set_fmt, ··· 543 544 static const struct v4l2_subdev_ops imx8mq_mipi_csi_subdev_ops = { 544 545 .video = &imx8mq_mipi_csi_video_ops, 545 546 .pad = &imx8mq_mipi_csi_pad_ops, 547 + }; 548 + 549 + static const struct v4l2_subdev_internal_ops imx8mq_mipi_csi_internal_ops = { 550 + .init_state = imx8mq_mipi_csi_init_state, 546 551 }; 547 552 548 553 /* ----------------------------------------------------------------------------- ··· 763 760 int ret; 764 761 765 762 v4l2_subdev_init(sd, &imx8mq_mipi_csi_subdev_ops); 763 + sd->internal_ops = &imx8mq_mipi_csi_internal_ops; 766 764 sd->owner = THIS_MODULE; 767 765 snprintf(sd->name, sizeof(sd->name), "%s %s", 768 766 MIPI_CSI2_SUBDEV_NAME, dev_name(state->dev));
+7 -3
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
··· 530 530 return 0; 531 531 } 532 532 533 - static int rzg2l_csi2_init_config(struct v4l2_subdev *sd, 534 - struct v4l2_subdev_state *sd_state) 533 + static int rzg2l_csi2_init_state(struct v4l2_subdev *sd, 534 + struct v4l2_subdev_state *sd_state) 535 535 { 536 536 struct v4l2_subdev_format fmt = { .pad = RZG2L_CSI2_SINK, }; 537 537 ··· 582 582 583 583 static const struct v4l2_subdev_pad_ops rzg2l_csi2_pad_ops = { 584 584 .enum_mbus_code = rzg2l_csi2_enum_mbus_code, 585 - .init_cfg = rzg2l_csi2_init_config, 586 585 .enum_frame_size = rzg2l_csi2_enum_frame_size, 587 586 .set_fmt = rzg2l_csi2_set_format, 588 587 .get_fmt = v4l2_subdev_get_fmt, ··· 590 591 static const struct v4l2_subdev_ops rzg2l_csi2_subdev_ops = { 591 592 .video = &rzg2l_csi2_video_ops, 592 593 .pad = &rzg2l_csi2_pad_ops, 594 + }; 595 + 596 + static const struct v4l2_subdev_internal_ops rzg2l_csi2_internal_ops = { 597 + .init_state = rzg2l_csi2_init_state, 593 598 }; 594 599 595 600 /* ----------------------------------------------------------------------------- ··· 780 777 781 778 csi2->subdev.dev = &pdev->dev; 782 779 v4l2_subdev_init(&csi2->subdev, &rzg2l_csi2_subdev_ops); 780 + csi2->subdev.internal_ops = &rzg2l_csi2_internal_ops; 783 781 v4l2_set_subdevdata(&csi2->subdev, &pdev->dev); 784 782 snprintf(csi2->subdev.name, sizeof(csi2->subdev.name), 785 783 "csi-%s", dev_name(&pdev->dev));
+7 -3
drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c
··· 168 168 return 0; 169 169 } 170 170 171 - static int rzg2l_cru_ip_init_config(struct v4l2_subdev *sd, 172 - struct v4l2_subdev_state *sd_state) 171 + static int rzg2l_cru_ip_init_state(struct v4l2_subdev *sd, 172 + struct v4l2_subdev_state *sd_state) 173 173 { 174 174 struct v4l2_subdev_format fmt = { .pad = RZG2L_CRU_IP_SINK, }; 175 175 ··· 192 192 static const struct v4l2_subdev_pad_ops rzg2l_cru_ip_pad_ops = { 193 193 .enum_mbus_code = rzg2l_cru_ip_enum_mbus_code, 194 194 .enum_frame_size = rzg2l_cru_ip_enum_frame_size, 195 - .init_cfg = rzg2l_cru_ip_init_config, 196 195 .get_fmt = v4l2_subdev_get_fmt, 197 196 .set_fmt = rzg2l_cru_ip_set_format, 198 197 }; ··· 199 200 static const struct v4l2_subdev_ops rzg2l_cru_ip_subdev_ops = { 200 201 .video = &rzg2l_cru_ip_video_ops, 201 202 .pad = &rzg2l_cru_ip_pad_ops, 203 + }; 204 + 205 + static const struct v4l2_subdev_internal_ops rzg2l_cru_ip_internal_ops = { 206 + .init_state = rzg2l_cru_ip_init_state, 202 207 }; 203 208 204 209 static const struct media_entity_operations rzg2l_cru_ip_entity_ops = { ··· 216 213 217 214 ip->subdev.dev = cru->dev; 218 215 v4l2_subdev_init(&ip->subdev, &rzg2l_cru_ip_subdev_ops); 216 + ip->subdev.internal_ops = &rzg2l_cru_ip_internal_ops; 219 217 v4l2_set_subdevdata(&ip->subdev, cru); 220 218 snprintf(ip->subdev.name, sizeof(ip->subdev.name), 221 219 "cru-ip-%s", dev_name(cru->dev));
-1
drivers/media/platform/renesas/vsp1/vsp1_brx.c
··· 264 264 } 265 265 266 266 static const struct v4l2_subdev_pad_ops brx_pad_ops = { 267 - .init_cfg = vsp1_entity_init_cfg, 268 267 .enum_mbus_code = brx_enum_mbus_code, 269 268 .enum_frame_size = brx_enum_frame_size, 270 269 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_clu.c
··· 155 155 */ 156 156 157 157 static const struct v4l2_subdev_pad_ops clu_pad_ops = { 158 - .init_cfg = vsp1_entity_init_cfg, 159 158 .enum_mbus_code = clu_enum_mbus_code, 160 159 .enum_frame_size = clu_enum_frame_size, 161 160 .get_fmt = vsp1_subdev_get_pad_format,
+25 -28
drivers/media/platform/renesas/vsp1/vsp1_entity.c
··· 171 171 } 172 172 173 173 /* 174 - * vsp1_entity_init_cfg - Initialize formats on all pads 175 - * @subdev: V4L2 subdevice 176 - * @sd_state: V4L2 subdev state 177 - * 178 - * Initialize all pad formats with default values in the given subdev state. 179 - * This function can be used as a handler for the subdev pad::init_cfg 180 - * operation. 181 - */ 182 - int vsp1_entity_init_cfg(struct v4l2_subdev *subdev, 183 - struct v4l2_subdev_state *sd_state) 184 - { 185 - unsigned int pad; 186 - 187 - for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) { 188 - struct v4l2_subdev_format format = { 189 - .pad = pad, 190 - .which = sd_state ? V4L2_SUBDEV_FORMAT_TRY 191 - : V4L2_SUBDEV_FORMAT_ACTIVE, 192 - }; 193 - 194 - v4l2_subdev_call(subdev, pad, set_fmt, sd_state, &format); 195 - } 196 - 197 - return 0; 198 - } 199 - 200 - /* 201 174 * vsp1_subdev_get_pad_format - Subdev pad get_fmt handler 202 175 * @subdev: V4L2 subdevice 203 176 * @sd_state: V4L2 subdev state ··· 396 423 mutex_unlock(&entity->lock); 397 424 return ret; 398 425 } 426 + 427 + static int vsp1_entity_init_state(struct v4l2_subdev *subdev, 428 + struct v4l2_subdev_state *sd_state) 429 + { 430 + unsigned int pad; 431 + 432 + /* Initialize all pad formats with default values. */ 433 + for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) { 434 + struct v4l2_subdev_format format = { 435 + .pad = pad, 436 + .which = sd_state ? V4L2_SUBDEV_FORMAT_TRY 437 + : V4L2_SUBDEV_FORMAT_ACTIVE, 438 + }; 439 + 440 + v4l2_subdev_call(subdev, pad, set_fmt, sd_state, &format); 441 + } 442 + 443 + return 0; 444 + } 445 + 446 + static const struct v4l2_subdev_internal_ops vsp1_entity_internal_ops = { 447 + .init_state = vsp1_entity_init_state, 448 + }; 399 449 400 450 /* ----------------------------------------------------------------------------- 401 451 * Media Operations ··· 654 658 /* Initialize the V4L2 subdev. */ 655 659 subdev = &entity->subdev; 656 660 v4l2_subdev_init(subdev, ops); 661 + subdev->internal_ops = &vsp1_entity_internal_ops; 657 662 658 663 subdev->entity.function = function; 659 664 subdev->entity.ops = &vsp1->media_ops; ··· 663 666 snprintf(subdev->name, sizeof(subdev->name), "%s %s", 664 667 dev_name(vsp1->dev), name); 665 668 666 - vsp1_entity_init_cfg(subdev, NULL); 669 + vsp1_entity_init_state(subdev, NULL); 667 670 668 671 /* 669 672 * Allocate the subdev state to store formats and selection
-2
drivers/media/platform/renesas/vsp1/vsp1_entity.h
··· 146 146 vsp1_entity_get_pad_selection(struct vsp1_entity *entity, 147 147 struct v4l2_subdev_state *sd_state, 148 148 unsigned int pad, unsigned int target); 149 - int vsp1_entity_init_cfg(struct v4l2_subdev *subdev, 150 - struct v4l2_subdev_state *sd_state); 151 149 152 150 void vsp1_entity_route_setup(struct vsp1_entity *entity, 153 151 struct vsp1_pipeline *pipe,
-1
drivers/media/platform/renesas/vsp1/vsp1_hsit.c
··· 113 113 } 114 114 115 115 static const struct v4l2_subdev_pad_ops hsit_pad_ops = { 116 - .init_cfg = vsp1_entity_init_cfg, 117 116 .enum_mbus_code = hsit_enum_mbus_code, 118 117 .enum_frame_size = hsit_enum_frame_size, 119 118 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_lif.c
··· 68 68 } 69 69 70 70 static const struct v4l2_subdev_pad_ops lif_pad_ops = { 71 - .init_cfg = vsp1_entity_init_cfg, 72 71 .enum_mbus_code = lif_enum_mbus_code, 73 72 .enum_frame_size = lif_enum_frame_size, 74 73 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_lut.c
··· 131 131 */ 132 132 133 133 static const struct v4l2_subdev_pad_ops lut_pad_ops = { 134 - .init_cfg = vsp1_entity_init_cfg, 135 134 .enum_mbus_code = lut_enum_mbus_code, 136 135 .enum_frame_size = lut_enum_frame_size, 137 136 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
··· 240 240 } 241 241 242 242 static const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = { 243 - .init_cfg = vsp1_entity_init_cfg, 244 243 .enum_mbus_code = vsp1_rwpf_enum_mbus_code, 245 244 .enum_frame_size = vsp1_rwpf_enum_frame_size, 246 245 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_sru.c
··· 252 252 } 253 253 254 254 static const struct v4l2_subdev_pad_ops sru_pad_ops = { 255 - .init_cfg = vsp1_entity_init_cfg, 256 255 .enum_mbus_code = sru_enum_mbus_code, 257 256 .enum_frame_size = sru_enum_frame_size, 258 257 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_uds.c
··· 239 239 */ 240 240 241 241 static const struct v4l2_subdev_pad_ops uds_pad_ops = { 242 - .init_cfg = vsp1_entity_init_cfg, 243 242 .enum_mbus_code = uds_enum_mbus_code, 244 243 .enum_frame_size = uds_enum_frame_size, 245 244 .get_fmt = vsp1_subdev_get_pad_format,
-1
drivers/media/platform/renesas/vsp1/vsp1_uif.c
··· 174 174 */ 175 175 176 176 static const struct v4l2_subdev_pad_ops uif_pad_ops = { 177 - .init_cfg = vsp1_entity_init_cfg, 178 177 .enum_mbus_code = uif_enum_mbus_code, 179 178 .enum_frame_size = uif_enum_frame_size, 180 179 .get_fmt = vsp1_subdev_get_pad_format,
+7 -3
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c
··· 270 270 return -EINVAL; 271 271 } 272 272 273 - static int rkisp1_csi_init_config(struct v4l2_subdev *sd, 274 - struct v4l2_subdev_state *sd_state) 273 + static int rkisp1_csi_init_state(struct v4l2_subdev *sd, 274 + struct v4l2_subdev_state *sd_state) 275 275 { 276 276 struct v4l2_mbus_framefmt *sink_fmt, *src_fmt; 277 277 ··· 405 405 406 406 static const struct v4l2_subdev_pad_ops rkisp1_csi_pad_ops = { 407 407 .enum_mbus_code = rkisp1_csi_enum_mbus_code, 408 - .init_cfg = rkisp1_csi_init_config, 409 408 .get_fmt = v4l2_subdev_get_fmt, 410 409 .set_fmt = rkisp1_csi_set_fmt, 411 410 }; ··· 412 413 static const struct v4l2_subdev_ops rkisp1_csi_ops = { 413 414 .video = &rkisp1_csi_video_ops, 414 415 .pad = &rkisp1_csi_pad_ops, 416 + }; 417 + 418 + static const struct v4l2_subdev_internal_ops rkisp1_csi_internal_ops = { 419 + .init_state = rkisp1_csi_init_state, 415 420 }; 416 421 417 422 int rkisp1_csi_register(struct rkisp1_device *rkisp1) ··· 429 426 430 427 sd = &csi->sd; 431 428 v4l2_subdev_init(sd, &rkisp1_csi_ops); 429 + sd->internal_ops = &rkisp1_csi_internal_ops; 432 430 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 433 431 sd->entity.ops = &rkisp1_csi_media_ops; 434 432 sd->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
+7 -3
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
··· 409 409 return 0; 410 410 } 411 411 412 - static int rkisp1_isp_init_config(struct v4l2_subdev *sd, 413 - struct v4l2_subdev_state *sd_state) 412 + static int rkisp1_isp_init_state(struct v4l2_subdev *sd, 413 + struct v4l2_subdev_state *sd_state) 414 414 { 415 415 struct v4l2_mbus_framefmt *sink_fmt, *src_fmt; 416 416 struct v4l2_rect *sink_crop, *src_crop; ··· 769 769 .enum_frame_size = rkisp1_isp_enum_frame_size, 770 770 .get_selection = rkisp1_isp_get_selection, 771 771 .set_selection = rkisp1_isp_set_selection, 772 - .init_cfg = rkisp1_isp_init_config, 773 772 .get_fmt = v4l2_subdev_get_fmt, 774 773 .set_fmt = rkisp1_isp_set_fmt, 775 774 .link_validate = v4l2_subdev_link_validate_default, ··· 879 880 .pad = &rkisp1_isp_pad_ops, 880 881 }; 881 882 883 + static const struct v4l2_subdev_internal_ops rkisp1_isp_internal_ops = { 884 + .init_state = rkisp1_isp_init_state, 885 + }; 886 + 882 887 int rkisp1_isp_register(struct rkisp1_device *rkisp1) 883 888 { 884 889 struct rkisp1_isp *isp = &rkisp1->isp; ··· 893 890 isp->rkisp1 = rkisp1; 894 891 895 892 v4l2_subdev_init(sd, &rkisp1_isp_ops); 893 + sd->internal_ops = &rkisp1_isp_internal_ops; 896 894 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; 897 895 sd->entity.ops = &rkisp1_isp_media_ops; 898 896 sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
+7 -3
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
··· 366 366 return ret; 367 367 } 368 368 369 - static int rkisp1_rsz_init_config(struct v4l2_subdev *sd, 370 - struct v4l2_subdev_state *sd_state) 369 + static int rkisp1_rsz_init_state(struct v4l2_subdev *sd, 370 + struct v4l2_subdev_state *sd_state) 371 371 { 372 372 struct v4l2_mbus_framefmt *sink_fmt, *src_fmt; 373 373 struct v4l2_rect *sink_crop; ··· 605 605 .enum_mbus_code = rkisp1_rsz_enum_mbus_code, 606 606 .get_selection = rkisp1_rsz_get_selection, 607 607 .set_selection = rkisp1_rsz_set_selection, 608 - .init_cfg = rkisp1_rsz_init_config, 609 608 .get_fmt = v4l2_subdev_get_fmt, 610 609 .set_fmt = rkisp1_rsz_set_fmt, 611 610 .link_validate = v4l2_subdev_link_validate_default, ··· 651 652 .pad = &rkisp1_rsz_pad_ops, 652 653 }; 653 654 655 + static const struct v4l2_subdev_internal_ops rkisp1_rsz_internal_ops = { 656 + .init_state = rkisp1_rsz_init_state, 657 + }; 658 + 654 659 static void rkisp1_rsz_unregister(struct rkisp1_resizer *rsz) 655 660 { 656 661 if (!rsz->rkisp1) ··· 684 681 } 685 682 686 683 v4l2_subdev_init(sd, &rkisp1_rsz_ops); 684 + sd->internal_ops = &rkisp1_rsz_internal_ops; 687 685 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 688 686 sd->entity.ops = &rkisp1_rsz_media_ops; 689 687 sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER;
+1
drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
··· 211 211 212 212 /* Initialize subdev */ 213 213 v4l2_subdev_init(subdev, &sun4i_csi_subdev_ops); 214 + subdev->internal_ops = &sun4i_csi_subdev_internal_ops; 214 215 subdev->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; 215 216 subdev->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; 216 217 subdev->owner = THIS_MODULE;
+1
drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.h
··· 89 89 }; 90 90 91 91 extern const struct v4l2_subdev_ops sun4i_csi_subdev_ops; 92 + extern const struct v4l2_subdev_internal_ops sun4i_csi_subdev_internal_ops; 92 93 93 94 struct sun4i_csi_format { 94 95 u32 mbus;
+6 -3
drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c
··· 266 266 .xfer_func = V4L2_XFER_FUNC_DEFAULT, 267 267 }; 268 268 269 - static int sun4i_csi_subdev_init_cfg(struct v4l2_subdev *subdev, 270 - struct v4l2_subdev_state *sd_state) 269 + static int sun4i_csi_subdev_init_state(struct v4l2_subdev *subdev, 270 + struct v4l2_subdev_state *sd_state) 271 271 { 272 272 struct v4l2_mbus_framefmt *fmt; 273 273 ··· 334 334 335 335 static const struct v4l2_subdev_pad_ops sun4i_csi_subdev_pad_ops = { 336 336 .link_validate = v4l2_subdev_link_validate_default, 337 - .init_cfg = sun4i_csi_subdev_init_cfg, 338 337 .get_fmt = sun4i_csi_subdev_get_fmt, 339 338 .set_fmt = sun4i_csi_subdev_set_fmt, 340 339 .enum_mbus_code = sun4i_csi_subdev_enum_mbus_code, ··· 341 342 342 343 const struct v4l2_subdev_ops sun4i_csi_subdev_ops = { 343 344 .pad = &sun4i_csi_subdev_pad_ops, 345 + }; 346 + 347 + const struct v4l2_subdev_internal_ops sun4i_csi_subdev_internal_ops = { 348 + .init_state = sun4i_csi_subdev_init_state, 344 349 }; 345 350 346 351 int sun4i_csi_v4l2_register(struct sun4i_csi *csi)
+7 -3
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c
··· 501 501 mbus_format->xfer_func = V4L2_XFER_FUNC_DEFAULT; 502 502 } 503 503 504 - static int sun6i_csi_bridge_init_cfg(struct v4l2_subdev *subdev, 505 - struct v4l2_subdev_state *state) 504 + static int sun6i_csi_bridge_init_state(struct v4l2_subdev *subdev, 505 + struct v4l2_subdev_state *state) 506 506 { 507 507 struct sun6i_csi_device *csi_dev = v4l2_get_subdevdata(subdev); 508 508 unsigned int pad = SUN6I_CSI_BRIDGE_PAD_SINK; ··· 581 581 } 582 582 583 583 static const struct v4l2_subdev_pad_ops sun6i_csi_bridge_pad_ops = { 584 - .init_cfg = sun6i_csi_bridge_init_cfg, 585 584 .enum_mbus_code = sun6i_csi_bridge_enum_mbus_code, 586 585 .get_fmt = sun6i_csi_bridge_get_fmt, 587 586 .set_fmt = sun6i_csi_bridge_set_fmt, ··· 589 590 static const struct v4l2_subdev_ops sun6i_csi_bridge_subdev_ops = { 590 591 .video = &sun6i_csi_bridge_video_ops, 591 592 .pad = &sun6i_csi_bridge_pad_ops, 593 + }; 594 + 595 + static const struct v4l2_subdev_internal_ops sun6i_csi_bridge_internal_ops = { 596 + .init_state = sun6i_csi_bridge_init_state, 592 597 }; 593 598 594 599 /* Media Entity */ ··· 785 782 /* V4L2 Subdev */ 786 783 787 784 v4l2_subdev_init(subdev, &sun6i_csi_bridge_subdev_ops); 785 + subdev->internal_ops = &sun6i_csi_bridge_internal_ops; 788 786 strscpy(subdev->name, SUN6I_CSI_BRIDGE_NAME, sizeof(subdev->name)); 789 787 subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 790 788 subdev->owner = THIS_MODULE;
+7 -3
drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c
··· 305 305 mbus_format->xfer_func = V4L2_XFER_FUNC_DEFAULT; 306 306 } 307 307 308 - static int sun6i_mipi_csi2_init_cfg(struct v4l2_subdev *subdev, 309 - struct v4l2_subdev_state *state) 308 + static int sun6i_mipi_csi2_init_state(struct v4l2_subdev *subdev, 309 + struct v4l2_subdev_state *state) 310 310 { 311 311 struct sun6i_mipi_csi2_device *csi2_dev = v4l2_get_subdevdata(subdev); 312 312 unsigned int pad = SUN6I_MIPI_CSI2_PAD_SINK; ··· 385 385 } 386 386 387 387 static const struct v4l2_subdev_pad_ops sun6i_mipi_csi2_pad_ops = { 388 - .init_cfg = sun6i_mipi_csi2_init_cfg, 389 388 .enum_mbus_code = sun6i_mipi_csi2_enum_mbus_code, 390 389 .get_fmt = sun6i_mipi_csi2_get_fmt, 391 390 .set_fmt = sun6i_mipi_csi2_set_fmt, ··· 393 394 static const struct v4l2_subdev_ops sun6i_mipi_csi2_subdev_ops = { 394 395 .video = &sun6i_mipi_csi2_video_ops, 395 396 .pad = &sun6i_mipi_csi2_pad_ops, 397 + }; 398 + 399 + static const struct v4l2_subdev_internal_ops sun6i_mipi_csi2_internal_ops = { 400 + .init_state = sun6i_mipi_csi2_init_state, 396 401 }; 397 402 398 403 /* Media Entity */ ··· 507 504 /* V4L2 Subdev */ 508 505 509 506 v4l2_subdev_init(subdev, &sun6i_mipi_csi2_subdev_ops); 507 + subdev->internal_ops = &sun6i_mipi_csi2_internal_ops; 510 508 strscpy(subdev->name, SUN6I_MIPI_CSI2_NAME, sizeof(subdev->name)); 511 509 subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 512 510 subdev->owner = THIS_MODULE;
+7 -3
drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c
··· 338 338 mbus_format->xfer_func = V4L2_XFER_FUNC_DEFAULT; 339 339 } 340 340 341 - static int sun8i_a83t_mipi_csi2_init_cfg(struct v4l2_subdev *subdev, 342 - struct v4l2_subdev_state *state) 341 + static int sun8i_a83t_mipi_csi2_init_state(struct v4l2_subdev *subdev, 342 + struct v4l2_subdev_state *state) 343 343 { 344 344 struct sun8i_a83t_mipi_csi2_device *csi2_dev = 345 345 v4l2_get_subdevdata(subdev); ··· 422 422 } 423 423 424 424 static const struct v4l2_subdev_pad_ops sun8i_a83t_mipi_csi2_pad_ops = { 425 - .init_cfg = sun8i_a83t_mipi_csi2_init_cfg, 426 425 .enum_mbus_code = sun8i_a83t_mipi_csi2_enum_mbus_code, 427 426 .get_fmt = sun8i_a83t_mipi_csi2_get_fmt, 428 427 .set_fmt = sun8i_a83t_mipi_csi2_set_fmt, ··· 430 431 static const struct v4l2_subdev_ops sun8i_a83t_mipi_csi2_subdev_ops = { 431 432 .video = &sun8i_a83t_mipi_csi2_video_ops, 432 433 .pad = &sun8i_a83t_mipi_csi2_pad_ops, 434 + }; 435 + 436 + static const struct v4l2_subdev_internal_ops sun8i_a83t_mipi_csi2_internal_ops = { 437 + .init_state = sun8i_a83t_mipi_csi2_init_state, 433 438 }; 434 439 435 440 /* Media Entity */ ··· 545 542 /* V4L2 Subdev */ 546 543 547 544 v4l2_subdev_init(subdev, &sun8i_a83t_mipi_csi2_subdev_ops); 545 + subdev->internal_ops = &sun8i_a83t_mipi_csi2_internal_ops; 548 546 strscpy(subdev->name, SUN8I_A83T_MIPI_CSI2_NAME, sizeof(subdev->name)); 549 547 subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 550 548 subdev->owner = THIS_MODULE;
+7 -3
drivers/media/platform/ti/cal/cal-camerarx.c
··· 721 721 return 0; 722 722 } 723 723 724 - static int cal_camerarx_sd_init_cfg(struct v4l2_subdev *sd, 725 - struct v4l2_subdev_state *state) 724 + static int cal_camerarx_sd_init_state(struct v4l2_subdev *sd, 725 + struct v4l2_subdev_state *state) 726 726 { 727 727 struct v4l2_subdev_format format = { 728 728 .which = state ? V4L2_SUBDEV_FORMAT_TRY ··· 782 782 }; 783 783 784 784 static const struct v4l2_subdev_pad_ops cal_camerarx_pad_ops = { 785 - .init_cfg = cal_camerarx_sd_init_cfg, 786 785 .enum_mbus_code = cal_camerarx_sd_enum_mbus_code, 787 786 .enum_frame_size = cal_camerarx_sd_enum_frame_size, 788 787 .get_fmt = v4l2_subdev_get_fmt, ··· 792 793 static const struct v4l2_subdev_ops cal_camerarx_subdev_ops = { 793 794 .video = &cal_camerarx_video_ops, 794 795 .pad = &cal_camerarx_pad_ops, 796 + }; 797 + 798 + static const struct v4l2_subdev_internal_ops cal_camerarx_internal_ops = { 799 + .init_state = cal_camerarx_sd_init_state, 795 800 }; 796 801 797 802 static struct media_entity_operations cal_camerarx_media_ops = { ··· 849 846 /* Initialize the V4L2 subdev and media entity. */ 850 847 sd = &phy->subdev; 851 848 v4l2_subdev_init(sd, &cal_camerarx_subdev_ops); 849 + sd->internal_ops = &cal_camerarx_internal_ops; 852 850 sd->entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; 853 851 sd->flags = V4L2_SUBDEV_FL_HAS_DEVNODE; 854 852 snprintf(sd->name, sizeof(sd->name), "CAMERARX%u", instance);
+7 -3
drivers/media/platform/video-mux.c
··· 282 282 return 0; 283 283 } 284 284 285 - static int video_mux_init_cfg(struct v4l2_subdev *sd, 286 - struct v4l2_subdev_state *sd_state) 285 + static int video_mux_init_state(struct v4l2_subdev *sd, 286 + struct v4l2_subdev_state *sd_state) 287 287 { 288 288 struct video_mux *vmux = v4l2_subdev_to_video_mux(sd); 289 289 struct v4l2_mbus_framefmt *mbusformat; ··· 302 302 } 303 303 304 304 static const struct v4l2_subdev_pad_ops video_mux_pad_ops = { 305 - .init_cfg = video_mux_init_cfg, 306 305 .get_fmt = v4l2_subdev_get_fmt, 307 306 .set_fmt = video_mux_set_format, 308 307 }; ··· 309 310 static const struct v4l2_subdev_ops video_mux_subdev_ops = { 310 311 .pad = &video_mux_pad_ops, 311 312 .video = &video_mux_subdev_video_ops, 313 + }; 314 + 315 + static const struct v4l2_subdev_internal_ops video_mux_internal_ops = { 316 + .init_state = video_mux_init_state, 312 317 }; 313 318 314 319 static int video_mux_notify_bound(struct v4l2_async_notifier *notifier, ··· 403 400 platform_set_drvdata(pdev, vmux); 404 401 405 402 v4l2_subdev_init(&vmux->subdev, &video_mux_subdev_ops); 403 + vmux->subdev.internal_ops = &video_mux_internal_ops; 406 404 snprintf(vmux->subdev.name, sizeof(vmux->subdev.name), "%pOFn", np); 407 405 vmux->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 408 406 vmux->subdev.dev = dev;
+7 -3
drivers/media/platform/xilinx/xilinx-csi2rxss.c
··· 661 661 } 662 662 } 663 663 664 - static int xcsi2rxss_init_cfg(struct v4l2_subdev *sd, 665 - struct v4l2_subdev_state *sd_state) 664 + static int xcsi2rxss_init_state(struct v4l2_subdev *sd, 665 + struct v4l2_subdev_state *sd_state) 666 666 { 667 667 struct xcsi2rxss_state *xcsi2rxss = to_xcsi2rxssstate(sd); 668 668 struct v4l2_mbus_framefmt *format; ··· 780 780 }; 781 781 782 782 static const struct v4l2_subdev_pad_ops xcsi2rxss_pad_ops = { 783 - .init_cfg = xcsi2rxss_init_cfg, 784 783 .get_fmt = xcsi2rxss_get_format, 785 784 .set_fmt = xcsi2rxss_set_format, 786 785 .enum_mbus_code = xcsi2rxss_enum_mbus_code, ··· 790 791 .core = &xcsi2rxss_core_ops, 791 792 .video = &xcsi2rxss_video_ops, 792 793 .pad = &xcsi2rxss_pad_ops 794 + }; 795 + 796 + static const struct v4l2_subdev_internal_ops xcsi2rxss_internal_ops = { 797 + .init_state = xcsi2rxss_init_state, 793 798 }; 794 799 795 800 static int xcsi2rxss_parse_of(struct xcsi2rxss_state *xcsi2rxss) ··· 973 970 /* Initialize V4L2 subdevice and media entity */ 974 971 subdev = &xcsi2rxss->subdev; 975 972 v4l2_subdev_init(subdev, &xcsi2rxss_ops); 973 + subdev->internal_ops = &xcsi2rxss_internal_ops; 976 974 subdev->dev = dev; 977 975 strscpy(subdev->name, dev_name(dev), sizeof(subdev->name)); 978 976 subdev->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE;
+8 -3
drivers/media/test-drivers/vimc/vimc-debayer.c
··· 150 150 return false; 151 151 } 152 152 153 - static int vimc_debayer_init_cfg(struct v4l2_subdev *sd, 154 - struct v4l2_subdev_state *sd_state) 153 + static int vimc_debayer_init_state(struct v4l2_subdev *sd, 154 + struct v4l2_subdev_state *sd_state) 155 155 { 156 156 struct vimc_debayer_device *vdebayer = v4l2_get_subdevdata(sd); 157 157 struct v4l2_mbus_framefmt *mf; ··· 307 307 } 308 308 309 309 static const struct v4l2_subdev_pad_ops vimc_debayer_pad_ops = { 310 - .init_cfg = vimc_debayer_init_cfg, 311 310 .enum_mbus_code = vimc_debayer_enum_mbus_code, 312 311 .enum_frame_size = vimc_debayer_enum_frame_size, 313 312 .get_fmt = vimc_debayer_get_fmt, ··· 392 393 .core = &vimc_debayer_core_ops, 393 394 .pad = &vimc_debayer_pad_ops, 394 395 .video = &vimc_debayer_video_ops, 396 + }; 397 + 398 + static const struct v4l2_subdev_internal_ops vimc_debayer_internal_ops = { 399 + .init_state = vimc_debayer_init_state, 395 400 }; 396 401 397 402 static unsigned int vimc_debayer_get_val(const u8 *bytes, ··· 597 594 vdebayer->pads, &vimc_debayer_ops); 598 595 if (ret) 599 596 goto err_free_hdl; 597 + 598 + vdebayer->sd.internal_ops = &vimc_debayer_internal_ops; 600 599 601 600 vdebayer->ved.process_frame = vimc_debayer_process_frame; 602 601 vdebayer->ved.dev = vimc->mdev.dev;
+8 -3
drivers/media/test-drivers/vimc/vimc-scaler.c
··· 70 70 return r; 71 71 } 72 72 73 - static int vimc_scaler_init_cfg(struct v4l2_subdev *sd, 74 - struct v4l2_subdev_state *sd_state) 73 + static int vimc_scaler_init_state(struct v4l2_subdev *sd, 74 + struct v4l2_subdev_state *sd_state) 75 75 { 76 76 struct v4l2_mbus_framefmt *mf; 77 77 struct v4l2_rect *r; ··· 292 292 } 293 293 294 294 static const struct v4l2_subdev_pad_ops vimc_scaler_pad_ops = { 295 - .init_cfg = vimc_scaler_init_cfg, 296 295 .enum_mbus_code = vimc_scaler_enum_mbus_code, 297 296 .enum_frame_size = vimc_scaler_enum_frame_size, 298 297 .get_fmt = vimc_scaler_get_fmt, ··· 344 345 static const struct v4l2_subdev_ops vimc_scaler_ops = { 345 346 .pad = &vimc_scaler_pad_ops, 346 347 .video = &vimc_scaler_video_ops, 348 + }; 349 + 350 + static const struct v4l2_subdev_internal_ops vimc_scaler_internal_ops = { 351 + .init_state = vimc_scaler_init_state, 347 352 }; 348 353 349 354 static void vimc_scaler_fill_src_frame(const struct vimc_scaler_device *const vscaler, ··· 426 423 kfree(vscaler); 427 424 return ERR_PTR(ret); 428 425 } 426 + 427 + vscaler->sd.internal_ops = &vimc_scaler_internal_ops; 429 428 430 429 vscaler->ved.process_frame = vimc_scaler_process_frame; 431 430 vscaler->ved.dev = vimc->mdev.dev;
+8 -3
drivers/media/test-drivers/vimc/vimc-sensor.c
··· 41 41 .colorspace = V4L2_COLORSPACE_SRGB, 42 42 }; 43 43 44 - static int vimc_sensor_init_cfg(struct v4l2_subdev *sd, 45 - struct v4l2_subdev_state *sd_state) 44 + static int vimc_sensor_init_state(struct v4l2_subdev *sd, 45 + struct v4l2_subdev_state *sd_state) 46 46 { 47 47 unsigned int i; 48 48 ··· 183 183 } 184 184 185 185 static const struct v4l2_subdev_pad_ops vimc_sensor_pad_ops = { 186 - .init_cfg = vimc_sensor_init_cfg, 187 186 .enum_mbus_code = vimc_sensor_enum_mbus_code, 188 187 .enum_frame_size = vimc_sensor_enum_frame_size, 189 188 .get_fmt = vimc_sensor_get_fmt, ··· 291 292 .core = &vimc_sensor_core_ops, 292 293 .pad = &vimc_sensor_pad_ops, 293 294 .video = &vimc_sensor_video_ops, 295 + }; 296 + 297 + static const struct v4l2_subdev_internal_ops vimc_sensor_internal_ops = { 298 + .init_state = vimc_sensor_init_state, 294 299 }; 295 300 296 301 static int vimc_sensor_s_ctrl(struct v4l2_ctrl *ctrl) ··· 431 428 &vimc_sensor_ops); 432 429 if (ret) 433 430 goto err_free_tpg; 431 + 432 + vsensor->sd.internal_ops = &vimc_sensor_internal_ops; 434 433 435 434 vsensor->ved.process_frame = vimc_sensor_process_frame; 436 435 vsensor->ved.dev = vimc->mdev.dev;
+11 -9
drivers/media/v4l2-core/v4l2-subdev.c
··· 1460 1460 } 1461 1461 } 1462 1462 1463 - /* 1464 - * There can be no race at this point, but we lock the state anyway to 1465 - * satisfy lockdep checks. 1466 - */ 1467 - v4l2_subdev_lock_state(state); 1468 - ret = v4l2_subdev_call(sd, pad, init_cfg, state); 1469 - v4l2_subdev_unlock_state(state); 1463 + if (sd->internal_ops && sd->internal_ops->init_state) { 1464 + /* 1465 + * There can be no race at this point, but we lock the state 1466 + * anyway to satisfy lockdep checks. 1467 + */ 1468 + v4l2_subdev_lock_state(state); 1469 + ret = sd->internal_ops->init_state(sd, state); 1470 + v4l2_subdev_unlock_state(state); 1470 1471 1471 - if (ret < 0 && ret != -ENOIOCTLCMD) 1472 - goto err; 1472 + if (ret) 1473 + goto err; 1474 + } 1473 1475 1474 1476 return state; 1475 1477
+1 -1
drivers/staging/media/imx/imx-ic-prp.c
··· 448 448 } 449 449 450 450 static const struct v4l2_subdev_pad_ops prp_pad_ops = { 451 - .init_cfg = imx_media_init_cfg, 452 451 .enum_mbus_code = prp_enum_mbus_code, 453 452 .get_fmt = prp_get_fmt, 454 453 .set_fmt = prp_set_fmt, ··· 471 472 }; 472 473 473 474 static const struct v4l2_subdev_internal_ops prp_internal_ops = { 475 + .init_state = imx_media_init_state, 474 476 .registered = prp_registered, 475 477 }; 476 478
+1 -1
drivers/staging/media/imx/imx-ic-prpencvf.c
··· 1296 1296 } 1297 1297 1298 1298 static const struct v4l2_subdev_pad_ops prp_pad_ops = { 1299 - .init_cfg = imx_media_init_cfg, 1300 1299 .enum_mbus_code = prp_enum_mbus_code, 1301 1300 .enum_frame_size = prp_enum_frame_size, 1302 1301 .get_fmt = prp_get_fmt, ··· 1319 1320 }; 1320 1321 1321 1322 static const struct v4l2_subdev_internal_ops prp_internal_ops = { 1323 + .init_state = imx_media_init_state, 1322 1324 .registered = prp_registered, 1323 1325 .unregistered = prp_unregistered, 1324 1326 };
+1 -1
drivers/staging/media/imx/imx-media-csi.c
··· 1866 1866 }; 1867 1867 1868 1868 static const struct v4l2_subdev_pad_ops csi_pad_ops = { 1869 - .init_cfg = imx_media_init_cfg, 1870 1869 .enum_mbus_code = csi_enum_mbus_code, 1871 1870 .enum_frame_size = csi_enum_frame_size, 1872 1871 .enum_frame_interval = csi_enum_frame_interval, ··· 1883 1884 }; 1884 1885 1885 1886 static const struct v4l2_subdev_internal_ops csi_internal_ops = { 1887 + .init_state = imx_media_init_state, 1886 1888 .registered = csi_registered, 1887 1889 .unregistered = csi_unregistered, 1888 1890 };
+4 -4
drivers/staging/media/imx/imx-media-utils.c
··· 426 426 427 427 /* 428 428 * Initializes the TRY format to the ACTIVE format on all pads 429 - * of a subdev. Can be used as the .init_cfg pad operation. 429 + * of a subdev. Can be used as the .init_state internal operation. 430 430 */ 431 - int imx_media_init_cfg(struct v4l2_subdev *sd, 432 - struct v4l2_subdev_state *sd_state) 431 + int imx_media_init_state(struct v4l2_subdev *sd, 432 + struct v4l2_subdev_state *sd_state) 433 433 { 434 434 struct v4l2_mbus_framefmt *mf_try; 435 435 unsigned int pad; ··· 451 451 452 452 return 0; 453 453 } 454 - EXPORT_SYMBOL_GPL(imx_media_init_cfg); 454 + EXPORT_SYMBOL_GPL(imx_media_init_state); 455 455 456 456 /* 457 457 * Default the colorspace in tryfmt to SRGB if set to an unsupported
+1 -1
drivers/staging/media/imx/imx-media-vdic.c
··· 882 882 } 883 883 884 884 static const struct v4l2_subdev_pad_ops vdic_pad_ops = { 885 - .init_cfg = imx_media_init_cfg, 886 885 .enum_mbus_code = vdic_enum_mbus_code, 887 886 .get_fmt = vdic_get_fmt, 888 887 .set_fmt = vdic_set_fmt, ··· 905 906 }; 906 907 907 908 static const struct v4l2_subdev_internal_ops vdic_internal_ops = { 909 + .init_state = imx_media_init_state, 908 910 .registered = vdic_registered, 909 911 .unregistered = vdic_unregistered, 910 912 };
+2 -2
drivers/staging/media/imx/imx-media.h
··· 192 192 int imx_media_init_mbus_fmt(struct v4l2_mbus_framefmt *mbus, 193 193 u32 width, u32 height, u32 code, u32 field, 194 194 const struct imx_media_pixfmt **cc); 195 - int imx_media_init_cfg(struct v4l2_subdev *sd, 196 - struct v4l2_subdev_state *sd_state); 195 + int imx_media_init_state(struct v4l2_subdev *sd, 196 + struct v4l2_subdev_state *sd_state); 197 197 void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt, 198 198 bool ic_route); 199 199 int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
+1 -1
drivers/staging/media/imx/imx6-mipi-csi2.c
··· 619 619 }; 620 620 621 621 static const struct v4l2_subdev_pad_ops csi2_pad_ops = { 622 - .init_cfg = imx_media_init_cfg, 623 622 .get_fmt = csi2_get_fmt, 624 623 .set_fmt = csi2_set_fmt, 625 624 }; ··· 630 631 }; 631 632 632 633 static const struct v4l2_subdev_internal_ops csi2_internal_ops = { 634 + .init_state = imx_media_init_state, 633 635 .registered = csi2_registered, 634 636 }; 635 637
+5 -1
drivers/staging/media/starfive/camss/stf-isp.c
··· 311 311 }; 312 312 313 313 static const struct v4l2_subdev_pad_ops isp_pad_ops = { 314 - .init_cfg = isp_init_formats, 315 314 .enum_mbus_code = isp_enum_mbus_code, 316 315 .get_fmt = v4l2_subdev_get_fmt, 317 316 .set_fmt = isp_set_format, ··· 321 322 static const struct v4l2_subdev_ops isp_v4l2_ops = { 322 323 .video = &isp_video_ops, 323 324 .pad = &isp_pad_ops, 325 + }; 326 + 327 + static const struct v4l2_subdev_internal_ops isp_internal_ops = { 328 + .init_state = isp_init_formats, 324 329 }; 325 330 326 331 static const struct media_entity_operations isp_media_ops = { ··· 338 335 int ret; 339 336 340 337 v4l2_subdev_init(sd, &isp_v4l2_ops); 338 + sd->internal_ops = &isp_internal_ops; 341 339 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 342 340 snprintf(sd->name, ARRAY_SIZE(sd->name), "stf_isp"); 343 341 v4l2_set_subdevdata(sd, isp_dev);
+7 -3
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c
··· 256 256 mbus_format->xfer_func = V4L2_XFER_FUNC_DEFAULT; 257 257 } 258 258 259 - static int sun6i_isp_proc_init_cfg(struct v4l2_subdev *subdev, 260 - struct v4l2_subdev_state *state) 259 + static int sun6i_isp_proc_init_state(struct v4l2_subdev *subdev, 260 + struct v4l2_subdev_state *state) 261 261 { 262 262 struct sun6i_isp_device *isp_dev = v4l2_get_subdevdata(subdev); 263 263 unsigned int pad = SUN6I_ISP_PROC_PAD_SINK_CSI; ··· 336 336 } 337 337 338 338 static const struct v4l2_subdev_pad_ops sun6i_isp_proc_pad_ops = { 339 - .init_cfg = sun6i_isp_proc_init_cfg, 340 339 .enum_mbus_code = sun6i_isp_proc_enum_mbus_code, 341 340 .get_fmt = sun6i_isp_proc_get_fmt, 342 341 .set_fmt = sun6i_isp_proc_set_fmt, ··· 344 345 static const struct v4l2_subdev_ops sun6i_isp_proc_subdev_ops = { 345 346 .video = &sun6i_isp_proc_video_ops, 346 347 .pad = &sun6i_isp_proc_pad_ops, 348 + }; 349 + 350 + static const struct v4l2_subdev_internal_ops sun6i_isp_proc_internal_ops = { 351 + .init_state = sun6i_isp_proc_init_state, 347 352 }; 348 353 349 354 /* Media Entity */ ··· 504 501 /* V4L2 Subdev */ 505 502 506 503 v4l2_subdev_init(subdev, &sun6i_isp_proc_subdev_ops); 504 + subdev->internal_ops = &sun6i_isp_proc_internal_ops; 507 505 strscpy(subdev->name, SUN6I_ISP_PROC_NAME, sizeof(subdev->name)); 508 506 subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 509 507 subdev->owner = THIS_MODULE;
+4 -3
include/media/v4l2-subdev.h
··· 771 771 /** 772 772 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations 773 773 * 774 - * @init_cfg: initialize the subdev state to default values 775 774 * @enum_mbus_code: callback for VIDIOC_SUBDEV_ENUM_MBUS_CODE() ioctl handler 776 775 * code. 777 776 * @enum_frame_size: callback for VIDIOC_SUBDEV_ENUM_FRAME_SIZE() ioctl handler ··· 835 836 * directly, use v4l2_subdev_disable_streams() instead. 836 837 */ 837 838 struct v4l2_subdev_pad_ops { 838 - int (*init_cfg)(struct v4l2_subdev *sd, 839 - struct v4l2_subdev_state *state); 840 839 int (*enum_mbus_code)(struct v4l2_subdev *sd, 841 840 struct v4l2_subdev_state *state, 842 841 struct v4l2_subdev_mbus_code_enum *code); ··· 911 914 /** 912 915 * struct v4l2_subdev_internal_ops - V4L2 subdev internal ops 913 916 * 917 + * @init_state: initialize the subdev state to default values 918 + * 914 919 * @registered: called when this subdev is registered. When called the v4l2_dev 915 920 * field is set to the correct v4l2_device. 916 921 * ··· 938 939 * these ops. 939 940 */ 940 941 struct v4l2_subdev_internal_ops { 942 + int (*init_state)(struct v4l2_subdev *sd, 943 + struct v4l2_subdev_state *state); 941 944 int (*registered)(struct v4l2_subdev *sd); 942 945 void (*unregistered)(struct v4l2_subdev *sd); 943 946 int (*open)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);