helene.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * helene.h
  3. *
  4. * Sony HELENE DVB-S/S2/T/T2/C/C2/ISDB-T/S tuner driver (CXD2858ER)
  5. *
  6. * Copyright 2012 Sony Corporation
  7. * Copyright (C) 2014 NetUP Inc.
  8. * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. */
  20. #ifndef __DVB_HELENE_H__
  21. #define __DVB_HELENE_H__
  22. #include <linux/dvb/frontend.h>
  23. #include <linux/i2c.h>
  24. enum helene_xtal {
  25. SONY_HELENE_XTAL_16000, /* 16 MHz */
  26. SONY_HELENE_XTAL_20500, /* 20.5 MHz */
  27. SONY_HELENE_XTAL_24000, /* 24 MHz */
  28. SONY_HELENE_XTAL_41000 /* 41 MHz */
  29. };
  30. /**
  31. * struct helene_config - the configuration of 'Helene' tuner driver
  32. * @i2c_address: I2C address of the tuner
  33. * @xtal_freq_mhz: Oscillator frequency, MHz
  34. * @set_tuner_priv: Callback function private context
  35. * @set_tuner_callback: Callback function that notifies the parent driver
  36. * which tuner is active now
  37. */
  38. struct helene_config {
  39. u8 i2c_address;
  40. u8 xtal_freq_mhz;
  41. void *set_tuner_priv;
  42. int (*set_tuner_callback)(void *, int);
  43. enum helene_xtal xtal;
  44. };
  45. #if IS_REACHABLE(CONFIG_DVB_HELENE)
  46. extern struct dvb_frontend *helene_attach(struct dvb_frontend *fe,
  47. const struct helene_config *config,
  48. struct i2c_adapter *i2c);
  49. #else
  50. static inline struct dvb_frontend *helene_attach(struct dvb_frontend *fe,
  51. const struct helene_config *config,
  52. struct i2c_adapter *i2c)
  53. {
  54. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  55. return NULL;
  56. }
  57. #endif
  58. #if IS_REACHABLE(CONFIG_DVB_HELENE)
  59. extern struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe,
  60. const struct helene_config *config,
  61. struct i2c_adapter *i2c);
  62. #else
  63. static inline struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe,
  64. const struct helene_config *config,
  65. struct i2c_adapter *i2c)
  66. {
  67. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  68. return NULL;
  69. }
  70. #endif
  71. #endif