aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-kthreads.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-11-24 16:16:46 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:39 -0500
commit76efd62f1546c6fab2116d3ba832403387bd3d4a (patch)
tree2dacbc15f37de125aa573708f599913f5fe05e91 /drivers/media/video/msp3400-kthreads.c
parent5d302f2e2c5fce46d88a9f6b3c1f74f9e9240e25 (diff)
V4L/DVB (9825): msp3400: convert to v4l2_subdev.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/msp3400-kthreads.c')
-rw-r--r--drivers/media/video/msp3400-kthreads.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c
index 846a14a61fd1..a655e9c30146 100644
--- a/drivers/media/video/msp3400-kthreads.c
+++ b/drivers/media/video/msp3400-kthreads.c
@@ -159,7 +159,7 @@ const char *msp_standard_std_name(int std)
159 159
160static void msp_set_source(struct i2c_client *client, u16 src) 160static void msp_set_source(struct i2c_client *client, u16 src)
161{ 161{
162 struct msp_state *state = i2c_get_clientdata(client); 162 struct msp_state *state = to_state(i2c_get_clientdata(client));
163 163
164 if (msp_dolby) { 164 if (msp_dolby) {
165 msp_write_dsp(client, 0x0008, 0x0520); /* I2S1 */ 165 msp_write_dsp(client, 0x0008, 0x0520); /* I2S1 */
@@ -186,7 +186,7 @@ void msp3400c_set_carrier(struct i2c_client *client, int cdo1, int cdo2)
186 186
187void msp3400c_set_mode(struct i2c_client *client, int mode) 187void msp3400c_set_mode(struct i2c_client *client, int mode)
188{ 188{
189 struct msp_state *state = i2c_get_clientdata(client); 189 struct msp_state *state = to_state(i2c_get_clientdata(client));
190 struct msp3400c_init_data_dem *data = &msp3400c_init_data[mode]; 190 struct msp3400c_init_data_dem *data = &msp3400c_init_data[mode];
191 int tuner = (state->routing.input >> 3) & 1; 191 int tuner = (state->routing.input >> 3) & 1;
192 int i; 192 int i;
@@ -227,7 +227,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
227 static char *strmode[] = { 227 static char *strmode[] = {
228 "mono", "stereo", "lang2", "lang1", "lang1+lang2" 228 "mono", "stereo", "lang2", "lang1", "lang1+lang2"
229 }; 229 };
230 struct msp_state *state = i2c_get_clientdata(client); 230 struct msp_state *state = to_state(i2c_get_clientdata(client));
231 char *modestr = (state->audmode >= 0 && state->audmode < 5) ? 231 char *modestr = (state->audmode >= 0 && state->audmode < 5) ?
232 strmode[state->audmode] : "unknown"; 232 strmode[state->audmode] : "unknown";
233 int src = 0; /* channel source: FM/AM, nicam or SCART */ 233 int src = 0; /* channel source: FM/AM, nicam or SCART */
@@ -356,7 +356,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
356 356
357static void msp3400c_print_mode(struct i2c_client *client) 357static void msp3400c_print_mode(struct i2c_client *client)
358{ 358{
359 struct msp_state *state = i2c_get_clientdata(client); 359 struct msp_state *state = to_state(i2c_get_clientdata(client));
360 360
361 if (state->main == state->second) 361 if (state->main == state->second)
362 v4l_dbg(1, msp_debug, client, 362 v4l_dbg(1, msp_debug, client,
@@ -385,7 +385,7 @@ static void msp3400c_print_mode(struct i2c_client *client)
385 385
386static int msp3400c_detect_stereo(struct i2c_client *client) 386static int msp3400c_detect_stereo(struct i2c_client *client)
387{ 387{
388 struct msp_state *state = i2c_get_clientdata(client); 388 struct msp_state *state = to_state(i2c_get_clientdata(client));
389 int val; 389 int val;
390 int rxsubchans = state->rxsubchans; 390 int rxsubchans = state->rxsubchans;
391 int newnicam = state->nicam_on; 391 int newnicam = state->nicam_on;
@@ -463,7 +463,7 @@ static int msp3400c_detect_stereo(struct i2c_client *client)
463/* stereo/multilang monitoring */ 463/* stereo/multilang monitoring */
464static void watch_stereo(struct i2c_client *client) 464static void watch_stereo(struct i2c_client *client)
465{ 465{
466 struct msp_state *state = i2c_get_clientdata(client); 466 struct msp_state *state = to_state(i2c_get_clientdata(client));
467 467
468 if (msp_detect_stereo(client)) 468 if (msp_detect_stereo(client))
469 msp_set_audmode(client); 469 msp_set_audmode(client);
@@ -475,7 +475,7 @@ static void watch_stereo(struct i2c_client *client)
475int msp3400c_thread(void *data) 475int msp3400c_thread(void *data)
476{ 476{
477 struct i2c_client *client = data; 477 struct i2c_client *client = data;
478 struct msp_state *state = i2c_get_clientdata(client); 478 struct msp_state *state = to_state(i2c_get_clientdata(client));
479 struct msp3400c_carrier_detect *cd; 479 struct msp3400c_carrier_detect *cd;
480 int count, max1, max2, val1, val2, val, i; 480 int count, max1, max2, val1, val2, val, i;
481 481
@@ -659,7 +659,7 @@ no_second:
659int msp3410d_thread(void *data) 659int msp3410d_thread(void *data)
660{ 660{
661 struct i2c_client *client = data; 661 struct i2c_client *client = data;
662 struct msp_state *state = i2c_get_clientdata(client); 662 struct msp_state *state = to_state(i2c_get_clientdata(client));
663 int val, i, std, count; 663 int val, i, std, count;
664 664
665 v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n"); 665 v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n");
@@ -825,7 +825,7 @@ restart:
825 825
826static int msp34xxg_modus(struct i2c_client *client) 826static int msp34xxg_modus(struct i2c_client *client)
827{ 827{
828 struct msp_state *state = i2c_get_clientdata(client); 828 struct msp_state *state = to_state(i2c_get_clientdata(client));
829 829
830 if (state->radio) { 830 if (state->radio) {
831 v4l_dbg(1, msp_debug, client, "selected radio modus\n"); 831 v4l_dbg(1, msp_debug, client, "selected radio modus\n");
@@ -852,7 +852,7 @@ static int msp34xxg_modus(struct i2c_client *client)
852 852
853static void msp34xxg_set_source(struct i2c_client *client, u16 reg, int in) 853static void msp34xxg_set_source(struct i2c_client *client, u16 reg, int in)
854 { 854 {
855 struct msp_state *state = i2c_get_clientdata(client); 855 struct msp_state *state = to_state(i2c_get_clientdata(client));
856 int source, matrix; 856 int source, matrix;
857 857
858 switch (state->audmode) { 858 switch (state->audmode) {
@@ -895,7 +895,7 @@ static void msp34xxg_set_source(struct i2c_client *client, u16 reg, int in)
895 895
896static void msp34xxg_set_sources(struct i2c_client *client) 896static void msp34xxg_set_sources(struct i2c_client *client)
897{ 897{
898 struct msp_state *state = i2c_get_clientdata(client); 898 struct msp_state *state = to_state(i2c_get_clientdata(client));
899 u32 in = state->routing.input; 899 u32 in = state->routing.input;
900 900
901 msp34xxg_set_source(client, 0x0008, (in >> 4) & 0xf); 901 msp34xxg_set_source(client, 0x0008, (in >> 4) & 0xf);
@@ -911,7 +911,7 @@ static void msp34xxg_set_sources(struct i2c_client *client)
911/* (re-)initialize the msp34xxg */ 911/* (re-)initialize the msp34xxg */
912static void msp34xxg_reset(struct i2c_client *client) 912static void msp34xxg_reset(struct i2c_client *client)
913{ 913{
914 struct msp_state *state = i2c_get_clientdata(client); 914 struct msp_state *state = to_state(i2c_get_clientdata(client));
915 int tuner = (state->routing.input >> 3) & 1; 915 int tuner = (state->routing.input >> 3) & 1;
916 int modus; 916 int modus;
917 917
@@ -954,7 +954,7 @@ static void msp34xxg_reset(struct i2c_client *client)
954int msp34xxg_thread(void *data) 954int msp34xxg_thread(void *data)
955{ 955{
956 struct i2c_client *client = data; 956 struct i2c_client *client = data;
957 struct msp_state *state = i2c_get_clientdata(client); 957 struct msp_state *state = to_state(i2c_get_clientdata(client));
958 int val, i; 958 int val, i;
959 959
960 v4l_dbg(1, msp_debug, client, "msp34xxg daemon started\n"); 960 v4l_dbg(1, msp_debug, client, "msp34xxg daemon started\n");
@@ -1049,7 +1049,7 @@ unmute:
1049 1049
1050static int msp34xxg_detect_stereo(struct i2c_client *client) 1050static int msp34xxg_detect_stereo(struct i2c_client *client)
1051{ 1051{
1052 struct msp_state *state = i2c_get_clientdata(client); 1052 struct msp_state *state = to_state(i2c_get_clientdata(client));
1053 int status = msp_read_dem(client, 0x0200); 1053 int status = msp_read_dem(client, 0x0200);
1054 int is_bilingual = status & 0x100; 1054 int is_bilingual = status & 0x100;
1055 int is_stereo = status & 0x40; 1055 int is_stereo = status & 0x40;
@@ -1078,7 +1078,7 @@ static int msp34xxg_detect_stereo(struct i2c_client *client)
1078 1078
1079static void msp34xxg_set_audmode(struct i2c_client *client) 1079static void msp34xxg_set_audmode(struct i2c_client *client)
1080{ 1080{
1081 struct msp_state *state = i2c_get_clientdata(client); 1081 struct msp_state *state = to_state(i2c_get_clientdata(client));
1082 1082
1083 if (state->std == 0x20) { 1083 if (state->std == 0x20) {
1084 if ((state->rxsubchans & V4L2_TUNER_SUB_SAP) && 1084 if ((state->rxsubchans & V4L2_TUNER_SUB_SAP) &&
@@ -1095,7 +1095,7 @@ static void msp34xxg_set_audmode(struct i2c_client *client)
1095 1095
1096void msp_set_audmode(struct i2c_client *client) 1096void msp_set_audmode(struct i2c_client *client)
1097{ 1097{
1098 struct msp_state *state = i2c_get_clientdata(client); 1098 struct msp_state *state = to_state(i2c_get_clientdata(client));
1099 1099
1100 switch (state->opmode) { 1100 switch (state->opmode) {
1101 case OPMODE_MANUAL: 1101 case OPMODE_MANUAL:
@@ -1110,7 +1110,7 @@ void msp_set_audmode(struct i2c_client *client)
1110 1110
1111int msp_detect_stereo(struct i2c_client *client) 1111int msp_detect_stereo(struct i2c_client *client)
1112{ 1112{
1113 struct msp_state *state = i2c_get_clientdata(client); 1113 struct msp_state *state = to_state(i2c_get_clientdata(client));
1114 1114
1115 switch (state->opmode) { 1115 switch (state->opmode) {
1116 case OPMODE_MANUAL: 1116 case OPMODE_MANUAL: