mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com,
	rfoss@kernel.org, todor.too@gmail.com, agross@kernel.org,
	andersson@kernel.org, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] media: qcom: camss: Convert to per-VFE pointer for power-domain linkages
Date: Wed, 25 Oct 2023 11:16:25 +0200	[thread overview]
Message-ID: <75c4a105-b925-4d6a-8c42-38f3ab32a7ca@linaro.org> (raw)
In-Reply-To: <20231024224255.754779-2-bryan.odonoghue@linaro.org>



On 10/25/23 00:42, Bryan O'Donoghue wrote:
> Right now we use the top-level camss structure to provide pointers via
> VFE id index back to genpd linkages.
> 
> In effect this hard-codes VFE indexes to power-domain indexes in the
> dtsi and mandates a very particular ordering of power domains in the
> dtsi, which bears no relationship to a real hardware dependency.
> 
> As a first step to rationalising the VFE power-domain code and breaking
> the magic indexing in dtsi use per-VFE pointers to genpd linkages.
> 
> The top-level index in msm_vfe_subdev_init is still used to attain the
> initial so no functional or logical change arises from this change.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
[...]

> @@ -653,11 +653,11 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
>   	if (id >= camss->res->vfe_num)
>   		return 0;
>   
> -	camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id],
> -						DL_FLAG_STATELESS |
> -						DL_FLAG_PM_RUNTIME |
> -						DL_FLAG_RPM_ACTIVE);
Good opportunity to inilne vfe->id and get rid of a local var!

> -	if (!camss->genpd_link[id])
> +	vfe->genpd_link = device_link_add(camss->dev, vfe->genpd,
> +					  DL_FLAG_STATELESS |
> +					  DL_FLAG_PM_RUNTIME |
> +					  DL_FLAG_RPM_ACTIVE);
> +	if (!vfe->genpd_link)
>   		return -EINVAL;
>   
[...]

>   /*
> @@ -1128,10 +1124,10 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
>   	struct camss *camss = vfe->camss;
>   	enum vfe_line_id id = vfe->id;
>   
> -	camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id], DL_FLAG_STATELESS |
> -						DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
> +	vfe->genpd_link = device_link_add(camss->dev, vfe->genpd, DL_FLAG_STATELESS |
> +					  DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
>   
> -	if (!camss->genpd_link[id]) {
> +	if (!vfe->genpd_link) {
>   		dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", id);
>   		return -EINVAL;
And here

[...]

> @@ -1113,10 +1111,10 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
>   	struct camss *camss = vfe->camss;
>   	enum vfe_line_id id = vfe->id;
>   
> -	camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id], DL_FLAG_STATELESS |
> -						DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
> +	vfe->genpd_link = device_link_add(camss->dev, vfe->genpd, DL_FLAG_STATELESS |
> +					  DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE);
>   
> -	if (!camss->genpd_link[id]) {
> +	if (!vfe->genpd_link) {
>   		dev_err(vfe->camss->dev, "Failed to add VFE#%d to power domain\n", id);
>   		return -EINVAL;
And here

[...]
>   
>   /*
> @@ -478,11 +478,11 @@ static int vfe_pm_domain_on(struct vfe_device *vfe)
>   	if (id >= camss->res->vfe_num)
>   		return 0;
>   
> -	camss->genpd_link[id] = device_link_add(camss->dev, camss->genpd[id],
> -						DL_FLAG_STATELESS |
> -						DL_FLAG_PM_RUNTIME |
> -						DL_FLAG_RPM_ACTIVE);
> -	if (!camss->genpd_link[id])
> +	vfe->genpd_link = device_link_add(camss->dev, vfe->genpd,
> +					  DL_FLAG_STATELESS |
> +					  DL_FLAG_PM_RUNTIME |
> +					  DL_FLAG_RPM_ACTIVE);
And here


Konrad

  reply	other threads:[~2023-10-25  9:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 22:42 [PATCH 0/4] media: qcom: camss: Introduce support for named power-domains Bryan O'Donoghue
2023-10-24 22:42 ` [PATCH 1/4] media: qcom: camss: Convert to per-VFE pointer for power-domain linkages Bryan O'Donoghue
2023-10-25  9:16   ` Konrad Dybcio [this message]
2023-10-25 10:41     ` Bryan O'Donoghue
2023-10-24 22:42 ` [PATCH 2/4] media: qcom: camss: Use common VFE pm_domain_on/pm_domain_off where applicable Bryan O'Donoghue
2023-10-25  9:18   ` Konrad Dybcio
2023-10-25 10:40     ` Bryan O'Donoghue
2023-10-26 19:01       ` Konrad Dybcio
2023-10-24 22:42 ` [PATCH 3/4] media: qcom: camss: Move VFE power-domain specifics into vfe.c Bryan O'Donoghue
2023-10-24 22:42 ` [PATCH 4/4] media: qcom: camss: Add support for named power-domains 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=75c4a105-b925-4d6a-8c42-38f3ab32a7ca@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --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 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®