Commit f167cb4e authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (3345): Fixes some bad global variables


- Debug global var is already used inside kernel.
- v4l_dbg now expects the debug var
- global vars inside msp34xx renamed to msp_*
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent b2a17e47
...@@ -75,13 +75,13 @@ int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf) ...@@ -75,13 +75,13 @@ int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf)
if(debug>1) { if(debug>1) {
int i; int i;
v4l_dbg(2,i2c_client_s,"hexdump:"); v4l_dbg(2, debug,i2c_client_s,"hexdump:");
for(i=1;i<65;i++) { for(i=1;i<65;i++) {
if(i!=1) { if(i!=1) {
if(((i-1)%8)==0) printk(" "); if(((i-1)%8)==0) printk(" ");
if(((i-1)%16)==0) { if(((i-1)%16)==0) {
printk("\n"); printk("\n");
v4l_dbg(2,i2c_client_s,"hexdump:"); v4l_dbg(2, debug,i2c_client_s,"hexdump:");
} }
} }
printk(" %02x",buf[i]); printk(" %02x",buf[i]);
......
...@@ -155,7 +155,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -155,7 +155,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind)
for (i = 1; i <= 7; i++) { for (i = 1; i <= 7; i++) {
u8 v = cs53l32a_read(client, i); u8 v = cs53l32a_read(client, i);
v4l_dbg(1, client, "Read Reg %d %02x\n", i, v); v4l_dbg(1, debug, client, "Read Reg %d %02x\n", i, v);
} }
/* Set cs53l32a internal register for Adaptec 2010/2410 setup */ /* Set cs53l32a internal register for Adaptec 2010/2410 setup */
...@@ -173,7 +173,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -173,7 +173,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind)
for (i = 1; i <= 7; i++) { for (i = 1; i <= 7; i++) {
u8 v = cs53l32a_read(client, i); u8 v = cs53l32a_read(client, i);
v4l_dbg(1, client, "Read Reg %d %02x\n", i, v); v4l_dbg(1, debug, client, "Read Reg %d %02x\n", i, v);
} }
i2c_attach_client(client); i2c_attach_client(client);
......
...@@ -265,7 +265,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp ...@@ -265,7 +265,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp
vid_input <= CX25840_COMPOSITE8); vid_input <= CX25840_COMPOSITE8);
u8 reg; u8 reg;
v4l_dbg(1, client, "decoder set video input %d, audio input %d\n", v4l_dbg(1, debug, client, "decoder set video input %d, audio input %d\n",
vid_input, aud_input); vid_input, aud_input);
if (is_composite) { if (is_composite) {
...@@ -533,7 +533,7 @@ static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) ...@@ -533,7 +533,7 @@ static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt)
else else
filter = 3; filter = 3;
v4l_dbg(1, client, "decoder set size %dx%d -> scale %ux%u\n", v4l_dbg(1, debug, client, "decoder set size %dx%d -> scale %ux%u\n",
pix->width, pix->height, HSC, VSC); pix->width, pix->height, HSC, VSC);
/* HSCALE=HSC */ /* HSCALE=HSC */
...@@ -687,13 +687,13 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, ...@@ -687,13 +687,13 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
return cx25840_audio(client, cmd, arg); return cx25840_audio(client, cmd, arg);
case VIDIOC_STREAMON: case VIDIOC_STREAMON:
v4l_dbg(1, client, "enable output\n"); v4l_dbg(1, debug, client, "enable output\n");
cx25840_write(client, 0x115, 0x8c); cx25840_write(client, 0x115, 0x8c);
cx25840_write(client, 0x116, 0x07); cx25840_write(client, 0x116, 0x07);
break; break;
case VIDIOC_STREAMOFF: case VIDIOC_STREAMOFF:
v4l_dbg(1, client, "disable output\n"); v4l_dbg(1, debug, client, "disable output\n");
cx25840_write(client, 0x115, 0x00); cx25840_write(client, 0x115, 0x00);
cx25840_write(client, 0x116, 0x00); cx25840_write(client, 0x116, 0x00);
break; break;
...@@ -871,7 +871,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, ...@@ -871,7 +871,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
client->driver = &i2c_driver_cx25840; client->driver = &i2c_driver_cx25840;
snprintf(client->name, sizeof(client->name) - 1, "cx25840"); snprintf(client->name, sizeof(client->name) - 1, "cx25840");
v4l_dbg(1, client, "detecting cx25840 client on address 0x%x\n", address << 1); v4l_dbg(1, debug, client, "detecting cx25840 client on address 0x%x\n", address << 1);
device_id = cx25840_read(client, 0x101) << 8; device_id = cx25840_read(client, 0x101) << 8;
device_id |= cx25840_read(client, 0x100); device_id |= cx25840_read(client, 0x100);
...@@ -879,7 +879,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, ...@@ -879,7 +879,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
/* The high byte of the device ID should be /* The high byte of the device ID should be
* 0x84 if chip is present */ * 0x84 if chip is present */
if ((device_id & 0xff00) != 0x8400) { if ((device_id & 0xff00) != 0x8400) {
v4l_dbg(1, client, "cx25840 not found\n"); v4l_dbg(1, debug, client, "cx25840 not found\n");
kfree(client); kfree(client);
return 0; return 0;
} }
......
...@@ -66,26 +66,26 @@ MODULE_LICENSE("GPL"); ...@@ -66,26 +66,26 @@ MODULE_LICENSE("GPL");
/* module parameters */ /* module parameters */
static int opmode = OPMODE_AUTO; static int opmode = OPMODE_AUTO;
int debug = 0; /* debug output */ int msp_debug = 0; /* msp_debug output */
int once = 0; /* no continous stereo monitoring */ int msp_once = 0; /* no continous stereo monitoring */
int amsound = 0; /* hard-wire AM sound at 6.5 Hz (france), int msp_amsound = 0; /* hard-wire AM sound at 6.5 Hz (france),
the autoscan seems work well only with FM... */ the autoscan seems work well only with FM... */
int standard = 1; /* Override auto detect of audio standard, if needed. */ int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */
int dolby = 0; int msp_dolby = 0;
int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual
(msp34xxg only) 0x00a0-0x03c0 */ (msp34xxg only) 0x00a0-0x03c0 */
/* read-only */ /* read-only */
module_param(opmode, int, 0444); module_param(opmode, int, 0444);
/* read-write */ /* read-write */
module_param(once, bool, 0644); module_param_named(once,msp_once, bool, 0644);
module_param(debug, int, 0644); module_param_named(debug,msp_debug, int, 0644);
module_param(stereo_threshold, int, 0644); module_param_named(stereo_threshold,msp_stereo_thresh, int, 0644);
module_param(standard, int, 0644); module_param_named(standard,msp_standard, int, 0644);
module_param(amsound, bool, 0644); module_param_named(amsound,msp_amsound, bool, 0644);
module_param(dolby, bool, 0644); module_param_named(dolby,msp_dolby, bool, 0644);
MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect"); MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect");
MODULE_PARM_DESC(once, "No continuous stereo monitoring"); MODULE_PARM_DESC(once, "No continuous stereo monitoring");
...@@ -127,7 +127,7 @@ int msp_reset(struct i2c_client *client) ...@@ -127,7 +127,7 @@ int msp_reset(struct i2c_client *client)
{ client->addr, I2C_M_RD, 2, read }, { client->addr, I2C_M_RD, 2, read },
}; };
v4l_dbg(3, client, "msp_reset\n"); v4l_dbg(3, msp_debug, client, "msp_reset\n");
if (i2c_transfer(client->adapter, &reset[0], 1) != 1 || if (i2c_transfer(client->adapter, &reset[0], 1) != 1 ||
i2c_transfer(client->adapter, &reset[1], 1) != 1 || i2c_transfer(client->adapter, &reset[1], 1) != 1 ||
i2c_transfer(client->adapter, test, 2) != 2) { i2c_transfer(client->adapter, test, 2) != 2) {
...@@ -165,7 +165,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr) ...@@ -165,7 +165,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr)
return -1; return -1;
} }
retval = read[0] << 8 | read[1]; retval = read[0] << 8 | read[1];
v4l_dbg(3, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval); v4l_dbg(3, msp_debug, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval);
return retval; return retval;
} }
...@@ -190,7 +190,7 @@ static int msp_write(struct i2c_client *client, int dev, int addr, int val) ...@@ -190,7 +190,7 @@ static int msp_write(struct i2c_client *client, int dev, int addr, int val)
buffer[3] = val >> 8; buffer[3] = val >> 8;
buffer[4] = val & 0xff; buffer[4] = val & 0xff;
v4l_dbg(3, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val); v4l_dbg(3, msp_debug, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val);
for (err = 0; err < 3; err++) { for (err = 0; err < 3; err++) {
if (i2c_master_send(client, buffer, 5) == 5) if (i2c_master_send(client, buffer, 5) == 5)
break; break;
...@@ -273,7 +273,7 @@ void msp_set_scart(struct i2c_client *client, int in, int out) ...@@ -273,7 +273,7 @@ void msp_set_scart(struct i2c_client *client, int in, int out)
} else } else
state->acb = 0xf60; /* Mute Input and SCART 1 Output */ state->acb = 0xf60; /* Mute Input and SCART 1 Output */
v4l_dbg(1, client, "scart switch: %s => %d (ACB=0x%04x)\n", v4l_dbg(1, msp_debug, client, "scart switch: %s => %d (ACB=0x%04x)\n",
scart_names[in], out, state->acb); scart_names[in], out, state->acb);
msp_write_dsp(client, 0x13, state->acb); msp_write_dsp(client, 0x13, state->acb);
...@@ -285,7 +285,7 @@ void msp_set_mute(struct i2c_client *client) ...@@ -285,7 +285,7 @@ void msp_set_mute(struct i2c_client *client)
{ {
struct msp_state *state = i2c_get_clientdata(client); struct msp_state *state = i2c_get_clientdata(client);
v4l_dbg(1, client, "mute audio\n"); v4l_dbg(1, msp_debug, client, "mute audio\n");
msp_write_dsp(client, 0x0000, 0); msp_write_dsp(client, 0x0000, 0);
msp_write_dsp(client, 0x0007, 1); msp_write_dsp(client, 0x0007, 1);
if (state->has_scart2_out_volume) if (state->has_scart2_out_volume)
...@@ -303,7 +303,7 @@ void msp_set_audio(struct i2c_client *client) ...@@ -303,7 +303,7 @@ void msp_set_audio(struct i2c_client *client)
if (!state->muted) if (!state->muted)
val = (state->volume * 0x7f / 65535) << 8; val = (state->volume * 0x7f / 65535) << 8;
v4l_dbg(1, client, "mute=%s volume=%d\n", v4l_dbg(1, msp_debug, client, "mute=%s volume=%d\n",
state->muted ? "on" : "off", state->volume); state->muted ? "on" : "off", state->volume);
msp_write_dsp(client, 0x0000, val); msp_write_dsp(client, 0x0000, val);
...@@ -321,7 +321,7 @@ void msp_set_audio(struct i2c_client *client) ...@@ -321,7 +321,7 @@ void msp_set_audio(struct i2c_client *client)
treble = ((state->treble - 32768) * 0x60 / 65535) << 8; treble = ((state->treble - 32768) * 0x60 / 65535) << 8;
loudness = state->loudness ? ((5 * 4) << 8) : 0; loudness = state->loudness ? ((5 * 4) << 8) : 0;
v4l_dbg(1, client, "balance=%d bass=%d treble=%d loudness=%d\n", v4l_dbg(1, msp_debug, client, "balance=%d bass=%d treble=%d loudness=%d\n",
state->balance, state->bass, state->treble, state->loudness); state->balance, state->bass, state->treble, state->loudness);
msp_write_dsp(client, 0x0001, bal << 8); msp_write_dsp(client, 0x0001, bal << 8);
...@@ -341,12 +341,12 @@ int msp_modus(struct i2c_client *client) ...@@ -341,12 +341,12 @@ int msp_modus(struct i2c_client *client)
struct msp_state *state = i2c_get_clientdata(client); struct msp_state *state = i2c_get_clientdata(client);
if (state->radio) { if (state->radio) {
v4l_dbg(1, client, "video mode selected to Radio\n"); v4l_dbg(1, msp_debug, client, "video mode selected to Radio\n");
return 0x0003; return 0x0003;
} }
if (state->v4l2_std & V4L2_STD_PAL) { if (state->v4l2_std & V4L2_STD_PAL) {
v4l_dbg(1, client, "video mode selected to PAL\n"); v4l_dbg(1, msp_debug, client, "video mode selected to PAL\n");
#if 1 #if 1
/* experimental: not sure this works with all chip versions */ /* experimental: not sure this works with all chip versions */
...@@ -357,11 +357,11 @@ int msp_modus(struct i2c_client *client) ...@@ -357,11 +357,11 @@ int msp_modus(struct i2c_client *client)
#endif #endif
} }
if (state->v4l2_std & V4L2_STD_NTSC) { if (state->v4l2_std & V4L2_STD_NTSC) {
v4l_dbg(1, client, "video mode selected to NTSC\n"); v4l_dbg(1, msp_debug, client, "video mode selected to NTSC\n");
return 0x2003; return 0x2003;
} }
if (state->v4l2_std & V4L2_STD_SECAM) { if (state->v4l2_std & V4L2_STD_SECAM) {
v4l_dbg(1, client, "video mode selected to SECAM\n"); v4l_dbg(1, msp_debug, client, "video mode selected to SECAM\n");
return 0x0003; return 0x0003;
} }
return 0x0003; return 0x0003;
...@@ -619,7 +619,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -619,7 +619,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
u16 *sarg = arg; u16 *sarg = arg;
int scart = 0; int scart = 0;
if (debug >= 2) if (msp_debug >= 2)
v4l_i2c_print_ioctl(client, cmd); v4l_i2c_print_ioctl(client, cmd);
switch (cmd) { switch (cmd) {
...@@ -666,7 +666,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -666,7 +666,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
if (state->radio) if (state->radio)
return 0; return 0;
state->radio = 1; state->radio = 1;
v4l_dbg(1, client, "switching to radio mode\n"); v4l_dbg(1, msp_debug, client, "switching to radio mode\n");
state->watch_stereo = 0; state->watch_stereo = 0;
switch (state->opmode) { switch (state->opmode) {
case OPMODE_MANUAL: case OPMODE_MANUAL:
...@@ -937,7 +937,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -937,7 +937,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
if (a->index < 0 || a->index > 2) if (a->index < 0 || a->index > 2)
return -EINVAL; return -EINVAL;
v4l_dbg(1, client, "Setting audio out on msp34xx to input %i\n", a->index); v4l_dbg(1, msp_debug, client, "Setting audio out on msp34xx to input %i\n", a->index);
msp_set_scart(client, state->in_scart, a->index + 1); msp_set_scart(client, state->in_scart, a->index + 1);
break; break;
...@@ -947,7 +947,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -947,7 +947,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
{ {
u32 *a = (u32 *)arg; u32 *a = (u32 *)arg;
v4l_dbg(1, client, "Setting I2S speed to %d\n", *a); v4l_dbg(1, msp_debug, client, "Setting I2S speed to %d\n", *a);
switch (*a) { switch (*a) {
case 1024000: case 1024000:
...@@ -1041,7 +1041,7 @@ static int msp_suspend(struct device * dev, pm_message_t state) ...@@ -1041,7 +1041,7 @@ static int msp_suspend(struct device * dev, pm_message_t state)
{ {
struct i2c_client *client = container_of(dev, struct i2c_client, dev); struct i2c_client *client = container_of(dev, struct i2c_client, dev);
v4l_dbg(1, client, "suspend\n"); v4l_dbg(1, msp_debug, client, "suspend\n");
msp_reset(client); msp_reset(client);
return 0; return 0;
} }
...@@ -1050,7 +1050,7 @@ static int msp_resume(struct device * dev) ...@@ -1050,7 +1050,7 @@ static int msp_resume(struct device * dev)
{ {
struct i2c_client *client = container_of(dev, struct i2c_client, dev); struct i2c_client *client = container_of(dev, struct i2c_client, dev);
v4l_dbg(1, client, "resume\n"); v4l_dbg(1, msp_debug, client, "resume\n");
msp_wake_thread(client); msp_wake_thread(client);
return 0; return 0;
} }
...@@ -1080,7 +1080,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -1080,7 +1080,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
snprintf(client->name, sizeof(client->name) - 1, "msp3400"); snprintf(client->name, sizeof(client->name) - 1, "msp3400");
if (msp_reset(client) == -1) { if (msp_reset(client) == -1) {
v4l_dbg(1, client, "msp3400 not found\n"); v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
kfree(client); kfree(client);
return -1; return -1;
} }
...@@ -1107,9 +1107,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -1107,9 +1107,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
state->rev1 = msp_read_dsp(client, 0x1e); state->rev1 = msp_read_dsp(client, 0x1e);
if (state->rev1 != -1) if (state->rev1 != -1)
state->rev2 = msp_read_dsp(client, 0x1f); state->rev2 = msp_read_dsp(client, 0x1f);
v4l_dbg(1, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2); v4l_dbg(1, msp_debug, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2);
if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) { if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) {
v4l_dbg(1, client, "not an msp3400 (cannot read chip version)\n"); v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n");
kfree(state); kfree(state);
kfree(client); kfree(client);
return -1; return -1;
......
This diff is collapsed.
...@@ -48,12 +48,12 @@ struct msp_matrix { ...@@ -48,12 +48,12 @@ struct msp_matrix {
#define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */ #define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */
/* module parameters */ /* module parameters */
extern int debug; extern int msp_debug;
extern int once; extern int msp_once;
extern int amsound; extern int msp_amsound;
extern int standard; extern int msp_standard;
extern int dolby; extern int msp_dolby;
extern int stereo_threshold; extern int msp_stereo_thresh;
struct msp_state { struct msp_state {
int rev1, rev2; int rev1, rev2;
......
...@@ -549,7 +549,7 @@ static int saa7115_set_audio_clock_freq(struct i2c_client *client, u32 freq) ...@@ -549,7 +549,7 @@ static int saa7115_set_audio_clock_freq(struct i2c_client *client, u32 freq)
u32 hz; u32 hz;
u64 f; u64 f;
v4l_dbg(1, client, "set audio clock freq: %d\n", freq); v4l_dbg(1, debug, client, "set audio clock freq: %d\n", freq);
/* sanity check */ /* sanity check */
if (freq < 32000 || freq > 48000) if (freq < 32000 || freq > 48000)
...@@ -670,10 +670,10 @@ static void saa7115_set_v4lstd(struct i2c_client *client, v4l2_std_id std) ...@@ -670,10 +670,10 @@ static void saa7115_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
// This works for NTSC-M, SECAM-L and the 50Hz PAL variants. // This works for NTSC-M, SECAM-L and the 50Hz PAL variants.
if (std & V4L2_STD_525_60) { if (std & V4L2_STD_525_60) {
v4l_dbg(1, client, "decoder set standard 60 Hz\n"); v4l_dbg(1, debug, client, "decoder set standard 60 Hz\n");
saa7115_writeregs(client, saa7115_cfg_60hz_video); saa7115_writeregs(client, saa7115_cfg_60hz_video);
} else { } else {
v4l_dbg(1, client, "decoder set standard 50 Hz\n"); v4l_dbg(1, debug, client, "decoder set standard 50 Hz\n");
saa7115_writeregs(client, saa7115_cfg_50hz_video); saa7115_writeregs(client, saa7115_cfg_50hz_video);
} }
...@@ -863,7 +863,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt ...@@ -863,7 +863,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
pix = &(fmt->fmt.pix); pix = &(fmt->fmt.pix);
v4l_dbg(1, client, "decoder set size\n"); v4l_dbg(1, debug, client, "decoder set size\n");
/* FIXME need better bounds checking here */ /* FIXME need better bounds checking here */
if ((pix->width < 1) || (pix->width > 1440)) if ((pix->width < 1) || (pix->width > 1440))
...@@ -889,7 +889,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt ...@@ -889,7 +889,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
HPSC = HPSC ? HPSC : 1; HPSC = HPSC ? HPSC : 1;
HFSC = (int)((1024 * 720) / (HPSC * pix->width)); HFSC = (int)((1024 * 720) / (HPSC * pix->width));
v4l_dbg(1, client, "Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC); v4l_dbg(1, debug, client, "Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC);
/* FIXME hardcodes to "Task B" /* FIXME hardcodes to "Task B"
* write H prescaler integer */ * write H prescaler integer */
saa7115_write(client, 0xd0, (u8) (HPSC & 0x3f)); saa7115_write(client, 0xd0, (u8) (HPSC & 0x3f));
...@@ -903,10 +903,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt ...@@ -903,10 +903,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
saa7115_write(client, 0xDD, (u8) ((HFSC >> 9) & 0xff)); saa7115_write(client, 0xDD, (u8) ((HFSC >> 9) & 0xff));
} else { } else {
if (is_50hz) { if (is_50hz) {
v4l_dbg(1, client, "Setting full 50hz width\n"); v4l_dbg(1, debug, client, "Setting full 50hz width\n");
saa7115_writeregs(client, saa7115_cfg_50hz_fullres_x); saa7115_writeregs(client, saa7115_cfg_50hz_fullres_x);
} else { } else {
v4l_dbg(1, client, "Setting full 60hz width\n"); v4l_dbg(1, debug, client, "Setting full 60hz width\n");
saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x); saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x);
} }
} }
...@@ -915,7 +915,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt ...@@ -915,7 +915,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
if (pix->height != Vsrc) { if (pix->height != Vsrc) {
VSCY = (int)((1024 * Vsrc) / pix->height); VSCY = (int)((1024 * Vsrc) / pix->height);
v4l_dbg(1, client, "Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY); v4l_dbg(1, debug, client, "Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY);
/* Correct Contrast and Luminance */ /* Correct Contrast and Luminance */
saa7115_write(client, 0xd5, (u8) (64 * 1024 / VSCY)); saa7115_write(client, 0xd5, (u8) (64 * 1024 / VSCY));
...@@ -929,10 +929,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt ...@@ -929,10 +929,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
saa7115_write(client, 0xe3, (u8) ((VSCY >> 8) & 0xff)); saa7115_write(client, 0xe3, (u8) ((VSCY >> 8) & 0xff));
} else { } else {
if (is_50hz) { if (is_50hz) {
v4l_dbg(1, client, "Setting full 50Hz height\n"); v4l_dbg(1, debug, client, "Setting full 50Hz height\n");
saa7115_writeregs(client, saa7115_cfg_50hz_fullres_y); saa7115_writeregs(client, saa7115_cfg_50hz_fullres_y);
} else { } else {
v4l_dbg(1, client, "Setting full 60hz height\n"); v4l_dbg(1, debug, client, "Setting full 60hz height\n");
saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y); saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y);
} }
} }
...@@ -1079,7 +1079,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar ...@@ -1079,7 +1079,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
break; break;
status = saa7115_read(client, 0x1f); status = saa7115_read(client, 0x1f);
v4l_dbg(1, client, "status: 0x%02x\n", status); v4l_dbg(1, debug, client, "status: 0x%02x\n", status);
vt->signal = ((status & (1 << 6)) == 0) ? 0xffff : 0x0; vt->signal = ((status & (1 << 6)) == 0) ? 0xffff : 0x0;
break; break;
} }
...@@ -1125,7 +1125,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar ...@@ -1125,7 +1125,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
break; break;
case VIDIOC_S_INPUT: case VIDIOC_S_INPUT:
v4l_dbg(1, client, "decoder set input %d\n", *iarg); v4l_dbg(1, debug, client, "decoder set input %d\n", *iarg);
/* inputs from 0-9 are available */ /* inputs from 0-9 are available */
if (*iarg < 0 || *iarg > 9) { if (*iarg < 0 || *iarg > 9) {
return -EINVAL; return -EINVAL;
...@@ -1133,7 +1133,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar ...@@ -1133,7 +1133,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
if (state->input == *iarg) if (state->input == *iarg)
break; break;
v4l_dbg(1, client, "now setting %s input\n", v4l_dbg(1, debug, client, "now setting %s input\n",
*iarg >= 6 ? "S-Video" : "Composite"); *iarg >= 6 ? "S-Video" : "Composite");
state->input = *iarg; state->input = *iarg;
...@@ -1150,7 +1150,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar ...@@ -1150,7 +1150,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
case VIDIOC_STREAMON: case VIDIOC_STREAMON:
case VIDIOC_STREAMOFF: case VIDIOC_STREAMOFF:
v4l_dbg(1, client, "%s output\n", v4l_dbg(1, debug, client, "%s output\n",
(cmd == VIDIOC_STREAMON) ? "enable" : "disable"); (cmd == VIDIOC_STREAMON) ? "enable" : "disable");
if (state->enable != (cmd == VIDIOC_STREAMON)) { if (state->enable != (cmd == VIDIOC_STREAMON)) {
...@@ -1164,7 +1164,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar ...@@ -1164,7 +1164,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
break; break;
case VIDIOC_INT_RESET: case VIDIOC_INT_RESET:
v4l_dbg(1, client, "decoder RESET\n"); v4l_dbg(1, debug, client, "decoder RESET\n");
saa7115_writeregs(client, saa7115_cfg_reset_scaler); saa7115_writeregs(client, saa7115_cfg_reset_scaler);
break; break;
...@@ -1257,12 +1257,12 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -1257,12 +1257,12 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
client->driver = &i2c_driver_saa7115; client->driver = &i2c_driver_saa7115;
snprintf(client->name, sizeof(client->name) - 1, "saa7115"); snprintf(client->name, sizeof(client->name) - 1, "saa7115");
v4l_dbg(1, client, "detecting saa7115 client on address 0x%x\n", address << 1); v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1);
saa7115_write(client, 0, 5); saa7115_write(client, 0, 5);
chip_id = saa7115_read(client, 0) & 0x0f; chip_id = saa7115_read(client, 0) & 0x0f;
if (chip_id != 4 && chip_id != 5) { if (chip_id != 4 && chip_id != 5) {
v4l_dbg(1, client, "saa7115 not found\n"); v4l_dbg(1, debug, client, "saa7115 not found\n");
kfree(client); kfree(client);
return 0; return 0;
} }
...@@ -1288,7 +1288,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -1288,7 +1288,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
state->ident = (chip_id == 4) ? V4L2_IDENT_SAA7114 : V4L2_IDENT_SAA7115; state->ident = (chip_id == 4) ? V4L2_IDENT_SAA7114 : V4L2_IDENT_SAA7115;
state->audclk_freq = 48000; state->audclk_freq = 48000;
v4l_dbg(1, client, "writing init values\n"); v4l_dbg(1, debug, client, "writing init values\n");
/* init to 60hz/48khz */ /* init to 60hz/48khz */
saa7115_writeregs(client, saa7115_init_auto_input); saa7115_writeregs(client, saa7115_init_auto_input);
...@@ -1301,7 +1301,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -1301,7 +1301,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
i2c_attach_client(client); i2c_attach_client(client);
v4l_dbg(1, client, "status: (1E) 0x%02x, (1F) 0x%02x\n", v4l_dbg(1, debug, client, "status: (1E) 0x%02x, (1F) 0x%02x\n",
saa7115_read(client, 0x1e), saa7115_read(client, 0x1f)); saa7115_read(client, 0x1e), saa7115_read(client, 0x1f));
return 0; return 0;
......
...@@ -338,7 +338,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -338,7 +338,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat
if (enable && (data->field != 0 || data->line != 16)) if (enable && (data->field != 0 || data->line != 16))
return -EINVAL; return -EINVAL;
if (state->vps_enable != enable) { if (state->vps_enable != enable) {
v4l_dbg(1, client, "Turn VPS Signal %s\n", enable ? "on" : "off"); v4l_dbg(1, debug, client, "Turn VPS Signal %s\n", enable ? "on" : "off");
saa7127_write(client, 0x54, enable << 7); saa7127_write(client, 0x54, enable << 7);
state->vps_enable = enable; state->vps_enable = enable;
} }
...@@ -350,7 +350,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -350,7 +350,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat
state->vps_data[2] = data->data[11]; state->vps_data[2] = data->data[11];
state->vps_data[3] = data->data[12]; state->vps_data[3] = data->data[12];
state->vps_data[4] = data->data[13]; state->vps_data[4] = data->data[13];
v4l_dbg(1, client, "Set VPS data %02x %02x %02x %02x %02x\n", v4l_dbg(1, debug, client, "Set VPS data %02x %02x %02x %02x %02x\n",
state->vps_data[0], state->vps_data[1], state->vps_data[0], state->vps_data[1],
state->vps_data[2], state->vps_data[3], state->vps_data[2], state->vps_data[3],
state->vps_data[4]); state->vps_data[4]);
...@@ -373,7 +373,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data ...@@ -373,7 +373,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data
if (enable && (data->field != 0 || data->line != 21)) if (enable && (data->field != 0 || data->line != 21))
return -EINVAL; return -EINVAL;
if (state->cc_enable != enable) { if (state->cc_enable != enable) {
v4l_dbg(1, client, "Turn CC %s\n", enable ? "on" : "off"); v4l_dbg(1, debug, client, "Turn CC %s\n", enable ? "on" : "off");
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
(state->xds_enable << 7) | (enable << 6) | 0x11); (state->xds_enable << 7) | (enable << 6) | 0x11);
state->cc_enable = enable; state->cc_enable = enable;
...@@ -381,7 +381,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data ...@@ -381,7 +381,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data
if (!enable) if (!enable)
return 0; return 0;
v4l_dbg(2, client, "CC data: %04x\n", cc); v4l_dbg(2, debug, client, "CC data: %04x\n", cc);
saa7127_write(client, SAA7127_REG_LINE_21_ODD_0, cc & 0xff); saa7127_write(client, SAA7127_REG_LINE_21_ODD_0, cc & 0xff);
saa7127_write(client, SAA7127_REG_LINE_21_ODD_1, cc >> 8); saa7127_write(client, SAA7127_REG_LINE_21_ODD_1, cc >> 8);
state->cc_data = cc; state->cc_data = cc;
...@@ -399,7 +399,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -399,7 +399,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat
if (enable && (data->field != 1 || data->line != 21)) if (enable && (data->field != 1 || data->line != 21))
return -EINVAL; return -EINVAL;
if (state->xds_enable != enable) { if (state->xds_enable != enable) {
v4l_dbg(1, client, "Turn XDS %s\n", enable ? "on" : "off"); v4l_dbg(1, debug, client, "Turn XDS %s\n", enable ? "on" : "off");
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
(enable << 7) | (state->cc_enable << 6) | 0x11); (enable << 7) | (state->cc_enable << 6) | 0x11);
state->xds_enable = enable; state->xds_enable = enable;
...@@ -407,7 +407,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -407,7 +407,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat
if (!enable) if (!enable)
return 0; return 0;
v4l_dbg(2, client, "XDS data: %04x\n", xds); v4l_dbg(2, debug, client, "XDS data: %04x\n", xds);
saa7127_write(client, SAA7127_REG_LINE_21_EVEN_0, xds & 0xff); saa7127_write(client, SAA7127_REG_LINE_21_EVEN_0, xds & 0xff);
saa7127_write(client, SAA7127_REG_LINE_21_EVEN_1, xds >> 8); saa7127_write(client, SAA7127_REG_LINE_21_EVEN_1, xds >> 8);
state->xds_data = xds; state->xds_data = xds;
...@@ -424,7 +424,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -424,7 +424,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat
if (enable && (data->field != 0 || data->line != 23)) if (enable && (data->field != 0 || data->line != 23))
return -EINVAL; return -EINVAL;
if (state->wss_enable != enable) { if (state->wss_enable != enable) {
v4l_dbg(1, client, "Turn WSS %s\n", enable ? "on" : "off"); v4l_dbg(1, debug, client, "Turn WSS %s\n", enable ? "on" : "off");
saa7127_write(client, 0x27, enable << 7); saa7127_write(client, 0x27, enable << 7);
state->wss_enable = enable; state->wss_enable = enable;
} }
...@@ -433,7 +433,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -433,7 +433,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat
saa7127_write(client, 0x26, data->data[0]); saa7127_write(client, 0x26, data->data[0]);
saa7127_write(client, 0x27, 0x80 | (data->data[1] & 0x3f)); saa7127_write(client, 0x27, 0x80 | (data->data[1] & 0x3f));
v4l_dbg(1, client, "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]); v4l_dbg(1, debug, client, "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]);
state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0]; state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0];
return 0; return 0;
} }
...@@ -445,11 +445,11 @@ static int saa7127_set_video_enable(struct i2c_client *client, int enable) ...@@ -445,11 +445,11 @@ static int saa7127_set_video_enable(struct i2c_client *client, int enable)
struct saa7127_state *state = i2c_get_clientdata(client); struct saa7127_state *state = i2c_get_clientdata(client);
if (enable) { if (enable) {
v4l_dbg(1, client, "Enable Video Output\n"); v4l_dbg(1, debug, client, "Enable Video Output\n");
saa7127_write(client, 0x2d, state->reg_2d); saa7127_write(client, 0x2d, state->reg_2d);
saa7127_write(client, 0x61, state->reg_61); saa7127_write(client, 0x61, state->reg_61);
} else { } else {
v4l_dbg(1, client, "Disable Video Output\n"); v4l_dbg(1, debug, client, "Disable Video Output\n");
saa7127_write(client, 0x2d, (state->reg_2d & 0xf0)); saa7127_write(client, 0x2d, (state->reg_2d & 0xf0));
saa7127_write(client, 0x61, (state->reg_61 | 0xc0)); saa7127_write(client, 0x61, (state->reg_61 | 0xc0));
} }
...@@ -465,11 +465,11 @@ static int saa7127_set_std(struct i2c_client *client, v4l2_std_id std) ...@@ -465,11 +465,11 @@ static int saa7127_set_std(struct i2c_client *client, v4l2_std_id std)
const struct i2c_reg_value *inittab; const struct i2c_reg_value *inittab;
if (std & V4L2_STD_525_60) { if (std & V4L2_STD_525_60) {
v4l_dbg(1, client, "Selecting 60 Hz video Standard\n"); v4l_dbg(1, debug, client, "Selecting 60 Hz video Standard\n");
inittab = saa7127_init_config_60hz; inittab = saa7127_init_config_60hz;
state->reg_61 = SAA7127_60HZ_DAC_CONTROL; state->reg_61 = SAA7127_60HZ_DAC_CONTROL;
} else { } else {
v4l_dbg(1, client, "Selecting 50 Hz video Standard\n"); v4l_dbg(1, debug, client, "Selecting 50 Hz video Standard\n");
inittab = saa7127_init_config_50hz; inittab = saa7127_init_config_50hz;
state->reg_61 = SAA7127_50HZ_DAC_CONTROL; state->reg_61 = SAA7127_50HZ_DAC_CONTROL;
} }
...@@ -520,7 +520,7 @@ static int saa7127_set_output_type(struct i2c_client *client, int output) ...@@ -520,7 +520,7 @@ static int saa7127_set_output_type(struct i2c_client *client, int output)
default: default:
return -EINVAL; return -EINVAL;
} }
v4l_dbg(1, client, "Selecting %s output type\n", output_strs[output]); v4l_dbg(1, debug, client, "Selecting %s output type\n", output_strs[output]);
/* Configure Encoder */ /* Configure Encoder */
saa7127_write(client, 0x2d, state->reg_2d); saa7127_write(client, 0x2d, state->reg_2d);
...@@ -537,12 +537,12 @@ static int saa7127_set_input_type(struct i2c_client *client, int input) ...@@ -537,12 +537,12 @@ static int saa7127_set_input_type(struct i2c_client *client, int input)
switch (input) { switch (input) {
case SAA7127_INPUT_TYPE_NORMAL: /* avia */ case SAA7127_INPUT_TYPE_NORMAL: /* avia */
v4l_dbg(1, client, "Selecting Normal Encoder Input\n"); v4l_dbg(1, debug, client, "Selecting Normal Encoder Input\n");
state->reg_3a_cb = 0; state->reg_3a_cb = 0;
break; break;
case SAA7127_INPUT_TYPE_TEST_IMAGE: /* color bar */ case SAA7127_INPUT_TYPE_TEST_IMAGE: /* color bar */
v4l_dbg(1, client, "Selecting Color Bar generator\n"); v4l_dbg(1, debug, client, "Selecting Color Bar generator\n");
state->reg_3a_cb = 0x80; state->reg_3a_cb = 0x80;
break; break;
...@@ -698,7 +698,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -698,7 +698,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
client->driver = &i2c_driver_saa7127; client->driver = &i2c_driver_saa7127;
snprintf(client->name, sizeof(client->name) - 1, "saa7127"); snprintf(client->name, sizeof(client->name) - 1, "saa7127");
v4l_dbg(1, client, "detecting saa7127 client on address 0x%x\n", address << 1); v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n", address << 1);
/* First test register 0: Bits 5-7 are a version ID (should be 0), /* First test register 0: Bits 5-7 are a version ID (should be 0),
and bit 2 should also be 0. and bit 2 should also be 0.
...@@ -707,7 +707,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -707,7 +707,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
0x1d after a reset and not expected to ever change. */ 0x1d after a reset and not expected to ever change. */
if ((saa7127_read(client, 0) & 0xe4) != 0 || if ((saa7127_read(client, 0) & 0xe4) != 0 ||
(saa7127_read(client, 0x29) & 0x3f) != 0x1d) { (saa7127_read(client, 0x29) & 0x3f) != 0x1d) {
v4l_dbg(1, client, "saa7127 not found\n"); v4l_dbg(1, debug, client, "saa7127 not found\n");
kfree(client); kfree(client);
return 0; return 0;
} }
...@@ -722,7 +722,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) ...@@ -722,7 +722,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind)
/* Configure Encoder */ /* Configure Encoder */
v4l_dbg(1, client, "Configuring encoder\n"); v4l_dbg(1, debug, client, "Configuring encoder\n");
saa7127_write_inittab(client, saa7127_init_config_common); saa7127_write_inittab(client, saa7127_init_config_common);
saa7127_set_std(client, V4L2_STD_NTSC); saa7127_set_std(client, V4L2_STD_NTSC);
saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH); saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH);
......
...@@ -227,8 +227,8 @@ static struct i2c_client client_template; ...@@ -227,8 +227,8 @@ static struct i2c_client client_template;
static int tda7432_write(struct i2c_client *client, int subaddr, int val) static int tda7432_write(struct i2c_client *client, int subaddr, int val)
{ {
unsigned char buffer[2]; unsigned char buffer[2];
v4l_dbg(2,client,"In tda7432_write\n"); v4l_dbg(2, debug,client,"In tda7432_write\n");
v4l_dbg(1,client,"Writing %d 0x%x\n", subaddr, val); v4l_dbg(1, debug,client,"Writing %d 0x%x\n", subaddr, val);
buffer[0] = subaddr; buffer[0] = subaddr;
buffer[1] = val; buffer[1] = val;
if (2 != i2c_master_send(client,buffer,2)) { if (2 != i2c_master_send(client,buffer,2)) {
...@@ -245,9 +245,9 @@ static int tda7432_set(struct i2c_client *client) ...@@ -245,9 +245,9 @@ static int tda7432_set(struct i2c_client *client)
{ {
struct tda7432 *t = i2c_get_clientdata(client); struct tda7432 *t = i2c_get_clientdata(client);
unsigned char buf[16]; unsigned char buf[16];
v4l_dbg(2,client,"In tda7432_set\n"); v4l_dbg(2, debug,client,"In tda7432_set\n");
v4l_dbg(1,client, v4l_dbg(1, debug,client,
"tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n", "tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n",
t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud); t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud);
buf[0] = TDA7432_IN; buf[0] = TDA7432_IN;
...@@ -271,7 +271,7 @@ static int tda7432_set(struct i2c_client *client) ...@@ -271,7 +271,7 @@ static int tda7432_set(struct i2c_client *client)
static void do_tda7432_init(struct i2c_client *client) static void do_tda7432_init(struct i2c_client *client)
{ {
struct tda7432 *t = i2c_get_clientdata(client); struct tda7432 *t = i2c_get_clientdata(client);
v4l_dbg(2,client,"In tda7432_init\n"); v4l_dbg(2, debug,client,"In tda7432_init\n");
t->input = TDA7432_STEREO_IN | /* Main (stereo) input */ t->input = TDA7432_STEREO_IN | /* Main (stereo) input */
TDA7432_BASS_SYM | /* Symmetric bass cut */ TDA7432_BASS_SYM | /* Symmetric bass cut */
...@@ -339,7 +339,7 @@ static int tda7432_command(struct i2c_client *client, ...@@ -339,7 +339,7 @@ static int tda7432_command(struct i2c_client *client,
unsigned int cmd, void *arg) unsigned int cmd, void *arg)
{ {
struct tda7432 *t = i2c_get_clientdata(client); struct tda7432 *t = i2c_get_clientdata(client);
v4l_dbg(2,client,"In tda7432_command\n"); v4l_dbg(2, debug,client,"In tda7432_command\n");
if (debug>1) if (debug>1)
v4l_i2c_print_ioctl(client,cmd); v4l_i2c_print_ioctl(client,cmd);
......
...@@ -159,7 +159,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val) ...@@ -159,7 +159,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val)
unsigned char buffer[2]; unsigned char buffer[2];
if (-1 == subaddr) { if (-1 == subaddr) {
v4l_dbg(1, &chip->c, "%s: chip_write: 0x%x\n", v4l_dbg(1, debug, &chip->c, "%s: chip_write: 0x%x\n",
chip->c.name, val); chip->c.name, val);
chip->shadow.bytes[1] = val; chip->shadow.bytes[1] = val;
buffer[0] = val; buffer[0] = val;
...@@ -169,7 +169,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val) ...@@ -169,7 +169,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val)
return -1; return -1;
} }
} else { } else {
v4l_dbg(1, &chip->c, "%s: chip_write: reg%d=0x%x\n", v4l_dbg(1, debug, &chip->c, "%s: chip_write: reg%d=0x%x\n",
chip->c.name, subaddr, val); chip->c.name, subaddr, val);
chip->shadow.bytes[subaddr+1] = val; chip->shadow.bytes[subaddr+1] = val;
buffer[0] = subaddr; buffer[0] = subaddr;
...@@ -204,7 +204,7 @@ static int chip_read(struct CHIPSTATE *chip) ...@@ -204,7 +204,7 @@ static int chip_read(struct CHIPSTATE *chip)
chip->c.name); chip->c.name);
return -1; return -1;
} }
v4l_dbg(1, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer); v4l_dbg(1, debug, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer);
return buffer; return buffer;
} }
...@@ -222,7 +222,7 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr) ...@@ -222,7 +222,7 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr)
v4l_warn(&chip->c, "%s: I/O error (read2)\n", chip->c.name); v4l_warn(&chip->c, "%s: I/O error (read2)\n", chip->c.name);
return -1; return -1;
} }
v4l_dbg(1, &chip->c, "%s: chip_read2: reg%d=0x%x\n", v4l_dbg(1, debug, &chip->c, "%s: chip_read2: reg%d=0x%x\n",
chip->c.name, subaddr,read[0]); chip->c.name, subaddr,read[0]);
return read[0]; return read[0];
} }
...@@ -235,7 +235,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd) ...@@ -235,7 +235,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd)
return 0; return 0;
/* update our shadow register set; print bytes if (debug > 0) */ /* update our shadow register set; print bytes if (debug > 0) */
v4l_dbg(1, &chip->c, "%s: chip_cmd(%s): reg=%d, data:", v4l_dbg(1, debug, &chip->c, "%s: chip_cmd(%s): reg=%d, data:",
chip->c.name, name,cmd->bytes[0]); chip->c.name, name,cmd->bytes[0]);
for (i = 1; i < cmd->count; i++) { for (i = 1; i < cmd->count; i++) {
if (debug) if (debug)
...@@ -274,7 +274,7 @@ static int chip_thread(void *data) ...@@ -274,7 +274,7 @@ static int chip_thread(void *data)
daemonize("%s", chip->c.name); daemonize("%s", chip->c.name);
allow_signal(SIGTERM); allow_signal(SIGTERM);
v4l_dbg(1, &chip->c, "%s: thread started\n", chip->c.name); v4l_dbg(1, debug, &chip->c, "%s: thread started\n", chip->c.name);
for (;;) { for (;;) {
add_wait_queue(&chip->wq, &wait); add_wait_queue(&chip->wq, &wait);
...@@ -286,7 +286,7 @@ static int chip_thread(void *data) ...@@ -286,7 +286,7 @@ static int chip_thread(void *data)
try_to_freeze(); try_to_freeze();
if (chip->done || signal_pending(current)) if (chip->done || signal_pending(current))
break; break;
v4l_dbg(1, &chip->c, "%s: thread wakeup\n", chip->c.name); v4l_dbg(1, debug, &chip->c, "%s: thread wakeup\n", chip->c.name);
/* don't do anything for radio or if mode != auto */ /* don't do anything for radio or if mode != auto */
if (chip->radio || chip->mode != 0) if (chip->radio || chip->mode != 0)
...@@ -299,7 +299,7 @@ static int chip_thread(void *data) ...@@ -299,7 +299,7 @@ static int chip_thread(void *data)
mod_timer(&chip->wt, jiffies+2*HZ); mod_timer(&chip->wt, jiffies+2*HZ);
} }
v4l_dbg(1, &chip->c, "%s: thread exiting\n", chip->c.name); v4l_dbg(1, debug, &chip->c, "%s: thread exiting\n", chip->c.name);
complete_and_exit(&chip->texit, 0); complete_and_exit(&chip->texit, 0);
return 0; return 0;
} }
...@@ -312,7 +312,7 @@ static void generic_checkmode(struct CHIPSTATE *chip) ...@@ -312,7 +312,7 @@ static void generic_checkmode(struct CHIPSTATE *chip)
if (mode == chip->prevmode) if (mode == chip->prevmode)
return; return;
v4l_dbg(1, &chip->c, "%s: thread checkmode\n", chip->c.name); v4l_dbg(1, debug, &chip->c, "%s: thread checkmode\n", chip->c.name);
chip->prevmode = mode; chip->prevmode = mode;
if (mode & VIDEO_SOUND_STEREO) if (mode & VIDEO_SOUND_STEREO)
...@@ -359,7 +359,7 @@ static int tda9840_getmode(struct CHIPSTATE *chip) ...@@ -359,7 +359,7 @@ static int tda9840_getmode(struct CHIPSTATE *chip)
if (val & TDA9840_ST_STEREO) if (val & TDA9840_ST_STEREO)
mode |= VIDEO_SOUND_STEREO; mode |= VIDEO_SOUND_STEREO;
v4l_dbg(1, &chip->c, "tda9840_getmode(): raw chip read: %d, return: %d\n", v4l_dbg(1, debug, &chip->c, "tda9840_getmode(): raw chip read: %d, return: %d\n",
val, mode); val, mode);
return mode; return mode;
} }
...@@ -655,7 +655,7 @@ static int tda9873_getmode(struct CHIPSTATE *chip) ...@@ -655,7 +655,7 @@ static int tda9873_getmode(struct CHIPSTATE *chip)
mode |= VIDEO_SOUND_STEREO; mode |= VIDEO_SOUND_STEREO;
if (val & TDA9873_DUAL) if (val & TDA9873_DUAL)
mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
v4l_dbg(1, &chip->c, "tda9873_getmode(): raw chip read: %d, return: %d\n", v4l_dbg(1, debug, &chip->c, "tda9873_getmode(): raw chip read: %d, return: %d\n",
val, mode); val, mode);
return mode; return mode;
} }
...@@ -666,12 +666,12 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode) ...@@ -666,12 +666,12 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode)
/* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */ /* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */
if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) { if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) {
v4l_dbg(1, &chip->c, "tda9873_setmode(): external input\n"); v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): external input\n");
return; return;
} }
v4l_dbg(1, &chip->c, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]); v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]);
v4l_dbg(1, &chip->c, "tda9873_setmode(): sw_data = %d\n", sw_data); v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): sw_data = %d\n", sw_data);
switch (mode) { switch (mode) {
case VIDEO_SOUND_MONO: case VIDEO_SOUND_MONO:
...@@ -692,7 +692,7 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode) ...@@ -692,7 +692,7 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode)
} }
chip_write(chip, TDA9873_SW, sw_data); chip_write(chip, TDA9873_SW, sw_data);
v4l_dbg(1, &chip->c, "tda9873_setmode(): req. mode %d; chip_write: %d\n", v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): req. mode %d; chip_write: %d\n",
mode, sw_data); mode, sw_data);
} }
...@@ -831,7 +831,7 @@ static int tda9874a_setup(struct CHIPSTATE *chip) ...@@ -831,7 +831,7 @@ static int tda9874a_setup(struct CHIPSTATE *chip)
chip_write(chip, TDA9874A_SDACOSR, (tda9874a_mode) ? 0x81:0x80); chip_write(chip, TDA9874A_SDACOSR, (tda9874a_mode) ? 0x81:0x80);
chip_write(chip, TDA9874A_AOSR, 0x00); /* or 0x10 */ chip_write(chip, TDA9874A_AOSR, 0x00); /* or 0x10 */
} }
v4l_dbg(1, &chip->c, "tda9874a_setup(): %s [0x%02X].\n", v4l_dbg(1, debug, &chip->c, "tda9874a_setup(): %s [0x%02X].\n",
tda9874a_modelist[tda9874a_STD].name,tda9874a_STD); tda9874a_modelist[tda9874a_STD].name,tda9874a_STD);
return 1; return 1;
} }
...@@ -874,7 +874,7 @@ static int tda9874a_getmode(struct CHIPSTATE *chip) ...@@ -874,7 +874,7 @@ static int tda9874a_getmode(struct CHIPSTATE *chip)
mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
} }
v4l_dbg(1, &chip->c, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n", v4l_dbg(1, debug, &chip->c, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n",
dsr, nsr, necr, mode); dsr, nsr, necr, mode);
return mode; return mode;
} }
...@@ -920,7 +920,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode) ...@@ -920,7 +920,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode)
chip_write(chip, TDA9874A_AOSR, aosr); chip_write(chip, TDA9874A_AOSR, aosr);
chip_write(chip, TDA9874A_MDACOSR, mdacosr); chip_write(chip, TDA9874A_MDACOSR, mdacosr);
v4l_dbg(1, &chip->c, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n", v4l_dbg(1, debug, &chip->c, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n",
mode, aosr, mdacosr); mode, aosr, mdacosr);
} else { /* dic == 0x07 */ } else { /* dic == 0x07 */
...@@ -955,7 +955,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode) ...@@ -955,7 +955,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode)
chip_write(chip, TDA9874A_FMMR, fmmr); chip_write(chip, TDA9874A_FMMR, fmmr);
chip_write(chip, TDA9874A_AOSR, aosr); chip_write(chip, TDA9874A_AOSR, aosr);
v4l_dbg(1, &chip->c, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n", v4l_dbg(1, debug, &chip->c, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n",
mode, fmmr, aosr); mode, fmmr, aosr);
} }
} }
...@@ -969,7 +969,7 @@ static int tda9874a_checkit(struct CHIPSTATE *chip) ...@@ -969,7 +969,7 @@ static int tda9874a_checkit(struct CHIPSTATE *chip)
if(-1 == (sic = chip_read2(chip,TDA9874A_SIC))) if(-1 == (sic = chip_read2(chip,TDA9874A_SIC)))
return 0; return 0;
v4l_dbg(1, &chip->c, "tda9874a_checkit(): DIC=0x%X, SIC=0x%X.\n", dic, sic); v4l_dbg(1, debug, &chip->c, "tda9874a_checkit(): DIC=0x%X, SIC=0x%X.\n", dic, sic);
if((dic == 0x11)||(dic == 0x07)) { if((dic == 0x11)||(dic == 0x07)) {
v4l_info(&chip->c, "found tda9874%s.\n", (dic == 0x11) ? "a":"h"); v4l_info(&chip->c, "found tda9874%s.\n", (dic == 0x11) ? "a":"h");
...@@ -1184,7 +1184,7 @@ static int ta8874z_getmode(struct CHIPSTATE *chip) ...@@ -1184,7 +1184,7 @@ static int ta8874z_getmode(struct CHIPSTATE *chip)
}else if (!(val & TA8874Z_B0)){ }else if (!(val & TA8874Z_B0)){
mode |= VIDEO_SOUND_STEREO; mode |= VIDEO_SOUND_STEREO;
} }
/* v4l_dbg(1, &chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */ /* v4l_dbg(1, debug, &chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */
return mode; return mode;
} }
...@@ -1197,7 +1197,7 @@ static void ta8874z_setmode(struct CHIPSTATE *chip, int mode) ...@@ -1197,7 +1197,7 @@ static void ta8874z_setmode(struct CHIPSTATE *chip, int mode)
{ {
int update = 1; int update = 1;
audiocmd *t = NULL; audiocmd *t = NULL;
v4l_dbg(1, &chip->c, "ta8874z_setmode(): mode: 0x%02x\n", mode); v4l_dbg(1, debug, &chip->c, "ta8874z_setmode(): mode: 0x%02x\n", mode);
switch(mode){ switch(mode){
case VIDEO_SOUND_MONO: case VIDEO_SOUND_MONO:
...@@ -1477,7 +1477,7 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -1477,7 +1477,7 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
i2c_set_clientdata(&chip->c, chip); i2c_set_clientdata(&chip->c, chip);
/* find description for the chip */ /* find description for the chip */
v4l_dbg(1, &chip->c, "chip found @ 0x%x\n", addr<<1); v4l_dbg(1, debug, &chip->c, "chip found @ 0x%x\n", addr<<1);
for (desc = chiplist; desc->name != NULL; desc++) { for (desc = chiplist; desc->name != NULL; desc++) {
if (0 == *(desc->insmodopt)) if (0 == *(desc->insmodopt))
continue; continue;
...@@ -1489,12 +1489,12 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -1489,12 +1489,12 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
break; break;
} }
if (desc->name == NULL) { if (desc->name == NULL) {
v4l_dbg(1, &chip->c, "no matching chip description found\n"); v4l_dbg(1, debug, &chip->c, "no matching chip description found\n");
return -EIO; return -EIO;
} }
v4l_info(&chip->c, "%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name); v4l_info(&chip->c, "%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name);
if (desc->flags) { if (desc->flags) {
v4l_dbg(1, &chip->c, "matches:%s%s%s.\n", v4l_dbg(1, debug, &chip->c, "matches:%s%s%s.\n",
(desc->flags & CHIP_HAS_VOLUME) ? " volume" : "", (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "",
(desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "", (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "",
(desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : ""); (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : "");
...@@ -1582,7 +1582,7 @@ static int chip_command(struct i2c_client *client, ...@@ -1582,7 +1582,7 @@ static int chip_command(struct i2c_client *client,
struct CHIPSTATE *chip = i2c_get_clientdata(client); struct CHIPSTATE *chip = i2c_get_clientdata(client);
struct CHIPDESC *desc = chiplist + chip->type; struct CHIPDESC *desc = chiplist + chip->type;
v4l_dbg(1, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd); v4l_dbg(1, debug, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd);
switch (cmd) { switch (cmd) {
case AUDC_SET_INPUT: case AUDC_SET_INPUT:
......
...@@ -49,9 +49,8 @@ ...@@ -49,9 +49,8 @@
/* These three macros assume that the debug level is set with a module /* These three macros assume that the debug level is set with a module
parameter called 'debug'. */ parameter called 'debug'. */
#define v4l_dbg(level, client, fmt, arg...) \ #define v4l_dbg(level, debug, client, fmt, arg...) \
do { \ do { \
extern int debug; \
if (debug >= (level)) \ if (debug >= (level)) \
v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment