From 8da1cf8c4fb984d703f18dfc078d725f8fb4b49f Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Sun, 15 Aug 1999 21:01:48 +0000 Subject: [PATCH] (mds) Add initial w83627hf support. Assuming identical to w83782d. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@525 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/w83781d.c | 8 +++++++- kernel/include/sensors.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/kernel/chips/w83781d.c b/kernel/chips/w83781d.c index ca2945e3..87fe4aa7 100644 --- a/kernel/chips/w83781d.c +++ b/kernel/chips/w83781d.c @@ -27,6 +27,7 @@ w83781d 7 3 0 3 0x10 yes yes w83782d 9 3 2-4 3 0x30 yes yes w83783s 5-6 3 2 1-2 0x40 yes no + w83782d 9 3 2-4 3 0x20 yes yes (LPC) */ @@ -61,7 +62,7 @@ static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END}; static unsigned int normal_isa_range[] = {SENSORS_ISA_END}; /* Insmod parameters */ -SENSORS_INSMOD_3(w83781d,w83782d,w83783s); +SENSORS_INSMOD_4(w83781d,w83782d,w83783s,w83627hf); /* Many W83781D constants specified below */ @@ -735,6 +736,8 @@ int w83781d_detect(struct i2c_adapter *adapter, int address, int kind) kind = w83782d; else if (val1 == 0x40) kind = w83783s; + else if (val1 == 0x20) + kind = w83627hf; else { if (kind == 0) printk("w83781d.o: Ignoring 'force' parameter for unknown chip at" @@ -752,6 +755,9 @@ int w83781d_detect(struct i2c_adapter *adapter, int address, int kind) } else if (kind == w83783s) { type_name = "w83783s"; client_name = "W83783S chip"; + } else if (kind == w83627hf) { + type_name = "w83627hf"; + client_name = "W83627HF chip"; } else { #ifdef DEBUG printk("w83781d.o: Internal error: unknown kind (%d)?!?",kind); diff --git a/kernel/include/sensors.h b/kernel/include/sensors.h index a100c18e..657ccb11 100644 --- a/kernel/include/sensors.h +++ b/kernel/include/sensors.h @@ -263,6 +263,23 @@ struct sensors_address_data { {NULL}}; \ SENSORS_INSMOD +#define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ + enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ + SENSORS_MODULE_PARM(force, \ + "List of adapter,address pairs to boldly assume " \ + "to be present"); \ + SENSORS_MODULE_PARM_FORCE(chip1); \ + SENSORS_MODULE_PARM_FORCE(chip2); \ + SENSORS_MODULE_PARM_FORCE(chip3); \ + SENSORS_MODULE_PARM_FORCE(chip4); \ + static struct sensors_force_data forces[] = {{force,any_chip}, \ + {force_ ## chip1,chip1}, \ + {force_ ## chip2,chip2}, \ + {force_ ## chip3,chip3}, \ + {force_ ## chip4,chip4}, \ + {NULL}}; \ + SENSORS_INSMOD + typedef int sensors_found_addr_proc (struct i2c_adapter *adapter, int addr, int kind);