From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Paul Elder <paul.elder+renesas@ideasonboard.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Ulf Hansson <ulfh@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 07/10] media: rcar-fcp: Handle resets
Date: Fri, 18 Sep 2026 04:28:55 +0300 [thread overview]
Message-ID: <20260918012855.GG145152@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260917-epaul-v7-3-rc1-x5h-vsp-fcp-v1-7-4c72d4e086dd@ideasonboard.com>
On Thu, Sep 17, 2026 at 09:04:46PM +0900, Paul Elder wrote:
> On some versions of the FCP, such as the one on the X5H, reset control
> is required to operate the FCP. Add support for handling resets
> optionally, to continue supporting versions that do not require it.
>
> Signed-off-by: Paul Elder <paul.elder+renesas@ideasonboard.com>
> ---
> drivers/media/platform/renesas/rcar-fcp.c | 34 +++++++++++++++++++++++++++++--
> 1 file changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/rcar-fcp.c b/drivers/media/platform/renesas/rcar-fcp.c
> index d99b3ff976e80f275af19e5dc02c6e1de98c38a3..15bcbbda3b853f71780aae876f6440b33addf193 100644
> --- a/drivers/media/platform/renesas/rcar-fcp.c
> +++ b/drivers/media/platform/renesas/rcar-fcp.c
> @@ -18,6 +18,7 @@
> #include <linux/platform_device.h>
> #include <linux/pm_runtime.h>
> #include <linux/property.h>
> +#include <linux/reset.h>
> #include <linux/slab.h>
>
> #include <media/rcar-fcp.h>
> @@ -63,6 +64,8 @@
> #define RCAR_FCP_REG_BA_REF_Y2 0x0118
> #define RCAR_FCP_REG_BA_REF_C 0x011c
>
> +struct reset_control;
> +
Not needed, you include linux/reset.h.
> enum rcar_fcp_type {
> RCAR_FCPF,
> RCAR_FCPV,
> @@ -73,6 +76,7 @@ struct rcar_fcp_device {
> struct device *dev;
> void __iomem *base;
> enum rcar_fcp_type type;
> + struct reset_control *rstc;
> };
>
> static LIST_HEAD(fcp_devices);
> @@ -262,12 +266,19 @@ static int rcar_fcp_probe(struct platform_device *pdev)
> fcp->dev = &pdev->dev;
> fcp->type = (enum rcar_fcp_type)device_get_match_data(&pdev->dev);
>
> + platform_set_drvdata(pdev, fcp);
> +
> fcp->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(fcp->base))
> return PTR_ERR(fcp->base);
>
> dma_set_max_seg_size(fcp->dev, UINT_MAX);
>
> + fcp->rstc = devm_reset_control_get_optional(&pdev->dev, NULL);
> + if (IS_ERR(fcp->rstc))
> + return dev_err_probe(&pdev->dev, PTR_ERR(fcp->rstc),
> + "failed to get reset control\n");
> +
> pm_runtime_enable(&pdev->dev);
> ret = pm_runtime_resume_and_get(&pdev->dev);
> if (ret < 0)
> @@ -283,8 +294,6 @@ static int rcar_fcp_probe(struct platform_device *pdev)
> list_add_tail(&fcp->list, &fcp_devices);
> mutex_unlock(&fcp_lock);
>
> - platform_set_drvdata(pdev, fcp);
> -
> return 0;
>
> error_pm_put:
> @@ -305,11 +314,32 @@ static void rcar_fcp_remove(struct platform_device *pdev)
> pm_runtime_disable(&pdev->dev);
> }
>
> +static int fcp_pm_runtime_suspend(struct device *dev)
> +{
> + struct rcar_fcp_device *fcp = dev_get_drvdata(dev);
> +
> + reset_control_assert(fcp->rstc);
No need for error checking ?
> + return 0;
> +}
> +
> +static int fcp_pm_runtime_resume(struct device *dev)
> +{
> + struct rcar_fcp_device *fcp = dev_get_drvdata(dev);
> +
> + reset_control_deassert(fcp->rstc);
Same here.
Otherwise this looks good, but please move it before patch 06/10 as I
would like to upstream this without 06/10.
> + return 0;
> +}
> +
> +static const struct dev_pm_ops fcp_pm_ops = {
> + RUNTIME_PM_OPS(fcp_pm_runtime_suspend, fcp_pm_runtime_resume, NULL)
> +};
> +
> static struct platform_driver rcar_fcp_platform_driver = {
> .probe = rcar_fcp_probe,
> .remove = rcar_fcp_remove,
> .driver = {
> .name = "rcar-fcp",
> + .pm = pm_ptr(&fcp_pm_ops),
> .of_match_table = rcar_fcp_of_match,
> .suppress_bind_attrs = true,
> },
>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2026-09-18 1:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 12:04 [PATCH 00/10] media: rcar-fcp, vsp1: Enable on R-Car X5H Paul Elder
2026-09-17 12:04 ` [PATCH 01/10] dt-bindings: clock: renesas,r8a78000-cpg: Add CPG_SGD4_VIO_DP_{TX,OTHER} Paul Elder
2026-09-18 1:03 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 02/10] clk: renesas: r8a78000: Add clock for FCPV and VSP for SCP FW SDKv4.36 Paul Elder
2026-09-18 1:11 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 03/10] pmdomain: renesas: r8a78000: Add maps for VIO " Paul Elder
2026-09-18 1:15 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 04/10] arm64: renesas: r8a78000: Add FCPV[BI] nodes Paul Elder
2026-09-18 1:18 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 05/10] arm64: renesas: r8a78000: Add VSP[BI] nodes Paul Elder
2026-09-18 1:21 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 06/10] media: rcar-fcp: Check device revision at probe time Paul Elder
2026-09-18 1:23 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 07/10] media: rcar-fcp: Handle resets Paul Elder
2026-09-18 1:28 ` Laurent Pinchart [this message]
2026-09-17 12:04 ` [PATCH 08/10] media: vsp1: Support full VSPB on R-Car M3-W, M3-N and E3 Paul Elder
2026-09-18 1:32 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 09/10] media: vsp1: Document X5H SoC ID Paul Elder
2026-09-18 1:32 ` Laurent Pinchart
2026-09-17 12:04 ` [PATCH 10/10] media: rcar-fcp: Add R-Car X5H support Paul Elder
2026-09-18 1:35 ` Laurent Pinchart
2026-09-17 12:17 ` [PATCH 00/10] media: rcar-fcp, vsp1: Enable on R-Car X5H Laurent Pinchart
2026-09-18 1:50 ` Laurent Pinchart
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=20260918012855.GG145152@killaraus.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=bmasney+clk@redhat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=jbrunet+clk@baylibre.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=paul.elder+renesas@ideasonboard.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=ulfh@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®