summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vimc/vimc-common.c
diff options
context:
space:
mode:
authorHelen Fornazier <helen.koike@collabora.com>2017-06-19 14:00:16 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-23 09:07:15 -0300
commit88ad71aab1a7931ac3d35c3acaa431c3dc05afd9 (patch)
tree0a0d0be75d70ff503c63888fb1c78c6532373f9c /drivers/media/platform/vimc/vimc-common.c
parent441c0db6e5a2f07f91b72e31a22a19180d28ebf5 (diff)
downloadlwn-88ad71aab1a7931ac3d35c3acaa431c3dc05afd9.tar.gz
lwn-88ad71aab1a7931ac3d35c3acaa431c3dc05afd9.zip
[media] vimc: sen: Support several image formats
Allow user space to change the image format as the frame size, the media bus pixel format, colorspace, quantization, field YCbCr encoding and the transfer function Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-common.c')
-rw-r--r--drivers/media/platform/vimc/vimc-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c
index 6ad77fdc04ad..b69805574c67 100644
--- a/drivers/media/platform/vimc/vimc-common.c
+++ b/drivers/media/platform/vimc/vimc-common.c
@@ -144,6 +144,14 @@ static const struct vimc_pix_map vimc_pix_map_list[] = {
},
};
+const struct vimc_pix_map *vimc_pix_map_by_index(unsigned int i)
+{
+ if (i >= ARRAY_SIZE(vimc_pix_map_list))
+ return NULL;
+
+ return &vimc_pix_map_list[i];
+}
+
const struct vimc_pix_map *vimc_pix_map_by_code(u32 code)
{
unsigned int i;