OSDN Git Service

media: rcar-vin: add link notify for Gen3
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Sat, 14 Apr 2018 11:57:22 +0000 (07:57 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 20 Apr 2018 14:32:44 +0000 (10:32 -0400)
commitc0cc5aef31704c824271b9c8043e7107acebc888
treee5a1beec6473c39c17eed8f0396ea0a5582ccae1
parentc7e80b67b63046ffa299a471e42be3eddc2e1d31
media: rcar-vin: add link notify for Gen3

Add the ability to process media device link change requests. Link
enabling is a bit complicated on Gen3, whether or not it's possible to
enable a link depends on what other links already are enabled. On Gen3
the 8 VINs are split into two subgroup's (VIN0-3 and VIN4-7) and from a
routing perspective these two groups are independent of each other.
Each subgroup's routing is controlled by the subgroup VIN master
instance (VIN0 and VIN4).

There are a limited number of possible route setups available for each
subgroup and the configuration of each setup is dictated by the
hardware. On H3 for example there are 6 possible route setups for each
subgroup to choose from.

This leads to the media device link notification code being rather large
since it will find the best routing configuration to try and accommodate
as many links as possible. When it's not possible to enable a new link
due to hardware constrains the link_notifier callback will return
-EMLINK.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
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>
drivers/media/platform/rcar-vin/rcar-core.c