s5h1432.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Samsung s5h1432 VSB/QAM demodulator driver
  3. *
  4. * Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #ifndef __S5H1432_H__
  18. #define __S5H1432_H__
  19. #include <linux/dvb/frontend.h>
  20. #define S5H1432_I2C_TOP_ADDR (0x02 >> 1)
  21. #define TAIWAN_HI_IF_FREQ_44_MHZ 44000000
  22. #define EUROPE_HI_IF_FREQ_36_MHZ 36000000
  23. #define IF_FREQ_6_MHZ 6000000
  24. #define IF_FREQ_3point3_MHZ 3300000
  25. #define IF_FREQ_3point5_MHZ 3500000
  26. #define IF_FREQ_4_MHZ 4000000
  27. struct s5h1432_config {
  28. /* serial/parallel output */
  29. #define S5H1432_PARALLEL_OUTPUT 0
  30. #define S5H1432_SERIAL_OUTPUT 1
  31. u8 output_mode;
  32. /* GPIO Setting */
  33. #define S5H1432_GPIO_OFF 0
  34. #define S5H1432_GPIO_ON 1
  35. u8 gpio;
  36. /* MPEG signal timing */
  37. #define S5H1432_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 0
  38. #define S5H1432_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 1
  39. #define S5H1432_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 2
  40. #define S5H1432_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
  41. u16 mpeg_timing;
  42. /* IF Freq for QAM and VSB in KHz */
  43. #define S5H1432_IF_3250 3250
  44. #define S5H1432_IF_3500 3500
  45. #define S5H1432_IF_4000 4000
  46. #define S5H1432_IF_5380 5380
  47. #define S5H1432_IF_44000 44000
  48. #define S5H1432_VSB_IF_DEFAULT s5h1432_IF_44000
  49. #define S5H1432_QAM_IF_DEFAULT s5h1432_IF_44000
  50. u16 qam_if;
  51. u16 vsb_if;
  52. /* Spectral Inversion */
  53. #define S5H1432_INVERSION_OFF 0
  54. #define S5H1432_INVERSION_ON 1
  55. u8 inversion;
  56. /* Return lock status based on tuner lock, or demod lock */
  57. #define S5H1432_TUNERLOCKING 0
  58. #define S5H1432_DEMODLOCKING 1
  59. u8 status_mode;
  60. };
  61. #if IS_REACHABLE(CONFIG_DVB_S5H1432)
  62. extern struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
  63. struct i2c_adapter *i2c);
  64. #else
  65. static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config
  66. *config,
  67. struct i2c_adapter *i2c)
  68. {
  69. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  70. return NULL;
  71. }
  72. #endif /* CONFIG_DVB_s5h1432 */
  73. #endif /* __s5h1432_H__ */