From: ALOK TIWARI <alok.a.tiwari@oracle.com>
To: Christian Marangi <ansuelsmth@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] thermal: Add support for Airoha EN7581 thermal sensor
Date: Wed, 14 May 2025 01:19:54 +0530 [thread overview]
Message-ID: <084240c5-48aa-406a-9bbe-2f349f9c2509@oracle.com> (raw)
In-Reply-To: <20250510172509.2547273-2-ansuelsmth@gmail.com>
> + * the same addr is used for ADC volt and valid reading.
> + * In such case, VALID ADDR is used and volt addr is ignored.
> + */
> +#define EN7581_RD_CTRL_DIFF BIT(0)
> +#define EN7581_TEMPADCVALIDMASK 0x884
> +#define EN7581_ADV_RD_VALID_POLARITY BIT(5)
> +#define EN7581_ADV_RD_VALID_POS GENMASK(4, 0)
> +#define EN7581_TEMPADCVOLTAGESHIFT 0x888
> +#define EN7581_ADC_VOLTAGE_SHIFT GENMASK(4, 0)
> +/*
> + * Same values for each CTL.
> + * Can operate in:
> + * - 1 sample
> + * - 2 sample and make average of them
> + * - 4,6,10,16 sample, drop max and min and make avgerage of them
typo avgerage -> average
[...]
> +}
> +
> +static void airoha_thermal_setup_monitor(struct airoha_thermal_priv *priv)
> +{
> + /* Set measure mode */
> + writel(FIELD_PREP(EN7581_MSRCTL0, EN7581_MSRCTL_6SAMPLE_MAX_MIX_AVG4),
> + priv->base + EN7581_TEMPMSRCTL0);
> +
> + /*
> + * Configure ADC valid reading addr
> + * The AHB temp monitor system doesn't have direct access to the
> + * thermal sensor. It does instead work by providing all kind of
> + * address to configure how to access and setup an ADC for the
> + * sensor. EN7581 supports only one sensor hence the
> + * implementation is greatly simplified but the AHB supports
> + * up to 4 different sensor from the same ADC that can be
"all kind of address" -> "various addresses"
4 different sensor -> 4 different sensors
> + * switched by tuning the ADC mux or wiriting address.
typo wiriting -> writing
> + *
> + * We set valid instead of volt as we don't enable valid/volt
> + * split reading and AHB read valid addr in such case.
> + */
> + writel(priv->scu_adc_res.start + EN7581_DOUT_TADC,
> + priv->base + EN7581_TEMPADCVALIDADDR);
> +
Thanks,
Alok
next prev parent reply other threads:[~2025-05-13 19:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-10 17:25 [PATCH v6 1/2] dt-bindings: thermal: Add support for Airoha EN7581 thermal sensor Christian Marangi
2025-05-10 17:25 ` [PATCH v6 2/2] " Christian Marangi
2025-05-11 12:16 ` kernel test robot
2025-05-12 21:26 ` kernel test robot
2025-05-13 16:59 ` kernel test robot
2025-05-13 19:49 ` ALOK TIWARI [this message]
2025-05-13 20:11 ` Christian Marangi (Ansuel)
2025-05-14 8:34 ` Daniel Lezcano
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=084240c5-48aa-406a-9bbe-2f349f9c2509@oracle.com \
--to=alok.a.tiwari@oracle.com \
--cc=ansuelsmth@gmail.com \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=rui.zhang@intel.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