Commit 47ba5bbf authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Mauro Carvalho Chehab

media: rcar-vin: add flag to switch to media controller mode

On Gen3 a media controller API needs to be used to allow userspace to
configure the subdevices in the pipeline instead of directly controlling
a single source subdevice, which is and will continue to be the mode of
operation on Gen2.

Prepare for these two modes of operation by adding a flag to struct
rvin_info which will control which mode to use.
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 90dedce9
...@@ -249,18 +249,21 @@ static int rvin_digital_graph_init(struct rvin_dev *vin) ...@@ -249,18 +249,21 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
static const struct rvin_info rcar_info_h1 = { static const struct rvin_info rcar_info_h1 = {
.model = RCAR_H1, .model = RCAR_H1,
.use_mc = false,
.max_width = 2048, .max_width = 2048,
.max_height = 2048, .max_height = 2048,
}; };
static const struct rvin_info rcar_info_m1 = { static const struct rvin_info rcar_info_m1 = {
.model = RCAR_M1, .model = RCAR_M1,
.use_mc = false,
.max_width = 2048, .max_width = 2048,
.max_height = 2048, .max_height = 2048,
}; };
static const struct rvin_info rcar_info_gen2 = { static const struct rvin_info rcar_info_gen2 = {
.model = RCAR_GEN2, .model = RCAR_GEN2,
.use_mc = false,
.max_width = 2048, .max_width = 2048,
.max_height = 2048, .max_height = 2048,
}; };
...@@ -355,6 +358,7 @@ static int rcar_vin_remove(struct platform_device *pdev) ...@@ -355,6 +358,7 @@ static int rcar_vin_remove(struct platform_device *pdev)
v4l2_async_notifier_unregister(&vin->notifier); v4l2_async_notifier_unregister(&vin->notifier);
v4l2_async_notifier_cleanup(&vin->notifier); v4l2_async_notifier_cleanup(&vin->notifier);
if (!vin->info->use_mc)
v4l2_ctrl_handler_free(&vin->ctrl_handler); v4l2_ctrl_handler_free(&vin->ctrl_handler);
rvin_dma_unregister(vin); rvin_dma_unregister(vin);
......
...@@ -75,11 +75,13 @@ struct rvin_graph_entity { ...@@ -75,11 +75,13 @@ struct rvin_graph_entity {
/** /**
* struct rvin_info - Information about the particular VIN implementation * struct rvin_info - Information about the particular VIN implementation
* @model: VIN model * @model: VIN model
* @use_mc: use media controller instead of controlling subdevice
* @max_width: max input width the VIN supports * @max_width: max input width the VIN supports
* @max_height: max input height the VIN supports * @max_height: max input height the VIN supports
*/ */
struct rvin_info { struct rvin_info {
enum model_id model; enum model_id model;
bool use_mc;
unsigned int max_width; unsigned int max_width;
unsigned int max_height; unsigned int max_height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment