1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
21{
22 struct dvb_frontend_ops *frontend_ops = &fe->ops;
23 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
24 struct tuner_state t_state;
25 int err = 0;
26
27 if (tuner_ops->get_state) {
28 err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
29 if (err < 0) {
30 printk("%s: Invalid parameter\n", __func__);
31 return err;
32 }
33 *frequency = t_state.frequency;
34 printk("%s: Frequency=%d\n", __func__, t_state.frequency);
35 }
36 return 0;
37}
38
39static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
40{
41 struct dvb_frontend_ops *frontend_ops = &fe->ops;
42 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
43 struct tuner_state t_state;
44 int err = 0;
45
46 t_state.frequency = frequency;
47
48 if (tuner_ops->set_state) {
49 err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
50 if (err < 0) {
51 printk("%s: Invalid parameter\n", __func__);
52 return err;
53 }
54 }
55 printk("%s: Frequency=%d\n", __func__, t_state.frequency);
56 return 0;
57}
58
59static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
60{
61 struct dvb_frontend_ops *frontend_ops = &fe->ops;
62 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
63 struct tuner_state t_state;
64 int err = 0;
65
66 if (tuner_ops->get_state) {
67 err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
68 if (err < 0) {
69 printk("%s: Invalid parameter\n", __func__);
70 return err;
71 }
72 *bandwidth = t_state.bandwidth;
73 printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
74 }
75 return 0;
76}
77