diff mbox series

[v5,13/22] media: camss: Enable SDM845

Message ID 20210217112122.424236-14-robert.foss@linaro.org (mailing list archive)
State New
Headers show
Series Add support for the SDM845 Camera Subsystem | expand

Commit Message

Robert Foss Feb. 17, 2021, 11:21 a.m. UTC
Enable support for SDM845 based Titan 170 ISPs.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
---
 drivers/media/platform/qcom/camss/camss.c | 17 +++++++++++++++++
 drivers/media/platform/qcom/camss/camss.h |  6 ++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

Comments

Andrey Konovalov Feb. 21, 2021, 6:32 p.m. UTC | #1
Hi Robert,

Thank you for your patch!

Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>

Thanks,
Andrey

On 17.02.2021 14:21, Robert Foss wrote:
> Enable support for SDM845 based Titan 170 ISPs.
> 
> Signed-off-by: Robert Foss <robert.foss@linaro.org>
> ---
>   drivers/media/platform/qcom/camss/camss.c | 17 +++++++++++++++++
>   drivers/media/platform/qcom/camss/camss.h |  6 ++++--
>   2 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 3c45537b2cfb..3bd3153b7905 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -894,6 +894,12 @@ static int camss_init_subdevices(struct camss *camss)
>   		csid_res = csid_res_660;
>   		ispif_res = &ispif_res_660;
>   		vfe_res = vfe_res_660;
> +	}  else if (camss->version == CAMSS_845) {
> +		csiphy_res = csiphy_res_845;
> +		csid_res = csid_res_845;
> +		/* Titan VFEs don't have an ISPIF  */
> +		ispif_res = NULL;
> +		vfe_res = vfe_res_845;
>   	} else {
>   		return -EINVAL;
>   	}
> @@ -1196,6 +1202,8 @@ static int camss_configure_pd(struct camss *camss)
>   	if (camss->version == CAMSS_8x96 ||
>   	    camss->version == CAMSS_660)
>   		nbr_pm_domains = PM_DOMAIN_CAMSS_COUNT;
> +	else if (camss->version == CAMSS_845)
> +		nbr_pm_domains = PM_DOMAIN_TITAN_COUNT;
>   
>   	for (i = 0; i < nbr_pm_domains; i++) {
>   		camss->genpd[i] = dev_pm_domain_attach_by_id(camss->dev, i);
> @@ -1264,6 +1272,12 @@ static int camss_probe(struct platform_device *pdev)
>   		camss->csiphy_num = 3;
>   		camss->csid_num = 4;
>   		camss->vfe_num = 2;
> +	} else if (of_device_is_compatible(dev->of_node,
> +					   "qcom,sdm845-camss")) {
> +		camss->version = CAMSS_845;
> +		camss->csiphy_num = 4;
> +		camss->csid_num = 3;
> +		camss->vfe_num = 3;
>   	} else {
>   		ret = -EINVAL;
>   		goto err_free;
> @@ -1395,6 +1409,8 @@ void camss_delete(struct camss *camss)
>   	if (camss->version == CAMSS_8x96 ||
>   	    camss->version == CAMSS_660)
>   		nbr_pm_domains = PM_DOMAIN_CAMSS_COUNT;
> +	else if (camss->version == CAMSS_845)
> +		nbr_pm_domains = PM_DOMAIN_TITAN_COUNT;
>   
>   	for (i = 0; i < nbr_pm_domains; i++) {
>   		device_link_del(camss->genpd_link[i]);
> @@ -1428,6 +1444,7 @@ static const struct of_device_id camss_dt_match[] = {
>   	{ .compatible = "qcom,msm8916-camss" },
>   	{ .compatible = "qcom,msm8996-camss" },
>   	{ .compatible = "qcom,sdm660-camss" },
> +	{ .compatible = "qcom,sdm845-camss" },
>   	{ }
>   };
>   
> diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
> index 7560d85b3352..2f853557ed16 100644
> --- a/drivers/media/platform/qcom/camss/camss.h
> +++ b/drivers/media/platform/qcom/camss/camss.h
> @@ -60,6 +60,8 @@ enum pm_domain {
>   	PM_DOMAIN_VFE0 = 0,
>   	PM_DOMAIN_VFE1 = 1,
>   	PM_DOMAIN_CAMSS_COUNT = 2,	/* CAMSS series of ISPs */
> +	PM_DOMAIN_VFELITE = 2,		/* VFELITE / TOP GDSC */
> +	PM_DOMAIN_TITAN_COUNT = 3,	/* Titan series of ISPs */
>   };
>   
>   enum camss_version {
> @@ -83,8 +85,8 @@ struct camss {
>   	int vfe_num;
>   	struct vfe_device *vfe;
>   	atomic_t ref_count;
> -	struct device *genpd[PM_DOMAIN_CAMSS_COUNT];
> -	struct device_link *genpd_link[PM_DOMAIN_CAMSS_COUNT];
> +	struct device *genpd[PM_DOMAIN_TITAN_COUNT];
> +	struct device_link *genpd_link[PM_DOMAIN_TITAN_COUNT];
>   };
>   
>   struct camss_camera_interface {
>
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 3c45537b2cfb..3bd3153b7905 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -894,6 +894,12 @@  static int camss_init_subdevices(struct camss *camss)
 		csid_res = csid_res_660;
 		ispif_res = &ispif_res_660;
 		vfe_res = vfe_res_660;
+	}  else if (camss->version == CAMSS_845) {
+		csiphy_res = csiphy_res_845;
+		csid_res = csid_res_845;
+		/* Titan VFEs don't have an ISPIF  */
+		ispif_res = NULL;
+		vfe_res = vfe_res_845;
 	} else {
 		return -EINVAL;
 	}
@@ -1196,6 +1202,8 @@  static int camss_configure_pd(struct camss *camss)
 	if (camss->version == CAMSS_8x96 ||
 	    camss->version == CAMSS_660)
 		nbr_pm_domains = PM_DOMAIN_CAMSS_COUNT;
+	else if (camss->version == CAMSS_845)
+		nbr_pm_domains = PM_DOMAIN_TITAN_COUNT;
 
 	for (i = 0; i < nbr_pm_domains; i++) {
 		camss->genpd[i] = dev_pm_domain_attach_by_id(camss->dev, i);
@@ -1264,6 +1272,12 @@  static int camss_probe(struct platform_device *pdev)
 		camss->csiphy_num = 3;
 		camss->csid_num = 4;
 		camss->vfe_num = 2;
+	} else if (of_device_is_compatible(dev->of_node,
+					   "qcom,sdm845-camss")) {
+		camss->version = CAMSS_845;
+		camss->csiphy_num = 4;
+		camss->csid_num = 3;
+		camss->vfe_num = 3;
 	} else {
 		ret = -EINVAL;
 		goto err_free;
@@ -1395,6 +1409,8 @@  void camss_delete(struct camss *camss)
 	if (camss->version == CAMSS_8x96 ||
 	    camss->version == CAMSS_660)
 		nbr_pm_domains = PM_DOMAIN_CAMSS_COUNT;
+	else if (camss->version == CAMSS_845)
+		nbr_pm_domains = PM_DOMAIN_TITAN_COUNT;
 
 	for (i = 0; i < nbr_pm_domains; i++) {
 		device_link_del(camss->genpd_link[i]);
@@ -1428,6 +1444,7 @@  static const struct of_device_id camss_dt_match[] = {
 	{ .compatible = "qcom,msm8916-camss" },
 	{ .compatible = "qcom,msm8996-camss" },
 	{ .compatible = "qcom,sdm660-camss" },
+	{ .compatible = "qcom,sdm845-camss" },
 	{ }
 };
 
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
index 7560d85b3352..2f853557ed16 100644
--- a/drivers/media/platform/qcom/camss/camss.h
+++ b/drivers/media/platform/qcom/camss/camss.h
@@ -60,6 +60,8 @@  enum pm_domain {
 	PM_DOMAIN_VFE0 = 0,
 	PM_DOMAIN_VFE1 = 1,
 	PM_DOMAIN_CAMSS_COUNT = 2,	/* CAMSS series of ISPs */
+	PM_DOMAIN_VFELITE = 2,		/* VFELITE / TOP GDSC */
+	PM_DOMAIN_TITAN_COUNT = 3,	/* Titan series of ISPs */
 };
 
 enum camss_version {
@@ -83,8 +85,8 @@  struct camss {
 	int vfe_num;
 	struct vfe_device *vfe;
 	atomic_t ref_count;
-	struct device *genpd[PM_DOMAIN_CAMSS_COUNT];
-	struct device_link *genpd_link[PM_DOMAIN_CAMSS_COUNT];
+	struct device *genpd[PM_DOMAIN_TITAN_COUNT];
+	struct device_link *genpd_link[PM_DOMAIN_TITAN_COUNT];
 };
 
 struct camss_camera_interface {