PECI / AMDTSI has higher priority than thermal diode/thermistor settings.
Always report PECI/AMDTSI if it is enabled on a given port.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Some oddball distributions do not have CONFIG_HWMON_VID enabled.
Work around the problem by providing dummy functions if this is the case.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
The 4th fan control does not have a separate set of registers,
so don't bother with it. PWM control is the old fashined method,
not the new one.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
If an external EC accesses the chip through SMBus registers
and if the chip's environmental registers are paged, it is likely
that the EC modifies the page register. If so, it likely will not
update the page on each access but assume that it "owns" the chip.
If the driver then modifies the page register, subsequent accesses
from the EC will likely have unpredictable results.
To avoid that problem, let's save the page register value after
disabling SMBus accesses and restore the original value when done.
This is only necessary if accesses are not handled through MMIO
since we don't touch the page register in that case.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Using DKMS, the driver will be automatically rebuilt when
the kernel is updated.
* `make dkms` to install via DKMS
* `make dkms_clean` to remove from DKMS
Signed-off-by: Burt P <pburt0@gmail.com>
This reverts commit 6c1e48b4f1.
See comments:
"This is indeed not working, at least on Fedora. I tried specifying
MAKE and CLEAN but the outcome is the same (which makes sense, since
the defaults should already cover this)."
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Using DKMS, the driver will be automatically rebuilt when
the kernel is updated.
* `make dkms` to install via DKMS
* `make dkms_clean` to remove from DKMS
Signed-off-by: Burt P <pburt0@gmail.com>
We can not use register 0x98 since it is typically not programmed
on systems selecting PECI. Try register 0x0a (Interface Selection)
which should be a better fit anyway.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Only disable SMBus if we are going to read/write data.
Disabling it on each attribute read can result in system
instabilities.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
For some recent chips (at least IT8792E/IT8795E), the value of the chip ID
register does not match the chip name. Display the textual, not the value
of the ID register, in the kernel log.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Make sure the build passes if the source is not in a git repository.
Again, that means that version information won't be available, but there
is only so much we can do about that.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Symbolic file permissions ran out of favor and result in a checkpatch
warning. Use octal permissions instead.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Some distributions use their own Makefile and thus won't create version.h,
resulting in a build failure. Pass the version as define instead.
That won't help for generating the driver version with those distributions,
but at least the driver will build.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Some chips support Environmental Controller access through SMBus.
On those chips, it is possible that an Embedded Controller accesses
Environmental Controller chip registers at any time. There is no real
means for synchronization. On banked chips, this can and will result in
access errors with unpredictable result.
Disable SMBus access while reading or writing environmental controller
registers to work around the problem.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Temperature sensor types won't change, so we only need to read it once.
Also fix temperature register calculation.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
There is some indication that other entities (BIOS ? EC ?) may access
the chip asynchronously. Restore the bank selection after read/write
operations to limit any potenial impact.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>