// SPDX-License-Identifier: GPL-2.0 /* * Sharp QM1D1B0004 satellite tuner * * Copyright (C) 2014 Akihiro Tsukada <[email protected]> * * based on (former) drivers/media/pci/pt1/va1j5jf8007s.c. */ /* * Note: * Since the data-sheet of this tuner chip is not available, * this driver lacks some tuner_ops and config options. * In addition, the implementation might be dependent on the specific use * in the FE module: VA1J5JF8007S and/or in the product: Earthsoft PT1/PT2. */ #include <linux/kernel.h> #include <linux/module.h> #include <media/dvb_frontend.h> #include "qm1d1b0004.h" /* * Tuner I/F (copied from the former va1j5jf8007s.c) * b[0] I2C addr * b[1] "0":1, BG:2, divider_quotient[7:3]:5 * b[2] divider_quotient[2:0]:3, divider_remainder:5 * b[3] "111":3, LPF[3:2]:2, TM:1, "0":1, REF:1 * b[4] BANDX, PSC:1, LPF[1:0]:2, DIV:1, "0":1 * * PLL frequency step := * REF == 0 -> PLL XTL frequency(4MHz) / 8 * REF == 1 -> PLL XTL frequency(4MHz) / 4 * * PreScaler := * PSC == 0 -> x32 * PSC == 1 -> x16 * * divider_quotient := (frequency / PLL frequency step) / PreScaler * divider_remainder := (frequency / PLL frequency step) % PreScaler * * LPF := LPF Frequency / 1000 / 2 - 2 * LPF Frequency @ baudrate=28.86Mbps = 30000 * * band (1..9) * band 1 (freq < 986000) -> DIV:1, BANDX:5, PSC:1 * band 2 (freq < 1072000) -> DIV:1, BANDX:6, PSC:1 * band 3 (freq < 1154000) -> DIV:1, BANDX:7, PSC:0 * band 4 (freq < 1291000) -> DIV:0, BANDX:1, PSC:0 * band 5 (freq < 1447000) -> DIV:0, BANDX:2, PSC:0 * band 6 (freq < 1615000) -> DIV:0, BANDX:3, PSC:0 * band 7 (freq < 1791000) -> DIV:0, BANDX:4, PSC:0 * band 8 (freq < 1972000) -> DIV:0, BANDX:5, PSC:0 * band 9 (freq < 2150000) -> DIV:0, BANDX:6, PSC:0 */ #define QM1D1B0004_PSC_MASK … #define QM1D1B0004_XTL_FREQ … #define QM1D1B0004_LPF_FALLBACK … #if 0 /* Currently unused */ static const struct qm1d1b0004_config default_cfg = { .lpf_freq = QM1D1B0004_CFG_LPF_DFLT, .half_step = false, }; #endif struct qm1d1b0004_state { … }; struct qm1d1b0004_cb_map { … }; static const struct qm1d1b0004_cb_map cb_maps[] = …; static u8 lookup_cb(u32 frequency) { … } static int qm1d1b0004_set_params(struct dvb_frontend *fe) { … } static int qm1d1b0004_set_config(struct dvb_frontend *fe, void *priv_cfg) { … } static int qm1d1b0004_init(struct dvb_frontend *fe) { … } static const struct dvb_tuner_ops qm1d1b0004_ops = …; static int qm1d1b0004_probe(struct i2c_client *client) { … } static void qm1d1b0004_remove(struct i2c_client *client) { … } static const struct i2c_device_id qm1d1b0004_id[] = …; MODULE_DEVICE_TABLE(i2c, qm1d1b0004_id); static struct i2c_driver qm1d1b0004_driver = …; module_i2c_driver(…) …; MODULE_DESCRIPTION(…) …; MODULE_AUTHOR(…) …; MODULE_LICENSE(…) …;