forked from luck/tmp_suning_uos_patched
V4L/DVB (3300): Add standard for South Korean NTSC-M using A2 audio.
South Korea uses NTSC-M but with A2 audio instead of BTSC. Several audio chips need this information in order to set the correct audio processing registers. Acked-by: Mauro Carvalho Chehab <mauro_chehab@yahoo.com.br> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
a77a922fcc
commit
0dfd812d4b
@ -214,7 +214,7 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
|
|||||||
we can capture, of the first and second field. */
|
we can capture, of the first and second field. */
|
||||||
.vbistart = { 7,320 },
|
.vbistart = { 7,320 },
|
||||||
},{
|
},{
|
||||||
.v4l2_id = V4L2_STD_NTSC_M,
|
.v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
|
||||||
.name = "NTSC",
|
.name = "NTSC",
|
||||||
.Fsc = 28636363,
|
.Fsc = 28636363,
|
||||||
.swidth = 768,
|
.swidth = 768,
|
||||||
|
@ -220,33 +220,23 @@ static void input_change(struct i2c_client *client)
|
|||||||
cx25840_write(client, 0x808, 0xff);
|
cx25840_write(client, 0x808, 0xff);
|
||||||
cx25840_write(client, 0x80b, 0x10);
|
cx25840_write(client, 0x80b, 0x10);
|
||||||
} else if (std & V4L2_STD_NTSC) {
|
} else if (std & V4L2_STD_NTSC) {
|
||||||
/* NTSC */
|
/* Certain Hauppauge PVR150 models have a hardware bug
|
||||||
if (state->pvr150_workaround) {
|
that causes audio to drop out. For these models the
|
||||||
/* Certain Hauppauge PVR150 models have a hardware bug
|
audio standard must be set explicitly.
|
||||||
that causes audio to drop out. For these models the
|
To be precise: it affects cards with tuner models
|
||||||
audio standard must be set explicitly.
|
85, 99 and 112 (model numbers from tveeprom). */
|
||||||
To be precise: it affects cards with tuner models
|
int hw_fix = state->pvr150_workaround;
|
||||||
85, 99 and 112 (model numbers from tveeprom). */
|
|
||||||
if (std == V4L2_STD_NTSC_M_JP) {
|
if (std == V4L2_STD_NTSC_M_JP) {
|
||||||
/* Japan uses EIAJ audio standard */
|
|
||||||
cx25840_write(client, 0x808, 0x2f);
|
|
||||||
} else {
|
|
||||||
/* Others use the BTSC audio standard */
|
|
||||||
cx25840_write(client, 0x808, 0x1f);
|
|
||||||
}
|
|
||||||
/* South Korea uses the A2-M (aka Zweiton M) audio
|
|
||||||
standard, and should set 0x808 to 0x3f, but I don't
|
|
||||||
know how to detect this. */
|
|
||||||
} else if (std == V4L2_STD_NTSC_M_JP) {
|
|
||||||
/* Japan uses EIAJ audio standard */
|
/* Japan uses EIAJ audio standard */
|
||||||
cx25840_write(client, 0x808, 0xf7);
|
cx25840_write(client, 0x808, hw_fix ? 0x2f : 0xf7);
|
||||||
|
} else if (std == V4L2_STD_NTSC_M_KR) {
|
||||||
|
/* South Korea uses A2 audio standard */
|
||||||
|
cx25840_write(client, 0x808, hw_fix ? 0x3f : 0xf8);
|
||||||
} else {
|
} else {
|
||||||
/* Others use the BTSC audio standard */
|
/* Others use the BTSC audio standard */
|
||||||
cx25840_write(client, 0x808, 0xf6);
|
cx25840_write(client, 0x808, hw_fix ? 0x1f : 0xf6);
|
||||||
}
|
}
|
||||||
/* South Korea uses the A2-M (aka Zweiton M) audio standard,
|
|
||||||
and should set 0x808 to 0xf8, but I don't know how to
|
|
||||||
detect this. */
|
|
||||||
cx25840_write(client, 0x80b, 0x00);
|
cx25840_write(client, 0x80b, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,17 +320,17 @@ static int set_v4lstd(struct i2c_client *client, v4l2_std_id std)
|
|||||||
u8 fmt=0; /* zero is autodetect */
|
u8 fmt=0; /* zero is autodetect */
|
||||||
|
|
||||||
/* First tests should be against specific std */
|
/* First tests should be against specific std */
|
||||||
if (std & V4L2_STD_NTSC_M_JP) {
|
if (std == V4L2_STD_NTSC_M_JP) {
|
||||||
fmt=0x2;
|
fmt=0x2;
|
||||||
} else if (std & V4L2_STD_NTSC_443) {
|
} else if (std == V4L2_STD_NTSC_443) {
|
||||||
fmt=0x3;
|
fmt=0x3;
|
||||||
} else if (std & V4L2_STD_PAL_M) {
|
} else if (std == V4L2_STD_PAL_M) {
|
||||||
fmt=0x5;
|
fmt=0x5;
|
||||||
} else if (std & V4L2_STD_PAL_N) {
|
} else if (std == V4L2_STD_PAL_N) {
|
||||||
fmt=0x6;
|
fmt=0x6;
|
||||||
} else if (std & V4L2_STD_PAL_Nc) {
|
} else if (std == V4L2_STD_PAL_Nc) {
|
||||||
fmt=0x7;
|
fmt=0x7;
|
||||||
} else if (std & V4L2_STD_PAL_60) {
|
} else if (std == V4L2_STD_PAL_60) {
|
||||||
fmt=0x8;
|
fmt=0x8;
|
||||||
} else {
|
} else {
|
||||||
/* Then, test against generic ones */
|
/* Then, test against generic ones */
|
||||||
@ -369,7 +359,7 @@ v4l2_std_id cx25840_get_v4lstd(struct i2c_client * client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (fmt) {
|
switch (fmt) {
|
||||||
case 0x1: return V4L2_STD_NTSC_M;
|
case 0x1: return V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR;
|
||||||
case 0x2: return V4L2_STD_NTSC_M_JP;
|
case 0x2: return V4L2_STD_NTSC_M_JP;
|
||||||
case 0x3: return V4L2_STD_NTSC_443;
|
case 0x3: return V4L2_STD_NTSC_443;
|
||||||
case 0x4: return V4L2_STD_PAL;
|
case 0x4: return V4L2_STD_PAL;
|
||||||
|
@ -231,7 +231,7 @@ static struct tvnorm tvnorms[] = {
|
|||||||
cAudioIF_6_5 |
|
cAudioIF_6_5 |
|
||||||
cVideoIF_38_90 ),
|
cVideoIF_38_90 ),
|
||||||
},{
|
},{
|
||||||
.std = V4L2_STD_NTSC_M,
|
.std = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
|
||||||
.name = "NTSC-M",
|
.name = "NTSC-M",
|
||||||
.b = ( cNegativeFmTV |
|
.b = ( cNegativeFmTV |
|
||||||
cQSS ),
|
cQSS ),
|
||||||
@ -619,6 +619,11 @@ static int tda9887_fixup_std(struct tda9887 *t)
|
|||||||
tda9887_dbg("insmod fixup: NTSC => NTSC_M_JP\n");
|
tda9887_dbg("insmod fixup: NTSC => NTSC_M_JP\n");
|
||||||
t->std = V4L2_STD_NTSC_M_JP;
|
t->std = V4L2_STD_NTSC_M_JP;
|
||||||
break;
|
break;
|
||||||
|
case 'k':
|
||||||
|
case 'K':
|
||||||
|
tda9887_dbg("insmod fixup: NTSC => NTSC_M_KR\n");
|
||||||
|
t->std = V4L2_STD_NTSC_M_KR;
|
||||||
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
/* default parameter, do nothing */
|
/* default parameter, do nothing */
|
||||||
break;
|
break;
|
||||||
|
@ -366,6 +366,11 @@ static int tuner_fixup_std(struct tuner *t)
|
|||||||
tuner_dbg("insmod fixup: NTSC => NTSC_M_JP\n");
|
tuner_dbg("insmod fixup: NTSC => NTSC_M_JP\n");
|
||||||
t->std = V4L2_STD_NTSC_M_JP;
|
t->std = V4L2_STD_NTSC_M_JP;
|
||||||
break;
|
break;
|
||||||
|
case 'k':
|
||||||
|
case 'K':
|
||||||
|
tuner_dbg("insmod fixup: NTSC => NTSC_M_KR\n");
|
||||||
|
t->std = V4L2_STD_NTSC_M_KR;
|
||||||
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
/* default parameter, do nothing */
|
/* default parameter, do nothing */
|
||||||
break;
|
break;
|
||||||
|
@ -628,6 +628,7 @@ typedef __u64 v4l2_std_id;
|
|||||||
#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
|
#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
|
||||||
#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
|
#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
|
||||||
#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
|
#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
|
||||||
|
#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
|
||||||
|
|
||||||
#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
|
#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
|
||||||
#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
|
#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
|
||||||
@ -660,7 +661,8 @@ typedef __u64 v4l2_std_id;
|
|||||||
V4L2_STD_PAL_H |\
|
V4L2_STD_PAL_H |\
|
||||||
V4L2_STD_PAL_I)
|
V4L2_STD_PAL_I)
|
||||||
#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
|
#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
|
||||||
V4L2_STD_NTSC_M_JP)
|
V4L2_STD_NTSC_M_JP |\
|
||||||
|
V4L2_STD_NTSC_M_KR)
|
||||||
#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
|
#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
|
||||||
V4L2_STD_SECAM_K |\
|
V4L2_STD_SECAM_K |\
|
||||||
V4L2_STD_SECAM_K1)
|
V4L2_STD_SECAM_K1)
|
||||||
|
Loading…
Reference in New Issue
Block a user