atbm8830.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Support for AltoBeam GB20600 (a.k.a DMB-TH) demodulator
  3. * ATBM8830, ATBM8831
  4. *
  5. * Copyright (C) 2009 David T.L. Wong <davidtlwong@gmail.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef __ATBM8830_H__
  22. #define __ATBM8830_H__
  23. #include <linux/dvb/frontend.h>
  24. #include <linux/i2c.h>
  25. #define ATBM8830_PROD_8830 0
  26. #define ATBM8830_PROD_8831 1
  27. struct atbm8830_config {
  28. /* product type */
  29. u8 prod;
  30. /* the demodulator's i2c address */
  31. u8 demod_address;
  32. /* parallel or serial transport stream */
  33. u8 serial_ts;
  34. /* transport stream clock output only when receiving valid stream */
  35. u8 ts_clk_gated;
  36. /* Decoder sample TS data at rising edge of clock */
  37. u8 ts_sampling_edge;
  38. /* Oscillator clock frequency */
  39. u32 osc_clk_freq; /* in kHz */
  40. /* IF frequency */
  41. u32 if_freq; /* in kHz */
  42. /* Swap I/Q for zero IF */
  43. u8 zif_swap_iq;
  44. /* Tuner AGC settings */
  45. u8 agc_min;
  46. u8 agc_max;
  47. u8 agc_hold_loop;
  48. };
  49. #if defined(CONFIG_DVB_ATBM8830) || \
  50. (defined(CONFIG_DVB_ATBM8830_MODULE) && defined(MODULE))
  51. extern struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config,
  52. struct i2c_adapter *i2c);
  53. #else
  54. static inline
  55. struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config,
  56. struct i2c_adapter *i2c) {
  57. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  58. return NULL;
  59. }
  60. #endif /* CONFIG_DVB_ATBM8830 */
  61. #endif /* __ATBM8830_H__ */