mantis_vp1034.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. .baud_rate = MANTIS_BAUD_9600,
  29. .parity = MANTIS_PARITY_NONE,
  30. .bytes = 0,
  31. };
  32. int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
  33. {
  34. struct mantis_pci *mantis = fe->dvb->priv;
  35. switch (voltage) {
  36. case SEC_VOLTAGE_13:
  37. dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[13V]");
  38. gpio_set_bits(mantis, 13, 1);
  39. gpio_set_bits(mantis, 14, 0);
  40. break;
  41. case SEC_VOLTAGE_18:
  42. dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[18V]");
  43. gpio_set_bits(mantis, 13, 1);
  44. gpio_set_bits(mantis, 14, 1);
  45. break;
  46. case SEC_VOLTAGE_OFF:
  47. dprintk(verbose, MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
  48. break;
  49. default:
  50. dprintk(verbose, MANTIS_ERROR, 1, "Invalid = (%d)", (u32 ) voltage);
  51. return -EINVAL;
  52. }
  53. mmwrite(0x00, MANTIS_GPIF_DOUT);
  54. return 0;
  55. }