horus3a.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * horus3a.h
  4. *
  5. * Sony Horus3A DVB-S/S2 tuner driver
  6. *
  7. * Copyright 2012 Sony Corporation
  8. * Copyright (C) 2014 NetUP Inc.
  9. * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
  10. * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
  11. */
  12. #ifndef __DVB_HORUS3A_H__
  13. #define __DVB_HORUS3A_H__
  14. #include <linux/dvb/frontend.h>
  15. #include <linux/i2c.h>
  16. /**
  17. * struct horus3a_config - the configuration of Horus3A tuner driver
  18. * @i2c_address: I2C address of the tuner
  19. * @xtal_freq_mhz: Oscillator frequency, MHz
  20. * @set_tuner_priv: Callback function private context
  21. * @set_tuner_callback: Callback function that notifies the parent driver
  22. * which tuner is active now
  23. */
  24. struct horus3a_config {
  25. u8 i2c_address;
  26. u8 xtal_freq_mhz;
  27. void *set_tuner_priv;
  28. int (*set_tuner_callback)(void *, int);
  29. };
  30. #if IS_REACHABLE(CONFIG_DVB_HORUS3A)
  31. /**
  32. * Attach a horus3a tuner
  33. *
  34. * @fe: frontend to be attached
  35. * @config: pointer to &struct helene_config with tuner configuration.
  36. * @i2c: i2c adapter to use.
  37. *
  38. * return: FE pointer on success, NULL on failure.
  39. */
  40. extern struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
  41. const struct horus3a_config *config,
  42. struct i2c_adapter *i2c);
  43. #else
  44. static inline struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
  45. const struct horus3a_config *config,
  46. struct i2c_adapter *i2c)
  47. {
  48. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  49. return NULL;
  50. }
  51. #endif
  52. #endif