s5h1411.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. Samsung S5H1411 VSB/QAM demodulator driver
  4. Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
  5. */
  6. #ifndef __S5H1411_H__
  7. #define __S5H1411_H__
  8. #include <linux/dvb/frontend.h>
  9. #define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
  10. #define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
  11. struct s5h1411_config {
  12. /* serial/parallel output */
  13. #define S5H1411_PARALLEL_OUTPUT 0
  14. #define S5H1411_SERIAL_OUTPUT 1
  15. u8 output_mode;
  16. /* GPIO Setting */
  17. #define S5H1411_GPIO_OFF 0
  18. #define S5H1411_GPIO_ON 1
  19. u8 gpio;
  20. /* MPEG signal timing */
  21. #define S5H1411_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 0
  22. #define S5H1411_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 1
  23. #define S5H1411_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 2
  24. #define S5H1411_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
  25. u16 mpeg_timing;
  26. /* IF Freq for QAM and VSB in KHz */
  27. #define S5H1411_IF_3250 3250
  28. #define S5H1411_IF_3500 3500
  29. #define S5H1411_IF_4000 4000
  30. #define S5H1411_IF_5380 5380
  31. #define S5H1411_IF_44000 44000
  32. #define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
  33. #define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
  34. u16 qam_if;
  35. u16 vsb_if;
  36. /* Spectral Inversion */
  37. #define S5H1411_INVERSION_OFF 0
  38. #define S5H1411_INVERSION_ON 1
  39. u8 inversion;
  40. /* Return lock status based on tuner lock, or demod lock */
  41. #define S5H1411_TUNERLOCKING 0
  42. #define S5H1411_DEMODLOCKING 1
  43. u8 status_mode;
  44. };
  45. #if IS_REACHABLE(CONFIG_DVB_S5H1411)
  46. extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config,
  47. struct i2c_adapter *i2c);
  48. #else
  49. static inline struct dvb_frontend *s5h1411_attach(
  50. const struct s5h1411_config *config,
  51. struct i2c_adapter *i2c)
  52. {
  53. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  54. return NULL;
  55. }
  56. #endif /* CONFIG_DVB_S5H1411 */
  57. #endif /* __S5H1411_H__ */