i2c-dev.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. i2c-dev.h - i2c-bus driver, char device interface
  3. Copyright (C) 1995-97 Simon G. Vogl
  4. Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. /* $Id: i2c-dev.h,v 1.13 2003/01/21 08:08:16 kmalkki Exp $ */
  18. #ifndef _LINUX_I2C_DEV_H
  19. #define _LINUX_I2C_DEV_H
  20. #include <linux/types.h>
  21. #include <linux/compiler.h>
  22. /* Some IOCTL commands are defined in <linux/i2c.h> */
  23. /* Note: 10-bit addresses are NOT supported! */
  24. /* This is the structure as used in the I2C_SMBUS ioctl call */
  25. struct i2c_smbus_ioctl_data {
  26. __u8 read_write;
  27. __u8 command;
  28. __u32 size;
  29. union i2c_smbus_data __user *data;
  30. };
  31. /* This is the structure as used in the I2C_RDWR ioctl call */
  32. struct i2c_rdwr_ioctl_data {
  33. struct i2c_msg __user *msgs; /* pointers to i2c_msgs */
  34. __u32 nmsgs; /* number of i2c_msgs */
  35. };
  36. #define I2C_RDRW_IOCTL_MAX_MSGS 42
  37. #endif /* _LINUX_I2C_DEV_H */