summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmatthew <jmatthew@openbsd.org>2020-09-08 01:29:58 +0000
committerjmatthew <jmatthew@openbsd.org>2020-09-08 01:29:58 +0000
commit5e6272bac1a5f67db84a50da11f339410772e544 (patch)
tree59d9aa0205f171146e0da81189ce6e672034434a
parentAdd RK3328 PWM, also found in the RK3308. (diff)
downloadwireguard-openbsd-5e6272bac1a5f67db84a50da11f339410772e544.tar.xz
wireguard-openbsd-5e6272bac1a5f67db84a50da11f339410772e544.zip
Add RK3308 temperature sensors.
ok kettenis@
-rw-r--r--sys/dev/fdt/rktemp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/fdt/rktemp.c b/sys/dev/fdt/rktemp.c
index 1e213ef2367..7e07580e2c4 100644
--- a/sys/dev/fdt/rktemp.c
+++ b/sys/dev/fdt/rktemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rktemp.c,v 1.5 2019/07/02 20:14:44 kettenis Exp $ */
+/* $OpenBSD: rktemp.c,v 1.6 2020/09/08 01:29:58 jmatthew Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
*
@@ -153,6 +153,7 @@ struct rktemp_entry rk3328_temps[] = {
{ 125000, 675 },
};
+const char *rk3308_names[] = { "CPU", "GPU" };
const char *rk3328_names[] = { "CPU" };
/* RK3399 conversion table. */
@@ -233,6 +234,7 @@ rktemp_match(struct device *parent, void *match, void *aux)
struct fdt_attach_args *faa = aux;
return (OF_is_compatible(faa->fa_node, "rockchip,rk3288-tsadc") ||
+ OF_is_compatible(faa->fa_node, "rockchip,rk3308-tsadc") ||
OF_is_compatible(faa->fa_node, "rockchip,rk3328-tsadc") ||
OF_is_compatible(faa->fa_node, "rockchip,rk3399-tsadc"));
}
@@ -267,6 +269,11 @@ rktemp_attach(struct device *parent, struct device *self, void *aux)
sc->sc_ntemps = nitems(rk3288_temps);
sc->sc_nsensors = 3;
names = rk3288_names;
+ } else if (OF_is_compatible(node, "rockchip,rk3308-tsadc")) {
+ sc->sc_temps = rk3328_temps;
+ sc->sc_ntemps = nitems(rk3328_temps);
+ sc->sc_nsensors = 2;
+ names = rk3308_names;
} else if (OF_is_compatible(node, "rockchip,rk3328-tsadc")) {
sc->sc_temps = rk3328_temps;
sc->sc_ntemps = nitems(rk3328_temps);