sound/pci: coding style fixes: ca0106
PATCH 4/24 sound/pci: coding style fixes: ca0106
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by Alexander Beregalov <[email protected]>
---
sound/pci/ca0106/ca0106.h | 32 +++--- sound/pci/ca0106/ca0106_main.c | 262 +++++++++++++++++++------------------- sound/pci/ca0106/ca0106_mixer.c | 22 ++-- sound/pci/ca0106/ca0106_proc.c | 66 +++++----- sound/pci/ca0106/ca_midi.c | 14 +- sound/pci/ca0106/ca_midi.h | 6 +- 6 files changed, 201 insertions(+), 201 deletions(-)
sound/pci/ca0106/ca0106.h +16 -16
@@ -5,7 +5,7 @@* * FEATURES currently supported: * See ca0106_main.c for features. -* +* * Changelog: * Support interrupts per period. * Removed noise from Center/LFE channel when in Analog mode.
@@ -174,10 +174,10 @@/********************************************************************************************************/ /* CA0106 pointer-offset register set, accessed through the PTR and DATA registers */ /********************************************************************************************************/ - +/* Initally all registers from 0x00 to 0x3f have zero contents. */ #define PLAYBACK_LIST_ADDR 0x00/* Base DMA address of a list of pointers to each period/size */ -/* One list entry: 4 bytes for DMA address, +/* One list entry: 4 bytes for DMA address, * 4 bytes for period_size << 16. * One list entry is 8 bytes long. * One list entry for each period in the buffer.
@@ -219,7 +219,7 @@* Playback mixer in enable [27:24] (one bit per channel) * Playback mixer out enable [31:28] (one bit per channel) */ -/* The Digital out jack is shared with the Center/LFE Analogue output. +/* The Digital out jack is shared with the Center/LFE Analogue output. * The jack has 4 poles. I will call 1 - Tip, 2 - Next to 1, 3 - Next to 2, 4 - Next to 3 * For Analogue: 1 -> Center Speaker, 2 -> Sub Woofer, 3 -> Ground, 4 -> Ground * For Digital: 1 -> Front SPDIF, 2 -> Rear SPDIF, 3 -> Center/Subwoofer SPDIF, 4 -> Ground.
@@ -232,7 +232,7 @@* Summary: For ALSA we use the Rear channel for SPDIF Digital AC3/DTS output */ /* A standard 2 pole mono mini-jack to RCA plug can be used for SPDIF Stereo PCM output from the Front channel. -* A standard 3 pole stereo mini-jack to 2 RCA plugs can be used for SPDIF AC3/DTS and Stereo PCM output utilising the Rear channel and just one of the RCA plugs. +* A standard 3 pole stereo mini-jack to 2 RCA plugs can be used for SPDIF AC3/DTS and Stereo PCM output utilising the Rear channel and just one of the RCA plugs. */ #define SPCS0 0x41/* SPDIF output Channel Status 0 register. For Rear. default=0x02108004, non-audio=0x02108006 */ #define SPCS1 0x42/* SPDIF output Channel Status 1 register. For Front */
@@ -331,7 +331,7 @@#define CAPTURE_SOURCE_CHANNEL2 0x00f00000/* 1 - What you hear or . 2 - ?? */ #define CAPTURE_SOURCE_CHANNEL3 0x000f0000/* 3 - Mic in, Line in, TAD in, Aux in. */ #define CAPTURE_SOURCE_RECORD_MAP 0x0000ffff/* Default 0x00e4 */ -/* Record Map [7:0] (2 bits per channel) 0=mapped to channel 0, 1=mapped to channel 1, 2=mapped to channel2, 3=mapped to channel3 +/* Record Map [7:0] (2 bits per channel) 0=mapped to channel 0, 1=mapped to channel 1, 2=mapped to channel2, 3=mapped to channel3 * Record source select for channel 0 [18:16] * Record source select for channel 1 [22:20] * Record source select for channel 2 [26:24]
@@ -432,7 +432,7 @@* Sample input rate [3:2] (0=48kHz, 1=Not available, 2=96kHz, 3=192Khz) * SRC input source select [4] 0=Audio from digital mixer, 1=Audio from analog source. * Record rate [9:8] (0=48kHz, 1=Not available, 2=96kHz, 3=192Khz) -* Record mixer output enable [12:10] +* Record mixer output enable [12:10] * I2S input rate master mode [15:14] (0=48kHz, 1=44.1kHz, 2=96kHz, 3=192Khz) * I2S output rate [17:16] (0=48kHz, 1=44.1kHz, 2=96kHz, 3=192Khz) * I2S output source select [18] (0=Audio from host, 1=Audio from SRC)
@@ -445,7 +445,7 @@* Not used [27] * Record Source 0 input [29:28] (0=SPDIF in, 1=I2S in, 2=AC97 Mic, 3=AC97 PCM) * Record Source 1 input [31:30] (0=SPDIF in, 1=I2S in, 2=AC97 Mic, 3=AC97 PCM) -*/ +*/ /* Sample rate output control register Channel=1 * I2S Input 0 volume Right [7:0] * I2S Input 0 volume Left [15:8]
@@ -467,7 +467,7 @@* AC97 output enable [5:0] * I2S output enable [19:16] * SPDIF output enable [27:24] -*/ +*/ #define UNKNOWN73 0x73/* Unknown. Readonly. Default 0x0 */ #define CHIP_VERSION 0x74/* P17 Chip version. Channel_id 0 only. Default 00000071 */ #define EXTENDED_INT_MASK 0x75/* Used by both playback and capture interrupt handler */
@@ -502,14 +502,14 @@#define I2C_A_ADC_LAST_MASK 0x00000040 //Bit mask for Last word transaction#define I2C_A_ADC_BYTE_MASK 0x00000080 //Bit mask for Byte Mode -#define I2C_A_ADC_ADD 0x00000034 //This is the Device address for ADC +#define I2C_A_ADC_ADD 0x00000034 //This is the Device address for ADC#define I2C_A_ADC_READ 0x00000001 //To perform a read operation#define I2C_A_ADC_START 0x00000100 //Start I2C transaction#define I2C_A_ADC_ABORT 0x00000200 //I2C transaction abort#define I2C_A_ADC_LAST 0x00000400 //I2C last transaction#define I2C_A_ADC_BYTE 0x00000800 //I2C one byte mode -#define I2C_D_ADC_REG_MASK 0xfe000000 //ADC address register +#define I2C_D_ADC_REG_MASK 0xfe000000 //ADC address register#define I2C_D_ADC_DAT_MASK 0x01ff0000 //ADC data register#define ADC_TIMEOUT 0x00000007 //ADC Timeout Clock Disable
@@ -708,13 +708,13 @@ struct snd_ca0106 {int snd_ca0106_mixer (struct snd_ca0106 *emu);int snd_ca0106_proc_init (struct snd_ca0106 * emu); -unsigned int snd_ca0106_ptr_read (struct snd_ca0106 * emu, -unsigned int reg, +unsigned int snd_ca0106_ptr_read (struct snd_ca0106 * emu, +unsigned int reg,unsigned int chn); -void snd_ca0106_ptr_write (struct snd_ca0106 *emu, -unsigned int reg, -unsigned int chn, +void snd_ca0106_ptr_write (struct snd_ca0106 *emu, +unsigned int reg, +unsigned int chn,unsigned int data);int snd_ca0106_i2c_write (struct snd_ca0106 *emu,u32 reg,u32 value);
sound/pci/ca0106/ca0106_main.c +131 -131
696 lines not on this page · raw message
sound/pci/ca0106/ca0106_mixer.c +11 -11
@@ -5,7 +5,7 @@* * FEATURES currently supported: * See ca0106_main.c for features. -* +* * Changelog: * Support interrupts per period. * Removed noise from Center/LFE channel when in Analog mode.
@@ -71,7 +71,7 @@#include <sound/ac97_codec.h> #include <sound/info.h> #include <sound/tlv.h> -#include <asm/io.h> +#include <linux/io.h> #include "ca0106.h"
@@ -157,7 +157,7 @@ static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,u32 mask;u32 source; - val = ucontrol->value.enumerated.item[0 ] ; + val = ucontrol->value.enumerated.item[0 ];if (val >=6 )return -EINVAL ; change = (emu->capture_source != val);
@@ -207,7 +207,7 @@ static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,* update the capture volume from the cached value * for the particular source. */ - source_id = ucontrol->value.enumerated.item[0 ] ; + source_id = ucontrol->value.enumerated.item[0 ];if (source_id >=4 )return -EINVAL ; change = (emu->i2c_capture_source != source_id);
@@ -273,23 +273,23 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,int change =0 ;u32 tmp; - val = ucontrol->value.enumerated.item[0 ] ; + val = ucontrol->value.enumerated.item[0 ];if (val >1 )return -EINVAL ; change = (emu->capture_mic_line_in != val);if (change) { emu->capture_mic_line_in = val;if (val) { -//snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ +/* snd_ca0106_i2c_write(emu, ADC_MUX, 0); Mute input */ tmp =inl (emu->port+GPIO ) & ~0x400 ; tmp = tmp |0x400 ;outl (tmp, emu->port+GPIO ); -//snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); +/* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); */ }else { -//snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */ +/* snd_ca0106_i2c_write(emu, ADC_MUX, 0); Mute input */ tmp =inl (emu->port+GPIO ) & ~0x400 ;outl (tmp, emu->port+GPIO ); -//snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); +/* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); */ } }return change;
@@ -405,7 +405,7 @@ static int snd_ca0106_volume_put(struct snd_kcontrol *kcontrol, nval = ((0xff - ucontrol->value.integer.value[0 ]) <<24 ) | ((0xff - ucontrol->value.integer.value[1 ]) <<16 ); nval |= ((0xff - ucontrol->value.integer.value[0 ]) <<8 ) | - ((0xff - ucontrol->value.integer.value[1 ]) ); + ((0xff - ucontrol->value.integer.value[1 ]));if (oval == nval)return 0 ;snd_ca0106_ptr_write (emu, reg, channel_id, nval);
@@ -451,7 +451,7 @@ static int snd_ca0106_i2c_volume_put(struct snd_kcontrol *kcontrol,return -EINVAL ;if (ogain != ngain) {if (emu->i2c_capture_source == source_id) -snd_ca0106_i2c_write (emu,ADC_ATTEN_ADCL , ((ngain) &0xff ) ); +snd_ca0106_i2c_write (emu,ADC_ATTEN_ADCL , ((ngain) &0xff )); emu->i2c_capture_volume[source_id][0 ] = ucontrol->value.integer.value[0 ]; change =1 ; }
sound/pci/ca0106/ca0106_proc.c +33 -33
213 lines not on this page · raw message
sound/pci/ca0106/ca_midi.c +7 -7
@@ -1,4 +1,4 @@ -/* +/* * Copyright 10/16/2005 Tilman Kranz <[email protected]> * Creative Audio MIDI, for the CA0106 Driver * Version: 0.0.1
@@ -66,7 +66,7 @@ static void ca_midi_interrupt(struct snd_ca_midi *midi, unsigned int status)ca_midi_clear_rx (midi); }else { byte =ca_midi_read_data (midi); -if (midi->substream_input) +if (midi->substream_input)snd_rawmidi_receive (midi->substream_input, &byte,1 );
@@ -124,7 +124,7 @@ static int ca_midi_input_open(struct snd_rawmidi_substream *substream) {struct snd_ca_midi *midi = substream->rmidi->private_data;unsigned long flags; - +if (snd_BUG_ON (!midi->dev_id))return -ENXIO ;spin_lock_irqsave (&midi->open_lock, flags);
@@ -187,13 +187,13 @@ static int ca_midi_output_close(struct snd_rawmidi_substream *substream)if (snd_BUG_ON (!midi->dev_id))return -ENXIO ; - +spin_lock_irqsave (&midi->open_lock, flags); midi->interrupt_disable (midi,midi->tx_enable); midi->midi_mode &= ~CA_MIDI_MODE_OUTPUT ; midi->substream_output =NULL ; - +if (!(midi->midi_mode &CA_MIDI_MODE_INPUT )) {spin_unlock_irqrestore (&midi->open_lock, flags);ca_midi_cmd (midi, midi->reset,0 );
@@ -230,7 +230,7 @@ static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, intunsigned char byte;spin_lock_irqsave (&midi->output_lock, flags); - +/* try to send some amount of bytes here before interrupts */ while (max >0 ) {if (ca_midi_output_ready (midi)) {
@@ -309,7 +309,7 @@ int __devinit ca_midi_init(void *dev_id, struct snd_ca_midi *midi, int device, cSNDRV_RAWMIDI_INFO_DUPLEX ; rmidi->private_data = midi; rmidi->private_free = ca_rmidi_free; - + midi->rmidi = rmidi;return 0 ; }
sound/pci/ca0106/ca_midi.h +3 -3
@@ -1,4 +1,4 @@ -/* +/* * Copyright 10/16/2005 Tilman Kranz <[email protected]> * Creative Audio MIDI, for the CA0106 Driver * Version: 0.0.1
@@ -46,8 +46,8 @@ struct snd_ca_midi {unsigned int midi_mode;int port;int tx_enable, rx_enable; -int ipr_tx, ipr_rx; - +int ipr_tx, ipr_rx; +int input_avail, output_ready;int ack, reset, enter_uart;