tda10048.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. NXP TDA10048HN DVB OFDM demodulator driver
  3. Copyright (C) 2009 Steven Toth <stoth@kernellabs.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef TDA10048_H
  17. #define TDA10048_H
  18. #include <linux/kconfig.h>
  19. #include <linux/dvb/frontend.h>
  20. #include <linux/firmware.h>
  21. struct tda10048_config {
  22. /* the demodulator's i2c address */
  23. u8 demod_address;
  24. /* serial/parallel output */
  25. #define TDA10048_PARALLEL_OUTPUT 0
  26. #define TDA10048_SERIAL_OUTPUT 1
  27. u8 output_mode;
  28. #define TDA10048_BULKWRITE_200 200
  29. #define TDA10048_BULKWRITE_50 50
  30. u8 fwbulkwritelen;
  31. /* Spectral Inversion */
  32. #define TDA10048_INVERSION_OFF 0
  33. #define TDA10048_INVERSION_ON 1
  34. u8 inversion;
  35. #define TDA10048_IF_3300 3300
  36. #define TDA10048_IF_3500 3500
  37. #define TDA10048_IF_3800 3800
  38. #define TDA10048_IF_4000 4000
  39. #define TDA10048_IF_4300 4300
  40. #define TDA10048_IF_4500 4500
  41. #define TDA10048_IF_4750 4750
  42. #define TDA10048_IF_5000 5000
  43. #define TDA10048_IF_36130 36130
  44. u16 dtv6_if_freq_khz;
  45. u16 dtv7_if_freq_khz;
  46. u16 dtv8_if_freq_khz;
  47. #define TDA10048_CLK_4000 4000
  48. #define TDA10048_CLK_16000 16000
  49. u16 clk_freq_khz;
  50. /* Disable I2C gate access */
  51. u8 disable_gate_access;
  52. bool no_firmware;
  53. bool set_pll;
  54. u8 pll_m;
  55. u8 pll_p;
  56. u8 pll_n;
  57. };
  58. #if IS_REACHABLE(CONFIG_DVB_TDA10048)
  59. extern struct dvb_frontend *tda10048_attach(
  60. const struct tda10048_config *config,
  61. struct i2c_adapter *i2c);
  62. #else
  63. static inline struct dvb_frontend *tda10048_attach(
  64. const struct tda10048_config *config,
  65. struct i2c_adapter *i2c)
  66. {
  67. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  68. return NULL;
  69. }
  70. #endif /* CONFIG_DVB_TDA10048 */
  71. #endif /* TDA10048_H */