s5h1411.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. Samsung S5H1411 VSB/QAM demodulator driver
  3. Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
  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 __S5H1411_H__
  17. #define __S5H1411_H__
  18. #include <linux/dvb/frontend.h>
  19. #define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
  20. #define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
  21. struct s5h1411_config {
  22. /* serial/parallel output */
  23. #define S5H1411_PARALLEL_OUTPUT 0
  24. #define S5H1411_SERIAL_OUTPUT 1
  25. u8 output_mode;
  26. /* GPIO Setting */
  27. #define S5H1411_GPIO_OFF 0
  28. #define S5H1411_GPIO_ON 1
  29. u8 gpio;
  30. /* MPEG signal timing */
  31. #define S5H1411_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0
  32. #define S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1
  33. #define S5H1411_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2
  34. #define S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
  35. u16 mpeg_timing;
  36. /* IF Freq for QAM and VSB in KHz */
  37. #define S5H1411_IF_3250 3250
  38. #define S5H1411_IF_3500 3500
  39. #define S5H1411_IF_4000 4000
  40. #define S5H1411_IF_5380 5380
  41. #define S5H1411_IF_44000 44000
  42. #define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
  43. #define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
  44. u16 qam_if;
  45. u16 vsb_if;
  46. /* Spectral Inversion */
  47. #define S5H1411_INVERSION_OFF 0
  48. #define S5H1411_INVERSION_ON 1
  49. u8 inversion;
  50. /* Return lock status based on tuner lock, or demod lock */
  51. #define S5H1411_TUNERLOCKING 0
  52. #define S5H1411_DEMODLOCKING 1
  53. u8 status_mode;
  54. };
  55. #if defined(CONFIG_DVB_S5H1411) || \
  56. (defined(CONFIG_DVB_S5H1411_MODULE) && defined(MODULE))
  57. extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config,
  58. struct i2c_adapter *i2c);
  59. #else
  60. static inline struct dvb_frontend *s5h1411_attach(
  61. const struct s5h1411_config *config,
  62. struct i2c_adapter *i2c)
  63. {
  64. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  65. return NULL;
  66. }
  67. #endif /* CONFIG_DVB_S5H1411 */
  68. #endif /* __S5H1411_H__ */
  69. /*
  70. * Local variables:
  71. * c-basic-offset: 8
  72. */