-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On January 9, 2004 06:30 am, Axel Beier wrote:

> I must look deeper in the compile-process of directfb because something
> is gone wrong on my machine. Most of directfb compiles for my (with the
> userspace headers from SuSEs glibc and a corrected videodev2.h from the
> kernelspace (2.6.0). But Im not shure due the trouble with the includes
> files (userspace/broken i2c and so on...) what is going wrong....

There's nothing actually wrong with your machine. It's just growing pains. 
SUSE backported a ton of Linux 2.6 stuff to their 2.4 kernel. The Matrox I2C 
stuff was affected. I've attached SUSE's patch that fixes this.

I should also note that I have disabled v4l2 in my DirectFB rpm.

- -- 
James Oakley
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE//t6PKtn0F7+/lLMRAsxPAKDUlR9EnjhZuezK764TCHvgxGL0jgCeKbBB
XN29Y5ZcFg298CKFcnP7Xg0=
=PFUW
-----END PGP SIGNATURE-----
--- gfxdrivers/matrox/i2c-userspace.h
+++ gfxdrivers/matrox/i2c-userspace.h
@@ -0,0 +1,66 @@
+#ifndef I2C_USERSPACE_H
+#define I2C_USERSPACE_H
+/* copied from i2c-dev.h,i2c.h */
+
+#define I2C_SLAVE       0x0703  /* Change slave address                 */
+                                /* Attn.: Slave address is 7 or 10 bits */
+#define I2C_SMBUS       0x0720  /* SMBus-level access */
+/* smbus_access read or write markers */
+#define I2C_SMBUS_READ  1
+#define I2C_SMBUS_WRITE 0
+/* SMBus transaction types (size parameter in the above functions)
+   Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
+#define I2C_SMBUS_QUICK             0
+#define I2C_SMBUS_BYTE              1
+#define I2C_SMBUS_BYTE_DATA         2
+#define I2C_SMBUS_WORD_DATA         3
+#define I2C_SMBUS_PROC_CALL         4
+#define I2C_SMBUS_BLOCK_DATA        5
+#define I2C_SMBUS_I2C_BLOCK_DATA    6
+#define I2C_SMBUS_BLOCK_PROC_CALL   7           /* SMBus 2.0 */
+#define I2C_SMBUS_BLOCK_DATA_PEC    8           /* SMBus 2.0 */
+#define I2C_SMBUS_PROC_CALL_PEC     9           /* SMBus 2.0 */
+#define I2C_SMBUS_BLOCK_PROC_CALL_PEC  10       /* SMBus 2.0 */
+#define I2C_SMBUS_WORD_DATA_PEC    11           /* SMBus 2.0 */
+
+#define I2C_SMBUS_BLOCK_MAX     32      /* As specified in SMBus standard */
+#define I2C_SMBUS_I2C_BLOCK_MAX 32      /* Not specified but we use same structure */
+
+
+union i2c_smbus_data {
+        __u8 byte;
+        __u16 word;
+        __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */
+                          /* one more for read length in block process call */
+                                                    /* and one more for PEC */
+};
+
+static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
+                                     int size, union i2c_smbus_data *data)
+{
+        struct i2c_smbus_ioctl_data args;
+
+        args.read_write = read_write;
+        args.command = command;
+        args.size = size;
+        args.data = data;
+        return ioctl(file,I2C_SMBUS,&args);
+}
+static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
+                                              __u8 value)
+{
+        union i2c_smbus_data data;
+        data.byte = value;
+        return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+                                I2C_SMBUS_BYTE_DATA, &data);
+}
+static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
+                                              __u16 value)
+{
+        union i2c_smbus_data data;
+        data.word = value;
+        return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
+                                I2C_SMBUS_WORD_DATA, &data);
+}
+
+#endif
--- gfxdrivers/matrox/matrox_maven.c
+++ gfxdrivers/matrox/matrox_maven.c
@@ -29,7 +29,11 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <linux/compiler.h>
 #include <linux/i2c-dev.h>
+#ifndef I2C_SLAVE
+#include "i2c-userspace.h"
+#endif
 
 #include <misc/util.h>
 

Reply via email to