public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] thermal: imx_scu_thermal: fix getting DT alert property value
Date: Wed, 20 May 2020 00:05:01 +0200	[thread overview]
Message-ID: <20200520000501.6a03d99b@crub> (raw)
In-Reply-To: <DB6PR0402MB27601310E50EAFB4C90BF10788B90@DB6PR0402MB2760.eurprd04.prod.outlook.com>

On Tue, 19 May 2020 11:45:55 +0000
Peng Fan peng.fan at nxp.com wrote:
...
> Do you have more insights about uclass_get_device and uclass_get_device_byname?
> uclass_get_device not work, but uclass_get_device_byname work.

well, we have three thermal uclass devices on i.MX8QXP:
 thermal       0  [   ]   imx_sc_thermal        |-- thermal-sensor
 thermal       1  [   ]   imx_sc_thermal        |   |-- cpu-thermal0
 thermal       2  [   ]   imx_sc_thermal        |   `-- drc-thermal0

when using uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev), the
first device ("thermal-sensor") is matching and for this device
imx_sc_thermal_ofdata_to_platdata() will be called, it then tries to
get the "thermal-sensors" list in the node of "thermal-sensor" device
(dev_of_offset(dev)), but this is wrong, since this list is a property
of the "cpu-thermal0" node according to bindings.

Therefore ofdata_to_platdata() can't find the "thermal-sensors" list
and does not initialize alert/critical pdata values.

When uclass_get_device_by_name() is used, then imx_sc_thermal_ofdata_to_platdata()
is called for "cpu-thermal0" device, here getting the list works
and alert/critical pdata values are initialized properly.

--
Anatolij

  reply	other threads:[~2020-05-19 22:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 20:34 [PATCH 1/2] cpu: imx8: fix type and rate detection Anatolij Gustschin
2020-05-16 20:34 ` [PATCH 2/2] thermal: imx_scu_thermal: fix getting DT alert property value Anatolij Gustschin
2020-05-17 10:04   ` Peng Fan
2020-05-17 11:18     ` Anatolij Gustschin
2020-05-17 14:43       ` Peng Fan
2020-05-17 14:53         ` Anatolij Gustschin
2020-05-19  9:35           ` Anatolij Gustschin
2020-05-19 10:05             ` Peng Fan
2020-05-19 10:26               ` Anatolij Gustschin
2020-05-19 11:45                 ` Peng Fan
2020-05-19 22:05                   ` Anatolij Gustschin [this message]
2020-05-19 23:37                     ` Anatolij Gustschin
2020-05-18 23:32       ` Fabio Estevam
2020-05-19  4:17         ` Heiko Schocher
2020-05-19  8:47           ` Anatolij Gustschin
2020-05-19 11:57           ` Fabio Estevam
2020-05-19  8:19         ` Anatolij Gustschin
2020-05-19 23:31   ` [PATCH] cpu: imx8: use intended cpu-thermal device when getting temp value Anatolij Gustschin
2020-05-20  2:17     ` Peng Fan
2020-05-22 21:14     ` Anatolij Gustschin
2020-05-17 10:02 ` [PATCH 1/2] cpu: imx8: fix type and rate detection Peng Fan
2020-05-22 21:13 ` Anatolij Gustschin

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=20200520000501.6a03d99b@crub \
    --to=agust@denx.de \
    --cc=u-boot@lists.denx.de \
    /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