Lines Matching refs:fe
62 static int stv6110_release(struct dvb_frontend *fe) in stv6110_release() argument
64 kfree(fe->tuner_priv); in stv6110_release()
65 fe->tuner_priv = NULL; in stv6110_release()
69 static int stv6110_write_regs(struct dvb_frontend *fe, u8 buf[], in stv6110_write_regs() argument
72 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_write_regs()
97 if (fe->ops.i2c_gate_ctrl) in stv6110_write_regs()
98 fe->ops.i2c_gate_ctrl(fe, 1); in stv6110_write_regs()
104 if (fe->ops.i2c_gate_ctrl) in stv6110_write_regs()
105 fe->ops.i2c_gate_ctrl(fe, 0); in stv6110_write_regs()
110 static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[], in stv6110_read_regs() argument
113 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_read_regs()
130 if (fe->ops.i2c_gate_ctrl) in stv6110_read_regs()
131 fe->ops.i2c_gate_ctrl(fe, 1); in stv6110_read_regs()
137 if (fe->ops.i2c_gate_ctrl) in stv6110_read_regs()
138 fe->ops.i2c_gate_ctrl(fe, 0); in stv6110_read_regs()
145 static int stv6110_read_reg(struct dvb_frontend *fe, int start) in stv6110_read_reg() argument
148 stv6110_read_regs(fe, buf, start, 1); in stv6110_read_reg()
153 static int stv6110_sleep(struct dvb_frontend *fe) in stv6110_sleep() argument
156 stv6110_write_regs(fe, reg, 0, 1); in stv6110_sleep()
180 static int stv6110_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) in stv6110_set_bandwidth() argument
182 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_set_bandwidth()
197 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL3], RSTV6110_CTRL3, 1); in stv6110_set_bandwidth()
200 stv6110_write_regs(fe, &priv->regs[RSTV6110_STAT1], RSTV6110_STAT1, 1); in stv6110_set_bandwidth()
205 ret = ((stv6110_read_reg(fe, RSTV6110_STAT1)) & 0x02); in stv6110_set_bandwidth()
212 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL3], RSTV6110_CTRL3, 1); in stv6110_set_bandwidth()
216 static int stv6110_init(struct dvb_frontend *fe) in stv6110_init() argument
218 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_init()
231 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8); in stv6110_init()
233 stv6110_set_bandwidth(fe, 72000000); in stv6110_init()
238 static int stv6110_get_frequency(struct dvb_frontend *fe, u32 *frequency) in stv6110_get_frequency() argument
240 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_get_frequency()
244 stv6110_read_regs(fe, regs, 0, 8); in stv6110_get_frequency()
263 static int stv6110_set_frequency(struct dvb_frontend *fe, u32 frequency) in stv6110_set_frequency() argument
265 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_set_frequency()
266 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in stv6110_set_frequency()
281 if (fe->ops.set_property && fe->ops.get_property) { in stv6110_set_frequency()
339 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], in stv6110_set_frequency()
345 ret = ((stv6110_read_reg(fe, RSTV6110_STAT1)) & 0x04); in stv6110_set_frequency()
350 ret = stv6110_read_reg(fe, RSTV6110_STAT1); in stv6110_set_frequency()
351 stv6110_get_frequency(fe, &result_freq); in stv6110_set_frequency()
360 static int stv6110_set_params(struct dvb_frontend *fe) in stv6110_set_params() argument
362 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in stv6110_set_params()
365 stv6110_set_frequency(fe, c->frequency); in stv6110_set_params()
366 stv6110_set_bandwidth(fe, bandwidth); in stv6110_set_params()
371 static int stv6110_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) in stv6110_get_bandwidth() argument
373 struct stv6110_priv *priv = fe->tuner_priv; in stv6110_get_bandwidth()
376 stv6110_read_regs(fe, regs, 0, 8); in stv6110_get_bandwidth()
403 struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe, in stv6110_attach() argument
424 if (fe->ops.i2c_gate_ctrl) in stv6110_attach()
425 fe->ops.i2c_gate_ctrl(fe, 1); in stv6110_attach()
429 if (fe->ops.i2c_gate_ctrl) in stv6110_attach()
430 fe->ops.i2c_gate_ctrl(fe, 0); in stv6110_attach()
447 memcpy(&fe->ops.tuner_ops, &stv6110_tuner_ops, in stv6110_attach()
449 fe->tuner_priv = priv; in stv6110_attach()
452 return fe; in stv6110_attach()