Commit 2f254721 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: i2c whitespace cleanup

The patch just removes all trailing whitespaces, there are no actual code
changes.  I've a script to remove them from my sources now, that should kill
those no-op whitespace changes in my patches after merging this initial
cleanup.
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 63eea279
/* /*
* For the STS-Thompson TDA7432 audio processor chip * For the STS-Thompson TDA7432 audio processor chip
* *
* Handles audio functions: volume, balance, tone, loudness * Handles audio functions: volume, balance, tone, loudness
* This driver will not complain if used with any * This driver will not complain if used with any
* other i2c device with the same address. * other i2c device with the same address.
* *
* Muting and tone control by Jonathan Isom <jisom@ematic.com> * Muting and tone control by Jonathan Isom <jisom@ematic.com>
...@@ -106,7 +106,7 @@ static struct i2c_client client_template; ...@@ -106,7 +106,7 @@ static struct i2c_client client_template;
* output (for front and rear). Since most vidcap cards probably * output (for front and rear). Since most vidcap cards probably
* don't have 4 channel output, this driver will set front & rear * don't have 4 channel output, this driver will set front & rear
* together (no independent control). * together (no independent control).
*/ */
/* Subaddresses for TDA7432 */ /* Subaddresses for TDA7432 */
...@@ -132,13 +132,13 @@ static struct i2c_client client_template; ...@@ -132,13 +132,13 @@ static struct i2c_client client_template;
* 0x03 - Mute (Using Attenuators Plays better with modules) * 0x03 - Mute (Using Attenuators Plays better with modules)
* Mono probably isn't used - I'm guessing only the stereo * Mono probably isn't used - I'm guessing only the stereo
* input is connected on most cards, so we'll set it to stereo. * input is connected on most cards, so we'll set it to stereo.
* *
* Bit 3 controls bass cut: 0/1 is non-symmetric/symmetric bass cut * Bit 3 controls bass cut: 0/1 is non-symmetric/symmetric bass cut
* Bit 4 controls bass range: 0/1 is extended/standard bass range * Bit 4 controls bass range: 0/1 is extended/standard bass range
* *
* Highest 3 bits not used * Highest 3 bits not used
*/ */
#define TDA7432_STEREO_IN 0 #define TDA7432_STEREO_IN 0
#define TDA7432_MONO_IN 2 /* Probably won't be used */ #define TDA7432_MONO_IN 2 /* Probably won't be used */
#define TDA7432_BASS_SYM 1 << 3 #define TDA7432_BASS_SYM 1 << 3
...@@ -161,7 +161,7 @@ static struct i2c_client client_template; ...@@ -161,7 +161,7 @@ static struct i2c_client client_template;
#define TDA7432_LD_ON 1 << 7 #define TDA7432_LD_ON 1 << 7
/* Subaddress 0x02 - Tone control */ /* Subaddress 0x02 - Tone control */
/* Bits 0,1,2 control absolute treble gain from 0dB to 14dB /* Bits 0,1,2 control absolute treble gain from 0dB to 14dB
* 0x0 is 14dB, 0x7 is 0dB * 0x0 is 14dB, 0x7 is 0dB
...@@ -173,23 +173,23 @@ static struct i2c_client client_template; ...@@ -173,23 +173,23 @@ static struct i2c_client client_template;
* Bits 4,5,6 control absolute bass gain from 0dB to 14dB * Bits 4,5,6 control absolute bass gain from 0dB to 14dB
* (This is only true for normal base range, set in 0x00) * (This is only true for normal base range, set in 0x00)
* 0x0 << 4 is 14dB, 0x7 is 0dB * 0x0 << 4 is 14dB, 0x7 is 0dB
* *
* Bit 7 controls bass attenuation/gain (sign) * Bit 7 controls bass attenuation/gain (sign)
* 1 << 7 = gain (+) * 1 << 7 = gain (+)
* 0 << 7 = attenuation (-) * 0 << 7 = attenuation (-)
* *
* Example: * Example:
* 1 1 0 1 0 1 0 1 is +4dB bass, -4dB treble * 1 1 0 1 0 1 0 1 is +4dB bass, -4dB treble
*/ */
#define TDA7432_TREBLE_0DB 0xf #define TDA7432_TREBLE_0DB 0xf
#define TDA7432_TREBLE 7 #define TDA7432_TREBLE 7
#define TDA7432_TREBLE_GAIN 1 << 3 #define TDA7432_TREBLE_GAIN 1 << 3
#define TDA7432_BASS_0DB 0xf #define TDA7432_BASS_0DB 0xf
#define TDA7432_BASS 7 << 4 #define TDA7432_BASS 7 << 4
#define TDA7432_BASS_GAIN 1 << 7 #define TDA7432_BASS_GAIN 1 << 7
/* Subaddress 0x03 - Left Front attenuation */ /* Subaddress 0x03 - Left Front attenuation */
/* Subaddress 0x04 - Left Rear attenuation */ /* Subaddress 0x04 - Left Rear attenuation */
/* Subaddress 0x05 - Right Front attenuation */ /* Subaddress 0x05 - Right Front attenuation */
...@@ -202,7 +202,7 @@ static struct i2c_client client_template; ...@@ -202,7 +202,7 @@ static struct i2c_client client_template;
* 0x1f is -37.5dB * 0x1f is -37.5dB
* *
* Bit 5 mutes that channel when set (1 = mute, 0 = unmute) * Bit 5 mutes that channel when set (1 = mute, 0 = unmute)
* We'll use the mute on the input, though (above) * We'll use the mute on the input, though (above)
* Bits 6,7 unused * Bits 6,7 unused
*/ */
...@@ -223,8 +223,8 @@ static struct i2c_client client_template; ...@@ -223,8 +223,8 @@ static struct i2c_client client_template;
* *
* Bits 5,6,7 unused * Bits 5,6,7 unused
*/ */
/* Begin code */ /* Begin code */
...@@ -253,7 +253,7 @@ static int tda7432_read(struct i2c_client *client) ...@@ -253,7 +253,7 @@ static int tda7432_read(struct i2c_client *client)
printk(KERN_WARNING "tda7432: I/O error, trying (read)\n"); printk(KERN_WARNING "tda7432: I/O error, trying (read)\n");
return -1; return -1;
} }
dprintk("tda7432: Read 0x%02x\n", buffer); dprintk("tda7432: Read 0x%02x\n", buffer);
return buffer; return buffer;
} }
#endif #endif
...@@ -263,8 +263,8 @@ static int tda7432_set(struct i2c_client *client) ...@@ -263,8 +263,8 @@ 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];
d2printk("tda7432: In tda7432_set\n"); d2printk("tda7432: In tda7432_set\n");
dprintk(KERN_INFO dprintk(KERN_INFO
"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;
...@@ -292,10 +292,10 @@ static void do_tda7432_init(struct i2c_client *client) ...@@ -292,10 +292,10 @@ static void do_tda7432_init(struct i2c_client *client)
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 */
TDA7432_BASS_NORM; /* Normal bass range */ TDA7432_BASS_NORM; /* Normal bass range */
t->volume = 0x3b ; /* -27dB Volume */ t->volume = 0x3b ; /* -27dB Volume */
if (loudness) /* Turn loudness on? */ if (loudness) /* Turn loudness on? */
t->volume |= TDA7432_LD_ON; t->volume |= TDA7432_LD_ON;
t->muted = VIDEO_AUDIO_MUTE; t->muted = VIDEO_AUDIO_MUTE;
t->treble = TDA7432_TREBLE_0DB; /* 0dB Treble */ t->treble = TDA7432_TREBLE_0DB; /* 0dB Treble */
t->bass = TDA7432_BASS_0DB; /* 0dB Bass */ t->bass = TDA7432_BASS_0DB; /* 0dB Bass */
...@@ -328,7 +328,7 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -328,7 +328,7 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind)
client->adapter = adap; client->adapter = adap;
client->addr = addr; client->addr = addr;
i2c_set_clientdata(client, t); i2c_set_clientdata(client, t);
do_tda7432_init(client); do_tda7432_init(client);
printk(KERN_INFO "tda7432: init\n"); printk(KERN_INFO "tda7432: init\n");
...@@ -354,7 +354,7 @@ static int tda7432_detach(struct i2c_client *client) ...@@ -354,7 +354,7 @@ static int tda7432_detach(struct i2c_client *client)
do_tda7432_init(client); do_tda7432_init(client);
i2c_detach_client(client); i2c_detach_client(client);
kfree(t); kfree(t);
return 0; return 0;
} }
...@@ -369,7 +369,7 @@ static int tda7432_command(struct i2c_client *client, ...@@ -369,7 +369,7 @@ static int tda7432_command(struct i2c_client *client,
/* --- v4l ioctls --- */ /* --- v4l ioctls --- */
/* take care: bttv does userspace copying, we'll get a /* take care: bttv does userspace copying, we'll get a
kernel pointer here... */ kernel pointer here... */
/* Query card - scale from TDA7432 settings to V4L settings */ /* Query card - scale from TDA7432 settings to V4L settings */
case VIDIOCGAUDIO: case VIDIOCGAUDIO:
{ {
...@@ -385,7 +385,7 @@ static int tda7432_command(struct i2c_client *client, ...@@ -385,7 +385,7 @@ static int tda7432_command(struct i2c_client *client,
va->mode |= VIDEO_SOUND_STEREO; va->mode |= VIDEO_SOUND_STEREO;
/* Master volume control /* Master volume control
* V4L volume is min 0, max 65535 * V4L volume is min 0, max 65535
* TDA7432 Volume: * TDA7432 Volume:
* Min (-79dB) is 0x6f * Min (-79dB) is 0x6f
* Max (+20dB) is 0x07 (630) * Max (+20dB) is 0x07 (630)
* Max (0dB) is 0x20 (829) * Max (0dB) is 0x20 (829)
...@@ -396,7 +396,7 @@ static int tda7432_command(struct i2c_client *client, ...@@ -396,7 +396,7 @@ static int tda7432_command(struct i2c_client *client,
} else { /* max 0db */ } else { /* max 0db */
va->volume = ( 0x6f - (t->volume & 0x7F) ) * 829; va->volume = ( 0x6f - (t->volume & 0x7F) ) * 829;
} }
/* Balance depends on L,R attenuation /* Balance depends on L,R attenuation
* V4L balance is 0 to 65535, middle is 32768 * V4L balance is 0 to 65535, middle is 32768
* TDA7432 attenuation: min (0dB) is 0, max (-37.5dB) is 0x1f * TDA7432 attenuation: min (0dB) is 0, max (-37.5dB) is 0x1f
...@@ -404,15 +404,15 @@ static int tda7432_command(struct i2c_client *client, ...@@ -404,15 +404,15 @@ static int tda7432_command(struct i2c_client *client,
* attenuation exists for lf, lr, rf, rr * attenuation exists for lf, lr, rf, rr
* we use only lf and rf (front channels) * we use only lf and rf (front channels)
*/ */
if ( (t->lf) < (t->rf) ) if ( (t->lf) < (t->rf) )
/* right is attenuated, balance shifted left */ /* right is attenuated, balance shifted left */
va->balance = (32768 - 1057*(t->rf)); va->balance = (32768 - 1057*(t->rf));
else else
/* left is attenuated, balance shifted right */ /* left is attenuated, balance shifted right */
va->balance = (32768 + 1057*(t->lf)); va->balance = (32768 + 1057*(t->lf));
/* Bass/treble 4 bits each */ /* Bass/treble 4 bits each */
va->bass=t->bass; va->bass=t->bass;
if(va->bass >= 0x8) if(va->bass >= 0x8)
va->bass = ~(va->bass - 0x8) & 0xf; va->bass = ~(va->bass - 0x8) & 0xf;
...@@ -421,7 +421,7 @@ static int tda7432_command(struct i2c_client *client, ...@@ -421,7 +421,7 @@ static int tda7432_command(struct i2c_client *client,
if(va->treble >= 0x8) if(va->treble >= 0x8)
va->treble = ~(va->treble - 0x8) & 0xf; va->treble = ~(va->treble - 0x8) & 0xf;
va->treble = (va->treble << 12)+(va->treble << 8)+(va->treble << 4)+(va->treble); va->treble = (va->treble << 12)+(va->treble << 8)+(va->treble << 4)+(va->treble);
break; /* VIDIOCGAUDIO case */ break; /* VIDIOCGAUDIO case */
} }
...@@ -437,13 +437,13 @@ static int tda7432_command(struct i2c_client *client, ...@@ -437,13 +437,13 @@ static int tda7432_command(struct i2c_client *client,
} else { /* max 0db */ } else { /* max 0db */
t->volume = 0x6f - ((va->volume)/829); t->volume = 0x6f - ((va->volume)/829);
} }
if (loudness) /* Turn on the loudness bit */ if (loudness) /* Turn on the loudness bit */
t->volume |= TDA7432_LD_ON; t->volume |= TDA7432_LD_ON;
tda7432_write(client,TDA7432_VL, t->volume); tda7432_write(client,TDA7432_VL, t->volume);
} }
if(va->flags & VIDEO_AUDIO_BASS) if(va->flags & VIDEO_AUDIO_BASS)
{ {
t->bass = va->bass >> 12; t->bass = va->bass >> 12;
...@@ -458,15 +458,15 @@ static int tda7432_command(struct i2c_client *client, ...@@ -458,15 +458,15 @@ static int tda7432_command(struct i2c_client *client,
} }
if(va->flags & (VIDEO_AUDIO_TREBLE| VIDEO_AUDIO_BASS)) if(va->flags & (VIDEO_AUDIO_TREBLE| VIDEO_AUDIO_BASS))
tda7432_write(client,TDA7432_TN, 0x10 | (t->bass << 4) | t->treble ); tda7432_write(client,TDA7432_TN, 0x10 | (t->bass << 4) | t->treble );
if(va->flags & VIDEO_AUDIO_BALANCE) { if(va->flags & VIDEO_AUDIO_BALANCE) {
if (va->balance < 32768) if (va->balance < 32768)
{ {
/* shifted to left, attenuate right */ /* shifted to left, attenuate right */
t->rr = (32768 - va->balance)/1057; t->rr = (32768 - va->balance)/1057;
t->rf = t->rr; t->rf = t->rr;
t->lr = TDA7432_ATTEN_0DB; t->lr = TDA7432_ATTEN_0DB;
t->lf = TDA7432_ATTEN_0DB; t->lf = TDA7432_ATTEN_0DB;
} }
else if(va->balance > 32769) else if(va->balance > 32769)
{ {
...@@ -474,22 +474,22 @@ static int tda7432_command(struct i2c_client *client, ...@@ -474,22 +474,22 @@ static int tda7432_command(struct i2c_client *client,
t->lf = (va->balance - 32768)/1057; t->lf = (va->balance - 32768)/1057;
t->lr = t->lf; t->lr = t->lf;
t->rr = TDA7432_ATTEN_0DB; t->rr = TDA7432_ATTEN_0DB;
t->rf = TDA7432_ATTEN_0DB; t->rf = TDA7432_ATTEN_0DB;
} }
else else
{ {
/* centered */ /* centered */
t->rr = TDA7432_ATTEN_0DB; t->rr = TDA7432_ATTEN_0DB;
t->rf = TDA7432_ATTEN_0DB; t->rf = TDA7432_ATTEN_0DB;
t->lf = TDA7432_ATTEN_0DB; t->lf = TDA7432_ATTEN_0DB;
t->lr = TDA7432_ATTEN_0DB; t->lr = TDA7432_ATTEN_0DB;
} }
} }
t->muted=(va->flags & VIDEO_AUDIO_MUTE); t->muted=(va->flags & VIDEO_AUDIO_MUTE);
if (t->muted) if (t->muted)
{ {
/* Mute & update balance*/ /* Mute & update balance*/
tda7432_write(client,TDA7432_LF, t->lf | TDA7432_MUTE); tda7432_write(client,TDA7432_LF, t->lf | TDA7432_MUTE);
tda7432_write(client,TDA7432_LR, t->lr | TDA7432_MUTE); tda7432_write(client,TDA7432_LR, t->lr | TDA7432_MUTE);
tda7432_write(client,TDA7432_RF, t->rf | TDA7432_MUTE); tda7432_write(client,TDA7432_RF, t->rf | TDA7432_MUTE);
...@@ -500,7 +500,7 @@ static int tda7432_command(struct i2c_client *client, ...@@ -500,7 +500,7 @@ static int tda7432_command(struct i2c_client *client,
tda7432_write(client,TDA7432_RF, t->rf); tda7432_write(client,TDA7432_RF, t->rf);
tda7432_write(client,TDA7432_RR, t->rr); tda7432_write(client,TDA7432_RR, t->rr);
} }
break; break;
} /* end of VIDEOCSAUDIO case */ } /* end of VIDEOCSAUDIO case */
...@@ -529,7 +529,7 @@ static struct i2c_client client_template = ...@@ -529,7 +529,7 @@ static struct i2c_client client_template =
{ {
I2C_DEVNAME("tda7432"), I2C_DEVNAME("tda7432"),
.id = -1, .id = -1,
.driver = &driver, .driver = &driver,
}; };
static int __init tda7432_init(void) static int __init tda7432_init(void)
......
/* /*
* For the TDA9875 chip * For the TDA9875 chip
* (The TDA9875 is used on the Diamond DTV2000 french version * (The TDA9875 is used on the Diamond DTV2000 french version
* Other cards probably use these chips as well.) * Other cards probably use these chips as well.)
* This driver will not complain if used with any * This driver will not complain if used with any
* other i2c device with the same address. * other i2c device with the same address.
* *
* Copyright (c) 2000 Guillaume Delvit based on Gerd Knorr source and * Copyright (c) 2000 Guillaume Delvit based on Gerd Knorr source and
* Eric Sandeen * Eric Sandeen
* This code is placed under the terms of the GNU General Public License * This code is placed under the terms of the GNU General Public License
* Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu)
* Which was based on tda8425.c by Greg Alexander (c) 1998 * Which was based on tda8425.c by Greg Alexander (c) 1998
* *
* OPTIONS: * OPTIONS:
* debug - set to 1 if you'd like to see debug messages * debug - set to 1 if you'd like to see debug messages
* *
* Revision: 0.1 - original version * Revision: 0.1 - original version
*/ */
...@@ -64,7 +64,7 @@ static struct i2c_client client_template; ...@@ -64,7 +64,7 @@ static struct i2c_client client_template;
* http://www.semiconductors.philips.com * http://www.semiconductors.philips.com
* TDA9875: I2C-bus controlled DSP audio processor, FM demodulator * TDA9875: I2C-bus controlled DSP audio processor, FM demodulator
* *
*/ */
/* subaddresses for TDA9875 */ /* subaddresses for TDA9875 */
#define TDA9875_MUT 0x12 /*General mute (value --> 0b11001100*/ #define TDA9875_MUT 0x12 /*General mute (value --> 0b11001100*/
...@@ -133,7 +133,7 @@ static int tda9875_read(struct i2c_client *client) ...@@ -133,7 +133,7 @@ static int tda9875_read(struct i2c_client *client)
printk(KERN_WARNING "tda9875: I/O error, trying (read)\n"); printk(KERN_WARNING "tda9875: I/O error, trying (read)\n");
return -1; return -1;
} }
dprintk("Read 0x%02x\n", buffer); dprintk("Read 0x%02x\n", buffer);
return buffer; return buffer;
} }
#endif #endif
...@@ -178,7 +178,7 @@ static void tda9875_set(struct i2c_client *client) ...@@ -178,7 +178,7 @@ static void tda9875_set(struct i2c_client *client)
static void do_tda9875_init(struct i2c_client *client) static void do_tda9875_init(struct i2c_client *client)
{ {
struct tda9875 *t = i2c_get_clientdata(client); struct tda9875 *t = i2c_get_clientdata(client);
dprintk("In tda9875_init\n"); dprintk("In tda9875_init\n");
tda9875_write(client, TDA9875_CFG, 0xd0 ); /*reg de config 0 (reset)*/ tda9875_write(client, TDA9875_CFG, 0xd0 ); /*reg de config 0 (reset)*/
tda9875_write(client, TDA9875_MSR, 0x03 ); /* Monitor 0b00000XXX*/ tda9875_write(client, TDA9875_MSR, 0x03 ); /* Monitor 0b00000XXX*/
tda9875_write(client, TDA9875_C1MSB, 0x00 ); /*Car1(FM) MSB XMHz*/ tda9875_write(client, TDA9875_C1MSB, 0x00 ); /*Car1(FM) MSB XMHz*/
...@@ -192,7 +192,7 @@ static void do_tda9875_init(struct i2c_client *client) ...@@ -192,7 +192,7 @@ static void do_tda9875_init(struct i2c_client *client)
tda9875_write(client, TDA9875_FMAT, 0x00 ); /*FM Matrix reg 0x00*/ tda9875_write(client, TDA9875_FMAT, 0x00 ); /*FM Matrix reg 0x00*/
tda9875_write(client, TDA9875_SC1, 0x00 ); /* SCART 1 (SC1)*/ tda9875_write(client, TDA9875_SC1, 0x00 ); /* SCART 1 (SC1)*/
tda9875_write(client, TDA9875_SC2, 0x01 ); /* SCART 2 (sc2)*/ tda9875_write(client, TDA9875_SC2, 0x01 ); /* SCART 2 (sc2)*/
tda9875_write(client, TDA9875_CH1V, 0x10 ); /* Channel volume 1 mute*/ tda9875_write(client, TDA9875_CH1V, 0x10 ); /* Channel volume 1 mute*/
tda9875_write(client, TDA9875_CH2V, 0x10 ); /* Channel volume 2 mute */ tda9875_write(client, TDA9875_CH2V, 0x10 ); /* Channel volume 2 mute */
tda9875_write(client, TDA9875_DACOS, 0x02 ); /* sig DAC i/o(in:nicam)*/ tda9875_write(client, TDA9875_DACOS, 0x02 ); /* sig DAC i/o(in:nicam)*/
...@@ -204,14 +204,14 @@ static void do_tda9875_init(struct i2c_client *client) ...@@ -204,14 +204,14 @@ static void do_tda9875_init(struct i2c_client *client)
tda9875_write(client, TDA9875_MVR, 0x03 ); /* Vol Main right 10dB*/ tda9875_write(client, TDA9875_MVR, 0x03 ); /* Vol Main right 10dB*/
tda9875_write(client, TDA9875_MBA, 0x00 ); /* Main Bass Main 0dB*/ tda9875_write(client, TDA9875_MBA, 0x00 ); /* Main Bass Main 0dB*/
tda9875_write(client, TDA9875_MTR, 0x00 ); /* Main Treble Main 0dB*/ tda9875_write(client, TDA9875_MTR, 0x00 ); /* Main Treble Main 0dB*/
tda9875_write(client, TDA9875_ACS, 0x44 ); /* Aux chan select (dac)*/ tda9875_write(client, TDA9875_ACS, 0x44 ); /* Aux chan select (dac)*/
tda9875_write(client, TDA9875_AVL, 0x00 ); /* Vol Aux left 0dB*/ tda9875_write(client, TDA9875_AVL, 0x00 ); /* Vol Aux left 0dB*/
tda9875_write(client, TDA9875_AVR, 0x00 ); /* Vol Aux right 0dB*/ tda9875_write(client, TDA9875_AVR, 0x00 ); /* Vol Aux right 0dB*/
tda9875_write(client, TDA9875_ABA, 0x00 ); /* Aux Bass Main 0dB*/ tda9875_write(client, TDA9875_ABA, 0x00 ); /* Aux Bass Main 0dB*/
tda9875_write(client, TDA9875_ATR, 0x00 ); /* Aux Aigus Main 0dB*/ tda9875_write(client, TDA9875_ATR, 0x00 ); /* Aux Aigus Main 0dB*/
tda9875_write(client, TDA9875_MUT, 0xcc ); /* General mute */ tda9875_write(client, TDA9875_MUT, 0xcc ); /* General mute */
t->mode=AUDIO_UNMUTE; t->mode=AUDIO_UNMUTE;
t->lvol=t->rvol =0; /* 0dB */ t->lvol=t->rvol =0; /* 0dB */
t->bass=0; /* 0dB */ t->bass=0; /* 0dB */
...@@ -262,7 +262,7 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -262,7 +262,7 @@ static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind)
kfree(t); kfree(t);
return 1; return 1;
} }
do_tda9875_init(client); do_tda9875_init(client);
printk(KERN_INFO "tda9875: init\n"); printk(KERN_INFO "tda9875: init\n");
...@@ -288,7 +288,7 @@ static int tda9875_detach(struct i2c_client *client) ...@@ -288,7 +288,7 @@ static int tda9875_detach(struct i2c_client *client)
do_tda9875_init(client); do_tda9875_init(client);
i2c_detach_client(client); i2c_detach_client(client);
kfree(t); kfree(t);
return 0; return 0;
} }
...@@ -298,9 +298,9 @@ static int tda9875_command(struct i2c_client *client, ...@@ -298,9 +298,9 @@ static int tda9875_command(struct i2c_client *client,
{ {
struct tda9875 *t = i2c_get_clientdata(client); struct tda9875 *t = i2c_get_clientdata(client);
dprintk("In tda9875_command...\n"); dprintk("In tda9875_command...\n");
switch (cmd) { switch (cmd) {
/* --- v4l ioctls --- */ /* --- v4l ioctls --- */
/* take care: bttv does userspace copying, we'll get a /* take care: bttv does userspace copying, we'll get a
kernel pointer here... */ kernel pointer here... */
...@@ -335,7 +335,7 @@ static int tda9875_command(struct i2c_client *client, ...@@ -335,7 +335,7 @@ static int tda9875_command(struct i2c_client *client,
struct video_audio *va = arg; struct video_audio *va = arg;
int left,right; int left,right;
dprintk("VIDEOCSAUDIO...\n"); dprintk("VIDEOCSAUDIO...\n");
left = (min(65536 - va->balance,32768) * left = (min(65536 - va->balance,32768) *
va->volume) / 32768; va->volume) / 32768;
right = (min(va->balance,(__u16)32768) * right = (min(va->balance,(__u16)32768) *
...@@ -357,7 +357,7 @@ static int tda9875_command(struct i2c_client *client, ...@@ -357,7 +357,7 @@ static int tda9875_command(struct i2c_client *client,
t->bass = 15; t->bass = 15;
if (t->bass < -12) if (t->bass < -12)
t->bass = -12 & 0xff; t->bass = -12 & 0xff;
t->treble = ((va->treble/2700)-12) & 0xff; t->treble = ((va->treble/2700)-12) & 0xff;
if (t->treble > 12) if (t->treble > 12)
t->treble = 12; t->treble = 12;
...@@ -367,7 +367,7 @@ static int tda9875_command(struct i2c_client *client, ...@@ -367,7 +367,7 @@ static int tda9875_command(struct i2c_client *client,
//printk("tda9875 bal:%04x vol:%04x bass:%04x treble:%04x\n",va->balance,va->volume,va->bass,va->treble); //printk("tda9875 bal:%04x vol:%04x bass:%04x treble:%04x\n",va->balance,va->volume,va->bass,va->treble);
tda9875_set(client); tda9875_set(client);
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
* *
* Copyright (c) 2000 Gerd Knorr * Copyright (c) 2000 Gerd Knorr
* based on code by: * based on code by:
* Eric Sandeen (eric_sandeen@bigfoot.com) * Eric Sandeen (eric_sandeen@bigfoot.com)
* Steve VanDeBogart (vandebo@uclink.berkeley.edu) * Steve VanDeBogart (vandebo@uclink.berkeley.edu)
* Greg Alexander (galexand@acm.org) * Greg Alexander (galexand@acm.org)
* *
* This code is placed under the terms of the GNU General Public License * This code is placed under the terms of the GNU General Public License
* *
* OPTIONS: * OPTIONS:
* debug - set to 1 if you'd like to see debug messages * debug - set to 1 if you'd like to see debug messages
* *
...@@ -207,7 +207,7 @@ static int chip_read(struct CHIPSTATE *chip) ...@@ -207,7 +207,7 @@ static int chip_read(struct CHIPSTATE *chip)
i2c_clientname(&chip->c)); i2c_clientname(&chip->c));
return -1; return -1;
} }
dprintk("%s: chip_read: 0x%x\n",i2c_clientname(&chip->c),buffer); dprintk("%s: chip_read: 0x%x\n",i2c_clientname(&chip->c),buffer);
return buffer; return buffer;
} }
...@@ -227,14 +227,14 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr) ...@@ -227,14 +227,14 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr)
return -1; return -1;
} }
dprintk("%s: chip_read2: reg%d=0x%x\n", dprintk("%s: chip_read2: reg%d=0x%x\n",
i2c_clientname(&chip->c),subaddr,read[0]); i2c_clientname(&chip->c),subaddr,read[0]);
return read[0]; return read[0];
} }
static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd) static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd)
{ {
int i; int i;
if (0 == cmd->count) if (0 == cmd->count)
return 0; return 0;
...@@ -273,7 +273,7 @@ static int chip_thread(void *data) ...@@ -273,7 +273,7 @@ static int chip_thread(void *data)
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
struct CHIPSTATE *chip = data; struct CHIPSTATE *chip = data;
struct CHIPDESC *desc = chiplist + chip->type; struct CHIPDESC *desc = chiplist + chip->type;
daemonize("%s",i2c_clientname(&chip->c)); daemonize("%s",i2c_clientname(&chip->c));
allow_signal(SIGTERM); allow_signal(SIGTERM);
dprintk("%s: thread started\n", i2c_clientname(&chip->c)); dprintk("%s: thread started\n", i2c_clientname(&chip->c));
...@@ -292,10 +292,10 @@ static int chip_thread(void *data) ...@@ -292,10 +292,10 @@ static int chip_thread(void *data)
/* don't do anything for radio or if mode != auto */ /* don't do anything for radio or if mode != auto */
if (chip->norm == VIDEO_MODE_RADIO || chip->mode != 0) if (chip->norm == VIDEO_MODE_RADIO || chip->mode != 0)
continue; continue;
/* have a look what's going on */ /* have a look what's going on */
desc->checkmode(chip); desc->checkmode(chip);
/* schedule next check */ /* schedule next check */
mod_timer(&chip->wt, jiffies+2*HZ); mod_timer(&chip->wt, jiffies+2*HZ);
} }
...@@ -352,14 +352,14 @@ static void generic_checkmode(struct CHIPSTATE *chip) ...@@ -352,14 +352,14 @@ static void generic_checkmode(struct CHIPSTATE *chip)
static int tda9840_getmode(struct CHIPSTATE *chip) static int tda9840_getmode(struct CHIPSTATE *chip)
{ {
int val, mode; int val, mode;
val = chip_read(chip); val = chip_read(chip);
mode = VIDEO_SOUND_MONO; mode = VIDEO_SOUND_MONO;
if (val & TDA9840_DS_DUAL) if (val & TDA9840_DS_DUAL)
mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
if (val & TDA9840_ST_STEREO) if (val & TDA9840_ST_STEREO)
mode |= VIDEO_SOUND_STEREO; mode |= VIDEO_SOUND_STEREO;
dprintk ("tda9840_getmode(): raw chip read: %d, return: %d\n", dprintk ("tda9840_getmode(): raw chip read: %d, return: %d\n",
val, mode); val, mode);
return mode; return mode;
...@@ -369,7 +369,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode) ...@@ -369,7 +369,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode)
{ {
int update = 1; int update = 1;
int t = chip->shadow.bytes[TDA9840_SW + 1] & ~0x7e; int t = chip->shadow.bytes[TDA9840_SW + 1] & ~0x7e;
switch (mode) { switch (mode) {
case VIDEO_SOUND_MONO: case VIDEO_SOUND_MONO:
t |= TDA9840_MONO; t |= TDA9840_MONO;
...@@ -419,7 +419,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode) ...@@ -419,7 +419,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode)
* in 1dB steps - mute is 0x27 */ * in 1dB steps - mute is 0x27 */
/* 0x02 - BA in TDA9855 */ /* 0x02 - BA in TDA9855 */
/* lower 5 bits control bass gain from -12dB (0x06) to 16.5dB (0x19) /* lower 5 bits control bass gain from -12dB (0x06) to 16.5dB (0x19)
* in .5dB steps - 0 is 0x0E */ * in .5dB steps - 0 is 0x0E */
...@@ -433,7 +433,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode) ...@@ -433,7 +433,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode)
/* Unique to TDA9855: */ /* Unique to TDA9855: */
/* 4 bits << 2 control subwoofer/surround gain from -14db (0x1) to 14db (0xf) /* 4 bits << 2 control subwoofer/surround gain from -14db (0x1) to 14db (0xf)
* in 3dB steps - mute is 0x0 */ * in 3dB steps - mute is 0x0 */
/* Unique to TDA9850: */ /* Unique to TDA9850: */
/* lower 4 bits control stereo noise threshold, over which stereo turns off /* lower 4 bits control stereo noise threshold, over which stereo turns off
* set to values of 0x00 through 0x0f for Ster1 through Ster16 */ * set to values of 0x00 through 0x0f for Ster1 through Ster16 */
...@@ -446,7 +446,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode) ...@@ -446,7 +446,7 @@ static void tda9840_setmode(struct CHIPSTATE *chip, int mode)
#define TDA9855_LOUD 1<<5 /* Loudness, 1==off */ #define TDA9855_LOUD 1<<5 /* Loudness, 1==off */
#define TDA9855_SUR 1<<3 /* Surround / Subwoofer 1==.5(L-R) 0==.5(L+R) */ #define TDA9855_SUR 1<<3 /* Surround / Subwoofer 1==.5(L-R) 0==.5(L+R) */
/* Bits 0 to 3 select various combinations /* Bits 0 to 3 select various combinations
* of line in and line out, only the * of line in and line out, only the
* interesting ones are defined */ * interesting ones are defined */
#define TDA9855_EXT 1<<2 /* Selects inputs LIR and LIL. Pins 41 & 12 */ #define TDA9855_EXT 1<<2 /* Selects inputs LIR and LIL. Pins 41 & 12 */
#define TDA9855_INT 0 /* Selects inputs LOR and LOL. (internal) */ #define TDA9855_INT 0 /* Selects inputs LOR and LOL. (internal) */
...@@ -499,7 +499,7 @@ static int tda985x_getmode(struct CHIPSTATE *chip) ...@@ -499,7 +499,7 @@ static int tda985x_getmode(struct CHIPSTATE *chip)
{ {
int mode; int mode;
mode = ((TDA985x_STP | TDA985x_SAPP) & mode = ((TDA985x_STP | TDA985x_SAPP) &
chip_read(chip)) >> 4; chip_read(chip)) >> 4;
/* Add mono mode regardless of SAP and stereo */ /* Add mono mode regardless of SAP and stereo */
/* Allows forced mono */ /* Allows forced mono */
...@@ -510,7 +510,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode) ...@@ -510,7 +510,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
{ {
int update = 1; int update = 1;
int c6 = chip->shadow.bytes[TDA985x_C6+1] & 0x3f; int c6 = chip->shadow.bytes[TDA985x_C6+1] & 0x3f;
switch (mode) { switch (mode) {
case VIDEO_SOUND_MONO: case VIDEO_SOUND_MONO:
c6 |= TDA985x_MONO; c6 |= TDA985x_MONO;
...@@ -538,7 +538,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode) ...@@ -538,7 +538,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
#define TDA9873_AD 0x01 /* Adjust */ #define TDA9873_AD 0x01 /* Adjust */
#define TDA9873_PT 0x02 /* Port */ #define TDA9873_PT 0x02 /* Port */
/* Subaddress 0x00: Switching Data /* Subaddress 0x00: Switching Data
* B7..B0: * B7..B0:
* *
* B1, B0: Input source selection * B1, B0: Input source selection
...@@ -552,10 +552,10 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode) ...@@ -552,10 +552,10 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
#define TDA9873_EXT_MONO 1 #define TDA9873_EXT_MONO 1
/* B3, B2: output signal select /* B3, B2: output signal select
* B4 : transmission mode * B4 : transmission mode
* 0, 0, 1 Mono * 0, 0, 1 Mono
* 1, 0, 0 Stereo * 1, 0, 0 Stereo
* 1, 1, 1 Stereo (reversed channel) * 1, 1, 1 Stereo (reversed channel)
* 0, 0, 0 Dual AB * 0, 0, 0 Dual AB
* 0, 0, 1 Dual AA * 0, 0, 1 Dual AA
* 0, 1, 0 Dual BB * 0, 1, 0 Dual BB
...@@ -587,7 +587,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode) ...@@ -587,7 +587,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
#define TDA9873_STEREO_ADJ 0x06 /* 0dB gain */ #define TDA9873_STEREO_ADJ 0x06 /* 0dB gain */
/* Bits C6..C4 control FM stantard /* Bits C6..C4 control FM stantard
* C6, C5, C4 * C6, C5, C4
* 0, 0, 0 B/G (PAL FM) * 0, 0, 0 B/G (PAL FM)
* 0, 0, 1 M * 0, 0, 1 M
...@@ -609,7 +609,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode) ...@@ -609,7 +609,7 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
#define TDA9873_IDR_FAST 1 << 7 #define TDA9873_IDR_FAST 1 << 7
/* Subaddress 0x02: Port data */ /* Subaddress 0x02: Port data */
/* E1, E0 free programmable ports P1/P2 /* E1, E0 free programmable ports P1/P2
0, 0 both ports low 0, 0 both ports low
...@@ -632,11 +632,11 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode) ...@@ -632,11 +632,11 @@ static void tda985x_setmode(struct CHIPSTATE *chip, int mode)
*/ */
#define TDA9873_MOUT_MONO 0 #define TDA9873_MOUT_MONO 0
#define TDA9873_MOUT_FMONO 0 #define TDA9873_MOUT_FMONO 0
#define TDA9873_MOUT_DUALA 0 #define TDA9873_MOUT_DUALA 0
#define TDA9873_MOUT_DUALB 1 << 3 #define TDA9873_MOUT_DUALB 1 << 3
#define TDA9873_MOUT_ST 1 << 4 #define TDA9873_MOUT_ST 1 << 4
#define TDA9873_MOUT_EXTM (1 << 4 ) & (1 << 3) #define TDA9873_MOUT_EXTM (1 << 4 ) & (1 << 3)
#define TDA9873_MOUT_EXTL 1 << 5 #define TDA9873_MOUT_EXTL 1 << 5
#define TDA9873_MOUT_EXTR (1 << 5 ) & (1 << 3) #define TDA9873_MOUT_EXTR (1 << 5 ) & (1 << 3)
#define TDA9873_MOUT_EXTLR (1 << 5 ) & (1 << 4) #define TDA9873_MOUT_EXTLR (1 << 5 ) & (1 << 4)
#define TDA9873_MOUT_MUTE (1 << 5 ) & (1 << 4) & (1 << 3) #define TDA9873_MOUT_MUTE (1 << 5 ) & (1 << 4) & (1 << 3)
...@@ -670,13 +670,13 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode) ...@@ -670,13 +670,13 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode)
dprintk("tda9873_setmode(): external input\n"); dprintk("tda9873_setmode(): external input\n");
return; return;
} }
dprintk("tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]); dprintk("tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]);
dprintk("tda9873_setmode(): sw_data = %d\n", sw_data); dprintk("tda9873_setmode(): sw_data = %d\n", sw_data);
switch (mode) { switch (mode) {
case VIDEO_SOUND_MONO: case VIDEO_SOUND_MONO:
sw_data |= TDA9873_TR_MONO; sw_data |= TDA9873_TR_MONO;
break; break;
case VIDEO_SOUND_STEREO: case VIDEO_SOUND_STEREO:
sw_data |= TDA9873_TR_STEREO; sw_data |= TDA9873_TR_STEREO;
...@@ -871,7 +871,7 @@ static int tda9874a_getmode(struct CHIPSTATE *chip) ...@@ -871,7 +871,7 @@ static int tda9874a_getmode(struct CHIPSTATE *chip)
if(nsr & 0x02) /* NSR.S/MB=1 */ if(nsr & 0x02) /* NSR.S/MB=1 */
mode |= VIDEO_SOUND_STEREO; mode |= VIDEO_SOUND_STEREO;
#endif #endif
if(nsr & 0x01) /* NSR.D/SB=1 */ if(nsr & 0x01) /* NSR.D/SB=1 */
mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
} else { } else {
if(dsr & 0x02) /* DSR.IDSTE=1 */ if(dsr & 0x02) /* DSR.IDSTE=1 */
...@@ -1082,7 +1082,7 @@ static int tda8425_initialize(struct CHIPSTATE *chip) ...@@ -1082,7 +1082,7 @@ static int tda8425_initialize(struct CHIPSTATE *chip)
static void tda8425_setmode(struct CHIPSTATE *chip, int mode) static void tda8425_setmode(struct CHIPSTATE *chip, int mode)
{ {
int s1 = chip->shadow.bytes[TDA8425_S1+1] & 0xe1; int s1 = chip->shadow.bytes[TDA8425_S1+1] & 0xe1;
if (mode & VIDEO_SOUND_LANG1) { if (mode & VIDEO_SOUND_LANG1) {
s1 |= TDA8425_S1_ML_SOUND_A; s1 |= TDA8425_S1_ML_SOUND_A;
s1 |= TDA8425_S1_STEREO_PSEUDO; s1 |= TDA8425_S1_STEREO_PSEUDO;
...@@ -1090,10 +1090,10 @@ static void tda8425_setmode(struct CHIPSTATE *chip, int mode) ...@@ -1090,10 +1090,10 @@ static void tda8425_setmode(struct CHIPSTATE *chip, int mode)
} else if (mode & VIDEO_SOUND_LANG2) { } else if (mode & VIDEO_SOUND_LANG2) {
s1 |= TDA8425_S1_ML_SOUND_B; s1 |= TDA8425_S1_ML_SOUND_B;
s1 |= TDA8425_S1_STEREO_PSEUDO; s1 |= TDA8425_S1_STEREO_PSEUDO;
} else { } else {
s1 |= TDA8425_S1_ML_STEREO; s1 |= TDA8425_S1_ML_STEREO;
if (mode & VIDEO_SOUND_MONO) if (mode & VIDEO_SOUND_MONO)
s1 |= TDA8425_S1_STEREO_MONO; s1 |= TDA8425_S1_STEREO_MONO;
if (mode & VIDEO_SOUND_STEREO) if (mode & VIDEO_SOUND_STEREO)
...@@ -1152,7 +1152,7 @@ static void tda8425_setmode(struct CHIPSTATE *chip, int mode) ...@@ -1152,7 +1152,7 @@ static void tda8425_setmode(struct CHIPSTATE *chip, int mode)
static int ta8874z_getmode(struct CHIPSTATE *chip) static int ta8874z_getmode(struct CHIPSTATE *chip)
{ {
int val, mode; int val, mode;
val = chip_read(chip); val = chip_read(chip);
mode = VIDEO_SOUND_MONO; mode = VIDEO_SOUND_MONO;
if (val & TA8874Z_B1){ if (val & TA8874Z_B1){
...@@ -1264,7 +1264,7 @@ static struct CHIPDESC chiplist[] = { ...@@ -1264,7 +1264,7 @@ static struct CHIPDESC chiplist[] = {
.inputmute = TDA9873_MUTE | TDA9873_AUTOMUTE, .inputmute = TDA9873_MUTE | TDA9873_AUTOMUTE,
.inputmap = {0xa0, 0xa2, 0xa0, 0xa0, 0xc0}, .inputmap = {0xa0, 0xa2, 0xa0, 0xa0, 0xc0},
.inputmask = TDA9873_INP_MASK|TDA9873_MUTE|TDA9873_AUTOMUTE, .inputmask = TDA9873_INP_MASK|TDA9873_MUTE|TDA9873_AUTOMUTE,
}, },
{ {
.name = "tda9874h/a", .name = "tda9874h/a",
...@@ -1522,7 +1522,7 @@ static int chip_detach(struct i2c_client *client) ...@@ -1522,7 +1522,7 @@ static int chip_detach(struct i2c_client *client)
wake_up_interruptible(&chip->wq); wake_up_interruptible(&chip->wq);
wait_for_completion(&chip->texit); wait_for_completion(&chip->texit);
} }
i2c_detach_client(&chip->c); i2c_detach_client(&chip->c);
kfree(chip); kfree(chip);
return 0; return 0;
...@@ -1587,7 +1587,7 @@ static int chip_command(struct i2c_client *client, ...@@ -1587,7 +1587,7 @@ static int chip_command(struct i2c_client *client,
case VIDIOCSAUDIO: case VIDIOCSAUDIO:
{ {
struct video_audio *va = arg; struct video_audio *va = arg;
if (desc->flags & CHIP_HAS_VOLUME) { if (desc->flags & CHIP_HAS_VOLUME) {
chip->left = (min(65536 - va->balance,32768) * chip->left = (min(65536 - va->balance,32768) *
va->volume) / 32768; va->volume) / 32768;
...@@ -1613,7 +1613,7 @@ static int chip_command(struct i2c_client *client, ...@@ -1613,7 +1613,7 @@ static int chip_command(struct i2c_client *client,
case VIDIOCSCHAN: case VIDIOCSCHAN:
{ {
struct video_channel *vc = arg; struct video_channel *vc = arg;
dprintk(KERN_DEBUG "tvaudio: VIDIOCSCHAN\n"); dprintk(KERN_DEBUG "tvaudio: VIDIOCSCHAN\n");
chip->norm = vc->norm; chip->norm = vc->norm;
break; break;
......
...@@ -82,7 +82,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -82,7 +82,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
if (NULL == client) if (NULL == client)
return -ENODEV; return -ENODEV;
if (cmd == SOUND_MIXER_INFO) { if (cmd == SOUND_MIXER_INFO) {
mixer_info info; mixer_info info;
strlcpy(info.id, "tv card", sizeof(info.id)); strlcpy(info.id, "tv card", sizeof(info.id));
...@@ -148,7 +148,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -148,7 +148,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
va.volume) / 32768; va.volume) / 32768;
ret = v4l_to_mix2(left,right); ret = v4l_to_mix2(left,right);
break; break;
case MIXER_WRITE(SOUND_MIXER_BASS): case MIXER_WRITE(SOUND_MIXER_BASS):
va.bass = mix_to_v4l(val); va.bass = mix_to_v4l(val);
client->driver->command(client,VIDIOCSAUDIO,&va); client->driver->command(client,VIDIOCSAUDIO,&va);
...@@ -324,7 +324,7 @@ static int tvmixer_clients(struct i2c_client *client) ...@@ -324,7 +324,7 @@ static int tvmixer_clients(struct i2c_client *client)
devices[i].dev = client; devices[i].dev = client;
printk("tvmixer: %s (%s) registered with minor %d\n", printk("tvmixer: %s (%s) registered with minor %d\n",
client->name,client->adapter->name,minor); client->name,client->adapter->name,minor);
return 0; return 0;
} }
...@@ -333,7 +333,7 @@ static int tvmixer_clients(struct i2c_client *client) ...@@ -333,7 +333,7 @@ static int tvmixer_clients(struct i2c_client *client)
static int __init tvmixer_init_module(void) static int __init tvmixer_init_module(void)
{ {
int i; int i;
for (i = 0; i < DEV_MAX; i++) for (i = 0; i < DEV_MAX; i++)
devices[i].minor = -1; devices[i].minor = -1;
...@@ -343,7 +343,7 @@ static int __init tvmixer_init_module(void) ...@@ -343,7 +343,7 @@ static int __init tvmixer_init_module(void)
static void __exit tvmixer_cleanup_module(void) static void __exit tvmixer_cleanup_module(void)
{ {
int i; int i;
i2c_del_driver(&driver); i2c_del_driver(&driver);
for (i = 0; i < DEV_MAX; i++) { for (i = 0; i < DEV_MAX; i++) {
if (devices[i].minor != -1) { if (devices[i].minor != -1) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define AUDIO_RADIO 0x01 #define AUDIO_RADIO 0x01
#define AUDIO_EXTERN 0x02 #define AUDIO_EXTERN 0x02
#define AUDIO_INTERN 0x03 #define AUDIO_INTERN 0x03
#define AUDIO_OFF 0x04 #define AUDIO_OFF 0x04
#define AUDIO_ON 0x05 #define AUDIO_ON 0x05
#define AUDIO_EXTERN_1 AUDIO_EXTERN #define AUDIO_EXTERN_1 AUDIO_EXTERN
#define AUDIO_EXTERN_2 0x06 #define AUDIO_EXTERN_2 0x06
......
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