Compare commits

48 Commits
v1.0 ... master

Author SHA1 Message Date
Guenter Roeck
40bec4b5a7 Add driver removal notice
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-07-09 08:44:27 -07:00
Burt P
109b7e0ba7 README: Add dkms instructions for #95
Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-07-08 15:23:09 -07:00
airbjorn
bfbaf881f5 auto-adjust loop threshold to changes in the array size
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-06-13 14:37:44 -07:00
airbjorn
721f5b8a1b replaced two spaces with one
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-06-12 06:41:02 -07:00
airbjorn
c9439f9d6e fixing indents in #defines: replacing spaces by tabs
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-06-12 06:40:49 -07:00
Guenter Roeck
b9a8431e5b Enable all temperature registers for IT8655E and IT8665E
Those chips always have all 6 temperature registers enabled.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-06-06 15:19:47 -07:00
Guenter Roeck
71826085db Fix temperature type for peci/amdtsi if diode/thermistor is also set
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>
2018-05-29 12:26:50 -07:00
Guenter Roeck
e4056dade6 Revert "Provide vid_from_reg and vid_which_vrm if needed"
This reverts commit 905a3a095d.

This didn't work and results in duplicate symbols.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-05-09 20:40:22 -07:00
Guenter Roeck
905a3a095d Provide vid_from_reg and vid_which_vrm if needed
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>
2018-05-08 14:26:55 -07:00
mettacrawler
3436b28078 Support Arch
Arch uses /proc/kallsyms and /proc/config.gz by default instead of /boot/System.map* and /boot/config*
2018-04-29 10:33:30 -07:00
Guenter Roeck
948ad8d145 Fix fan control for IT8736F
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>
2018-02-27 21:19:23 -08:00
Guenter Roeck
155715e7ea Add preliminary support for IT8736F and IT8738E
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-02-26 21:02:58 -08:00
Guenter Roeck
496856a115 Fix scaling for IT8732F
3.3V channels report the wrong voltages on IT8732F since the scaling bit
is not set.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-02-26 19:19:09 -08:00
Guenter Roeck
d847fc0fc1 Save and restore bank around envmon register accesses if needed
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>
2018-02-14 09:00:59 -08:00
Guenter Roeck
850c17bf06 Fix up fan / pwm detection for IT8625/IT8665
Hope it is correct this time around.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-01-19 13:31:01 -08:00
Burt P
7f59901679 Makefile: DKMS fix
Allow DKMS (or anyone) to specify TARGET in Makefile.

Signed-off-by: Burt P <pburt0@gmail.com>
2018-01-13 13:19:57 -08:00
Burt P
5edd7bb6f9 Add optional DKMS target to Makefile (v2)
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>
2018-01-06 04:19:36 -08:00
Guenter Roeck
98fa33ddad README: Fix typo
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-01-03 09:27:25 -08:00
Guenter Roeck
8293dc9f82 Revert "Add optional DKMS target to Makefile"
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>
2017-12-30 18:26:30 -08:00
Guenter Roeck
6d26a04b3b Add comment explaining why smbus_disable is needed in probe
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-03 10:28:15 -08:00
Guenter Roeck
348c4c1272 Add more known problems to ISSUES file
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-03 10:26:43 -08:00
Guenter Roeck
f88dd6bac6 Add ISSUES file
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-12-03 10:15:06 -08:00
Burt P
6c1e48b4f1 Add optional DKMS target to Makefile
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>
2017-12-03 09:53:19 -08:00
Guenter Roeck
6582b4739f Fix PECI/AMDTSI selection
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>
2017-10-07 07:38:41 -07:00
Guenter Roeck
4f8c82e23c Do not disable SMBs unless really necessary
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>
2017-10-06 16:14:31 -07:00
Guenter Roeck
f8240ebfd5 Report actual chip name, not its ID
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>
2017-10-02 17:24:29 -07:00
Guenter Roeck
e8f7cf1bdd Experimental support for IT8606E
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 11:18:33 -07:00
Guenter Roeck
1d68bab74c Makefile: Versioning, take three
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>
2017-10-02 10:53:44 -07:00
Guenter Roeck
3fde481373 Checkpatch cleanup: Line length
Try to stay below the 80-character-per-line limit.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 08:02:36 -07:00
Guenter Roeck
7bf9a9269a Checkpatch cleanup: Opening brackets
Checkpatch nowadays is allergic against '{' in continuation lines.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 08:00:03 -07:00
Guenter Roeck
071c771980 Checkpatch cleanup: Use octal file permissions
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>
2017-10-02 07:56:47 -07:00
Guenter Roeck
c693f90cea Checkpatch cleanup: Use octal permissions for module parameters
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 07:51:19 -07:00
Guenter Roeck
d9b09ed39a Checkpatch cleanup: Double semicolon, missing space
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-02 07:49:35 -07:00
Guenter Roeck
5e4d82b615 Drop version.h
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>
2017-10-01 19:15:58 -07:00
Guenter Roeck
e32b31eae2 Add support for 4th temperature sensor on IT8622
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 16:47:43 -07:00
Guenter Roeck
d198f700b9 Improve AMDTSI temp type detection, and temp 4 type detection on IT8622
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 16:39:31 -07:00
Guenter Roeck
5ddfe6a940 Add SMBus bitmap for IT8622
IT8622 supports two external SMBus channels. Add bitmask to disable them
while accessing the chip.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 15:28:24 -07:00
Guenter Roeck
68a88d99b7 Fix mmio resource request
We have to request a memory resource with IORESOURCE_MEM.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 13:40:18 -07:00
Guenter Roeck
a997a09938 IT8655E supports MMIO
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 13:05:13 -07:00
Guenter Roeck
d86efa30a3 Print MMIO address into kernel log
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 13:02:59 -07:00
Guenter Roeck
57301c6b5d Update README to describe new module parameters
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-01 12:52:34 -07:00
Guenter Roeck
851a92d074 Add MMIO support
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-30 23:50:09 -07:00
Guenter Roeck
78afa4ee1a Disable SMBus access while accessing Enviromnental Controller registers
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>
2017-09-30 09:23:47 -07:00
Guenter Roeck
4d29188e4f Fix FAN_TAC5 detection for IT8665E
FAN_TAC5 is connected if 26h[4]=0.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 08:10:16 -07:00
Guenter Roeck
32d442e05e Remove version.h when running clean, and clean does not depend on version.h
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:20:38 -07:00
Guenter Roeck
bde0232c73 Ignore version.h
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:19:12 -07:00
Guenter Roeck
247605bba6 it87: Display driver version
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:15:47 -07:00
Guenter Roeck
e7caee4aaf Makefile: Generate version.h
Update version after each change in it87.c.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-09-24 04:15:20 -07:00
5 changed files with 1032 additions and 568 deletions

24
ISSUES Normal file
View File

@@ -0,0 +1,24 @@
Support for old kernel versions
===============================
The driver is known to not build for v2.6.32 kernels. Exact errors are unknown,
though it is likely that kernel API functions are incompatible or not supported
in v2.6.32. Patches to fix the problem will be accepted as long as they are
implemented in compat.h.
Fan issues after suspend on Gigabyte GA-AX370 Gaming 5 + Ubuntu
===============================================================
Jaka Jaksic reports that after resuming from suspend to memory on Gigabyte
GA-AX370 Gaming 5, fans start spinning very fast, regardless of whether IT87
is loaded or not. Analysis shows that some chip registers have a wrong value
after resume. The working assumption is that there is a BIOS problem.
There is no known workaround.
On-board temperature display shows '00' on GA-AX370 Gaming 5
============================================================
Öyvind Saether reports that the on-board two digit alarmblock display on
Gigabyte AX370 Gaming 5 shows '00' instead of the current temperature after
"modprobe it87". No further information is available at this time.
There is no known workaround.

View File

@@ -1,7 +1,10 @@
# For building for the current running version of Linux
ifndef TARGET
TARGET := $(shell uname -r)
endif
# Or specific version
#TARGET := 2.6.33.5
KERNEL_MODULES := /lib/modules/$(TARGET)
ifneq ("","$(wildcard /usr/src/linux-headers-$(TARGET)/*)")
@@ -17,9 +20,27 @@ endif
endif
#SYSTEM_MAP := $(KERNEL_BUILD)/System.map
ifneq ("","$(wildcard /boot/System.map-$(TARGET))")
SYSTEM_MAP := /boot/System.map-$(TARGET)
else
# Arch
SYSTEM_MAP := /proc/kallsyms
endif
DRIVER := it87
ifneq ("","$(wildcard .git/*)")
DRIVER_VERSION := $(shell git describe --long)
else
ifneq ("", "$(wildcard VERSION)")
DRIVER_VERSION := $(shell cat VERSION)
else
DRIVER_VERSION := unknown
endif
endif
# DKMS
DKMS_ROOT_PATH=/usr/src/$(DRIVER)-$(DRIVER_VERSION)
MODPROBE_OUTPUT=$(shell lsmod | grep it87)
# Directory below /lib/modules/$(TARGET)/kernel into which to install
# the module:
@@ -38,13 +59,18 @@ ifneq ("","$(wildcard $(MODDESTDIR)/*.ko.xz)")
COMPRESS_XZ := y
endif
.PHONY: all install modules modules_install clean
.PHONY: all install modules modules_install clean dkms dkms_clean
all: modules
# Targets for running make directly in the external module directory:
modules clean:
IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"$(DRIVER_VERSION)\"'
modules:
@$(MAKE) EXTRA_CFLAGS="$(IT87_CFLAGS)" -C $(KERNEL_BUILD) M=$(CURDIR) $@
clean:
@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
install: modules_install
@@ -59,3 +85,24 @@ ifeq ($(COMPRESS_XZ), y)
@xz -f $(MODDESTDIR)/$(DRIVER).ko
endif
depmod -a -F $(SYSTEM_MAP) $(TARGET)
dkms:
@sed -i -e '/^PACKAGE_VERSION=/ s/=.*/=\"$(DRIVER_VERSION)\"/' dkms.conf
@echo "$(DRIVER_VERSION)" >VERSION
@mkdir $(DKMS_ROOT_PATH)
@cp `pwd`/dkms.conf $(DKMS_ROOT_PATH)
@cp `pwd`/VERSION $(DKMS_ROOT_PATH)
@cp `pwd`/Makefile $(DKMS_ROOT_PATH)
@cp `pwd`/compat.h $(DKMS_ROOT_PATH)
@cp `pwd`/it87.c $(DKMS_ROOT_PATH)
@dkms add -m $(DRIVER) -v $(DRIVER_VERSION)
@dkms build -m $(DRIVER) -v $(DRIVER_VERSION)
@dkms install --force -m $(DRIVER) -v $(DRIVER_VERSION)
@modprobe $(DRIVER)
dkms_clean:
@if [ ! -z "$(MODPROBE_OUTPUT)" ]; then \
rmmod $(DRIVER);\
fi
@dkms remove -m $(DRIVER) -v $(DRIVER_VERSION) --all
@rm -rf $(DKMS_ROOT_PATH)

57
README
View File

@@ -1,3 +1,14 @@
DRIVER REMOVAL NOTICE
=====================
I have been unable to meet support demands for this driver, resulting
in unpleasant experience and frustration for everyone involved.
Consequently, the driver will be removed from github, effective
August 1, 2018. Interested parties are encouraged to clone the driver
before that time and to start maintaining it on their own.
Kernel driver it87
==================
@@ -93,6 +104,7 @@ Supported chips:
Authors:
Christophe Gauthron
Jean Delvare <jdelvare@suse.de>
Guenter Roeck <linux@roeck-us.net>
Building & Installing
@@ -103,6 +115,31 @@ Building & Installing
* sudo make install
Using DKMS
----------
To install:
* sudo make dkms
To remove:
* sudo make dkms_clean
Notes:
* The module does not provide a real version number, so `git describe --long`
is used to create one. This means that anything that changes the git state
will change the version. `make dkms_clean` should be run before making a
commit or an update with `git pull` as the Makefile is currently unable to
track the last installed version to replace it. If this doesn't happen, the
old version will need to be manually removed from dkms, before installing
the updated module.
Something like `dkms remove -m it87 -v <old version> --all`, followed by
`rm -rf /usr/src/it87-<old version>`, should do.
`dkms status it87` can be used to list the installed versions.
Module Parameters
-----------------
@@ -122,6 +159,26 @@ Module Parameters
misconfigured by BIOS - PWM values would be inverted. This option tries
to fix this. Please contact your BIOS manufacturer and ask him for fix.
* force_id
Force chip ID to specified value. Should only be used for testing.
* ignore_resource_conflict
Similar to acpi_enforce_resources=lax, but only affects this driver.
ACPI resource conflicts are ignored if this parameter is provided and
set to 1.
Provided since there are reports that system-wide acpi_enfore_resources=lax
can result in boot failures on some systems.
Note: This is inherently risky since it means that both ACPI and this driver
may access the chip at the same time. This can result in race conditions and,
worst case, result in unexpected system reboots.
* mmio
If set to 1, the driver uses MMIO to access the chip if supported. This is
faster and less risky (untested!).
Hardware Interfaces
-------------------

7
dkms.conf Normal file
View File

@@ -0,0 +1,7 @@
MAKE="make TARGET=${kernelver}"
CLEAN="make clean"
PACKAGE_NAME="it87"
PACKAGE_VERSION="to be filled by make dkms"
BUILT_MODULE_NAME[0]="it87"
DEST_MODULE_LOCATION[0]="/kernel/drivers/hwmon/it87"
AUTOINSTALL="yes"

1461
it87.c

File diff suppressed because it is too large Load Diff