i2c-algo-bit.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. /* $Id: i2c-algo-bit.h,v 1.10 2003/01/21 08:08:16 kmalkki Exp $ */
  20. #ifndef _LINUX_I2C_ALGO_BIT_H
  21. #define _LINUX_I2C_ALGO_BIT_H
  22. /* --- Defines for bit-adapters --------------------------------------- */
  23. /*
  24. * This struct contains the hw-dependent functions of bit-style adapters to
  25. * manipulate the line states, and to init any hw-specific features. This is
  26. * only used if you have more than one hw-type of adapter running.
  27. */
  28. struct i2c_algo_bit_data {
  29. void *data; /* private data for lowlevel routines */
  30. void (*setsda) (void *data, int state);
  31. void (*setscl) (void *data, int state);
  32. int (*getsda) (void *data);
  33. int (*getscl) (void *data);
  34. /* local settings */
  35. int udelay; /* half-clock-cycle time in microsecs */
  36. /* i.e. clock is (500 / udelay) KHz */
  37. int mdelay; /* in millisecs, unused */
  38. int timeout; /* in jiffies */
  39. };
  40. #define I2C_BIT_ADAP_MAX 16
  41. int i2c_bit_add_bus(struct i2c_adapter *);
  42. int i2c_bit_del_bus(struct i2c_adapter *);
  43. #endif /* _LINUX_I2C_ALGO_BIT_H */