[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240405141411.1807189-12-panikiel@google.com>
Date: Fri, 5 Apr 2024 14:14:06 +0000
From: "Paweł Anikiel" <panikiel@...gle.com>
To: kieran.bingham@...asonboard.com, mchehab@...nel.org,
hverkuil-cisco@...all.nl, tharvey@...eworks.com,
niklas.soderlund@...natech.se, prabhakar.csengg@...il.com,
charles-antoine.couret@...vision.fr, thierry.reding@...il.com,
jonathanh@...dia.com, skomatineni@...dia.com, luca.ceresoli@...tlin.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
chromeos-krk-upstreaming@...gle.com,
"Paweł Anikiel" <panikiel@...gle.com>
Subject: [PATCH 11/16] 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@...gle.com>
---
drivers/media/spi/gs1662.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/media/spi/gs1662.c b/drivers/media/spi/gs1662.c
index 75c21a93e6d0..44f97e99ff15 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,
+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,16 +276,19 @@ static int gs_s_dv_timings(struct v4l2_subdev *sd,
return 0;
}
-static int gs_g_dv_timings(struct v4l2_subdev *sd,
+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,
+static int gs_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_dv_timings *timings)
{
struct gs *gs = to_gs(sd);
@@ -290,6 +296,9 @@ static int gs_query_dv_timings(struct v4l2_subdev *sd,
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,
};
--
2.44.0.478.gd926399ef9-goog
Powered by blists - more mailing lists