cx24110.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. cx24110 - Single Chip Satellite Channel Receiver driver module
  3. Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@htp-tel.de> based on
  4. work
  5. Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
  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. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #ifndef CX24110_H
  19. #define CX24110_H
  20. #include <linux/dvb/frontend.h>
  21. struct cx24110_config
  22. {
  23. /* the demodulator's i2c address */
  24. u8 demod_address;
  25. };
  26. static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val)
  27. {
  28. u8 buf[] = {
  29. (u8)((val >> 24) & 0xff),
  30. (u8)((val >> 16) & 0xff),
  31. (u8)((val >> 8) & 0xff)
  32. };
  33. if (fe->ops.write)
  34. return fe->ops.write(fe, buf, 3);
  35. return 0;
  36. }
  37. #if defined(CONFIG_DVB_CX24110) || (defined(CONFIG_DVB_CX24110_MODULE) && defined(MODULE))
  38. extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
  39. struct i2c_adapter* i2c);
  40. #else
  41. static inline struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
  42. struct i2c_adapter* i2c)
  43. {
  44. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  45. return NULL;
  46. }
  47. #endif // CONFIG_DVB_CX24110
  48. #endif // CX24110_H