From ed6a17cc3785b25238904a38b655493645317bf9 Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 1 Jul 2023 08:20:38 +0000 Subject: [PATCH] Add support for JH7110 to stftemp(4). This adds temperature sensor support for the Starfive VisionFive 2. ok kettenis@ --- sys/arch/riscv64/dev/stftemp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/arch/riscv64/dev/stftemp.c b/sys/arch/riscv64/dev/stftemp.c index 235f0f09fc4..7c4b836524e 100644 --- a/sys/arch/riscv64/dev/stftemp.c +++ b/sys/arch/riscv64/dev/stftemp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stftemp.c,v 1.1 2022/06/12 10:51:55 kettenis Exp $ */ +/* $OpenBSD: stftemp.c,v 1.2 2023/07/01 08:20:38 jsing Exp $ */ /* * Copyright (c) 2022 Mark Kettenis * @@ -72,7 +72,8 @@ stftemp_match(struct device *parent, void *match, void *aux) { struct fdt_attach_args *faa = aux; - return OF_is_compatible(faa->fa_node, "starfive,jh7100-temp"); + return OF_is_compatible(faa->fa_node, "starfive,jh7100-temp") || + OF_is_compatible(faa->fa_node, "starfive,jh7110-temp"); } void @@ -146,7 +147,7 @@ void stftemp_refresh_sensors(void *arg) { struct stftemp_softc *sc = arg; - + sc->sc_sensor.value = 273150000 + 1000 * stftemp_get_temp(sc); sc->sc_sensor.flags &= ~SENSOR_FINVALID; } -- 2.20.1