via_i2c.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
  3. * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License as published by the Free Software Foundation;
  7. * either version 2, or (at your option) any later version.
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
  10. * the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. * A PARTICULAR PURPOSE.See the GNU General Public License
  12. * 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.,
  16. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #ifndef __VIA_I2C_H__
  19. #define __VIA_I2C_H__
  20. #include <linux/i2c.h>
  21. #include <linux/i2c-algo-bit.h>
  22. struct via_i2c_stuff {
  23. u16 i2c_port; /* GPIO or I2C port */
  24. u16 is_active; /* Being used as I2C? */
  25. struct i2c_adapter adapter;
  26. struct i2c_algo_bit_data algo;
  27. };
  28. int viafb_i2c_readbyte(u8 adap, u8 slave_addr, u8 index, u8 *pdata);
  29. int viafb_i2c_writebyte(u8 adap, u8 slave_addr, u8 index, u8 data);
  30. int viafb_i2c_readbytes(u8 adap, u8 slave_addr, u8 index, u8 *buff, int buff_len);
  31. struct i2c_adapter *viafb_find_i2c_adapter(enum viafb_i2c_adap which);
  32. extern int viafb_i2c_init(void);
  33. extern void viafb_i2c_exit(void);
  34. #endif /* __VIA_I2C_H__ */