diff options
| author | Hans de Goede | 2025-05-17 13:40:59 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab | 2025-07-08 08:43:31 +0200 |
| commit | 01027ffed991f8e4f05e4d73cd91f17681d1bf51 (patch) | |
| tree | 7ad8d0c9dca012aa0e37e2788c50a8cc5dfb5371 /drivers | |
| parent | 1e29696182f68b88cf2e459cc928eecc5770b459 (diff) | |
media: atomisp: gc0310: Implement internal_ops.init_state
Implement internal_ops.init_state to fill in the v4l2_mbus_framefmt
struct in newly allocated sd-state structs.
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250517114106.43494-17-hansg@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c index baf9355ade4d..e0a031574a84 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c @@ -596,6 +596,17 @@ static const struct v4l2_subdev_ops gc0310_ops = { .sensor = &gc0310_sensor_ops, }; +static int gc0310_init_state(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state) +{ + gc0310_fill_format(v4l2_subdev_state_get_format(sd_state, 0)); + return 0; +} + +static const struct v4l2_subdev_internal_ops gc0310_internal_ops = { + .init_state = gc0310_init_state, +}; + static int gc0310_init_controls(struct gc0310_device *sensor) { struct i2c_client *client = v4l2_get_subdevdata(&sensor->sd); @@ -762,6 +773,7 @@ static int gc0310_probe(struct i2c_client *client) return ret; } + sensor->sd.internal_ops = &gc0310_internal_ops; sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; sensor->pad.flags = MEDIA_PAD_FL_SOURCE; sensor->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; |
