Skip to contentSkip to conversation

hwmon (dme1737): probe all addresses

PATCH In review Juerg Haefliger 2 participants 3 messages Mar 26, 2008 – Mar 27, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 hwmon (dme1737): probe all addresses

This patch adds a module load parameter to enable probing of non-standard LPC addresses 0x162e and 0x164e when scanning for supported ISA chips.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

This patch adds a module load parameter to enable probing of non-standard LPC addresses 0x162e and 0x164e when scanning for supported ISA chips.

Signed-off-by Juerg Haefliger <juergh at gmail.com>
Documentation/hwmon/dme1737 +2 -0
Index: linux/Documentation/hwmon/dme1737
===================================================================
@@ -22,6 +22,8 @@
 			and PWM output control functions. Using this parameter
 			shouldn't be required since the BIOS usually takes care
 			of this.
+* probe_all_addr: bool	Include non-standard LPC addresses 0x162e and 0x164e
+			when probing for ISA devices.
 
 Note that there is no need to use this parameter if the driver loads without
 complaining. The driver will say so if it is necessary.
drivers/hwmon/dme1737.c +9 -1
Index: linux/drivers/hwmon/dme1737.c
===================================================================
@@ -48,6 +48,11 @@
 module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
+static int probe_all_addr;
+module_param(probe_all_addr, bool, 0);
+MODULE_PARM_DESC(probe_all_addr, "Include probing of non-standard LPC "
+		 "addresses");
+
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END};
 
@@ -2430,7 +2435,10 @@
 	}
 
 	if (dme1737_isa_detect(0x2e, &addr) &&
-	    dme1737_isa_detect(0x4e, &addr)) {
+	    dme1737_isa_detect(0x4e, &addr) &&
+	    (!probe_all_addr || (probe_all_addr &&
+	     dme1737_isa_detect(0x162e, &addr) &&
+	     dme1737_isa_detect(0x164e, &addr)))) {
 		/* Return 0 if we didn't find an ISA device */
 		return 0;
 	}

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

Hi Juerg,

Quoted 9 lines · Juerg Haefliger

This patch adds a module load parameter to enable probing of non-standard LPC addresses 0x162e and 0x164e when scanning for supported ISA chips.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

Index: linux/Documentation/hwmon/dme1737
=================================> --- linux.orig/Documentation/hwmon/dme1737 2008-01-24 14:58:37.000000000 -0800
+++ linux/Documentation/hwmon/dme1737 2008-03-15 22:19:11.000000000 -0700

Documentation/hwmon/dme1737 line 29

Quoted 8 lines
Documentation/hwmon/dme1737 +2 -0
@@ -22,6 +22,8 @@
 			and PWM output control functions. Using this parameter
 			shouldn't be required since the BIOS usually takes care
 			of this.
+* probe_all_addr: bool	Include non-standard LPC addresses 0x162e and 0x164e
+			when probing for ISA devices.
 
 Note that there is no need to use this parameter if the driver loads without
 complaining. The driver will say so if it is necessary.

Maybe you could document on which board this parameter is known to be needed? (EPIA SN18000 if I recall properly.)

Quoted 16 lines

Index: linux/drivers/hwmon/dme1737.c
=================================> --- linux.orig/drivers/hwmon/dme1737.c 2008-03-15 22:12:39.000000000 -0700
+++ linux/drivers/hwmon/dme1737.c 2008-03-15 22:17:04.000000000 -0700

drivers/hwmon/dme1737.c +5 -0
@@ -48,6 +48,11 @@
 module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
+static int probe_all_addr;
+module_param(probe_all_addr, bool, 0);
+MODULE_PARM_DESC(probe_all_addr, "Include probing of non-standard LPC "
+		 "addresses");
+
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END};
 

drivers/hwmon/dme1737.c line 2439

Quoted 6 lines
drivers/hwmon/dme1737.c +2 -1
@@ -2430,7 +2435,10 @@
 	}
 
 	if (dme1737_isa_detect(0x2e, &addr) &&
-	    dme1737_isa_detect(0x4e, &addr)) {
+	    dme1737_isa_detect(0x4e, &addr) &&
+	    (!probe_all_addr || (probe_all_addr &&

It works, but note that the "probe_all_addr" check is redundant.

Quoted 5 lines
drivers/hwmon/dme1737.c +2 -0
+	     dme1737_isa_detect(0x162e, &addr) &&
+	     dme1737_isa_detect(0x164e, &addr)))) {
 		/* Return 0 if we didn't find an ISA device */
 		return 0;
 	}
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Juerg Haefliger

Hi Jean,

Quoted 20 lines · Jean Delvare

Hi Juerg,

Quoted 15 lines · Juerg Haefliger

This patch adds a module load parameter to enable probing of non-standard LPC addresses 0x162e and 0x164e when scanning for supported ISA chips.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

Index: linux/Documentation/hwmon/dme1737
=================================> > --- linux.orig/Documentation/hwmon/dme1737 2008-01-24 14:58:37.000000000 -0800
+++ linux/Documentation/hwmon/dme1737 2008-03-15 22:19:11.000000000 -0700

Documentation/hwmon/dme1737 +2 -0
@@ -22,6 +22,8 @@
                      and PWM output control functions. Using this parameter
                      shouldn't be required since the BIOS usually takes care
                      of this.
+* probe_all_addr: bool       Include non-standard LPC addresses 0x162e and 0x164e
+                     when probing for ISA devices.
 
Quoted 5 lines

Documentation/hwmon/dme1737 line 29

Quoted 2 lines
Documentation/hwmon/dme1737 +0 -0
 Note that there is no need to use this parameter if the driver loads without
 complaining. The driver will say so if it is necessary.

Maybe you could document on which board this parameter is known to be needed? (EPIA SN18000 if I recall properly.)

OK, will do.

Quoted 18 lines
Quoted 18 lines

Index: linux/drivers/hwmon/dme1737.c
=================================> > --- linux.orig/drivers/hwmon/dme1737.c 2008-03-15 22:12:39.000000000 -0700
+++ linux/drivers/hwmon/dme1737.c 2008-03-15 22:17:04.000000000 -0700

drivers/hwmon/dme1737.c +5 -0
@@ -48,6 +48,11 @@
 module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
+static int probe_all_addr;
+module_param(probe_all_addr, bool, 0);
+MODULE_PARM_DESC(probe_all_addr, "Include probing of non-standard LPC "
+              "addresses");
+
 /* Addresses to scan */
 static const unsigned short normal_i2c[] = {0x2c, 0x2d, 0x2e, I2C_CLIENT_END};
 
@@ -2430,7 +2435,10 @@
      }
 
Quoted 6 lines

drivers/hwmon/dme1737.c line 2439

Quoted 4 lines
drivers/hwmon/dme1737.c +2 -1
      if (dme1737_isa_detect(0x2e, &addr) &&
-         dme1737_isa_detect(0x4e, &addr)) {
+         dme1737_isa_detect(0x4e, &addr) &&
+         (!probe_all_addr || (probe_all_addr &&

It works, but note that the "probe_all_addr" check is redundant.

True, will fix.

Thanks for the review of the patch set.
...juerg

Quoted 9 lines

drivers/hwmon/dme1737.c line 2444

Quoted 5 lines
drivers/hwmon/dme1737.c +2 -0
+          dme1737_isa_detect(0x162e, &addr) &&
+          dme1737_isa_detect(0x164e, &addr)))) {
              /* Return 0 if we didn't find an ISA device */
              return 0;
      }

--
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors