si2168_priv.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Silicon Labs Si2168 DVB-T/T2/C demodulator driver
  4. *
  5. * Copyright (C) 2014 Antti Palosaari <crope@iki.fi>
  6. */
  7. #ifndef SI2168_PRIV_H
  8. #define SI2168_PRIV_H
  9. #include "si2168.h"
  10. #include <media/dvb_frontend.h>
  11. #include <linux/firmware.h>
  12. #include <linux/i2c-mux.h>
  13. #include <linux/kernel.h>
  14. #define SI2168_A20_FIRMWARE "dvb-demod-si2168-a20-01.fw"
  15. #define SI2168_A30_FIRMWARE "dvb-demod-si2168-a30-01.fw"
  16. #define SI2168_B40_FIRMWARE "dvb-demod-si2168-b40-01.fw"
  17. #define SI2168_D60_FIRMWARE "dvb-demod-si2168-d60-01.fw"
  18. #define SI2168_B40_FIRMWARE_FALLBACK "dvb-demod-si2168-02.fw"
  19. /* state struct */
  20. struct si2168_dev {
  21. struct mutex i2c_mutex;
  22. struct i2c_mux_core *muxc;
  23. struct dvb_frontend fe;
  24. enum fe_delivery_system delivery_system;
  25. enum fe_status fe_status;
  26. #define SI2168_CHIP_ID_A20 ('A' << 24 | 68 << 16 | '2' << 8 | '0' << 0)
  27. #define SI2168_CHIP_ID_A30 ('A' << 24 | 68 << 16 | '3' << 8 | '0' << 0)
  28. #define SI2168_CHIP_ID_B40 ('B' << 24 | 68 << 16 | '4' << 8 | '0' << 0)
  29. #define SI2168_CHIP_ID_D60 ('D' << 24 | 68 << 16 | '6' << 8 | '0' << 0)
  30. unsigned int chip_id;
  31. unsigned int version;
  32. const char *firmware_name;
  33. bool active;
  34. bool warm;
  35. u8 ts_mode;
  36. bool ts_clock_inv;
  37. bool ts_clock_gapped;
  38. bool spectral_inversion;
  39. };
  40. /* firmware command struct */
  41. #define SI2168_ARGLEN 30
  42. struct si2168_cmd {
  43. u8 args[SI2168_ARGLEN];
  44. unsigned wlen;
  45. unsigned rlen;
  46. };
  47. #endif