s5h1432.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Samsung s5h1432 VSB/QAM demodulator driver
  4. *
  5. * Copyright (C) 2009 Bill Liu <[email protected]>
  6. */
  7. #ifndef __S5H1432_H__
  8. #define __S5H1432_H__
  9. #include <linux/dvb/frontend.h>
  10. #define S5H1432_I2C_TOP_ADDR (0x02 >> 1)
  11. #define TAIWAN_HI_IF_FREQ_44_MHZ 44000000
  12. #define EUROPE_HI_IF_FREQ_36_MHZ 36000000
  13. #define IF_FREQ_6_MHZ 6000000
  14. #define IF_FREQ_3point3_MHZ 3300000
  15. #define IF_FREQ_3point5_MHZ 3500000
  16. #define IF_FREQ_4_MHZ 4000000
  17. struct s5h1432_config {
  18. /* serial/parallel output */
  19. #define S5H1432_PARALLEL_OUTPUT 0
  20. #define S5H1432_SERIAL_OUTPUT 1
  21. u8 output_mode;
  22. /* GPIO Setting */
  23. #define S5H1432_GPIO_OFF 0
  24. #define S5H1432_GPIO_ON 1
  25. u8 gpio;
  26. /* MPEG signal timing */
  27. #define S5H1432_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 0
  28. #define S5H1432_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 1
  29. #define S5H1432_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 2
  30. #define S5H1432_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
  31. u16 mpeg_timing;
  32. /* IF Freq for QAM and VSB in KHz */
  33. #define S5H1432_IF_3250 3250
  34. #define S5H1432_IF_3500 3500
  35. #define S5H1432_IF_4000 4000
  36. #define S5H1432_IF_5380 5380
  37. #define S5H1432_IF_44000 44000
  38. #define S5H1432_VSB_IF_DEFAULT s5h1432_IF_44000
  39. #define S5H1432_QAM_IF_DEFAULT s5h1432_IF_44000
  40. u16 qam_if;
  41. u16 vsb_if;
  42. /* Spectral Inversion */
  43. #define S5H1432_INVERSION_OFF 0
  44. #define S5H1432_INVERSION_ON 1
  45. u8 inversion;
  46. /* Return lock status based on tuner lock, or demod lock */
  47. #define S5H1432_TUNERLOCKING 0
  48. #define S5H1432_DEMODLOCKING 1
  49. u8 status_mode;
  50. };
  51. #if IS_REACHABLE(CONFIG_DVB_S5H1432)
  52. extern struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
  53. struct i2c_adapter *i2c);
  54. #else
  55. static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config
  56. *config,
  57. struct i2c_adapter *i2c)
  58. {
  59. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  60. return NULL;
  61. }
  62. #endif /* CONFIG_DVB_s5h1432 */
  63. #endif /* __s5h1432_H__ */