s5h1432.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. Samsung s5h1432 VSB/QAM demodulator driver
  3. Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef __S5H1432_H__
  17. #define __S5H1432_H__
  18. #include <linux/dvb/frontend.h>
  19. #define S5H1432_I2C_TOP_ADDR (0x02 >> 1)
  20. #define TAIWAN_HI_IF_FREQ_44_MHZ 44000000
  21. #define EUROPE_HI_IF_FREQ_36_MHZ 36000000
  22. #define IF_FREQ_6_MHZ 6000000
  23. #define IF_FREQ_3point3_MHZ 3300000
  24. #define IF_FREQ_3point5_MHZ 3500000
  25. #define IF_FREQ_4_MHZ 4000000
  26. struct s5h1432_config {
  27. /* serial/parallel output */
  28. #define S5H1432_PARALLEL_OUTPUT 0
  29. #define S5H1432_SERIAL_OUTPUT 1
  30. u8 output_mode;
  31. /* GPIO Setting */
  32. #define S5H1432_GPIO_OFF 0
  33. #define S5H1432_GPIO_ON 1
  34. u8 gpio;
  35. /* MPEG signal timing */
  36. #define S5H1432_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0
  37. #define S5H1432_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1
  38. #define S5H1432_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2
  39. #define S5H1432_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
  40. u16 mpeg_timing;
  41. /* IF Freq for QAM and VSB in KHz */
  42. #define S5H1432_IF_3250 3250
  43. #define S5H1432_IF_3500 3500
  44. #define S5H1432_IF_4000 4000
  45. #define S5H1432_IF_5380 5380
  46. #define S5H1432_IF_44000 44000
  47. #define S5H1432_VSB_IF_DEFAULT s5h1432_IF_44000
  48. #define S5H1432_QAM_IF_DEFAULT s5h1432_IF_44000
  49. u16 qam_if;
  50. u16 vsb_if;
  51. /* Spectral Inversion */
  52. #define S5H1432_INVERSION_OFF 0
  53. #define S5H1432_INVERSION_ON 1
  54. u8 inversion;
  55. /* Return lock status based on tuner lock, or demod lock */
  56. #define S5H1432_TUNERLOCKING 0
  57. #define S5H1432_DEMODLOCKING 1
  58. u8 status_mode;
  59. };
  60. #if defined(CONFIG_DVB_S5H1432) || \
  61. (defined(CONFIG_DVB_S5H1432_MODULE) && defined(MODULE))
  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__ */
  74. /*
  75. * Local variables:
  76. * c-basic-offset: 8
  77. */