u-boot/drivers/thermal/thermal_sandbox.c
Michal Simek 81f3a665ab common: Convert *.c/h from UTF-8 to ASCII enconfing
Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or
names are converted.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Marek Behún <kabel@kernel.org>
2024-04-22 11:01:48 -06:00

36 lines
759 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 2022 Sartura Ltd.
* Written by Robert Marko <robert.marko@sartura.hr>
*
* Sandbox driver for the thermal uclass.
*/
#include <common.h>
#include <dm.h>
#include <thermal.h>
int sandbox_thermal_get_temp(struct udevice *dev, int *temp)
{
/* Simply return 100 deg C */
*temp = 100;
return 0;
}
static const struct dm_thermal_ops sandbox_thermal_ops = {
.get_temp = sandbox_thermal_get_temp,
};
static const struct udevice_id sandbox_thermal_ids[] = {
{ .compatible = "sandbox,thermal" },
{ }
};
U_BOOT_DRIVER(thermal_sandbox) = {
.name = "thermal-sandbox",
.id = UCLASS_THERMAL,
.of_match = sandbox_thermal_ids,
.ops = &sandbox_thermal_ops,
.flags = DM_FLAG_PRE_RELOC,
};