s5h1411.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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/kconfig.h>
  19. #include <linux/dvb/frontend.h>
  20. #define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
  21. #define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
  22. struct s5h1411_config {
  23. /* serial/parallel output */
  24. #define S5H1411_PARALLEL_OUTPUT 0
  25. #define S5H1411_SERIAL_OUTPUT 1
  26. u8 output_mode;
  27. /* GPIO Setting */
  28. #define S5H1411_GPIO_OFF 0
  29. #define S5H1411_GPIO_ON 1
  30. u8 gpio;
  31. /* MPEG signal timing */
  32. #define S5H1411_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0
  33. #define S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1
  34. #define S5H1411_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2
  35. #define S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
  36. u16 mpeg_timing;
  37. /* IF Freq for QAM and VSB in KHz */
  38. #define S5H1411_IF_3250 3250
  39. #define S5H1411_IF_3500 3500
  40. #define S5H1411_IF_4000 4000
  41. #define S5H1411_IF_5380 5380
  42. #define S5H1411_IF_44000 44000
  43. #define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
  44. #define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
  45. u16 qam_if;
  46. u16 vsb_if;
  47. /* Spectral Inversion */
  48. #define S5H1411_INVERSION_OFF 0
  49. #define S5H1411_INVERSION_ON 1
  50. u8 inversion;
  51. /* Return lock status based on tuner lock, or demod lock */
  52. #define S5H1411_TUNERLOCKING 0
  53. #define S5H1411_DEMODLOCKING 1
  54. u8 status_mode;
  55. };
  56. #if IS_REACHABLE(CONFIG_DVB_S5H1411)
  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__ */