V4L/DVB (13338): stv0900: big rework to support cut 3.0.

Patch 1 of 4.
Also patch changes logic to prevent code repetitions and big indents.
It makes checkpatch silent :)

Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Igor M. Liplianin 2009-11-06 23:07:56 -03:00 committed by Mauro Carvalho Chehab
parent 502cd96d5b
commit 46960eea9c
2 changed files with 224 additions and 114 deletions

View File

@ -141,85 +141,228 @@ struct stv0900_short_frames_car_loop_optim {
};
struct stv0900_short_frames_car_loop_optim_vs_mod {
enum fe_stv0900_modulation modulation;
u8 car_loop_2; /* SR<3msps */
u8 car_loop_5; /* 3<SR<=7msps */
u8 car_loop_10; /* 7<SR<=15msps */
u8 car_loop_20; /* 10<SR<=25msps */
u8 car_loop_30; /* 10<SR<=45msps */
};
/* Cut 1.x Tracking carrier loop carrier QPSK 1/2 to 8PSK 9/10 long Frame */
static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoop[14] = {
/*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_12, 0x1C, 0x0D, 0x1B, 0x2C, 0x3A, 0x1C, 0x2A, 0x3B, 0x2A, 0x1B },
{ STV0900_QPSK_35, 0x2C, 0x0D, 0x2B, 0x2C, 0x3A, 0x0C, 0x3A, 0x2B, 0x2A, 0x0B },
{ STV0900_QPSK_23, 0x2C, 0x0D, 0x2B, 0x2C, 0x0B, 0x0C, 0x3A, 0x1B, 0x2A, 0x3A },
{ STV0900_QPSK_34, 0x3C, 0x0D, 0x3B, 0x1C, 0x0B, 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_45, 0x3C, 0x0D, 0x3B, 0x1C, 0x0B, 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_56, 0x0D, 0x0D, 0x3B, 0x1C, 0x0B, 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_89, 0x0D, 0x0D, 0x3B, 0x1C, 0x1B, 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_910, 0x1D, 0x0D, 0x3B, 0x1C, 0x1B, 0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_8PSK_35, 0x29, 0x3B, 0x09, 0x2B, 0x38, 0x0B, 0x18, 0x1A, 0x08, 0x0A },
{ STV0900_8PSK_23, 0x0A, 0x3B, 0x29, 0x2B, 0x19, 0x0B, 0x38, 0x1A, 0x18, 0x0A },
{ STV0900_8PSK_34, 0x3A, 0x3B, 0x2A, 0x2B, 0x39, 0x0B, 0x19, 0x1A, 0x38, 0x0A },
{ STV0900_8PSK_56, 0x1B, 0x3B, 0x0B, 0x2B, 0x1A, 0x0B, 0x39, 0x1A, 0x19, 0x0A },
{ STV0900_8PSK_89, 0x3B, 0x3B, 0x0B, 0x2B, 0x2A, 0x0B, 0x39, 0x1A, 0x29, 0x39 },
{ STV0900_8PSK_910, 0x3B, 0x3B, 0x0B, 0x2B, 0x2A, 0x0B, 0x39, 0x1A, 0x29, 0x39 }
static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoop[14] = {
/*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_12, 0x1C, 0x0D, 0x1B, 0x2C, 0x3A,
0x1C, 0x2A, 0x3B, 0x2A, 0x1B },
{ STV0900_QPSK_35, 0x2C, 0x0D, 0x2B, 0x2C, 0x3A,
0x0C, 0x3A, 0x2B, 0x2A, 0x0B },
{ STV0900_QPSK_23, 0x2C, 0x0D, 0x2B, 0x2C, 0x0B,
0x0C, 0x3A, 0x1B, 0x2A, 0x3A },
{ STV0900_QPSK_34, 0x3C, 0x0D, 0x3B, 0x1C, 0x0B,
0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_45, 0x3C, 0x0D, 0x3B, 0x1C, 0x0B,
0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_56, 0x0D, 0x0D, 0x3B, 0x1C, 0x0B,
0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_89, 0x0D, 0x0D, 0x3B, 0x1C, 0x1B,
0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_QPSK_910, 0x1D, 0x0D, 0x3B, 0x1C, 0x1B,
0x3B, 0x3A, 0x0B, 0x2A, 0x3A },
{ STV0900_8PSK_35, 0x29, 0x3B, 0x09, 0x2B, 0x38,
0x0B, 0x18, 0x1A, 0x08, 0x0A },
{ STV0900_8PSK_23, 0x0A, 0x3B, 0x29, 0x2B, 0x19,
0x0B, 0x38, 0x1A, 0x18, 0x0A },
{ STV0900_8PSK_34, 0x3A, 0x3B, 0x2A, 0x2B, 0x39,
0x0B, 0x19, 0x1A, 0x38, 0x0A },
{ STV0900_8PSK_56, 0x1B, 0x3B, 0x0B, 0x2B, 0x1A,
0x0B, 0x39, 0x1A, 0x19, 0x0A },
{ STV0900_8PSK_89, 0x3B, 0x3B, 0x0B, 0x2B, 0x2A,
0x0B, 0x39, 0x1A, 0x29, 0x39 },
{ STV0900_8PSK_910, 0x3B, 0x3B, 0x0B, 0x2B, 0x2A,
0x0B, 0x39, 0x1A, 0x29, 0x39 }
};
/* Cut 2.0 Tracking carrier loop carrier QPSK 1/2 to 8PSK 9/10 long Frame */
static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoopCut20[14] = {
/* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_12, 0x1F, 0x3F, 0x1E, 0x3F, 0x3D, 0x1F, 0x3D, 0x3E, 0x3D, 0x1E },
{ STV0900_QPSK_35, 0x2F, 0x3F, 0x2E, 0x2F, 0x3D, 0x0F, 0x0E, 0x2E, 0x3D, 0x0E },
{ STV0900_QPSK_23, 0x2F, 0x3F, 0x2E, 0x2F, 0x0E, 0x0F, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_34, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E, 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_45, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E, 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_56, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E, 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_89, 0x3F, 0x3F, 0x3E, 0x1F, 0x1E, 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_910, 0x3F, 0x3F, 0x3E, 0x1F, 0x1E, 0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_8PSK_35, 0x3c, 0x0c, 0x1c, 0x3b, 0x0c, 0x3b, 0x2b, 0x2b, 0x1b, 0x2b },
{ STV0900_8PSK_23, 0x1d, 0x0c, 0x3c, 0x0c, 0x2c, 0x3b, 0x0c, 0x2b, 0x2b, 0x2b },
{ STV0900_8PSK_34, 0x0e, 0x1c, 0x3d, 0x0c, 0x0d, 0x3b, 0x2c, 0x3b, 0x0c, 0x2b },
{ STV0900_8PSK_56, 0x2e, 0x3e, 0x1e, 0x2e, 0x2d, 0x1e, 0x3c, 0x2d, 0x2c, 0x1d },
{ STV0900_8PSK_89, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d, 0x1e, 0x0d, 0x2d, 0x3c, 0x1d },
{ STV0900_8PSK_910, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d, 0x1e, 0x1d, 0x2d, 0x0d, 0x1d }
static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoopCut20[14] = {
/* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_12, 0x1F, 0x3F, 0x1E, 0x3F, 0x3D,
0x1F, 0x3D, 0x3E, 0x3D, 0x1E },
{ STV0900_QPSK_35, 0x2F, 0x3F, 0x2E, 0x2F, 0x3D,
0x0F, 0x0E, 0x2E, 0x3D, 0x0E },
{ STV0900_QPSK_23, 0x2F, 0x3F, 0x2E, 0x2F, 0x0E,
0x0F, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_34, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E,
0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_45, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E,
0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_56, 0x3F, 0x3F, 0x3E, 0x1F, 0x0E,
0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_89, 0x3F, 0x3F, 0x3E, 0x1F, 0x1E,
0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_QPSK_910, 0x3F, 0x3F, 0x3E, 0x1F, 0x1E,
0x3E, 0x0E, 0x1E, 0x3D, 0x3D },
{ STV0900_8PSK_35, 0x3c, 0x0c, 0x1c, 0x3b, 0x0c,
0x3b, 0x2b, 0x2b, 0x1b, 0x2b },
{ STV0900_8PSK_23, 0x1d, 0x0c, 0x3c, 0x0c, 0x2c,
0x3b, 0x0c, 0x2b, 0x2b, 0x2b },
{ STV0900_8PSK_34, 0x0e, 0x1c, 0x3d, 0x0c, 0x0d,
0x3b, 0x2c, 0x3b, 0x0c, 0x2b },
{ STV0900_8PSK_56, 0x2e, 0x3e, 0x1e, 0x2e, 0x2d,
0x1e, 0x3c, 0x2d, 0x2c, 0x1d },
{ STV0900_8PSK_89, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d,
0x1e, 0x0d, 0x2d, 0x3c, 0x1d },
{ STV0900_8PSK_910, 0x3e, 0x3e, 0x1e, 0x2e, 0x3d,
0x1e, 0x1d, 0x2d, 0x0d, 0x1d },
};
/* Cut 2.0 Tracking carrier loop carrier 16APSK 2/3 to 32APSK 9/10 long Frame */
static const struct stv0900_car_loop_optim FE_STV0900_S2APSKCarLoopCut20[11] = {
/* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_16APSK_23, 0x0C, 0x0C, 0x0C, 0x0C, 0x1D, 0x0C, 0x3C, 0x0C, 0x2C, 0x0C },
{ STV0900_16APSK_34, 0x0C, 0x0C, 0x0C, 0x0C, 0x0E, 0x0C, 0x2D, 0x0C, 0x1D, 0x0C },
{ STV0900_16APSK_45, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x0C, 0x3D, 0x0C, 0x2D, 0x0C },
{ STV0900_16APSK_56, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x0C, 0x3D, 0x0C, 0x2D, 0x0C },
{ STV0900_16APSK_89, 0x0C, 0x0C, 0x0C, 0x0C, 0x2E, 0x0C, 0x0E, 0x0C, 0x3D, 0x0C },
{ STV0900_16APSK_910, 0x0C, 0x0C, 0x0C, 0x0C, 0x2E, 0x0C, 0x0E, 0x0C, 0x3D, 0x0C },
{ STV0900_32APSK_34, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_45, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_56, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_89, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_910, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C }
/* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_16APSK_23, 0x0C, 0x0C, 0x0C, 0x0C, 0x1D,
0x0C, 0x3C, 0x0C, 0x2C, 0x0C },
{ STV0900_16APSK_34, 0x0C, 0x0C, 0x0C, 0x0C, 0x0E,
0x0C, 0x2D, 0x0C, 0x1D, 0x0C },
{ STV0900_16APSK_45, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E,
0x0C, 0x3D, 0x0C, 0x2D, 0x0C },
{ STV0900_16APSK_56, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E,
0x0C, 0x3D, 0x0C, 0x2D, 0x0C },
{ STV0900_16APSK_89, 0x0C, 0x0C, 0x0C, 0x0C, 0x2E,
0x0C, 0x0E, 0x0C, 0x3D, 0x0C },
{ STV0900_16APSK_910, 0x0C, 0x0C, 0x0C, 0x0C, 0x2E,
0x0C, 0x0E, 0x0C, 0x3D, 0x0C },
{ STV0900_32APSK_34, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_45, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_56, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_89, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
{ STV0900_32APSK_910, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C },
};
/* Cut 2.0 Tracking carrier loop carrier QPSK 1/4 to QPSK 2/5 long Frame */
static const struct stv0900_car_loop_optim FE_STV0900_S2LowQPCarLoopCut20[3] = {
/* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon 10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_14, 0x0F, 0x3F, 0x0E, 0x3F, 0x2D, 0x2F, 0x2D, 0x1F, 0x3D, 0x3E },
{ STV0900_QPSK_13, 0x0F, 0x3F, 0x0E, 0x3F, 0x2D, 0x2F, 0x3D, 0x0F, 0x3D, 0x2E },
{ STV0900_QPSK_25, 0x1F, 0x3F, 0x1E, 0x3F, 0x3D, 0x1F, 0x3D, 0x3E, 0x3D, 0x2E }
/* Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_14, 0x0F, 0x3F, 0x0E, 0x3F, 0x2D,
0x2F, 0x2D, 0x1F, 0x3D, 0x3E },
{ STV0900_QPSK_13, 0x0F, 0x3F, 0x0E, 0x3F, 0x2D,
0x2F, 0x3D, 0x0F, 0x3D, 0x2E },
{ STV0900_QPSK_25, 0x1F, 0x3F, 0x1E, 0x3F, 0x3D,
0x1F, 0x3D, 0x3E, 0x3D, 0x2E }
};
/* Cut 2.0 Tracking carrier loop carrier short Frame, cut 1.2 and 2.0 */
static const struct stv0900_short_frames_car_loop_optim FE_STV0900_S2ShortCarLoop[4] = {
/*Mod 2M_cut1.2 2M_cut2.0 5M_cut1.2 5M_cut2.0 10M_cut1.2 10M_cut2.0 20M_cut1.2 20M_cut2.0 30M_cut1.2 30M_cut2.0 */
{ STV0900_QPSK, 0x3C, 0x2F, 0x2B, 0x2E, 0x0B, 0x0E, 0x3A, 0x0E, 0x2A, 0x3D },
{ STV0900_8PSK, 0x0B, 0x3E, 0x2A, 0x0E, 0x0A, 0x2D, 0x19, 0x0D, 0x09, 0x3C },
{ STV0900_16APSK, 0x1B, 0x1E, 0x1B, 0x1E, 0x1B, 0x1E, 0x3A, 0x3D, 0x2A, 0x2D },
{ STV0900_32APSK, 0x1B, 0x1E, 0x1B, 0x1E, 0x1B, 0x1E, 0x3A, 0x3D, 0x2A, 0x2D }
static const
struct stv0900_short_frames_car_loop_optim FE_STV0900_S2ShortCarLoop[4] = {
/*Mod 2Mcut1.2 2Mcut2.0 5Mcut1.2 5Mcut2.0 10Mcut1.2
10Mcut2.0 20Mcut1.2 20M_cut2.0 30Mcut1.2 30Mcut2.0*/
{ STV0900_QPSK, 0x3C, 0x2F, 0x2B, 0x2E, 0x0B,
0x0E, 0x3A, 0x0E, 0x2A, 0x3D },
{ STV0900_8PSK, 0x0B, 0x3E, 0x2A, 0x0E, 0x0A,
0x2D, 0x19, 0x0D, 0x09, 0x3C },
{ STV0900_16APSK, 0x1B, 0x1E, 0x1B, 0x1E, 0x1B,
0x1E, 0x3A, 0x3D, 0x2A, 0x2D },
{ STV0900_32APSK, 0x1B, 0x1E, 0x1B, 0x1E, 0x1B,
0x1E, 0x3A, 0x3D, 0x2A, 0x2D }
};
static const u16 STV0900_InitVal[182][2] = {
static const struct stv0900_car_loop_optim FE_STV0900_S2CarLoopCut30[14] = {
/*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_QPSK_12, 0x3C, 0x2C, 0x0C, 0x2C, 0x1B,
0x2C, 0x1B, 0x1C, 0x0B, 0x3B },
{ STV0900_QPSK_35, 0x0D, 0x0D, 0x0C, 0x0D, 0x1B,
0x3C, 0x1B, 0x1C, 0x0B, 0x3B },
{ STV0900_QPSK_23, 0x1D, 0x0D, 0x0C, 0x1D, 0x2B,
0x3C, 0x1B, 0x1C, 0x0B, 0x3B },
{ STV0900_QPSK_34, 0x1D, 0x1D, 0x0C, 0x1D, 0x2B,
0x3C, 0x1B, 0x1C, 0x0B, 0x3B },
{ STV0900_QPSK_45, 0x2D, 0x1D, 0x1C, 0x1D, 0x2B,
0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
{ STV0900_QPSK_56, 0x2D, 0x1D, 0x1C, 0x1D, 0x2B,
0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
{ STV0900_QPSK_89, 0x3D, 0x2D, 0x1C, 0x1D, 0x3B,
0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
{ STV0900_QPSK_910, 0x3D, 0x2D, 0x1C, 0x1D, 0x3B,
0x3C, 0x2B, 0x0C, 0x1B, 0x3B },
{ STV0900_8PSK_35, 0x39, 0x19, 0x39, 0x19, 0x19,
0x19, 0x19, 0x19, 0x09, 0x19 },
{ STV0900_8PSK_23, 0x2A, 0x39, 0x1A, 0x0A, 0x39,
0x0A, 0x29, 0x39, 0x29, 0x0A },
{ STV0900_8PSK_34, 0x0B, 0x3A, 0x0B, 0x0B, 0x3A,
0x1B, 0x1A, 0x0B, 0x1A, 0x3A },
{ STV0900_8PSK_56, 0x0C, 0x1B, 0x3B, 0x2B, 0x1B,
0x3B, 0x3A, 0x3B, 0x3A, 0x1B },
{ STV0900_8PSK_89, 0x2C, 0x2C, 0x2C, 0x1C, 0x2B,
0x0C, 0x0B, 0x3B, 0x0B, 0x1B },
{ STV0900_8PSK_910, 0x2C, 0x3C, 0x2C, 0x1C, 0x3B,
0x1C, 0x0B, 0x3B, 0x0B, 0x1B }
};
static const
struct stv0900_car_loop_optim FE_STV0900_S2APSKCarLoopCut30[11] = {
/*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff */
{ STV0900_16APSK_23, 0x0A, 0x0A, 0x0A, 0x0A, 0x1A,
0x0A, 0x3A, 0x0A, 0x2A, 0x0A },
{ STV0900_16APSK_34, 0x0A, 0x0A, 0x0A, 0x0A, 0x0B,
0x0A, 0x3B, 0x0A, 0x1B, 0x0A },
{ STV0900_16APSK_45, 0x0A, 0x0A, 0x0A, 0x0A, 0x1B,
0x0A, 0x3B, 0x0A, 0x2B, 0x0A },
{ STV0900_16APSK_56, 0x0A, 0x0A, 0x0A, 0x0A, 0x1B,
0x0A, 0x3B, 0x0A, 0x2B, 0x0A },
{ STV0900_16APSK_89, 0x0A, 0x0A, 0x0A, 0x0A, 0x2B,
0x0A, 0x0C, 0x0A, 0x3B, 0x0A },
{ STV0900_16APSK_910, 0x0A, 0x0A, 0x0A, 0x0A, 0x2B,
0x0A, 0x0C, 0x0A, 0x3B, 0x0A },
{ STV0900_32APSK_34, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
{ STV0900_32APSK_45, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
{ STV0900_32APSK_56, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
{ STV0900_32APSK_89, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
0x0A, 0x0A, 0x0A, 0x0A, 0x0A },
{ STV0900_32APSK_910, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
0x0A, 0x0A, 0x0A, 0x0A, 0x0A }
};
static const
struct stv0900_car_loop_optim FE_STV0900_S2LowQPCarLoopCut30[3] = {
/*Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon
10MPoff 20MPon 20MPoff 30MPon 30MPoff*/
{ STV0900_QPSK_14, 0x0C, 0x3C, 0x0B, 0x3C, 0x2A,
0x2C, 0x2A, 0x1C, 0x3A, 0x3B },
{ STV0900_QPSK_13, 0x0C, 0x3C, 0x0B, 0x3C, 0x2A,
0x2C, 0x3A, 0x0C, 0x3A, 0x2B },
{ STV0900_QPSK_25, 0x1C, 0x3C, 0x1B, 0x3C, 0x3A,
0x1C, 0x3A, 0x3B, 0x3A, 0x2B }
};
static const struct stv0900_short_frames_car_loop_optim_vs_mod
FE_STV0900_S2ShortCarLoopCut30[4] = {
/*Mod 2Mcut3.0 5Mcut3.0 10Mcut3.0 20Mcut3.0 30Mcut3.0*/
{ STV0900_QPSK, 0x2C, 0x2B, 0x0B, 0x0B, 0x3A },
{ STV0900_8PSK, 0x3B, 0x0B, 0x2A, 0x0A, 0x39 },
{ STV0900_16APSK, 0x1B, 0x1B, 0x1B, 0x3A, 0x2A },
{ STV0900_32APSK, 0x1B, 0x1B, 0x1B, 0x3A, 0x2A },
};
static const u16 STV0900_InitVal[181][2] = {
{ R0900_OUTCFG , 0x00 },
{ R0900_MODECFG , 0xff },
{ R0900_AGCRF1CFG , 0x11 },
{ R0900_AGCRF2CFG , 0x13 },
{ R0900_TSGENERAL1X , 0x14 },
@ -381,7 +524,7 @@ static const u16 STV0900_InitVal[182][2] = {
{ R0900_GAINLLR_NF15 , 0x1A },
{ R0900_GAINLLR_NF16 , 0x1F },
{ R0900_GAINLLR_NF17 , 0x21 },
{ R0900_RCCFGH , 0x20 },
{ R0900_RCCFG2 , 0x20 },
{ R0900_P1_FECM , 0x01 }, /*disable DSS modes*/
{ R0900_P2_FECM , 0x01 }, /*disable DSS modes*/
{ R0900_P1_PRVIT , 0x2F }, /*disable puncture rate 6/7*/

View File

@ -46,22 +46,6 @@
#define FALSE (!TRUE)
#endif
#define dmd_reg(a, b, c) \
do { \
a = 0; \
switch (demod) { \
case STV0900_DEMOD_1: \
default: \
a = b; \
break; \
case STV0900_DEMOD_2: \
a = c; \
break; \
} \
} while (0)
extern int stvdebug;
#define dprintk(args...) \
do { \
if (stvdebug) \
@ -70,6 +54,8 @@ extern int stvdebug;
#define STV0900_MAXLOOKUPSIZE 500
#define STV0900_BLIND_SEARCH_AGC2_TH 700
#define STV0900_BLIND_SEARCH_AGC2_TH_CUT30 1400
#define IQPOWER_THRESHOLD 30
/* One point of the lookup table */
struct stv000_lookpoint {
@ -263,14 +249,14 @@ struct stv0900_init_params{
int tuner1_adc;
/* IQ from the tuner1 to the demod */
enum stv0900_iq_inversion tun1_iq_inversion;
enum stv0900_iq_inversion tun1_iq_inv;
enum fe_stv0900_clock_type path2_ts_clock;
u8 tun2_maddress;
int tuner2_adc;
/* IQ from the tuner2 to the demod */
enum stv0900_iq_inversion tun2_iq_inversion;
enum stv0900_iq_inversion tun2_iq_inv;
struct stv0900_reg *ts_config;
};
@ -300,7 +286,7 @@ struct stv0900_signal_info {
enum fe_stv0900_modcode modcode;
enum fe_stv0900_modulation modulation;
enum fe_stv0900_pilot pilot;
enum fe_stv0900_frame_length frame_length;
enum fe_stv0900_frame_length frame_len;
enum stv0900_iq_inversion spectrum;
enum fe_stv0900_rolloff rolloff;
@ -318,47 +304,25 @@ struct stv0900_internal{
/* Demodulator use for single demod or for dual demod) */
enum fe_stv0900_demod_mode demod_mode;
/*Demod 1*/
s32 tuner1_freq;
s32 tuner1_bw;
s32 dmd1_symbol_rate;
s32 dmd1_srch_range;
/*Demods */
s32 freq[2];
s32 bw[2];
s32 symbol_rate[2];
s32 srch_range[2];
/* algorithm for search Blind, Cold or Warm*/
enum fe_stv0900_search_algo dmd1_srch_algo;
enum fe_stv0900_search_algo srch_algo[2];
/* search standard: Auto, DVBS1/DSS only or DVBS2 only*/
enum fe_stv0900_search_standard dmd1_srch_standard;
enum fe_stv0900_search_standard srch_standard[2];
/* inversion search : auto, auto norma first, normal or inverted */
enum fe_stv0900_search_iq dmd1_srch_iq_inv;
enum fe_stv0900_modcode dmd1_modcode;
enum fe_stv0900_modulation dmd1_modulation;
enum fe_stv0900_fec dmd1_fec;
enum fe_stv0900_search_iq srch_iq_inv[2];
enum fe_stv0900_modcode modcode[2];
enum fe_stv0900_modulation modulation[2];
enum fe_stv0900_fec fec[2];
struct stv0900_signal_info dmd1_rslts;
enum fe_stv0900_signal_type dmd1_state;
struct stv0900_signal_info result[2];
enum fe_stv0900_error err[2];
enum fe_stv0900_error dmd1_err;
/*Demod 2*/
s32 tuner2_freq;
s32 tuner2_bw;
s32 dmd2_symbol_rate;
s32 dmd2_srch_range;
enum fe_stv0900_search_algo dmd2_srch_algo;
enum fe_stv0900_search_standard dmd2_srch_stndrd;
/* inversion search : auto, auto normal first, normal or inverted */
enum fe_stv0900_search_iq dmd2_srch_iq_inv;
enum fe_stv0900_modcode dmd2_modcode;
enum fe_stv0900_modulation dmd2_modulation;
enum fe_stv0900_fec dmd2_fec;
/* results of the search*/
struct stv0900_signal_info dmd2_rslts;
/* current state of the search algorithm */
enum fe_stv0900_signal_type dmd2_state;
enum fe_stv0900_error dmd2_err;
struct i2c_adapter *i2c_adap;
u8 i2c_addr;
@ -379,6 +343,8 @@ struct stv0900_state {
int demod;
};
extern int stvdebug;
extern s32 ge2comp(s32 a, s32 width);
extern void stv0900_write_reg(struct stv0900_internal *i_params,
@ -418,13 +384,14 @@ extern u8 stv0900_get_optim_short_carr_loop(s32 srate,
extern void stv0900_stop_all_s2_modcod(struct stv0900_internal *i_params,
enum fe_stv0900_demod_num demod);
extern void stv0900_activate_s2_modcode(struct stv0900_internal *i_params,
extern void stv0900_activate_s2_modcod(struct stv0900_internal *i_params,
enum fe_stv0900_demod_num demod);
extern void stv0900_activate_s2_modcode_single(struct stv0900_internal *i_params,
extern void stv0900_activate_s2_modcod_single(struct stv0900_internal *i_params,
enum fe_stv0900_demod_num demod);
extern enum fe_stv0900_tracking_standard stv0900_get_standard(struct dvb_frontend *fe,
extern enum
fe_stv0900_tracking_standard stv0900_get_standard(struct dvb_frontend *fe,
enum fe_stv0900_demod_num demod);
#endif