Lines Matching refs:state
206 static int s921_i2c_writereg(struct s921_state *state, in s921_i2c_writereg() argument
215 rc = i2c_transfer(state->i2c, &msg, 1); in s921_i2c_writereg()
225 static int s921_i2c_writeregdata(struct s921_state *state, u8 i2c_addr, in s921_i2c_writeregdata() argument
231 rc = s921_i2c_writereg(state, i2c_addr, rd[i].reg, rd[i].data); in s921_i2c_writeregdata()
238 static int s921_i2c_readreg(struct s921_state *state, u8 i2c_addr, u8 reg) in s921_i2c_readreg() argument
247 rc = i2c_transfer(state->i2c, msg, 2); in s921_i2c_readreg()
257 #define s921_readreg(state, reg) \ argument
258 s921_i2c_readreg(state, state->config->demod_address, reg)
259 #define s921_writereg(state, reg, val) \ argument
260 s921_i2c_writereg(state, state->config->demod_address, reg, val)
261 #define s921_writeregdata(state, regdata) \ argument
262 s921_i2c_writeregdata(state, state->config->demod_address, \
268 struct s921_state *state = fe->demodulator_priv; in s921_pll_tune() local
292 rc = s921_writeregdata(state, s921_prefreq); in s921_pll_tune()
296 rc = s921_writereg(state, 0xf2, (f_offset >> 8) & 0xff); in s921_pll_tune()
300 rc = s921_writereg(state, 0xf3, f_offset & 0xff); in s921_pll_tune()
304 rc = s921_writereg(state, 0xf4, f_switch); in s921_pll_tune()
308 rc = s921_writeregdata(state, s921_postfreq); in s921_pll_tune()
313 rc = s921_readreg(state, 0x80); in s921_pll_tune()
316 rc = s921_writereg(state, 0x01, 0x40); in s921_pll_tune()
320 rc = s921_readreg(state, 0x01); in s921_pll_tune()
323 rc = s921_readreg(state, 0x80); in s921_pll_tune()
326 rc = s921_readreg(state, 0x80); in s921_pll_tune()
329 rc = s921_readreg(state, 0x32); in s921_pll_tune()
339 struct s921_state *state = fe->demodulator_priv; in s921_initfe() local
344 rc = s921_writeregdata(state, s921_init); in s921_initfe()
353 struct s921_state *state = fe->demodulator_priv; in s921_read_status() local
358 rc = s921_readreg(state, 0x81); in s921_read_status()
364 rc = s921_readreg(state, 0x82); in s921_read_status()
393 struct s921_state *state = fe->demodulator_priv; in s921_read_signal_strength() local
405 rc = s921_readreg(state, 0x01); in s921_read_signal_strength()
408 rc = s921_readreg(state, 0x80); in s921_read_signal_strength()
411 rc = s921_readreg(state, 0x32); in s921_read_signal_strength()
420 struct s921_state *state = fe->demodulator_priv; in s921_set_frontend() local
431 state->currentfreq = p->frequency; in s921_set_frontend()
439 struct s921_state *state = fe->demodulator_priv; in s921_get_frontend() local
442 p->frequency = state->currentfreq; in s921_get_frontend()
474 struct s921_state *state = fe->demodulator_priv; in s921_release() local
477 kfree(state); in s921_release()
486 struct s921_state *state = in s921_attach() local
490 if (!state) { in s921_attach()
496 state->config = config; in s921_attach()
497 state->i2c = i2c; in s921_attach()
500 memcpy(&state->frontend.ops, &s921_ops, in s921_attach()
502 state->frontend.demodulator_priv = state; in s921_attach()
504 return &state->frontend; in s921_attach()