tda10048.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/dvb/frontend.h>
  19. #include <linux/firmware.h>
  20. struct tda10048_config {
  21. /* the demodulator's i2c address */
  22. u8 demod_address;
  23. /* serial/parallel output */
  24. #define TDA10048_PARALLEL_OUTPUT 0
  25. #define TDA10048_SERIAL_OUTPUT 1
  26. u8 output_mode;
  27. #define TDA10048_BULKWRITE_200 200
  28. #define TDA10048_BULKWRITE_50 50
  29. u8 fwbulkwritelen;
  30. /* Spectral Inversion */
  31. #define TDA10048_INVERSION_OFF 0
  32. #define TDA10048_INVERSION_ON 1
  33. u8 inversion;
  34. #define TDA10048_IF_3300 3300
  35. #define TDA10048_IF_3500 3500
  36. #define TDA10048_IF_3800 3800
  37. #define TDA10048_IF_4000 4000
  38. #define TDA10048_IF_4300 4300
  39. #define TDA10048_IF_4500 4500
  40. #define TDA10048_IF_4750 4750
  41. #define TDA10048_IF_5000 5000
  42. #define TDA10048_IF_36130 36130
  43. u16 dtv6_if_freq_khz;
  44. u16 dtv7_if_freq_khz;
  45. u16 dtv8_if_freq_khz;
  46. #define TDA10048_CLK_4000 4000
  47. #define TDA10048_CLK_16000 16000
  48. u16 clk_freq_khz;
  49. /* Disable I2C gate access */
  50. u8 disable_gate_access;
  51. bool no_firmware;
  52. bool set_pll;
  53. u8 pll_m;
  54. u8 pll_p;
  55. u8 pll_n;
  56. };
  57. #if IS_REACHABLE(CONFIG_DVB_TDA10048)
  58. extern struct dvb_frontend *tda10048_attach(
  59. const struct tda10048_config *config,
  60. struct i2c_adapter *i2c);
  61. #else
  62. static inline struct dvb_frontend *tda10048_attach(
  63. const struct tda10048_config *config,
  64. struct i2c_adapter *i2c)
  65. {
  66. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  67. return NULL;
  68. }
  69. #endif /* CONFIG_DVB_TDA10048 */
  70. #endif /* TDA10048_H */