mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dikshita Agarwal <quic_dikshita@quicinc.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	Vikash Garodia <quic_vgarodia@quicinc.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: <linux-media@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 3/7] media: platform: qcom/iris: introduce optional controller_rst_tbl
Date: Wed, 16 Apr 2025 13:16:24 +0530	[thread overview]
Message-ID: <35ffb534-fb8d-4023-1ac0-cb1f37d0448a@quicinc.com> (raw)
In-Reply-To: <20250415-topic-sm8x50-iris-v10-v6-3-8ad319094055@linaro.org>



On 4/15/2025 7:17 PM, Neil Armstrong wrote:
> Introduce an optional controller_rst_tbl use to store reset lines
> used to reset part of the controller.
> 
> This is necessary for the vpu3 support, when the xo reset line
> must be asserted separately from the other reset line
> on power off operation.
> 
> Factor the iris_init_resets() logic to allow requesting
> multiple reset tables.
> 
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  drivers/media/platform/qcom/iris/iris_core.h       |  2 ++
>  .../platform/qcom/iris/iris_platform_common.h      |  2 ++
>  drivers/media/platform/qcom/iris/iris_probe.c      | 39 +++++++++++++++-------
>  3 files changed, 31 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
> index 37fb4919fecc62182784b4dca90fcab47dd38a80..aeeac32a1f6d9a9fa7027e8e3db4d95f021c552e 100644
> --- a/drivers/media/platform/qcom/iris/iris_core.h
> +++ b/drivers/media/platform/qcom/iris/iris_core.h
> @@ -43,6 +43,7 @@ struct icc_info {
>   * @clock_tbl: table of iris clocks
>   * @clk_count: count of iris clocks
>   * @resets: table of iris reset clocks
> + * @controller_resets: table of controller reset clocks
>   * @iris_platform_data: a structure for platform data
>   * @state: current state of core
>   * @iface_q_table_daddr: device address for interface queue table memory
> @@ -82,6 +83,7 @@ struct iris_core {
>  	struct clk_bulk_data			*clock_tbl;
>  	u32					clk_count;
>  	struct reset_control_bulk_data		*resets;
> +	struct reset_control_bulk_data		*controller_resets;
>  	const struct iris_platform_data		*iris_platform_data;
>  	enum iris_core_state			state;
>  	dma_addr_t				iface_q_table_daddr;
> diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
> index f6b15d2805fb2004699709bb12cd7ce9b052180c..fdd40fd80178c4c66b37e392d07a0a62f492f108 100644
> --- a/drivers/media/platform/qcom/iris/iris_platform_common.h
> +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
> @@ -156,6 +156,8 @@ struct iris_platform_data {
>  	unsigned int clk_tbl_size;
>  	const char * const *clk_rst_tbl;
>  	unsigned int clk_rst_tbl_size;
> +	const char * const *controller_rst_tbl;
> +	unsigned int controller_rst_tbl_size;
>  	u64 dma_mask;
>  	const char *fwname;
>  	u32 pas_id;
> diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
> index aca442dcc153830e6252d1dca87afb38c0b9eb8f..4f8bce6e2002bffee4c93dcaaf6e52bf4e40992e 100644
> --- a/drivers/media/platform/qcom/iris/iris_probe.c
> +++ b/drivers/media/platform/qcom/iris/iris_probe.c
> @@ -91,25 +91,40 @@ static int iris_init_clocks(struct iris_core *core)
>  	return 0;
>  }
>  
> -static int iris_init_resets(struct iris_core *core)
> +static int iris_init_reset_table(struct iris_core *core,
> +				 struct reset_control_bulk_data **resets,
> +				 const char * const *rst_tbl, u32 rst_tbl_size)
>  {
> -	const char * const *rst_tbl;
> -	u32 rst_tbl_size;
>  	u32 i = 0;
>  
> -	rst_tbl = core->iris_platform_data->clk_rst_tbl;
> -	rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size;
> -
> -	core->resets = devm_kzalloc(core->dev,
> -				    sizeof(*core->resets) * rst_tbl_size,
> -				    GFP_KERNEL);
> -	if (!core->resets)
> +	*resets = devm_kzalloc(core->dev,
> +			       sizeof(struct reset_control_bulk_data) * rst_tbl_size,
> +			       GFP_KERNEL);
> +	if (!*resets)
>  		return -ENOMEM;
>  
>  	for (i = 0; i < rst_tbl_size; i++)
> -		core->resets[i].id = rst_tbl[i];
> +		(*resets)[i].id = rst_tbl[i];
> +
> +	return devm_reset_control_bulk_get_exclusive(core->dev, rst_tbl_size, *resets);
> +}
> +
> +static int iris_init_resets(struct iris_core *core)
> +{
> +	int ret;
> +
> +	ret = iris_init_reset_table(core, &core->resets,
> +				    core->iris_platform_data->clk_rst_tbl,
> +				    core->iris_platform_data->clk_rst_tbl_size);
> +	if (ret)
> +		return ret;
> +
> +	if (!core->iris_platform_data->controller_rst_tbl_size)
> +		return 0;
>  
> -	return devm_reset_control_bulk_get_exclusive(core->dev, rst_tbl_size, core->resets);
> +	return iris_init_reset_table(core, &core->controller_resets,
> +				     core->iris_platform_data->controller_rst_tbl,
> +				     core->iris_platform_data->controller_rst_tbl_size);
>  }
>  
>  static int iris_init_resources(struct iris_core *core)
> 
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>

  reply	other threads:[~2025-04-16  7:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15 13:47 [PATCH v6 0/7] media: qcom: iris: add support for SM8650 Neil Armstrong
2025-04-15 13:47 ` [PATCH v6 1/7] dt-bindings: media: qcom,sm8550-iris: document SM8650 IRIS accelerator Neil Armstrong
2025-04-15 13:47 ` [PATCH v6 2/7] media: platform: qcom/iris: add power_off_controller to vpu_ops Neil Armstrong
2025-04-15 13:47 ` [PATCH v6 3/7] media: platform: qcom/iris: introduce optional controller_rst_tbl Neil Armstrong
2025-04-16  7:46   ` Dikshita Agarwal [this message]
2025-04-15 13:47 ` [PATCH v6 4/7] media: platform: qcom/iris: rename iris_vpu3 to iris_vpu3x Neil Armstrong
2025-04-15 13:47 ` [PATCH v6 5/7] media: platform: qcom/iris: add support for vpu33 Neil Armstrong
2025-04-15 13:47 ` [PATCH v6 6/7] media: platform: qcom/iris: rename platform_sm8550 to platform_gen2 Neil Armstrong
2025-04-15 14:20   ` Bryan O'Donoghue
2025-04-15 13:47 ` [PATCH v6 7/7] media: platform: qcom/iris: add sm8650 support Neil Armstrong
2025-04-15 14:19   ` Bryan O'Donoghue
2025-04-16 10:25   ` Dikshita Agarwal
2025-04-16 11:23     ` Dmitry Baryshkov
2025-04-16 12:03       ` Dikshita Agarwal
2025-04-17  8:50     ` Neil Armstrong
2025-04-17 14:06       ` Vikash Garodia

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=35ffb534-fb8d-4023-1ac0-cb1f37d0448a@quicinc.com \
    --to=quic_dikshita@quicinc.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=robh@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®