瀏覽代碼

[PATCH] I2C: Clarify the usage of i2c-dev.h

Upon suggestion by Nils Roeder, here is an update to the i2c
documentation to clarify which header files user-space applications
relying on the i2c-dev interface should include.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jean Delvare 20 年之前
父節點
當前提交
1d772e2587
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7 4
      Documentation/i2c/dev-interface

+ 7 - 4
Documentation/i2c/dev-interface

@@ -14,9 +14,12 @@ C example
 =========
 =========
 
 
 So let's say you want to access an i2c adapter from a C program. The
 So let's say you want to access an i2c adapter from a C program. The
-first thing to do is `#include <linux/i2c.h>" and "#include <linux/i2c-dev.h>. 
-Yes, I know, you should never include kernel header files, but until glibc 
-knows about i2c, there is not much choice.
+first thing to do is "#include <linux/i2c-dev.h>". Please note that
+there are two files named "i2c-dev.h" out there, one is distributed
+with the Linux kernel and is meant to be included from kernel
+driver code, the other one is distributed with lm_sensors and is
+meant to be included from user-space programs. You obviously want
+the second one here.
 
 
 Now, you have to decide which adapter you want to access. You should
 Now, you have to decide which adapter you want to access. You should
 inspect /sys/class/i2c-dev/ to decide this. Adapter numbers are assigned
 inspect /sys/class/i2c-dev/ to decide this. Adapter numbers are assigned
@@ -78,7 +81,7 @@ Full interface description
 ==========================
 ==========================
 
 
 The following IOCTLs are defined and fully supported 
 The following IOCTLs are defined and fully supported 
-(see also i2c-dev.h and i2c.h):
+(see also i2c-dev.h):
 
 
 ioctl(file,I2C_SLAVE,long addr)
 ioctl(file,I2C_SLAVE,long addr)
   Change slave address. The address is passed in the 7 lower bits of the
   Change slave address. The address is passed in the 7 lower bits of the