aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-02-13 23:13:20 -0500
committerGuenter Roeck <linux@roeck-us.net>2015-04-05 09:01:00 -0400
commit3ba9d977a9b8a90c586f46444448d977bdbdcc3b (patch)
tree529dd8b075d05611b6a7a304a1cf54576eaf8166 /drivers/hwmon/it87.c
parent4ee07157d690b1b824328a473816a371130de6f2 (diff)
hwmon: (it87) Add support for IT8620E
IT8620E is mostly compatible to IT7828F. Add generic support for it. IT8620E supports up to 6 fan tachometers and 6 pwm controls. Support for the 6th tachometer and for the additional pwm controls are addded in separate patches. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 80580cdf9a15..4e4db72d38e8 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -11,6 +11,7 @@
11 * similar parts. The other devices are supported by different drivers. 11 * similar parts. The other devices are supported by different drivers.
12 * 12 *
13 * Supports: IT8603E Super I/O chip w/LPC interface 13 * Supports: IT8603E Super I/O chip w/LPC interface
14 * IT8620E Super I/O chip w/LPC interface
14 * IT8623E Super I/O chip w/LPC interface 15 * IT8623E Super I/O chip w/LPC interface
15 * IT8705F Super I/O chip w/LPC interface 16 * IT8705F Super I/O chip w/LPC interface
16 * IT8712F Super I/O chip w/LPC interface 17 * IT8712F Super I/O chip w/LPC interface
@@ -69,7 +70,7 @@
69#define DRVNAME "it87" 70#define DRVNAME "it87"
70 71
71enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8771, 72enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8771,
72 it8772, it8781, it8782, it8783, it8786, it8790, it8603 }; 73 it8772, it8781, it8782, it8783, it8786, it8790, it8603, it8620 };
73 74
74static unsigned short force_id; 75static unsigned short force_id;
75module_param(force_id, ushort, 0); 76module_param(force_id, ushort, 0);
@@ -155,12 +156,14 @@ static inline void superio_exit(void)
155#define IT8786E_DEVID 0x8786 156#define IT8786E_DEVID 0x8786
156#define IT8790E_DEVID 0x8790 157#define IT8790E_DEVID 0x8790
157#define IT8603E_DEVID 0x8603 158#define IT8603E_DEVID 0x8603
159#define IT8620E_DEVID 0x8620
158#define IT8623E_DEVID 0x8623 160#define IT8623E_DEVID 0x8623
159#define IT87_ACT_REG 0x30 161#define IT87_ACT_REG 0x30
160#define IT87_BASE_REG 0x60 162#define IT87_BASE_REG 0x60
161 163
162/* Logical device 7 registers (IT8712F and later) */ 164/* Logical device 7 registers (IT8712F and later) */
163#define IT87_SIO_GPIO1_REG 0x25 165#define IT87_SIO_GPIO1_REG 0x25
166#define IT87_SIO_GPIO2_REG 0x26
164#define IT87_SIO_GPIO3_REG 0x27 167#define IT87_SIO_GPIO3_REG 0x27
165#define IT87_SIO_GPIO5_REG 0x29 168#define IT87_SIO_GPIO5_REG 0x29
166#define IT87_SIO_PINX1_REG 0x2a /* Pin selection */ 169#define IT87_SIO_PINX1_REG 0x2a /* Pin selection */
@@ -375,6 +378,14 @@ static const struct it87_devices it87_devices[] = {
375 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL, 378 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_IN7_INTERNAL,
376 .peci_mask = 0x07, 379 .peci_mask = 0x07,
377 }, 380 },
381 [it8620] = {
382 .name = "it8620",
383 .suffix = "E",
384 .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS
385 | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_FIVE_FANS
386 | FEAT_IN7_INTERNAL,
387 .peci_mask = 0x07,
388 },
378}; 389};
379 390
380#define has_16bit_fans(data) ((data)->features & FEAT_16BIT_FANS) 391#define has_16bit_fans(data) ((data)->features & FEAT_16BIT_FANS)
@@ -1850,6 +1861,9 @@ static int __init it87_find(unsigned short *address,
1850 case IT8623E_DEVID: 1861 case IT8623E_DEVID:
1851 sio_data->type = it8603; 1862 sio_data->type = it8603;
1852 break; 1863 break;
1864 case IT8620E_DEVID:
1865 sio_data->type = it8620;
1866 break;
1853 case 0xffff: /* No device at all */ 1867 case 0xffff: /* No device at all */
1854 goto exit; 1868 goto exit;
1855 default: 1869 default:
@@ -1985,6 +1999,33 @@ static int __init it87_find(unsigned short *address,
1985 sio_data->internal |= (1 << 3); /* in9 is AVCC */ 1999 sio_data->internal |= (1 << 3); /* in9 is AVCC */
1986 2000
1987 sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f; 2001 sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f;
2002 } else if (sio_data->type == it8620) {
2003 int reg;
2004
2005 superio_select(GPIO);
2006
2007 /* Check for fan4, fan5 */
2008 reg = superio_inb(IT87_SIO_GPIO2_REG);
2009 if (!(reg & (1 << 5)))
2010 sio_data->skip_fan |= (1 << 3);
2011 if (!(reg & (1 << 4)))
2012 sio_data->skip_fan |= (1 << 4);
2013
2014 /* Check for pwm3, fan3 */
2015 reg = superio_inb(IT87_SIO_GPIO3_REG);
2016 if (reg & (1 << 6))
2017 sio_data->skip_pwm |= (1 << 2);
2018 if (reg & (1 << 7))
2019 sio_data->skip_fan |= (1 << 2);
2020
2021 /* Check for pwm2, fan2 */
2022 reg = superio_inb(IT87_SIO_GPIO5_REG);
2023 if (reg & (1 << 1))
2024 sio_data->skip_pwm |= (1 << 1);
2025 if (reg & (1 << 2))
2026 sio_data->skip_fan |= (1 << 1);
2027
2028 sio_data->beep_pin = superio_inb(IT87_SIO_BEEP_PIN_REG) & 0x3f;
1988 } else { 2029 } else {
1989 int reg; 2030 int reg;
1990 bool uart6; 2031 bool uart6;