Skip to contentSkip to conversation

via686a sensors support

PATCH In review GertJan Spoelman 3 participants 6 messages Jan 12, 2003 – Jan 20, 2003 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 via686a sensors support

This patch adds via686a sensors support to 2.5.56 (tested with bk1). Christoph this patch applies against the patch you sent me yesterday. and again, please check it.

GertJan

drivers/i2c/busses/Kconfig +2 -3
diff -Nru linux-2.5.56/drivers/i2c/busses/Kconfig linux-2.5.56-edited/drivers/i2c/busses/Kconfig
@@ -16,7 +16,7 @@
 	  while the kernel is running.  If you want to compile it as a module,
 	  say M here and read <file:Documentation/modules.txt>.
 
-	  The module will be called i2c-amd756.o.
+	  The module will be called i2c-amd756.ko.
 
 	  You will also need the latest user-space utilties: you can find them
 	  in the lm_sensors package, which you can download at
@@ -33,7 +33,7 @@
 	  while the kernel is running.  If you want to compile it as a module,
 	  say M here and read <file:Documentation/modules.txt>.
 
-	  The module will be called i2c-amd8111.o.
+	  The module will be called i2c-amd8111.ko.
 
 	  You will also need the latest user-space utilties: you can find them
 	  in the lm_sensors package, which you can download at 
@@ -54,4 +54,3 @@
 	  The module will be called i2c-isa.ko.
 
 endmenu
-
drivers/i2c/chips/Kconfig +20 -2
diff -Nru linux-2.5.56/drivers/i2c/chips/Kconfig linux-2.5.56-edited/drivers/i2c/chips/Kconfig
@@ -16,7 +16,7 @@
 	  be built as a module which can be inserted and removed while the
 	  kernel is running.
 
-	  The module will be called adm1021.o.
+	  The module will be called adm1021.ko.
 	  
 	  You will also need the latest user-space utilties: you can find them
 	  in the lm_sensors package, which you can download at 
@@ -31,7 +31,21 @@
 	  TCN75, and National Semi LM77. This can also be built as a module
 	  which can be inserted and removed while the kernel is running.
 
-	  The module will be called lm75.o.
+	  The module will be called lm75.ko.
+
+	  You will also need the latest user-space utilties: you can find them
+	  in the lm_sensors package, which you can download at 
+	  http://www.lm-sensors.nu
+
+config SENSORS_VIA686A
+	tristate "  Via 686a Integrated Hardware Monitor"
+	depends on I2C && I2C_PROC && I2C_ISA
+	help
+	  If you say yes here you get support for the integrated sensors in
+	  VIA 686A/B South Bridges. This can also be built as a module
+	  which can be inserted and removed while the kernel is running.
+
+	  The module will be called via686a.ko.
 
 	  You will also need the latest user-space utilties: you can find them
 	  in the lm_sensors package, which you can download at
@@ -48,4 +62,8 @@
 
 	  The module will be called w83781d.ko.
 
+	  You will also need the latest user-space utilties: you can find them
+	  in the lm_sensors package, which you can download at 
+	  http://www.lm-sensors.nu
+
 endmenu
drivers/i2c/chips/Makefile +1 -0
diff -Nru linux-2.5.56/drivers/i2c/chips/Makefile linux-2.5.56-edited/drivers/i2c/chips/Makefile
@@ -4,4 +4,5 @@
 
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
 obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
+obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
drivers/i2c/chips/via686a.c +941 -0

941 lines not on this page · raw message

#1 lore raw

drivers/i2c/busses/Kconfig line 19

Quoted 6 lines
drivers/i2c/busses/Kconfig +1 -1
@@ -16,7 +16,7 @@
 	  while the kernel is running.  If you want to compile it as a module,
 	  say M here and read <file:Documentation/modules.txt>.
 
-	  The module will be called i2c-amd756.o.
+	  The module will be called i2c-amd756.ko.

Please don't submit unrelated changes in this patch. While I agree with this documentation fix it's clearly a separate issue.

drivers/i2c/chips/via686a.c line 33

Quoted 1 line
drivers/i2c/chips/via686a.c +1 -0
+#include <linux/version.h>

you don't need this header.

drivers/i2c/chips/via686a.c line 71

Quoted 3 lines
drivers/i2c/chips/via686a.c +3 -0
+#ifndef PCI_DEVICE_ID_VIA_82C686_4
+#define PCI_DEVICE_ID_VIA_82C686_4 0x3057
+#endif

This one should be in include/linux/pci_ids.h

Quoted 1 line

+extern inline long IN_FROM_REG(u8 val, int inNum)

All these extern inlines should be static inline instead.

drivers/i2c/chips/via686a.c line 523

Quoted 11 lines
drivers/i2c/chips/via686a.c +11 -0
+static int via686a_find(int *address)
+{
+	u16 val;
+
+	if (!pci_present())
+		return -ENODEV;
+
+	if (!(s_bridge = pci_find_device(PCI_VENDOR_ID_VIA,
+					 PCI_DEVICE_ID_VIA_82C686_4,
+					 NULL)))
+		return -ENODEV;

I think this should converted to a 2.4/2.5-style PCI driver. See the amd drivers.

drivers/i2c/chips/via686a.c line 654

Quoted 5 lines
drivers/i2c/chips/via686a.c +5 -0
+/* No commands defined yet */
+static int via686a_command(struct i2c_client *client, unsigned int cmd, void *arg)
+{
+	return 0;
+}

->command is optional, so there's no need to have this stub.

drivers/i2c/chips/via686a.c line 719

Quoted 3 lines
drivers/i2c/chips/via686a.c +3 -0
+
+	if ((jiffies - data->last_updated > HZ + HZ / 2) ||
+	    (jiffies < data->last_updated) || !data->valid) {

Use time_after here?

#2 lore raw
Quoted 9 lines · Christoph Hellwig

Review line 19

Quoted 6 lines
(quoted diff) +1 -1
@@ -16,7 +16,7 @@
 	  while the kernel is running.  If you want to compile it as a module,
 	  say M here and read <file:Documentation/modules.txt>.
 
-	  The module will be called i2c-amd756.o.
+	  The module will be called i2c-amd756.ko.

Please don't submit unrelated changes in this patch. While I agree with this documentation fix it's clearly a separate issue.

O.K., sorry.

Quoted 3 lines

Review line 20

Quoted 1 line
(quoted diff) +1 -0
+#include <linux/version.h>

you don't need this header.

Has been deleted.

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+#ifndef PCI_DEVICE_ID_VIA_82C686_4
+#define PCI_DEVICE_ID_VIA_82C686_4 0x3057
+#endif

This one should be in include/linux/pci_ids.h

It already is, so just deleted that part.

Quoted 3 lines
Quoted 1 line

+extern inline long IN_FROM_REG(u8 val, int inNum)

All these extern inlines should be static inline instead.

Changed.

Quoted 6 lines
Quoted 6 lines
(quoted diff) +6 -0
+static int via686a_find(int *address)
+{
+	u16 val;
+
+	if (!pci_present())
+		return -ENODEV;
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+
+	if (!(s_bridge = pci_find_device(PCI_VENDOR_ID_VIA,
+					 PCI_DEVICE_ID_VIA_82C686_4,
+					 NULL)))
+		return -ENODEV;

I think this should converted to a 2.4/2.5-style PCI driver. See the amd drivers.

Done, I hope it's any good, very new stuff to me. It does work, it still loads and works on my machine.

Quoted 7 lines

Review

Quoted 5 lines
(quoted diff) +2 -0
+/* No commands defined yet */
+static int via686a_command(struct i2c_client *client, unsigned int cmd,

void *arg) +{

(quoted diff) +2 -0
+	return 0;
+}

->command is optional, so there's no need to have this stub.

Also deleted.

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+	if ((jiffies - data->last_updated > HZ + HZ / 2) ||
+	    (jiffies < data->last_updated) || !data->valid) {

Use time_after here?

O.K. has been done, this should probably also be changed then in lm75 and adm1021.

GertJan

New patch follows:

drivers/i2c/chips/Kconfig +14 -0
diff -Nru linux-2.5.58/drivers/i2c/chips/Kconfig linux-2.5.58-edited/drivers/i2c/chips/Kconfig
@@ -37,6 +37,20 @@
 	  in the lm_sensors package, which you can download at 
 	  http://www.lm-sensors.nu
 
+config SENSORS_VIA686A
+	tristate "  Via 686a Integrated Hardware Monitor"
+	depends on I2C && I2C_PROC && I2C_ISA
+	help
+	  If you say yes here you get support for the integrated sensors in
+	  VIA 686A/B South Bridges. This can also be built as a module
+	  which can be inserted and removed while the kernel is running.
+
+	  The module will be called via686a.ko.
+
+	  You will also need the latest user-space utilties: you can find them
+	  in the lm_sensors package, which you can download at 
+	  http://www.lm-sensors.nu
+
 config SENSORS_W83781D
 	tristate "  Winbond W83781D, W83782D, W83783S, W83627HF and Asus AS99127F"
 	depends on I2C && I2C_PROC && I2C_ISA
drivers/i2c/chips/Makefile +1 -0
diff -Nru linux-2.5.58/drivers/i2c/chips/Makefile linux-2.5.58-edited/drivers/i2c/chips/Makefile
@@ -4,4 +4,5 @@
 
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
 obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
+obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
drivers/i2c/chips/via686a.c +935 -0

935 lines not on this page · raw message

#3 lore raw

This patch looks really good to me. Please try to submit and your other stuff to Linus.

#4 lore raw
Quoted 2 lines · Christoph Hellwig

This patch looks really good to me. Please try to submit and your other stuff to Linus.

OK thanks, I will do that.
Thanks again for you help.

Signature · 1 line
    GertJan
#5 lore raw
In reply to Christoph Hellwig

Hi!

Quoted 9 lines

drivers/i2c/busses/Kconfig line 19

Quoted 6 lines
drivers/i2c/busses/Kconfig +1 -1
@@ -16,7 +16,7 @@
 	  while the kernel is running.  If you want to compile it as a module,
 	  say M here and read <file:Documentation/modules.txt>.
 
-	  The module will be called i2c-amd756.o.
+	  The module will be called i2c-amd756.ko.

Please don't submit unrelated changes in this patch. While I agree with this documentation fix it's clearly a separate issue.

Please submit that documenation fixes through trivial patch monkey. That should make sure they are not lost.

Signature · 2 lines
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?