cxd2880_io.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * cxd2880_io.h
  4. * Sony CXD2880 DVB-T2/T tuner + demodulator driver
  5. * register I/O interface definitions
  6. *
  7. * Copyright (C) 2016, 2017, 2018 Sony Semiconductor Solutions Corporation
  8. */
  9. #ifndef CXD2880_IO_H
  10. #define CXD2880_IO_H
  11. #include "cxd2880_common.h"
  12. enum cxd2880_io_tgt {
  13. CXD2880_IO_TGT_SYS,
  14. CXD2880_IO_TGT_DMD
  15. };
  16. struct cxd2880_reg_value {
  17. u8 addr;
  18. u8 value;
  19. };
  20. struct cxd2880_io {
  21. int (*read_regs)(struct cxd2880_io *io,
  22. enum cxd2880_io_tgt tgt, u8 sub_address,
  23. u8 *data, u32 size);
  24. int (*write_regs)(struct cxd2880_io *io,
  25. enum cxd2880_io_tgt tgt, u8 sub_address,
  26. const u8 *data, u32 size);
  27. int (*write_reg)(struct cxd2880_io *io,
  28. enum cxd2880_io_tgt tgt, u8 sub_address,
  29. u8 data);
  30. void *if_object;
  31. u8 i2c_address_sys;
  32. u8 i2c_address_demod;
  33. u8 slave_select;
  34. void *user;
  35. };
  36. int cxd2880_io_common_write_one_reg(struct cxd2880_io *io,
  37. enum cxd2880_io_tgt tgt,
  38. u8 sub_address, u8 data);
  39. int cxd2880_io_set_reg_bits(struct cxd2880_io *io,
  40. enum cxd2880_io_tgt tgt,
  41. u8 sub_address, u8 data, u8 mask);
  42. int cxd2880_io_write_multi_regs(struct cxd2880_io *io,
  43. enum cxd2880_io_tgt tgt,
  44. const struct cxd2880_reg_value reg_value[],
  45. u8 size);
  46. #endif