2019-05-19 07:51:31 -06:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2011-07-31 22:07:39 -06:00
|
|
|
/*
|
|
|
|
* NXP TDA10071 + Conexant CX24118A DVB-S/S2 demodulator + tuner driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Antti Palosaari <crope@iki.fi>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TDA10071_PRIV
|
|
|
|
#define TDA10071_PRIV
|
|
|
|
|
2017-12-28 11:03:51 -07:00
|
|
|
#include <media/dvb_frontend.h>
|
2011-07-31 22:07:39 -06:00
|
|
|
#include "tda10071.h"
|
|
|
|
#include <linux/firmware.h>
|
2015-04-20 19:21:44 -06:00
|
|
|
#include <linux/regmap.h>
|
2011-07-31 22:07:39 -06:00
|
|
|
|
2015-04-20 17:04:00 -06:00
|
|
|
struct tda10071_dev {
|
2011-07-31 22:07:39 -06:00
|
|
|
struct dvb_frontend fe;
|
2015-04-16 08:46:24 -06:00
|
|
|
struct i2c_client *client;
|
2015-04-20 19:21:44 -06:00
|
|
|
struct regmap *regmap;
|
2015-04-21 06:58:15 -06:00
|
|
|
struct mutex cmd_execute_mutex;
|
2015-04-20 16:54:56 -06:00
|
|
|
u32 clk;
|
|
|
|
u16 i2c_wr_max;
|
|
|
|
u8 ts_mode;
|
|
|
|
bool spec_inv;
|
|
|
|
u8 pll_multiplier;
|
|
|
|
u8 tuner_i2c_addr;
|
2011-07-31 22:07:39 -06:00
|
|
|
|
2015-04-21 08:14:44 -06:00
|
|
|
u8 meas_count;
|
|
|
|
u32 dvbv3_ber;
|
2015-06-07 11:53:52 -06:00
|
|
|
enum fe_status fe_status;
|
|
|
|
enum fe_delivery_system delivery_system;
|
2011-07-31 22:07:39 -06:00
|
|
|
bool warm; /* FW running */
|
2015-04-21 08:14:44 -06:00
|
|
|
u64 post_bit_error;
|
|
|
|
u64 block_error;
|
2011-07-31 22:07:39 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct tda10071_modcod {
|
2015-06-07 11:53:52 -06:00
|
|
|
enum fe_delivery_system delivery_system;
|
|
|
|
enum fe_modulation modulation;
|
|
|
|
enum fe_code_rate fec;
|
2011-07-31 22:07:39 -06:00
|
|
|
u8 val;
|
|
|
|
} TDA10071_MODCOD[] = {
|
|
|
|
/* NBC-QPSK */
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_AUTO, 0x00 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_1_2, 0x04 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_3_5, 0x05 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_2_3, 0x06 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_3_4, 0x07 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_4_5, 0x08 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_5_6, 0x09 },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_8_9, 0x0a },
|
|
|
|
{ SYS_DVBS2, QPSK, FEC_9_10, 0x0b },
|
|
|
|
/* 8PSK */
|
2014-07-07 06:05:15 -06:00
|
|
|
{ SYS_DVBS2, PSK_8, FEC_AUTO, 0x00 },
|
2011-07-31 22:07:39 -06:00
|
|
|
{ SYS_DVBS2, PSK_8, FEC_3_5, 0x0c },
|
|
|
|
{ SYS_DVBS2, PSK_8, FEC_2_3, 0x0d },
|
|
|
|
{ SYS_DVBS2, PSK_8, FEC_3_4, 0x0e },
|
|
|
|
{ SYS_DVBS2, PSK_8, FEC_5_6, 0x0f },
|
|
|
|
{ SYS_DVBS2, PSK_8, FEC_8_9, 0x10 },
|
|
|
|
{ SYS_DVBS2, PSK_8, FEC_9_10, 0x11 },
|
|
|
|
/* QPSK */
|
|
|
|
{ SYS_DVBS, QPSK, FEC_AUTO, 0x2d },
|
|
|
|
{ SYS_DVBS, QPSK, FEC_1_2, 0x2e },
|
|
|
|
{ SYS_DVBS, QPSK, FEC_2_3, 0x2f },
|
|
|
|
{ SYS_DVBS, QPSK, FEC_3_4, 0x30 },
|
|
|
|
{ SYS_DVBS, QPSK, FEC_5_6, 0x31 },
|
|
|
|
{ SYS_DVBS, QPSK, FEC_7_8, 0x32 },
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tda10071_reg_val_mask {
|
|
|
|
u8 reg;
|
|
|
|
u8 val;
|
|
|
|
u8 mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* firmware filename */
|
2012-09-12 08:37:29 -06:00
|
|
|
#define TDA10071_FIRMWARE "dvb-fe-tda10071.fw"
|
2011-07-31 22:07:39 -06:00
|
|
|
|
|
|
|
/* firmware commands */
|
|
|
|
#define CMD_DEMOD_INIT 0x10
|
|
|
|
#define CMD_CHANGE_CHANNEL 0x11
|
|
|
|
#define CMD_MPEG_CONFIG 0x13
|
|
|
|
#define CMD_TUNER_INIT 0x15
|
|
|
|
#define CMD_GET_AGCACC 0x1a
|
|
|
|
|
|
|
|
#define CMD_LNB_CONFIG 0x20
|
|
|
|
#define CMD_LNB_SEND_DISEQC 0x21
|
|
|
|
#define CMD_LNB_SET_DC_LEVEL 0x22
|
|
|
|
#define CMD_LNB_PCB_CONFIG 0x23
|
|
|
|
#define CMD_LNB_SEND_TONEBURST 0x24
|
|
|
|
#define CMD_LNB_UPDATE_REPLY 0x25
|
|
|
|
|
|
|
|
#define CMD_GET_FW_VERSION 0x35
|
|
|
|
#define CMD_SET_SLEEP_MODE 0x36
|
|
|
|
#define CMD_BER_CONTROL 0x3e
|
|
|
|
#define CMD_BER_UPDATE_COUNTERS 0x3f
|
|
|
|
|
2015-02-26 03:13:06 -07:00
|
|
|
/* firmware command struct */
|
2012-07-01 12:59:13 -06:00
|
|
|
#define TDA10071_ARGLEN 30
|
2011-07-31 22:07:39 -06:00
|
|
|
struct tda10071_cmd {
|
|
|
|
u8 args[TDA10071_ARGLEN];
|
|
|
|
u8 len;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* TDA10071_PRIV */
|