summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/microchip/microchip-sama7g5-isc.c
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2022-11-07 15:18:15 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-11-25 08:46:50 +0100
commit920b2665f39253c484973baeebd0da8093cc3d7b (patch)
treec265bff5a2e8300d11466d8708d2b079143ad999 /drivers/media/platform/microchip/microchip-sama7g5-isc.c
parentmedia: microchip: add ISC driver as Microchip ISC (diff)
downloadlinux-920b2665f39253c484973baeebd0da8093cc3d7b.tar.xz
linux-920b2665f39253c484973baeebd0da8093cc3d7b.zip
media: microchip: microchip-isc: prepare for media controller support
Prepare the support for media-controller. This means that the capabilities of the driver have changed and now it's capable of media controller operations. The driver will register its media device, and add the video entity to this media device. The subdevices are registered to the same media device. The ISC will have a base entity which is auto-detected as microchip_isc_base. It will also register a subdevice that allows cropping of the incoming frame to the maximum frame size supported by the ISC. The ISC will create a link between the subdevice that is asynchronously registered and the microchip_isc_scaler entity. Then, the microchip_isc_scaler and microchip_isc_base are connected through another link. This patch does not change the previous capability of the driver, the fact that the format is still being propagated from the top video node down to the sensor. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/microchip/microchip-sama7g5-isc.c')
-rw-r--r--drivers/media/platform/microchip/microchip-sama7g5-isc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
index 3408f6fb61e8..75a0a5caa8d8 100644
--- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
@@ -526,15 +526,23 @@ static int microchip_xisc_probe(struct platform_device *pdev)
break;
}
+ regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver);
+
+ ret = isc_mc_init(isc, ver);
+ if (ret < 0)
+ goto isc_probe_mc_init_err;
+
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
pm_request_idle(dev);
- regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver);
dev_info(dev, "Microchip XISC version %x\n", ver);
return 0;
+isc_probe_mc_init_err:
+ isc_mc_cleanup(isc);
+
cleanup_subdev:
microchip_isc_subdev_cleanup(isc);
@@ -555,6 +563,8 @@ static int microchip_xisc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
+ isc_mc_cleanup(isc);
+
microchip_isc_subdev_cleanup(isc);
v4l2_device_unregister(&isc->v4l2_dev);