diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2018-04-14 14:57:00 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-04-20 16:50:07 +0300 |
commit | bb3ed3fd66888f048cd99466751eeb98b031f676 (patch) | |
tree | 0db36fd2b16e12fe8dd6db592041d86054f4042a /drivers/media/platform/rcar-vin/rcar-vin.h | |
parent | 23525ef9f87ebb3a2e3b9141aecd477b2729d669 (diff) | |
download | linux-bb3ed3fd66888f048cd99466751eeb98b031f676.tar.xz |
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-vin.h')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-vin.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h index 385243e3d4da..b63c4fce68ad 100644 --- a/drivers/media/platform/rcar-vin/rcar-vin.h +++ b/drivers/media/platform/rcar-vin/rcar-vin.h @@ -29,7 +29,7 @@ /* Address alignment mask for HW buffers */ #define HW_BUFFER_MASK 0x7f -enum chip_id { +enum model_id { RCAR_H1, RCAR_M1, RCAR_GEN2, @@ -87,10 +87,18 @@ struct rvin_graph_entity { }; /** + * struct rvin_info - Information about the particular VIN implementation + * @model: VIN model + */ +struct rvin_info { + enum model_id model; +}; + +/** * struct rvin_dev - Renesas VIN device structure * @dev: (OF) device * @base: device I/O register space remapped to virtual memory - * @chip: type of VIN chip + * @info: info about VIN instance * * @vdev: V4L2 video device associated with VIN * @v4l2_dev: V4L2 device @@ -119,7 +127,7 @@ struct rvin_graph_entity { struct rvin_dev { struct device *dev; void __iomem *base; - enum chip_id chip; + const struct rvin_info *info; struct video_device vdev; struct v4l2_device v4l2_dev; |