--- drivers/hwmon/it87.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) Index: linux-3.12.24-rt38/drivers/hwmon/it87.c =================================================================== --- linux-3.12.24-rt38.orig/drivers/hwmon/it87.c +++ linux-3.12.24-rt38/drivers/hwmon/it87.c @@ -18,6 +18,7 @@ * IT8721F Super I/O chip w/LPC interface * IT8726F Super I/O chip w/LPC interface * IT8728F Super I/O chip w/LPC interface + * IT8739F Super I/O chip w/LPC interface * IT8758E Super I/O chip w/LPC interface * IT8771E Super I/O chip w/LPC interface * IT8772E Super I/O chip w/LPC interface @@ -63,13 +64,17 @@ #define DRVNAME "it87" -enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8771, - it8772, it8782, it8783 }; +enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8739, + it8771, it8772, it8782, it8783 }; static unsigned short force_id; module_param(force_id, ushort, 0); MODULE_PARM_DESC(force_id, "Override the detected device ID"); +static unsigned short force_address; +module_param(force_address, ushort, 0); +MODULE_PARM_DESC(force_address, "Override the device address"); + static struct platform_device *pdev; #define REG 0x2e /* The register to read/write */ @@ -142,6 +147,7 @@ static inline void superio_exit(void) #define IT8721F_DEVID 0x8721 #define IT8726F_DEVID 0x8726 #define IT8728F_DEVID 0x8728 +#define IT8739F_DEVID 0x8739 #define IT8771E_DEVID 0x8771 #define IT8772E_DEVID 0x8772 #define IT8782F_DEVID 0x8782 @@ -285,6 +291,12 @@ static const struct it87_devices it87_de | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI, .peci_mask = 0x07, }, + [it8739] = { + .name = "it8739", + .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS + | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI, + .peci_mask = 0x07, + }, [it8771] = { .name = "it8771", .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS @@ -1697,7 +1709,7 @@ static int __init it87_find(unsigned sho struct it87_sio_data *sio_data) { int err; - u16 chip_type; + u16 chip_type, found_id; const char *board_vendor, *board_name; err = superio_enter(); @@ -1705,7 +1717,11 @@ static int __init it87_find(unsigned sho return err; err = -ENODEV; - chip_type = force_id ? force_id : superio_inw(DEVID); + found_id = superio_inw(DEVID); + chip_type = force_id ? force_id : found_id; + if (force_id != found_id) + pr_info("Found IT%04xF chip, forced to assume IT%04xF chip\n", + found_id, force_id); switch (chip_type) { case IT8705F_DEVID: @@ -1730,6 +1746,9 @@ static int __init it87_find(unsigned sho case IT8728F_DEVID: sio_data->type = it8728; break; + case IT8739F_DEVID: + sio_data->type = it8739; + break; case IT8771E_DEVID: sio_data->type = it8771; break; @@ -1756,6 +1775,11 @@ static int __init it87_find(unsigned sho } *address = superio_inw(IT87_BASE_REG) & ~(IT87_EXTENT - 1); + if (*address != force_address) { + pr_info("Using forced chip address 0x%x instead of 0x%x\n", + force_address, *address); + *address = force_address; + } if (*address == 0) { pr_info("Base address not set, skipping\n"); goto exit;