Lines Matching full:fe
48 static void stv6110_release(struct dvb_frontend *fe) in stv6110_release() argument
50 kfree(fe->tuner_priv); in stv6110_release()
51 fe->tuner_priv = NULL; in stv6110_release()
54 static int stv6110_write_regs(struct dvb_frontend *fe, u8 buf[], in stv6110_write_regs() argument
57 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_write_regs()
82 if (fe->ops.i2c_gate_ctrl) in stv6110_write_regs()
83 fe->ops.i2c_gate_ctrl(fe, 1); in stv6110_write_regs()
89 if (fe->ops.i2c_gate_ctrl) in stv6110_write_regs()
90 fe->ops.i2c_gate_ctrl(fe, 0); in stv6110_write_regs()
95 static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[], in stv6110_read_regs() argument
98 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_read_regs()
115 if (fe->ops.i2c_gate_ctrl) in stv6110_read_regs()
116 fe->ops.i2c_gate_ctrl(fe, 1); in stv6110_read_regs()
122 if (fe->ops.i2c_gate_ctrl) in stv6110_read_regs()
123 fe->ops.i2c_gate_ctrl(fe, 0); in stv6110_read_regs()
130 static int stv6110_read_reg(struct dvb_frontend *fe, int start) in stv6110_read_reg() argument
133 stv6110_read_regs(fe, buf, start, 1); in stv6110_read_reg()
138 static int stv6110_sleep(struct dvb_frontend *fe) in stv6110_sleep() argument
141 stv6110_write_regs(fe, reg, 0, 1); in stv6110_sleep()
165 static int stv6110_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) in stv6110_set_bandwidth() argument
167 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_set_bandwidth()
182 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL3], RSTV6110_CTRL3, 1); in stv6110_set_bandwidth()
185 stv6110_write_regs(fe, &priv->regs[RSTV6110_STAT1], RSTV6110_STAT1, 1); in stv6110_set_bandwidth()
190 ret = ((stv6110_read_reg(fe, RSTV6110_STAT1)) & 0x02); in stv6110_set_bandwidth()
197 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL3], RSTV6110_CTRL3, 1); in stv6110_set_bandwidth()
201 static int stv6110_init(struct dvb_frontend *fe) in stv6110_init() argument
203 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_init()
216 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8); in stv6110_init()
218 stv6110_set_bandwidth(fe, 72000000); in stv6110_init()
223 static int stv6110_get_frequency(struct dvb_frontend *fe, u32 *frequency) in stv6110_get_frequency() argument
225 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_get_frequency()
229 stv6110_read_regs(fe, regs, 0, 8); in stv6110_get_frequency()
248 static int stv6110_set_frequency(struct dvb_frontend *fe, u32 frequency) in stv6110_set_frequency() argument
250 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_set_frequency()
315 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], in stv6110_set_frequency()
321 ret = ((stv6110_read_reg(fe, RSTV6110_STAT1)) & 0x04); in stv6110_set_frequency()
326 ret = stv6110_read_reg(fe, RSTV6110_STAT1); in stv6110_set_frequency()
327 stv6110_get_frequency(fe, &result_freq); in stv6110_set_frequency()
336 static int stv6110_set_params(struct dvb_frontend *fe) in stv6110_set_params() argument
338 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in stv6110_set_params()
341 stv6110_set_frequency(fe, c->frequency); in stv6110_set_params()
342 stv6110_set_bandwidth(fe, bandwidth); in stv6110_set_params()
347 static int stv6110_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) in stv6110_get_bandwidth() argument
349 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_get_bandwidth()
352 stv6110_read_regs(fe, regs, 0, 8); in stv6110_get_bandwidth()
379 struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe, in stv6110_attach() argument
400 if (fe->ops.i2c_gate_ctrl) in stv6110_attach()
401 fe->ops.i2c_gate_ctrl(fe, 1); in stv6110_attach()
405 if (fe->ops.i2c_gate_ctrl) in stv6110_attach()
406 fe->ops.i2c_gate_ctrl(fe, 0); in stv6110_attach()
423 memcpy(&fe->ops.tuner_ops, &stv6110_tuner_ops, in stv6110_attach()
425 fe->tuner_priv = priv; in stv6110_attach()
428 return fe; in stv6110_attach()