diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-31 07:35:57 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-31 07:35:57 -0500 |
commit | 2ca1a615835d9f4990f42102ab1f2ef434e7e89c (patch) | |
tree | 726cf3d5f29a6c66c44e4bd68e7ebed2fd83d059 /drivers/media/dvb/frontends/tda8261_cfg.h | |
parent | e12f0102ac81d660c9f801d0a0e10ccf4537a9de (diff) | |
parent | 6a94cb73064c952255336cc57731904174b2c58f (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
arch/x86/kernel/io_apic.c
Diffstat (limited to 'drivers/media/dvb/frontends/tda8261_cfg.h')
-rw-r--r-- | drivers/media/dvb/frontends/tda8261_cfg.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/tda8261_cfg.h b/drivers/media/dvb/frontends/tda8261_cfg.h new file mode 100644 index 000000000000..1af1ee49b542 --- /dev/null +++ b/drivers/media/dvb/frontends/tda8261_cfg.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | TDA8261 8PSK/QPSK tuner driver | ||
3 | Copyright (C) Manu Abraham (abraham.manu@gmail.com) | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency) | ||
21 | { | ||
22 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
23 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
24 | struct tuner_state t_state; | ||
25 | int err = 0; | ||
26 | |||
27 | if (&fe->ops) | ||
28 | frontend_ops = &fe->ops; | ||
29 | if (&frontend_ops->tuner_ops) | ||
30 | tuner_ops = &frontend_ops->tuner_ops; | ||
31 | if (tuner_ops->get_state) { | ||
32 | if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) { | ||
33 | printk("%s: Invalid parameter\n", __func__); | ||
34 | return err; | ||
35 | } | ||
36 | *frequency = t_state.frequency; | ||
37 | printk("%s: Frequency=%d\n", __func__, t_state.frequency); | ||
38 | } | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency) | ||
43 | { | ||
44 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
45 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
46 | struct tuner_state t_state; | ||
47 | int err = 0; | ||
48 | |||
49 | t_state.frequency = frequency; | ||
50 | if (&fe->ops) | ||
51 | frontend_ops = &fe->ops; | ||
52 | if (&frontend_ops->tuner_ops) | ||
53 | tuner_ops = &frontend_ops->tuner_ops; | ||
54 | if (tuner_ops->set_state) { | ||
55 | if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) { | ||
56 | printk("%s: Invalid parameter\n", __func__); | ||
57 | return err; | ||
58 | } | ||
59 | } | ||
60 | printk("%s: Frequency=%d\n", __func__, t_state.frequency); | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) | ||
65 | { | ||
66 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
67 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
68 | struct tuner_state t_state; | ||
69 | int err = 0; | ||
70 | |||
71 | if (&fe->ops) | ||
72 | frontend_ops = &fe->ops; | ||
73 | if (&frontend_ops->tuner_ops) | ||
74 | tuner_ops = &frontend_ops->tuner_ops; | ||
75 | if (tuner_ops->get_state) { | ||
76 | if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) { | ||
77 | printk("%s: Invalid parameter\n", __func__); | ||
78 | return err; | ||
79 | } | ||
80 | *bandwidth = t_state.bandwidth; | ||
81 | } | ||
82 | printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth); | ||
83 | return 0; | ||
84 | } | ||