s5h1409.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. Samsung S5H1409 VSB/QAM demodulator driver
  4. Copyright (C) 2006 Steven Toth <stoth@linuxtv.org>
  5. */
  6. #ifndef __S5H1409_H__
  7. #define __S5H1409_H__
  8. #include <linux/dvb/frontend.h>
  9. struct s5h1409_config {
  10. /* the demodulator's i2c address */
  11. u8 demod_address;
  12. /* serial/parallel output */
  13. #define S5H1409_PARALLEL_OUTPUT 0
  14. #define S5H1409_SERIAL_OUTPUT 1
  15. u8 output_mode;
  16. /* GPIO Setting */
  17. #define S5H1409_GPIO_OFF 0
  18. #define S5H1409_GPIO_ON 1
  19. u8 gpio;
  20. /* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */
  21. u16 qam_if;
  22. /* Spectral Inversion */
  23. #define S5H1409_INVERSION_OFF 0
  24. #define S5H1409_INVERSION_ON 1
  25. u8 inversion;
  26. /* Return lock status based on tuner lock, or demod lock */
  27. #define S5H1409_TUNERLOCKING 0
  28. #define S5H1409_DEMODLOCKING 1
  29. u8 status_mode;
  30. /* MPEG signal timing */
  31. #define S5H1409_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 0
  32. #define S5H1409_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 1
  33. #define S5H1409_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 2
  34. #define S5H1409_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
  35. u16 mpeg_timing;
  36. /* HVR-1600 optimizations (to better work with MXL5005s)
  37. Note: some of these are likely to be folded into the generic driver
  38. after being regression tested with other boards */
  39. #define S5H1409_HVR1600_NOOPTIMIZE 0
  40. #define S5H1409_HVR1600_OPTIMIZE 1
  41. u8 hvr1600_opt;
  42. };
  43. #if IS_REACHABLE(CONFIG_DVB_S5H1409)
  44. extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config,
  45. struct i2c_adapter *i2c);
  46. #else
  47. static inline struct dvb_frontend *s5h1409_attach(
  48. const struct s5h1409_config *config,
  49. struct i2c_adapter *i2c)
  50. {
  51. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  52. return NULL;
  53. }
  54. #endif /* CONFIG_DVB_S5H1409 */
  55. #endif /* __S5H1409_H__ */