summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/rkisp1/rkisp1-common.h
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-09-01 13:16:08 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-27 11:13:07 +0200
commit9a8e67b8bbb2c080718222b766e2aeeb1a29a4fa (patch)
treef6570cf21e4cb8cd5ba2aa76f23adf9633177737 /drivers/staging/media/rkisp1/rkisp1-common.h
parent5fc929ae516537720d61139df92fa89ac4989c7b (diff)
downloadlinux-9a8e67b8bbb2c080718222b766e2aeeb1a29a4fa.tar.bz2
media: staging: rkisp1: add a helper function to enumerate supported mbus formats on capture
Add a function 'rkisp1_cap_enum_mbus_codes' that receive a pointer to 'v4l2_subdev_mbus_code_enum' and returns the next supported mbus format of the capture. The function assumes that pixel formats with identical 'mbus' are grouped together in the hardcoded arrays, therefore the order of the entries in the array 'rkisp1_sp_fmts' are adjusted. This function is a helper for the media bus enumeration of the source pad of the resizer entity. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/rkisp1/rkisp1-common.h')
-rw-r--r--drivers/staging/media/rkisp1/rkisp1-common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/media/rkisp1/rkisp1-common.h b/drivers/staging/media/rkisp1/rkisp1-common.h
index 992d8ec4c448..8cdfcaab268e 100644
--- a/drivers/staging/media/rkisp1/rkisp1-common.h
+++ b/drivers/staging/media/rkisp1/rkisp1-common.h
@@ -411,6 +411,17 @@ static inline u32 rkisp1_read(struct rkisp1_device *rkisp1, unsigned int addr)
}
/*
+ * rkisp1_cap_enum_mbus_codes - A helper function that return the i'th supported mbus code
+ * of the capture entity. This is used to enumerate the supported
+ * mbus codes on the source pad of the resizer.
+ *
+ * @cap: the capture entity
+ * @code: the mbus code, the function reads the code->index and fills the code->code
+ */
+int rkisp1_cap_enum_mbus_codes(struct rkisp1_capture *cap,
+ struct v4l2_subdev_mbus_code_enum *code);
+
+/*
* rkisp1_sd_adjust_crop_rect - adjust a rectangle to fit into another rectangle.
*
* @crop: rectangle to adjust.