aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-07-31 15:52:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-05 12:14:22 -0400
commit303760b44a7a142cb9f4c9df4609fb63bbda98db (patch)
tree8097f99cd993bc005b25e14a5690770b6e351195 /drivers/i2c
parentf4b50261207c987913f076d867c2e154d71fd012 (diff)
[PATCH] hwmon: hwmon vs i2c, second round (07/11)
The only part left in i2c-sensor is the VRM/VRD/VID handling code. This is in no way related to i2c, so it doesn't belong there. Move the code to hwmon, where it belongs. Note that not all hardware monitoring drivers do VRM/VRD/VID operations, so less drivers depend on hwmon-vid than there were depending on i2c-sensor. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/Makefile4
-rw-r--r--drivers/i2c/chips/Kconfig10
-rw-r--r--drivers/i2c/i2c-sensor-vid.c103
3 files changed, 0 insertions, 117 deletions
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 71d68ad0e5ce..71c5a854ac5d 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -4,12 +4,8 @@
4 4
5obj-$(CONFIG_I2C) += i2c-core.o 5obj-$(CONFIG_I2C) += i2c-core.o
6obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o 6obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
7obj-$(CONFIG_I2C_SENSOR) += i2c-sensor.o
8obj-y += busses/ chips/ algos/ 7obj-y += busses/ chips/ algos/
9 8
10i2c-sensor-objs := i2c-sensor-vid.o
11
12
13ifeq ($(CONFIG_I2C_DEBUG_CORE),y) 9ifeq ($(CONFIG_I2C_DEBUG_CORE),y)
14EXTRA_CFLAGS += -DDEBUG 10EXTRA_CFLAGS += -DDEBUG
15endif 11endif
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 43f70dbfc03f..6bd44a44cd28 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -2,17 +2,12 @@
2# Miscellaneous I2C chip drivers configuration 2# Miscellaneous I2C chip drivers configuration
3# 3#
4 4
5config I2C_SENSOR
6 tristate
7 default n
8
9menu "Miscellaneous I2C Chip support" 5menu "Miscellaneous I2C Chip support"
10 depends on I2C 6 depends on I2C
11 7
12config SENSORS_DS1337 8config SENSORS_DS1337
13 tristate "Dallas Semiconductor DS1337 and DS1339 Real Time Clock" 9 tristate "Dallas Semiconductor DS1337 and DS1339 Real Time Clock"
14 depends on I2C && EXPERIMENTAL 10 depends on I2C && EXPERIMENTAL
15 select I2C_SENSOR
16 help 11 help
17 If you say yes here you get support for Dallas Semiconductor 12 If you say yes here you get support for Dallas Semiconductor
18 DS1337 and DS1339 real-time clock chips. 13 DS1337 and DS1339 real-time clock chips.
@@ -23,7 +18,6 @@ config SENSORS_DS1337
23config SENSORS_DS1374 18config SENSORS_DS1374
24 tristate "Maxim/Dallas Semiconductor DS1374 Real Time Clock" 19 tristate "Maxim/Dallas Semiconductor DS1374 Real Time Clock"
25 depends on I2C && EXPERIMENTAL 20 depends on I2C && EXPERIMENTAL
26 select I2C_SENSOR
27 help 21 help
28 If you say yes here you get support for Dallas Semiconductor 22 If you say yes here you get support for Dallas Semiconductor
29 DS1374 real-time clock chips. 23 DS1374 real-time clock chips.
@@ -34,7 +28,6 @@ config SENSORS_DS1374
34config SENSORS_EEPROM 28config SENSORS_EEPROM
35 tristate "EEPROM reader" 29 tristate "EEPROM reader"
36 depends on I2C && EXPERIMENTAL 30 depends on I2C && EXPERIMENTAL
37 select I2C_SENSOR
38 help 31 help
39 If you say yes here you get read-only access to the EEPROM data 32 If you say yes here you get read-only access to the EEPROM data
40 available on modern memory DIMMs and Sony Vaio laptops. Such 33 available on modern memory DIMMs and Sony Vaio laptops. Such
@@ -46,7 +39,6 @@ config SENSORS_EEPROM
46config SENSORS_PCF8574 39config SENSORS_PCF8574
47 tristate "Philips PCF8574 and PCF8574A" 40 tristate "Philips PCF8574 and PCF8574A"
48 depends on I2C && EXPERIMENTAL 41 depends on I2C && EXPERIMENTAL
49 select I2C_SENSOR
50 help 42 help
51 If you say yes here you get support for Philips PCF8574 and 43 If you say yes here you get support for Philips PCF8574 and
52 PCF8574A chips. 44 PCF8574A chips.
@@ -67,7 +59,6 @@ config SENSORS_PCA9539
67config SENSORS_PCF8591 59config SENSORS_PCF8591
68 tristate "Philips PCF8591" 60 tristate "Philips PCF8591"
69 depends on I2C && EXPERIMENTAL 61 depends on I2C && EXPERIMENTAL
70 select I2C_SENSOR
71 help 62 help
72 If you say yes here you get support for Philips PCF8591 chips. 63 If you say yes here you get support for Philips PCF8591 chips.
73 64
@@ -77,7 +68,6 @@ config SENSORS_PCF8591
77config SENSORS_RTC8564 68config SENSORS_RTC8564
78 tristate "Epson 8564 RTC chip" 69 tristate "Epson 8564 RTC chip"
79 depends on I2C && EXPERIMENTAL 70 depends on I2C && EXPERIMENTAL
80 select I2C_SENSOR
81 help 71 help
82 If you say yes here you get support for the Epson 8564 RTC chip. 72 If you say yes here you get support for the Epson 8564 RTC chip.
83 73
diff --git a/drivers/i2c/i2c-sensor-vid.c b/drivers/i2c/i2c-sensor-vid.c
deleted file mode 100644
index b8ef289fc80e..000000000000
--- a/drivers/i2c/i2c-sensor-vid.c
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 i2c-sensor-vid.c - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring
4
5 Copyright (c) 2004 Rudolf Marek <r.marek@sh.cvut.cz>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#include <linux/config.h>
23#include <linux/module.h>
24#include <linux/kernel.h>
25
26struct vrm_model {
27 u8 vendor;
28 u8 eff_family;
29 u8 eff_model;
30 int vrm_type;
31};
32
33#define ANY 0xFF
34
35#ifdef CONFIG_X86
36
37static struct vrm_model vrm_models[] = {
38 {X86_VENDOR_AMD, 0x6, ANY, 90}, /* Athlon Duron etc */
39 {X86_VENDOR_AMD, 0xF, ANY, 24}, /* Athlon 64, Opteron */
40 {X86_VENDOR_INTEL, 0x6, 0x9, 85}, /* 0.13um too */
41 {X86_VENDOR_INTEL, 0x6, 0xB, 85}, /* 0xB Tualatin */
42 {X86_VENDOR_INTEL, 0x6, ANY, 82}, /* any P6 */
43 {X86_VENDOR_INTEL, 0x7, ANY, 0}, /* Itanium */
44 {X86_VENDOR_INTEL, 0xF, 0x3, 100}, /* P4 Prescott */
45 {X86_VENDOR_INTEL, 0xF, ANY, 90}, /* P4 before Prescott */
46 {X86_VENDOR_INTEL, 0x10,ANY, 0}, /* Itanium 2 */
47 {X86_VENDOR_UNKNOWN, ANY, ANY, 0} /* stop here */
48 };
49
50static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor)
51{
52 int i = 0;
53
54 while (vrm_models[i].vendor!=X86_VENDOR_UNKNOWN) {
55 if (vrm_models[i].vendor==vendor)
56 if ((vrm_models[i].eff_family==eff_family)&& \
57 ((vrm_models[i].eff_model==eff_model)|| \
58 (vrm_models[i].eff_model==ANY)))
59 return vrm_models[i].vrm_type;
60 i++;
61 }
62
63 return 0;
64}
65
66int i2c_which_vrm(void)
67{
68 struct cpuinfo_x86 *c = cpu_data;
69 u32 eax;
70 u8 eff_family, eff_model;
71 int vrm_ret;
72
73 if (c->x86 < 6) return 0; /* any CPU with familly lower than 6
74 dont have VID and/or CPUID */
75 eax = cpuid_eax(1);
76 eff_family = ((eax & 0x00000F00)>>8);
77 eff_model = ((eax & 0x000000F0)>>4);
78 if (eff_family == 0xF) { /* use extended model & family */
79 eff_family += ((eax & 0x00F00000)>>20);
80 eff_model += ((eax & 0x000F0000)>>16)<<4;
81 }
82 vrm_ret = find_vrm(eff_family,eff_model,c->x86_vendor);
83 if (vrm_ret == 0)
84 printk(KERN_INFO "i2c-sensor.o: Unknown VRM version of your"
85 " x86 CPU\n");
86 return vrm_ret;
87}
88
89/* and now for something completely different for Non-x86 world*/
90#else
91int i2c_which_vrm(void)
92{
93 printk(KERN_INFO "i2c-sensor.o: Unknown VRM version of your CPU\n");
94 return 0;
95}
96#endif
97
98EXPORT_SYMBOL(i2c_which_vrm);
99
100MODULE_AUTHOR("Rudolf Marek <r.marek@sh.cvut.cz>");
101
102MODULE_DESCRIPTION("i2c-sensor driver");
103MODULE_LICENSE("GPL");