Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (it87) Add support for IT8781F

IT8781F is mostly compatible to IT8782F. Major difference is that it only
supports four instead of six UART channels, and therefore does not share
the uart6 pins.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

+39 -19
+13 -9
Documentation/hwmon/it87
··· 42 42 Prefix: 'it8772' 43 43 Addresses scanned: from Super I/O config space (8 I/O ports) 44 44 Datasheet: Not publicly available 45 + * IT8781F 46 + Prefix: 'it8781' 47 + Addresses scanned: from Super I/O config space (8 I/O ports) 48 + Datasheet: Not publicly available 45 49 * IT8782F 46 50 Prefix: 'it8782' 47 51 Addresses scanned: from Super I/O config space (8 I/O ports) ··· 100 96 101 97 This driver implements support for the IT8603E, IT8623E, IT8705F, IT8712F, 102 98 IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E, IT8771E, 103 - IT8772E, IT8782F, IT8783E/F, and SiS950 chips. 99 + IT8772E, IT8781F, IT8782F, IT8783E/F, and SiS950 chips. 104 100 105 101 These chips are 'Super I/O chips', supporting floppy disks, infrared ports, 106 102 joysticks and other miscellaneous stuff. For hardware monitoring, they ··· 124 120 have support for 2 additional fans. The additional fans are supported by the 125 121 driver. 126 122 127 - The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E, IT8782F, IT8783E/F, and late 128 - IT8712F and IT8705F also have optional 16-bit tachometer counters for fans 1 to 129 - 3. This is better (no more fan clock divider mess) but not compatible with the 130 - older chips and revisions. The 16-bit tachometer mode is enabled by the driver 131 - when one of the above chips is detected. 123 + The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E, IT8781F, IT8782F, IT8783E/F, 124 + and late IT8712F and IT8705F also have optional 16-bit tachometer counters 125 + for fans 1 to 3. This is better (no more fan clock divider mess) but not 126 + compatible with the older chips and revisions. The 16-bit tachometer mode 127 + is enabled by the driver when one of the above chips is detected. 132 128 133 129 The IT8726F is just bit enhanced IT8716F with additional hardware 134 130 for AMD power sequencing. Therefore the chip will appear as IT8716F ··· 160 156 0.016 volt (except IT8603E, IT8721F/IT8758E and IT8728F: 0.012 volt.) The 161 157 battery voltage in8 does not have limit registers. 162 158 163 - On the IT8603E, IT8721F/IT8758E, IT8782F, and IT8783E/F, some voltage inputs 164 - are internal and scaled inside the chip: 159 + On the IT8603E, IT8721F/IT8758E, IT8781F, IT8782F, and IT8783E/F, some 160 + voltage inputs are internal and scaled inside the chip: 165 161 * in3 (optional) 166 - * in7 (optional for IT8782F and IT8783E/F) 162 + * in7 (optional for IT8781F, IT8782F, and IT8783E/F) 167 163 * in8 (always) 168 164 * in9 (relevant for IT8603E only) 169 165 The driver handles this transparently so user-space doesn't have to care.
+2 -2
drivers/hwmon/Kconfig
··· 599 599 help 600 600 If you say yes here you get support for ITE IT8705F, IT8712F, 601 601 IT8716F, IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E, 602 - IT8771E, IT8772E, IT8782F, IT8783E/F and IT8603E sensor chips, 603 - and the SiS950 clone. 602 + IT8771E, IT8772E, IT8781F, IT8782F, IT8783E/F and IT8603E 603 + sensor chips, and the SiS950 clone. 604 604 605 605 This driver can also be built as a module. If so, the module 606 606 will be called it87.
+24 -8
drivers/hwmon/it87.c
··· 23 23 * IT8758E Super I/O chip w/LPC interface 24 24 * IT8771E Super I/O chip w/LPC interface 25 25 * IT8772E Super I/O chip w/LPC interface 26 + * IT8781F Super I/O chip w/LPC interface 26 27 * IT8782F Super I/O chip w/LPC interface 27 28 * IT8783E/F Super I/O chip w/LPC interface 28 29 * Sis950 A clone of the IT8705F ··· 67 66 #define DRVNAME "it87" 68 67 69 68 enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8771, 70 - it8772, it8782, it8783, it8603 }; 69 + it8772, it8781, it8782, it8783, it8603 }; 71 70 72 71 static unsigned short force_id; 73 72 module_param(force_id, ushort, 0); ··· 147 146 #define IT8728F_DEVID 0x8728 148 147 #define IT8771E_DEVID 0x8771 149 148 #define IT8772E_DEVID 0x8772 149 + #define IT8781F_DEVID 0x8781 150 150 #define IT8782F_DEVID 0x8782 151 151 #define IT8783E_DEVID 0x8783 152 152 #define IT8603E_DEVID 0x8603 ··· 308 306 /* 12mV ADC (HWSensors4, OHM) */ 309 307 /* 16 bit fans (HWSensors4, OHM) */ 310 308 .peci_mask = 0x07, 309 + }, 310 + [it8781] = { 311 + .name = "it8781", 312 + .features = FEAT_16BIT_FANS | FEAT_TEMP_OFFSET 313 + | FEAT_TEMP_OLD_PECI, 314 + .old_peci_mask = 0x4, 311 315 }, 312 316 [it8782] = { 313 317 .name = "it8782", ··· 1769 1761 case IT8772E_DEVID: 1770 1762 sio_data->type = it8772; 1771 1763 break; 1764 + case IT8781F_DEVID: 1765 + sio_data->type = it8781; 1766 + break; 1772 1767 case IT8782F_DEVID: 1773 1768 sio_data->type = it8782; 1774 1769 break; ··· 1930 1919 reg = superio_inb(IT87_SIO_GPIO3_REG); 1931 1920 if (sio_data->type == it8721 || sio_data->type == it8728 || 1932 1921 sio_data->type == it8771 || sio_data->type == it8772 || 1933 - sio_data->type == it8782) { 1922 + sio_data->type == it8781 || sio_data->type == it8782) { 1934 1923 /* 1935 - * IT8721F/IT8758E, and IT8782F don't have VID pins 1936 - * at all, not sure about the IT8728F and compatibles. 1924 + * IT8721F/IT8758E, IT8728F, IT8772F, IT8781F, and 1925 + * IT8782F don't have VID pins at all, not sure about 1926 + * the IT8771F. 1937 1927 */ 1938 1928 sio_data->skip_vid = 1; 1939 1929 } else { ··· 2159 2147 data->in_scaled |= (1 << 8); /* in8 is Vbat */ 2160 2148 if (sio_data->internal & (1 << 3)) 2161 2149 data->in_scaled |= (1 << 9); /* in9 is AVCC */ 2162 - } else if (sio_data->type == it8782 || sio_data->type == it8783) { 2150 + } else if (sio_data->type == it8781 || sio_data->type == it8782 || 2151 + sio_data->type == it8783) { 2163 2152 if (sio_data->internal & (1 << 0)) 2164 2153 data->in_scaled |= (1 << 3); /* in3 is VCC5V */ 2165 2154 if (sio_data->internal & (1 << 1)) ··· 2473 2460 it87_write_value(data, IT87_REG_FAN_16BIT, 2474 2461 tmp | 0x07); 2475 2462 } 2476 - /* IT8705F, IT8782F, and IT8783E/F only support three fans. */ 2477 - if (data->type != it87 && data->type != it8782 && 2478 - data->type != it8783) { 2463 + /* 2464 + * IT8705F, IT8781F, IT8782F, and IT8783E/F only support 2465 + * three fans. 2466 + */ 2467 + if (data->type != it87 && data->type != it8781 && 2468 + data->type != it8782 && data->type != it8783) { 2479 2469 if (tmp & (1 << 4)) 2480 2470 data->has_fan |= (1 << 3); /* fan4 enabled */ 2481 2471 if (tmp & (1 << 5))