aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-kthreads.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/msp3400-kthreads.c')
-rw-r--r--drivers/media/video/msp3400-kthreads.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c
index 71a944b447e2..972f2c80dbe2 100644
--- a/drivers/media/video/msp3400-kthreads.c
+++ b/drivers/media/video/msp3400-kthreads.c
@@ -806,6 +806,38 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
806 state->source = source; 806 state->source = source;
807} 807}
808 808
809static int msp34xxg_modus(struct i2c_client *client)
810{
811 struct msp_state *state = i2c_get_clientdata(client);
812
813 if (state->radio) {
814 v4l_dbg(1, msp_debug, client, "selected radio modus\n");
815 return 0x0001;
816 }
817
818 if (state->v4l2_std & V4L2_STD_PAL) {
819 v4l_dbg(1, msp_debug, client, "selected PAL modus\n");
820 return 0x7001;
821 }
822 if (state->v4l2_std == V4L2_STD_NTSC_M_JP) {
823 v4l_dbg(1, msp_debug, client, "selected M (EIA-J) modus\n");
824 return 0x4001;
825 }
826 if (state->v4l2_std == V4L2_STD_NTSC_M_KR) {
827 v4l_dbg(1, msp_debug, client, "selected M (A2) modus\n");
828 return 0x0001;
829 }
830 if (state->v4l2_std & V4L2_STD_MN) {
831 v4l_dbg(1, msp_debug, client, "selected M (BTSC) modus\n");
832 return 0x2001;
833 }
834 if (state->v4l2_std & V4L2_STD_SECAM) {
835 v4l_dbg(1, msp_debug, client, "selected SECAM modus\n");
836 return 0x6001;
837 }
838 return 0x0001;
839}
840
809/* (re-)initialize the msp34xxg, according to the current norm in state->norm 841/* (re-)initialize the msp34xxg, according to the current norm in state->norm
810 * return 0 if it worked, -1 if it failed 842 * return 0 if it worked, -1 if it failed
811 */ 843 */
@@ -826,7 +858,7 @@ static int msp34xxg_reset(struct i2c_client *client)
826 msp_write_dem(client, 0x40, state->i2s_mode); 858 msp_write_dem(client, 0x40, state->i2s_mode);
827 859
828 /* step-by-step initialisation, as described in the manual */ 860 /* step-by-step initialisation, as described in the manual */
829 modus = msp_modus(client); 861 modus = msp34xxg_modus(client);
830 if (state->radio) 862 if (state->radio)
831 std = 0x40; 863 std = 0x40;
832 else 864 else