aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-03-30 15:46:43 -0400
committerJean Delvare <khali@linux-fr.org>2009-03-30 15:46:43 -0400
commitfb4504fe84b09cbf49fda19e6630a1003d79656a (patch)
treed2e623b65fb91f18a02b3435f5a25e8b36572815 /drivers
parenta157d06d4d70318a0818552095071d7430dd5d34 (diff)
Move the pcf8591 driver to hwmon
Directory drivers/i2c/chips is going away, so drivers there must find new homes. For the pcf8591 driver, the best choice seems to be the hwmon subsystem. While the Philips PCF8591 device isn't a typical hardware monitoring chip, its DAC interface is compatible with the hwmon one, so it fits somewhat. If a better subsystem is ever created for ADC/DAC chips, the driver could be moved there. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/Kconfig14
-rw-r--r--drivers/hwmon/Makefile1
-rw-r--r--drivers/hwmon/pcf8591.c (renamed from drivers/i2c/chips/pcf8591.c)24
-rw-r--r--drivers/i2c/chips/Kconfig13
-rw-r--r--drivers/i2c/chips/Makefile1
5 files changed, 27 insertions, 26 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 0eb4170cc4af..9a22816b37dd 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -635,6 +635,20 @@ config SENSORS_PC87427
635 This driver can also be built as a module. If so, the module 635 This driver can also be built as a module. If so, the module
636 will be called pc87427. 636 will be called pc87427.
637 637
638config SENSORS_PCF8591
639 tristate "Philips PCF8591 ADC/DAC"
640 depends on I2C
641 default n
642 help
643 If you say yes here you get support for Philips PCF8591 4-channel
644 ADC, 1-channel DAC chips.
645
646 This driver can also be built as a module. If so, the module
647 will be called pcf8591.
648
649 These devices are hard to detect and rarely found on mainstream
650 hardware. If unsure, say N.
651
638config SENSORS_SIS5595 652config SENSORS_SIS5595
639 tristate "Silicon Integrated Systems Corp. SiS5595" 653 tristate "Silicon Integrated Systems Corp. SiS5595"
640 depends on PCI 654 depends on PCI
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 2e80f37f39eb..e332d6267920 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -70,6 +70,7 @@ obj-$(CONFIG_SENSORS_MAX1619) += max1619.o
70obj-$(CONFIG_SENSORS_MAX6650) += max6650.o 70obj-$(CONFIG_SENSORS_MAX6650) += max6650.o
71obj-$(CONFIG_SENSORS_PC87360) += pc87360.o 71obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
72obj-$(CONFIG_SENSORS_PC87427) += pc87427.o 72obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
73obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
73obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o 74obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
74obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o 75obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
75obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o 76obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/hwmon/pcf8591.c
index 16ce3e193776..1d7ffebd679d 100644
--- a/drivers/i2c/chips/pcf8591.c
+++ b/drivers/hwmon/pcf8591.c
@@ -1,6 +1,6 @@
1/* 1/*
2 Copyright (C) 2001-2004 Aurelien Jarno <aurelien@aurel32.net> 2 Copyright (C) 2001-2004 Aurelien Jarno <aurelien@aurel32.net>
3 Ported to Linux 2.6 by Aurelien Jarno <aurelien@aurel32.net> with 3 Ported to Linux 2.6 by Aurelien Jarno <aurelien@aurel32.net> with
4 the help of Jean Delvare <khali@linux-fr.org> 4 the help of Jean Delvare <khali@linux-fr.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
@@ -41,13 +41,13 @@ MODULE_PARM_DESC(input_mode,
41 " 3 = two differential inputs\n"); 41 " 3 = two differential inputs\n");
42 42
43/* The PCF8591 control byte 43/* The PCF8591 control byte
44 7 6 5 4 3 2 1 0 44 7 6 5 4 3 2 1 0
45 | 0 |AOEF| AIP | 0 |AINC| AICH | */ 45 | 0 |AOEF| AIP | 0 |AINC| AICH | */
46 46
47/* Analog Output Enable Flag (analog output active if 1) */ 47/* Analog Output Enable Flag (analog output active if 1) */
48#define PCF8591_CONTROL_AOEF 0x40 48#define PCF8591_CONTROL_AOEF 0x40
49 49
50/* Analog Input Programming 50/* Analog Input Programming
51 0x00 = four single ended inputs 51 0x00 = four single ended inputs
52 0x10 = three differential inputs 52 0x10 = three differential inputs
53 0x20 = single ended and differential mixed 53 0x20 = single ended and differential mixed
@@ -58,7 +58,7 @@ MODULE_PARM_DESC(input_mode,
58#define PCF8591_CONTROL_AINC 0x04 58#define PCF8591_CONTROL_AINC 0x04
59 59
60/* Channel selection 60/* Channel selection
61 0x00 = channel 0 61 0x00 = channel 0
62 0x01 = channel 1 62 0x01 = channel 1
63 0x02 = channel 2 63 0x02 = channel 2
64 0x03 = channel 3 */ 64 0x03 = channel 3 */
@@ -114,7 +114,7 @@ static ssize_t set_out0_output(struct device *dev, struct device_attribute *attr
114 return -EINVAL; 114 return -EINVAL;
115} 115}
116 116
117static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO, 117static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO,
118 show_out0_ouput, set_out0_output); 118 show_out0_ouput, set_out0_output);
119 119
120static ssize_t show_out0_enable(struct device *dev, struct device_attribute *attr, char *buf) 120static ssize_t show_out0_enable(struct device *dev, struct device_attribute *attr, char *buf)
@@ -139,7 +139,7 @@ static ssize_t set_out0_enable(struct device *dev, struct device_attribute *attr
139 return count; 139 return count;
140} 140}
141 141
142static DEVICE_ATTR(out0_enable, S_IWUSR | S_IRUGO, 142static DEVICE_ATTR(out0_enable, S_IWUSR | S_IRUGO,
143 show_out0_enable, set_out0_enable); 143 show_out0_enable, set_out0_enable);
144 144
145static struct attribute *pcf8591_attributes[] = { 145static struct attribute *pcf8591_attributes[] = {
@@ -196,7 +196,7 @@ static int pcf8591_probe(struct i2c_client *client,
196 err = -ENOMEM; 196 err = -ENOMEM;
197 goto exit; 197 goto exit;
198 } 198 }
199 199
200 i2c_set_clientdata(client, data); 200 i2c_set_clientdata(client, data);
201 mutex_init(&data->update_lock); 201 mutex_init(&data->update_lock);
202 202
@@ -249,8 +249,8 @@ static void pcf8591_init_client(struct i2c_client *client)
249 data->aout = PCF8591_INIT_AOUT; 249 data->aout = PCF8591_INIT_AOUT;
250 250
251 i2c_smbus_write_byte_data(client, data->control, data->aout); 251 i2c_smbus_write_byte_data(client, data->control, data->aout);
252 252
253 /* The first byte transmitted contains the conversion code of the 253 /* The first byte transmitted contains the conversion code of the
254 previous read cycle. FLUSH IT! */ 254 previous read cycle. FLUSH IT! */
255 i2c_smbus_read_byte(client); 255 i2c_smbus_read_byte(client);
256} 256}
@@ -267,8 +267,8 @@ static int pcf8591_read_channel(struct device *dev, int channel)
267 data->control = (data->control & ~PCF8591_CONTROL_AICH_MASK) 267 data->control = (data->control & ~PCF8591_CONTROL_AICH_MASK)
268 | channel; 268 | channel;
269 i2c_smbus_write_byte(client, data->control); 269 i2c_smbus_write_byte(client, data->control);
270 270
271 /* The first byte transmitted contains the conversion code of 271 /* The first byte transmitted contains the conversion code of
272 the previous read cycle. FLUSH IT! */ 272 the previous read cycle. FLUSH IT! */
273 i2c_smbus_read_byte(client); 273 i2c_smbus_read_byte(client);
274 } 274 }
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index c80312c1f382..8f8c81eb0aee 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -64,19 +64,6 @@ config SENSORS_PCA9539
64 This driver is deprecated and will be dropped soon. Use 64 This driver is deprecated and will be dropped soon. Use
65 drivers/gpio/pca953x.c instead. 65 drivers/gpio/pca953x.c instead.
66 66
67config SENSORS_PCF8591
68 tristate "Philips PCF8591"
69 depends on EXPERIMENTAL
70 default n
71 help
72 If you say yes here you get support for Philips PCF8591 chips.
73
74 This driver can also be built as a module. If so, the module
75 will be called pcf8591.
76
77 These devices are hard to detect and rarely found on mainstream
78 hardware. If unsure, say N.
79
80config SENSORS_MAX6875 67config SENSORS_MAX6875
81 tristate "Maxim MAX6875 Power supply supervisor" 68 tristate "Maxim MAX6875 Power supply supervisor"
82 depends on EXPERIMENTAL 69 depends on EXPERIMENTAL
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index d142f238a2de..55a376037183 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_SENSORS_MAX6875) += max6875.o
15obj-$(CONFIG_SENSORS_PCA9539) += pca9539.o 15obj-$(CONFIG_SENSORS_PCA9539) += pca9539.o
16obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o 16obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o
17obj-$(CONFIG_PCF8575) += pcf8575.o 17obj-$(CONFIG_PCF8575) += pcf8575.o
18obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
19obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o 18obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o
20 19
21ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) 20ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)