Changeset 3556
- Timestamp:
- 06/30/01 21:03:27 (7 years ago)
- Files:
-
- i2c/trunk/doc/writing-clients (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
i2c/trunk/doc/writing-clients
r3530 r3556 191 191 192 192 You do not have to use this parameter interface; but don't try to use 193 function i2c_probe() (or sensors_detect()) if you don't.193 function i2c_probe() (or i2c_detect()) if you don't. 194 194 195 195 NOTE: If you want to write a `sensors' driver, the interface is slightly … … 345 345 } 346 346 347 For `sensors' drivers, use the sensors_detect function instead:347 For `sensors' drivers, use the i2c_detect function instead: 348 348 349 349 int foo_attach_adapter(struct i2c_adapter *adapter) 350 350 { 351 return sensors_detect(adapter,&addr_data,&foo_detect_client);351 return i2c_detect(adapter,&addr_data,&foo_detect_client); 352 352 } 353 353 … … 355 355 so you do not have to define it yourself. 356 356 357 The i2c_probe or sensors_detect function will call the foo_detect_client357 The i2c_probe or i2c_detect function will call the foo_detect_client 358 358 function only for those i2c addresses that actually have a device on 359 359 them (unless a `force' parameter was used). In addition, addresses that … … 364 364 -------------------------- 365 365 366 The detect client function is called by i2c_probe or sensors_detect.366 The detect client function is called by i2c_probe or i2c_detect. 367 367 The `kind' parameter contains 0 if this call is due to a `force' 368 parameter, and 0 otherwise (for sensors_detect, it contains 0 if368 parameter, and 0 otherwise (for i2c_detect, it contains 0 if 369 369 this call is due to the generic `force' parameter, and the chip type 370 370 number if it is due to a specific `force' parameter). … … 531 531 /* Register a new directory entry with module sensors. See below for 532 532 the `template' structure. */ 533 if ((i = sensors_register_entry(new_client, type_name,533 if ((i = i2c_register_entry(new_client, type_name, 534 534 foo_dir_table_template,THIS_MODULE)) < 0) { 535 535 err = i; … … 575 575 576 576 /* SENSORS ONLY START */ 577 /* Deregister with the ` sensors' module. */578 sensors_deregister_entry(((struct lm78_data *)(client->data))->sysctl_id);577 /* Deregister with the `i2c-proc' module. */ 578 i2c_deregister_entry(((struct lm78_data *)(client->data))->sysctl_id); 579 579 /* SENSORS ONLY END */ 580 580 … … 773 773 First, I will give an example definition. 774 774 static ctl_table foo_dir_table_template[] = { 775 { FOO_SYSCTL_FUNC1, "func1", NULL, 0, 0644, NULL, & sensors_proc_real,776 & sensors_sysctl_real,NULL,&foo_func },777 { FOO_SYSCTL_FUNC2, "func2", NULL, 0, 0644, NULL, & sensors_proc_real,778 & sensors_sysctl_real,NULL,&foo_func },779 { FOO_SYSCTL_DATA, "data", NULL, 0, 0644, NULL, & sensors_proc_real,780 & sensors_sysctl_real,NULL,&foo_data },775 { FOO_SYSCTL_FUNC1, "func1", NULL, 0, 0644, NULL, &i2c_proc_real, 776 &i2c_sysctl_real,NULL,&foo_func }, 777 { FOO_SYSCTL_FUNC2, "func2", NULL, 0, 0644, NULL, &i2c_proc_real, 778 &i2c_sysctl_real,NULL,&foo_func }, 779 { FOO_SYSCTL_DATA, "data", NULL, 0, 0644, NULL, &i2c_proc_real, 780 &i2c_sysctl_real,NULL,&foo_data }, 781 781 { 0 } 782 782 }; … … 792 792 0644 is safe, as the file will be owned by root:root. 793 793 794 The seventh and eighth parameters should be & sensors_proc_real and795 & sensors_sysctl_real if you want to export lists of reals (scaled794 The seventh and eighth parameters should be &i2c_proc_real and 795 &i2c_sysctl_real if you want to export lists of reals (scaled 796 796 integers). You can also use your own function for them, as usual. 797 797 Finally, the last parameter is the call-back to gather the data
