Path: blob/master/drivers/media/dvb/mantis/hopper_vp3028.c
15112 views
/*1Hopper VP-3028 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 "mantis_common.h"32#include "mantis_ioc.h"33#include "mantis_dvb.h"34#include "hopper_vp3028.h"3536struct zl10353_config hopper_vp3028_config = {37.demod_address = 0x0f,38};3940#define MANTIS_MODEL_NAME "VP-3028"41#define MANTIS_DEV_TYPE "DVB-T"4243static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe)44{45struct i2c_adapter *adapter = &mantis->adapter;46struct mantis_hwconfig *config = mantis->hwconfig;47int err = 0;4849mantis_gpio_set_bits(mantis, config->reset, 0);50msleep(100);51err = mantis_frontend_power(mantis, POWER_ON);52msleep(100);53mantis_gpio_set_bits(mantis, config->reset, 1);5455err = mantis_frontend_power(mantis, POWER_ON);56if (err == 0) {57msleep(250);58dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)");59fe = dvb_attach(zl10353_attach, &hopper_vp3028_config, adapter);6061if (!fe)62return -1;63} else {64dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",65adapter->name,66err);6768return -EIO;69}70dprintk(MANTIS_ERROR, 1, "Done!");7172return 0;73}7475struct mantis_hwconfig vp3028_config = {76.model_name = MANTIS_MODEL_NAME,77.dev_type = MANTIS_DEV_TYPE,78.ts_size = MANTIS_TS_188,7980.baud_rate = MANTIS_BAUD_9600,81.parity = MANTIS_PARITY_NONE,82.bytes = 0,8384.frontend_init = vp3028_frontend_init,85.power = GPIF_A00,86.reset = GPIF_A03,87};888990