rtl2832.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Realtek RTL2832 DVB-T demodulator driver
  3. *
  4. * Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
  5. * Copyright (C) 2012-2014 Antti Palosaari <crope@iki.fi>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. */
  21. #ifndef RTL2832_H
  22. #define RTL2832_H
  23. #include <linux/dvb/frontend.h>
  24. #include <linux/i2c-mux.h>
  25. /**
  26. * struct rtl2832_platform_data - Platform data for the rtl2832 driver
  27. * @clk: Clock frequency (4000000, 16000000, 25000000, 28800000).
  28. * @tuner: Used tuner model.
  29. * @get_dvb_frontend: Get DVB frontend.
  30. * @get_i2c_adapter: Get I2C adapter.
  31. * @enable_slave_ts: Enable slave TS IF.
  32. * @pid_filter: Set PID to PID filter.
  33. * @pid_filter_ctrl: Control PID filter.
  34. */
  35. struct rtl2832_platform_data {
  36. u32 clk;
  37. /*
  38. * XXX: This list must be kept sync with dvb_usb_rtl28xxu USB IF driver.
  39. */
  40. #define RTL2832_TUNER_FC2580 0x21
  41. #define RTL2832_TUNER_TUA9001 0x24
  42. #define RTL2832_TUNER_FC0012 0x26
  43. #define RTL2832_TUNER_E4000 0x27
  44. #define RTL2832_TUNER_FC0013 0x29
  45. #define RTL2832_TUNER_R820T 0x2a
  46. #define RTL2832_TUNER_R828D 0x2b
  47. #define RTL2832_TUNER_SI2157 0x2c
  48. u8 tuner;
  49. struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
  50. struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *);
  51. int (*enable_slave_ts)(struct i2c_client *);
  52. int (*pid_filter)(struct dvb_frontend *, u8, u16, int);
  53. int (*pid_filter_ctrl)(struct dvb_frontend *, int);
  54. /* private: Register access for SDR module use only */
  55. int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t);
  56. int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t);
  57. int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int);
  58. };
  59. #endif /* RTL2832_H */