summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/msp3400-kthreads.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/msp3400-kthreads.c')
-rw-r--r--drivers/media/i2c/msp3400-kthreads.c115
1 files changed, 57 insertions, 58 deletions
diff --git a/drivers/media/i2c/msp3400-kthreads.c b/drivers/media/i2c/msp3400-kthreads.c
index 17120804fab7..eec7aa4c6f98 100644
--- a/drivers/media/i2c/msp3400-kthreads.c
+++ b/drivers/media/i2c/msp3400-kthreads.c
@@ -220,7 +220,7 @@ void msp3400c_set_mode(struct i2c_client *client, int mode)
int tuner = (state->route_in >> 3) & 1;
int i;
- v4l_dbg(1, msp_debug, client, "set_mode: %d\n", mode);
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "set_mode: %d\n", mode);
state->mode = mode;
state->rxsubchans = V4L2_TUNER_SUB_MONO;
@@ -266,7 +266,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
/* this method would break everything, let's make sure
* it's never called
*/
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"set_audmode called with mode=%d instead of set_source (ignored)\n",
state->audmode);
return;
@@ -295,7 +295,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
/* switch demodulator */
switch (state->mode) {
case MSP_MODE_FM_TERRA:
- v4l_dbg(1, msp_debug, client, "FM set_audmode: %s\n", modestr);
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "FM set_audmode: %s\n", modestr);
switch (audmode) {
case V4L2_TUNER_MODE_STEREO:
msp_write_dsp(client, 0x000e, 0x3001);
@@ -309,7 +309,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
}
break;
case MSP_MODE_FM_SAT:
- v4l_dbg(1, msp_debug, client, "SAT set_audmode: %s\n", modestr);
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "SAT set_audmode: %s\n", modestr);
switch (audmode) {
case V4L2_TUNER_MODE_MONO:
msp3400c_set_carrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
@@ -329,31 +329,31 @@ static void msp3400c_set_audmode(struct i2c_client *client)
case MSP_MODE_FM_NICAM1:
case MSP_MODE_FM_NICAM2:
case MSP_MODE_AM_NICAM:
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"NICAM set_audmode: %s\n", modestr);
if (state->nicam_on)
src = 0x0100; /* NICAM */
break;
case MSP_MODE_BTSC:
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"BTSC set_audmode: %s\n", modestr);
break;
case MSP_MODE_EXTERN:
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"extern set_audmode: %s\n", modestr);
src = 0x0200; /* SCART */
break;
case MSP_MODE_FM_RADIO:
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"FM-Radio set_audmode: %s\n", modestr);
break;
default:
- v4l_dbg(1, msp_debug, client, "mono set_audmode\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "mono set_audmode\n");
return;
}
/* switch audio */
- v4l_dbg(1, msp_debug, client, "set audmode %d\n", audmode);
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "set audmode %d\n", audmode);
switch (audmode) {
case V4L2_TUNER_MODE_STEREO:
case V4L2_TUNER_MODE_LANG1_LANG2:
@@ -361,7 +361,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
break;
case V4L2_TUNER_MODE_MONO:
if (state->mode == MSP_MODE_AM_NICAM) {
- v4l_dbg(1, msp_debug, client, "switching to AM mono\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "switching to AM mono\n");
/* AM mono decoding is handled by tuner, not MSP chip */
/* SCART switching control register */
msp_set_scart(client, SCART_MONO, 0);
@@ -377,7 +377,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
src |= 0x0010;
break;
}
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"set_audmode final source/matrix = 0x%x\n", src);
msp_set_source(client, src);
@@ -388,23 +388,23 @@ static void msp3400c_print_mode(struct i2c_client *client)
struct msp_state *state = to_state(i2c_get_clientdata(client));
if (state->main == state->second)
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"mono sound carrier: %d.%03d MHz\n",
state->main / 910000, (state->main / 910) % 1000);
else
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"main sound carrier: %d.%03d MHz\n",
state->main / 910000, (state->main / 910) % 1000);
if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2)
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"NICAM/FM carrier : %d.%03d MHz\n",
state->second / 910000, (state->second/910) % 1000);
if (state->mode == MSP_MODE_AM_NICAM)
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"NICAM/AM carrier : %d.%03d MHz\n",
state->second / 910000, (state->second / 910) % 1000);
if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) {
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"FM-stereo carrier : %d.%03d MHz\n",
state->second / 910000, (state->second / 910) % 1000);
}
@@ -425,7 +425,7 @@ static int msp3400c_detect_stereo(struct i2c_client *client)
val = msp_read_dsp(client, 0x18);
if (val > 32767)
val -= 65536;
- v4l_dbg(2, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 2, msp_debug,
"stereo detect register: %d\n", val);
if (val > 8192) {
rxsubchans = V4L2_TUNER_SUB_STEREO;
@@ -440,7 +440,7 @@ static int msp3400c_detect_stereo(struct i2c_client *client)
case MSP_MODE_FM_NICAM2:
case MSP_MODE_AM_NICAM:
val = msp_read_dem(client, 0x23);
- v4l_dbg(2, msp_debug, client, "nicam sync=%d, mode=%d\n",
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "nicam sync=%d, mode=%d\n",
val & 1, (val & 0x1e) >> 1);
if (val & 1) {
@@ -471,14 +471,14 @@ static int msp3400c_detect_stereo(struct i2c_client *client)
}
if (rxsubchans != state->rxsubchans) {
update = 1;
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"watch: rxsubchans %02x => %02x\n",
state->rxsubchans, rxsubchans);
state->rxsubchans = rxsubchans;
}
if (newnicam != state->nicam_on) {
update = 1;
- v4l_dbg(1, msp_debug, client, "watch: nicam %d => %d\n",
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "watch: nicam %d => %d\n",
state->nicam_on, newnicam);
state->nicam_on = newnicam;
}
@@ -508,23 +508,23 @@ int msp3400c_thread(void *data)
struct msp3400c_carrier_detect *cd;
int count, max1, max2, val1, val2, val, i;
- v4l_dbg(1, msp_debug, client, "msp3400 daemon started\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "msp3400 daemon started\n");
state->detected_std = V4L2_STD_ALL;
set_freezable();
for (;;) {
- v4l_dbg(2, msp_debug, client, "msp3400 thread: sleep\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "msp3400 thread: sleep\n");
msp_sleep(state, -1);
- v4l_dbg(2, msp_debug, client, "msp3400 thread: wakeup\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "msp3400 thread: wakeup\n");
restart:
- v4l_dbg(2, msp_debug, client, "thread: restart scan\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "thread: restart scan\n");
state->restart = 0;
if (kthread_should_stop())
break;
if (state->radio || MSP_MODE_EXTERN == state->mode) {
/* no carrier scan, just unmute */
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"thread: no carrier scan\n");
state->scan_in_progress = 0;
msp_update_volume(state);
@@ -553,7 +553,7 @@ restart:
/* autodetect doesn't work well with AM ... */
max1 = 3;
count = 0;
- v4l_dbg(1, msp_debug, client, "AM sound override\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "AM sound override\n");
}
for (i = 0; i < count; i++) {
@@ -565,7 +565,7 @@ restart:
val -= 65536;
if (val1 < val)
val1 = val, max1 = i;
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"carrier1 val: %5d / %s\n", val, cd[i].name);
}
@@ -602,7 +602,7 @@ restart:
val -= 65536;
if (val2 < val)
val2 = val, max2 = i;
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"carrier2 val: %5d / %s\n", val, cd[i].name);
}
@@ -687,7 +687,7 @@ no_second:
watch_stereo(client);
}
}
- v4l_dbg(1, msp_debug, client, "thread: exit\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "thread: exit\n");
return 0;
}
@@ -698,23 +698,23 @@ int msp3410d_thread(void *data)
struct msp_state *state = to_state(i2c_get_clientdata(client));
int val, i, std, count;
- v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "msp3410 daemon started\n");
state->detected_std = V4L2_STD_ALL;
set_freezable();
for (;;) {
- v4l_dbg(2, msp_debug, client, "msp3410 thread: sleep\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "msp3410 thread: sleep\n");
msp_sleep(state, -1);
- v4l_dbg(2, msp_debug, client, "msp3410 thread: wakeup\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "msp3410 thread: wakeup\n");
restart:
- v4l_dbg(2, msp_debug, client, "thread: restart scan\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "thread: restart scan\n");
state->restart = 0;
if (kthread_should_stop())
break;
if (state->mode == MSP_MODE_EXTERN) {
/* no carrier scan needed, just unmute */
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"thread: no carrier scan\n");
state->scan_in_progress = 0;
msp_update_volume(state);
@@ -740,7 +740,7 @@ restart:
goto restart;
if (msp_debug)
- v4l_dbg(2, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 2, msp_debug,
"setting standard: %s (0x%04x)\n",
msp_standard_std_name(std), std);
@@ -758,14 +758,14 @@ restart:
val = msp_read_dem(client, 0x7e);
if (val < 0x07ff)
break;
- v4l_dbg(2, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 2, msp_debug,
"detection still in progress\n");
}
}
for (i = 0; msp_stdlist[i].name != NULL; i++)
if (msp_stdlist[i].retval == val)
break;
- v4l_dbg(1, msp_debug, client, "current standard: %s (0x%04x)\n",
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "current standard: %s (0x%04x)\n",
msp_standard_std_name(val), val);
state->main = msp_stdlist[i].main;
state->second = msp_stdlist[i].second;
@@ -775,8 +775,7 @@ restart:
if (msp_amsound && !state->radio &&
(state->v4l2_std & V4L2_STD_SECAM) && (val != 0x0009)) {
/* autodetection has failed, let backup */
- v4l_dbg(1, msp_debug, client, "autodetection failed,"
- " switching to backup standard: %s (0x%04x)\n",
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "autodetection failed, switching to backup standard: %s (0x%04x)\n",
msp_stdlist[8].name ?
msp_stdlist[8].name : "unknown", val);
state->std = val = 0x0009;
@@ -850,7 +849,7 @@ restart:
watch_stereo(client);
}
}
- v4l_dbg(1, msp_debug, client, "thread: exit\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "thread: exit\n");
return 0;
}
@@ -867,23 +866,23 @@ static int msp34xxg_modus(struct i2c_client *client)
struct msp_state *state = to_state(i2c_get_clientdata(client));
if (state->radio) {
- v4l_dbg(1, msp_debug, client, "selected radio modus\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "selected radio modus\n");
return 0x0001;
}
if (state->v4l2_std == V4L2_STD_NTSC_M_JP) {
- v4l_dbg(1, msp_debug, client, "selected M (EIA-J) modus\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "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");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "selected M (A2) modus\n");
return 0x0001;
}
if (state->v4l2_std == V4L2_STD_SECAM_L) {
- v4l_dbg(1, msp_debug, client, "selected SECAM-L modus\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "selected SECAM-L modus\n");
return 0x6001;
}
if (state->v4l2_std & V4L2_STD_MN) {
- v4l_dbg(1, msp_debug, client, "selected M (BTSC) modus\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "selected M (BTSC) modus\n");
return 0x2001;
}
return 0x7001;
@@ -927,7 +926,7 @@ static void msp34xxg_set_source(struct i2c_client *client, u16 reg, int in)
else
source = (in << 8) | matrix;
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"set source to %d (0x%x) for output %02x\n", in, source, reg);
msp_write_dsp(client, reg, source);
}
@@ -996,23 +995,23 @@ int msp34xxg_thread(void *data)
struct msp_state *state = to_state(i2c_get_clientdata(client));
int val, i;
- v4l_dbg(1, msp_debug, client, "msp34xxg daemon started\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "msp34xxg daemon started\n");
state->detected_std = V4L2_STD_ALL;
set_freezable();
for (;;) {
- v4l_dbg(2, msp_debug, client, "msp34xxg thread: sleep\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "msp34xxg thread: sleep\n");
msp_sleep(state, -1);
- v4l_dbg(2, msp_debug, client, "msp34xxg thread: wakeup\n");
+ dev_dbg_lvl(&client->dev, 2, msp_debug, "msp34xxg thread: wakeup\n");
restart:
- v4l_dbg(1, msp_debug, client, "thread: restart scan\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "thread: restart scan\n");
state->restart = 0;
if (kthread_should_stop())
break;
if (state->mode == MSP_MODE_EXTERN) {
/* no carrier scan needed, just unmute */
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"thread: no carrier scan\n");
state->scan_in_progress = 0;
msp_update_volume(state);
@@ -1029,7 +1028,7 @@ restart:
goto unmute;
/* watch autodetect */
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"started autodetect, waiting for result\n");
for (i = 0; i < 10; i++) {
if (msp_sleep(state, 100))
@@ -1041,17 +1040,17 @@ restart:
state->std = val;
break;
}
- v4l_dbg(2, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 2, msp_debug,
"detection still in progress\n");
}
if (state->std == 1) {
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"detection still in progress after 10 tries. giving up.\n");
continue;
}
unmute:
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"detected standard: %s (0x%04x)\n",
msp_standard_std_name(state->std), state->std);
state->detected_std = msp_standard_std(state->std);
@@ -1084,7 +1083,7 @@ unmute:
goto restart;
}
}
- v4l_dbg(1, msp_debug, client, "thread: exit\n");
+ dev_dbg_lvl(&client->dev, 1, msp_debug, "thread: exit\n");
return 0;
}
@@ -1111,7 +1110,7 @@ static int msp34xxg_detect_stereo(struct i2c_client *client)
state->rxsubchans =
V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
}
- v4l_dbg(1, msp_debug, client,
+ dev_dbg_lvl(&client->dev, 1, msp_debug,
"status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n",
status, is_stereo, is_bilingual, state->rxsubchans);
return (oldrx != state->rxsubchans);