9ca8040489dd3c4e382205acc751c8766133b9fb
[safe/jmp/linux-2.6] / drivers / media / dvb / mantis / mantis_vp3030.c
1 /*
2         Mantis VP-3030 driver
3
4         Copyright (C) 2005, 2006 Manu Abraham (abraham.manu@gmail.com)
5
6         This program is free software; you can redistribute it and/or modify
7         it under the terms of the GNU General Public License as published by
8         the Free Software Foundation; either version 2 of the License, or
9         (at your option) any later version.
10
11         This program is distributed in the hope that it will be useful,
12         but WITHOUT ANY WARRANTY; without even the implied warranty of
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14         GNU General Public License for more details.
15
16         You should have received a copy of the GNU General Public License
17         along with this program; if not, write to the Free Software
18         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #include "mantis_common.h"
22 #include "mantis_vp3030.h"
23
24 struct zl10353_config mantis_vp3030_config = {
25         .demod_address  = 0x0f,
26 };
27
28 #define MANTIS_MODEL_NAME       "VP-3030"
29 #define MANTIS_DEV_TYPE         "DVB-T"
30
31 struct mantis_hwconfig vp3030_mantis_config = {
32         .model_name     = MANTIS_MODEL_NAME,
33         .dev_type       = MANTIS_DEV_TYPE,
34         .ts_size        = MANTIS_TS_188,
35         .baud_rate      = MANTIS_BAUD_9600,
36         .parity         = MANTIS_PARITY_NONE,
37         .bytes          = 0,
38 };
39
40 int panasonic_en57h12d5_set_params(struct dvb_frontend *fe,
41                                    struct dvb_frontend_parameters *params)
42 {
43         u8 buf[4];
44         int rc;
45         struct mantis_pci *mantis = fe->dvb->priv;
46
47         struct i2c_msg tuner_msg = {
48                 .addr = 0x60,
49                 .flags = 0,
50                 .buf = buf,
51                 .len = sizeof (buf)
52         };
53
54         if ((params->frequency < 950000) || (params->frequency > 2150000))
55                 return -EINVAL;
56         rc = i2c_transfer(&mantis->adapter, &tuner_msg, 1);
57         if (rc != 1) {
58                 printk("%s: I2C Transfer returned [%d]\n", __func__, rc);
59                 return -EIO;
60         }
61         msleep_interruptible(1);
62         printk("%s: Send params to tuner ok!!!\n", __func__);
63
64         return 0;
65 }