tda1002x.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. TDA10021/TDA10023 - Single Chip Cable Channel Receiver driver module
  4. used on the Siemens DVB-C cards
  5. Copyright (C) 1999 Convergence Integrated Media GmbH <[email protected]>
  6. Copyright (C) 2004 Markus Schulz <[email protected]>
  7. Support for TDA10021
  8. */
  9. #ifndef TDA1002x_H
  10. #define TDA1002x_H
  11. #include <linux/dvb/frontend.h>
  12. struct tda1002x_config {
  13. /* the demodulator's i2c address */
  14. u8 demod_address;
  15. u8 invert;
  16. };
  17. enum tda10023_output_mode {
  18. TDA10023_OUTPUT_MODE_PARALLEL_A = 0xe0,
  19. TDA10023_OUTPUT_MODE_PARALLEL_B = 0xa1,
  20. TDA10023_OUTPUT_MODE_PARALLEL_C = 0xa0,
  21. TDA10023_OUTPUT_MODE_SERIAL, /* TODO: not implemented */
  22. };
  23. struct tda10023_config {
  24. /* the demodulator's i2c address */
  25. u8 demod_address;
  26. u8 invert;
  27. /* clock settings */
  28. u32 xtal; /* defaults: 28920000 */
  29. u8 pll_m; /* defaults: 8 */
  30. u8 pll_p; /* defaults: 4 */
  31. u8 pll_n; /* defaults: 1 */
  32. /* MPEG2 TS output mode */
  33. u8 output_mode;
  34. /* input freq offset + baseband conversion type */
  35. u16 deltaf;
  36. };
  37. #if IS_REACHABLE(CONFIG_DVB_TDA10021)
  38. extern struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
  39. struct i2c_adapter* i2c, u8 pwm);
  40. #else
  41. static inline struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
  42. struct i2c_adapter* i2c, u8 pwm)
  43. {
  44. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  45. return NULL;
  46. }
  47. #endif // CONFIG_DVB_TDA10021
  48. #if IS_REACHABLE(CONFIG_DVB_TDA10023)
  49. extern struct dvb_frontend *tda10023_attach(
  50. const struct tda10023_config *config,
  51. struct i2c_adapter *i2c, u8 pwm);
  52. #else
  53. static inline struct dvb_frontend *tda10023_attach(
  54. const struct tda10023_config *config,
  55. struct i2c_adapter *i2c, u8 pwm)
  56. {
  57. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  58. return NULL;
  59. }
  60. #endif // CONFIG_DVB_TDA10023
  61. #endif // TDA1002x_H