i2c-dev.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #ifndef _LINUX_I2C_DEV_H
  18. #define _LINUX_I2C_DEV_H
  19. #include <linux/types.h>
  20. #include <linux/compiler.h>
  21. /* Some IOCTL commands are defined in <linux/i2c.h> */
  22. /* Note: 10-bit addresses are NOT supported! */
  23. /* This is the structure as used in the I2C_SMBUS ioctl call */
  24. struct i2c_smbus_ioctl_data {
  25. __u8 read_write;
  26. __u8 command;
  27. __u32 size;
  28. union i2c_smbus_data __user *data;
  29. };
  30. /* This is the structure as used in the I2C_RDWR ioctl call */
  31. struct i2c_rdwr_ioctl_data {
  32. struct i2c_msg __user *msgs; /* pointers to i2c_msgs */
  33. __u32 nmsgs; /* number of i2c_msgs */
  34. };
  35. #define I2C_RDRW_IOCTL_MAX_MSGS 42
  36. #endif /* _LINUX_I2C_DEV_H */