Show
Ignore:
Timestamp:
12/08/03 00:44:59 (10 years ago)
Author:
mds
Message:

2.6 update

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/doc/developers/applications

    r1302 r2142  
    1111        1) Character device access to the i2c bus driver 
    1212           via /dev/i2c-x 
    13         2) I2C bus access functions as defined in <linux/i2c-dev.h> 
    14         3) /proc access to the chip device driver 
     13        2) I2C bus access functions as defined in kernel/include/i2c-dev.h 
     14        3A) /proc access to the chip device driver 
     15        3B) sysfs access to the chip device driver 
    1516        4) libsensors library 
     17        5) sensors program 
    1618 
    1719 
     
    2729 
    2830   This method does not use a chip device driver at all. 
     31   However it does require the i2c-dev module. 
    2932   The driver must set an individual chip address on the bus via 
    3033   an ioctl, so it must use locking if multiple devices on the 
     
    38412. Direct /dev access using inline functions 
    3942-------------------------------------------- 
    40    I2C bus access inline functions as defined in <linux/i2c-dev.h> 
     43   I2C bus access inline functions as defined in kernel/include/i2c-dev.h, 
    4144   and in doc/dev-interface in the i2c package or 
    4245   Documentation/i2c/dev-interface in the linux kernel sources. 
     46   Note that these used to be defined in <linux/i2c-dev.h> in the kernel 
     47   source tree. However, userspace applications are not supposed to      
     48   include kernel headers, so the inline functions were removed from 
     49   the kernel file in recent kernels. Use the header file in this package 
     50   instead. 
    4351 
    4452   This method does not use a chip device driver at all. 
     53   However it does require the i2c-dev module. 
    4554   The driver must set an individual chip address on the bus via 
    4655   an ioctl, so it must use locking if multiple devices on the 
     
    5261 
    5362 
    54 3. /proc access 
    55 --------------- 
     633A. /proc access (2.4 kernels) 
     64----------------------------- 
    5665   Chip drivers using the i2c-proc module create subdirectories in 
    5766   /proc/sys/dev/sensors which can be accessed directly by applications. 
    5867   Naming and content standards for the entries in these subdirectories 
    5968   is documented in the file doc/developers/proc. Note that these 
    60    standards are only loosely followed. 
     69   standards may not be strictly followed. 
    6170 
    6271   If a new driver adheres to these standards then an application may 
     
    7988   For examples of programs using /proc accesses, see 
    8089   prog/eeprom/decode-dimms.pl, prog/matorb/displayit.pl, 
    81    prog/maxilife/writelcd.sh, prog/rrd/sens_update_rrd. 
     90   prog/maxilife/writelcd.sh, prog/rrd/sens_update_rrd, 
     91   prog/pwm/fancontrol, and prog/pwm/pwmconfig. 
    8292   Also search freshmeat for sensors applications. 
     93 
     94 
     953B. sysfs access (2.6 kernels) 
     96------------------------------ 
     97   Chip drivers using the i2c-sensor module create subdirectories in 
     98   the sysfs filesystem (usually /sys) which can be accessed 
     99   directly by applications. 
     100   Naming and content standards for the entries in these subdirectories 
     101   is documented in the file Documentation/i2c/sysfs-interface in the 
     102   2.6 kernel source tree. Note that these standards may not be 
     103   strictly followed. 
     104 
     105   If a new driver adheres to these standards then an application may 
     106   be able to support new devices on-the-fly. 
     107 
     108   sysfs access provides a method to read and write sensor values 
     109   for any driver using i2c-sensor, including ISA chip drivers. 
     110 
     111   This method may also works well for shell and perl scripts 
     112   written to access a specific device. Note that sysfs is 
     113   standard in 2.6 kernels. 
     114 
     115   Note that most drivers provide only raw sensor readings via /sys; 
     116   many readings must be scaled or adjusted, and these adjustments 
     117   must often be changed by the user. An application using /proc must 
     118   generally provide adjustment facilities and the requirements 
     119   of the adjustments can be quite complex. If you need adjustment 
     120   facilities, consider the libsensors library, below. 
     121 
     122   For an examples of a program using /sys accesses, see gkrellm. 
     123   See also lib/proc.c and prog/dump/i2cbusses.c for examples. 
     124   The sysfsutils package may also be helpful. 
     125   Also search freshmeat for sensors and sysfs applications. 
    83126 
    84127 
     
    90133   provided by the user. Other facilities are sensor renaming, limit setting, 
    91134   and ignoring individual sensors. 
     135   The libsensors library supports both 2.4 and 2.6 kernels. 
    92136 
    93    Unfortunately there is no documentation for libsensors. See the 
     137   Unfortunately there is little documentation for libsensors. See the 
    94138   'sensors' application in prog/sensors for an example. The source 
    95139   for libsensors is in the lib/ directory. Another example 
     
    104148   does not fall under the GPL. This may or may not be changed in the future. 
    105149   Contact us if you wish to discuss your application. 
     150 
     151   For an examples of a program using libsensors accesses, see 
     152   prog/sensors/sensors. Also search freshmeat for sensors applications. 
     153 
     1545. sensors program 
     155------------------ 
     156   The 'sensors' program is a text-based application that uses libsensors. 
     157   The output is fairly standardized; therefore this output could be 
     158   used by other applications. 
     159   One simple method is 'sensors|grep ALARM'.