Changeset 3556

Show
Ignore:
Timestamp:
06/30/01 21:03:27 (7 years ago)
Author:
mds
Message:

updates for the sensors_* to i2c_* conversion in i2c-proc.c.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • i2c/trunk/doc/writing-clients

    r3530 r3556  
    191191 
    192192You 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. 
     193function i2c_probe() (or i2c_detect()) if you don't. 
    194194 
    195195NOTE: If you want to write a `sensors' driver, the interface is slightly 
     
    345345  } 
    346346 
    347 For `sensors' drivers, use the sensors_detect function instead: 
     347For `sensors' drivers, use the i2c_detect function instead: 
    348348   
    349349  int foo_attach_adapter(struct i2c_adapter *adapter) 
    350350  {  
    351     return sensors_detect(adapter,&addr_data,&foo_detect_client); 
     351    return i2c_detect(adapter,&addr_data,&foo_detect_client); 
    352352  } 
    353353 
     
    355355so you do not have to define it yourself. 
    356356 
    357 The i2c_probe or sensors_detect function will call the foo_detect_client 
     357The i2c_probe or i2c_detect function will call the foo_detect_client 
    358358function only for those i2c addresses that actually have a device on 
    359359them (unless a `force' parameter was used). In addition, addresses that 
     
    364364-------------------------- 
    365365 
    366 The detect client function is called by i2c_probe or sensors_detect. 
     366The detect client function is called by i2c_probe or i2c_detect. 
    367367The `kind' parameter contains 0 if this call is due to a `force' 
    368 parameter, and 0 otherwise (for sensors_detect, it contains 0 if 
     368parameter, and 0 otherwise (for i2c_detect, it contains 0 if 
    369369this call is due to the generic `force' parameter, and the chip type 
    370370number if it is due to a specific `force' parameter). 
     
    531531    /* Register a new directory entry with module sensors. See below for 
    532532       the `template' structure. */ 
    533     if ((i = sensors_register_entry(new_client, type_name, 
     533    if ((i = i2c_register_entry(new_client, type_name, 
    534534                                    foo_dir_table_template,THIS_MODULE)) < 0) { 
    535535      err = i; 
     
    575575 
    576576    /* 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); 
    579579    /* SENSORS ONLY END */ 
    580580 
     
    773773First, I will give an example definition. 
    774774  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 }, 
    781781    { 0 } 
    782782  }; 
     
    7927920644 is safe, as the file will be owned by root:root.  
    793793 
    794 The seventh and eighth parameters should be &sensors_proc_real and 
    795 &sensors_sysctl_real if you want to export lists of reals (scaled 
     794The seventh and eighth parameters should be &i2c_proc_real and 
     795&i2c_sysctl_real if you want to export lists of reals (scaled 
    796796integers). You can also use your own function for them, as usual. 
    797797Finally, the last parameter is the call-back to gather the data