mhl_i2c_utils.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Copyright (c) 2012, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef __MHL_I2C_UTILS_H__
  14. #define __MHL_I2C_UTILS_H__
  15. #include <linux/i2c.h>
  16. #include <linux/types.h>
  17. #include <linux/mhl_defs.h>
  18. /*
  19. * I2C command to the adapter to append
  20. * the buffer from next msg to this one.
  21. */
  22. #define I2C_M_APPND_NXT_WR 0x0002
  23. extern uint8_t slave_addrs[MAX_PAGES];
  24. extern struct mhl_msm_state_t *mhl_msm_state;
  25. int mhl_i2c_reg_read(uint8_t slave_addr_index, uint8_t reg_offset);
  26. int mhl_i2c_reg_write(uint8_t slave_addr_index, uint8_t reg_offset,
  27. uint8_t value);
  28. int mhl_i2c_reg_write_cmds(uint8_t slave_addr_index, uint8_t reg_offset,
  29. uint8_t *value, uint16_t count);
  30. void mhl_i2c_reg_modify(uint8_t slave_addr_index, uint8_t reg_offset,
  31. uint8_t mask, uint8_t val);
  32. #endif /* __MHL_I2C_UTILS_H__ */