Commit 409c0b5bdf7d80e61380ce6b226b98405576d7cc

Authored by Jean Delvare
Committed by Jean Delvare
1 parent f496b2d4f1

hwmon: (lm63) LM64 has a dedicated pin for tachometer

On the LM64, the tachometer function has a dedicated pin and fan speed
monitoring is always enabled.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>

Showing 2 changed files with 11 additions and 4 deletions Side-by-side Diff

Documentation/hwmon/lm63
... ... @@ -54,7 +54,10 @@
54 54 Note that the pin used for fan monitoring is shared with an alert out
55 55 function. Depending on how the board designer wanted to use the chip, fan
56 56 speed monitoring will or will not be possible. The proper chip configuration
57   -is left to the BIOS, and the driver will blindly trust it.
  57 +is left to the BIOS, and the driver will blindly trust it. Only the original
  58 +LM63 suffers from this limitation, the LM64 and LM96163 have separate pins
  59 +for fan monitoring and alert out. On the LM64, monitoring is always enabled;
  60 +on the LM96163 it can be disabled.
58 61  
59 62 A PWM output can be used to control the speed of the fan. The LM63 has two
60 63 PWM modes: manual and automatic. Automatic mode is not fully implemented yet
drivers/hwmon/lm63.c
... ... @@ -796,6 +796,9 @@
796 796 i2c_smbus_write_byte_data(client, LM63_REG_CONFIG1,
797 797 data->config);
798 798 }
  799 + /* Tachometer is always enabled on LM64 */
  800 + if (data->kind == lm64)
  801 + data->config |= 0x04;
799 802  
800 803 /* We may need pwm1_freq before ever updating the client data */
801 804 data->pwm1_freq = i2c_smbus_read_byte_data(client, LM63_REG_PWM_FREQ);
... ... @@ -836,9 +839,10 @@
836 839 }
837 840  
838 841 /* Show some debug info about the LM63 configuration */
839   - dev_dbg(&client->dev, "Alert/tach pin configured for %s\n",
840   - (data->config & 0x04) ? "tachometer input" :
841   - "alert output");
  842 + if (data->kind == lm63)
  843 + dev_dbg(&client->dev, "Alert/tach pin configured for %s\n",
  844 + (data->config & 0x04) ? "tachometer input" :
  845 + "alert output");
842 846 dev_dbg(&client->dev, "PWM clock %s kHz, output frequency %u Hz\n",
843 847 (data->config_fan & 0x08) ? "1.4" : "360",
844 848 ((data->config_fan & 0x08) ? 700 : 180000) / data->pwm1_freq);