s5h1432.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. *
  20. */
  21. #ifndef __S5H1432_H__
  22. #define __S5H1432_H__
  23. #include <linux/kconfig.h>
  24. #include <linux/dvb/frontend.h>
  25. #define S5H1432_I2C_TOP_ADDR (0x02 >> 1)
  26. #define TAIWAN_HI_IF_FREQ_44_MHZ 44000000
  27. #define EUROPE_HI_IF_FREQ_36_MHZ 36000000
  28. #define IF_FREQ_6_MHZ 6000000
  29. #define IF_FREQ_3point3_MHZ 3300000
  30. #define IF_FREQ_3point5_MHZ 3500000
  31. #define IF_FREQ_4_MHZ 4000000
  32. struct s5h1432_config {
  33. /* serial/parallel output */
  34. #define S5H1432_PARALLEL_OUTPUT 0
  35. #define S5H1432_SERIAL_OUTPUT 1
  36. u8 output_mode;
  37. /* GPIO Setting */
  38. #define S5H1432_GPIO_OFF 0
  39. #define S5H1432_GPIO_ON 1
  40. u8 gpio;
  41. /* MPEG signal timing */
  42. #define S5H1432_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0
  43. #define S5H1432_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1
  44. #define S5H1432_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2
  45. #define S5H1432_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
  46. u16 mpeg_timing;
  47. /* IF Freq for QAM and VSB in KHz */
  48. #define S5H1432_IF_3250 3250
  49. #define S5H1432_IF_3500 3500
  50. #define S5H1432_IF_4000 4000
  51. #define S5H1432_IF_5380 5380
  52. #define S5H1432_IF_44000 44000
  53. #define S5H1432_VSB_IF_DEFAULT s5h1432_IF_44000
  54. #define S5H1432_QAM_IF_DEFAULT s5h1432_IF_44000
  55. u16 qam_if;
  56. u16 vsb_if;
  57. /* Spectral Inversion */
  58. #define S5H1432_INVERSION_OFF 0
  59. #define S5H1432_INVERSION_ON 1
  60. u8 inversion;
  61. /* Return lock status based on tuner lock, or demod lock */
  62. #define S5H1432_TUNERLOCKING 0
  63. #define S5H1432_DEMODLOCKING 1
  64. u8 status_mode;
  65. };
  66. #if IS_REACHABLE(CONFIG_DVB_S5H1432)
  67. extern struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
  68. struct i2c_adapter *i2c);
  69. #else
  70. static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config
  71. *config,
  72. struct i2c_adapter *i2c)
  73. {
  74. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  75. return NULL;
  76. }
  77. #endif /* CONFIG_DVB_s5h1432 */
  78. #endif /* __s5h1432_H__ */