
On Fri, 12 Aug 2022 at 12:16, Robert Marko robert.marko@sartura.hr wrote:
Currently, there is no way for users to check the readings from thermal sensors from U-boot console, only some boards print it during boot.
So, lets add a simple "temperature" command that allows listing thermal uclass devices and getting their value.
Note that the thermal devices are intenionally probed if list is used as almost always they will not get probed otherwise and there is no way for users to manually call probe on a certain device from console.
Assumption is made that temperature is returned in degrees C and not milidegrees like in Linux as this is what most drivers seem to return.
Signed-off-by: Robert Marko robert.marko@sartura.hr
Changes in v2:
- Drop <dm/uclass-internal.h> by using uclass_get_device_by_name()
- Make the unit clear in help
- Expand Kconfig boolean and help
- Drop degree symbol as test doesnt work with it.
cmd/Kconfig | 6 ++++ cmd/Makefile | 1 + cmd/temperature.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 cmd/temperature.c
Reviewed-by: Simon Glass sjg@chromium.org