diff options
author | Paweł Anikiel <panikiel@google.com> | 2024-04-05 14:14:06 +0000 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-04-09 08:15:04 +0200 |
commit | a5af9744fe1b17c2a941499ac64602520b974af5 (patch) | |
tree | 26f128c4741d5afd37e7dc9358b7f2fff7a2cb69 /drivers/media/spi | |
parent | cf709fe39f15f01d96c59b1b9a663242c9efa4a5 (diff) | |
download | lwn-a5af9744fe1b17c2a941499ac64602520b974af5.tar.gz lwn-a5af9744fe1b17c2a941499ac64602520b974af5.zip |
media: spi: gs1662: Switch dv timing callbacks to pad ops
Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.
Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]
Diffstat (limited to 'drivers/media/spi')
-rw-r--r-- | drivers/media/spi/gs1662.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/media/spi/gs1662.c b/drivers/media/spi/gs1662.c index 75c21a93e6d0..dc5c4c055d29 100644 --- a/drivers/media/spi/gs1662.c +++ b/drivers/media/spi/gs1662.c @@ -259,12 +259,15 @@ static inline struct gs *to_gs(struct v4l2_subdev *sd) return container_of(sd, struct gs, sd); } -static int gs_s_dv_timings(struct v4l2_subdev *sd, - struct v4l2_dv_timings *timings) +static int gs_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_dv_timings *timings) { struct gs *gs = to_gs(sd); int reg_value; + if (pad != 0) + return -EINVAL; + reg_value = get_register_timings(timings); if (reg_value == 0x0) return -EINVAL; @@ -273,23 +276,29 @@ static int gs_s_dv_timings(struct v4l2_subdev *sd, return 0; } -static int gs_g_dv_timings(struct v4l2_subdev *sd, - struct v4l2_dv_timings *timings) +static int gs_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_dv_timings *timings) { struct gs *gs = to_gs(sd); + if (pad != 0) + return -EINVAL; + *timings = gs->current_timings; return 0; } -static int gs_query_dv_timings(struct v4l2_subdev *sd, - struct v4l2_dv_timings *timings) +static int gs_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_dv_timings *timings) { struct gs *gs = to_gs(sd); struct v4l2_dv_timings fmt; u16 reg_value, i; int ret; + if (pad != 0) + return -EINVAL; + if (gs->enabled) return -EBUSY; @@ -410,14 +419,14 @@ static const struct v4l2_subdev_core_ops gs_core_ops = { }; static const struct v4l2_subdev_video_ops gs_video_ops = { - .s_dv_timings = gs_s_dv_timings, - .g_dv_timings = gs_g_dv_timings, .s_stream = gs_s_stream, .g_input_status = gs_g_input_status, - .query_dv_timings = gs_query_dv_timings, }; static const struct v4l2_subdev_pad_ops gs_pad_ops = { + .s_dv_timings = gs_s_dv_timings, + .g_dv_timings = gs_g_dv_timings, + .query_dv_timings = gs_query_dv_timings, .enum_dv_timings = gs_enum_dv_timings, .dv_timings_cap = gs_dv_timings_cap, }; |