hopper_vp3028.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. Hopper VP-3028 driver
  3. Copyright (C) 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 <linux/signal.h>
  17. #include <linux/sched.h>
  18. #include <linux/interrupt.h>
  19. #include "dmxdev.h"
  20. #include "dvbdev.h"
  21. #include "dvb_demux.h"
  22. #include "dvb_frontend.h"
  23. #include "dvb_net.h"
  24. #include "zl10353.h"
  25. #include "mantis_common.h"
  26. #include "mantis_ioc.h"
  27. #include "mantis_dvb.h"
  28. #include "hopper_vp3028.h"
  29. static struct zl10353_config hopper_vp3028_config = {
  30. .demod_address = 0x0f,
  31. };
  32. #define MANTIS_MODEL_NAME "VP-3028"
  33. #define MANTIS_DEV_TYPE "DVB-T"
  34. static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe)
  35. {
  36. struct i2c_adapter *adapter = &mantis->adapter;
  37. struct mantis_hwconfig *config = mantis->hwconfig;
  38. int err = 0;
  39. mantis_gpio_set_bits(mantis, config->reset, 0);
  40. msleep(100);
  41. err = mantis_frontend_power(mantis, POWER_ON);
  42. msleep(100);
  43. mantis_gpio_set_bits(mantis, config->reset, 1);
  44. err = mantis_frontend_power(mantis, POWER_ON);
  45. if (err == 0) {
  46. msleep(250);
  47. dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)");
  48. fe = dvb_attach(zl10353_attach, &hopper_vp3028_config, adapter);
  49. if (!fe)
  50. return -1;
  51. } else {
  52. dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",
  53. adapter->name,
  54. err);
  55. return -EIO;
  56. }
  57. dprintk(MANTIS_ERROR, 1, "Done!");
  58. return 0;
  59. }
  60. struct mantis_hwconfig vp3028_config = {
  61. .model_name = MANTIS_MODEL_NAME,
  62. .dev_type = MANTIS_DEV_TYPE,
  63. .ts_size = MANTIS_TS_188,
  64. .baud_rate = MANTIS_BAUD_9600,
  65. .parity = MANTIS_PARITY_NONE,
  66. .bytes = 0,
  67. .frontend_init = vp3028_frontend_init,
  68. .power = GPIF_A00,
  69. .reset = GPIF_A03,
  70. };