On Sun, 3 Dec 2023 02:30:51 +0000 (UTC)
[email protected] wrote:
> Hello again. I've been trying to gather dmesgs online and it seems
> that the only macppc computers with this driver are powerbooks and
> ibooks, not Nuno's model, for instance.
>
> I think it's reasonable to do this with an ifdef, what do you think?
Mac OS might not be setting this temperature, so I don't know why
OpenBSD should set it. For now, I prefer to do nothing.
I looked at Mac OS source code, where AppleFan-109.2.3 attaches
IOI2CADT746x to adt7460 and adt7467 devices. I found no i2c writes,
only reads. I guess that Mac OS doesn't set this temperature. (It is
also possible that Mac OS does set it, but I didn't find the code;
Apple didn't publish all their code.)
The adt0 on my macppc PowerBook5,4 now shows temps around 47 to 52
degC (while I am typing this mail, and the cpu is mostly idle). I am
not running your diff. The fans are quiet. If I run your diff, which
seems to set the temperature minimum to 46 degC, then the fans might
make more noise.
To reduce wear on this old PowerBook, I run apmd(8) -L which sets the
cpu to half speed, and I use an external usb keyboard and mouse. In
the past when I set apm -H and loaded the cpu, the fans got loud.
--gkoehler
> Index: dev/i2c/adt7460.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/i2c/adt7460.c,v
> retrieving revision 1.22
> diff -u -p -r1.22 adt7460.c
> --- dev/i2c/adt7460.c 6 Apr 2022 18:59:28 -0000 1.22
> +++ dev/i2c/adt7460.c 3 Dec 2023 02:28:11 -0000
> @@ -34,6 +34,9 @@
> #define ADT7460_REM1_TEMP 0x25
> #define ADT7460_LOCAL_TEMP 0x26
> #define ADT7460_REM2_TEMP 0x27
> +#define ADT7460_REM1_TEMP_TRG 0x68
> +#define ADT7460_LOCAL_TEMP_TRG 0x67
> +#define ADT7460_REM2_TEMP_TRG 0x69
> #define ADT7460_TACH1L 0x28
> #define ADT7460_TACH1H 0x29
> #define ADT7460_TACH2L 0x2a
> @@ -196,6 +199,18 @@ adt_attach(struct device *parent, struct
> return;
> }
> }
> +
> +#ifdef __macppc__
> + for (cmd = ADT7460_LOCAL_TEMP_TRG; cmd <= ADT7460_REM2_TEMP_TRG; cmd++){
> + data = 46; /* temperature target in deg C */
> + if (iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP,
> + sc->sc_addr, &cmd, sizeof cmd, &data, sizeof data, 0)) {
> + iic_release_bus(sc->sc_tag, 0);
> + printf(": cannot set temperature target register\n");
> + return;
> + }
> + }
> +#endif
>
> iic_release_bus(sc->sc_tag, 0);
>
--
George Koehler <[email protected]>