All of lore.kernel.org
 help / color / mirror / Atom feed
From: Depeng Shao <quic_depengs@quicinc.com>
To: <rfoss@kernel.org>, <todor.too@gmail.com>,
	<bryan.odonoghue@linaro.org>, <andersson@kernel.org>,
	<konrad.dybcio@linaro.org>, <mchehab@kernel.org>,
	<quic_yon@quicinc.com>
Cc: <quic_depengs@quicinc.com>, <linux-kernel@vger.kernel.org>,
	<linux-media@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>
Subject: [PATCH v2 8/8] media: qcom: camss: Add sm8550 support
Date: Wed, 20 Mar 2024 19:41:36 +0530	[thread overview]
Message-ID: <20240320141136.26827-9-quic_depengs@quicinc.com> (raw)
In-Reply-To: <20240320141136.26827-1-quic_depengs@quicinc.com>

Add in functional logic throughout the code to support the SM8550.

Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
---
 .../media/platform/qcom/camss/camss-csid.c    | 19 +++++++++++++++++++
 .../media/platform/qcom/camss/camss-csiphy.c  |  1 +
 drivers/media/platform/qcom/camss/camss-vfe.c |  7 +++++++
 .../media/platform/qcom/camss/camss-video.c   |  1 +
 4 files changed, 28 insertions(+)

diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index eb27d69e89a1..e9203dc15798 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -590,6 +590,25 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
 			csid->base = camss->vfe[id].base + VFE_480_LITE_CSID_OFFSET;
 		else
 			csid->base = camss->vfe[id].base + VFE_480_CSID_OFFSET;
+	} else if (camss->res->version == CAMSS_8550) {
+		/* for titan 780, CSID lite registers are inside the VFE lite region,
+		 * between the VFE "top" and "bus" registers. this requires
+		 * VFE to be initialized before CSID
+		 */
+		if (id >= 2)
+			csid->base = camss->vfe[id].base;
+		else {
+			csid->base =
+				devm_platform_ioremap_resource_byname(pdev, res->reg[0]);
+			if (id != 0)
+				csid->top_base = camss->csid[0].top_base;
+			else
+				csid->top_base =
+					devm_platform_ioremap_resource_byname(pdev, res->reg[1]);
+		}
+
+		if (IS_ERR(csid->base))
+			return PTR_ERR(csid->base);
 	} else {
 		csid->base = devm_platform_ioremap_resource_byname(pdev, res->reg[0]);
 		if (IS_ERR(csid->base))
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
index 45b3a8e5dea4..f35af0dd2147 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
@@ -579,6 +579,7 @@ int msm_csiphy_subdev_init(struct camss *camss,
 	case CAMSS_845:
 	case CAMSS_8250:
 	case CAMSS_8280XP:
+	case CAMSS_8550:
 		csiphy->formats = csiphy_formats_sdm845;
 		csiphy->nformats = ARRAY_SIZE(csiphy_formats_sdm845);
 		break;
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index d875237cf244..ff115c5521c6 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -226,6 +226,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
 	case CAMSS_845:
 	case CAMSS_8250:
 	case CAMSS_8280XP:
+	case CAMSS_8550:
 		switch (sink_code) {
 		case MEDIA_BUS_FMT_YUYV8_1X16:
 		{
@@ -296,6 +297,10 @@ int vfe_reset(struct vfe_device *vfe)
 
 	reinit_completion(&vfe->reset_complete);
 
+	// The reset has been moved to csid in 8550
+	if (vfe->camss->res->version == CAMSS_8550)
+		return 0;
+
 	vfe->ops->global_reset(vfe);
 
 	time = wait_for_completion_timeout(&vfe->reset_complete,
@@ -1520,6 +1525,7 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
 		case CAMSS_845:
 		case CAMSS_8250:
 		case CAMSS_8280XP:
+		case CAMSS_8550:
 			l->formats = formats_rdi_845;
 			l->nformats = ARRAY_SIZE(formats_rdi_845);
 			break;
@@ -1605,6 +1611,7 @@ static int vfe_bpl_align(struct vfe_device *vfe)
 	case CAMSS_845:
 	case CAMSS_8250:
 	case CAMSS_8280XP:
+	case CAMSS_8550:
 		ret = 16;
 		break;
 	default:
diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
index 54cd82f74115..78a746be952c 100644
--- a/drivers/media/platform/qcom/camss/camss-video.c
+++ b/drivers/media/platform/qcom/camss/camss-video.c
@@ -1029,6 +1029,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
 	case CAMSS_845:
 	case CAMSS_8250:
 	case CAMSS_8280XP:
+	case CAMSS_8550:
 		video->formats = formats_rdi_845;
 		video->nformats = ARRAY_SIZE(formats_rdi_845);
 		break;
-- 
2.17.1


  parent reply	other threads:[~2024-03-20 14:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 14:11 [PATCH v2 0/8] media: qcom: camss: Add sm8550 support Depeng Shao
2024-03-20 14:11 ` [PATCH v2 1/8] media: qcom: camss: Add CAMSS_8550 enum Depeng Shao
2024-03-20 14:50   ` Bryan O'Donoghue
2024-03-20 15:51   ` Krzysztof Kozlowski
2024-03-20 15:53     ` Bryan O'Donoghue
2024-03-20 15:59       ` Krzysztof Kozlowski
2024-03-20 14:11 ` [PATCH v2 2/8] media: qcom: camss: Add subdev notify support Depeng Shao
2024-03-20 16:08   ` Bryan O'Donoghue
2024-03-20 16:41     ` Gjorgji Rosikopulos (Consultant)
2024-03-20 14:11 ` [PATCH v2 3/8] media: qcom: camss: Add new csiphy driver 2-1-2 Depeng Shao
2024-03-20 15:21   ` Bryan O'Donoghue
2024-03-25 12:15     ` Depeng Shao
2024-03-20 14:11 ` [PATCH v2 4/8] media: qcom: camss: Add new params for csid_device Depeng Shao
2024-03-20 15:26   ` Bryan O'Donoghue
2024-03-20 15:53   ` Krzysztof Kozlowski
2024-03-25 12:30     ` Depeng Shao
2024-03-20 14:11 ` [PATCH v2 5/8] media: qcom: camss: Add CSID gen3 driver Depeng Shao
2024-03-20 15:40   ` Bryan O'Donoghue
2024-03-20 16:12     ` Bryan O'Donoghue
2024-03-25 13:38     ` Depeng Shao
2024-03-20 14:11 ` [PATCH v2 6/8] media: qcom: camss: Add new VFE driver for SM8550 Depeng Shao
2024-03-20 15:57   ` Bryan O'Donoghue
2024-03-25 12:47     ` Depeng Shao
2024-04-09 13:39   ` Bryan O'Donoghue
2024-04-09 15:35     ` Bryan O'Donoghue
2024-03-20 14:11 ` [PATCH v2 7/8] media: qcom: camss: Add sm8550 resources Depeng Shao
2024-03-20 15:50   ` Krzysztof Kozlowski
2024-03-20 14:11 ` Depeng Shao [this message]
2024-03-20 16:01   ` [PATCH v2 8/8] media: qcom: camss: Add sm8550 support Bryan O'Donoghue
2024-03-25 13:16     ` Depeng Shao
2024-03-20 15:08 ` [PATCH v2 0/8] " Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240320141136.26827-9-quic_depengs@quicinc.com \
    --to=quic_depengs@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=quic_yon@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=todor.too@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.