From: Jonathan Cameron <jic23@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Claudiu <claudiu.beznea@tuxon.dev>,
rafael@kernel.org, daniel.lezcano@linaro.org,
rui.zhang@intel.com, lukasz.luba@arm.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, magnus.damm@gmail.com,
mturquette@baylibre.com, sboyd@kernel.org,
p.zabel@pengutronix.de, ulf.hansson@linaro.org,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 4/6] thermal: renesas: rzg3s: Add thermal driver for the Renesas RZ/G3S SoC
Date: Sat, 25 Jan 2025 12:18:26 +0000 [thread overview]
Message-ID: <20250125121826.6abbe7de@jic23-huawei> (raw)
In-Reply-To: <CAMuHMdUDKFRsZWsZG9DY4PHdxQEDoPqzfeRx8MNTreOpxdLvpw@mail.gmail.com>
On Wed, 22 Jan 2025 11:29:19 +0100
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Claudiu,
>
> CC iio
>
> On Fri, Jan 3, 2025 at 5:38 PM Claudiu <claudiu.beznea@tuxon.dev> wrote:
> > From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >
> > The Renesas RZ/G3S SoC features a Thermal Sensor Unit (TSU) that reports
> > the junction temperature. The temperature is reported through a dedicated
> > ADC channel. Add a driver for the Renesas RZ/G3S TSU.
> >
> > Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Thanks for your patch!
>
> > --- /dev/null
> > +++ b/drivers/thermal/renesas/rzg3s_thermal.c
>
> > +static int rzg3s_thermal_probe(struct platform_device *pdev)
> > +{
> > + struct rzg3s_thermal_priv *priv;
> > + struct device *dev = &pdev->dev;
> > + int ret;
> > +
> > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> > + if (!priv)
> > + return -ENOMEM;
> > +
> > + priv->base = devm_platform_ioremap_resource(pdev, 0);
> > + if (IS_ERR(priv->base))
> > + return PTR_ERR(priv->base);
> > +
> > + priv->channel = devm_iio_channel_get(dev, "tsu");
>
> Given there's only a single IIO channel, you could pass NULL instead
> of the name, and drop "io-channel-names" from the DT bindings.
> I don't know what's the IIO policy w.r.t. unnamed channels, though.
It's supported, so fine as long as no future additional names show up.
Will just fallback to index 0 I think.
Jonathan
>
> > + if (IS_ERR(priv->channel))
> > + return dev_err_probe(dev, PTR_ERR(priv->channel), "Failed to get IIO channel!\n");
> > +
> > + priv->rstc = devm_reset_control_get_exclusive_deasserted(dev, NULL);
> > + if (IS_ERR(priv->rstc))
> > + return dev_err_probe(dev, PTR_ERR(priv->rstc), "Failed to get reset!\n");
> > +
> > + priv->dev = dev;
> > + priv->mode = THERMAL_DEVICE_DISABLED;
> > + platform_set_drvdata(pdev, priv);
> > +
> > + pm_runtime_set_autosuspend_delay(dev, 300);
> > + pm_runtime_use_autosuspend(dev);
> > + pm_runtime_enable(dev);
> > +
> > + ret = rzg3s_thermal_read_calib(priv);
> > + if (ret) {
> > + dev_err_probe(dev, ret, "Failed to read calibration data!\n");
> > + goto rpm_disable;
> > + }
> > +
> > + priv->tz = thermal_of_zone_register(dev->of_node, 0, priv, &rzg3s_tz_of_ops);
> > + if (IS_ERR(priv->tz)) {
> > + dev_err_probe(dev, PTR_ERR(priv->tz), "Failed to register thermal zone!\n");
> > + goto rpm_disable;
> > + }
> > +
> > + ret = thermal_add_hwmon_sysfs(priv->tz);
> > + if (ret) {
> > + dev_err_probe(dev, ret, "Failed to add hwmon sysfs!\n");
> > + goto tz_unregister;
> > + }
> > +
> > + return 0;
> > +
> > +tz_unregister:
> > + thermal_of_zone_unregister(priv->tz);
> > +rpm_disable:
> > + pm_runtime_disable(dev);
> > + pm_runtime_dont_use_autosuspend(dev);
> > + return ret;
> > +}
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
next prev parent reply other threads:[~2025-01-25 12:18 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 16:37 [PATCH 0/6] thermal: renesas: Add support for RZ/G3S Claudiu
2025-01-03 16:38 ` [PATCH 1/6] clk: renesas: r9a08g045: Add clocks, resets and power domain support for the TSU IP Claudiu
2025-01-10 14:16 ` Geert Uytterhoeven
2025-01-03 16:38 ` [PATCH 2/6] thermal: of: Export non-devres helper to register/unregister thermal zone Claudiu
2025-01-09 17:34 ` Daniel Lezcano
2025-01-15 15:42 ` Ulf Hansson
2025-02-04 14:33 ` Jonathan Cameron
2025-02-05 8:33 ` Claudiu Beznea
2025-02-05 11:39 ` Jonathan Cameron
2025-01-29 17:24 ` Daniel Lezcano
2025-01-30 9:08 ` Claudiu Beznea
2025-01-30 10:07 ` Daniel Lezcano
2025-01-30 10:30 ` Claudiu Beznea
2025-01-30 10:50 ` Claudiu Beznea
2025-01-30 17:24 ` Daniel Lezcano
2025-01-30 17:32 ` Claudiu Beznea
2025-01-30 20:53 ` Claudiu Beznea
2025-01-30 22:33 ` Daniel Lezcano
2025-01-30 23:16 ` Claudiu Beznea
2025-02-03 16:30 ` Claudiu Beznea
2025-01-30 10:33 ` Biju Das
2025-01-30 17:31 ` Daniel Lezcano
2025-01-30 17:47 ` Biju Das
2025-01-03 16:38 ` [PATCH 3/6] dt-bindings: thermal: r9a08g045-tsu: Document the TSU unit Claudiu
2025-01-08 23:43 ` Rob Herring (Arm)
2025-01-22 10:12 ` Geert Uytterhoeven
2025-01-03 16:38 ` [PATCH 4/6] thermal: renesas: rzg3s: Add thermal driver for the Renesas RZ/G3S SoC Claudiu
2025-01-22 10:29 ` Geert Uytterhoeven
2025-01-25 12:18 ` Jonathan Cameron [this message]
2025-01-27 8:32 ` Claudiu Beznea
2025-01-27 8:54 ` Geert Uytterhoeven
2025-01-27 9:11 ` Biju Das
2025-01-27 9:15 ` Claudiu Beznea
2025-01-27 9:17 ` Biju Das
2025-01-03 16:38 ` [PATCH 5/6] arm64: dts: renesas: r9a08g045: Add TSU node Claudiu
2025-01-22 10:31 ` Geert Uytterhoeven
2025-01-30 17:53 ` Daniel Lezcano
2025-01-03 16:38 ` [PATCH 6/6] arm64: defconfig: Enable RZ/G3S thermal Claudiu
2025-01-22 10:33 ` Geert Uytterhoeven
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=20250125121826.6abbe7de@jic23-huawei \
--to=jic23@kernel.org \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=magnus.damm@gmail.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=rui.zhang@intel.com \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@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