libcamera: camera_sensor: Discover VCMs through ancillary links

Add a function to check for and initialise any VCMs linked to the
CameraSensor's entity by ancillary links. This should initialise
the lens_ member with the linked entity. Call the new function
during CameraSensor::init().

Reviewed-by: Laurent Pinchart <>
Signed-off-by: Daniel Scally <>
Reviewed-by: Jean-Michel Hautbois <>
Signed-off-by: Kieran Bingham <>
2 files changed