aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--Documentation/hwmon/it8713
-rw-r--r--drivers/hwmon/Kconfig2
-rw-r--r--drivers/hwmon/it87.c43
3 files changed, 53 insertions, 5 deletions
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index 91e8f011dacf..e87294878334 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -6,6 +6,10 @@ Supported chips:
6 Prefix: 'it8603' 6 Prefix: 'it8603'
7 Addresses scanned: from Super I/O config space (8 I/O ports) 7 Addresses scanned: from Super I/O config space (8 I/O ports)
8 Datasheet: Not publicly available 8 Datasheet: Not publicly available
9 * IT8620E
10 Prefix: 'it8620'
11 Addresses scanned: from Super I/O config space (8 I/O ports)
12 Datasheet: Not publicly available
9 * IT8705F 13 * IT8705F
10 Prefix: 'it87' 14 Prefix: 'it87'
11 Addresses scanned: from Super I/O config space (8 I/O ports) 15 Addresses scanned: from Super I/O config space (8 I/O ports)
@@ -106,7 +110,7 @@ motherboard models.
106Description 110Description
107----------- 111-----------
108 112
109This driver implements support for the IT8603E, IT8623E, IT8705F, 113This driver implements support for the IT8603E, IT8620E, IT8623E, IT8705F,
110IT8712F, IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E, 114IT8712F, IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E,
111IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F, IT8786E, IT8790E, and SiS950 115IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F, IT8786E, IT8790E, and SiS950
112chips. 116chips.
@@ -147,8 +151,11 @@ The IT8728F, IT8771E, and IT8772E are considered compatible with the IT8721F,
147until a datasheet becomes available (hopefully.) 151until a datasheet becomes available (hopefully.)
148 152
149The IT8603E/IT8623E is a custom design, hardware monitoring part is similar to 153The IT8603E/IT8623E is a custom design, hardware monitoring part is similar to
150IT8728F. It only supports 16-bit fan mode, the full speed mode of the 154IT8728F. It only supports 3 fans, 16-bit fan mode, and the full speed mode
151fan is not supported (value 0 of pwmX_enable). 155of the fan is not supported (value 0 of pwmX_enable).
156
157The IT8620E is another custom design, hardware monitoring part is similar to
158IT8728F. It only supports 16-bit fan mode.
152 159
153The IT8790E supports up to 3 fans. 16-bit fan mode is always enabled. 160The IT8790E supports up to 3 fans. 16-bit fan mode is always enabled.
154 161
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 848ddfe30ef8..25d9e72627e9 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -601,7 +601,7 @@ config SENSORS_IT87
601 If you say yes here you get support for ITE IT8705F, IT8712F, 601 If you say yes here you get support for ITE IT8705F, IT8712F,
602 IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E, 602 IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E,
603 IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F, IT8786E, IT8790E, 603 IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F, IT8786E, IT8790E,
604 IT8603E, and IT8623E sensor chips, and the SiS950 clone. 604 IT8603E, IT8620E, and IT8623E sensor chips, and the SiS950 clone.
605 605
606 This driver can also be built as a module. If so, the module 606 This driver can also be built as a module. If so, the module
607 will be called it87. 607 will be called it87.
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;