horus3a.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * horus3a.h
  3. *
  4. * Sony Horus3A DVB-S/S2 tuner driver
  5. *
  6. * Copyright 2012 Sony Corporation
  7. * Copyright (C) 2014 NetUP Inc.
  8. * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
  9. * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. */
  21. #ifndef __DVB_HORUS3A_H__
  22. #define __DVB_HORUS3A_H__
  23. #include <linux/dvb/frontend.h>
  24. #include <linux/i2c.h>
  25. /**
  26. * struct horus3a_config - the configuration of Horus3A tuner driver
  27. * @i2c_address: I2C address of the tuner
  28. * @xtal_freq_mhz: Oscillator frequency, MHz
  29. * @set_tuner_priv: Callback function private context
  30. * @set_tuner_callback: Callback function that notifies the parent driver
  31. * which tuner is active now
  32. */
  33. struct horus3a_config {
  34. u8 i2c_address;
  35. u8 xtal_freq_mhz;
  36. void *set_tuner_priv;
  37. int (*set_tuner_callback)(void *, int);
  38. };
  39. #if IS_REACHABLE(CONFIG_DVB_HORUS3A)
  40. /**
  41. * Attach a horus3a tuner
  42. *
  43. * @fe: frontend to be attached
  44. * @config: pointer to &struct helene_config with tuner configuration.
  45. * @i2c: i2c adapter to use.
  46. *
  47. * return: FE pointer on success, NULL on failure.
  48. */
  49. extern struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
  50. const struct horus3a_config *config,
  51. struct i2c_adapter *i2c);
  52. #else
  53. static inline struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
  54. const struct horus3a_config *config,
  55. struct i2c_adapter *i2c)
  56. {
  57. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  58. return NULL;
  59. }
  60. #endif
  61. #endif