summaryrefslogtreecommitdiff
path: root/drivers/media/platform/rcar-vin/rcar-v4l2.c
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2018-04-14 07:57:00 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-04-20 09:50:07 -0400
commitbb3ed3fd66888f048cd99466751eeb98b031f676 (patch)
tree0db36fd2b16e12fe8dd6db592041d86054f4042a /drivers/media/platform/rcar-vin/rcar-v4l2.c
parent23525ef9f87ebb3a2e3b9141aecd477b2729d669 (diff)
media: rcar-vin: move model information to own struct
When Gen3 support is added to the driver more than model ID will be different for the different SoCs. To avoid a lot of if statements in the code create a struct rvin_info to store this information. While we are at it rename the poorly chosen enum which contains the different model IDs from chip_id to model_id. Also sort the compatible string entries and make use of of_device_get_match_data() which will always work as the driver is DT only, so there's always a valid match. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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/rcar-vin/rcar-v4l2.c')
-rw-r--r--drivers/media/platform/rcar-vin/rcar-v4l2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 9df8ea0f54c9..97baea8fb7e6 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -266,7 +266,8 @@ static int __rvin_try_format(struct rvin_dev *vin,
pix->sizeimage = max_t(u32, pix->sizeimage,
rvin_format_sizeimage(pix));
- if (vin->chip == RCAR_M1 && pix->pixelformat == V4L2_PIX_FMT_XBGR32) {
+ if (vin->info->model == RCAR_M1 &&
+ pix->pixelformat == V4L2_PIX_FMT_XBGR32) {
vin_err(vin, "pixel format XBGR32 not supported on M1\n");
return -EINVAL;
}