interconnect: qcom: Fix Kconfig indentation
[linux/fpc-iii.git] / drivers / media / dvb-frontends / stb6100_proc.h
blobaf75a40e0ff17daaa2cf779eb3f381e69fe761dd
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 STB6100 Silicon Tuner wrapper
4 Copyright (C)2009 Igor M. Liplianin (liplianin@me.by)
6 */
8 #include <linux/dvb/frontend.h>
9 #include <media/dvb_frontend.h>
11 static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency)
13 struct dvb_frontend_ops *frontend_ops = &fe->ops;
14 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
15 int err = 0;
17 if (tuner_ops->get_frequency) {
18 if (frontend_ops->i2c_gate_ctrl)
19 frontend_ops->i2c_gate_ctrl(fe, 1);
21 err = tuner_ops->get_frequency(fe, frequency);
22 if (err < 0) {
23 printk("%s: Invalid parameter\n", __func__);
24 return err;
27 if (frontend_ops->i2c_gate_ctrl)
28 frontend_ops->i2c_gate_ctrl(fe, 0);
31 return 0;
34 static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency)
36 struct dvb_frontend_ops *frontend_ops = &fe->ops;
37 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
38 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
39 u32 bw = c->bandwidth_hz;
40 int err = 0;
42 c->frequency = frequency;
43 c->bandwidth_hz = 0; /* Don't adjust the bandwidth */
45 if (tuner_ops->set_params) {
46 if (frontend_ops->i2c_gate_ctrl)
47 frontend_ops->i2c_gate_ctrl(fe, 1);
49 err = tuner_ops->set_params(fe);
50 c->bandwidth_hz = bw;
51 if (err < 0) {
52 printk("%s: Invalid parameter\n", __func__);
53 return err;
56 if (frontend_ops->i2c_gate_ctrl)
57 frontend_ops->i2c_gate_ctrl(fe, 0);
61 return 0;
64 static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth)
66 struct dvb_frontend_ops *frontend_ops = &fe->ops;
67 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
68 int err = 0;
70 if (tuner_ops->get_bandwidth) {
71 if (frontend_ops->i2c_gate_ctrl)
72 frontend_ops->i2c_gate_ctrl(fe, 1);
74 err = tuner_ops->get_bandwidth(fe, bandwidth);
75 if (err < 0) {
76 printk(KERN_ERR "%s: Invalid parameter\n", __func__);
77 return err;
80 if (frontend_ops->i2c_gate_ctrl)
81 frontend_ops->i2c_gate_ctrl(fe, 0);
84 return 0;
87 static int stb6100_set_bandw(struct dvb_frontend *fe, u32 bandwidth)
89 struct dvb_frontend_ops *frontend_ops = &fe->ops;
90 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
91 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
92 u32 freq = c->frequency;
93 int err = 0;
95 c->bandwidth_hz = bandwidth;
96 c->frequency = 0; /* Don't adjust the frequency */
98 if (tuner_ops->set_params) {
99 if (frontend_ops->i2c_gate_ctrl)
100 frontend_ops->i2c_gate_ctrl(fe, 1);
102 err = tuner_ops->set_params(fe);
103 c->frequency = freq;
104 if (err < 0) {
105 printk(KERN_ERR "%s: Invalid parameter\n", __func__);
106 return err;
109 if (frontend_ops->i2c_gate_ctrl)
110 frontend_ops->i2c_gate_ctrl(fe, 0);
114 return 0;