From: miod Date: Thu, 21 Dec 2023 19:40:47 +0000 (+0000) Subject: New TEMPerGold sensor; reported by Mikolaj Kucharski on bugs@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fdbc13eb2d3ced2c3ee184bc54b7c73c64d4949a;p=openbsd New TEMPerGold sensor; reported by Mikolaj Kucharski on bugs@ --- diff --git a/share/man/man4/ugold.4 b/share/man/man4/ugold.4 index 43df0892d03..abf6b68751a 100644 --- a/share/man/man4/ugold.4 +++ b/share/man/man4/ugold.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ugold.4,v 1.9 2023/12/08 06:33:48 miod Exp $ +.\" $OpenBSD: ugold.4,v 1.10 2023/12/21 19:40:47 miod Exp $ .\" .\" Copyright (c) 2013 Takayoshi SASANO .\" Copyright (c) 2013 Martin Pieuchot @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 8 2023 $ +.Dd $Mdocdate: December 21 2023 $ .Dt UGOLD 4 .Os .Sh NAME @@ -39,6 +39,7 @@ driver: .It Li "RDing TEMPer2_V4.1" Ta "2 Temperature (internal/external)" .It Li "RDing TEMPerGold_V3.1" Ta "1 Temperature" .It Li "RDing TEMPerGold_V3.4" Ta "1 Temperature" +.It Li "RDing TEMPerGold_V3.5" Ta "1 Temperature" .It Li "RDing TEMPerHum1V1.0" Ta "1 Temperature and 1 Humidity" .It Li "RDing TEMPerHum1V1.2" Ta "1 Temperature and 1 Humidity" .It Li "RDing TEMPerHUM_V3.9" Ta "1 Temperature and 1 Humidity" diff --git a/sys/dev/usb/ugold.c b/sys/dev/usb/ugold.c index 7f7dfad213c..c761e5a9f1a 100644 --- a/sys/dev/usb/ugold.c +++ b/sys/dev/usb/ugold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugold.c,v 1.26 2023/12/10 19:03:37 miod Exp $ */ +/* $OpenBSD: ugold.c,v 1.27 2023/12/21 19:40:47 miod Exp $ */ /* * Copyright (c) 2013 Takayoshi SASANO @@ -498,8 +498,14 @@ ugold_si700x_type(struct ugold_softc *sc) /* TEMPerGold prefix */ if (sc->sc_model_len >= 11 && memcmp(sc->sc_model, "TEMPerGold_", 11) == 0) { + /* + * All V3.something models ought to work, but better be + * safe than sorry, and TEMPerHum models have been known + * to use slightly different sensors between models. + */ if (memcmp(sc->sc_model + 11, "V3.1 ", 16 - 11) == 0 || - memcmp(sc->sc_model + 11, "V3.4 ", 16 - 11) == 0) { + memcmp(sc->sc_model + 11, "V3.4 ", 16 - 11) == 0 || + memcmp(sc->sc_model + 11, "V3.5 ", 16 - 11) == 0) { sc->sc_type = UGOLD_TYPE_GOLD; sc->sc_num_sensors = 1; descr = "gold (temperature only)";