mantis_vp3030.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Mantis VP-3030 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_vp3030.h"
  18. struct zl10353_config mantis_vp3030_config = {
  19. .demod_address = 0x0f,
  20. };
  21. #define MANTIS_MODEL_NAME "VP-3030"
  22. #define MANTIS_DEV_TYPE "DVB-T"
  23. struct mantis_hwconfig vp3030_mantis_config = {
  24. .model_name = MANTIS_MODEL_NAME,
  25. .dev_type = MANTIS_DEV_TYPE,
  26. .ts_size = MANTIS_TS_188,
  27. .baud_rate = MANTIS_BAUD_9600,
  28. .parity = MANTIS_PARITY_NONE,
  29. .bytes = 0,
  30. };
  31. int panasonic_en57h12d5_set_params(struct dvb_frontend *fe,
  32. struct dvb_frontend_parameters *params)
  33. {
  34. u8 buf[4];
  35. int rc;
  36. struct mantis_pci *mantis = fe->dvb->priv;
  37. struct i2c_msg tuner_msg = {
  38. .addr = 0x60,
  39. .flags = 0,
  40. .buf = buf,
  41. .len = sizeof (buf)
  42. };
  43. if ((params->frequency < 950000) || (params->frequency > 2150000))
  44. return -EINVAL;
  45. rc = i2c_transfer(&mantis->adapter, &tuner_msg, 1);
  46. if (rc != 1) {
  47. printk("%s: I2C Transfer returned [%d]\n", __func__, rc);
  48. return -EIO;
  49. }
  50. msleep_interruptible(1);
  51. printk("%s: Send params to tuner ok!!!\n", __func__);
  52. return 0;
  53. }