> Date: Sun, 21 Apr 2019 21:25:25 +0200
> From: Marcus Glocker <[email protected]>
> 
> I found a second thermal sensor INT3403 in my X1 which didn't attach
> to acpitz(4) because its type returns AML_OBJTYPE_DEVICE instead of
> AML_OBJTYPE_THERMZONE.
> 
> When matching it explicitly it attaches to acpitz1 and seems to work
> fine (I did some load tests to see it scaling up and down):
> 
>    hw.sensors.acpitz0.temp0=54.00 degC (zone temperature)
> -> hw.sensors.acpitz1.temp0=41.00 degC (zone temperature)
> 
> Can we add acpi_matchhids() for such sensors?

This INT3403 device is part of Intel's DPTF and I don't think it makes
sense to have acpitz(4) handle this.  Looking at the relevant Linux
code the DPTF stuff is more complicated.

Maybe we should add a separate driver for this?

> Index: sys/dev/acpi/acpitz.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/acpi/acpitz.c,v
> retrieving revision 1.54
> diff -u -p -r1.54 acpitz.c
> --- sys/dev/acpi/acpitz.c     29 Jun 2018 17:39:18 -0000      1.54
> +++ sys/dev/acpi/acpitz.c     21 Apr 2019 19:12:10 -0000
> @@ -76,6 +76,11 @@ struct cfdriver acpitz_cd = {
>       NULL, "acpitz", DV_DULL
>  };
>  
> +const char *acpitz_hids[] = {
> +     "INT3403",
> +     NULL
> +};
> +
>  void acpitz_init_perf(void *);
>  void acpitz_setperf(int);
>  void acpitz_monitor(struct acpitz_softc *);
> @@ -171,6 +176,13 @@ acpitz_match(struct device *parent, void
>  {
>       struct acpi_attach_args *aa = aux;
>       struct cfdata           *cf = match;
> +
> +     /*
> +      * Some thermal sensors don't match to AML_OBJTYPE_THERMZONE.
> +      * First try to match them explicitly therefore.
> +      */
> +     if (acpi_matchhids(aa, acpitz_hids, cf->cf_driver->cd_name))
> +             return (1);
>  
>       /* sanity */
>       if (aa->aaa_name == NULL ||
> 
> 

Reply via email to