Path: blob/master/drivers/media/dvb/mantis/mantis_vp3030.c
15112 views
/*1Mantis VP-3030 driver23Copyright (C) Manu Abraham ([email protected])45This program is free software; you can redistribute it and/or modify6it under the terms of the GNU General Public License as published by7the Free Software Foundation; either version 2 of the License, or8(at your option) any later version.910This program is distributed in the hope that it will be useful,11but WITHOUT ANY WARRANTY; without even the implied warranty of12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13GNU General Public License for more details.1415You should have received a copy of the GNU General Public License16along with this program; if not, write to the Free Software17Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*/1920#include <linux/signal.h>21#include <linux/sched.h>22#include <linux/interrupt.h>2324#include "dmxdev.h"25#include "dvbdev.h"26#include "dvb_demux.h"27#include "dvb_frontend.h"28#include "dvb_net.h"2930#include "zl10353.h"31#include "tda665x.h"32#include "mantis_common.h"33#include "mantis_ioc.h"34#include "mantis_dvb.h"35#include "mantis_vp3030.h"3637struct zl10353_config mantis_vp3030_config = {38.demod_address = 0x0f,39};4041struct tda665x_config env57h12d5_config = {42.name = "ENV57H12D5 (ET-50DT)",43.addr = 0x60,44.frequency_min = 47000000,45.frequency_max = 862000000,46.frequency_offst = 3616667,47.ref_multiplier = 6, /* 1/6 MHz */48.ref_divider = 100000, /* 1/6 MHz */49};5051#define MANTIS_MODEL_NAME "VP-3030"52#define MANTIS_DEV_TYPE "DVB-T"535455static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe)56{57struct i2c_adapter *adapter = &mantis->adapter;58struct mantis_hwconfig *config = mantis->hwconfig;59int err = 0;6061mantis_gpio_set_bits(mantis, config->reset, 0);62msleep(100);63err = mantis_frontend_power(mantis, POWER_ON);64msleep(100);65mantis_gpio_set_bits(mantis, config->reset, 1);6667if (err == 0) {68msleep(250);69dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)");70fe = dvb_attach(zl10353_attach, &mantis_vp3030_config, adapter);7172if (!fe)73return -1;7475dvb_attach(tda665x_attach, fe, &env57h12d5_config, adapter);76} else {77dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",78adapter->name,79err);8081return -EIO;8283}84mantis->fe = fe;85dprintk(MANTIS_ERROR, 1, "Done!");8687return 0;88}8990struct mantis_hwconfig vp3030_config = {91.model_name = MANTIS_MODEL_NAME,92.dev_type = MANTIS_DEV_TYPE,93.ts_size = MANTIS_TS_188,9495.baud_rate = MANTIS_BAUD_9600,96.parity = MANTIS_PARITY_NONE,97.bytes = 0,9899.frontend_init = vp3030_frontend_init,100.power = GPIF_A12,101.reset = GPIF_A13,102103.i2c_mode = MANTIS_BYTE_MODE104};105106107