# i2c, lm_sensor and fanspeed problems

## edbch

Hello to all,

My primary objective was to control my laptop fanspeed, because it has remained at an uncomfortable temperature. During my research I discovered that the i2cdetect was not finding anything, as follows:

```
gentoo ~ # i2cdetect -l

gentoo ~ #
```

Lsmod indicates that the correct module is being loaded, as follows:

```
gentoo ~ # lsmod | grep -i i2c

i2c_i801                8656  0 

i2c_core               18840  3 drm,i2c_i801,videodev

gentoo ~ # 
```

I believe that is the correct module, because lspci says:

```
gentoo ~ # lspci | grep -i "pci bridge"

00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port (rev 03)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)

00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)

gentoo ~ # 
```

and this page 

http://www.lm-sensors.org/wiki/Devices

says that the correct module is really i2c-i801.

It seems strange that, although loaded automatically, lsmod indicates that 0 devices are being associated with the  i2c-801 module.

I'm using:

```
gentoo ~ # uname -r

2.6.31-gentoo-r10

gentoo ~ # qlist -I -v lm_sensors 

sys-apps/lm_sensors-3.1.2

gentoo ~ # 

```

If more information is needed, please do not hesitate to ask. I did not put more information to not pollute the first post.

I do not have a clear idea of how to proceed.

Any help would be welcome.

----------

## Rexilion

Well, can you post the output of:

```
lspci -v
```

please?

----------

## edbch

Ok, sorry the delay at respond. 

```
gentoo ~ # lspci -v

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, fast devsel, latency 0

   Capabilities: [e0] Vendor Specific Information <?>

00:01.0 PCI bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express PCI Express Root Port (rev 03) (prog-if 00 [Normal decode])

   Flags: bus master, fast devsel, latency 0

   Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

   I/O behind bridge: 00002000-00002fff

   Memory behind bridge: c8100000-c81fffff

   Prefetchable memory behind bridge: 00000000d0000000-00000000d7ffffff

   Capabilities: [88] Subsystem: Acer Incorporated [ALI] Device 0094

   Capabilities: [80] Power Management version 2

   Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-

   Capabilities: [a0] Express Root Port (Slot+), MSI 00

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [140] Root Complex Link <?>

   Kernel driver in use: pcieport-driver

   Kernel modules: shpchp

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, fast devsel, latency 0, IRQ 22

   Memory at c8000000 (64-bit, non-prefetchable) [size=16K]

   Capabilities: [50] Power Management version 2

   Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit+

   Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [130] Root Complex Link <?>

   Kernel driver in use: HDA Intel

   Kernel modules: snd-hda-intel

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02) (prog-if 00 [Normal decode])

   Flags: bus master, fast devsel, latency 0

   Bus: primary=00, secondary=02, subordinate=02, sec-latency=0

   Capabilities: [40] Express Root Port (Slot+), MSI 00

   Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-

   Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0094

   Capabilities: [a0] Power Management version 2

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [180] Root Complex Link <?>

   Kernel driver in use: pcieport-driver

   Kernel modules: shpchp

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02) (prog-if 00 [Normal decode])

   Flags: bus master, fast devsel, latency 0

   Bus: primary=00, secondary=03, subordinate=03, sec-latency=0

   Memory behind bridge: 84000000-840fffff

   Capabilities: [40] Express Root Port (Slot+), MSI 00

   Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-

   Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0094

   Capabilities: [a0] Power Management version 2

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [180] Root Complex Link <?>

   Kernel driver in use: pcieport-driver

   Kernel modules: shpchp

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02) (prog-if 00 [Normal decode])

   Flags: bus master, fast devsel, latency 0

   Bus: primary=00, secondary=04, subordinate=04, sec-latency=0

   Memory behind bridge: 84100000-841fffff

   Capabilities: [40] Express Root Port (Slot+), MSI 00

   Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-

   Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0094

   Capabilities: [a0] Power Management version 2

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [180] Root Complex Link <?>

   Kernel driver in use: pcieport-driver

   Kernel modules: shpchp

00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02) (prog-if 00 [Normal decode])

   Flags: bus master, fast devsel, latency 0

   Bus: primary=00, secondary=05, subordinate=07, sec-latency=0

   Capabilities: [40] Express Root Port (Slot+), MSI 00

   Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-

   Capabilities: [90] Subsystem: Acer Incorporated [ALI] Device 0094

   Capabilities: [a0] Power Management version 2

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [180] Root Complex Link <?>

   Kernel driver in use: pcieport-driver

   Kernel modules: shpchp

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02) (prog-if 00 [UHCI])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 0, IRQ 23

   I/O ports at 1800 [size=32]

   Kernel driver in use: uhci_hcd

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02) (prog-if 00 [UHCI])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 0, IRQ 19

   I/O ports at 1820 [size=32]

   Kernel driver in use: uhci_hcd

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02) (prog-if 00 [UHCI])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 0, IRQ 18

   I/O ports at 1840 [size=32]

   Kernel driver in use: uhci_hcd

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02) (prog-if 00 [UHCI])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 0, IRQ 16

   I/O ports at 1860 [size=32]

   Kernel driver in use: uhci_hcd

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 0, IRQ 23

   Memory at c8004000 (32-bit, non-prefetchable) [size=1K]

   Capabilities: [50] Power Management version 2

   Capabilities: [58] Debug port: BAR=1 offset=00a0

   Kernel driver in use: ehci_hcd

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2) (prog-if 01 [Subtractive decode])

   Flags: bus master, fast devsel, latency 0

   Bus: primary=00, secondary=0a, subordinate=0e, sec-latency=56

   I/O behind bridge: 00003000-00003fff

   Memory behind bridge: c8400000-c84fffff

   Prefetchable memory behind bridge: 0000000080000000-0000000083ffffff

   Capabilities: [50] Subsystem: Acer Incorporated [ALI] Device 0094

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 0

   Capabilities: [e0] Vendor Specific Information <?>

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02) (prog-if 80 [Master])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 19

   I/O ports at 01f0 [size=8]

   I/O ports at 03f4 [size=1]

   I/O ports at 0170 [size=8]

   I/O ports at 0374 [size=1]

   I/O ports at 18b0 [size=16]

   Capabilities: [70] Power Management version 2

   Kernel driver in use: ata_piix

   Kernel modules: ata_piix

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: medium devsel, IRQ 19

   I/O ports at 18c0 [size=32]

   Kernel modules: i2c-i801

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X1400 (prog-if 00 [VGA controller])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, fast devsel, latency 0, IRQ 16

   Memory at d0000000 (32-bit, prefetchable) [size=128M]

   I/O ports at 2000 [size=256]

   Memory at c8100000 (32-bit, non-prefetchable) [size=64K]

   [virtual] Expansion ROM at c8120000 [disabled] [size=128K]

   Capabilities: [50] Power Management version 2

   Capabilities: [58] Express Legacy Endpoint, MSI 00

   Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+

03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)

   Subsystem: Intel Corporation PRO/Wireless 3945ABG Network Connection

   Flags: bus master, fast devsel, latency 0, IRQ 29

   Memory at 84000000 (32-bit, non-prefetchable) [size=4K]

   Capabilities: [c8] Power Management version 2

   Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+

   Capabilities: [e0] Express Legacy Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [140] Device Serial Number 

   Kernel driver in use: iwl3945

   Kernel modules: iwl3945

04:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5789 Gigabit Ethernet PCI Express (rev 21)

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, fast devsel, latency 0, IRQ 30

   Memory at 84100000 (64-bit, non-prefetchable) [size=64K]

   Capabilities: [48] Power Management version 2

   Capabilities: [50] Vital Product Data

   Capabilities: [58] MSI: Enable+ Count=1/8 Maskable- 64bit+

   Capabilities: [d0] Express Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [13c] Virtual Channel <?>

   Capabilities: [160] Device Serial Number 

   Capabilities: [16c] Power Budgeting <?>

   Kernel driver in use: tg3

0a:09.0 CardBus bridge: Texas Instruments PCIxx12 Cardbus Controller

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 168, IRQ 20

   Memory at c8404000 (32-bit, non-prefetchable) [size=4K]

   Bus: primary=0a, secondary=0b, subordinate=0e, sec-latency=176

   Memory window 0: 80000000-83fff000 (prefetchable)

   Memory window 1: 88000000-8bfff000

   I/O window 0: 00003000-000030ff

   I/O window 1: 00003400-000034ff

   16-bit legacy interface ports at 0001

   Kernel driver in use: yenta_cardbus

0a:09.1 FireWire (IEEE 1394): Texas Instruments PCIxx12 OHCI Compliant IEEE 1394 Host Controller (prog-if 10 [OHCI])

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 32, IRQ 10

   Memory at c8405000 (32-bit, non-prefetchable) [size=2K]

   Memory at c8400000 (32-bit, non-prefetchable) [size=16K]

   Capabilities: [44] Power Management version 2

0a:09.2 Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)

   Subsystem: Acer Incorporated [ALI] Device 0094

   Flags: bus master, medium devsel, latency 57, IRQ 20

   Memory at c8406000 (32-bit, non-prefetchable) [size=4K]

   Capabilities: [44] Power Management version 2

   Kernel driver in use: tifm_7xx1

   Kernel modules: tifm_7xx1

gentoo ~ # 

```

----------

## Ant P.

Is there anything in /sys/class/hwmon? Sometimes you don't need i2c at all.

----------

## edbch

```
gentoo ~ # ls /sys/class/hwmon

hwmon0  hwmon1  hwmon2

gentoo ~ #
```

These are all reporting the temperature of the system, which is exactly what I see through:

```
gentoo ~ # sensors

acpitz-virtual-0

Adapter: Virtual device

temp1:       +60.0°C  (crit = +97.0°C)                  

coretemp-isa-0000

Adapter: ISA adapter

Core 0:      +57.0°C  (crit = +100.0°C)                  

coretemp-isa-0001

Adapter: ISA adapter

Core 1:      +56.0°C  (crit = +100.0°C)                  

gentoo ~ #
```

 *Quote:*   

> Sometimes you don't need i2c at all.

 

Hmm .. this is interesting. It seems I have two problems:

1) understand what is happening with the i2c;

2) if I do not need the i2c, how can I access the fansspeeds (and control then).

For me, the most urgent is controlling the fanspeeds. But if we can solve everything ...

----------

## poly_poly-man

modprobe i2c-dev for the i2c fix

look into lm_sensors for your fan speed control.

----------

## edbch

```
gentoo ~ # modprobe i2c-dev

gentoo ~ # lsmod | grep i2c

i2c_dev                 5856  0 

i2c_i801                8656  0 

i2c_core               18840  4 i2c_dev,drm,videodev,i2c_i801

gentoo ~ # sensors-detect

     .

     .

     .

You should now start the lm_sensors service to load the required

kernel modules.

gentoo ~ # /etc/init.d/lm_sensors restart

 * Caching service dependencies ...                                                                                                                                                                      [ ok ]

 * Loading lm_sensors modules...

 *   Loading coretemp ...                                                                                                                                                                                [ ok ]

gentoo ~ # sensors

acpitz-virtual-0

Adapter: Virtual device

temp1:       +57.0°C  (crit = +97.0°C)                  

coretemp-isa-0000

Adapter: ISA adapter

Core 0:      +53.0°C  (crit = +100.0°C)                  

coretemp-isa-0001

Adapter: ISA adapter

Core 1:      +53.0°C  (crit = +100.0°C)                  

gentoo ~ # 
```

seems to load i2c-dev did not work. i2c-dev seems to be in use by any device, as i2c_i801.

----------

## edbch

bump

----------

## Cyker

You need to know what chip you have on the system that controls the fans.

I doubt it would be the Intel chipset; It is more likely some winbond or ITxyz chip.

The AMD driver for my mobo gives me temps but the IT87 chip, which also gives temps, is what gives me fan speed and control, along with voltages. (Incidentally, it also doesn't use I2C but the ISA bus!!  :Smile: )

As yours is a laptop, there is a possibility the fan control is not hackable in software; Some laptops use thermal sensing fans which use a thermal diode or some such to directly control fan speed.

That said, modern laptops tend to have ACPI controls for a lot of this stuff so there's another possibility there. (Finding an ACPI driver is another problem! lm_sensors ACPI drivers are very immature; The ACPI driver for mine doesn't even support fancontrol so I have to use the old IT87 driver despite everyone and the kernel giving dire warnings that this is bad and will cause rabid badgers to set my server on fire)

What laptop is it anyway? Maybe we can figure out the right chip from the model?

Or you can build all the lm_sensors drivers as modules and run sensors-detect to see what it picks up (Obviously if the driver isn't built, sensors-detect can't test for it!)

----------

## edbch

Hello,

 *Quote:*   

> You need to know what chip you have on the system that controls the fans.
> 
> I doubt it would be the Intel chipset; It is more likely some winbond or ITxyz chip.

 

Can you tell me where I can get this information?After starting this topic, continuing with my reading, I found texts that point in this direction, but much information I got was that this would be provided by lm_sensors.

 *Quote:*   

> What laptop is it anyway? Maybe we can figure out the right chip from the model?

 

Acer Aspire 5670.

 *Quote:*   

> Or you can build all the lm_sensors drivers as modules and run sensors-detect to see what it picks up (Obviously if the driver isn't built, sensors-detect can't test for it!)

 

I did this in a desperate attempt before starting this post. Actually I enabled not only the modules, but some options of buses that seemed to have anything to do with the problem. Obviously not getting results with it, and now my kernel, that was decent, now is a monster. Do not bother me since that would solve the problem.

Years ago, when I acquire this laptop, the first distro I installed was Ubuntu, and I remember that I coud see the tensions and fanspeed with lm_sensors. Soon I was unhappy with Ubuntu, and put my old friend Gentoo, but I remember this  has not worked right at the time. Only now decided to investigate it properly.

----------

## Cyker

If you did load all the drivers in and lm_sensors still couldn't find anything, you might be out of luck  :Sad: 

I don't suppose you still have that Ubuntu lying around? If you can boot off it, that'd be the easiest way to find out what sensor module you need to get the fan controls working...

----------

