Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 889220c7 authored by Ankit Premrajka's avatar Ankit Premrajka Committed by Stephen Boyd
Browse files

msm: camera: resource manager related changes.



Make changes to support dynamic selection
of subdevs through the resource manager. Instead of
choosing the subdevs to be used by the current mctl
session statically during open, the VFE, AXI and VPE
subdevs are now selected and initialized later as per
session requirements.

Change-Id: I8df951b81f0ccc77e5b4f64bf5cf620822cf0175
Signed-off-by: default avatarAnkit Premrajka <ankitp@codeaurora.org>
parent d44b785e
Loading
Loading
Loading
Loading
+10 −30
Original line number Diff line number Diff line
@@ -16,48 +16,28 @@
#include "msm_csi_register.h"

int msm_csi_register_subdevs(struct msm_cam_media_controller *p_mctl,
	int core_index,
	int (*msm_mctl_subdev_match_core)(struct device *, void *))
	int core_index, struct msm_cam_server_dev *server_dev)
{
	int rc = -ENODEV;
	struct device_driver *driver;
	struct device *dev;

	/* register csiphy subdev */
	driver = driver_find(MSM_CSIPHY_DRV_NAME, &platform_bus_type);
	if (!driver)
	p_mctl->csiphy_sdev = server_dev->csiphy_device[core_index];
	if (!p_mctl->csiphy_sdev)
		goto out;

	dev = driver_find_device(driver, NULL, (void *)core_index,
			msm_mctl_subdev_match_core);
	if (!dev)
		goto out;

	p_mctl->csiphy_sdev = dev_get_drvdata(dev);
	v4l2_set_subdev_hostdata(p_mctl->csiphy_sdev, p_mctl);

	/* register csid subdev */
	driver = driver_find(MSM_CSID_DRV_NAME, &platform_bus_type);
	if (!driver)
		goto out;

	dev = driver_find_device(driver, NULL, (void *)core_index,
			msm_mctl_subdev_match_core);
	if (!dev)
	p_mctl->csid_sdev = server_dev->csid_device[core_index];
	if (!p_mctl->csid_sdev)
		goto out;

	p_mctl->csid_sdev = dev_get_drvdata(dev);
	v4l2_set_subdev_hostdata(p_mctl->csid_sdev, p_mctl);

	/* register ispif subdev */
	driver = driver_find(MSM_ISPIF_DRV_NAME, &platform_bus_type);
	if (!driver)
		goto out;

	dev = driver_find_device(driver, NULL, 0,
			msm_mctl_subdev_match_core);
	if (!dev)
	p_mctl->ispif_sdev = server_dev->ispif_device[0];
	if (!p_mctl->ispif_sdev)
		goto out;
	v4l2_set_subdev_hostdata(p_mctl->ispif_sdev, p_mctl);

	p_mctl->ispif_sdev = dev_get_drvdata(dev);
	rc = 0;
	return rc;
out:
+1 −1
Original line number Diff line number Diff line
@@ -13,4 +13,4 @@

int msm_csi_register_subdevs(struct msm_cam_media_controller *p_mctl,
	int core_index,
	int (*msm_mctl_subdev_match_core)(struct device *, void *));
	struct msm_cam_server_dev *server_dev);
+6 −0
Original line number Diff line number Diff line
@@ -463,6 +463,12 @@ static int csic_probe(struct platform_device *pdev)
	msm_cam_register_subdev_node(
		&new_csic_dev->subdev, &sd_info);

	media_entity_init(&new_csic_dev->subdev.entity, 0, NULL, 0);
	new_csic_dev->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
	new_csic_dev->subdev.entity.group_id = CSIC_DEV;
	new_csic_dev->subdev.entity.name = pdev->name;
	new_csic_dev->subdev.entity.revision =
		new_csic_dev->subdev.devnode->num;
	return 0;

csic_no_resource:
+4 −13
Original line number Diff line number Diff line
@@ -16,23 +16,14 @@
#include "msm_csi_register.h"

int msm_csi_register_subdevs(struct msm_cam_media_controller *p_mctl,
	int core_index,
	int (*msm_mctl_subdev_match_core)(struct device *, void *))
	int core_index, struct msm_cam_server_dev *server_dev)
{
	int rc = -ENODEV;
	struct device_driver *driver;
	struct device *dev;

	driver = driver_find(MSM_CSIC_DRV_NAME, &platform_bus_type);
	if (!driver)
	p_mctl->csic_sdev = server_dev->csic_device[core_index];
	if (!p_mctl->csic_sdev)
		goto out;

	dev = driver_find_device(driver, NULL, (void *)core_index,
			msm_mctl_subdev_match_core);
	if (!dev)
		goto out;

	p_mctl->csic_sdev = dev_get_drvdata(dev);
	v4l2_set_subdev_hostdata(p_mctl->csic_sdev, p_mctl);

	rc = 0;
	p_mctl->ispif_sdev = NULL;
+7 −0
Original line number Diff line number Diff line
@@ -320,6 +320,13 @@ static int csid_probe(struct platform_device *pdev)
	sd_info.sd_index = pdev->id;
	sd_info.irq_num = new_csid_dev->irq->start;
	msm_cam_register_subdev_node(&new_csid_dev->subdev, &sd_info);

	media_entity_init(&new_csid_dev->subdev.entity, 0, NULL, 0);
	new_csid_dev->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
	new_csid_dev->subdev.entity.group_id = CSID_DEV;
	new_csid_dev->subdev.entity.name = pdev->name;
	new_csid_dev->subdev.entity.revision =
		new_csid_dev->subdev.devnode->num;
	return 0;

csid_no_resource:
Loading