Lines Matching +full:2 +full:c
3 * Panasonic MN88473 DVB-T/T2/C demodulator driver
5 * Copyright (C) 2014 Antti Palosaari <crope@iki.fi>
21 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in mn88473_set_frontend() local
30 c->delivery_system, c->modulation, c->frequency, in mn88473_set_frontend()
31 c->bandwidth_hz, c->symbol_rate, c->inversion, c->stream_id); in mn88473_set_frontend()
38 switch (c->delivery_system) { in mn88473_set_frontend()
59 switch (c->delivery_system) { in mn88473_set_frontend()
62 switch (c->bandwidth_hz) { in mn88473_set_frontend()
106 if_val[2] = (uitmp >> 0) & 0xff; in mn88473_set_frontend()
108 ret = regmap_write(dev->regmap[2], 0x05, 0x00); in mn88473_set_frontend()
111 ret = regmap_write(dev->regmap[2], 0xfb, 0x13); in mn88473_set_frontend()
114 ret = regmap_write(dev->regmap[2], 0xef, 0x13); in mn88473_set_frontend()
117 ret = regmap_write(dev->regmap[2], 0xf9, 0x13); in mn88473_set_frontend()
120 ret = regmap_write(dev->regmap[2], 0x00, 0x18); in mn88473_set_frontend()
123 ret = regmap_write(dev->regmap[2], 0x01, 0x01); in mn88473_set_frontend()
126 ret = regmap_write(dev->regmap[2], 0x02, 0x21); in mn88473_set_frontend()
129 ret = regmap_write(dev->regmap[2], 0x03, delivery_system_val); in mn88473_set_frontend()
132 ret = regmap_write(dev->regmap[2], 0x0b, 0x00); in mn88473_set_frontend()
137 ret = regmap_write(dev->regmap[2], 0x10 + i, if_val[i]); in mn88473_set_frontend()
142 switch (c->delivery_system) { in mn88473_set_frontend()
146 ret = regmap_write(dev->regmap[2], 0x13 + i, in mn88473_set_frontend()
161 ret = regmap_write(dev->regmap[2], 0x2d, reg_bank2_2d_val); in mn88473_set_frontend()
164 ret = regmap_write(dev->regmap[2], 0x2e, 0x00); in mn88473_set_frontend()
167 ret = regmap_write(dev->regmap[2], 0x56, 0x0d); in mn88473_set_frontend()
198 ret = regmap_bulk_write(dev->regmap[0], 0x40, "\xf4\x08", 2); in mn88473_set_frontend()
218 if (c->delivery_system == SYS_DVBT2) { in mn88473_set_frontend()
219 ret = regmap_write(dev->regmap[2], 0x36, in mn88473_set_frontend()
220 (c->stream_id == NO_STREAM_ID_FILTER) ? 0 : in mn88473_set_frontend()
221 c->stream_id ); in mn88473_set_frontend()
227 ret = regmap_write(dev->regmap[2], 0xf8, 0x9f); in mn88473_set_frontend()
241 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in mn88473_read_status() local
252 switch (c->delivery_system) { in mn88473_read_status()
270 ret = regmap_read(dev->regmap[2], 0x8b, &utmp); in mn88473_read_status()
313 for (i = 0; i < 2; i++) { in mn88473_read_status()
314 ret = regmap_bulk_read(dev->regmap[2], 0x86 + i, in mn88473_read_status()
321 utmp1 = buf[0] << 8 | buf[1] << 0 | buf[0] >> 2; in mn88473_read_status()
324 c->strength.stat[0].scale = FE_SCALE_RELATIVE; in mn88473_read_status()
325 c->strength.stat[0].uvalue = utmp1; in mn88473_read_status()
327 c->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_read_status()
331 if (*status & FE_HAS_VITERBI && c->delivery_system == SYS_DVBT) { in mn88473_read_status()
333 ret = regmap_bulk_read(dev->regmap[0], 0x8f, buf, 2); in mn88473_read_status()
348 c->cnr.stat[0].svalue = stmp; in mn88473_read_status()
349 c->cnr.stat[0].scale = FE_SCALE_DECIBEL; in mn88473_read_status()
351 c->delivery_system == SYS_DVBT2) { in mn88473_read_status()
354 ret = regmap_bulk_read(dev->regmap[2], 0xb7 + i, in mn88473_read_status()
360 utmp = buf[1] << 8 | buf[2] << 0; in mn88473_read_status()
361 utmp1 = (buf[0] >> 2) & 0x01; /* 0=SISO, 1=MISO */ in mn88473_read_status()
382 c->cnr.stat[0].svalue = stmp; in mn88473_read_status()
383 c->cnr.stat[0].scale = FE_SCALE_DECIBEL; in mn88473_read_status()
385 c->delivery_system == SYS_DVBC_ANNEX_A) { in mn88473_read_status()
386 /* DVB-C CNR */ in mn88473_read_status()
392 utmp2 = buf[2] << 8 | buf[3] << 0; /* noise */ in mn88473_read_status()
404 c->cnr.stat[0].svalue = stmp; in mn88473_read_status()
405 c->cnr.stat[0].scale = FE_SCALE_DECIBEL; in mn88473_read_status()
407 c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_read_status()
411 if (*status & FE_HAS_LOCK && (c->delivery_system == SYS_DVBT || in mn88473_read_status()
412 c->delivery_system == SYS_DVBC_ANNEX_A)) { in mn88473_read_status()
413 /* DVB-T & DVB-C BER */ in mn88473_read_status()
418 utmp1 = buf[0] << 16 | buf[1] << 8 | buf[2] << 0; in mn88473_read_status()
424 c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; in mn88473_read_status()
425 c->post_bit_error.stat[0].uvalue += utmp1; in mn88473_read_status()
426 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; in mn88473_read_status()
427 c->post_bit_count.stat[0].uvalue += utmp2; in mn88473_read_status()
429 c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_read_status()
430 c->post_bit_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_read_status()
440 utmp2 = buf[2] << 8 | buf[3] << 0; in mn88473_read_status()
444 c->block_error.stat[0].scale = FE_SCALE_COUNTER; in mn88473_read_status()
445 c->block_error.stat[0].uvalue += utmp1; in mn88473_read_status()
446 c->block_count.stat[0].scale = FE_SCALE_COUNTER; in mn88473_read_status()
447 c->block_count.stat[0].uvalue += utmp2; in mn88473_read_status()
449 c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_read_status()
450 c->block_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_read_status()
463 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in mn88473_init() local
521 ret = regmap_write(dev->regmap[2], 0x09, 0x08); in mn88473_init()
524 ret = regmap_write(dev->regmap[2], 0x08, 0x1d); in mn88473_init()
531 c->strength.len = 1; in mn88473_init()
532 c->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_init()
533 c->cnr.len = 1; in mn88473_init()
534 c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_init()
535 c->post_bit_error.len = 1; in mn88473_init()
536 c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_init()
537 c->post_bit_count.len = 1; in mn88473_init()
538 c->post_bit_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_init()
539 c->block_error.len = 1; in mn88473_init()
540 c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_init()
541 c->block_count.len = 1; in mn88473_init()
542 c->block_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mn88473_init()
562 ret = regmap_write(dev->regmap[2], 0x05, 0x3e); in mn88473_sleep()
657 * Also, register bank 2 do not support sequential I/O. Only single in mn88473_probe()
673 dev->client[2] = i2c_new_dummy_device(client->adapter, 0x1c); in mn88473_probe()
674 if (IS_ERR(dev->client[2])) { in mn88473_probe()
675 ret = PTR_ERR(dev->client[2]); in mn88473_probe()
676 dev_err(&client->dev, "2nd I2C registration failed\n"); in mn88473_probe()
679 dev->regmap[2] = regmap_init_i2c(dev->client[2], ®map_config); in mn88473_probe()
680 if (IS_ERR(dev->regmap[2])) { in mn88473_probe()
681 ret = PTR_ERR(dev->regmap[2]); in mn88473_probe()
684 i2c_set_clientdata(dev->client[2], dev); in mn88473_probe()
687 ret = regmap_read(dev->regmap[2], 0xff, &uitmp); in mn88473_probe()
699 ret = regmap_write(dev->regmap[2], 0x05, 0x3e); in mn88473_probe()
713 regmap_exit(dev->regmap[2]); in mn88473_probe()
715 i2c_unregister_device(dev->client[2]); in mn88473_probe()
735 regmap_exit(dev->regmap[2]); in mn88473_remove()
736 i2c_unregister_device(dev->client[2]); in mn88473_remove()
765 MODULE_DESCRIPTION("Panasonic MN88473 DVB-T/T2/C demodulator driver");