added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / drivers / media / dvb / frontends / stb6100_cfg.h
blobd3133405dc03f7e366eb6481ff3795e6f96217b7
1 /*
2 STB6100 Silicon Tuner
3 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
5 Copyright (C) ST Microelectronics
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
24 struct dvb_frontend_ops *frontend_ops = NULL;
25 struct dvb_tuner_ops *tuner_ops = NULL;
26 struct tuner_state t_state;
27 int err = 0;
29 if (&fe->ops)
30 frontend_ops = &fe->ops;
31 if (&frontend_ops->tuner_ops)
32 tuner_ops = &frontend_ops->tuner_ops;
33 if (tuner_ops->get_state) {
34 if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) {
35 printk("%s: Invalid parameter\n", __func__);
36 return err;
38 *frequency = t_state.frequency;
39 printk("%s: Frequency=%d\n", __func__, t_state.frequency);
41 return 0;
44 static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
46 struct dvb_frontend_ops *frontend_ops = NULL;
47 struct dvb_tuner_ops *tuner_ops = NULL;
48 struct tuner_state t_state;
49 int err = 0;
51 t_state.frequency = frequency;
52 if (&fe->ops)
53 frontend_ops = &fe->ops;
54 if (&frontend_ops->tuner_ops)
55 tuner_ops = &frontend_ops->tuner_ops;
56 if (tuner_ops->set_state) {
57 if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) {
58 printk("%s: Invalid parameter\n", __func__);
59 return err;
62 printk("%s: Frequency=%d\n", __func__, t_state.frequency);
63 return 0;
66 static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
68 struct dvb_frontend_ops *frontend_ops = &fe->ops;
69 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
70 struct tuner_state t_state;
71 int err = 0;
73 if (&fe->ops)
74 frontend_ops = &fe->ops;
75 if (&frontend_ops->tuner_ops)
76 tuner_ops = &frontend_ops->tuner_ops;
77 if (tuner_ops->get_state) {
78 if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) {
79 printk("%s: Invalid parameter\n", __func__);
80 return err;
82 *bandwidth = t_state.bandwidth;
84 printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
85 return 0;
88 static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth)
90 struct dvb_frontend_ops *frontend_ops = NULL;
91 struct dvb_tuner_ops *tuner_ops = NULL;
92 struct tuner_state t_state;
93 int err = 0;
95 t_state.bandwidth = bandwidth;
96 if (&fe->ops)
97 frontend_ops = &fe->ops;
98 if (&frontend_ops->tuner_ops)
99 tuner_ops = &frontend_ops->tuner_ops;
100 if (tuner_ops->set_state) {
101 if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) {
102 printk("%s: Invalid parameter\n", __func__);
103 return err;
106 printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
107 return 0;