Ver código fonte

hwmon: (f71882fg) Add support for the F81865F

Add support for the Fintek F81865F. It's essentially compatible with
the F71882FG, but has fewer inputs: 7 voltage, 2 temperature and 2 fan
inputs only.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Jean Delvare 14 anos atrás
pai
commit
383586b12d
3 arquivos alterados com 19 adições e 8 exclusões
  1. 4 0
      Documentation/hwmon/f71882fg
  2. 1 0
      drivers/hwmon/Kconfig
  3. 14 8
      drivers/hwmon/f71882fg.c

+ 4 - 0
Documentation/hwmon/f71882fg

@@ -41,6 +41,10 @@ Supported chips:
     Note: This is the 64-pin variant of the F71889FG, they have the
     Note: This is the 64-pin variant of the F71889FG, they have the
 	  same device ID and are fully compatible as far as hardware
 	  same device ID and are fully compatible as far as hardware
 	  monitoring is concerned.
 	  monitoring is concerned.
+  * Fintek F81865F
+    Prefix: 'f81865f'
+    Addresses scanned: none, address read from Super I/O config space
+    Datasheet: Available from the Fintek website
 
 
 Author: Hans de Goede <hdegoede@redhat.com>
 Author: Hans de Goede <hdegoede@redhat.com>
 
 

+ 1 - 0
drivers/hwmon/Kconfig

@@ -330,6 +330,7 @@ config SENSORS_F71882FG
 	    F71889FG/ED
 	    F71889FG/ED
 	    F8000
 	    F8000
 	    F81801U
 	    F81801U
+	    F81865F
 
 
 	  This driver can also be built as a module.  If so, the module
 	  This driver can also be built as a module.  If so, the module
 	  will be called f71882fg.
 	  will be called f71882fg.

+ 14 - 8
drivers/hwmon/f71882fg.c

@@ -55,6 +55,7 @@
 #define SIO_F71889_ID		0x0723	/* Chipset ID */
 #define SIO_F71889_ID		0x0723	/* Chipset ID */
 #define SIO_F71889E_ID		0x0909	/* Chipset ID */
 #define SIO_F71889E_ID		0x0909	/* Chipset ID */
 #define SIO_F8000_ID		0x0581	/* Chipset ID */
 #define SIO_F8000_ID		0x0581	/* Chipset ID */
+#define SIO_F81865_ID		0x0704	/* Chipset ID */
 
 
 #define REGION_LENGTH		8
 #define REGION_LENGTH		8
 #define ADDR_REG_OFFSET		5
 #define ADDR_REG_OFFSET		5
@@ -106,7 +107,7 @@ module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
 
 enum chips { f71808e, f71858fg, f71862fg, f71869, f71882fg, f71889fg,
 enum chips { f71808e, f71858fg, f71862fg, f71869, f71882fg, f71889fg,
-	     f71889ed, f8000 };
+	     f71889ed, f8000, f81865f };
 
 
 static const char *f71882fg_names[] = {
 static const char *f71882fg_names[] = {
 	"f71808e",
 	"f71808e",
@@ -117,6 +118,7 @@ static const char *f71882fg_names[] = {
 	"f71889fg", /* f81801u too, same id */
 	"f71889fg", /* f81801u too, same id */
 	"f71889ed",
 	"f71889ed",
 	"f8000",
 	"f8000",
+	"f81865f",
 };
 };
 
 
 static const char f71882fg_has_in[][F71882FG_MAX_INS] = {
 static const char f71882fg_has_in[][F71882FG_MAX_INS] = {
@@ -128,6 +130,7 @@ static const char f71882fg_has_in[][F71882FG_MAX_INS] = {
 	[f71889fg]	= { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
 	[f71889fg]	= { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
 	[f71889ed]	= { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
 	[f71889ed]	= { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
 	[f8000]		= { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
 	[f8000]		= { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
+	[f81865f]	= { 1, 1, 1, 1, 1, 1, 1, 0, 0 },
 };
 };
 
 
 static const char f71882fg_has_in1_alarm[] = {
 static const char f71882fg_has_in1_alarm[] = {
@@ -139,6 +142,7 @@ static const char f71882fg_has_in1_alarm[] = {
 	[f71889fg]	= 1,
 	[f71889fg]	= 1,
 	[f71889ed]	= 1,
 	[f71889ed]	= 1,
 	[f8000]		= 0,
 	[f8000]		= 0,
+	[f81865f]	= 1,
 };
 };
 
 
 static const char f71882fg_has_beep[] = {
 static const char f71882fg_has_beep[] = {
@@ -150,6 +154,7 @@ static const char f71882fg_has_beep[] = {
 	[f71889fg]	= 1,
 	[f71889fg]	= 1,
 	[f71889ed]	= 1,
 	[f71889ed]	= 1,
 	[f8000]		= 0,
 	[f8000]		= 0,
+	[f81865f]	= 1,
 };
 };
 
 
 static const char f71882fg_nr_fans[] = {
 static const char f71882fg_nr_fans[] = {
@@ -161,6 +166,7 @@ static const char f71882fg_nr_fans[] = {
 	[f71889fg]	= 3,
 	[f71889fg]	= 3,
 	[f71889ed]	= 3,
 	[f71889ed]	= 3,
 	[f8000]		= 3,
 	[f8000]		= 3,
+	[f81865f]	= 2,
 };
 };
 
 
 static const char f71882fg_nr_temps[] = {
 static const char f71882fg_nr_temps[] = {
@@ -172,6 +178,7 @@ static const char f71882fg_nr_temps[] = {
 	[f71889fg]	= 3,
 	[f71889fg]	= 3,
 	[f71889ed]	= 3,
 	[f71889ed]	= 3,
 	[f8000]		= 3,
 	[f8000]		= 3,
+	[f81865f]	= 2,
 };
 };
 
 
 static struct platform_device *f71882fg_pdev;
 static struct platform_device *f71882fg_pdev;
@@ -2186,16 +2193,12 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
 		case f71862fg:
 		case f71862fg:
 			err = (data->pwm_enable & 0x15) != 0x15;
 			err = (data->pwm_enable & 0x15) != 0x15;
 			break;
 			break;
-		case f71808e:
-		case f71869:
-		case f71882fg:
-		case f71889fg:
-		case f71889ed:
-			err = 0;
-			break;
 		case f8000:
 		case f8000:
 			err = data->pwm_enable & 0x20;
 			err = data->pwm_enable & 0x20;
 			break;
 			break;
+		default:
+			err = 0;
+			break;
 		}
 		}
 		if (err) {
 		if (err) {
 			dev_err(&pdev->dev,
 			dev_err(&pdev->dev,
@@ -2433,6 +2436,9 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
 	case SIO_F8000_ID:
 	case SIO_F8000_ID:
 		sio_data->type = f8000;
 		sio_data->type = f8000;
 		break;
 		break;
+	case SIO_F81865_ID:
+		sio_data->type = f81865f;
+		break;
 	default:
 	default:
 		pr_info("Unsupported Fintek device: %04x\n",
 		pr_info("Unsupported Fintek device: %04x\n",
 			(unsigned int)devid);
 			(unsigned int)devid);