Lines Matching +full:jd +full:- +full:src
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Zarlink ZL10039 DVB-S tuner
5 * Copyright 2007 Jan D. Louw <jd.louw@mweb.co.za>
64 .addr = state->i2c_addr, in zl10039_read()
69 .addr = state->i2c_addr, in zl10039_read()
78 if (i2c_transfer(state->i2c, msg, 2) != 2) { in zl10039_read()
80 return -EREMOTEIO; in zl10039_read()
87 const enum zl10039_reg_addr reg, const u8 *src, in zl10039_write() argument
92 .addr = state->i2c_addr, in zl10039_write()
102 return -EINVAL; in zl10039_write()
108 memcpy(&buf[1], src, count); in zl10039_write()
109 if (i2c_transfer(state->i2c, &msg, 1) != 1) { in zl10039_write()
111 return -EREMOTEIO; in zl10039_write()
134 struct zl10039_state *state = fe->tuner_priv; in zl10039_init()
138 if (fe->ops.i2c_gate_ctrl) in zl10039_init()
139 fe->ops.i2c_gate_ctrl(fe, 1); in zl10039_init()
151 if (fe->ops.i2c_gate_ctrl) in zl10039_init()
152 fe->ops.i2c_gate_ctrl(fe, 0); in zl10039_init()
159 struct zl10039_state *state = fe->tuner_priv; in zl10039_sleep()
163 if (fe->ops.i2c_gate_ctrl) in zl10039_sleep()
164 fe->ops.i2c_gate_ctrl(fe, 1); in zl10039_sleep()
170 if (fe->ops.i2c_gate_ctrl) in zl10039_sleep()
171 fe->ops.i2c_gate_ctrl(fe, 0); in zl10039_sleep()
178 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in zl10039_set_params()
179 struct zl10039_state *state = fe->tuner_priv; in zl10039_set_params()
188 c->frequency, c->symbol_rate); in zl10039_set_params()
192 div = (c->frequency * 1000) / 126387; in zl10039_set_params()
193 fbw = (c->symbol_rate * 27) / 32000; in zl10039_set_params()
195 bf = ((fbw * 5088) / 1011100) - 1; in zl10039_set_params()
211 if (fe->ops.i2c_gate_ctrl) in zl10039_set_params()
212 fe->ops.i2c_gate_ctrl(fe, 1); in zl10039_set_params()
227 if (fe->ops.i2c_gate_ctrl) in zl10039_set_params()
228 fe->ops.i2c_gate_ctrl(fe, 0); in zl10039_set_params()
237 struct zl10039_state *state = fe->tuner_priv; in zl10039_release()
241 fe->tuner_priv = NULL; in zl10039_release()
261 state->i2c = i2c; in zl10039_attach()
262 state->i2c_addr = i2c_addr; in zl10039_attach()
265 if (fe->ops.i2c_gate_ctrl) in zl10039_attach()
266 fe->ops.i2c_gate_ctrl(fe, 1); in zl10039_attach()
268 if (zl10039_readreg(state, GENERAL, &state->id) < 0) { in zl10039_attach()
270 if (fe->ops.i2c_gate_ctrl) in zl10039_attach()
271 fe->ops.i2c_gate_ctrl(fe, 0); in zl10039_attach()
275 if (fe->ops.i2c_gate_ctrl) in zl10039_attach()
276 fe->ops.i2c_gate_ctrl(fe, 0); in zl10039_attach()
278 state->id = state->id & 0x0f; in zl10039_attach()
279 switch (state->id) { in zl10039_attach()
281 strscpy(fe->ops.tuner_ops.info.name, in zl10039_attach()
282 "Zarlink ZL10039 DVB-S tuner", in zl10039_attach()
283 sizeof(fe->ops.tuner_ops.info.name)); in zl10039_attach()
286 dprintk("Chip ID=%x does not match a known type\n", state->id); in zl10039_attach()
290 memcpy(&fe->ops.tuner_ops, &zl10039_ops, sizeof(struct dvb_tuner_ops)); in zl10039_attach()
291 fe->tuner_priv = state; in zl10039_attach()
302 MODULE_DESCRIPTION("Zarlink ZL10039 DVB-S tuner driver");
303 MODULE_AUTHOR("Jan D. Louw <jd.louw@mweb.co.za>");