summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-03-19 11:25:42 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2006-03-19 11:25:42 +0100
commit036b2352981a21a2be2f42c669b184afdae481a2 (patch)
tree1419feb46725296a0d182a7f3f1dc9ae514276b2 /linux/drivers/media
parentfc6dbea1fac5464ee509748f623281b4a4d40356 (diff)
downloadmediapointer-dvb-s2-036b2352981a21a2be2f42c669b184afdae481a2.tar.gz
mediapointer-dvb-s2-036b2352981a21a2be2f42c669b184afdae481a2.tar.bz2
Move msp_modus to msp3400-kthreads, add JP and KR std detection
From: Hans Verkuil <hverkuil@xs4all.nl> msp_modus is 'G' model specific. Moved it to kthreads and also added proper handling for the Japanese and South Korean TV standards. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/msp3400-driver.c31
-rw-r--r--linux/drivers/media/video/msp3400-kthreads.c34
-rw-r--r--linux/drivers/media/video/msp3400.h1
3 files changed, 33 insertions, 33 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 5d90a2c10..42bdb33c2 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -355,37 +355,6 @@ void msp_set_audio(struct i2c_client *client)
msp_write_dsp(client, 0x0033, loudness);
}
-int msp_modus(struct i2c_client *client)
-{
- struct msp_state *state = i2c_get_clientdata(client);
-
- if (state->radio) {
- v4l_dbg(1, msp_debug, client, "video mode selected to Radio\n");
- return 0x0003;
- }
-
- if (state->v4l2_std & V4L2_STD_PAL) {
- v4l_dbg(1, msp_debug, client, "video mode selected to PAL\n");
-
-#if 1 /* KEEP */
- /* experimental: not sure this works with all chip versions */
- return 0x7003;
-#else
- /* previous value, try this if it breaks ... */
- return 0x1003;
-#endif
- }
- if (state->v4l2_std & V4L2_STD_NTSC) {
- v4l_dbg(1, msp_debug, client, "video mode selected to NTSC\n");
- return 0x2003;
- }
- if (state->v4l2_std & V4L2_STD_SECAM) {
- v4l_dbg(1, msp_debug, client, "video mode selected to SECAM\n");
- return 0x0003;
- }
- return 0x0003;
-}
-
/* ------------------------------------------------------------------------ */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
diff --git a/linux/drivers/media/video/msp3400-kthreads.c b/linux/drivers/media/video/msp3400-kthreads.c
index 4f1fc2434..2e972eefe 100644
--- a/linux/drivers/media/video/msp3400-kthreads.c
+++ b/linux/drivers/media/video/msp3400-kthreads.c
@@ -838,6 +838,38 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
state->source = source;
}
+static int msp34xxg_modus(struct i2c_client *client)
+{
+ struct msp_state *state = i2c_get_clientdata(client);
+
+ if (state->radio) {
+ v4l_dbg(1, msp_debug, client, "selected radio modus\n");
+ return 0x0001;
+ }
+
+ if (state->v4l2_std & V4L2_STD_PAL) {
+ v4l_dbg(1, msp_debug, client, "selected PAL modus\n");
+ return 0x7001;
+ }
+ if (state->v4l2_std == V4L2_STD_NTSC_M_JP) {
+ v4l_dbg(1, msp_debug, client, "selected M (EIA-J) modus\n");
+ return 0x4001;
+ }
+ if (state->v4l2_std == V4L2_STD_NTSC_M_KR) {
+ v4l_dbg(1, msp_debug, client, "selected M (A2) modus\n");
+ return 0x0001;
+ }
+ if (state->v4l2_std & V4L2_STD_MN) {
+ v4l_dbg(1, msp_debug, client, "selected M (BTSC) modus\n");
+ return 0x2001;
+ }
+ if (state->v4l2_std & V4L2_STD_SECAM) {
+ v4l_dbg(1, msp_debug, client, "selected SECAM modus\n");
+ return 0x6001;
+ }
+ return 0x0001;
+}
+
/* (re-)initialize the msp34xxg, according to the current norm in state->norm
* return 0 if it worked, -1 if it failed
*/
@@ -858,7 +890,7 @@ static int msp34xxg_reset(struct i2c_client *client)
msp_write_dem(client, 0x40, state->i2s_mode);
/* step-by-step initialisation, as described in the manual */
- modus = msp_modus(client);
+ modus = msp34xxg_modus(client);
if (state->radio)
std = 0x40;
else
diff --git a/linux/drivers/media/video/msp3400.h b/linux/drivers/media/video/msp3400.h
index b96a075ef..4163277ca 100644
--- a/linux/drivers/media/video/msp3400.h
+++ b/linux/drivers/media/video/msp3400.h
@@ -103,7 +103,6 @@ int msp_reset(struct i2c_client *client);
void msp_set_scart(struct i2c_client *client, int in, int out);
void msp_set_mute(struct i2c_client *client);
void msp_set_audio(struct i2c_client *client);
-int msp_modus(struct i2c_client *client);
int msp_sleep(struct msp_state *state, int timeout);
/* msp3400-kthreads.c */