Commit 27d40321 authored by Manu Abraham's avatar Manu Abraham Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (11682): STV0900/STV0903: Add support for Silicon cut >= 3



1. Support Silicon Cut >= 3.0
2. Remove support for obsolete cuts: 1.0. 1.1. 1.2
3. Try to catch more error cases

Driver doesn't now attach to obsolete silcon cuts, It just simply quits.
Results in code simplification, with removal of the obsolete cuts.

Signed-off-by: default avatarManu Abraham <manu@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b5b2b7ed
Loading
Loading
Loading
Loading
+689 −480

File changed.

Preview size limit exceeded, changes collapsed.

+14 −19
Original line number Diff line number Diff line
@@ -77,7 +77,18 @@

#define MAKEWORD16(__a, __b)			(((__a) << 8) | (__b))

#define STV090x_SEARCH_AGC2_TH		700
#define MSB(__x)				((__x >> 8) & 0xff)
#define LSB(__x)				(__x & 0xff)


#define STV090x_IQPOWER_THRESHOLD	  30
#define STV090x_SEARCH_AGC2_TH_CUT20	 700
#define STV090x_SEARCH_AGC2_TH_CUT30	1200

#define STV090x_SEARCH_AGC2_TH(__ver)	\
	((__ver <= 0x20) ?		\
	STV090x_SEARCH_AGC2_TH_CUT20 :	\
	STV090x_SEARCH_AGC2_TH_CUT30)

enum stv090x_signal_state {
	STV090x_NOCARRIER,
@@ -201,23 +212,7 @@ struct stv090x_long_frame_crloop {
struct stv090x_short_frame_crloop {
	enum stv090x_modulation	modulation;

	u8 crl_cut12_2; /* Cut 1.2, SR <= 3M */
	u8 crl_cut20_2; /* Cut 2.0, SR <  3M */
	u8 crl_cut12_5; /* Cut 1.2, 3 < SR <= 7M */
	u8 crl_cut20_5; /* Cut 2.0, 3 < SR <= 7M */
	u8 crl_cut12_10; /* Cut 1.2, 7 < SR <= 15M */
	u8 crl_cut20_10; /* Cut 2.0, 7 < SR <= 15M */
	u8 crl_cut12_20; /* Cut 1.2, 10 < SR <= 25M */
	u8 crl_cut20_20; /* Cut 2.0, 10 < SR <= 25M */
	u8 crl_cut12_30; /* Cut 1.2, 25 < SR <= 45M */
	u8 crl_cut20_30; /* Cut 2.0, 10 < SR <= 45M */
};


struct stv090x_short_frame_vsmod_crloop {
	enum stv090x_modulation	modulation;

	u8 crl_2; /*           <  3M */
	u8 crl_2;  /*      SR <   3M */
	u8 crl_5;  /*  3 < SR <=  7M */
	u8 crl_10; /*  7 < SR <= 15M */
	u8 crl_20; /* 10 < SR <= 25M */
+63 −9
Original line number Diff line number Diff line
@@ -793,10 +793,16 @@
#define STV090x_Px_DEMOD(__x)			(0xF410 - (__x - 1) * 0x200)
#define STV090x_P1_DEMOD			STV090x_Px_DEMOD(1)
#define STV090x_P2_DEMOD			STV090x_Px_DEMOD(2)
#define STV090x_OFFST_Px_MANUAL_S2ROLLOFF_FIELD	7
#define STV090x_WIDTH_Px_MANUAL_S2ROLLOFF_FIELD	1
#define STV090x_OFFST_Px_DEMOD_STOP_FIELD	6
#define STV090x_WIDTH_Px_DEMOD_STOP_FIELD	1
#define STV090x_OFFST_Px_SPECINV_CONTROL_FIELD	4
#define STV090x_WIDTH_Px_SPECINV_CONTROL_FIELD	2
#define STV090x_OFFST_Px_MANUAL_ROLLOFF_FIELD	2
#define STV090x_WIDTH_Px_MANUAL_ROLLOFF_FIELD	1
#define STV090x_OFFST_Px_FORCE_ENASAMP_FIELD	3
#define STV090x_WIDTH_Px_FORCE_ENASAMP_FIELD	1
#define STV090x_OFFST_Px_MANUAL_SXROLLOFF_FIELD	2
#define STV090x_WIDTH_Px_MANUAL_SXROLLOFF_FIELD	1
#define STV090x_OFFST_Px_ROLLOFF_CONTROL_FIELD	0
#define STV090x_WIDTH_Px_ROLLOFF_CONTROL_FIELD	2

@@ -1566,6 +1572,42 @@
#define STV090x_OFFST_Px_DIS_QP_1_4_FIELD	4
#define STV090x_WIDTH_Px_DIS_QP_1_4_FIELD	4

#define STV090x_Px_GAUSSR0(__x)			(0xf4c0 - (__x - 1) * 0x200)
#define STV090x_P1_GAUSSR0			STV090x_Px_GAUSSR0(1)
#define STV090x_P2_GAUSSR0			STV090x_Px_GAUSSR0(2)
#define STV090x_OFFST_Px_EN_CCIMODE_FIELD	7
#define STV090x_WIDTH_Px_EN_CCIMODE_FIELD	1
#define STV090x_OFFST_Px_R0_GAUSSIEN_FIELD	0
#define STV090x_WIDTH_Px_R0_GAUSSIEN_FIELD	7

#define STV090x_Px_CCIR0(__x)			(0xf4c1 - (__x - 1) * 0x200)
#define STV090x_P1_CCIR0			STV090x_Px_CCIR0(1)
#define STV090x_P2_CCIR0			STV090x_Px_CCIR0(2)
#define STV090x_OFFST_Px_CCIDETECT_PLH_FIELD	7
#define STV090x_WIDTH_Px_CCIDETECT_PLH_FIELD	1
#define STV090x_OFFST_Px_R0_CCI_FIELD		0
#define STV090x_WIDTH_Px_R0_CCI_FIELD		7

#define STV090x_Px_CCIQUANT(__x)		(0xf4c2 - (__x - 1) * 0x200)
#define STV090x_P1_CCIQUANT			STV090x_Px_CCIQUANT(1)
#define STV090x_P2_CCIQUANT			STV090x_Px_CCIQUANT(2)
#define STV090x_OFFST_Px_CCI_BETA_FIELD		5
#define STV090x_WIDTH_Px_CCI_BETA_FIELD		3
#define STV090x_OFFST_Px_CCI_QUANT_FIELD	0
#define STV090x_WIDTH_Px_CCI_QUANT_FIELD	5

#define STV090x_Px_CCITHRESH(__x)		(0xf4c3 - (__x - 1) * 0x200)
#define STV090x_P1_CCITHRESH			STV090x_Px_CCITHRESH(1)
#define STV090x_P2_CCITHRESH			STV090x_Px_CCITHRESH(2)
#define STV090x_OFFST_Px_CCI_THRESHOLD_FIELD	0
#define STV090x_WIDTH_Px_CCI_THRESHOLD_FIELD	8

#define STV090x_Px_CCIACC(__x)			(0xf4c4 - (__x - 1) * 0x200)
#define STV090x_P1_CCIACC			STV090x_Px_CCIACC(1)
#define STV090x_P2_CCIACC			STV090x_Px_CCIACC(1)
#define STV090x_OFFST_Px_CCI_VALUE_FIELD	0
#define STV090x_WIDTH_Px_CCI_VALUE_FIELD	8

#define STV090x_Px_DMDRESCFG(__x)		(0xF4C6 - (__x - 1) * 0x200)
#define STV090x_P1_DMDRESCFG			STV090x_Px_DMDRESCFG(1)
#define STV090x_P2_DMDRESCFG			STV090x_Px_DMDRESCFG(2)
@@ -1847,6 +1889,18 @@
#define STV090x_Px_PDELCTRL2(__x)		(0xf551 - (__x - 1) * 0x200)
#define STV090x_P1_PDELCTRL2			STV090x_Px_PDELCTRL2(1)
#define STV090x_P2_PDELCTRL2			STV090x_Px_PDELCTRL2(2)
#define STV090x_OFFST_Px_FORCE_CONTINUOUS	7
#define STV090x_WIDTH_Px_FORCE_CONTINUOUS	1
#define STV090x_OFFST_Px_RESET_UPKO_COUNT	6
#define STV090x_WIDTH_Px_RESET_UPKO_COUNT	1
#define STV090x_OFFST_Px_USER_PKTDELIN_NB	5
#define STV090x_WIDTH_Px_USER_PKTDELIN_NB	1
#define STV090x_OFFST_Px_FORCE_LOCKED		4
#define STV090x_WIDTH_Px_FORCE_LOCKED		1
#define STV090x_OFFST_Px_DATA_UNBBSCRAM		3
#define STV090x_WIDTH_Px_DATA_UNBBSCRAM		1
#define STV090x_OFFST_Px_FORCE_LONGPACKET	2
#define STV090x_WIDTH_Px_FORCE_LONGPACKET	1
#define STV090x_OFFST_Px_FRAME_MODE_FIELD	1
#define STV090x_WIDTH_Px_FRAME_MODE_FIELD	1