linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.0-test11: i2c-dev.h for userspace
@ 2003-12-12 14:56 Johannes Stezenbach
  2003-12-12 17:56 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Stezenbach @ 2003-12-12 14:56 UTC (permalink / raw)
  To: sensors; +Cc: Greg KH, linux-kernel

Hi,

I had some trouble compiling a userspace application
which uses the I2C device interface (the DirectFB
Matrox driver). Apparently some stuff has been removed
from i2c-dev.h, and Documentation/i2c/dev-interface is
out of date. I'm using Debian unstable (where glibc is
built with kernel 2.6 headers).

The patch below puts back some "#if __KERNEL__" conditionals
so i2c.h can be included without errors in userspace progams.

Regards,
Johannes



--- linux-2.6.0-test11-bk8/include/linux/i2c.h.orig	2003-12-12 15:19:12.000000000 +0100
+++ linux-2.6.0-test11-bk8/include/linux/i2c.h	2003-12-12 15:19:37.000000000 +0100
@@ -28,21 +28,26 @@
 #ifndef _LINUX_I2C_H
 #define _LINUX_I2C_H
 
+#ifdef __KERNEL__
 #include <linux/module.h>
-#include <linux/types.h>
-#include <linux/i2c-id.h>
 #include <linux/device.h>	/* for struct device */
 #include <asm/semaphore.h>
+#endif
+#include <linux/types.h>
+#include <linux/i2c-id.h>
 
 /* --- General options ------------------------------------------------	*/
 
 struct i2c_msg;
+union i2c_smbus_data;
+
+#ifdef __KERNEL__
+
 struct i2c_algorithm;
 struct i2c_adapter;
 struct i2c_client;
 struct i2c_driver;
 struct i2c_client_address_data;
-union i2c_smbus_data;
 
 /*
  * The master routines are the ones normally used to transmit data to devices
@@ -384,6 +389,7 @@
 
 /* Return 1 if adapter supports everything we need, 0 if not. */
 extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func);
+#endif /* #if __KERNEL__ */
 
 /*
  * I2C Message - used for pure i2c transaction, also from /dev interface
@@ -530,6 +536,8 @@
 				/* written byte (except address)	*/
 #define I2C_MDELAY	0x0706	/* millisec delay between written bytes */
 
+
+#ifdef __KERNEL__
 /* ----- I2C-DEV: char device interface stuff ------------------------- */
 
 #define I2C_MAJOR	89		/* Device major number		*/
@@ -605,5 +613,6 @@
 	set_current_state(TASK_INTERRUPTIBLE);
 	schedule_timeout(timeout);
 }
+#endif /* #if __KERNEL__ */
 
 #endif /* _LINUX_I2C_H */
--- linux-2.6.0-test11-bk8/include/linux/i2c-dev.h.orig	2003-12-12 15:19:17.000000000 +0100
+++ linux-2.6.0-test11-bk8/include/linux/i2c-dev.h	2003-12-12 15:19:37.000000000 +0100
@@ -25,6 +25,7 @@
 #define _LINUX_I2C_DEV_H
 
 #include <linux/types.h>
+#include <linux/compiler.h>
 
 /* Some IOCTL commands are defined in <linux/i2c.h> */
 /* Note: 10-bit addresses are NOT supported! */

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-14  2:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-12 14:56 2.6.0-test11: i2c-dev.h for userspace Johannes Stezenbach
2003-12-12 17:56 ` Greg KH
2003-12-12 18:53   ` Johannes Stezenbach
2003-12-12 19:01     ` Greg KH
2003-12-12 19:21       ` Johannes Stezenbach
2003-12-12 19:45         ` Greg KH
2003-12-14  1:57       ` bill davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).