- Timestamp:
- 06/27/07 10:42:40 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/doc/developers/applications
r4480 r4484 12 12 via /dev/i2c-x 13 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 14 3) sysfs access to the chip device driver 16 15 4) libsensors library 17 16 5) sensors program … … 61 60 62 61 63 3A. /proc access (2.4 kernels) 64 ----------------------------- 65 Chip drivers using the i2c-proc module create subdirectories in 66 /proc/sys/dev/sensors which can be accessed directly by applications. 67 Naming and content standards for the entries in these subdirectories 68 is documented in the file doc/developers/proc. Note that these 69 standards may not be strictly followed. 70 71 If a new driver adheres to these standards then an application may 72 be able to support new devices on-the-fly. 73 74 /proc access provides a method to read and write sensor values 75 for any driver using i2c-proc, including ISA chip drivers. 76 77 This method also works well for shell and perl scripts 78 written to access a specific device. Note that i2c-proc is 79 standard in the kernel as of kernel 2.4.13. 80 81 Note that most drivers provide only raw sensor readings via /proc; 82 many readings must be scaled or adjusted, and these adjustments 83 must often be changed by the user. An application using /proc must 84 generally provide adjustment facilities and the requirements 85 of the adjustments can be quite complex. If you need adjustment 86 facilities, consider the libsensors library, below. 87 88 For examples of programs using /proc accesses, see 89 prog/eeprom/decode-dimms.pl, prog/matorb/displayit.pl, 90 prog/maxilife/writelcd.sh, prog/rrd/sens_update_rrd, 91 prog/pwm/fancontrol, and prog/pwm/pwmconfig. 92 Also search freshmeat for sensors applications. 93 94 95 3B. sysfs access (2.6 kernels) 96 ------------------------------ 62 3. sysfs access 63 --------------- 97 64 Chip drivers using the i2c-sensor module create subdirectories in 98 65 the sysfs filesystem (usually /sys) which can be accessed … … 107 74 108 75 sysfs access provides a method to read and write sensor values 109 for any driver using i2c-sensor, including ISA chip drivers.76 for any driver, including ISA chip drivers. 110 77 111 78 This method may also works well for shell and perl scripts … … 115 82 Note that most drivers provide only raw sensor readings via /sys; 116 83 many readings must be scaled or adjusted, and these adjustments 117 must often be changed by the user. An application using / procmust84 must often be changed by the user. An application using /sys must 118 85 generally provide adjustment facilities and the requirements 119 86 of the adjustments can be quite complex. If you need adjustment … … 121 88 122 89 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.90 See also lib/proc.c and i2cbusses.c (in the i2c-tools package) for 91 examples. The sysfsutils package may also be helpful. 125 92 Also search freshmeat for sensors and sysfs applications. 126 93
