mantis_vp1034.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. Mantis VP-1034 driver
  3. Copyright (C) 2005, 2006 Manu Abraham (abraham.manu@gmail.com)
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #include "mantis_common.h"
  17. #include "mantis_vp1034.h"
  18. struct mb86a16_config vp1034_config = {
  19. .demod_address = 0x08,
  20. .set_voltage = vp1034_set_voltage,
  21. };
  22. #define MANTIS_MODEL_NAME "VP-1034"
  23. #define MANTIS_DEV_TYPE "DVB-S/DSS"
  24. struct mantis_hwconfig vp1034_mantis_config = {
  25. .model_name = MANTIS_MODEL_NAME,
  26. .dev_type = MANTIS_DEV_TYPE,
  27. .ts_size = MANTIS_TS_204,
  28. };
  29. int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
  30. {
  31. struct mantis_pci *mantis = fe->dvb->priv;
  32. switch (voltage) {
  33. case SEC_VOLTAGE_13:
  34. dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[13V]");
  35. gpio_set_bits(mantis, 13, 1);
  36. gpio_set_bits(mantis, 14, 0);
  37. break;
  38. case SEC_VOLTAGE_18:
  39. dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[18V]");
  40. gpio_set_bits(mantis, 13, 1);
  41. gpio_set_bits(mantis, 14, 1);
  42. break;
  43. case SEC_VOLTAGE_OFF:
  44. dprintk(verbose, MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
  45. break;
  46. default:
  47. dprintk(verbose, MANTIS_ERROR, 1, "Invalid = (%d)", (u32 ) voltage);
  48. return -EINVAL;
  49. }
  50. mmwrite(0x00, MANTIS_GPIF_DOUT);
  51. return 0;
  52. }