i2c-algo-bit.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* ------------------------------------------------------------------------- */
  2. /* i2c-algo-bit.h i2c driver algorithms for bit-shift adapters */
  3. /* ------------------------------------------------------------------------- */
  4. /* Copyright (C) 1995-99 Simon G. Vogl
  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. /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
  18. Frodo Looijaard <frodol@dds.nl> */
  19. #ifndef _LINUX_I2C_ALGO_BIT_H
  20. #define _LINUX_I2C_ALGO_BIT_H
  21. /* --- Defines for bit-adapters --------------------------------------- */
  22. /*
  23. * This struct contains the hw-dependent functions of bit-style adapters to
  24. * manipulate the line states, and to init any hw-specific features. This is
  25. * only used if you have more than one hw-type of adapter running.
  26. */
  27. struct i2c_algo_bit_data {
  28. void *data; /* private data for lowlevel routines */
  29. void (*setsda) (void *data, int state);
  30. void (*setscl) (void *data, int state);
  31. int (*getsda) (void *data);
  32. int (*getscl) (void *data);
  33. /* local settings */
  34. int udelay; /* half-clock-cycle time in microsecs */
  35. /* i.e. clock is (500 / udelay) KHz */
  36. int timeout; /* in jiffies */
  37. };
  38. int i2c_bit_add_bus(struct i2c_adapter *);
  39. #endif /* _LINUX_I2C_ALGO_BIT_H */