proc-interface
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. i2c-core is the core i2c module (surprise!) which offers general routines on
  2. which other modules build. You will find that all i2c-related modules depend
  3. on this module, so it will (need to) be loaded whenever another i2c-related 
  4. module is loaded. Seen from the outside, the most interesting is the /proc 
  5. interface. Note that there is no corresponding sysctl interface!
  6. /proc/bus/i2c
  7. =============
  8. Whenever i2c-core is loaded, you will find a file /proc/bus/i2c, which lists
  9. all currently registered I2C adapters. Each line contains exactly one
  10. I2C adapter. Each line has the following format: "i2c-%dt%9st%-32s't%-32sn",
  11. which works out to four columns separated by tabs. Note that the file
  12. will be empty, if no adapters are registered at all.
  13. Adapters are numbered from 0 upwards. The first column contains the number
  14. of the adapter, for example "i2c-4" for adapter 4. The name listed is also
  15. the name of the /proc file which lists all devices attached to it, and
  16. of the /dev file which corresponds to this adapter.
  17. The second column documents what kind of adapter this is. Some adapters
  18. understand the full I2C protocol, others only a subset called SMBus,
  19. and yet others are some kind of pseudo-adapters that do not understand
  20. i2c at all. Possible values in here are "i2c", "smbus", "i2c/smbus"
  21. and "dummy". Because the SMBus protocol can be fully emulated by i2c
  22. adapters, if you see "i2c" here, SMBus is supported too. There may
  23. be some future adapters which support both specific SMBus commands and
  24. general I2C, and they will display "i2c/smbus".
  25. The third and fourth column are respectively the algorithm and adapter
  26. name of this adapter. Each adapter is associated with an algorithm,
  27. and several adapters can share the same algorithm. The combination of
  28. algorithm name and adapter name should be unique for an adapter, but
  29. you can't really count on that yet.
  30. /proc/bus/i2c-*
  31. ===============
  32. Each registered adapter gets its own file in /proc/bus/, which lists
  33. the devices registered to the adapter. Each line in such a file contains
  34. one registered device. Each line has the following format:
  35. "%02xt%-32st%-32sn", which works out to three columns separated by
  36. tabs. Note that this file can be empty, if no devices are found on 
  37. the adapter.
  38. The first column contains the (hexadecimal) address of the client. As 
  39. only 7-bit addresses are supported at this moment, two digits are
  40. enough. 
  41. The second and third column are respectively the client name and the
  42. driver name of this client. Each client is associated with a driver,
  43. and several clients can share the same driver.