hwmon: (it87) Add support for IT8782F and IT8783E/F
Subsystems (3)
Guenter Roeck
maintainerPATCH v2 1/3 hwmon: (it87) Add support for IT8782F and IT8783E/F
--- Documentation/hwmon/it87 | 28 +++++++--- drivers/hwmon/it87.c | 124 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 117 insertions(+), 35 deletions(-)
Documentation/hwmon/it87 +19 -9
@@ -30,6 +30,14 @@ Supported chips: Prefix: 'it8728' Addresses scanned: from Super I/O config space (8 I/O ports) Datasheet: Not publicly available + * IT8782F + Prefix: 'it8782' + Addresses scanned: from Super I/O config space (8 I/O ports) + Datasheet: Not publicly available + * IT8783E/F + Prefix: 'it8783' + Addresses scanned: from Super I/O config space (8 I/O ports) + Datasheet: Not publicly available * SiS950 [clone of IT8705F] Prefix: 'it87' Addresses scanned: from Super I/O config space (8 I/O ports)
@@ -75,7 +83,8 @@ Description ----------- This driver implements support for the IT8705F, IT8712F, IT8716F, -IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E and SiS950 chips. +IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E, IT8781F, IT8782F, +IT8783E/F, and SiS950 chips. These chips are 'Super I/O chips', supporting floppy disks, infrared ports, joysticks and other miscellaneous stuff. For hardware monitoring, they
@@ -99,11 +108,11 @@ The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E and later IT8712F revisions have support for 2 additional fans. The additional fans are supported by the driver. -The IT8716F, IT8718F, IT8720F and IT8721F/IT8758E, and late IT8712F and -IT8705F also have optional 16-bit tachometer counters for fans 1 to 3. This -is better (no more fan clock divider mess) but not compatible with the older -chips and revisions. The 16-bit tachometer mode is enabled by the driver when -one of the above chips is detected. +The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E, IT8782F, IT8783E/F, and late +IT8712F and IT8705F also have optional 16-bit tachometer counters for fans 1 to +3. This is better (no more fan clock divider mess) but not compatible with the +older chips and revisions. The 16-bit tachometer mode is enabled by the driver +when one of the above chips is detected. The IT8726F is just bit enhanced IT8716F with additional hardware for AMD power sequencing. Therefore the chip will appear as IT8716F
@@ -131,9 +140,10 @@ inputs can measure voltages between 0 and 4.08 volts, with a resolution of 0.016 volt (except IT8721F/IT8758E and IT8728F: 0.012 volt.) The battery voltage in8 does not have limit registers. -On the IT8721F/IT8758E, some voltage inputs are internal and scaled inside -the chip (in7, in8 and optionally in3). The driver handles this transparently -so user-space doesn't have to care. +On the IT8721F/IT8758E, IT8782F, and IT8783E/F, some voltage inputs are +internal and scaled inside the chip (in7 (optional for IT8782F and IT8783E/F), +in8 and optionally in3). The driver handles this transparently so user-space +doesn't have to care. The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value: the voltage level your processor should work with. This is hardcoded by
drivers/hwmon/it87.c +98 -26
212 lines not on this page · raw message
Signature · 7 lines
1.7.5.4 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
drivers/hwmon/it87.c static int __init it87_find(unsigned short *address, · line 1757
Quoted 8 lines · Guenter Roeck
drivers/hwmon/it87.c +3
-3reg =superio_inb (IT87_SIO_GPIO3_REG ); -if (sio_data->type = it8721 || sio_data->type = it8728) { +if (sio_data->type = it8721 || sio_data->type = it8728 || + sio_data->type = it8782) {/* -* The IT8721F/IT8758E doesn't have VID pins at all, -* not sure about the IT8728F. +* IT8721F, IT8758E, and IT8782F don't have VID pins
"IT8721F/IT8758E" is written this way on purpose throughout the whole driver and documentation, because they are "the same chip" (same device ID.)
Quoted 5 lines
drivers/hwmon/it87.c +1
-0+* at all, not sure about the IT8728F. */ sio_data->skip_vid =1 ; }else {
drivers/hwmon/it87.c static int __init it87_find(unsigned short *address, · line 1801
Quoted 10 lines
drivers/hwmon/it87.c +5
-1@@ -1733,8 +1793,12 @@ static int __init it87_find(unsigned short *address,* configured, even though the IT8720F datasheet claims * that the internal routing of VCCH to VIN7 is the default * setting. So we force the internal routing in this case. +* +* On IT8782F, VIN7 is multiplexed with one of the UART6 pins. +* If UART6 is enabled, re-route VIN7 to the internal divider. */ -if (sio_data->type = it8720 && !(reg & (1 <<1 ))) { +if ((sio_data->type = it8720 && !(reg & (1 <<1 ))) || + (sio_data->type = it8782 && (reg & (1 <<2 )))) {
I'd like to see this done a little differently. Here you'll output the notice message even if VIN7 was already properly routed. That's not fair. I'd prefer:
if ((sio_data->type = it8720 ||
(sio_data->type = it8782 && (reg & (1 << 2))))
&& !(reg & (1 << 1))) {so you only write to the register and print the notice when needed.
drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 1894
Quoted 12 lines
drivers/hwmon/it87.c +2
-0reg |= (1 <<1 );superio_outb (IT87_SIO_PINX2_REG , reg);pr_notice ("Routing internal VCCH to in7\n" );@@ -1823,6 +1887,8 @@ static int __devinit it87_probe(struct platform_device *pdev)"it8720" ,"it8721" ,"it8728" , +"it8782" , +"it8783" , }; res =platform_get_resource (pdev,IORESOURCE_IO ,0 );
Other than these two minor things, patch looks good (the few remarks I had happen to be addressed by the later patches in the series.) So you can add:
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Jean,
Quoted 53 lines · Jean Delvare
Hi Guenter,
drivers/hwmon/it87.c static int __init it87_find(unsigned short *address, · line 1757
Quoted 8 lines · Guenter Roeck
drivers/hwmon/it87.c +3
-3reg =superio_inb (IT87_SIO_GPIO3_REG ); -if (sio_data->type = it8721 || sio_data->type = it8728) { +if (sio_data->type = it8721 || sio_data->type = it8728 || + sio_data->type = it8782) {/* -* The IT8721F/IT8758E doesn't have VID pins at all, -* not sure about the IT8728F. +* IT8721F, IT8758E, and IT8782F don't have VID pins "IT8721F/IT8758E" is written this way on purpose throughout the whole driver and documentation, because they are "the same chip" (same device ID.)
Quoted 5 lines
drivers/hwmon/it87.c +1
-0+* at all, not sure about the IT8728F. */ sio_data->skip_vid =1 ; }else {drivers/hwmon/it87.c static int __init it87_find(unsigned short *address, · line 1801
Quoted 10 lines
drivers/hwmon/it87.c +5
-1@@ -1733,8 +1793,12 @@ static int __init it87_find(unsigned short *address,* configured, even though the IT8720F datasheet claims * that the internal routing of VCCH to VIN7 is the default * setting. So we force the internal routing in this case. +* +* On IT8782F, VIN7 is multiplexed with one of the UART6 pins. +* If UART6 is enabled, re-route VIN7 to the internal divider. */ -if (sio_data->type = it8720 && !(reg & (1 <<1 ))) { +if ((sio_data->type = it8720 && !(reg & (1 <<1 ))) || + (sio_data->type = it8782 && (reg & (1 <<2 )))) {I'd like to see this done a little differently. Here you'll output the notice message even if VIN7 was already properly routed. That's not fair. I'd prefer:
if ((sio_data->type = it8720 || (sio_data->type = it8782 && (reg & (1 << 2)))) && !(reg & (1 << 1))) {so you only write to the register and print the notice when needed.
Quoted 11 lines
drivers/hwmon/it87.c +2
-0reg |= (1 <<1 );superio_outb (IT87_SIO_PINX2_REG , reg);pr_notice ("Routing internal VCCH to in7\n" );@@ -1823,6 +1887,8 @@ static int __devinit it87_probe(struct platform_device *pdev)"it8720" ,"it8721" ,"it8728" , +"it8782" , + "it8783", };
Quoted 8 lines
drivers/hwmon/it87.c static int __devinit it87_probe(struct platform_device *pdev) · line 1894
Quoted 1 line
drivers/hwmon/it87.c +0
-0res =platform_get_resource (pdev,IORESOURCE_IO ,0 );Other than these two minor things, patch looks good (the few remarks I had happen to be addressed by the later patches in the series.) So you can add:
Acked-by Jean Delvare <[email protected]>
Thanks a lot for the review.
Fixed, and applied.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors