From: Randy Dunlap <rdunlap@infradead.org>
To: Keerthy <j-keerthy@ti.com>,
rui.zhang@intel.com, robh+dt@kernel.org,
daniel.lezcano@linaro.org
Cc: amit.kucheria@verdurent.com, t-kristo@ti.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
mark.rutland@arm.com
Subject: Re: [PATCH v3 2/4] thermal: k3: Add support for bandgap sensors
Date: Tue, 18 Feb 2020 23:50:29 -0800 [thread overview]
Message-ID: <ab0bc84b-189f-a9be-e838-a38c14fa702a@infradead.org> (raw)
In-Reply-To: <20200219074314.22829-3-j-keerthy@ti.com>
On 2/18/20 11:43 PM, Keerthy wrote:
> The bandgap provides current and voltage reference for its internal
> circuits and other analog IP blocks. The analog-to-digital
> converter (ADC) produces an output value that is proportional
> to the silicon temperature.
>
> Currently reading temperatures and trend computing is supported
> as there are no active/passive cooling agent supported.
>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> drivers/thermal/Kconfig | 12 ++
> drivers/thermal/Makefile | 1 +
> drivers/thermal/k3_bandgap.c | 342 +++++++++++++++++++++++++++++++++++
> 3 files changed, 355 insertions(+)
> create mode 100644 drivers/thermal/k3_bandgap.c
>
> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> index 5a05db5438d6..fa598eddc7ac 100644
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -251,6 +251,18 @@ config IMX_THERMAL
> cpufreq is used as the cooling device to throttle CPUs when the
> passive trip is crossed.
>
> +config K3_THERMAL
> + bool "Texas Instruments K3 thermal support"
Hi,
Why is this bool and not tristate?
> + depends on THERMAL
> + depends on ARCH_K3 || COMPILE_TEST
> + help
> + If you say yes here you get thermal support for the Texas Instruments
> + K3 SoC family. The current chip supported is:
> + - AM654
> +
> + This includes temperature reading functionality and also trend
> + computation.
> +
> config MAX77620_THERMAL
> tristate "Temperature sensor driver for Maxim MAX77620 PMIC"
> depends on MFD_MAX77620
> diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c
> new file mode 100644
> index 000000000000..35d904eb9857
> --- /dev/null
> +++ b/drivers/thermal/k3_bandgap.c
> @@ -0,0 +1,342 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * TI Bandgap temperature sensor driver for K3 SoC Family
> + *
> + * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
> + */
> +static int k3_bgp_read_temp(struct k3_thermal_data *devdata,
> + int *temp)
> +{
> + struct k3_bandgap *bgp;
> + unsigned int dtemp, s0, s1, s2;
> +
> + bgp = devdata->bgp;
> + /**
"/**" is used to indicate kernel-doc notation in the Linux kernel source files,
but this comment is not kernel-doc notation, so please just use "/*".
> + * Errata is applicable for am654 pg 1.0 silicon. There
> + * is a variation of the order for 8-10 degree centigrade.
> + * Work around that by getting the average of two closest
> + * readings out of three readings everytime we want to
> + * report temperatures.
> + *
> + * Errata workaround.
> + */
thanks.
--
~Randy
next prev parent reply other threads:[~2020-02-19 7:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 7:43 [PATCH v3 0/4] thermal: k3: Add support for bandgap sensors Keerthy
2020-02-19 7:43 ` [PATCH v3 1/4] dt-bindings: thermal: k3: Add VTM bindings documentation Keerthy
2020-02-19 14:52 ` Rob Herring
2020-02-20 4:12 ` Keerthy
2020-02-20 19:40 ` Rob Herring
2020-02-24 1:14 ` J, KEERTHY
2020-02-19 7:43 ` [PATCH v3 2/4] thermal: k3: Add support for bandgap sensors Keerthy
2020-02-19 7:50 ` Randy Dunlap [this message]
2020-02-19 12:43 ` Keerthy
2020-02-19 7:43 ` [PATCH v3 3/4] arm64: dts: ti: am654: Add thermal zones Keerthy
2020-02-19 7:43 ` [PATCH v3 4/4] arm64: dts: ti: am6: Add VTM node Keerthy
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=ab0bc84b-189f-a9be-e838-a38c14fa702a@infradead.org \
--to=rdunlap@infradead.org \
--cc=amit.kucheria@verdurent.com \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=j-keerthy@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=t-kristo@ti.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;
as well as URLs for NNTP newsgroup(s).