aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/hwmon/pcf859118
-rw-r--r--drivers/hwmon/pcf8591.c26
2 files changed, 8 insertions, 36 deletions
diff --git a/Documentation/hwmon/pcf8591 b/Documentation/hwmon/pcf8591
index e76a7892f68..ac020b3bb7b 100644
--- a/Documentation/hwmon/pcf8591
+++ b/Documentation/hwmon/pcf8591
@@ -4,7 +4,7 @@ Kernel driver pcf8591
4Supported chips: 4Supported chips:
5 * Philips/NXP PCF8591 5 * Philips/NXP PCF8591
6 Prefix: 'pcf8591' 6 Prefix: 'pcf8591'
7 Addresses scanned: I2C 0x48 - 0x4f 7 Addresses scanned: none
8 Datasheet: Publicly available at the NXP website 8 Datasheet: Publicly available at the NXP website
9 http://www.nxp.com/pip/PCF8591_6.html 9 http://www.nxp.com/pip/PCF8591_6.html
10 10
@@ -58,18 +58,16 @@ Module parameters
58Accessing PCF8591 via /sys interface 58Accessing PCF8591 via /sys interface
59------------------------------------- 59-------------------------------------
60 60
61! Be careful ! 61The PCF8591 is plainly impossible to detect! Thus the driver won't even
62The PCF8591 is plainly impossible to detect! Stupid chip. 62try. You have to explicitly instantiate the device at the relevant
63So every chip with address in the interval [0x48..0x4f] is 63address (in the interval [0x48..0x4f]) either through platform data, or
64detected as PCF8591. If you have other chips in this address 64using the sysfs interface. See Documentation/i2c/instantiating-devices
65range, the workaround is to load this module after the one 65for details.
66for your others chips.
67 66
68On detection (i.e. insmod, modprobe et al.), directories are being 67Directories are being created for each instantiated PCF8591:
69created for each detected PCF8591:
70 68
71/sys/bus/i2c/devices/<0>-<1>/ 69/sys/bus/i2c/devices/<0>-<1>/
72where <0> is the bus the chip was detected on (e. g. i2c-0) 70where <0> is the bus the chip is connected to (e. g. i2c-0)
73and <1> the chip address ([48..4f]) 71and <1> the chip address ([48..4f])
74 72
75Inside these directories, there are such files: 73Inside these directories, there are such files:
diff --git a/drivers/hwmon/pcf8591.c b/drivers/hwmon/pcf8591.c
index d7df0e6c1ef..dc7259d6981 100644
--- a/drivers/hwmon/pcf8591.c
+++ b/drivers/hwmon/pcf8591.c
@@ -26,10 +26,6 @@
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/hwmon.h> 27#include <linux/hwmon.h>
28 28
29/* Addresses to scan */
30static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
31 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
32
33/* Insmod parameters */ 29/* Insmod parameters */
34 30
35static int input_mode; 31static int input_mode;
@@ -170,24 +166,6 @@ static const struct attribute_group pcf8591_attr_group_opt = {
170 * Real code 166 * Real code
171 */ 167 */
172 168
173/* Return 0 if detection is successful, -ENODEV otherwise */
174static int pcf8591_detect(struct i2c_client *client,
175 struct i2c_board_info *info)
176{
177 struct i2c_adapter *adapter = client->adapter;
178
179 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE
180 | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
181 return -ENODEV;
182
183 /* Now, we would do the remaining detection. But the PCF8591 is plainly
184 impossible to detect! Stupid chip. */
185
186 strlcpy(info->type, "pcf8591", I2C_NAME_SIZE);
187
188 return 0;
189}
190
191static int pcf8591_probe(struct i2c_client *client, 169static int pcf8591_probe(struct i2c_client *client,
192 const struct i2c_device_id *id) 170 const struct i2c_device_id *id)
193{ 171{
@@ -307,10 +285,6 @@ static struct i2c_driver pcf8591_driver = {
307 .probe = pcf8591_probe, 285 .probe = pcf8591_probe,
308 .remove = pcf8591_remove, 286 .remove = pcf8591_remove,
309 .id_table = pcf8591_id, 287 .id_table = pcf8591_id,
310
311 .class = I2C_CLASS_HWMON, /* Nearest choice */
312 .detect = pcf8591_detect,
313 .address_list = normal_i2c,
314}; 288};
315 289
316static int __init pcf8591_init(void) 290static int __init pcf8591_init(void)