tda10071_priv.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * NXP TDA10071 + Conexant CX24118A DVB-S/S2 demodulator + tuner driver
  4. *
  5. * Copyright (C) 2011 Antti Palosaari <crope@iki.fi>
  6. */
  7. #ifndef TDA10071_PRIV
  8. #define TDA10071_PRIV
  9. #include <media/dvb_frontend.h>
  10. #include "tda10071.h"
  11. #include <linux/firmware.h>
  12. #include <linux/regmap.h>
  13. struct tda10071_dev {
  14. struct dvb_frontend fe;
  15. struct i2c_client *client;
  16. struct regmap *regmap;
  17. struct mutex cmd_execute_mutex;
  18. u32 clk;
  19. u16 i2c_wr_max;
  20. u8 ts_mode;
  21. bool spec_inv;
  22. u8 pll_multiplier;
  23. u8 tuner_i2c_addr;
  24. u8 meas_count;
  25. u32 dvbv3_ber;
  26. enum fe_status fe_status;
  27. enum fe_delivery_system delivery_system;
  28. bool warm; /* FW running */
  29. u64 post_bit_error;
  30. u64 block_error;
  31. };
  32. static struct tda10071_modcod {
  33. enum fe_delivery_system delivery_system;
  34. enum fe_modulation modulation;
  35. enum fe_code_rate fec;
  36. u8 val;
  37. } TDA10071_MODCOD[] = {
  38. /* NBC-QPSK */
  39. { SYS_DVBS2, QPSK, FEC_AUTO, 0x00 },
  40. { SYS_DVBS2, QPSK, FEC_1_2, 0x04 },
  41. { SYS_DVBS2, QPSK, FEC_3_5, 0x05 },
  42. { SYS_DVBS2, QPSK, FEC_2_3, 0x06 },
  43. { SYS_DVBS2, QPSK, FEC_3_4, 0x07 },
  44. { SYS_DVBS2, QPSK, FEC_4_5, 0x08 },
  45. { SYS_DVBS2, QPSK, FEC_5_6, 0x09 },
  46. { SYS_DVBS2, QPSK, FEC_8_9, 0x0a },
  47. { SYS_DVBS2, QPSK, FEC_9_10, 0x0b },
  48. /* 8PSK */
  49. { SYS_DVBS2, PSK_8, FEC_AUTO, 0x00 },
  50. { SYS_DVBS2, PSK_8, FEC_3_5, 0x0c },
  51. { SYS_DVBS2, PSK_8, FEC_2_3, 0x0d },
  52. { SYS_DVBS2, PSK_8, FEC_3_4, 0x0e },
  53. { SYS_DVBS2, PSK_8, FEC_5_6, 0x0f },
  54. { SYS_DVBS2, PSK_8, FEC_8_9, 0x10 },
  55. { SYS_DVBS2, PSK_8, FEC_9_10, 0x11 },
  56. /* QPSK */
  57. { SYS_DVBS, QPSK, FEC_AUTO, 0x2d },
  58. { SYS_DVBS, QPSK, FEC_1_2, 0x2e },
  59. { SYS_DVBS, QPSK, FEC_2_3, 0x2f },
  60. { SYS_DVBS, QPSK, FEC_3_4, 0x30 },
  61. { SYS_DVBS, QPSK, FEC_5_6, 0x31 },
  62. { SYS_DVBS, QPSK, FEC_7_8, 0x32 },
  63. };
  64. struct tda10071_reg_val_mask {
  65. u8 reg;
  66. u8 val;
  67. u8 mask;
  68. };
  69. /* firmware filename */
  70. #define TDA10071_FIRMWARE "dvb-fe-tda10071.fw"
  71. /* firmware commands */
  72. #define CMD_DEMOD_INIT 0x10
  73. #define CMD_CHANGE_CHANNEL 0x11
  74. #define CMD_MPEG_CONFIG 0x13
  75. #define CMD_TUNER_INIT 0x15
  76. #define CMD_GET_AGCACC 0x1a
  77. #define CMD_LNB_CONFIG 0x20
  78. #define CMD_LNB_SEND_DISEQC 0x21
  79. #define CMD_LNB_SET_DC_LEVEL 0x22
  80. #define CMD_LNB_PCB_CONFIG 0x23
  81. #define CMD_LNB_SEND_TONEBURST 0x24
  82. #define CMD_LNB_UPDATE_REPLY 0x25
  83. #define CMD_GET_FW_VERSION 0x35
  84. #define CMD_SET_SLEEP_MODE 0x36
  85. #define CMD_BER_CONTROL 0x3e
  86. #define CMD_BER_UPDATE_COUNTERS 0x3f
  87. /* firmware command struct */
  88. #define TDA10071_ARGLEN 30
  89. struct tda10071_cmd {
  90. u8 args[TDA10071_ARGLEN];
  91. u8 len;
  92. };
  93. #endif /* TDA10071_PRIV */