mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suresh Vankadara <quic_svankada@quicinc.com>
To: Vikram Sharma <quic_vikramsa@quicinc.com>, <rfoss@kernel.org>,
	<todor.too@gmail.com>, <bryan.odonoghue@linaro.org>,
	<mchehab@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
	<conor+dt@kernel.org>, <andersson@kernel.org>,
	<konradybcio@kernel.org>, <hverkuil-cisco@xs4all.nl>,
	<cros-qcom-dts-watchers@chromium.org>, <catalin.marinas@arm.com>,
	<will@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-media@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC/WIP v2 7/9] media: qcom: camss: Add support for CSID for sa8775p
Date: Sat, 10 May 2025 13:28:19 +0530	[thread overview]
Message-ID: <fd4a66f6-1d64-4047-b6ea-cbcf6720ef70@quicinc.com> (raw)
In-Reply-To: <20250427070135.884623-8-quic_vikramsa@quicinc.com>



On 4/27/2025 12:31 PM, Vikram Sharma wrote:
> The CSID in sa8775p is version 690, This csid is different from
> csid 780 w.r.t few bit-fields.
> 
> Co-developed-by: Suresh Vankadara <quic_svankada@quicinc.com>
> Signed-off-by: Suresh Vankadara <quic_svankada@quicinc.com>
> Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
> ---
>   .../platform/qcom/camss/camss-csid-gen3.c     |  31 +++-
>   drivers/media/platform/qcom/camss/camss.c     | 151 ++++++++++++++++++
>   2 files changed, 175 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.c b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
> index b66105f7b901..4f9471523a08 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid-gen3.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
> @@ -48,8 +48,12 @@
>   #define CSID_CSI2_RX_IRQ_CLEAR		0xA4
>   #define CSID_CSI2_RX_IRQ_SET		0xA8
>   
> +#define IS_CSID_690(csid)	(csid->camss->res->version ==\
> +					CAMSS_8775P ? true : false)
>   #define CSID_BUF_DONE_IRQ_STATUS	0x8C
> -#define		BUF_DONE_IRQ_STATUS_RDI_OFFSET	(csid_is_lite(csid) ? 1 : 14)
> +#define BUF_DONE_IRQ_STATUS_RDI_OFFSET  (csid_is_lite(csid) ?\
> +						1 : (IS_CSID_690(csid) ?\
> +						13 : 14))
This becomes more complex if more number of chipsets under csid gen3 are 
added.inline function helps for readability. It should return with 1, 13 
or 14. This comment is applicable at all places in csid.

>   
> -#define CSID_RDI_IRQ_SUBSAMPLE_PATTERN(rdi)	(0x548 + 0x100 * (rdi))
> -#define CSID_RDI_IRQ_SUBSAMPLE_PERIOD(rdi)	(0x54C + 0x100 * (rdi))
> -
> +#define CSID_RDI_IRQ_SUBSAMPLE_PATTERN(rdi)	(csid_is_lite(csid) && IS_CSID_690(csid) ?\
> +							(0x348 + 0x100 * (rdi)) :\
> +							(0x548 + 0x100 * (rdi)))
> +#define CSID_RDI_IRQ_SUBSAMPLE_PERIOD(rdi)	(csid_is_lite(csid) && IS_CSID_690(csid) ?\
> +							(0x34C + 0x100 * (rdi)) :\
> +							(0x54C + 0x100 * (rdi)))
Subsample pattern is not used in driver. Remove?

>   #define CSI2_RX_CFG0_PHY_SEL_BASE_IDX	1
>   
>   static void __csid_configure_rx(struct csid_device *csid,
> @@ -103,6 +117,9 @@ static void __csid_configure_rx(struct csid_device *csid,
>   	val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
>   	val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX) << CSI2_RX_CFG0_PHY_NUM_SEL;
>   
> +	if (IS_CSID_690(csid) && (vc > 3))
> +		val |= 1 << CSI2_RX_CFG0_VC_MODE;
Is VC greater than 3? in which case?

> +static const struct camss_subdev_resources csid_res_8775p[] = {
> +	/* CSID0 */
> +	{
> +		.regulators = {},
> +
> +		.clock = { "csid", "csiphy_rx"},
> +		.clock_rate = {
> +			{ 400000000, 400000000},
> +			{ 400000000, 400000000}
> +		},
> +
> +		.reg = { "csid0", "csid_top" },
Align name with DTS for csid_top. Comment is applicable for all 
instances for this target.

> +	/* CSID2 (lite) */
> +	{
> +		.regulators = {},
> +
> +		.clock = { "cpas_ife_lite", "vfe_lite_ahb",
> +			   "vfe_lite_csid", "vfe_lite_cphy_rx",
> +			   "vfe_lite"},
Align with DTS comment in clock name. Applicable for all CSID lites for 
this target.


Regards,
Suresh Vankadara.



  reply	other threads:[~2025-05-10  7:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-27  7:01 [PATCH v2 RFC/WIP 0/9] Add sa8775p camss support Vikram Sharma
2025-04-27  7:01 ` [PATCH RFC/WIP v2 1/9] media: qcom: camss: add generic csid handling in csid gen3 Vikram Sharma
2025-04-27  7:01 ` [PATCH RFC/WIP v2 2/9] media: qcom: camss: add generic vfe handling in vfe gen3 Vikram Sharma
2025-04-27  7:01 ` [PATCH RFC/WIP v2 3/9] media: dt-bindings: Add qcom,sa8775p-camss Vikram Sharma
2025-04-28  7:38   ` Krzysztof Kozlowski
2025-04-27  7:01 ` [PATCH RFC/WIP v2 4/9] arm64: dts: qcom: sa8775p: Add support for camss Vikram Sharma
2025-04-30 10:30   ` Konrad Dybcio
2025-05-10  7:14   ` Suresh Vankadara
2025-05-11  9:53     ` Bryan O'Donoghue
2025-04-27  7:01 ` [PATCH RFC/WIP v2 5/9] media: qcom: camss: Add sa8775p compatible Vikram Sharma
2025-05-10  7:25   ` Suresh Vankadara
2025-04-27  7:01 ` [PATCH RFC/WIP v2 6/9] media: qcom: camss: Add support for CSIPHY 690 Vikram Sharma
2025-04-27  7:01 ` [PATCH RFC/WIP v2 7/9] media: qcom: camss: Add support for CSID for sa8775p Vikram Sharma
2025-05-10  7:58   ` Suresh Vankadara [this message]
2025-04-27  7:01 ` [PATCH RFC/WIP v2 8/9] media: qcom: camss: Add support for VFE 690 Vikram Sharma
2025-04-27  7:01 ` [PATCH RFC/WIP v2 9/9] media: qcom: camss: Enumerate resources for SA8775P Vikram Sharma

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=fd4a66f6-1d64-4047-b6ea-cbcf6720ef70@quicinc.com \
    --to=quic_svankada@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=cros-qcom-dts-watchers@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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_vikramsa@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=todor.too@gmail.com \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®