diff options
Diffstat (limited to 'Documentation/i2c/writing-clients')
-rw-r--r-- | Documentation/i2c/writing-clients | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 7e2a8f11c220..43d7928056ae 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -148,7 +148,7 @@ are defined in i2c.h to help you support them, as well as a generic | |||
148 | detection algorithm. | 148 | detection algorithm. |
149 | 149 | ||
150 | You do not have to use this parameter interface; but don't try to use | 150 | You do not have to use this parameter interface; but don't try to use |
151 | function i2c_probe() (or i2c_detect()) if you don't. | 151 | function i2c_probe() if you don't. |
152 | 152 | ||
153 | NOTE: If you want to write a `sensors' driver, the interface is slightly | 153 | NOTE: If you want to write a `sensors' driver, the interface is slightly |
154 | different! See below. | 154 | different! See below. |
@@ -259,17 +259,10 @@ detected at a specific address, another callback is called. | |||
259 | return i2c_probe(adapter,&addr_data,&foo_detect_client); | 259 | return i2c_probe(adapter,&addr_data,&foo_detect_client); |
260 | } | 260 | } |
261 | 261 | ||
262 | For `sensors' drivers, use the i2c_detect function instead: | ||
263 | |||
264 | int foo_attach_adapter(struct i2c_adapter *adapter) | ||
265 | { | ||
266 | return i2c_detect(adapter,&addr_data,&foo_detect_client); | ||
267 | } | ||
268 | |||
269 | Remember, structure `addr_data' is defined by the macros explained above, | 262 | Remember, structure `addr_data' is defined by the macros explained above, |
270 | so you do not have to define it yourself. | 263 | so you do not have to define it yourself. |
271 | 264 | ||
272 | The i2c_probe or i2c_detect function will call the foo_detect_client | 265 | The i2c_probe function will call the foo_detect_client |
273 | function only for those i2c addresses that actually have a device on | 266 | function only for those i2c addresses that actually have a device on |
274 | them (unless a `force' parameter was used). In addition, addresses that | 267 | them (unless a `force' parameter was used). In addition, addresses that |
275 | are already in use (by some other registered client) are skipped. | 268 | are already in use (by some other registered client) are skipped. |
@@ -278,11 +271,9 @@ are already in use (by some other registered client) are skipped. | |||
278 | The detect client function | 271 | The detect client function |
279 | -------------------------- | 272 | -------------------------- |
280 | 273 | ||
281 | The detect client function is called by i2c_probe or i2c_detect. | 274 | The detect client function is called by i2c_probe. The `kind' parameter |
282 | The `kind' parameter contains 0 if this call is due to a `force' | 275 | contains -1 for a probed detection, 0 for a forced detection, or a positive |
283 | parameter, and -1 otherwise (for i2c_detect, it contains 0 if | 276 | number for a forced detection with a chip type forced. |
284 | this call is due to the generic `force' parameter, and the chip type | ||
285 | number if it is due to a specific `force' parameter). | ||
286 | 277 | ||
287 | Below, some things are only needed if this is a `sensors' driver. Those | 278 | Below, some things are only needed if this is a `sensors' driver. Those |
288 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ | 279 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ |