From: Laurentiu Tudor <tudor.laurentiu.oss@gmail.com>
To: Depeng Shao <quic_depengs@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,
vladimir.zapolskiy@linaro.org, hverkuil@xs4all.nl
Cc: quic_eberman@quicinc.com, linux-media@vger.kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@quicinc.com
Subject: Re: [PATCH v8 05/16] media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field inside csiphy struct
Date: Wed, 15 Jan 2025 20:01:46 +0200 [thread overview]
Message-ID: <79b3e4d6-becf-4bcd-91fa-768b4098d01d@gmail.com> (raw)
In-Reply-To: <20250108143733.2761200-6-quic_depengs@quicinc.com>
On 1/8/25 16:37, Depeng Shao wrote:
> From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>
> A .data field in the csiphy device structure allows us to extend out the
> register layout of the three phase capable CSIPHY layer.
>
> Move the existing lane configuration structure to an encapsulating
> structure -> struct csiphy_device_regs which is derived from the .data
> field populated at PHY init time, as opposed to calculated at lane
> configuration.
>
> Reviewed-by: default avatarVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Nit: Something's not right with this tag.
---
Best Regards, Laurentiu
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
> ---
> .../qcom/camss/camss-csiphy-3ph-1-0.c | 54 ++++++++++---------
> .../media/platform/qcom/camss/camss-csiphy.h | 6 +++
> 2 files changed, 36 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
> index b283df7634bb..39cc7109ccf0 100644
> --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
> +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
> @@ -470,32 +470,10 @@ static void csiphy_gen1_config_lanes(struct csiphy_device *csiphy,
> static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy,
> u8 settle_cnt)
> {
> - const struct csiphy_lane_regs *r;
> - int i, array_size;
> + const struct csiphy_lane_regs *r = csiphy->regs->lane_regs;
> + int i, array_size = csiphy->regs->lane_array_size;
> u32 val;
>
> - switch (csiphy->camss->res->version) {
> - case CAMSS_7280:
> - r = &lane_regs_sm8250[0];
> - array_size = ARRAY_SIZE(lane_regs_sm8250);
> - break;
> - case CAMSS_8250:
> - r = &lane_regs_sm8250[0];
> - array_size = ARRAY_SIZE(lane_regs_sm8250);
> - break;
> - case CAMSS_8280XP:
> - r = &lane_regs_sc8280xp[0];
> - array_size = ARRAY_SIZE(lane_regs_sc8280xp);
> - break;
> - case CAMSS_845:
> - r = &lane_regs_sdm845[0];
> - array_size = ARRAY_SIZE(lane_regs_sdm845);
> - break;
> - default:
> - WARN(1, "unknown cspi version\n");
> - return;
> - }
> -
> for (i = 0; i < array_size; i++, r++) {
> switch (r->csiphy_param_type) {
> case CSIPHY_SETTLE_CNT_LOWER_BYTE:
> @@ -588,6 +566,34 @@ static void csiphy_lanes_disable(struct csiphy_device *csiphy,
>
> static int csiphy_init(struct csiphy_device *csiphy)
> {
> + struct device *dev = csiphy->camss->dev;
> + struct csiphy_device_regs *regs;
> +
> + regs = devm_kmalloc(dev, sizeof(*regs), GFP_KERNEL);
> + if (!regs)
> + return -ENOMEM;
> +
> + csiphy->regs = regs;
> +
> + switch (csiphy->camss->res->version) {
> + case CAMSS_845:
> + regs->lane_regs = &lane_regs_sdm845[0];
> + regs->lane_array_size = ARRAY_SIZE(lane_regs_sdm845);
> + break;
> + case CAMSS_7280:
> + case CAMSS_8250:
> + regs->lane_regs = &lane_regs_sm8250[0];
> + regs->lane_array_size = ARRAY_SIZE(lane_regs_sm8250);
> + break;
> + case CAMSS_8280XP:
> + regs->lane_regs = &lane_regs_sc8280xp[0];
> + regs->lane_array_size = ARRAY_SIZE(lane_regs_sc8280xp);
> + break;
> + default:
> + WARN(1, "unknown csiphy version\n");
> + return -ENODEV;
> + }
> +
> return 0;
> }
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h
> index 49393dfd5215..4d731597fed7 100644
> --- a/drivers/media/platform/qcom/camss/camss-csiphy.h
> +++ b/drivers/media/platform/qcom/camss/camss-csiphy.h
> @@ -85,6 +85,11 @@ struct csiphy_subdev_resources {
> const struct csiphy_formats *formats;
> };
>
> +struct csiphy_device_regs {
> + const struct csiphy_lane_regs *lane_regs;
> + int lane_array_size;
> +};
> +
> struct csiphy_device {
> struct camss *camss;
> u8 id;
> @@ -103,6 +108,7 @@ struct csiphy_device {
> struct csiphy_config cfg;
> struct v4l2_mbus_framefmt fmt[MSM_CSIPHY_PADS_NUM];
> const struct csiphy_subdev_resources *res;
> + struct csiphy_device_regs *regs;
> };
>
> struct camss_subdev_resources;
next prev parent reply other threads:[~2025-01-15 18:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 14:37 [PATCH v8 00/16] media: qcom: camss: Add sm8550 support Depeng Shao
2025-01-08 14:37 ` [PATCH v8 01/16] media: qcom: camss: csiphy-3ph: Fix trivial indentation fault in defines Depeng Shao
2025-01-08 14:37 ` [PATCH v8 02/16] media: qcom: camss: csiphy-3ph: Remove redundant PHY init sequence control loop Depeng Shao
2025-01-08 14:37 ` [PATCH v8 03/16] media: qcom: camss: csiphy-3ph: Rename struct Depeng Shao
2025-01-08 14:37 ` [PATCH v8 04/16] media: qcom: camss: csiphy: Add an init callback to CSI PHY devices Depeng Shao
2025-01-08 14:37 ` [PATCH v8 05/16] media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field inside csiphy struct Depeng Shao
2025-01-15 18:01 ` Laurentiu Tudor [this message]
2025-01-15 21:01 ` Bryan O'Donoghue
2025-01-15 21:15 ` Vladimir Zapolskiy
2025-01-15 21:39 ` Bryan O'Donoghue
2025-01-08 14:37 ` [PATCH v8 06/16] media: qcom: camss: csiphy-3ph: Use an offset variable to find common control regs Depeng Shao
2025-01-08 14:37 ` [PATCH v8 07/16] media: qcom: camss: csid: Move common code into csid core Depeng Shao
2025-01-08 14:37 ` [PATCH v8 08/16] media: qcom: camss: vfe: Move common code into vfe core Depeng Shao
2025-01-08 14:37 ` [PATCH v8 09/16] media: qcom: camss: Add callback API for RUP update and buf done Depeng Shao
2025-01-08 14:37 ` [PATCH v8 10/16] media: qcom: camss: Add default case in vfe_src_pad_code Depeng Shao
2025-01-08 14:37 ` [PATCH v8 11/16] media: qcom: camss: csid: Only add TPG v4l2 ctrl if TPG hardware is available Depeng Shao
2025-01-15 15:51 ` Bryan O'Donoghue
2025-01-08 14:37 ` [PATCH v8 12/16] dt-bindings: media: camss: Add qcom,sm8550-camss binding Depeng Shao
2025-01-11 8:54 ` Krzysztof Kozlowski
2025-01-08 14:37 ` [PATCH v8 13/16] media: qcom: camss: Add sm8550 compatible Depeng Shao
2025-01-08 14:37 ` [PATCH v8 14/16] media: qcom: camss: csiphy-3ph: Add Gen2 v2.1.2 two-phase MIPI CSI-2 DPHY support Depeng Shao
2025-01-08 14:37 ` [PATCH v8 15/16] media: qcom: camss: Add CSID 780 support Depeng Shao
2025-01-08 14:37 ` [PATCH v8 16/16] media: qcom: camss: Add support for VFE 780 Depeng Shao
2025-01-10 13:50 ` [PATCH v8 00/16] media: qcom: camss: Add sm8550 support Bryan O'Donoghue
2025-01-10 15:11 ` Depeng Shao
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=79b3e4d6-becf-4bcd-91fa-768b4098d01d@gmail.com \
--to=tudor.laurentiu.oss@gmail.com \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=kernel@quicinc.com \
--cc=krzk+dt@kernel.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_depengs@quicinc.com \
--cc=quic_eberman@quicinc.com \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=todor.too@gmail.com \
--cc=vladimir.zapolskiy@linaro.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®