summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ar0521.c
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-11-04 17:24:49 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-11-25 11:44:43 +0300
commitf9746da3473c571b1021bc78bf2b2deea8d3fd1c (patch)
treefc5a49c04ac1de3b4510a0bcf6548e04f2e494be /drivers/media/i2c/ar0521.c
parent6e27ef31a5c17068dc032289f3cc132ceedce2f8 (diff)
downloadlinux-f9746da3473c571b1021bc78bf2b2deea8d3fd1c.tar.xz
media: ar0521: Add LINK_FREQ control
Add support for V4L2_CID_LINK_FREQ which currently reports a single hard-coded frequency which depends on the fixed pixel clock. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/i2c/ar0521.c')
-rw-r--r--drivers/media/i2c/ar0521.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c
index acb9509d7708..c9c578b223ef 100644
--- a/drivers/media/i2c/ar0521.c
+++ b/drivers/media/i2c/ar0521.c
@@ -89,6 +89,10 @@ static const char * const ar0521_supply_names[] = {
"vaa", /* Analog (2.7V) supply */
};
+static const s64 ar0521_link_frequencies[] = {
+ 184000000,
+};
+
struct ar0521_ctrls {
struct v4l2_ctrl_handler handler;
struct {
@@ -570,6 +574,7 @@ static int ar0521_init_controls(struct ar0521_dev *sensor)
const struct v4l2_ctrl_ops *ops = &ar0521_ctrl_ops;
struct ar0521_ctrls *ctrls = &sensor->ctrls;
struct v4l2_ctrl_handler *hdl = &ctrls->handler;
+ struct v4l2_ctrl *link_freq;
int ret;
v4l2_ctrl_handler_init(hdl, 32);
@@ -608,6 +613,12 @@ static int ar0521_init_controls(struct ar0521_dev *sensor)
ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_EXPOSURE, 0,
65535, 1, 360);
+ link_freq = v4l2_ctrl_new_int_menu(hdl, ops, V4L2_CID_LINK_FREQ,
+ ARRAY_SIZE(ar0521_link_frequencies) - 1,
+ 0, ar0521_link_frequencies);
+ if (link_freq)
+ link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
+
ctrls->test_pattern = v4l2_ctrl_new_std_menu_items(hdl, ops,
V4L2_CID_TEST_PATTERN,
ARRAY_SIZE(test_pattern_menu) - 1,