Alsa-devel
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 6 participants
- 51094 discussions
Added a new quirk for STAC_HP_M4 series for an 92hd75xxx family laptop.
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
---
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index f00334f..3000ecf 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -80,6 +80,7 @@ enum {
STAC_92HD71BXX_REF,
STAC_DELL_M4_1,
STAC_DELL_M4_2,
+ STAC_HP_M4,
STAC_92HD71BXX_MODELS
};
@@ -1527,12 +1528,14 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
[STAC_92HD71BXX_REF] = ref92hd71bxx_pin_configs,
[STAC_DELL_M4_1] = dell_m4_1_pin_configs,
[STAC_DELL_M4_2] = dell_m4_2_pin_configs,
+ [STAC_HP_M4] = NULL,
};
static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
[STAC_92HD71BXX_REF] = "ref",
[STAC_DELL_M4_1] = "dell-m4-1",
[STAC_DELL_M4_2] = "dell-m4-2",
+ [STAC_HP_M4] = "hp-m4",
};
static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
@@ -4204,10 +4207,24 @@ again:
spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids);
spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);
- spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
- spec->num_smuxes = ARRAY_SIZE(stac92hd71bxx_smux_nids);
spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
+ switch (spec->board_config) {
+ case STAC_HP_M4:
+ spec->num_dmics = 0;
+ spec->num_smuxes = 1;
+ spec->num_dmuxes = 0;
+
+ /* enable internal microphone */
+ snd_hda_codec_write_cache(codec, 0x0e, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80);
+ break;
+ default:
+ spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
+ spec->num_smuxes = ARRAY_SIZE(stac92hd71bxx_smux_nids);
+ spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
+ };
+
spec->multiout.num_dacs = 1;
spec->multiout.hp_nid = 0x11;
spec->multiout.dac_nids = stac92hd71bxx_dac_nids;
2
1
Added support for controlling hardware gain amps on input ports
using a volume control mixer with a mux selecting the port being controlled.
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
---
diff --git a/pci/hda/hda_codec.c b/pci/hda/hda_codec.c
index 696d77e..e12626b 100644
--- a/pci/hda/hda_codec.c
+++ b/pci/hda/hda_codec.c
@@ -961,15 +961,6 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec)
}
#endif /* SND_HDA_NEEDS_RESUME */
-/*
- * AMP control callbacks
- */
-/* retrieve parameters from private_value */
-#define get_amp_nid(kc) ((kc)->private_value & 0xffff)
-#define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3)
-#define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1)
-#define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf)
-
/* volume */
int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
diff --git a/pci/hda/hda_local.h b/pci/hda/hda_local.h
index 5c9e578..d688f50 100644
--- a/pci/hda/hda_local.h
+++ b/pci/hda/hda_local.h
@@ -418,4 +418,13 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec,
hda_nid_t nid);
#endif /* CONFIG_SND_HDA_POWER_SAVE */
+/*
+ * AMP control callbacks
+ */
+/* retrieve parameters from private_value */
+#define get_amp_nid(kc) ((kc)->private_value & 0xffff)
+#define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3)
+#define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1)
+#define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf)
+
#endif /* __SOUND_HDA_LOCAL_H */
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index f00334f..ac56481 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -156,10 +156,13 @@ struct sigmatel_spec {
unsigned int num_pwrs;
unsigned int *pwr_mapping;
hda_nid_t *pwr_nids;
+ hda_nid_t *amp_nids;
hda_nid_t *dac_list;
/* playback */
struct hda_input_mux *mono_mux;
+ struct hda_input_mux *amp_mux;
+ unsigned int cur_amux;
unsigned int cur_mmux;
struct hda_multi_out multiout;
hda_nid_t dac_nids[5];
@@ -215,6 +218,7 @@ struct sigmatel_spec {
struct hda_input_mux private_dimux;
struct hda_input_mux private_imux;
struct hda_input_mux private_smux;
+ struct hda_input_mux private_amp_mux;
struct hda_input_mux private_mono_mux;
};
@@ -243,6 +247,10 @@ static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
+static hda_nid_t stac92hd73xx_amp_nids[4] = {
+ 0x0b, 0x0c, 0x0e, 0
+};
+
#define STAC92HD73XX_NUM_DMICS 2
static hda_nid_t stac92hd73xx_dmic_nids[STAC92HD73XX_NUM_DMICS + 1] = {
0x13, 0x14, 0
@@ -448,6 +456,34 @@ static hda_nid_t stac9205_pin_nids[12] = {
0x21, 0x22,
};
+#define stac92xx_amp_volume_info snd_hda_mixer_amp_volume_info
+
+static int stac92xx_amp_volume_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ hda_nid_t nid = spec->amp_nids[spec->cur_amux];
+
+ kcontrol->private_value ^= get_amp_nid(kcontrol);
+ kcontrol->private_value |= nid;
+
+ return snd_hda_mixer_amp_volume_get(kcontrol, ucontrol);
+}
+
+static int stac92xx_amp_volume_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ hda_nid_t nid = spec->amp_nids[spec->cur_amux];
+
+ kcontrol->private_value ^= get_amp_nid(kcontrol);
+ kcontrol->private_value |= nid;
+
+ return snd_hda_mixer_amp_volume_put(kcontrol, ucontrol);
+}
+
static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
@@ -563,6 +599,41 @@ static int stac92xx_mono_mux_enum_put(struct snd_kcontrol *kcontrol,
spec->mono_nid, &spec->cur_mmux);
}
+static int stac92xx_amp_mux_enum_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ return snd_hda_input_mux_info(spec->amp_mux, uinfo);
+}
+
+static int stac92xx_amp_mux_enum_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+
+ ucontrol->value.enumerated.item[0] = spec->cur_amux;
+ return 0;
+}
+
+static int stac92xx_amp_mux_enum_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ struct snd_kcontrol *ctl =
+ snd_hda_find_mixer_ctl(codec, "Amp Capture Volume");
+ if (!ctl)
+ return -EINVAL;
+
+ snd_ctl_notify(codec->bus->card, SNDRV_CTL_EVENT_MASK_VALUE |
+ SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
+
+ return snd_hda_input_mux_put(codec, spec->amp_mux, ucontrol,
+ 0, &spec->cur_amux);
+}
+
#define stac92xx_aloopback_info snd_ctl_boolean_mono_info
static int stac92xx_aloopback_get(struct snd_kcontrol *kcontrol,
@@ -837,6 +908,31 @@ static struct hda_verb stac9205_core_init[] = {
.put = stac92xx_mono_mux_enum_put, \
}
+#define STAC_AMP_MUX \
+ { \
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
+ .name = "Amp Selector Capture Switch", \
+ .count = 1, \
+ .info = stac92xx_amp_mux_enum_info, \
+ .get = stac92xx_amp_mux_enum_get, \
+ .put = stac92xx_amp_mux_enum_put, \
+ }
+
+#define STAC_AMP_VOL(xname, nid, chs, idx, dir) \
+ { \
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
+ .name = xname, \
+ .index = 0, \
+ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
+ SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \
+ .info = stac92xx_amp_volume_info, \
+ .get = stac92xx_amp_volume_get, \
+ .put = stac92xx_amp_volume_put, \
+ .tlv = { .c = snd_hda_mixer_amp_tlv }, \
+ .private_value = HDA_COMPOSE_AMP_VAL(nid, chs, idx, dir) \
+ }
+
#define STAC_INPUT_SOURCE(cnt) \
{ \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
@@ -2418,6 +2514,8 @@ enum {
STAC_CTL_WIDGET_VOL,
STAC_CTL_WIDGET_MUTE,
STAC_CTL_WIDGET_MONO_MUX,
+ STAC_CTL_WIDGET_AMP_MUX,
+ STAC_CTL_WIDGET_AMP_VOL,
STAC_CTL_WIDGET_HP_SWITCH,
STAC_CTL_WIDGET_IO_SWITCH,
STAC_CTL_WIDGET_CLFE_SWITCH
@@ -2427,6 +2525,8 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
HDA_CODEC_VOLUME(NULL, 0, 0, 0),
HDA_CODEC_MUTE(NULL, 0, 0, 0),
STAC_MONO_MUX,
+ STAC_AMP_MUX,
+ STAC_AMP_VOL(NULL, 0, 0, 0, 0),
STAC_CODEC_HP_SWITCH(NULL),
STAC_CODEC_IO_SWITCH(NULL, 0),
STAC_CODEC_CLFE_SWITCH(NULL, 0),
@@ -2844,6 +2944,35 @@ static int stac92xx_auto_create_mono_output_ctls(struct hda_codec *codec)
"Mono Mux", spec->mono_nid);
}
+/* labels for amp mux outputs */
+static const char *stac92xx_amp_labels[3] = {
+ "Front Microphone", "Microphone", "Line In"
+};
+
+/* create amp out controls mux on capable codecs */
+static int stac92xx_auto_create_amp_output_ctls(struct hda_codec *codec)
+{
+ struct sigmatel_spec *spec = codec->spec;
+ struct hda_input_mux *amp_mux = &spec->private_amp_mux;
+ int i, err;
+
+ for (i = 0; i < ARRAY_SIZE(stac92xx_amp_labels); i++) {
+ amp_mux->items[amp_mux->num_items].label =
+ stac92xx_amp_labels[i];
+ amp_mux->items[amp_mux->num_items].index = i;
+ amp_mux->num_items++;
+ }
+
+ err = stac92xx_add_control(spec, STAC_CTL_WIDGET_AMP_MUX,
+ "Amp Selector Capture Switch", 0);
+ if (err < 0)
+ return err;
+ return stac92xx_add_control(spec, STAC_CTL_WIDGET_AMP_VOL,
+ "Amp Capture Volume",
+ HDA_COMPOSE_AMP_VAL(spec->amp_nids[0], 3, 0, HDA_INPUT));
+}
+
+
/* create PC beep volume controls */
static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
hda_nid_t nid)
@@ -3213,7 +3342,11 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
if (err < 0)
return err;
}
-
+ if (spec->amp_nids) {
+ err = stac92xx_auto_create_amp_output_ctls(codec);
+ if (err < 0)
+ return err;
+ }
if (spec->num_dmics > 0)
if ((err = stac92xx_auto_create_dmic_input_ctls(codec,
&spec->autocfg)) < 0)
@@ -3246,7 +3379,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
spec->dinput_mux = &spec->private_dimux;
spec->sinput_mux = &spec->private_smux;
spec->mono_mux = &spec->private_mono_mux;
-
+ spec->amp_mux = &spec->private_amp_mux;
return 1;
}
@@ -3914,6 +4047,7 @@ again:
spec->dmic_nids = stac92hd73xx_dmic_nids;
spec->dmux_nids = stac92hd73xx_dmux_nids;
spec->smux_nids = stac92hd73xx_smux_nids;
+ spec->amp_nids = stac92hd73xx_amp_nids;
spec->num_muxes = ARRAY_SIZE(stac92hd73xx_mux_nids);
spec->num_adcs = ARRAY_SIZE(stac92hd73xx_adc_nids);
2
1

13 Sep '08
Hi,
I have a blue-tooth headset connected to Ubuntu 8.04 but it does't work
well. I've created ~/.asoundrc as below:
pcm.bluetooth {
type bluetooth
device 20:04:07:80:BC:89
profile voice
}
ctl.bluetooth {
type bluetooth
}
now I can use command `aplay -Dbluetooth -v 2.wav` to play sound to the
headset, but the sound is little bit wired due to inaccurate rate.
Playing WAVE '2.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
Warning: rate is not accurate (requested = 16000Hz, got = 8000Hz)
please, try the plug plugin (-Dplug:bluetooth)
Bluetooth Audio Device
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 8000
exact rate : 8000 (8000/1)
msbits : 16
buffer_size : 4000
period_size : 1000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 1000
period_event : 0
start_threshold : 4000
stop_threshold : 4000
silence_threshold: 0
silence_size : 0
boundary : 2097152000
So I input command according to the aplay's recommendation `aplay
-Dplug:bluetooth -v 2.wav`. The problem comes out.
aplay -Dplug:bluetooth -v 2.wav
Playing WAVE '2.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
Plug PCM: Rate conversion PCM (8000, sformat=S16_LE)
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 16000
exact rate : 16000 (16000/1)
msbits : 16
buffer_size : 8000
period_size : 2000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 2000
period_event : 0
start_threshold : 8000
stop_threshold : 8000
silence_threshold: 0
silence_size : 0
boundary : 2097152000
Slave: Bluetooth Audio Device
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 8000
exact rate : 8000 (8000/1)
msbits : 16
buffer_size : 4000
period_size : 1000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 1000
period_event : 0
start_threshold : 4000
stop_threshold : 4000
silence_threshold: 0
silence_size : 0
boundary : 2097152000
It seems that ALSA plugs rate plugin. But I hear NOTHING from my headset
and aplay seems suspended. I turn on bluez debug flag and rebuild it. I
find the bluez suspending at 'bluetooth_playback_poll_descriptors'.
Sep 7 23:18:59 alex-laptop aplay: DEBUG: pcm_bluetooth.c 930
bluetooth_hsp_write: count=0 frames_to_read=24
Sep 7 23:18:59 alex-laptop aplay: DEBUG: pcm_bluetooth.c 993
bluetooth_hsp_write: returning 24
Sep 7 23:18:59 alex-laptop aplay: DEBUG: pcm_bluetooth.c 912
bluetooth_hsp_write: areas->step=16 areas->first=0 offset=0, size=1000
io->nonblock=0 io->hw_ptr=0 io->appl_ptr=0 stream.fd=8 link_mtu=48
data->count=0
Sep 7 23:18:59 alex-laptop aplay: DEBUG: pcm_bluetooth.c 930
bluetooth_hsp_write: count=0 frames_to_read=24
Sep 7 23:18:59 alex-laptop aplay: DEBUG: pcm_bluetooth.c 993
bluetooth_hsp_write: returning 24
Sep 7 23:18:59 alex-laptop aplay: DEBUG: pcm_bluetooth.c 802
bluetooth_playback_poll_descriptors: Space =2 pfd[0].fd=5 pfd[1].fd=6
Sep 7 23:19:01 alex-laptop audio[7979]: Received AT+VGS=11
Now I go deep into ALSA then I find ALSA suspending at:
int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
{
struct pollfd *pfd;
unsigned short *revents;
int i, npfds, pollio, err, err_poll;
npfds = snd_pcm_poll_descriptors_count(pcm);
if (npfds <= 0 || npfds >= 16) {
SNDERR("Invalid poll_fds %d\n", npfds);
return -EIO;
}
pfd = alloca(sizeof(*pfd) * npfds);
revents = alloca(sizeof(*revents) * npfds);
syslog( LOG_INFO, "%s", __FUNCTION__ );
err = snd_pcm_poll_descriptors(pcm, pfd, npfds);
if (err < 0)
return err;
if (err != npfds) {
SNDMSG("invalid poll descriptors %d\n", err);
return -EIO;
}
do {
pollio = 0;
err_poll = poll(pfd, npfds, timeout); <-------------
It seems the bluez doesn't feed ALSA some signals. But why? I notice
'bluetooth_playback_start' haven't been invoked. Is it the point? Then I
keep tracing ALSA. I find in snd_pcm_rate_commit_area
result = snd_pcm_mmap_commit(rate->gen.slave,
slave_offset,
slave_size);
if (result < (snd_pcm_sframes_t)slave_size) {
if (result < 0)
return result;
result = snd_pcm_rewind(rate->gen.slave,
result); <-----------
if (result < 0)
return result;
return 0;
}
The snd_pcm_mmap_commit returns with 24 which indicates bluetooth SCO
link mtu(48bytes). And it causes snd_pcm_rewind being called after every
package sent by bluetooth SCO link. Look at this piece of code in
snd_pcm_write_areas:
if (state == SND_PCM_STATE_PREPARED) {
snd_pcm_sframes_t hw_avail = pcm->buffer_size -
avail;
hw_avail += frames;
/* some plugins might automatically start the
stream */
state = snd_pcm_state(pcm);
if (state == SND_PCM_STATE_PREPARED &&
hw_avail >= (snd_pcm_sframes_t)
pcm->start_threshold) {
err = snd_pcm_start(pcm);
if (err < 0)
goto _end;
}
}
the 'avail' will be equal to pcm->buffer due to snd_pcm_rewind,
therefore the condition hw_avail>=pcm->start_threshold will not be
satisfied forever. That's why snd_pcm_start can't be called.
I don't know the mechanism of ALSA and I just assume ALSA wanna bluez
plugin sending whole period_size instead of only one 48bytes package. I
revise the bluez plugin:
#if 0 // this section is original bluez
frame_size = areas->step / 8;
if ((data->count + size * frame_size) <= data->link_mtu)
frames_to_read = size;
else
frames_to_read = (data->link_mtu - data->count) /
frame_size;
DBG("count=%d frames_to_read=%lu", data->count, frames_to_read);
/* Ready for more data */
buff = (uint8_t *) areas->addr +
(areas->first + areas->step * offset) / 8;
memcpy(data->buffer + data->count, buff, frame_size *
frames_to_read);
/* Remember we have some frames in the pipe now */
data->count += frames_to_read * frame_size;
if (data->count != data->link_mtu) {
ret = frames_to_read;
goto done;
}
rsend = send(data->stream.fd, data->buffer, data->link_mtu,
io->nonblock ? MSG_DONTWAIT : 0);
if (rsend > 0) {
/* Reset count pointer */
data->count = 0;
ret = frames_to_read;
} else if (rsend < 0)
ret = (errno == EPIPE) ? -EIO : -errno;
else
ret = -EIO;
#else
frame_size = areas->step / 8;
buff = (uint8_t *) areas->addr +
(areas->first + areas->step * offset) / 8;
tobesent = frame_size*size;
while( rsend<tobesent )
{
if( tobesent-rsend>data->link_mtu )
sent = send(data->stream.fd, buff
+counter*data->link_mtu,
data->link_mtu,
io->nonblock ? MSG_DONTWAIT :
0);
else
sent = send(data->stream.fd, buff
+counter*data->link_mtu,
tobesent-rsend,
io->nonblock ? MSG_DONTWAIT :
0);
if( sent > 0 )
{
if( sent != data->link_mtu && tobesent-rsend >
data->link_mtu )
DBG("got problem!");
counter++;
rsend+=sent;
}
else if (rsend < 0)
{
ret = (errno == EPIPE) ? -EIO : -errno;
break;
}
else
{
ret = -EIO;
break;
}
}
ret = size;
#endif
After this revision, the headset works but the performance isn't as good
as playing MONO 8000Hz wav directly to headset with 'aplay -Dbluetooth
1.wav'. Any hints would be appreciated.
Regards,
Galaha
1
0

Re: [alsa-devel] [PATCH] ASoC: OMAP: Fix Gumstix Overo machine driver by using snd_soc_dai struct (rev 2)
by Steve Sakoman 13 Sep '08
by Steve Sakoman 13 Sep '08
13 Sep '08
From: Jarkko Nikula <jarkko.nikula(a)nokia.com>
Structs snd_soc_codec_dai and snd_soc_cpu_dai are obsolete and are merged to
snd_soc_dai by the commit 8687eb8bded8c3c5842a85bd0c30e43fc5a3e0e0.
Signed-off-by: Jarkko Nikula <jarkko.nikula(a)nokia.com>
Acked-by: Steve Sakoman <steve(a)sakoman.com>
---
sound/soc/omap/overo.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c
index 542ff6b..1a086ce 100644
--- a/sound/soc/omap/overo.c
+++ b/sound/soc/omap/overo.c
@@ -39,8 +39,8 @@ static int overo_hw_params(struct snd_pcm_substream
*substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
- struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai;
+ struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
int ret;
/* Set codec DAI configuration */
--
1.5.6.5
2
1

Re: [alsa-devel] [PATCH] ASoC: OMAP: Fix Gumstix Overo machine driver by using snd_soc_dai struct
by Steve Sakoman 12 Sep '08
by Steve Sakoman 12 Sep '08
12 Sep '08
On Fri, Sep 12, 2008 at 1:46 PM, Felipe Balbi <me(a)felipebalbi.com> wrote:
> should this be From: Jarkko ???
Indeed. Will resubmit.
Steve
1
0

[alsa-devel] [PATCH] ASoC: OMAP: Fix Gumstix Overo machine driver by using snd_soc_dai struct
by Steve Sakoman 12 Sep '08
by Steve Sakoman 12 Sep '08
12 Sep '08
Structs snd_soc_codec_dai and snd_soc_cpu_dai are obsolete and are merged to
snd_soc_dai by the commit 8687eb8bded8c3c5842a85bd0c30e43fc5a3e0e0.
Signed-off-by: Jarkko Nikula <jarkko.nikula(a)nokia.com>
Acked-by: Steve Sakoman <steve(a)sakoman.com>
---
sound/soc/omap/overo.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c
index 542ff6b..1a086ce 100644
--- a/sound/soc/omap/overo.c
+++ b/sound/soc/omap/overo.c
@@ -39,8 +39,8 @@ static int overo_hw_params(struct snd_pcm_substream
*substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
- struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai;
+ struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
int ret;
/* Set codec DAI configuration */
--
1.5.6.5
1
0
Hi guys,
I am cross posting this because I am not sure which list it belongs to.
I have a test program I wrote to help me learn ALSA APIs, It work to a
degree. It is a
simple Capture/Playback interface. My problem is that when the Callback
starts, it
does not allow any cycles back to the main program. The main program
waits for console
input to tell the callback when to stop. Well it does not accept any
console input when
the callback is running. Any ideas??
The source is here: http://64.124.13.3/_ALSA_/Echo/
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0
ASoC and non-ASoC drivers for ACLINK on PXA share lot's of common code.
Move all common code into separate module snd-pxa2xx-lib.
Signed-off-by: Dmitry Baryshkov <dbaryshkov(a)gmail.com>
---
include/sound/pxa2xx-lib.h | 20 +++
sound/arm/Kconfig | 6 +-
sound/arm/Makefile | 3 +
sound/arm/pxa2xx-ac97-lib.c | 323 +++++++++++++++++++++++++++++++++++++++++++
sound/arm/pxa2xx-ac97.c | 247 +++------------------------------
sound/soc/pxa/Kconfig | 2 +
sound/soc/pxa/pxa2xx-ac97.c | 272 ++-----------------------------------
7 files changed, 380 insertions(+), 493 deletions(-)
create mode 100644 include/sound/pxa2xx-lib.h
create mode 100644 sound/arm/pxa2xx-ac97-lib.c
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h
new file mode 100644
index 0000000..d18dd2d
--- /dev/null
+++ b/include/sound/pxa2xx-lib.h
@@ -0,0 +1,20 @@
+#ifndef PXA2XX_LIB_H
+#define PXA2XX_LIB_H
+
+#include <linux/platform_device.h>
+#include <sound/ac97_codec.h>
+
+extern unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
+extern void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
+
+extern bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97);
+extern bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97);
+extern void pxa2xx_ac97_finish_reset(struct snd_ac97 *ac97);
+
+extern int pxa2xx_ac97_hw_suspend(void);
+extern int pxa2xx_ac97_hw_resume(void);
+
+extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
+extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
+
+#endif
diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig
index 351e19e..3fd2642 100644
--- a/sound/arm/Kconfig
+++ b/sound/arm/Kconfig
@@ -32,11 +32,15 @@ config SND_PXA2XX_PCM
tristate
select SND_PCM
+config SND_PXA2XX_LIB
+ tristate
+ select SND_AC97_CODEC
+
config SND_PXA2XX_AC97
tristate "AC97 driver for the Intel PXA2xx chip"
depends on ARCH_PXA
select SND_PXA2XX_PCM
- select SND_AC97_CODEC
+ select SND_PXA2XX_LIB
help
Say Y or M if you want to support any AC97 codec attached to
the PXA2xx AC97 interface.
diff --git a/sound/arm/Makefile b/sound/arm/Makefile
index 4ef6dd0..bb2ed88 100644
--- a/sound/arm/Makefile
+++ b/sound/arm/Makefile
@@ -11,5 +11,8 @@ snd-aaci-objs := aaci.o devdma.o
obj-$(CONFIG_SND_PXA2XX_PCM) += snd-pxa2xx-pcm.o
snd-pxa2xx-pcm-objs := pxa2xx-pcm.o
+obj-$(CONFIG_SND_PXA2XX_LIB) += snd-pxa2xx-lib.o
+snd-pxa2xx-lib-objs := pxa2xx-ac97-lib.o
+
obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
new file mode 100644
index 0000000..61cf41f
--- /dev/null
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -0,0 +1,323 @@
+/*
+ * Based on sound/arm/pxa2xx-ac97.c and sound/soc/pxa/pxa2xx-ac97.c which contain:
+ *
+ * Author: Nicolas Pitre
+ * Created: Dec 02, 2004
+ * Copyright: MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+
+#include <sound/ac97_codec.h>
+#include <sound/pxa2xx-lib.h>
+
+#include <asm/irq.h>
+#include <mach/hardware.h>
+#include <mach/pxa-regs.h>
+#include <mach/pxa2xx-gpio.h>
+#include <mach/audio.h>
+
+static DEFINE_MUTEX(car_mutex);
+static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
+static volatile long gsr_bits;
+static struct clk *ac97_clk;
+#ifdef CONFIG_PXA27x
+static struct clk *ac97conf_clk;
+#endif
+
+/*
+ * Beware PXA27x bugs:
+ *
+ * o Slot 12 read from modem space will hang controller.
+ * o CDONE, SDONE interrupt fails after any slot 12 IO.
+ *
+ * We therefore have an hybrid approach for waiting on SDONE (interrupt or
+ * 1 jiffy timeout if interrupt never comes).
+ */
+
+unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
+{
+ unsigned short val = -1;
+ volatile u32 *reg_addr;
+
+ mutex_lock(&car_mutex);
+
+ /* set up primary or secondary codec space */
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
+ reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE;
+#else
+ if (reg == AC97_GPIO_STATUS)
+ reg_addr = ac97->num ? &SMC_REG_BASE : &PMC_REG_BASE;
+ else
+ reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
+#endif
+ reg_addr += (reg >> 1);
+
+ /* start read access across the ac97 link */
+ GSR = GSR_CDONE | GSR_SDONE;
+ gsr_bits = 0;
+ val = *reg_addr;
+ if (reg == AC97_GPIO_STATUS)
+ goto out;
+ if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1) <= 0 &&
+ !((GSR | gsr_bits) & GSR_SDONE)) {
+ printk(KERN_ERR "%s: read error (ac97_reg=%d GSR=%#lx)\n",
+ __func__, reg, GSR | gsr_bits);
+ val = -1;
+ goto out;
+ }
+
+ /* valid data now */
+ GSR = GSR_CDONE | GSR_SDONE;
+ gsr_bits = 0;
+ val = *reg_addr;
+ /* but we've just started another cycle... */
+ wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
+
+out: mutex_unlock(&car_mutex);
+ return val;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_read);
+
+void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
+{
+ volatile u32 *reg_addr;
+
+ mutex_lock(&car_mutex);
+
+ /* set up primary or secondary codec space */
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
+ reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE;
+#else
+ if (reg == AC97_GPIO_STATUS)
+ reg_addr = ac97->num ? &SMC_REG_BASE : &PMC_REG_BASE;
+ else
+ reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
+#endif
+ reg_addr += (reg >> 1);
+
+ GSR = GSR_CDONE | GSR_SDONE;
+ gsr_bits = 0;
+ *reg_addr = val;
+ if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_CDONE, 1) <= 0 &&
+ !((GSR | gsr_bits) & GSR_CDONE))
+ printk(KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n",
+ __func__, reg, GSR | gsr_bits);
+
+ mutex_unlock(&car_mutex);
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_write);
+
+bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97)
+{
+#ifdef CONFIG_PXA3xx
+ int timeout = 100;
+#endif
+ gsr_bits = 0;
+
+#ifdef CONFIG_PXA27x
+ /* warm reset broken on Bulverde,
+ so manually keep AC97 reset high */
+ pxa_gpio_mode(113 | GPIO_OUT | GPIO_DFLT_HIGH);
+ udelay(10);
+ GCR |= GCR_WARM_RST;
+ pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
+ udelay(500);
+#elif defined(CONFIG_PXA3xx)
+ /* Can't use interrupts */
+ GCR |= GCR_WARM_RST;
+ while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
+ mdelay(1);
+#else
+ GCR |= GCR_WARM_RST | GCR_PRIRDY_IEN | GCR_SECRDY_IEN;
+ wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
+#endif
+
+ if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) {
+ printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n",
+ __func__, gsr_bits);
+
+ return false;
+ }
+
+ return true;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_warm_reset);
+
+bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97)
+{
+#ifdef CONFIG_PXA3xx
+ int timeout = 1000;
+
+ /* Hold CLKBPB for 100us */
+ GCR = 0;
+ GCR = GCR_CLKBPB;
+ udelay(100);
+ GCR = 0;
+#endif
+
+ GCR &= GCR_COLD_RST; /* clear everything but nCRST */
+ GCR &= ~GCR_COLD_RST; /* then assert nCRST */
+
+ gsr_bits = 0;
+#ifdef CONFIG_PXA27x
+ /* PXA27x Developers Manual section 13.5.2.2.1 */
+ clk_enable(ac97conf_clk);
+ udelay(5);
+ clk_disable(ac97conf_clk);
+ GCR = GCR_COLD_RST;
+ udelay(50);
+#elif defined(CONFIG_PXA3xx)
+ /* Can't use interrupts on PXA3xx */
+ GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
+
+ GCR = GCR_WARM_RST | GCR_COLD_RST;
+ while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--)
+ mdelay(10);
+#else
+ GCR = GCR_COLD_RST;
+ GCR |= GCR_CDONE_IE|GCR_SDONE_IE;
+ wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
+#endif
+
+ if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) {
+ printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
+ __func__, gsr_bits);
+
+ return false;
+ }
+
+ return true;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_cold_reset);
+
+
+void pxa2xx_ac97_finish_reset(struct snd_ac97 *ac97)
+{
+ GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
+ GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_finish_reset);
+
+static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
+{
+ long status;
+
+ status = GSR;
+ if (status) {
+ GSR = status;
+ gsr_bits |= status;
+ wake_up(&gsr_wq);
+
+#ifdef CONFIG_PXA27x
+ /* Although we don't use those we still need to clear them
+ since they tend to spuriously trigger when MMC is used
+ (hardware bug? go figure)... */
+ MISR = MISR_EOC;
+ PISR = PISR_EOC;
+ MCSR = MCSR_EOC;
+#endif
+
+ return IRQ_HANDLED;
+ }
+
+ return IRQ_NONE;
+}
+
+#ifdef CONFIG_PM
+int pxa2xx_ac97_hw_suspend(void)
+{
+ GCR |= GCR_ACLINK_OFF;
+ clk_disable(ac97_clk);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);
+
+int pxa2xx_ac97_hw_resume(void)
+{
+ pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
+ pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
+ pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
+ pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
+#ifdef CONFIG_PXA27x
+ /* Use GPIO 113 as AC97 Reset on Bulverde */
+ pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
+#endif
+ clk_enable(ac97_clk);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
+#endif
+
+int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
+{
+ int ret;
+
+ ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, 0, "AC97", NULL);
+ if (ret < 0)
+ goto err;
+
+ pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
+ pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
+ pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
+ pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
+#ifdef CONFIG_PXA27x
+ /* Use GPIO 113 as AC97 Reset on Bulverde */
+ pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
+ ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
+ if (IS_ERR(ac97conf_clk)) {
+ ret = PTR_ERR(ac97conf_clk);
+ ac97conf_clk = NULL;
+ goto err_irq;
+ }
+#endif
+
+ ac97_clk = clk_get(&dev->dev, "AC97CLK");
+ if (IS_ERR(ac97_clk)) {
+ ret = PTR_ERR(ac97_clk);
+ ac97_clk = NULL;
+ goto err_irq;
+ }
+
+ return clk_enable(ac97_clk);
+
+err_irq:
+ GCR |= GCR_ACLINK_OFF;
+#ifdef CONFIG_PXA27x
+ if (ac97conf_clk) {
+ clk_put(ac97conf_clk);
+ ac97conf_clk = NULL;
+ }
+#endif
+ free_irq(IRQ_AC97, NULL);
+err:
+ return ret;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
+
+void pxa2xx_ac97_hw_remove(struct platform_device *dev)
+{
+ GCR |= GCR_ACLINK_OFF;
+ free_irq(IRQ_AC97, NULL);
+#ifdef CONFIG_PXA27x
+ clk_put(ac97conf_clk);
+ ac97conf_clk = NULL;
+#endif
+ clk_disable(ac97_clk);
+ clk_put(ac97_clk);
+ ac97_clk = NULL;
+}
+EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);
+
+MODULE_AUTHOR("Nicolas Pitre");
+MODULE_DESCRIPTION("Intel/Marvell PXA sound library");
+MODULE_LICENSE("GPL");
+
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 199cca3..cba71d8 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -12,198 +12,27 @@
#include <linux/init.h>
#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/wait.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
+#include <sound/pxa2xx-lib.h>
-#include <asm/irq.h>
-#include <linux/mutex.h>
#include <mach/hardware.h>
#include <mach/pxa-regs.h>
-#include <mach/pxa2xx-gpio.h>
#include <mach/audio.h>
#include "pxa2xx-pcm.h"
-
-static DEFINE_MUTEX(car_mutex);
-static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
-static volatile long gsr_bits;
-static struct clk *ac97_clk;
-#ifdef CONFIG_PXA27x
-static struct clk *ac97conf_clk;
-#endif
-
-/*
- * Beware PXA27x bugs:
- *
- * o Slot 12 read from modem space will hang controller.
- * o CDONE, SDONE interrupt fails after any slot 12 IO.
- *
- * We therefore have an hybrid approach for waiting on SDONE (interrupt or
- * 1 jiffy timeout if interrupt never comes).
- */
-
-static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
-{
- unsigned short val = -1;
- volatile u32 *reg_addr;
-
- mutex_lock(&car_mutex);
-
- /* set up primary or secondary codec space */
- reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE;
- reg_addr += (reg >> 1);
-
- /* start read access across the ac97 link */
- GSR = GSR_CDONE | GSR_SDONE;
- gsr_bits = 0;
- val = *reg_addr;
- if (reg == AC97_GPIO_STATUS)
- goto out;
- if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1) <= 0 &&
- !((GSR | gsr_bits) & GSR_SDONE)) {
- printk(KERN_ERR "%s: read error (ac97_reg=%d GSR=%#lx)\n",
- __func__, reg, GSR | gsr_bits);
- val = -1;
- goto out;
- }
-
- /* valid data now */
- GSR = GSR_CDONE | GSR_SDONE;
- gsr_bits = 0;
- val = *reg_addr;
- /* but we've just started another cycle... */
- wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
-
-out: mutex_unlock(&car_mutex);
- return val;
-}
-
-static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
-{
- volatile u32 *reg_addr;
-
- mutex_lock(&car_mutex);
-
- /* set up primary or secondary codec space */
- reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE;
- reg_addr += (reg >> 1);
-
- GSR = GSR_CDONE | GSR_SDONE;
- gsr_bits = 0;
- *reg_addr = val;
- if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_CDONE, 1) <= 0 &&
- !((GSR | gsr_bits) & GSR_CDONE))
- printk(KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n",
- __func__, reg, GSR | gsr_bits);
-
- mutex_unlock(&car_mutex);
-}
-
static void pxa2xx_ac97_reset(struct snd_ac97 *ac97)
{
- /* First, try cold reset */
-#ifdef CONFIG_PXA3xx
- int timeout;
-
- /* Hold CLKBPB for 100us */
- GCR = 0;
- GCR = GCR_CLKBPB;
- udelay(100);
- GCR = 0;
-#endif
-
- GCR &= GCR_COLD_RST; /* clear everything but nCRST */
- GCR &= ~GCR_COLD_RST; /* then assert nCRST */
-
- gsr_bits = 0;
-#ifdef CONFIG_PXA27x
- /* PXA27x Developers Manual section 13.5.2.2.1 */
- clk_enable(ac97conf_clk);
- udelay(5);
- clk_disable(ac97conf_clk);
- GCR = GCR_COLD_RST;
- udelay(50);
-#elif defined(CONFIG_PXA3xx)
- timeout = 1000;
- /* Can't use interrupts on PXA3xx */
- GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
-
- GCR = GCR_WARM_RST | GCR_COLD_RST;
- while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--)
- mdelay(10);
-#else
- GCR = GCR_COLD_RST;
- GCR |= GCR_CDONE_IE|GCR_SDONE_IE;
- wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
-#endif
-
- if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) {
- printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
- __func__, gsr_bits);
-
- /* let's try warm reset */
- gsr_bits = 0;
-#ifdef CONFIG_PXA27x
- /* warm reset broken on Bulverde,
- so manually keep AC97 reset high */
- pxa_gpio_mode(113 | GPIO_OUT | GPIO_DFLT_HIGH);
- udelay(10);
- GCR |= GCR_WARM_RST;
- pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
- udelay(500);
-#elif defined(CONFIG_PXA3xx)
- timeout = 100;
- /* Can't use interrupts */
- GCR |= GCR_WARM_RST;
- while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
- mdelay(1);
-#else
- GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN;
- wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
-#endif
-
- if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)))
- printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n",
- __func__, gsr_bits);
- }
-
- GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
- GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
-}
-
-static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
-{
- long status;
-
- status = GSR;
- if (status) {
- GSR = status;
- gsr_bits |= status;
- wake_up(&gsr_wq);
-
-#ifdef CONFIG_PXA27x
- /* Although we don't use those we still need to clear them
- since they tend to spuriously trigger when MMC is used
- (hardware bug? go figure)... */
- MISR = MISR_EOC;
- PISR = PISR_EOC;
- MCSR = MCSR_EOC;
-#endif
-
- return IRQ_HANDLED;
+ if (!pxa2xx_ac97_try_cold_reset(ac97)) {
+ pxa2xx_ac97_try_warm_reset(ac97);
}
- return IRQ_NONE;
+ pxa2xx_ac97_finish_reset(ac97);
}
static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
@@ -288,17 +117,19 @@ static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state)
snd_ac97_suspend(pxa2xx_ac97_ac97);
if (platform_ops && platform_ops->suspend)
platform_ops->suspend(platform_ops->priv);
- GCR |= GCR_ACLINK_OFF;
- clk_disable(ac97_clk);
- return 0;
+ return pxa2xx_ac97_hw_suspend();
}
static int pxa2xx_ac97_do_resume(struct snd_card *card)
{
pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;
+ int rc;
+
+ rc = pxa2xx_ac97_hw_resume();
+ if (rc)
+ return rc;
- clk_enable(ac97_clk);
if (platform_ops && platform_ops->resume)
platform_ops->resume(platform_ops->priv);
snd_ac97_resume(pxa2xx_ac97_ac97);
@@ -354,40 +185,17 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
if (ret)
goto err;
- ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, 0, "AC97", NULL);
- if (ret < 0)
- goto err;
-
- pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
- pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
- pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
- pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
-#ifdef CONFIG_PXA27x
- /* Use GPIO 113 as AC97 Reset on Bulverde */
- pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
- ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
- if (IS_ERR(ac97conf_clk)) {
- ret = PTR_ERR(ac97conf_clk);
- ac97conf_clk = NULL;
- goto err;
- }
-#endif
-
- ac97_clk = clk_get(&dev->dev, "AC97CLK");
- if (IS_ERR(ac97_clk)) {
- ret = PTR_ERR(ac97_clk);
- ac97_clk = NULL;
+ ret = pxa2xx_ac97_hw_probe(dev);
+ if (ret)
goto err;
- }
- clk_enable(ac97_clk);
ret = snd_ac97_bus(card, 0, &pxa2xx_ac97_ops, NULL, &ac97_bus);
if (ret)
- goto err;
+ goto err_remove;
memset(&ac97_template, 0, sizeof(ac97_template));
ret = snd_ac97_mixer(ac97_bus, &ac97_template, &pxa2xx_ac97_ac97);
if (ret)
- goto err;
+ goto err_remove;
snprintf(card->shortname, sizeof(card->shortname),
"%s", snd_ac97_get_short_name(pxa2xx_ac97_ac97));
@@ -401,22 +209,11 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
return 0;
}
- err:
+err_remove:
+ pxa2xx_ac97_hw_remove(dev);
+err:
if (card)
snd_card_free(card);
- if (ac97_clk) {
- GCR |= GCR_ACLINK_OFF;
- free_irq(IRQ_AC97, NULL);
- clk_disable(ac97_clk);
- clk_put(ac97_clk);
- ac97_clk = NULL;
- }
-#ifdef CONFIG_PXA27x
- if (ac97conf_clk) {
- clk_put(ac97conf_clk);
- ac97conf_clk = NULL;
- }
-#endif
return ret;
}
@@ -427,15 +224,7 @@ static int __devexit pxa2xx_ac97_remove(struct platform_device *dev)
if (card) {
snd_card_free(card);
platform_set_drvdata(dev, NULL);
- GCR |= GCR_ACLINK_OFF;
- free_irq(IRQ_AC97, NULL);
- clk_disable(ac97_clk);
- clk_put(ac97_clk);
- ac97_clk = NULL;
-#ifdef CONFIG_PXA27x
- clk_put(ac97conf_clk);
- ac97conf_clk = NULL;
-#endif
+ pxa2xx_ac97_hw_remove(dev);
}
return 0;
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 9212c37..d1ccbdc 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -13,6 +13,8 @@ config SND_PXA2XX_AC97
config SND_PXA2XX_SOC_AC97
tristate
select AC97_BUS
+ select SND_ARM
+ select SND_PXA2XX_LIB
select SND_SOC_AC97_BUS
config SND_PXA2XX_SOC_I2S
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index d94a495..a80ae07 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -13,225 +13,30 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/wait.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
#include <sound/core.h>
-#include <sound/pcm.h>
#include <sound/ac97_codec.h>
-#include <sound/initval.h>
#include <sound/soc.h>
+#include <sound/pxa2xx-lib.h>
-#include <asm/irq.h>
-#include <linux/mutex.h>
#include <mach/hardware.h>
#include <mach/pxa-regs.h>
-#include <mach/pxa2xx-gpio.h>
-#include <mach/audio.h>
#include "pxa2xx-pcm.h"
#include "pxa2xx-ac97.h"
-static DEFINE_MUTEX(car_mutex);
-static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
-static volatile long gsr_bits;
-static struct clk *ac97_clk;
-#ifdef CONFIG_PXA27x
-static struct clk *ac97conf_clk;
-#endif
-
-/*
- * Beware PXA27x bugs:
- *
- * o Slot 12 read from modem space will hang controller.
- * o CDONE, SDONE interrupt fails after any slot 12 IO.
- *
- * We therefore have an hybrid approach for waiting on SDONE (interrupt or
- * 1 jiffy timeout if interrupt never comes).
- */
-
-static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97,
- unsigned short reg)
-{
- unsigned short val = -1;
- volatile u32 *reg_addr;
-
- mutex_lock(&car_mutex);
-
- /* set up primary or secondary codec/modem space */
-#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
- reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
-#else
- if (reg == AC97_GPIO_STATUS)
- reg_addr = ac97->num ? &SMC_REG_BASE : &PMC_REG_BASE;
- else
- reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
-#endif
- reg_addr += (reg >> 1);
-
-#ifndef CONFIG_PXA27x
- if (reg == AC97_GPIO_STATUS) {
- /* read from controller cache */
- val = *reg_addr;
- goto out;
- }
-#endif
-
- /* start read access across the ac97 link */
- GSR = GSR_CDONE | GSR_SDONE;
- gsr_bits = 0;
- val = *reg_addr;
-
- wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
- if (!((GSR | gsr_bits) & GSR_SDONE)) {
- printk(KERN_ERR "%s: read error (ac97_reg=%x GSR=%#lx)\n",
- __func__, reg, GSR | gsr_bits);
- val = -1;
- goto out;
- }
-
- /* valid data now */
- GSR = GSR_CDONE | GSR_SDONE;
- gsr_bits = 0;
- val = *reg_addr;
- /* but we've just started another cycle... */
- wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
-
-out: mutex_unlock(&car_mutex);
- return val;
-}
-
-static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
- unsigned short val)
-{
- volatile u32 *reg_addr;
-
- mutex_lock(&car_mutex);
-
- /* set up primary or secondary codec/modem space */
-#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
- reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
-#else
- if (reg == AC97_GPIO_STATUS)
- reg_addr = ac97->num ? &SMC_REG_BASE : &PMC_REG_BASE;
- else
- reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
-#endif
- reg_addr += (reg >> 1);
-
- GSR = GSR_CDONE | GSR_SDONE;
- gsr_bits = 0;
- *reg_addr = val;
- wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_CDONE, 1);
- if (!((GSR | gsr_bits) & GSR_CDONE))
- printk(KERN_ERR "%s: write error (ac97_reg=%x GSR=%#lx)\n",
- __func__, reg, GSR | gsr_bits);
-
- mutex_unlock(&car_mutex);
-}
-
static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
{
-#ifdef CONFIG_PXA3xx
- int timeout = 100;
-#endif
- gsr_bits = 0;
-
-#ifdef CONFIG_PXA27x
- /* warm reset broken on Bulverde,
- so manually keep AC97 reset high */
- pxa_gpio_mode(113 | GPIO_OUT | GPIO_DFLT_HIGH);
- udelay(10);
- GCR |= GCR_WARM_RST;
- pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
- udelay(500);
-#elif defined(CONFIG_PXA3xx)
- /* Can't use interrupts */
- GCR |= GCR_WARM_RST;
- while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
- mdelay(1);
-#else
- GCR |= GCR_WARM_RST | GCR_PRIRDY_IEN | GCR_SECRDY_IEN;
- wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
-#endif
-
- if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)))
- printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n",
- __func__, gsr_bits);
+ pxa2xx_ac97_try_warm_reset(ac97);
- GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
- GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
+ pxa2xx_ac97_finish_reset(ac97);
}
static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
{
-#ifdef CONFIG_PXA3xx
- int timeout = 1000;
-
- /* Hold CLKBPB for 100us */
- GCR = 0;
- GCR = GCR_CLKBPB;
- udelay(100);
- GCR = 0;
-#endif
+ pxa2xx_ac97_try_cold_reset(ac97);
- GCR &= GCR_COLD_RST; /* clear everything but nCRST */
- GCR &= ~GCR_COLD_RST; /* then assert nCRST */
-
- gsr_bits = 0;
-#ifdef CONFIG_PXA27x
- /* PXA27x Developers Manual section 13.5.2.2.1 */
- clk_enable(ac97conf_clk);
- udelay(5);
- clk_disable(ac97conf_clk);
- GCR = GCR_COLD_RST;
- udelay(50);
-#elif defined(CONFIG_PXA3xx)
- /* Can't use interrupts on PXA3xx */
- GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
-
- GCR = GCR_WARM_RST | GCR_COLD_RST;
- while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--)
- mdelay(10);
-#else
- GCR = GCR_COLD_RST;
- GCR |= GCR_CDONE_IE|GCR_SDONE_IE;
- wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
-#endif
-
- if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)))
- printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
- __func__, gsr_bits);
-
- GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
- GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
-}
-
-static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
-{
- long status;
-
- status = GSR;
- if (status) {
- GSR = status;
- gsr_bits |= status;
- wake_up(&gsr_wq);
-
-#ifdef CONFIG_PXA27x
- /* Although we don't use those we still need to clear them
- since they tend to spuriously trigger when MMC is used
- (hardware bug? go figure)... */
- MISR = MISR_EOC;
- PISR = PISR_EOC;
- MCSR = MCSR_EOC;
-#endif
-
- return IRQ_HANDLED;
- }
-
- return IRQ_NONE;
+ pxa2xx_ac97_finish_reset(ac97);
}
struct snd_ac97_bus_ops soc_ac97_ops = {
@@ -285,24 +90,13 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = {
static int pxa2xx_ac97_suspend(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
- GCR |= GCR_ACLINK_OFF;
- clk_disable(ac97_clk);
- return 0;
+ return pxa2xx_ac97_hw_suspend();
}
static int pxa2xx_ac97_resume(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
- pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
- pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
- pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
- pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
-#ifdef CONFIG_PXA27x
- /* Use GPIO 113 as AC97 Reset on Bulverde */
- pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
-#endif
- clk_enable(ac97_clk);
- return 0;
+ return pxa2xx_ac97_hw_resume();
}
#else
@@ -313,61 +107,13 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev,
static int pxa2xx_ac97_probe(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
- int ret;
-
- ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
- if (ret < 0)
- goto err;
-
- pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
- pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
- pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
- pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
-#ifdef CONFIG_PXA27x
- /* Use GPIO 113 as AC97 Reset on Bulverde */
- pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
-
- ac97conf_clk = clk_get(&pdev->dev, "AC97CONFCLK");
- if (IS_ERR(ac97conf_clk)) {
- ret = PTR_ERR(ac97conf_clk);
- ac97conf_clk = NULL;
- goto err_irq;
- }
-#endif
- ac97_clk = clk_get(&pdev->dev, "AC97CLK");
- if (IS_ERR(ac97_clk)) {
- ret = PTR_ERR(ac97_clk);
- ac97_clk = NULL;
- goto err_irq;
- }
- clk_enable(ac97_clk);
- return 0;
-
- err_irq:
- GCR |= GCR_ACLINK_OFF;
-#ifdef CONFIG_PXA27x
- if (ac97conf_clk) {
- clk_put(ac97conf_clk);
- ac97conf_clk = NULL;
- }
-#endif
- free_irq(IRQ_AC97, NULL);
- err:
- return ret;
+ return pxa2xx_ac97_hw_probe(pdev);
}
static void pxa2xx_ac97_remove(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
- GCR |= GCR_ACLINK_OFF;
- free_irq(IRQ_AC97, NULL);
-#ifdef CONFIG_PXA27x
- clk_put(ac97conf_clk);
- ac97conf_clk = NULL;
-#endif
- clk_disable(ac97_clk);
- clk_put(ac97_clk);
- ac97_clk = NULL;
+ pxa2xx_ac97_hw_remove(pdev);
}
static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
--
1.5.6.5
4
12
Hi,
I'm observing an issue with my audio driver in omap platform. When playing back audio files several 'buffer underrun' messages appear, but using -M option of 'aplay', audio is played fine.
Since the driver is for omap, I'm using the alsa driver for that platform with minor changes (sound/arm/omap/omap-alsa.c from omap-kernel)? Any idea what could be wrong?
Regards,
Misael
1
0
Since I got like,
$cat /proc/asound/devices
2: : timer
3: : sequencer
4: [ 0- 0]: digital audio playback
5: [ 0] : control
I created nodes according to this like,
$ls -l /dev/snd/
total 0
crw-r--r-- 1 root root 116, 5 Jun 14 18:58 controlC0
crw-r--r-- 1 root root 116, 24 Jun 14 18:55 pcmC0D0c
crw-r--r-- 1 root root 116, 4 Jun 14 18:59 pcmC0D0p
crw-r--r-- 1 root root 116, 2 Jun 14 18:59 timer
Now when I played aplay,
$aplay alarm.wav
Playing WAVE '/home/alarm.wav' : Unsigned 8 bit, Rate 22050 Hz, Mono
<3>Bad pte = 5fc2d05f, process = aplay, vm_flags = 800fb, vaddr = 4001c000
Unable to handle kernel NULL pointer dereference at virtual address 00000003
pgd = c2a70000
[00000003] *pgd=22a30031, *pte=00000000, *ppte=00000000
Internal error: Oops: 1 [#2]
Modules linked in:
CPU: 0
PC is at snd_pcm_mmap_data_nopage+0xc4/0xe8
LR is at 0x4001d000
pc : [<c01bf854>] lr : [<4001d000>] Not tainted
sp : c2a4fe6c ip : ffffffff fp : c2a4fe80
r10: 4001d000 r9 : c002bba0 r8 : c2a4e000
r7 : c2e364c4 r6 : 00000000 r5 : c2a4fea0 r4 : c2a7ac00
r3 : 00000093 r2 : 00000013 r1 : 00002000 r0 : c0afa5c0
Flags: nzcv IRQs off FIQs on Mode SVC_32 Segment user
Control: 5317F
Table: 22A70000 DAC: 00000015
Process aplay (pid: 912, stack limit = 0xc2a4e250)
Stack: (0xc2a4fe6c to 0xc2a50000)
fe60: 00000000 c29b3544 c2a4fecc c2a4fe84
c0079c58
fe80: c01bf7a0 c2a71000 c002bbe0 5fc2d05f 00000000 00000000 c2a71000
00000000
fea0: 00000002 ffffffeb c03d0040 c2e364c4 c002bba0 c002bbd4 c2a4ffb0
4001d000
fec0: c2a4ff04 c2a4fed0 c003b3a4 c0079b2c 000227d0 00000000 00000017
ffffffff
fee0: c02cd04c 00000017 c2a4ffb0 4001d000 4032e000 400cb5fc c2a4ffac
c2a4ff08
ff00: c003b5c0 c003b2dc c2a4ff14 c2faddc0 ffffffe7 c0844123 00000000
c0035ec4
ff20: 400cb5fc c2a4ff40 c2a4ff34 c01c15b8 c01c10e4 c2a4ff5c c2a4ff44
c00943d0
ff40: c01c1594 c2faddc0 000227d0 00000004 c2a4ff84 c2a4ff60 c00946ac
c00943a4
ff60: 000003d8 00000000 c2faddc0 fffffff7 c0844123 00000036 c2a4ffa4
c2a4ff88
ff80: c009470c c0094428 00000000 ffffffff 4032e320 00000008 00000004
00000004
ffa0: 00000000 c2a4ffb0 c0035cc8 c003b594 00000000 4001d000 4032c000
ffffff00
ffc0: 00000400 4032e320 00000008 00000004 00000004 4032e000 400cb5fc
000004c8
ffe0: ffffff00 bebb29e0 ffffff00 4008ce20 20000010 ffffffff 4009e42c
4009e464
Backtrace:
[<c01bf790>] (snd_pcm_mmap_data_nopage+0x0/0xe8) from [<c0079c58>]
(__handle_mm_fault+0x13c/0x760)
r5 = C29B3544 r4 = 00000000
[<c0079b1c>] (__handle_mm_fault+0x0/0x760) from [<c003b3a4>]
(do_page_fault+0xd8/0x20c)
[<c003b2cc>] (do_page_fault+0x0/0x20c) from [<c003b5c0>]
(do_DataAbort+0x3c/0xa0)
[<c003b584>] (do_DataAbort+0x0/0xa0) from [<c0035cc8>]
(ret_from_exception+0x0/0x10)
r8 = 00000004 r7 = 00000004 r6 = 00000008 r5 = 4032E320
r4 = FFFFFFFF
Code: 1590c00c e10f2000 e3823080 e121f003 (e59c3004)
Segmentation fault
No sound ...:-((
Where I am doing wrong..??
On Thu, Sep 11, 2008 at 6:12 PM, Prithwee Narayan N S <
prithweens(a)sanyo.co.in> wrote:
> Hi,
>
>
>
> Try the following nodes.
>
>
>
> # cat /proc/asound/devices
>
> 0: [ 0] : control
>
> 16: [ 0- 0]: digital audio playback
>
> 24: [ 0- 0]: digital audio capture
>
> 33: : timer
>
>
>
> / # ls -l /dev/snd/
>
> crw-rw---- 1 0 101 116, 0 Jan 1 00:00 controlC0
>
> crw-rw---- 1 0 101 116, 24 Jan 1 00:00 pcmC0D0c
>
> crw-rw---- 1 0 101 116, 16 Jan 1 00:00 pcmC0D0p
>
> crw-rw---- 1 0 101 116, 33 Jan 1 00:00 timer
>
>
>
> *aplay** -D hw:**0**,0 file.wav* or *aplay** -D plughw:0,0 file.wav*should play your WAV file provided you have the correct alsa.conf file.
>
>
>
> Regards,
>
> Prithwee Narayan.
>
>
>
> On Wed, Sep 10, 2008 at 6:16 PM, vasudha rao <vasudha.jrao(a)gmail.com>
> wrote:
>
> >
>
> > Hi ,
>
> >
>
> > I want to play and record audio file in my custom atmel 9263 board
>
> > running with linux(2.6.20).
>
> > when I tried to play aplay for a wave file, I got
>
> >
>
> > $aplay /home/alarm.wav
>
> > ALSA lib pcm.c:1707:(snd_pcm_open_noupdate) Unknown PCM default
>
> > aplay: main:446: audio open error: No such file or directory
>
> >
>
> > $aplay -l
>
> > aplay: device_list:187: no soundcards found...
>
> >
>
> > $cat /proc/asound/devices
>
> > 2: : timer
>
> > 3: : sequencer
>
> > 4: [ 0- 0]: digital audio playback
>
> > 5: [ 0] : control
>
> >
>
> > Can you tel me where I am doing wrong..??
>
> >
>
> > Thanks in advance..
>
1
0
Sir,
If you have, can you please send me the o/p of this comand,
$ls -lh /dev/snd/
Thank you..
On Thu, Sep 11, 2008 at 2:00 PM, dinesh <dinesh.dua(a)coraltele.com> wrote:
> Hi,
> As per ur proc enteries you havn't registered any capture device so u can
> not do recording with ur device.
>
>
>
> -----Original Message-----
> *From*: vasudha rao <vasudha.jrao(a)gmail.com<vasudha%20rao%20%3cvasudha.jrao(a)gmail.com%3e>
> >
> *To*: aggarwal <anuj.aggarwal(a)gmail.com<aggarwal%20%3canuj.aggarwal(a)gmail.com%3e>
> >
> *Cc*: alsa-devel(a)alsa-project.org
> *Subject*: [alsa-devel] aplay not working
> *Date*: Thu, 11 Sep 2008 13:33:10 +0530
>
> Hi ,
>
> I am not able to do audio record also..
>
> I tried following commands..
>
> $arecord
> RIFF$��.WAVEfmt ...@.@.data��.Recording WAVE 'stdout' : Unsigned 8 bit, Rate
> 8000 Hz, Mono
> arecord: xrun:1037: read/write error, state = PREPARED
>
> $aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 0: AC97 [Atmel AC97], device 0: Atmel AC97 [Atmel AC97]
> Subdevices: 1/1
> Subdevice #0: subdevice #0
>
> $aplay
> aplay: main:508: audio open error: Inappropriate ioctl for device
>
> $cat /proc/asound/cards
> 0 [AC97 ]: ac97c - Atmel AC97
> Atmel AC97 Controller at 0xfffa0000, irq 18
>
>
> $cat /proc/asound/version
> Advanced Linux Sound Architecture Driver Version 1.0.14rc1 (Tue Jan 09
> 09:56:17 2007 UTC).
>
> $cat /proc/asound/devices
> 2: : timer
> 3: : sequencer
> 4: [ 0- 0]: digital audio playback
> 5: [ 0] : control
>
>
> Where I am doing wrong..
>
>
>
> Thank you..
> _______________________________________________
> Alsa-devel mailing listAlsa-devel@alsa-project.orghttp://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
1
0
Hi ,
I am not able to do audio record also..
I tried following commands..
$arecord
RIFF$��.WAVEfmt ...@.@.data��.Recording WAVE 'stdout' : Unsigned 8 bit, Rate
8000 Hz, Mono
arecord: xrun:1037: read/write error, state = PREPARED
$aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AC97 [Atmel AC97], device 0: Atmel AC97 [Atmel AC97]
Subdevices: 1/1
Subdevice #0: subdevice #0
$aplay
aplay: main:508: audio open error: Inappropriate ioctl for device
$cat /proc/asound/cards
0 [AC97 ]: ac97c - Atmel AC97
Atmel AC97 Controller at 0xfffa0000, irq 18
$cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.14rc1 (Tue Jan 09
09:56:17 2007 UTC).
$cat /proc/asound/devices
2: : timer
3: : sequencer
4: [ 0- 0]: digital audio playback
5: [ 0] : control
Where I am doing wrong..
Thank you..
1
0
Hello,
at first I'm sorry for not using the bug-tracking system to report this
bug. But I'm not going to create one account for each os-project only to
submit a bug report.
While playing arround with mumble, I discovered a bug in the alsa
library (1.0.17a) function 'snd_device_name_hint': Calling this function
leads to a partial destroyed snd_config for my configuration. In my
case, after calling this function, an open request for certain pcm
devices fails. If you need detailed information, feel free to contact me
using my email adress. (I'm not subscribing the mailing list!)
I omitted my config here, to keep this mail short...
greetings
Andreas
1
0

10 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ac97/ac97_codec.c | 192 ++++++++++++++++----------------
sound/pci/ac97/ac97_patch.c | 252 +++++++++++++++++++++---------------------
sound/pci/ac97/ac97_pcm.c | 10 +-
sound/pci/ac97/ac97_proc.c | 24 ++--
4 files changed, 239 insertions(+), 239 deletions(-)
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 6704acb..0cf819a 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -141,33 +141,33 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
{ 0x43525958, 0xfffffff8, "CS4205", patch_cirrus_spdif, NULL },
{ 0x43525960, 0xfffffff8, "CS4291", NULL, NULL },
{ 0x43525970, 0xfffffff8, "CS4202", NULL, NULL },
-{ 0x43585421, 0xffffffff, "HSD11246", NULL, NULL }, // SmartMC II
-{ 0x43585428, 0xfffffff8, "Cx20468", patch_conexant, NULL }, // SmartAMC fixme: the mask might be different
+{ 0x43585421, 0xffffffff, "HSD11246", NULL, NULL }, /* SmartMC II */
+{ 0x43585428, 0xfffffff8, "Cx20468", patch_conexant, NULL }, /* SmartAMC fixme: the mask might be different */
{ 0x43585431, 0xffffffff, "Cx20551", patch_cx20551, NULL },
{ 0x44543031, 0xfffffff0, "DT0398", NULL, NULL },
-{ 0x454d4328, 0xffffffff, "EM28028", NULL, NULL }, // same as TR28028?
+{ 0x454d4328, 0xffffffff, "EM28028", NULL, NULL }, /* same as TR28028? */
{ 0x45838308, 0xffffffff, "ESS1988", NULL, NULL },
{ 0x48525300, 0xffffff00, "HMP9701", NULL, NULL },
{ 0x49434501, 0xffffffff, "ICE1230", NULL, NULL },
-{ 0x49434511, 0xffffffff, "ICE1232", NULL, NULL }, // alias VIA VT1611A?
+{ 0x49434511, 0xffffffff, "ICE1232", NULL, NULL }, /* alias VIA VT1611A? */
{ 0x49434514, 0xffffffff, "ICE1232A", NULL, NULL },
-{ 0x49434551, 0xffffffff, "VT1616", patch_vt1616, NULL },
-{ 0x49434552, 0xffffffff, "VT1616i", patch_vt1616, NULL }, // VT1616 compatible (chipset integrated)
+{ 0x49434551, 0xffffffff, "VT1616", patch_vt1616, NULL },
+{ 0x49434552, 0xffffffff, "VT1616i", patch_vt1616, NULL }, /* VT1616 compatible (chipset integrated) */
{ 0x49544520, 0xffffffff, "IT2226E", NULL, NULL },
{ 0x49544561, 0xffffffff, "IT2646E", patch_it2646, NULL },
-{ 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL, NULL }, // only guess --jk
+{ 0x4e534300, 0xffffffff, "LM4540,43,45,46,48", NULL, NULL }, /* only guess --jk */
{ 0x4e534331, 0xffffffff, "LM4549", NULL, NULL },
-{ 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix
+{ 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, /* volume wrap fix */
{ 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL },
{ 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH },
{ 0x54524102, 0xffffffff, "TR28022", NULL, NULL },
{ 0x54524103, 0xffffffff, "TR28023", NULL, NULL },
{ 0x54524106, 0xffffffff, "TR28026", NULL, NULL },
-{ 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, // added by xin jin [07/09/99]
-{ 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)]
+{ 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, /* added by xin jin [07/09/99] */
+{ 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, /* only guess --jk [TR28023 = eMicro EM28023 (new CT1297)] */
{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
-{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF
-{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF
+{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, /* modified ICE1232 with S/PDIF */
+{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, /* modified VT1616 with S/PDIF */
{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL },
{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
@@ -186,11 +186,11 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
{ 0x83847608, 0xffffffff, "STAC9708,11", patch_sigmatel_stac9708, NULL },
{ 0x83847609, 0xffffffff, "STAC9721,23", patch_sigmatel_stac9721, NULL },
{ 0x83847644, 0xffffffff, "STAC9744", patch_sigmatel_stac9744, NULL },
-{ 0x83847650, 0xffffffff, "STAC9750,51", NULL, NULL }, // patch?
-{ 0x83847652, 0xffffffff, "STAC9752,53", NULL, NULL }, // patch?
+{ 0x83847650, 0xffffffff, "STAC9750,51", NULL, NULL }, /* patch? */
+{ 0x83847652, 0xffffffff, "STAC9752,53", NULL, NULL }, /* patch? */
{ 0x83847656, 0xffffffff, "STAC9756,57", patch_sigmatel_stac9756, NULL },
{ 0x83847658, 0xffffffff, "STAC9758,59", patch_sigmatel_stac9758, NULL },
-{ 0x83847666, 0xffffffff, "STAC9766,67", NULL, NULL }, // patch?
+{ 0x83847666, 0xffffffff, "STAC9766,67", NULL, NULL }, /* patch? */
{ 0, 0, NULL, NULL, NULL }
};
@@ -274,7 +274,7 @@ EXPORT_SYMBOL(snd_ac97_write);
/**
* snd_ac97_read - read a value from the given register
- *
+ *
* @ac97: the ac97 instance
* @reg: the register to read
*
@@ -293,9 +293,9 @@ unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
/* read a register - return the cached value if already read */
static inline unsigned short snd_ac97_read_cache(struct snd_ac97 *ac97, unsigned short reg)
{
- if (! test_bit(reg, ac97->reg_accessed)) {
+ if (!test_bit(reg, ac97->reg_accessed)) {
ac97->regs[reg] = ac97->bus->ops->read(ac97, reg);
- // set_bit(reg, ac97->reg_accessed);
+ /* set_bit(reg, ac97->reg_accessed); */
}
return ac97->regs[reg];
}
@@ -437,11 +437,11 @@ static int snd_ac97_info_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = e->shift_l == e->shift_r ? 1 : 2;
uinfo->value.enumerated.items = e->mask;
-
+
if (uinfo->value.enumerated.item > e->mask - 1)
uinfo->value.enumerated.item = e->mask - 1;
strcpy(uinfo->value.enumerated.name, e->texts[uinfo->value.enumerated.item]);
@@ -454,7 +454,7 @@ static int snd_ac97_get_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
unsigned short val, bitmask;
-
+
for (bitmask = 1; bitmask < e->mask; bitmask <<= 1)
;
val = snd_ac97_read_cache(ac97, e->reg);
@@ -472,7 +472,7 @@ static int snd_ac97_put_enum_double(struct snd_kcontrol *kcontrol,
struct ac97_enum *e = (struct ac97_enum *)kcontrol->private_value;
unsigned short val;
unsigned short mask, bitmask;
-
+
for (bitmask = 1; bitmask < e->mask; bitmask <<= 1)
;
if (ucontrol->value.enumerated.item[0] > e->mask - 1)
@@ -561,7 +561,7 @@ static int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol,
int invert = (kcontrol->private_value >> 24) & 0x01;
int err, page_save;
unsigned short val, val2, val_mask;
-
+
page_save = snd_ac97_page_save(ac97, reg, kcontrol);
val = (ucontrol->value.integer.value[0] & mask);
if (invert)
@@ -622,8 +622,8 @@ AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 9, 2, std_mix),
AC97_ENUM_SINGLE(AC97_GENERAL_PURPOSE, 8, 2, std_mic),
};
-static const struct snd_kcontrol_new snd_ac97_control_capture_src =
-AC97_ENUM("Capture Source", std_enum[0]);
+static const struct snd_kcontrol_new snd_ac97_control_capture_src =
+AC97_ENUM("Capture Source", std_enum[0]);
static const struct snd_kcontrol_new snd_ac97_control_capture_vol =
AC97_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 15, 0);
@@ -690,7 +690,7 @@ static int snd_ac97_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ct
uinfo->count = 1;
return 0;
}
-
+
static int snd_ac97_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
@@ -702,7 +702,7 @@ static int snd_ac97_spdif_cmask_get(struct snd_kcontrol *kcontrol, struct snd_ct
ucontrol->value.iec958.status[3] = IEC958_AES3_CON_FS;
return 0;
}
-
+
static int snd_ac97_spdif_pmask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
/* FIXME: AC'97 spec doesn't say which bits are used for what */
@@ -725,7 +725,7 @@ static int snd_ac97_spdif_default_get(struct snd_kcontrol *kcontrol, struct snd_
mutex_unlock(&ac97->reg_mutex);
return 0;
}
-
+
static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
@@ -752,7 +752,7 @@ static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_
val |= 1<<3;
if (!(new & IEC958_AES0_CON_NOT_COPYRIGHT))
val |= 1<<2;
- val |= ((new >> 8) & 0xff) << 4; // category + original
+ val |= ((new >> 8) & 0xff) << 4; /* category + original */
switch ((new >> 24) & 0xff) {
case IEC958_AES3_CON_FS_44100: val |= 0<<12; break;
case IEC958_AES3_CON_FS_48000: val |= 2<<12; break;
@@ -768,16 +768,16 @@ static int snd_ac97_spdif_default_put(struct snd_kcontrol *kcontrol, struct snd_
if (ac97->flags & AC97_CS_SPDIF) {
int x = (val >> 12) & 0x03;
switch (x) {
- case 0: x = 1; break; // 44.1
- case 2: x = 0; break; // 48.0
- default: x = 0; break; // illegal.
+ case 0: x = 1; break; /* 44.1 */
+ case 2: x = 0; break; /* 48.0 */
+ default: x = 0; break; /* illegal. */
}
change |= snd_ac97_update_bits_nolock(ac97, AC97_CSR_SPDIF, 0x3fff, ((val & 0xcfff) | (x << 12)));
} else if (ac97->flags & AC97_CX_SPDIF) {
int v;
v = new & (IEC958_AES0_CON_EMPHASIS_5015|IEC958_AES0_CON_NOT_COPYRIGHT) ? 0 : AC97_CXR_COPYRGT;
v |= new & IEC958_AES0_NONAUDIO ? AC97_CXR_SPDIF_AC3 : AC97_CXR_SPDIF_PCM;
- change |= snd_ac97_update_bits_nolock(ac97, AC97_CXR_AUDIO_MISC,
+ change |= snd_ac97_update_bits_nolock(ac97, AC97_CXR_AUDIO_MISC,
AC97_CXR_SPDIF_MASK | AC97_CXR_COPYRGT,
v);
} else if (ac97->id == AC97_ID_YMF743) {
@@ -806,7 +806,7 @@ static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff;
int mask = (kcontrol->private_value >> 16) & 0xff;
- // int invert = (kcontrol->private_value >> 24) & 0xff;
+ /* int invert = (kcontrol->private_value >> 24) & 0xff; */
unsigned short value, old, new;
int change;
@@ -893,7 +893,7 @@ static int snd_ac97_ad18xx_pcm_get_bits(struct snd_kcontrol *kcontrol, struct sn
int lshift = (kcontrol->private_value >> 8) & 0x0f;
int rshift = (kcontrol->private_value >> 12) & 0x0f;
int mask = (kcontrol->private_value >> 16) & 0xff;
-
+
ucontrol->value.integer.value[0] = mask - ((ac97->spec.ad18xx.pcmreg[codec] >> lshift) & mask);
if (lshift != rshift && (ac97->flags & AC97_STEREO_MUTES))
ucontrol->value.integer.value[1] = mask - ((ac97->spec.ad18xx.pcmreg[codec] >> rshift) & mask);
@@ -908,7 +908,7 @@ static int snd_ac97_ad18xx_pcm_put_bits(struct snd_kcontrol *kcontrol, struct sn
int rshift = (kcontrol->private_value >> 12) & 0x0f;
int mask = (kcontrol->private_value >> 16) & 0xff;
unsigned short val, valmask;
-
+
val = (mask - (ucontrol->value.integer.value[0] & mask)) << lshift;
valmask = mask << lshift;
if (lshift != rshift && (ac97->flags & AC97_STEREO_MUTES)) {
@@ -936,7 +936,7 @@ static int snd_ac97_ad18xx_pcm_get_volume(struct snd_kcontrol *kcontrol, struct
{
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int codec = kcontrol->private_value & 3;
-
+
mutex_lock(&ac97->page_mutex);
ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31);
ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31);
@@ -949,7 +949,7 @@ static int snd_ac97_ad18xx_pcm_put_volume(struct snd_kcontrol *kcontrol, struct
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int codec = kcontrol->private_value & 3;
unsigned short val1, val2;
-
+
val1 = 31 - (ucontrol->value.integer.value[0] & 31);
val2 = 31 - (ucontrol->value.integer.value[1] & 31);
return snd_ac97_ad18xx_update_pcm_bits(ac97, codec, 0x1f1f, (val1 << 8) | val2);
@@ -1023,11 +1023,11 @@ static int snd_ac97_dev_free(struct snd_device *device)
return snd_ac97_free(ac97);
}
-static int snd_ac97_try_volume_mix(struct snd_ac97 * ac97, int reg)
+static int snd_ac97_try_volume_mix(struct snd_ac97 *ac97, int reg)
{
unsigned short val, mask = 0x8000;
- if (! snd_ac97_valid_reg(ac97, reg))
+ if (!snd_ac97_valid_reg(ac97, reg))
return 0;
switch (reg) {
@@ -1092,7 +1092,7 @@ static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned cha
}
*lo_max = *hi_max = 0;
- for (i = 0 ; i < ARRAY_SIZE(cbit); i++) {
+ for (i = 0; i < ARRAY_SIZE(cbit); i++) {
unsigned short val;
snd_ac97_write(ac97, reg, 0x8080 | cbit[i] | (cbit[i] << 8));
/* Do the read twice due to buffers on some ac97 codecs.
@@ -1110,7 +1110,7 @@ static void check_volume_resolution(struct snd_ac97 *ac97, int reg, unsigned cha
}
}
-static int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit)
+static int snd_ac97_try_bit(struct snd_ac97 *ac97, int reg, int bit)
{
unsigned short mask, val, orig, res;
@@ -1124,7 +1124,7 @@ static int snd_ac97_try_bit(struct snd_ac97 * ac97, int reg, int bit)
}
/* check the volume resolution of center/lfe */
-static void snd_ac97_change_volume_params2(struct snd_ac97 * ac97, int reg, int shift, unsigned char *max)
+static void snd_ac97_change_volume_params2(struct snd_ac97 *ac97, int reg, int shift, unsigned char *max)
{
unsigned short val, val1;
@@ -1151,7 +1151,7 @@ static inline int printable(unsigned int x)
}
static struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template,
- struct snd_ac97 * ac97)
+ struct snd_ac97 *ac97)
{
struct snd_kcontrol_new template;
memcpy(&template, _template, sizeof(template));
@@ -1170,7 +1170,7 @@ static int snd_ac97_cmute_new_stereo(struct snd_card *card, char *name, int reg,
int err;
unsigned short val, val1, mute_mask;
- if (! snd_ac97_valid_reg(ac97, reg))
+ if (!snd_ac97_valid_reg(ac97, reg))
return 0;
mute_mask = 0x8000;
@@ -1238,7 +1238,7 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne
int err;
struct snd_kcontrol *kctl;
- if (! snd_ac97_valid_reg(ac97, reg))
+ if (!snd_ac97_valid_reg(ac97, reg))
return 0;
if (hi_max) {
/* invert */
@@ -1275,7 +1275,7 @@ static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx,
char name[44];
unsigned char lo_max, hi_max;
- if (! snd_ac97_valid_reg(ac97, reg))
+ if (!snd_ac97_valid_reg(ac97, reg))
return 0;
if (snd_ac97_try_bit(ac97, reg, 15)) {
@@ -1301,7 +1301,7 @@ static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx,
static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97);
-static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
+static int snd_ac97_mixer_build(struct snd_ac97 *ac97)
{
struct snd_card *card = ac97->bus->card;
struct snd_kcontrol *kctl;
@@ -1325,7 +1325,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
ac97->regs[AC97_CENTER_LFE_MASTER] = 0x8080;
/* build center controls */
- if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER))
+ if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER))
&& !(ac97->flags & AC97_AD_MULTI)) {
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97))) < 0)
return err;
@@ -1353,7 +1353,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
}
/* build surround controls */
- if ((snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER))
+ if ((snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER))
&& !(ac97->flags & AC97_AD_MULTI)) {
/* Surround Master (0x38) is with stereo mutes */
if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback",
@@ -1368,14 +1368,14 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
AC97_HEADPHONE, 0, ac97)) < 0)
return err;
}
-
+
/* build master mono controls */
if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_MONO)) {
if ((err = snd_ac97_cmix_new(card, "Master Mono Playback",
AC97_MASTER_MONO, 0, ac97)) < 0)
return err;
}
-
+
/* build master tone controls */
if (!(ac97->flags & AC97_HAS_NO_TONE)) {
if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) {
@@ -1391,9 +1391,9 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f);
}
}
-
+
/* build PC Speaker controls */
- if (!(ac97->flags & AC97_HAS_NO_PC_BEEP) &&
+ if (!(ac97->flags & AC97_HAS_NO_PC_BEEP) &&
((ac97->flags & AC97_HAS_PC_BEEP) ||
snd_ac97_try_volume_mix(ac97, AC97_PC_BEEP))) {
for (idx = 0; idx < 2; idx++)
@@ -1403,7 +1403,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
snd_ac97_write_cache(ac97, AC97_PC_BEEP,
snd_ac97_read(ac97, AC97_PC_BEEP) | 0x801e);
}
-
+
/* build Phone controls */
if (!(ac97->flags & AC97_HAS_NO_PHONE)) {
if (snd_ac97_try_volume_mix(ac97, AC97_PHONE)) {
@@ -1412,7 +1412,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
return err;
}
}
-
+
/* build MIC controls */
if (!(ac97->flags & AC97_HAS_NO_MIC)) {
if (snd_ac97_try_volume_mix(ac97, AC97_MIC)) {
@@ -1430,7 +1430,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
AC97_LINE, 1, ac97)) < 0)
return err;
}
-
+
/* build CD controls */
if (!(ac97->flags & AC97_HAS_NO_CD)) {
if (snd_ac97_try_volume_mix(ac97, AC97_CD)) {
@@ -1439,7 +1439,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
return err;
}
}
-
+
/* build Video controls */
if (!(ac97->flags & AC97_HAS_NO_VIDEO)) {
if (snd_ac97_try_volume_mix(ac97, AC97_VIDEO)) {
@@ -1620,7 +1620,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
}
ac97->spdif_status = SNDRV_PCM_DEFAULT_CON_SPDIF;
}
-
+
/* build chip specific controls */
if (ac97->build_ops->build_specific)
if ((err = ac97->build_ops->build_specific(ac97)) < 0)
@@ -1628,7 +1628,7 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
if (snd_ac97_try_bit(ac97, AC97_POWERDOWN, 15)) {
kctl = snd_ac97_cnew(&snd_ac97_control_eapd, ac97);
- if (! kctl)
+ if (!kctl)
return -ENOMEM;
if (ac97->scaps & AC97_SCAP_INV_EAPD)
set_inv_eapd(ac97, kctl);
@@ -1639,11 +1639,11 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
return 0;
}
-static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 * ac97)
+static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 *ac97)
{
int err, idx;
- //printk("AC97_GPIO_CFG = %x\n",snd_ac97_read(ac97,AC97_GPIO_CFG));
+ /* printk("AC97_GPIO_CFG = %x\n",snd_ac97_read(ac97,AC97_GPIO_CFG)); */
snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH));
snd_ac97_write(ac97, AC97_GPIO_POLARITY, 0xffff & ~(AC97_GPIO_LINE1_OH));
snd_ac97_write(ac97, AC97_GPIO_STICKY, 0xffff);
@@ -1776,15 +1776,15 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int m
printable(id >> 16),
printable(id >> 8));
pid = look_for_codec_id(snd_ac97_codec_id_vendors, id);
- if (! pid)
+ if (!pid)
return;
strcpy(name, pid->name);
if (ac97 && pid->patch) {
if ((modem && (pid->flags & AC97_MODEM_PATCH)) ||
- (! modem && ! (pid->flags & AC97_MODEM_PATCH)))
+ (!modem && !(pid->flags & AC97_MODEM_PATCH)))
pid->patch(ac97);
- }
+ }
pid = look_for_codec_id(snd_ac97_codec_ids, id);
if (pid) {
@@ -1794,7 +1794,7 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int m
sprintf(name + strlen(name), " rev %d", id & ~pid->mask);
if (ac97 && pid->patch) {
if ((modem && (pid->flags & AC97_MODEM_PATCH)) ||
- (! modem && ! (pid->flags & AC97_MODEM_PATCH)))
+ (!modem && !(pid->flags & AC97_MODEM_PATCH)))
pid->patch(ac97);
}
} else
@@ -1829,7 +1829,7 @@ static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem)
end_time = jiffies + timeout;
do {
-
+
/* use preliminary reads to settle the communication */
snd_ac97_read(ac97, AC97_RESET);
snd_ac97_read(ac97, AC97_VENDOR_ID1);
@@ -1872,7 +1872,7 @@ static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem)
*
* The ops table must include valid callbacks (at least read and
* write). The other callbacks, wait and reset, are not mandatory.
- *
+ *
* The clock is set to 48000. If another clock is needed, set
* (*rbus)->clock manually.
*
@@ -1971,7 +1971,7 @@ static void do_update_power(struct work_struct *work)
*
* The template must include the codec number (num) and address (addr),
* and the private data (private_data).
- *
+ *
* The ac97 instance is registered as a low-level device, so you don't
* have to release it manually.
*
@@ -2061,10 +2061,10 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
/* proceed anyway - it's often non-critical */
}
}
- __access_ok:
+__access_ok:
ac97->id = snd_ac97_read(ac97, AC97_VENDOR_ID1) << 16;
ac97->id |= snd_ac97_read(ac97, AC97_VENDOR_ID2);
- if (! (ac97->scaps & AC97_SCAP_DETECT_BY_VENDOR) &&
+ if (!(ac97->scaps & AC97_SCAP_DETECT_BY_VENDOR) &&
(ac97->id == 0x00000000 || ac97->id == 0xffffffff)) {
snd_printk(KERN_ERR "AC'97 %d access is not valid [0x%x], removing mixer.\n", ac97->num, ac97->id);
snd_ac97_free(ac97);
@@ -2073,7 +2073,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
pid = look_for_codec_id(snd_ac97_codec_ids, ac97->id);
if (pid)
ac97->flags |= pid->flags;
-
+
/* test for AC'97 */
if (!(ac97->scaps & AC97_SCAP_SKIP_AUDIO) && !(ac97->scaps & AC97_SCAP_AUDIO)) {
/* test if we can write to the record gain volume register */
@@ -2104,14 +2104,14 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
return -EACCES;
}
- if (bus->ops->reset) // FIXME: always skipping?
+ if (bus->ops->reset) /* FIXME: always skipping? */
goto __ready_ok;
/* FIXME: add powerdown control */
if (ac97_is_audio(ac97)) {
/* nothing should be in powerdown mode */
snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0);
- if (! (ac97->flags & AC97_DEFAULT_POWER_OFF)) {
+ if (!(ac97->flags & AC97_DEFAULT_POWER_OFF)) {
snd_ac97_write_cache(ac97, AC97_RESET, 0); /* reset to defaults */
udelay(100);
snd_ac97_write_cache(ac97, AC97_POWERDOWN, 0);
@@ -2158,8 +2158,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
} while (time_after_eq(end_time, jiffies));
snd_printk(KERN_WARNING "MC'97 %d converters and GPIO not ready (0x%x)\n", ac97->num, snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS));
}
-
- __ready_ok:
+
+__ready_ok:
if (ac97_is_audio(ac97))
ac97->addr = (ac97->ext_id & AC97_EI_ADDR_MASK) >> AC97_EI_ADDR_SHIFT;
else
@@ -2167,7 +2167,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
if (ac97->ext_id & 0x01c9) { /* L/R, MIC, SDAC, LDAC VRA support */
reg = snd_ac97_read(ac97, AC97_EXTENDED_STATUS);
reg |= ac97->ext_id & 0x01c0; /* LDAC/SDAC/CDAC */
- if (! bus->no_vra)
+ if (!bus->no_vra)
reg |= ac97->ext_id & 0x0009; /* VRA/VRM */
snd_ac97_write_cache(ac97, AC97_EXTENDED_STATUS, reg);
}
@@ -2210,8 +2210,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
if (bus->ops->init)
bus->ops->init(ac97);
snd_ac97_get_name(ac97, ac97->id, name, !ac97_is_audio(ac97));
- snd_ac97_get_name(NULL, ac97->id, name, !ac97_is_audio(ac97)); // ac97->id might be changed in the special setup code
- if (! ac97->build_ops)
+ snd_ac97_get_name(NULL, ac97->id, name, !ac97_is_audio(ac97)); /* ac97->id might be changed in the special setup code */
+ if (!ac97->build_ops)
ac97->build_ops = &null_build_ops;
if (ac97_is_audio(ac97)) {
@@ -2295,7 +2295,7 @@ static void snd_ac97_powerdown(struct snd_ac97 *ac97)
/* powerdown external amplifier */
if (ac97->scaps & AC97_SCAP_INV_EAPD)
power = ac97->regs[AC97_POWERDOWN] & ~AC97_PD_EAPD;
- else if (! (ac97->scaps & AC97_SCAP_EAPD_LED))
+ else if (!(ac97->scaps & AC97_SCAP_EAPD_LED))
power = ac97->regs[AC97_POWERDOWN] | AC97_PD_EAPD;
power |= AC97_PD_PR6; /* Headphone amplifier powerdown */
power |= AC97_PD_PR0 | AC97_PD_PR1; /* ADC & DAC powerdown */
@@ -2347,7 +2347,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
{
int i;
- if (! ac97)
+ if (!ac97)
return 0;
if (reg) {
@@ -2416,8 +2416,8 @@ static void update_power_regs(struct snd_ac97 *ac97)
snd_ac97_update_bits(ac97, power_regs[i].power_reg,
power_regs[i].mask, bits);
}
- if (! power_up) {
- if (! (ac97->regs[AC97_POWERDOWN] & AC97_PD_PR2)) {
+ if (!power_up) {
+ if (!(ac97->regs[AC97_POWERDOWN] & AC97_PD_PR2)) {
/* power down analog mix and vref */
snd_ac97_update_bits(ac97, AC97_POWERDOWN,
AC97_PD_PR2, AC97_PD_PR2);
@@ -2437,7 +2437,7 @@ static void update_power_regs(struct snd_ac97 *ac97)
*/
void snd_ac97_suspend(struct snd_ac97 *ac97)
{
- if (! ac97)
+ if (!ac97)
return;
if (ac97->build_ops->suspend)
ac97->build_ops->suspend(ac97);
@@ -2457,7 +2457,7 @@ static void snd_ac97_restore_status(struct snd_ac97 *ac97)
{
int i;
- for (i = 2; i < 0x7c ; i += 2) {
+ for (i = 2; i < 0x7c; i += 2) {
if (i == AC97_POWERDOWN || i == AC97_EXTENDED_ID)
continue;
/* restore only accessible registers
@@ -2501,7 +2501,7 @@ void snd_ac97_resume(struct snd_ac97 *ac97)
{
unsigned long end_time;
- if (! ac97)
+ if (!ac97)
return;
if (ac97->bus->ops->reset) {
@@ -2510,7 +2510,7 @@ void snd_ac97_resume(struct snd_ac97 *ac97)
}
snd_ac97_write(ac97, AC97_POWERDOWN, 0);
- if (! (ac97->flags & AC97_DEFAULT_POWER_OFF)) {
+ if (!(ac97->flags & AC97_DEFAULT_POWER_OFF)) {
if (!(ac97->scaps & AC97_SCAP_SKIP_AUDIO))
snd_ac97_write(ac97, AC97_RESET, 0);
else if (!(ac97->scaps & AC97_SCAP_SKIP_MODEM))
@@ -2568,7 +2568,7 @@ static void set_ctl_name(char *dst, const char *src, const char *suffix)
sprintf(dst, "%s %s", src, suffix);
else
strcpy(dst, src);
-}
+}
/* remove the control with the given name and optional suffix */
static int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name,
@@ -2644,7 +2644,7 @@ static int tune_hp_only(struct snd_ac97 *ac97)
{
struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL);
- if (! msw || ! mvol)
+ if (!msw || !mvol)
return -ENOENT;
msw->put = bind_hp_volsw_put;
mvol->put = bind_hp_volsw_put;
@@ -2699,7 +2699,7 @@ static int tune_ad_sharing(struct snd_ac97 *ac97)
return 0;
}
-static const struct snd_kcontrol_new snd_ac97_alc_jack_detect =
+static const struct snd_kcontrol_new snd_ac97_alc_jack_detect =
AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);
/* ac97 tune: set up ALC jack-select */
@@ -2720,7 +2720,7 @@ static int tune_alc_jack(struct snd_ac97 *ac97)
static int tune_inv_eapd(struct snd_ac97 *ac97)
{
struct snd_kcontrol *kctl = ctl_find(ac97, "External Amplifier", NULL);
- if (! kctl)
+ if (!kctl)
return -ENOENT;
set_inv_eapd(ac97, kctl);
return 0;
@@ -2749,7 +2749,7 @@ static int master_mute_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
static int tune_mute_led(struct snd_ac97 *ac97)
{
struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
- if (! msw)
+ if (!msw)
return -ENOENT;
msw->put = master_mute_sw_put;
snd_ac97_remove_ctl(ac97, "External Amplifier", NULL);
@@ -2782,7 +2782,7 @@ static int tune_hp_mute_led(struct snd_ac97 *ac97)
{
struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL);
struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL);
- if (! msw || ! mvol)
+ if (!msw || !mvol)
return -ENOENT;
msw->put = hp_master_mute_sw_put;
mvol->put = bind_hp_volsw_put;
@@ -2830,7 +2830,7 @@ static int apply_quirk_str(struct snd_ac97 *ac97, const char *typestr)
for (i = 0; i < ARRAY_SIZE(applicable_quirks); i++) {
q = &applicable_quirks[i];
- if (q->name && ! strcmp(typestr, q->name))
+ if (q->name && !strcmp(typestr, q->name))
return apply_quirk(ac97, i);
}
/* for compatibility, accept the numbers, too */
@@ -2864,13 +2864,13 @@ int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, cons
return result;
}
- if (! quirk)
+ if (!quirk)
return -EINVAL;
for (; quirk->subvendor; quirk++) {
if (quirk->subvendor != ac97->subsystem_vendor)
continue;
- if ((! quirk->mask && quirk->subdevice == ac97->subsystem_device) ||
+ if ((!quirk->mask && quirk->subdevice == ac97->subsystem_device) ||
quirk->subdevice == (quirk->mask & ac97->subsystem_device)) {
if (quirk->codec_id && quirk->codec_id != ac97->id)
continue;
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 6ce3cbe..19e8572 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -30,7 +30,7 @@
* Chip specific initialization
*/
-static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontrol_new *controls, int count)
+static int patch_build_controls(struct snd_ac97 *ac97, const struct snd_kcontrol_new *controls, int count)
{
int idx, err;
@@ -446,7 +446,7 @@ static const struct snd_kcontrol_new snd_ac97_ymf753_controls_spdif[3] = {
AC97_YMF7X3_DIT_CTRL, 2, 1, 1)
};
-static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97)
+static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 *ac97)
{
int err;
@@ -460,7 +460,7 @@ static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
.build_post_spdif = patch_yamaha_ymf753_post_spdif
};
-static int patch_yamaha_ymf753(struct snd_ac97 * ac97)
+static int patch_yamaha_ymf753(struct snd_ac97 *ac97)
{
/* Patch for Yamaha YMF753, Copyright (c) by David Shust, dshust(a)shustring.com.
This chip has nonstandard and extended behaviour with regard to its S/PDIF output.
@@ -486,14 +486,14 @@ AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1),
AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1),
};
-static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97)
+static int patch_wolfson_wm9703_specific(struct snd_ac97 *ac97)
{
/* This is known to work for the ViewSonic ViewPad 1000
* Randolph Bentson <bentson(a)holmsjoen.com>
- * WM9703/9707/9708/9717
+ * WM9703/9707/9708/9717
*/
int err, i;
-
+
for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) {
if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm97xx_snd_ac97_controls[i], ac97))) < 0)
return err;
@@ -506,7 +506,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
.build_specific = patch_wolfson_wm9703_specific,
};
-static int patch_wolfson03(struct snd_ac97 * ac97)
+static int patch_wolfson03(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_wolfson_wm9703_ops;
return 0;
@@ -521,7 +521,7 @@ AC97_DOUBLE("Rear DAC Volume", AC97_WM9704_RPCM_VOL, 8, 0, 31, 1),
AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
};
-static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97)
+static int patch_wolfson_wm9704_specific(struct snd_ac97 *ac97)
{
int err, i;
for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) {
@@ -537,14 +537,14 @@ static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
.build_specific = patch_wolfson_wm9704_specific,
};
-static int patch_wolfson04(struct snd_ac97 * ac97)
+static int patch_wolfson04(struct snd_ac97 *ac97)
{
/* WM9704M/9704Q */
ac97->build_ops = &patch_wolfson_wm9704_ops;
return 0;
}
-static int patch_wolfson_wm9705_specific(struct snd_ac97 * ac97)
+static int patch_wolfson_wm9705_specific(struct snd_ac97 *ac97)
{
int err, i;
for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) {
@@ -559,7 +559,7 @@ static struct snd_ac97_build_ops patch_wolfson_wm9705_ops = {
.build_specific = patch_wolfson_wm9705_specific,
};
-static int patch_wolfson05(struct snd_ac97 * ac97)
+static int patch_wolfson05(struct snd_ac97 *ac97)
{
/* WM9705, WM9710 */
ac97->build_ops = &patch_wolfson_wm9705_ops;
@@ -578,7 +578,7 @@ static const char* wm9711_rec_adc[] = {"Stereo", "Left", "Right", "Mute"};
static const char* wm9711_base[] = {"Linear Control", "Adaptive Boost"};
static const char* wm9711_rec_gain[] = {"+1.5dB Steps", "+0.75dB Steps"};
static const char* wm9711_mic[] = {"Mic 1", "Differential", "Mic 2", "Stereo"};
-static const char* wm9711_rec_sel[] =
+static const char* wm9711_rec_sel[] =
{"Mic 1", "NC", "NC", "Master Mix", "Line", "Headphone Mix", "Phone Mix", "Phone"};
static const char* wm9711_ng_type[] = {"Constant Gain", "Mute"};
@@ -675,10 +675,10 @@ AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0),
AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0),
};
-static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97)
+static int patch_wolfson_wm9711_specific(struct snd_ac97 *ac97)
{
int err, i;
-
+
for (i = 0; i < ARRAY_SIZE(wm9711_snd_ac97_controls); i++) {
if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm9711_snd_ac97_controls[i], ac97))) < 0)
return err;
@@ -696,32 +696,32 @@ static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
.build_specific = patch_wolfson_wm9711_specific,
};
-static int patch_wolfson11(struct snd_ac97 * ac97)
+static int patch_wolfson11(struct snd_ac97 *ac97)
{
/* WM9711, WM9712 */
ac97->build_ops = &patch_wolfson_wm9711_ops;
ac97->flags |= AC97_HAS_NO_REC_GAIN | AC97_STEREO_MUTES | AC97_HAS_NO_MIC |
AC97_HAS_NO_PC_BEEP | AC97_HAS_NO_VIDEO | AC97_HAS_NO_CD;
-
+
return 0;
}
static const char* wm9713_mic_mixer[] = {"Stereo", "Mic 1", "Mic 2", "Mute"};
static const char* wm9713_rec_mux[] = {"Stereo", "Left", "Right", "Mute"};
-static const char* wm9713_rec_src[] =
- {"Mic 1", "Mic 2", "Line", "Mono In", "Headphone Mix", "Master Mix",
+static const char* wm9713_rec_src[] =
+ {"Mic 1", "Mic 2", "Line", "Mono In", "Headphone Mix", "Master Mix",
"Mono Mix", "Zh"};
static const char* wm9713_rec_gain[] = {"+1.5dB Steps", "+0.75dB Steps"};
static const char* wm9713_alc_select[] = {"None", "Left", "Right", "Stereo"};
static const char* wm9713_mono_pga[] = {"Vmid", "Zh", "Mono Mix", "Inv 1"};
-static const char* wm9713_spk_pga[] =
+static const char* wm9713_spk_pga[] =
{"Vmid", "Zh", "Headphone Mix", "Master Mix", "Inv", "NC", "NC", "NC"};
static const char* wm9713_hp_pga[] = {"Vmid", "Zh", "Headphone Mix", "NC"};
static const char* wm9713_out3_pga[] = {"Vmid", "Zh", "Inv 1", "NC"};
static const char* wm9713_out4_pga[] = {"Vmid", "Zh", "Inv 2", "NC"};
-static const char* wm9713_dac_inv[] =
- {"Off", "Mono Mix", "Master Mix", "Headphone Mix L", "Headphone Mix R",
+static const char* wm9713_dac_inv[] =
+ {"Off", "Mono Mix", "Master Mix", "Headphone Mix L", "Headphone Mix R",
"Headphone Mix Mono", "NC", "Vmid"};
static const char* wm9713_base[] = {"Linear Control", "Adaptive Boost"};
static const char* wm9713_ng_type[] = {"Constant Gain", "Mute"};
@@ -842,10 +842,10 @@ AC97_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
AC97_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1),
};
-static int patch_wolfson_wm9713_3d (struct snd_ac97 * ac97)
+static int patch_wolfson_wm9713_3d(struct snd_ac97 *ac97)
{
int err, i;
-
+
for (i = 0; i < ARRAY_SIZE(wm13_snd_ac97_controls_3d); i++) {
if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls_3d[i], ac97))) < 0)
return err;
@@ -853,10 +853,10 @@ static int patch_wolfson_wm9713_3d (struct snd_ac97 * ac97)
return 0;
}
-static int patch_wolfson_wm9713_specific(struct snd_ac97 * ac97)
+static int patch_wolfson_wm9713_specific(struct snd_ac97 *ac97)
{
int err, i;
-
+
for (i = 0; i < ARRAY_SIZE(wm13_snd_ac97_controls); i++) {
if ((err = snd_ctl_add(ac97->bus->card, snd_ac97_cnew(&wm13_snd_ac97_controls[i], ac97))) < 0)
return err;
@@ -872,13 +872,13 @@ static int patch_wolfson_wm9713_specific(struct snd_ac97 * ac97)
}
#ifdef CONFIG_PM
-static void patch_wolfson_wm9713_suspend (struct snd_ac97 * ac97)
+static void patch_wolfson_wm9713_suspend(struct snd_ac97 *ac97)
{
snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xfeff);
snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0xffff);
}
-static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97)
+static void patch_wolfson_wm9713_resume(struct snd_ac97 *ac97)
{
snd_ac97_write_cache(ac97, AC97_EXTENDED_MID, 0xda00);
snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0x3810);
@@ -889,13 +889,13 @@ static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97)
static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
.build_specific = patch_wolfson_wm9713_specific,
.build_3d = patch_wolfson_wm9713_3d,
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM
.suspend = patch_wolfson_wm9713_suspend,
.resume = patch_wolfson_wm9713_resume
#endif
};
-static int patch_wolfson13(struct snd_ac97 * ac97)
+static int patch_wolfson13(struct snd_ac97 *ac97)
{
/* WM9713, WM9714 */
ac97->build_ops = &patch_wolfson_wm9713_ops;
@@ -915,7 +915,7 @@ static int patch_wolfson13(struct snd_ac97 * ac97)
/*
* Tritech codec
*/
-static int patch_tritech_tr28028(struct snd_ac97 * ac97)
+static int patch_tritech_tr28028(struct snd_ac97 *ac97)
{
snd_ac97_write_cache(ac97, 0x26, 0x0300);
snd_ac97_write_cache(ac97, 0x26, 0x0000);
@@ -927,7 +927,7 @@ static int patch_tritech_tr28028(struct snd_ac97 * ac97)
/*
* Sigmatel STAC97xx codecs
*/
-static int patch_sigmatel_stac9700_3d(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9700_3d(struct snd_ac97 *ac97)
{
struct snd_kcontrol *kctl;
int err;
@@ -940,7 +940,7 @@ static int patch_sigmatel_stac9700_3d(struct snd_ac97 * ac97)
return 0;
}
-static int patch_sigmatel_stac9708_3d(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9708_3d(struct snd_ac97 *ac97)
{
struct snd_kcontrol *kctl;
int err;
@@ -968,7 +968,7 @@ AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0),
AC97_SINGLE("Sigmatel ADC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 0, 1, 0)
};
-static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac97xx_specific(struct snd_ac97 *ac97)
{
int err;
@@ -993,7 +993,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
.build_specific = patch_sigmatel_stac97xx_specific
};
-static int patch_sigmatel_stac9700(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9700(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_sigmatel_stac9700_ops;
return 0;
@@ -1040,7 +1040,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
.build_specific = patch_sigmatel_stac9708_specific
};
-static int patch_sigmatel_stac9708(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9708(struct snd_ac97 *ac97)
{
unsigned int codec72, codec6c;
@@ -1066,11 +1066,11 @@ static int patch_sigmatel_stac9708(struct snd_ac97 * ac97)
return 0;
}
-static int patch_sigmatel_stac9721(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9721(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_sigmatel_stac9700_ops;
if (snd_ac97_read(ac97, AC97_SIGMATEL_ANALOG) == 0) {
- // patch for SigmaTel
+ /* patch for SigmaTel */
snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba);
snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x4000);
snd_ac97_write_cache(ac97, AC97_SIGMATEL_BIAS1, 0xabba);
@@ -1080,9 +1080,9 @@ static int patch_sigmatel_stac9721(struct snd_ac97 * ac97)
return 0;
}
-static int patch_sigmatel_stac9744(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9744(struct snd_ac97 *ac97)
{
- // patch for SigmaTel
+ /* patch for SigmaTel */
ac97->build_ops = &patch_sigmatel_stac9700_ops;
snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba);
snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */
@@ -1092,9 +1092,9 @@ static int patch_sigmatel_stac9744(struct snd_ac97 * ac97)
return 0;
}
-static int patch_sigmatel_stac9756(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9756(struct snd_ac97 *ac97)
{
- // patch for SigmaTel
+ /* patch for SigmaTel */
ac97->build_ops = &patch_sigmatel_stac9700_ops;
snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC1, 0xabba);
snd_ac97_write_cache(ac97, AC97_SIGMATEL_CIC2, 0x0000); /* is this correct? --jk */
@@ -1269,7 +1269,7 @@ static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
.build_specific = patch_sigmatel_stac9758_specific
};
-static int patch_sigmatel_stac9758(struct snd_ac97 * ac97)
+static int patch_sigmatel_stac9758(struct snd_ac97 *ac97)
{
static unsigned short regs[4] = {
AC97_SIGMATEL_OUTSEL,
@@ -1293,12 +1293,12 @@ static int patch_sigmatel_stac9758(struct snd_ac97 * ac97)
int i;
/* Gateway M675 notebook */
- if (ac97->pci &&
+ if (ac97->pci &&
ac97->subsystem_vendor == 0x107b &&
ac97->subsystem_device == 0x0601)
pregs = m675_regs;
- // patch for SigmaTel
+ /* patch for SigmaTel */
ac97->build_ops = &patch_sigmatel_stac9758_ops;
/* FIXME: assume only page 0 for writing cache */
snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, AC97_PAGE_VENDOR);
@@ -1317,7 +1317,7 @@ static const struct snd_kcontrol_new snd_ac97_cirrus_controls_spdif[2] = {
AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "AC97-SPSA", AC97_CSR_ACMODE, 0, 3, 0)
};
-static int patch_cirrus_build_spdif(struct snd_ac97 * ac97)
+static int patch_cirrus_build_spdif(struct snd_ac97 *ac97)
{
int err;
@@ -1343,7 +1343,7 @@ static struct snd_ac97_build_ops patch_cirrus_ops = {
.build_spdif = patch_cirrus_build_spdif
};
-static int patch_cirrus_spdif(struct snd_ac97 * ac97)
+static int patch_cirrus_spdif(struct snd_ac97 *ac97)
{
/* Basically, the cs4201/cs4205/cs4297a has non-standard sp/dif registers.
WHY CAN'T ANYONE FOLLOW THE BLOODY SPEC? *sigh*
@@ -1357,18 +1357,18 @@ static int patch_cirrus_spdif(struct snd_ac97 * ac97)
*/
ac97->build_ops = &patch_cirrus_ops;
- ac97->flags |= AC97_CS_SPDIF;
+ ac97->flags |= AC97_CS_SPDIF;
ac97->rates[AC97_RATES_SPDIF] &= ~SNDRV_PCM_RATE_32000;
ac97->ext_id |= AC97_EI_SPDIF; /* force the detection of spdif */
snd_ac97_write_cache(ac97, AC97_CSR_ACMODE, 0x0080);
return 0;
}
-static int patch_cirrus_cs4299(struct snd_ac97 * ac97)
+static int patch_cirrus_cs4299(struct snd_ac97 *ac97)
{
/* force the detection of PC Beep */
ac97->flags |= AC97_HAS_PC_BEEP;
-
+
return patch_cirrus_spdif(ac97);
}
@@ -1379,7 +1379,7 @@ static const struct snd_kcontrol_new snd_ac97_conexant_controls_spdif[1] = {
AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), AC97_CXR_AUDIO_MISC, 3, 1, 0),
};
-static int patch_conexant_build_spdif(struct snd_ac97 * ac97)
+static int patch_conexant_build_spdif(struct snd_ac97 *ac97)
{
int err;
@@ -1400,7 +1400,7 @@ static struct snd_ac97_build_ops patch_conexant_ops = {
.build_spdif = patch_conexant_build_spdif
};
-static int patch_conexant(struct snd_ac97 * ac97)
+static int patch_conexant(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_conexant_ops;
ac97->flags |= AC97_CX_SPDIF;
@@ -1434,13 +1434,13 @@ static void ad18xx_resume(struct snd_ac97 *ac97)
}
}
- if (! (ac97->flags & AC97_AD_MULTI))
+ if (!(ac97->flags & AC97_AD_MULTI))
/* normal restore */
snd_ac97_restore_status(ac97);
else {
/* restore the AD18xx codec configurations */
for (codec = 0; codec < 3; codec++) {
- if (! ac97->spec.ad18xx.id[codec])
+ if (!ac97->spec.ad18xx.id[codec])
continue;
/* select single codec */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
@@ -1451,14 +1451,14 @@ static void ad18xx_resume(struct snd_ac97 *ac97)
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
/* restore status */
- for (i = 2; i < 0x7c ; i += 2) {
+ for (i = 2; i < 0x7c; i += 2) {
if (i == AC97_POWERDOWN || i == AC97_EXTENDED_ID)
continue;
if (test_bit(i, ac97->reg_accessed)) {
/* handle multi codecs for AD18xx */
if (i == AC97_PCM) {
for (codec = 0; codec < 3; codec++) {
- if (! ac97->spec.ad18xx.id[codec])
+ if (!ac97->spec.ad18xx.id[codec])
continue;
/* select single codec */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
@@ -1501,22 +1501,22 @@ static const struct snd_ac97_res_table ad1819_restbl[] = {
{ } /* terminator */
};
-static int patch_ad1819(struct snd_ac97 * ac97)
+static int patch_ad1819(struct snd_ac97 *ac97)
{
unsigned short scfg;
- // patch for Analog Devices
+ /* patch for Analog Devices */
scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG);
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x7000); /* select all codecs */
ac97->res_table = ad1819_restbl;
return 0;
}
-static unsigned short patch_ad1881_unchained(struct snd_ac97 * ac97, int idx, unsigned short mask)
+static unsigned short patch_ad1881_unchained(struct snd_ac97 *ac97, int idx, unsigned short mask)
{
unsigned short val;
- // test for unchained codec
+ /* test for unchained codec */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, mask);
snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); /* ID0C, ID1C, SDIE = off */
val = snd_ac97_read(ac97, AC97_VENDOR_ID2);
@@ -1528,13 +1528,13 @@ static unsigned short patch_ad1881_unchained(struct snd_ac97 * ac97, int idx, un
return mask;
}
-static int patch_ad1881_chained1(struct snd_ac97 * ac97, int idx, unsigned short codec_bits)
+static int patch_ad1881_chained1(struct snd_ac97 *ac97, int idx, unsigned short codec_bits)
{
static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 };
unsigned short val;
-
+
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, cfg_bits[idx]);
- snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); // SDIE
+ snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); /* SDIE */
val = snd_ac97_read(ac97, AC97_VENDOR_ID2);
if ((val & 0xff40) != 0x5340)
return 0;
@@ -1546,26 +1546,26 @@ static int patch_ad1881_chained1(struct snd_ac97 * ac97, int idx, unsigned short
return 1;
}
-static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int cidx1, int cidx2)
+static void patch_ad1881_chained(struct snd_ac97 *ac97, int unchained_idx, int cidx1, int cidx2)
{
- // already detected?
+ /* already detected? */
if (ac97->spec.ad18xx.unchained[cidx1] || ac97->spec.ad18xx.chained[cidx1])
cidx1 = -1;
if (ac97->spec.ad18xx.unchained[cidx2] || ac97->spec.ad18xx.chained[cidx2])
cidx2 = -1;
if (cidx1 < 0 && cidx2 < 0)
return;
- // test for chained codecs
+ /* test for chained codecs */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
ac97->spec.ad18xx.unchained[unchained_idx]);
- snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); // ID1C
+ snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); /* ID1C */
ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002;
if (cidx1 >= 0) {
if (cidx2 < 0)
patch_ad1881_chained1(ac97, cidx1, 0);
- else if (patch_ad1881_chained1(ac97, cidx1, 0x0006)) // SDIE | ID1C
+ else if (patch_ad1881_chained1(ac97, cidx1, 0x0006)) /* SDIE | ID1C */
patch_ad1881_chained1(ac97, cidx2, 0);
- else if (patch_ad1881_chained1(ac97, cidx2, 0x0006)) // SDIE | ID1C
+ else if (patch_ad1881_chained1(ac97, cidx2, 0x0006)) /* SDIE | ID1C */
patch_ad1881_chained1(ac97, cidx1, 0);
} else if (cidx2 >= 0) {
patch_ad1881_chained1(ac97, cidx2, 0);
@@ -1578,15 +1578,15 @@ static struct snd_ac97_build_ops patch_ad1881_build_ops = {
#endif
};
-static int patch_ad1881(struct snd_ac97 * ac97)
+static int patch_ad1881(struct snd_ac97 *ac97)
{
static const char cfg_idxs[3][2] = {
{2, 1},
{0, 2},
{0, 1}
};
-
- // patch for Analog Devices
+
+ /* patch for Analog Devices */
unsigned short codecs[3];
unsigned short val;
int idx, num;
@@ -1597,7 +1597,7 @@ static int patch_ad1881(struct snd_ac97 * ac97)
codecs[1] = patch_ad1881_unchained(ac97, 1, (1<<14));
codecs[2] = patch_ad1881_unchained(ac97, 2, (1<<13));
- if (! (codecs[0] || codecs[1] || codecs[2]))
+ if (!(codecs[0] || codecs[1] || codecs[2]))
goto __end;
for (idx = 0; idx < 3; idx++)
@@ -1613,7 +1613,7 @@ static int patch_ad1881(struct snd_ac97 * ac97)
ac97->scaps |= AC97_SCAP_CENTER_LFE_DAC;
}
- __end:
+__end:
/* select all codecs */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
/* check if only one codec is present */
@@ -1623,8 +1623,8 @@ static int patch_ad1881(struct snd_ac97 * ac97)
if (num == 1) {
/* ok, deselect all ID bits */
snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000);
- ac97->spec.ad18xx.codec_cfg[0] =
- ac97->spec.ad18xx.codec_cfg[1] =
+ ac97->spec.ad18xx.codec_cfg[0] =
+ ac97->spec.ad18xx.codec_cfg[1] =
ac97->spec.ad18xx.codec_cfg[2] = 0x0000;
}
/* required for AD1886/AD1885 combination */
@@ -1648,7 +1648,7 @@ static const struct snd_kcontrol_new snd_ac97_controls_ad1885[] = {
static const DECLARE_TLV_DB_SCALE(db_scale_6bit_6db_max, -8850, 150, 0);
-static int patch_ad1885_specific(struct snd_ac97 * ac97)
+static int patch_ad1885_specific(struct snd_ac97 *ac97)
{
int err;
@@ -1666,7 +1666,7 @@ static struct snd_ac97_build_ops patch_ad1885_build_ops = {
#endif
};
-static int patch_ad1885(struct snd_ac97 * ac97)
+static int patch_ad1885(struct snd_ac97 *ac97)
{
patch_ad1881(ac97);
/* This is required to deal with the Intel D815EEAL2 */
@@ -1679,7 +1679,7 @@ static int patch_ad1885(struct snd_ac97 * ac97)
return 0;
}
-static int patch_ad1886_specific(struct snd_ac97 * ac97)
+static int patch_ad1886_specific(struct snd_ac97 *ac97)
{
reset_tlv(ac97, "Headphone Playback Volume",
db_scale_6bit_6db_max);
@@ -1693,7 +1693,7 @@ static struct snd_ac97_build_ops patch_ad1886_build_ops = {
#endif
};
-static int patch_ad1886(struct snd_ac97 * ac97)
+static int patch_ad1886(struct snd_ac97 *ac97)
{
patch_ad1881(ac97);
/* Presario700 workaround */
@@ -1847,7 +1847,7 @@ static const struct snd_kcontrol_new snd_ac97_ad198x_spdif_source = {
.put = snd_ac97_ad198x_spdif_source_put,
};
-static int patch_ad198x_post_spdif(struct snd_ac97 * ac97)
+static int patch_ad198x_post_spdif(struct snd_ac97 *ac97)
{
return patch_build_controls(ac97, &snd_ac97_ad198x_spdif_source, 1);
}
@@ -1882,7 +1882,7 @@ static int check_list(struct snd_ac97 *ac97, const unsigned int *list)
return 0;
}
-static int patch_ad1981a_specific(struct snd_ac97 * ac97)
+static int patch_ad1981a_specific(struct snd_ac97 *ac97)
{
if (check_list(ac97, ad1981_jacks_blacklist))
return 0;
@@ -2092,10 +2092,10 @@ static struct snd_ac97_build_ops patch_ad1888_build_ops = {
.update_jacks = ad1888_update_jacks,
};
-static int patch_ad1888(struct snd_ac97 * ac97)
+static int patch_ad1888(struct snd_ac97 *ac97)
{
unsigned short misc;
-
+
patch_ad1881(ac97);
ac97->build_ops = &patch_ad1888_build_ops;
@@ -2141,7 +2141,7 @@ static struct snd_ac97_build_ops patch_ad1980_build_ops = {
.update_jacks = ad1888_update_jacks,
};
-static int patch_ad1980(struct snd_ac97 * ac97)
+static int patch_ad1980(struct snd_ac97 *ac97)
{
patch_ad1888(ac97);
ac97->build_ops = &patch_ad1980_build_ops;
@@ -2175,7 +2175,7 @@ static int snd_ac97_ad1985_vrefout_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_ac97_ad1985_vrefout_put(struct snd_kcontrol *kcontrol,
+static int snd_ac97_ad1985_vrefout_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
static const int ctrl2reg[4] = {1, 2, 0, 3};
@@ -2256,10 +2256,10 @@ static struct snd_ac97_build_ops patch_ad1985_build_ops = {
.update_jacks = ad1985_update_jacks,
};
-static int patch_ad1985(struct snd_ac97 * ac97)
+static int patch_ad1985(struct snd_ac97 *ac97)
{
unsigned short misc;
-
+
patch_ad1881(ac97);
ac97->build_ops = &patch_ad1985_build_ops;
misc = snd_ac97_read(ac97, AC97_AD_MISC);
@@ -2548,7 +2548,7 @@ static struct snd_ac97_build_ops patch_ad1986_build_ops = {
.update_jacks = ad1986_update_jacks,
};
-static int patch_ad1986(struct snd_ac97 * ac97)
+static int patch_ad1986(struct snd_ac97 *ac97)
{
patch_ad1881(ac97);
ac97->build_ops = &patch_ad1986_build_ops;
@@ -2575,7 +2575,7 @@ static int patch_alc203(struct snd_ac97 *ac97)
static void alc650_update_jacks(struct snd_ac97 *ac97)
{
int shared;
-
+
/* shared Line-In / Surround Out */
shared = is_shared_surrout(ac97);
snd_ac97_update_bits(ac97, AC97_ALC650_MULTICH, 1 << 9,
@@ -2628,7 +2628,7 @@ static const struct snd_kcontrol_new snd_ac97_spdif_controls_alc650[] = {
static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_max, -4350, 150, 0);
-static int patch_alc650_specific(struct snd_ac97 * ac97)
+static int patch_alc650_specific(struct snd_ac97 *ac97)
{
int err;
@@ -2649,7 +2649,7 @@ static struct snd_ac97_build_ops patch_alc650_ops = {
.update_jacks = alc650_update_jacks
};
-static int patch_alc650(struct snd_ac97 * ac97)
+static int patch_alc650(struct snd_ac97 *ac97)
{
unsigned short val;
@@ -2672,7 +2672,7 @@ static int patch_alc650(struct snd_ac97 * ac97)
ac97->id == 0x414c4723);
/* enable AC97_ALC650_GPIO_SETUP, AC97_ALC650_CLOCK for R/W */
- snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS,
+ snd_ac97_write_cache(ac97, AC97_ALC650_GPIO_STATUS,
snd_ac97_read(ac97, AC97_ALC650_GPIO_STATUS) | 0x8000);
/* Enable SPDIF-IN only on Rev.E and above */
@@ -2680,7 +2680,7 @@ static int patch_alc650(struct snd_ac97 * ac97)
/* SPDIF IN with pin 47 */
if (ac97->spec.dev_flags &&
/* ASUS A6KM requires EAPD */
- ! (ac97->subsystem_vendor == 0x1043 &&
+ !(ac97->subsystem_vendor == 0x1043 &&
ac97->subsystem_device == 0x1103))
val |= 0x03; /* enable */
else
@@ -2710,7 +2710,7 @@ static int patch_alc650(struct snd_ac97 * ac97)
static void alc655_update_jacks(struct snd_ac97 *ac97)
{
int shared;
-
+
/* shared Line-In / Surround Out */
shared = is_shared_surrout(ac97);
ac97_update_bits_page(ac97, AC97_ALC650_MULTICH, 1 << 9,
@@ -2783,7 +2783,7 @@ static const struct snd_kcontrol_new snd_ac97_spdif_controls_alc655[] = {
},
};
-static int patch_alc655_specific(struct snd_ac97 * ac97)
+static int patch_alc655_specific(struct snd_ac97 *ac97)
{
int err;
@@ -2801,7 +2801,7 @@ static struct snd_ac97_build_ops patch_alc655_ops = {
.update_jacks = alc655_update_jacks
};
-static int patch_alc655(struct snd_ac97 * ac97)
+static int patch_alc655(struct snd_ac97 *ac97)
{
unsigned int val;
@@ -2862,7 +2862,7 @@ static void alc850_update_jacks(struct snd_ac97 *ac97)
{
int shared;
int aux_is_back_surround;
-
+
/* shared Line-In / Surround Out */
shared = is_shared_surrout(ac97);
/* SURR 1kOhm (bit4), Amp (bit5) */
@@ -2963,7 +2963,7 @@ static const struct snd_kcontrol_new snd_ac97_cm9738_controls[] = {
AC97_CHANNEL_MODE_4CH_CTL,
};
-static int patch_cm9738_specific(struct snd_ac97 * ac97)
+static int patch_cm9738_specific(struct snd_ac97 *ac97)
{
return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls));
}
@@ -2973,7 +2973,7 @@ static struct snd_ac97_build_ops patch_cm9738_ops = {
.update_jacks = cm9738_update_jacks
};
-static int patch_cm9738(struct snd_ac97 * ac97)
+static int patch_cm9738(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_cm9738_ops;
/* FIXME: can anyone confirm below? */
@@ -3012,7 +3012,7 @@ static int snd_ac97_cmedia_spdif_playback_source_put(struct snd_kcontrol *kcontr
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
return snd_ac97_update_bits(ac97, AC97_CM9739_SPDIF_CTRL,
- 0x01 << 1,
+ 0x01 << 1,
(ucontrol->value.enumerated.item[0] & 0x01) << 1);
}
@@ -3028,7 +3028,7 @@ static const struct snd_kcontrol_new snd_ac97_cm9739_controls_spdif[] = {
/* BIT 2: IG_SPIV */
AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Valid Switch", AC97_CM9739_SPDIF_CTRL, 2, 1, 0),
/* BIT 3: SPI2F */
- AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Monitor", AC97_CM9739_SPDIF_CTRL, 3, 1, 0),
+ AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Monitor", AC97_CM9739_SPDIF_CTRL, 3, 1, 0),
/* BIT 4: SPI2SDI */
AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_CM9739_SPDIF_CTRL, 4, 1, 0),
/* BIT 8: SPD32 - 32bit SPDIF - not supported yet */
@@ -3049,12 +3049,12 @@ static const struct snd_kcontrol_new snd_ac97_cm9739_controls[] = {
AC97_CHANNEL_MODE_CTL,
};
-static int patch_cm9739_specific(struct snd_ac97 * ac97)
+static int patch_cm9739_specific(struct snd_ac97 *ac97)
{
return patch_build_controls(ac97, snd_ac97_cm9739_controls, ARRAY_SIZE(snd_ac97_cm9739_controls));
}
-static int patch_cm9739_post_spdif(struct snd_ac97 * ac97)
+static int patch_cm9739_post_spdif(struct snd_ac97 *ac97)
{
return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
}
@@ -3065,7 +3065,7 @@ static struct snd_ac97_build_ops patch_cm9739_ops = {
.update_jacks = cm9739_update_jacks
};
-static int patch_cm9739(struct snd_ac97 * ac97)
+static int patch_cm9739(struct snd_ac97 *ac97)
{
unsigned short val;
@@ -3100,7 +3100,7 @@ static int patch_cm9739(struct snd_ac97 * ac97)
val = snd_ac97_read(ac97, AC97_CM9739_MULTI_CHAN) & (1 << 4);
val |= (1 << 3);
val |= (1 << 13);
- if (! (ac97->ext_id & AC97_EI_SPDIF))
+ if (!(ac97->ext_id & AC97_EI_SPDIF))
val |= (1 << 14);
snd_ac97_write_cache(ac97, AC97_CM9739_MULTI_CHAN, val);
@@ -3216,19 +3216,19 @@ static const struct snd_kcontrol_new snd_ac97_cm9761_controls_spdif[] = {
/* BIT 2: IG_SPIV */
AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Valid Switch", AC97_CM9761_SPDIF_CTRL, 2, 1, 0),
/* BIT 3: SPI2F */
- AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Monitor", AC97_CM9761_SPDIF_CTRL, 3, 1, 0),
+ AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Monitor", AC97_CM9761_SPDIF_CTRL, 3, 1, 0),
/* BIT 4: SPI2SDI */
AC97_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), AC97_CM9761_SPDIF_CTRL, 4, 1, 0),
/* BIT 9-10: DAC_CTL */
AC97_ENUM("DAC Clock Source", cm9761_dac_clock_enum),
};
-static int patch_cm9761_post_spdif(struct snd_ac97 * ac97)
+static int patch_cm9761_post_spdif(struct snd_ac97 *ac97)
{
return patch_build_controls(ac97, snd_ac97_cm9761_controls_spdif, ARRAY_SIZE(snd_ac97_cm9761_controls_spdif));
}
-static int patch_cm9761_specific(struct snd_ac97 * ac97)
+static int patch_cm9761_specific(struct snd_ac97 *ac97)
{
return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls));
}
@@ -3308,7 +3308,7 @@ static int patch_cm9761(struct snd_ac97 *ac97)
return 0;
}
-
+
#define AC97_CM9780_SIDE 0x60
#define AC97_CM9780_JACK 0x62
#define AC97_CM9780_MIXER 0x64
@@ -3418,7 +3418,7 @@ static int snd_ac97_add_vmaster(struct snd_ac97 *ac97, char *name,
return 0;
}
-static int patch_vt1616_specific(struct snd_ac97 * ac97)
+static int patch_vt1616_specific(struct snd_ac97 *ac97)
{
struct snd_kcontrol *kctl;
int err;
@@ -3453,7 +3453,7 @@ static struct snd_ac97_build_ops patch_vt1616_ops = {
.build_specific = patch_vt1616_specific
};
-static int patch_vt1616(struct snd_ac97 * ac97)
+static int patch_vt1616(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_vt1616_ops;
return 0;
@@ -3480,7 +3480,7 @@ static int snd_ac97_vt1617a_smart51_info(struct snd_kcontrol *kcontrol,
/* ordering in this list reflects vt1617a docs for Reg 20 and
* 7a and Table 6 that lays out the matrix NB WRT Table6: SM51
* is SM51EN *AND* it's Bit14, not Bit15 so the table is very
- * counter-intuitive */
+ * counter-intuitive */
static const char* texts[] = { "LineIn Mic1", "LineIn Mic1 Mic3",
"Surr LFE/C Mic3", "LineIn LFE/C Mic3",
@@ -3492,18 +3492,18 @@ static int snd_ac97_vt1617a_smart51_info(struct snd_kcontrol *kcontrol,
static int snd_ac97_vt1617a_smart51_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- ushort usSM51, usMS;
+ ushort usSM51, usMS;
struct snd_ac97 *pac97;
-
+
pac97 = snd_kcontrol_chip(kcontrol); /* grab codec handle */
/* grab our desired bits, then mash them together in a manner
* consistent with Table 6 on page 17 in the 1617a docs */
-
+
usSM51 = snd_ac97_read(pac97, 0x7a) >> 14;
usMS = snd_ac97_read(pac97, 0x20) >> 8;
-
+
ucontrol->value.enumerated.item[0] = (usSM51 << 1) + usMS;
return 0;
@@ -3512,7 +3512,7 @@ static int snd_ac97_vt1617a_smart51_get(struct snd_kcontrol *kcontrol,
static int snd_ac97_vt1617a_smart51_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- ushort usSM51, usMS, usReg;
+ ushort usSM51, usMS, usReg;
struct snd_ac97 *pac97;
@@ -3548,7 +3548,7 @@ static const struct snd_kcontrol_new snd_ac97_controls_vt1617a[] = {
},
};
-static int patch_vt1617a(struct snd_ac97 * ac97)
+static int patch_vt1617a(struct snd_ac97 *ac97)
{
int err = 0;
int val;
@@ -3793,7 +3793,7 @@ static const struct snd_kcontrol_new snd_ac97_spdif_controls_it2646[] = {
AC97_SINGLE("IEC958 Input Monitor", 0x76, 13, 1, 0),
};
-static int patch_it2646_specific(struct snd_ac97 * ac97)
+static int patch_it2646_specific(struct snd_ac97 *ac97)
{
int err;
if ((err = patch_build_controls(ac97, snd_ac97_controls_it2646, ARRAY_SIZE(snd_ac97_controls_it2646))) < 0)
@@ -3808,7 +3808,7 @@ static struct snd_ac97_build_ops patch_it2646_ops = {
.update_jacks = it2646_update_jacks
};
-static int patch_it2646(struct snd_ac97 * ac97)
+static int patch_it2646(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_it2646_ops;
/* full DAC volume */
@@ -3828,7 +3828,7 @@ static const struct snd_kcontrol_new snd_ac97_controls_si3036[] = {
AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1)
};
-static int patch_si3036_specific(struct snd_ac97 * ac97)
+static int patch_si3036_specific(struct snd_ac97 *ac97)
{
int idx, err;
for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++)
@@ -3841,10 +3841,10 @@ static struct snd_ac97_build_ops patch_si3036_ops = {
.build_specific = patch_si3036_specific,
};
-static int mpatch_si3036(struct snd_ac97 * ac97)
+static int mpatch_si3036(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_si3036_ops;
- snd_ac97_write_cache(ac97, 0x5c, 0xf210 );
+ snd_ac97_write_cache(ac97, 0x5c, 0xf210);
snd_ac97_write_cache(ac97, 0x68, 0);
return 0;
}
@@ -3879,7 +3879,7 @@ static int patch_lm4550(struct snd_ac97 *ac97)
return 0;
}
-/*
+/*
* UCB1400 codec (http://www.semiconductors.philips.com/acrobat_download/datasheets/UCB1400-0…)
*/
static const struct snd_kcontrol_new snd_ac97_controls_ucb1400[] = {
@@ -3895,7 +3895,7 @@ AC97_SINGLE("DC Filter", 0x6a, 4, 1, 0),
AC97_SINGLE("Smart Low Power Mode", 0x6c, 4, 3, 0),
};
-static int patch_ucb1400_specific(struct snd_ac97 * ac97)
+static int patch_ucb1400_specific(struct snd_ac97 *ac97)
{
int idx, err;
for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++)
@@ -3908,7 +3908,7 @@ static struct snd_ac97_build_ops patch_ucb1400_ops = {
.build_specific = patch_ucb1400_specific,
};
-static int patch_ucb1400(struct snd_ac97 * ac97)
+static int patch_ucb1400(struct snd_ac97 *ac97)
{
ac97->build_ops = &patch_ucb1400_ops;
/* enable headphone driver and smart low power mode by default */
diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c
index 48cbda9..cb86273 100644
--- a/sound/pci/ac97/ac97_pcm.c
+++ b/sound/pci/ac97/ac97_pcm.c
@@ -175,7 +175,7 @@ static int set_spdif_rate(struct snd_ac97 *ac97, unsigned short rate)
unsigned short old, bits, reg, mask;
unsigned int sbits;
- if (! (ac97->ext_id & AC97_EI_SPDIF))
+ if (!(ac97->ext_id & AC97_EI_SPDIF))
return -ENODEV;
/* TODO: double rate support */
@@ -258,7 +258,7 @@ int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate)
{
int dbl;
unsigned int tmp;
-
+
dbl = rate > 48000;
if (dbl) {
if (!(ac97->flags & AC97_DOUBLE_RATE))
@@ -281,11 +281,11 @@ int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate)
return -EINVAL;
break;
case AC97_PCM_SURR_DAC_RATE:
- if (! (ac97->scaps & AC97_SCAP_SURROUND_DAC))
+ if (!(ac97->scaps & AC97_SCAP_SURROUND_DAC))
return -EINVAL;
break;
case AC97_PCM_LFE_DAC_RATE:
- if (! (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC))
+ if (!(ac97->scaps & AC97_SCAP_CENTER_LFE_DAC))
return -EINVAL;
break;
case AC97_SPDIF:
@@ -618,7 +618,7 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
}
if (reg_ok[cidx] & (1 << (reg - AC97_PCM_FRONT_DAC_RATE)))
continue;
- //printk(KERN_DEBUG "setting ac97 reg 0x%x to rate %d\n", reg, rate);
+ /* printk(KERN_DEBUG "setting ac97 reg 0x%x to rate %d\n", reg, rate); */
err = snd_ac97_set_rate(pcm->r[r].codec[cidx], reg, rate);
if (err < 0)
snd_printk(KERN_ERR "error in snd_ac97_set_rate: cidx=%d, reg=0x%x, rate=%d, err=%d\n", cidx, reg, rate, err);
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c
index 060ea59..11f7e50 100644
--- a/sound/pci/ac97/ac97_proc.c
+++ b/sound/pci/ac97/ac97_proc.c
@@ -140,7 +140,7 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffe
AC97_PAGE_MASK, val & AC97_PAGE_MASK);
}
- // val = snd_ac97_read(ac97, AC97_RESET);
+ /* val = snd_ac97_read(ac97, AC97_RESET); */
val = ac97->caps;
snd_iprintf(buffer, "Capabilities :%s%s%s%s%s%s\n",
val & AC97_BC_DEDICATED_MIC ? " -dedicated MIC PCM IN channel-" : "",
@@ -188,7 +188,7 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffe
ext = snd_ac97_read(ac97, AC97_EXTENDED_ID);
if (ext == 0)
goto __modem;
-
+
snd_iprintf(buffer, "Extended ID : codec=%i rev=%i%s%s%s%s DSA=%i%s%s%s%s\n",
(ext & AC97_EI_ADDR_MASK) >> AC97_EI_ADDR_SHIFT,
(ext & AC97_EI_REV_MASK) >> AC97_EI_REV_SHIFT,
@@ -295,11 +295,11 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffe
}
- __modem:
+__modem:
mext = snd_ac97_read(ac97, AC97_EXTENDED_MID);
if (mext == 0)
return;
-
+
snd_iprintf(buffer, "Extended modem ID: codec=%i%s%s%s%s%s\n",
(mext & AC97_MEI_ADDR_MASK) >> AC97_MEI_ADDR_SHIFT,
mext & AC97_MEI_CID2 ? " CID2" : "",
@@ -342,9 +342,9 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffe
static void snd_ac97_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
struct snd_ac97 *ac97 = entry->private_data;
-
+
mutex_lock(&ac97->page_mutex);
- if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86
+ if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { /* Analog Devices AD1881/85/86 */
int idx;
for (idx = 0; idx < 3; idx++)
if (ac97->spec.ad18xx.id[idx]) {
@@ -356,7 +356,7 @@ static void snd_ac97_proc_read(struct snd_info_entry *entry, struct snd_info_buf
}
/* select all codecs */
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
-
+
snd_iprintf(buffer, "\nAD18XX configuration\n");
snd_iprintf(buffer, "Unchained : 0x%04x,0x%04x,0x%04x\n",
ac97->spec.ad18xx.unchained[0],
@@ -401,13 +401,13 @@ static void snd_ac97_proc_regs_read_main(struct snd_ac97 *ac97, struct snd_info_
}
}
-static void snd_ac97_proc_regs_read(struct snd_info_entry *entry,
+static void snd_ac97_proc_regs_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ac97 *ac97 = entry->private_data;
mutex_lock(&ac97->page_mutex);
- if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { // Analog Devices AD1881/85/86
+ if ((ac97->id & 0xffffff40) == AC97_ID_AD1881) { /* Analog Devices AD1881/85/86 */
int idx;
for (idx = 0; idx < 3; idx++)
@@ -421,11 +421,11 @@ static void snd_ac97_proc_regs_read(struct snd_info_entry *entry,
snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
} else {
snd_ac97_proc_regs_read_main(ac97, buffer, 0);
- }
+ }
mutex_unlock(&ac97->page_mutex);
}
-void snd_ac97_proc_init(struct snd_ac97 * ac97)
+void snd_ac97_proc_init(struct snd_ac97 *ac97)
{
struct snd_info_entry *entry;
char name[32];
@@ -458,7 +458,7 @@ void snd_ac97_proc_init(struct snd_ac97 * ac97)
ac97->proc_regs = entry;
}
-void snd_ac97_proc_done(struct snd_ac97 * ac97)
+void snd_ac97_proc_done(struct snd_ac97 *ac97)
{
snd_info_free_entry(ac97->proc_regs);
ac97->proc_regs = NULL;
2
4
Hi group,
I am making progress with my ALSA apps but in the process I have found
a few bugs.
One of them is in the documentation.
In
http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#g692ad9e59…
Under Parameters=> 'Size frames to be written' should be 'frames to be
read'.
Just FYI.
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
4
3
Hi,
what is the current status in the development of the native emu20k1, (
for the low-end X-fis , Gamer, Music... ) driver?
thanks
- CU beomuex
3
2

[alsa-devel] [PATCH 1/2] ca0106 playback 44100Hz support to SPDIF and playback format & rate constraints
by Ben Stanley 10 Sep '08
by Ben Stanley 10 Sep '08
10 Sep '08
Dear list,
This patch provides the ability to play back digital audio via SPDIF at
a sampling rate of 44100Hz. It also implements rate constraints to
ensure that the hardware restrictions of the card are not violated. Note
that if 44100Hz is used, then all used channels must use that frequency.
For example, opening hw:0,0 at 48000 and then opening hw:0,1 at 44100
will fail due to constraints. However, you may successfully open both
hw:0,0 and hw:0,1 at 44100 (presume no other channels open). Further
details of the restriction may be found in the thread
http://thread.gmane.org/gmane.linux.alsa.devel/52149/focus=52345
This patch also implements playback format restrictions, such that only
one playback format may be in use at any time.
I tested driver playback using the attached script
(Test_ca0106_driver.sh). I get good audio output for all combinations of
sampling rates and formats except for 192kHz S16 (as noted at the end of
the script). Sometimes it works and sometimes it doesn't. The reason for
the failure is not apparent at this time. It could have something to do
with my receiver. I don't know.
The attached script also checks and validates that the rate and format
constraints operate as required.
I periodically have trouble with this driver not producing sound output.
This has been investigated and the cause is explained here
http://thread.gmane.org/gmane.linux.alsa.devel/55384/focus=55410
I intend to submit a new patch to address this in the future.
This patch has been in use for three months on my MythTV system (Ubuntu
8.04). I find it works reliably for me. I also use it with xine, aplay,
mplayer, mame, and childsplay.
I have checked with checkpatch.pl . Patch is against v1.0.18rc1.
Signed-off-by: Ben Stanley Ben.Stanley(a)exemail.com.au
This is the patch against alsa-kmirror.
---
pci/ca0106/ca0106.h | 7 +-
pci/ca0106/ca0106_main.c | 266 ++++++++++++++++++++++++++++++++++++++--------
2 files changed, 229 insertions(+), 44 deletions(-)
diff --git a/pci/ca0106/ca0106.h b/pci/ca0106/ca0106.h
index 74175fc..376fa9c 100644
--- a/pci/ca0106/ca0106.h
+++ b/pci/ca0106/ca0106.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2004 James Courtier-Dutton <James(a)superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
- * Version: 0.0.22
+ * Version: 0.0.23
*
* FEATURES currently supported:
* See ca0106_main.c for features.
@@ -49,6 +49,8 @@
* Implement support for Line-in capture on SB Live 24bit.
* 0.0.22
* Add support for mute control on SB Live 24bit (cards w/ SPI DAC)
+ * 0.0.23
+ * Add support for playback sampling rate and format constraints.
*
*
* This code was initally based on code from ALSA's emu10k1x.c which is:
@@ -644,6 +646,8 @@
#include "ca_midi.h"
+#define DRVNAME "snd-ca0106"
+
struct snd_ca0106;
struct snd_ca0106_channel {
@@ -659,6 +663,7 @@ struct snd_ca0106_pcm {
struct snd_pcm_substream *substream;
int channel_id;
unsigned short running;
+ unsigned short hw_reserved;
};
struct snd_ca0106_details {
diff --git a/pci/ca0106/ca0106_main.c b/pci/ca0106/ca0106_main.c
index 2f8b28a..33f992b 100644
--- a/pci/ca0106/ca0106_main.c
+++ b/pci/ca0106/ca0106_main.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2004 James Courtier-Dutton <James(a)superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
- * Version: 0.0.25
+ * Version: 0.0.26
*
* FEATURES currently supported:
* Front, Rear and Center/LFE.
@@ -83,9 +83,14 @@
* Add support for mute control on SB Live 24bit (cards w/ SPI DAC)
* 0.0.25
* Powerdown SPI DAC channels when not in use
+ * 0.0.26 Ben Stanley
+ * Added support for output at 44100Hz rate (SPDIF only).
+ * Implemented constraints system for output rate and format.
*
* BUGS:
* Some stability problems when unloading the snd-ca0106 kernel module.
+ * Some programs fail to produce sound output (tested on SPDIF). See
+ * http://thread.gmane.org/gmane.linux.alsa.devel/55384/focus=55410
* --
*
* TODO:
@@ -145,6 +150,7 @@
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
+#include <sound/pcm_params.h>
#include <sound/ac97_codec.h>
#include <sound/info.h>
@@ -284,9 +290,9 @@ static struct snd_pcm_hardware snd_ca0106_playback_hw = {
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_SYNC_START,
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
- .rates = (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
- SNDRV_PCM_RATE_192000),
- .rate_min = 48000,
+ .rates = (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000),
+ .rate_min = 44100,
.rate_max = 192000,
.channels_min = 2, //1,
.channels_max = 2, //6,
@@ -318,6 +324,111 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
.fifo_size = 0,
};
+static unsigned int all_spdif_playback_rates[] =
+ {44100, 48000, 96000, 192000};
+
+static int hw_rule_playback_rate(
+ struct snd_pcm_hw_params *params,
+ struct snd_pcm_hw_rule *rule)
+{
+ struct snd_ca0106 *chip = rule->private;
+ int chi, any_44100 = 0, any_non_44100 = 0, mask = 0;
+ struct snd_ca0106_channel *chp = 0;
+ struct snd_pcm_runtime *runtime;
+ if (snd_BUG_ON(!chip))
+ return -EINVAL;
+
+ if (chip->spdif_enable) {
+ for (chi = 0; chi < 4; ++chi) {
+ chp = &(chip->playback_channels[chi]);
+ if (!chp->use)
+ continue;
+ if (snd_BUG_ON(!chp->epcm))
+ return -EINVAL;
+ if (!chp->epcm->hw_reserved)
+ continue;
+ if (snd_BUG_ON(!chp->epcm->substream))
+ return -EINVAL;
+ if (snd_BUG_ON(!chp->epcm->substream->runtime))
+ return -EINVAL;
+ runtime = chp->epcm->substream->runtime;
+ snd_printd("snd_hw_rule_playback_rate: ch=%d, "
+ "rate=%d.\n", chi, runtime->rate);
+ any_44100 += runtime->rate == 44100;
+ any_non_44100 += runtime->rate != 44100;
+ }
+ if (snd_BUG_ON(any_44100 && any_non_44100))
+ return -EINVAL;
+ if (any_44100)
+ mask = 0x1;
+ else if (any_non_44100)
+ mask = 0xE;
+ else
+ mask = 0xF;
+ } else {
+ /* 44100Hz is not supported for DAC (FIXME Why?) */
+ mask = 0xE;
+ }
+ snd_printd("snd_hw_rule_playback_rate: any_44100=%d, "
+ "any_non_44100=%d, mask=0x%X, spdif=%d\n",
+ any_44100, any_non_44100, mask, chip->spdif_enable);
+ return snd_interval_list(
+ hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE),
+ ARRAY_SIZE(all_spdif_playback_rates),
+ all_spdif_playback_rates, mask);
+}
+
+static int hw_rule_playback_format(
+ struct snd_pcm_hw_params *params,
+ struct snd_pcm_hw_rule *rule)
+{
+ struct snd_ca0106 *chip = rule->private;
+ int chi, any_S16 = 0, any_S32 = 0;
+ struct snd_ca0106_channel *chp = 0;
+ struct snd_pcm_runtime *runtime;
+ struct snd_mask fmt, *f = hw_param_mask(
+ params, SNDRV_PCM_HW_PARAM_FORMAT);
+ int result;
+ if (snd_BUG_ON(!chip))
+ return -EINVAL;
+ snd_mask_none(&fmt);
+
+ for (chi = 0; chi < 4; ++chi) {
+ chp = &(chip->playback_channels[chi]);
+ if (!chp->use)
+ continue;
+ if (snd_BUG_ON(!chp->epcm))
+ return -EINVAL;
+ if (!chp->epcm->hw_reserved)
+ continue;
+ if (snd_BUG_ON(!chp->epcm->substream))
+ return -EINVAL;
+ if (snd_BUG_ON(!chp->epcm->substream->runtime))
+ return -EINVAL;
+ runtime = chp->epcm->substream->runtime;
+ snd_printd("snd_hw_rule_playback_format: ch=%d, format=%d.\n",
+ chi, runtime->format);
+ any_S16 += runtime->format == SNDRV_PCM_FORMAT_S16_LE;
+ any_S32 += runtime->format == SNDRV_PCM_FORMAT_S32_LE;
+ }
+ if (snd_BUG_ON(any_S16 && any_S32))
+ return -EINVAL;
+ if (any_S16)
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S16_LE);
+ else if (any_S32)
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S32_LE);
+ else {
+ /* No format yet chosen, so both formats are available. */
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S16_LE);
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S32_LE);
+ }
+ result = snd_mask_refine(f, &fmt);
+ snd_printd("snd_hw_rule_playback_format: any_S16=%d, any_S32=%d, "
+ "refined_fmt=0x%X, avail_fmt=0x%X, changed=%d\n",
+ any_S16, any_S32, f->bits[0], fmt.bits[0], result);
+ return result;
+}
+
unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
unsigned int reg,
unsigned int chn)
@@ -508,10 +619,24 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
//printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
//channel->interrupt = snd_ca0106_pcm_channel_interrupt;
channel->epcm = epcm;
- if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
+ err = snd_pcm_hw_constraint_integer(
+ runtime, SNDRV_PCM_HW_PARAM_PERIODS);
+ if (err < 0)
return err;
- if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
+ err = snd_pcm_hw_constraint_step(
+ runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
+ if (err < 0)
return err;
+ err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ hw_rule_playback_rate, (void *)chip,
+ SNDRV_PCM_HW_PARAM_RATE, -1);
+ if (err < 0)
+ return err;
+ err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
+ hw_rule_playback_format, (void *)chip,
+ SNDRV_PCM_HW_PARAM_FORMAT, -1);
+ if (err < 0)
+ return err;
snd_pcm_set_sync(substream);
if (chip->details->spi_dac && channel_id != PCM_FRONT_CHANNEL) {
@@ -646,6 +771,9 @@ static int snd_ca0106_pcm_hw_params_playback(struct snd_pcm_substream *substream
/* hw_free callback */
static int snd_ca0106_pcm_hw_free_playback(struct snd_pcm_substream *substream)
{
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_ca0106_pcm *epcm = runtime->private_data;
+ epcm->hw_reserved = 0;
return snd_pcm_lib_free_pages(substream);
}
@@ -667,53 +795,103 @@ static int snd_ca0106_pcm_hw_free_capture(struct snd_pcm_substream *substream)
static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
{
struct snd_ca0106 *emu = snd_pcm_substream_chip(substream);
- struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime, *runtimei = 0;
struct snd_ca0106_pcm *epcm = runtime->private_data;
- int channel = epcm->channel_id;
+ struct snd_ca0106_channel *chp = 0;
+ int channel = epcm->channel_id, chi, any_44100 = 0, any_non_44100 = 0;
u32 *table_base = (u32 *)(emu->buffer.area+(8*16*channel));
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
u32 hcfg_mask = HCFG_PLAYBACK_S32_LE;
u32 hcfg_set = 0x00000000;
u32 hcfg;
- u32 reg40_mask = 0x30000 << (channel<<1);
+ u32 reg40_mask = 0xFF0000;
u32 reg40_set = 0;
u32 reg40;
- /* FIXME: Depending on mixer selection of SPDIF out or not, select the spdif rate or the DAC rate. */
- u32 reg71_mask = 0x03030000 ; /* Global. Set SPDIF rate. We only support 44100 to spdif, not to DAC. */
+ u32 reg71_mask;
+ u32 reg71_shift;
u32 reg71_set = 0;
u32 reg71;
int i;
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
- /* Rate can be set per channel. */
- /* reg40 control host to fifo */
- /* reg71 controls DAC rate. */
- switch (runtime->rate) {
- case 44100:
- reg40_set = 0x10000 << (channel<<1);
- reg71_set = 0x01010000;
- break;
- case 48000:
- reg40_set = 0;
- reg71_set = 0;
- break;
- case 96000:
- reg40_set = 0x20000 << (channel<<1);
- reg71_set = 0x02020000;
- break;
- case 192000:
- reg40_set = 0x30000 << (channel<<1);
- reg71_set = 0x03030000;
- break;
- default:
- reg40_set = 0;
- reg71_set = 0;
- break;
+ epcm->hw_reserved = 1;
+ /* FIXME CLEAN UP IF spdif_enable IS CHANGED WHILE CHANNELS ARE OPENED
+ * OR PREVENT THIS FROM HAPPENING. */
+ if (emu->spdif_enable)
+ reg71_shift = 24; /* SPDIF Output Rate */
+ else
+ reg71_shift = 16; /* I2S Output Rate */
+ reg71_mask = 0x3 << reg71_shift;
+
+ printk(KERN_DEBUG DRVNAME ": prepare_playback: "
+ "channel_number=%d, rate=%d, format=0x%x, channels=%d, "
+ "buffer_size=%ld,period_size=%ld, periods=%u, "
+ "frames_to_bytes=%d\n",
+ channel, runtime->rate, runtime->format, runtime->channels,
+ runtime->buffer_size, runtime->period_size, runtime->periods,
+ frames_to_bytes(runtime, 1));
+ /*printk("dma_addr=%x, dma_area=%p, table_base=%p\n",
+ runtime->dma_addr,runtime->dma_area, table_base);*/
+ /*printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
+ emu->buffer.addr,emu->buffer.area, emu->buffer.bytes);*/
+ /* We are forced to build the settings for all the channels. */
+ for (chi = 0; chi < 4; ++chi) {
+ chp = &(emu->playback_channels[chi]);
+ if (!chp->use)
+ continue;
+ if (snd_BUG_ON(!chp->epcm))
+ return -EINVAL;
+ if (chi != channel && !chp->epcm->hw_reserved)
+ continue;
+ if (snd_BUG_ON(!chp->epcm->substream))
+ return -EINVAL;
+ if (snd_BUG_ON(!chp->epcm->substream->runtime))
+ return -EINVAL;
+ runtimei = chp->epcm->substream->runtime;
+ any_44100 += runtimei->rate == 44100;
+ any_non_44100 += runtimei->rate != 44100;
+ /* Rate can be set per channel. */
+ /* reg40 control host to fifo */
+ /* reg71 controls DAC rate. */
+ switch (runtimei->rate) {
+ case 44100:
+ /* We only support 44100 to spdif, not to DAC.
+ (FIXME WHY?)*/
+ if (emu->spdif_enable) {
+ /* When using 44100, *all* channels
+ must be set to that rate. */
+ reg40_set |= 0x550000;
+ reg71_set |= 0x1 << reg71_shift;
+ break;
+ } else {
+ printk(KERN_ERR DRVNAME
+ "prepare_playback: "
+ "44100Hz is invalid for DAC.\n");
+ }
+ case 48000:
+ /* reg40_set &= !(0x1 << (chi<<1)); */
+ /* reg71_set &= !(0x1 << reg71_shift); */
+ break;
+ case 96000:
+ reg40_set |= 0x20000 << (chi<<1);
+ reg71_set |= 0x2 << reg71_shift;
+ break;
+ case 192000:
+ reg40_set |= 0x30000 << (chi<<1);
+ reg71_set |= 0x3 << reg71_shift;
+ break;
+ default:
+ printk(KERN_ERR DRVNAME
+ ": prepare_playback: "
+ "Bad sampling frequency %d.\n",
+ runtimei->rate);
+ }
}
- /* Format is a global setting */
- /* FIXME: Only let the first channel accessed set this. */
+ printk(KERN_DEBUG DRVNAME ": prepare_playback: any_44100=%d, "
+ "any_non_44100=%d, spdif=%d.\n",
+ any_44100, any_non_44100, emu->spdif_enable);
+ /* Format is a global setting. */
+ /* Only the first channel accessed can set this
+ (enforced by constraints). */
switch (runtime->format) {
case SNDRV_PCM_FORMAT_S16_LE:
hcfg_set = 0;
@@ -1363,8 +1541,8 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
#if 1
- printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model,
- pci->revision, chip->serial);
+ printk(KERN_INFO DRVNAME ": Model %04x Rev %08x Serial %08x\n",
+ chip->model, pci->revision, chip->serial);
#endif
strcpy(card->driver, "CA0106");
strcpy(card->shortname, "CA0106");
@@ -1378,7 +1556,9 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
}
chip->details = c;
if (subsystem[dev]) {
- printk(KERN_INFO "snd-ca0106: Sound card name=%s, subsystem=0x%x. Forced to subsystem=0x%x\n",
+ printk(KERN_INFO DRVNAME
+ ": Sound card name=%s, subsystem=0x%x. "
+ "Forced to subsystem=0x%x\n",
c->name, chip->serial, subsystem[dev]);
}
--
1.5.4.3
5
15
Titanium is second generation X-Fi, and ALSA has yet to support the
1st generation. It's very unlikely that it will happen anytime soon.
2008/9/10 William Zumwalt <wizumwalt(a)gmail.com>:
> Hi all,
> I have an X-Fi Titanium Fatal1ty card and have been having a really hard
> time trying to get the driver for it installed and was wondering if anyone
> had an idea when this card would be supported by alsa.
> Thanks,
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Alsa-user mailing list
> Alsa-user(a)lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>
>
--
Vedran Miletić
1
0
I've started a new thread to avoid confusion, and copied bits here:
On Monday 08 September 2008 21:51, Mark Brown wrote:
> On Mon, Sep 08, 2008 at 09:27:13PM +0100, Alan Horstmann wrote:
> > With just this one change we have been successful in running the codec
> > over spi. At present we do have an issue with dapm during capture
> > -nothing is being turned on! Any pointers would be appreciated.
>
> If you define DEBUG when building soc-dapm.c (a define at the top of the
> source file will do the trick) then it will be very verbose about the
> decisions it's making - that will normally point out the problem.
> Probably either one of the input controls is not configured to make a
> path from the input pins to the ADC or the input has been mistakenly
> marked as disabled.
That gets us lots of info to digest, and it does look like there are no dapm
capture paths -listing below. What we cannot fathom is why!
Can users of wm8731 confirm successful capture with dapm on any platform? It
is not clear at this stage whether we are looking for a problem on our
platform, or a general bug in the driver dapm code.
Any assistance would be appreciated.
Alan
widget ADC
HiFi Capture stream Capture event 1
widget DAC
HiFi Playback stream Capture event 1
reg old 5f new 5f change 0
reg old 5f new 5f change 0
DAPM WM8731 snd_soc_dapm_stream_event
Ext Spk: Off in 0 out 1
in static LHPOUT
Int Mic: Off in 1 out 0
out static Mic Bias
LLINEIN: Off in 0 out 1
out static Line Input
RLINEIN: Off in 0 out 1
out static Line Input
MICIN: Off in 1 out 0
in static Mic Bias
out static Mic Bias
Mic Bias: Off in 1 out 0
in static Int Mic
in static MICIN
out static MICIN
Line Input: Off in 0 out 1
in static RLINEIN
in static LLINEIN
out Line In Input Mux
Input Mux: Off in 0 out 1
in Line In Line Input
out static ADC
ADC: Off in 0 out 1
in static Input Mux
RHPOUT: Off in 0 out 1
in static Output Mixer
ROUT: Off in 0 out 1
in static Output Mixer
LHPOUT: Off in 0 out 1
in static Output Mixer
out static Ext Spk
LOUT: Off in 0 out 1
in static Output Mixer
DAC: Off in 0 out 4
out HiFi Playback Switch Output Mixer
Output Mixer: Off in 0 out 4
in HiFi Playback Switch DAC
out static LOUT
out static LHPOUT
out static ROUT
out static RHPOUT
2
2
Hi,
I'm trying to get an jukebox application going on a Sony PlayStation3 using
Qt-Embedded, Phonon and PulseAudio. The application is working well on my KDE-
based laptop where it appears that the application is using Phonon -> ALSA ->
PulseAudio. But there is no sound from the application when run on the PS3.
I initially reported this problem to the PulseAudio mailing list. The first
post on this topic is at https://tango.0pointer.de/pipermail/pulseaudio-
discuss/2008-August/002249.html . In pacticular, see these posts:
1) https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-
September/002346.html where I detail the results of a final test using the
latest development version of PulseAudio; and
2) https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-
September/002347.html where a PulseAudio developer diagnoses the problem as
being within ALSA.
For convenience, the following is from the latter post:
"So, what happens here is this: your device can only do non-interleaved audio
and is hence configured for it (as we can see from that "slave setup" listing
above). Because your hardware lacks a hardware volume control ALSA puts
"softvol" on top of the hw device: the "Soft Volume PCM" you can see in the
first part. That device is initialized for interleaved audio as you can see.
Which is what PA supports and PA asked for.
Now, if softval takes non-interleaved from below and gives interleaved to the
layer above than it would need to rearrange those samples -- which it however
doesn't actually. PA hence checks with those asserts if the audio data is
properly arranged -- which it is not as we can see.
This is a bug in ALSA's softvol module. Please report this on alsa-devel.
softvol falsely claims to be able to rearrange non-interleaved audio to
interleaved."
Not sure what other information I should post here so I'll wait for any
feedback.
Thanks in advance,
Kevin
4
7

[alsa-devel] [PATCH 1/8] ASoC: Make all codecs depend on rather than selecting I2C
by Mark Brown 09 Sep '08
by Mark Brown 09 Sep '08
09 Sep '08
The I2C layer uses I/O operations that aren't available on all
architectures and since select bypasses Kconfig dependency checking
selecting I2C breaks builds like allmodconfig on some architectures.
Signed-off-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 5d77dc3..13ae4fd 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1,6 +1,6 @@
config SND_SOC_ALL_CODECS
tristate "Build all ASoC CODEC drivers"
- select I2C
+ depends on I2C
select SPI
select SND_SOC_AK4535
select SND_SOC_UDA1380
--
1.5.6.5
6
20

[alsa-devel] how is 'dir' in snd_pcm_hw_params_set_periods_near() supposed to work?
by Lennart Poettering 09 Sep '08
by Lennart Poettering 09 Sep '08
09 Sep '08
Heya!
How is the 'dir' argument in snd_pcm_hw_params_set_periods_near()
supposed to work?
I'd assume that passing dir=1 would mean that it is looked for a
number of periods that is greater *or equal* to what we request. If we
pass dir=-1 we'd be looking for a number of periods that is smaller
*or equal* to what we request.
However, what I am experiencing is that there is no "or equal". On my
softvol on hda setup here if I ask for 5 periods I will always get 6
if I pass dir=1 -- even if the could give me 5 and will give me five
if I pass dir=0.
The docs don't really elaborate on this much.
I'd certainly think that having ">=" and "<=" here is much more useful
and natural than ">" and "<", and hence I was wondering: is this just
a bug in the software or is it really intended to be this way?
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
2
1

[alsa-devel] [PATCH 09/24] sound/pci: coding style fixes: sound/pci/e*
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ens1370.c | 60 ++++++++++++++++++++--------------------
sound/pci/es1938.c | 68 +++++++++++++++++++++++-----------------------
sound/pci/es1968.c | 74 +++++++++++++++++++++++++-------------------------
3 files changed, 101 insertions(+), 101 deletions(-)
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 9bf9536..56a8f7c 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -26,7 +26,7 @@
* by Kurt J. Bosch
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -467,13 +467,13 @@ MODULE_DEVICE_TABLE(pci, snd_audiopci_ids);
static unsigned int snd_es1370_fixed_rates[] =
{5512, 11025, 22050, 44100};
static struct snd_pcm_hw_constraint_list snd_es1370_hw_constraints_rates = {
- .count = 4,
+ .count = 4,
.list = snd_es1370_fixed_rates,
.mask = 0,
};
static struct snd_ratnum es1370_clock = {
.num = ES_1370_SRCLOCK,
- .den_min = 29,
+ .den_min = 29,
.den_max = 353,
.den_step = 1,
};
@@ -494,7 +494,7 @@ static struct snd_pcm_hw_constraint_ratdens snd_es1371_hw_constraints_dac_clock
};
static struct snd_ratnum es1371_adc_clock = {
.num = 48000 << 15,
- .den_min = 32768,
+ .den_min = 32768,
.den_max = 393216,
.den_step = 1,
};
@@ -542,7 +542,7 @@ static unsigned int snd_es1371_src_read(struct ensoniq * ensoniq, unsigned short
/* now, wait for busy and the correct time to read */
temp = snd_es1371_wait_src_ready(ensoniq);
-
+
if ((temp & 0x00870000) != 0x00010000) {
/* wait for the right state */
for (i = 0; i < POLL_COUNT; i++) {
@@ -552,12 +552,12 @@ static unsigned int snd_es1371_src_read(struct ensoniq * ensoniq, unsigned short
}
}
- /* hide the state bits */
+ /* hide the state bits */
r = orig & (ES_1371_SRC_DISABLE | ES_1371_DIS_P1 |
ES_1371_DIS_P2 | ES_1371_DIS_R1);
r |= ES_1371_SRC_RAM_ADDRO(reg);
outl(r, ES_REG(ensoniq, 1371_SMPRATE));
-
+
return temp;
}
@@ -648,7 +648,7 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
struct ensoniq *ensoniq = ac97->private_data;
unsigned int t, x, fail = 0;
- __again:
+__again:
mutex_lock(&ensoniq->src_mutex);
for (t = 0; t < POLL_COUNT; t++) {
if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
@@ -677,7 +677,7 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
/* wait for WIP again */
for (t = 0; t < POLL_COUNT; t++) {
if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP))
- break;
+ break;
}
/* now wait for the stinkin' data (RDY) */
for (t = 0; t < POLL_COUNT; t++) {
@@ -1053,7 +1053,7 @@ static struct snd_pcm_hardware snd_ensoniq_playback1 =
SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
#else
(SNDRV_PCM_RATE_KNOT | /* 5512Hz rate */
- SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050 |
+ SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050 |
SNDRV_PCM_RATE_44100),
#endif
.rate_min = 4000,
@@ -1072,7 +1072,7 @@ static struct snd_pcm_hardware snd_ensoniq_playback2 =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
@@ -1424,7 +1424,7 @@ static int snd_es1371_spdif_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&ensoniq->reg_lock);
ucontrol->value.integer.value[0] = ensoniq->ctrl & ES_1373_SPDIF_THRU ? 1 : 0;
spin_unlock_irq(&ensoniq->reg_lock);
@@ -1437,7 +1437,7 @@ static int snd_es1371_spdif_put(struct snd_kcontrol *kcontrol,
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
unsigned int nval1, nval2;
int change;
-
+
nval1 = ucontrol->value.integer.value[0] ? ES_1373_SPDIF_THRU : 0;
nval2 = ucontrol->value.integer.value[0] ? ES_1373_SPDIF_EN : 0;
spin_lock_irq(&ensoniq->reg_lock);
@@ -1487,7 +1487,7 @@ static int snd_es1373_rear_get(struct snd_kcontrol *kcontrol,
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int val = 0;
-
+
spin_lock_irq(&ensoniq->reg_lock);
if ((ensoniq->cssr & (ES_1373_REAR_BIT27|ES_1373_REAR_BIT26|
ES_1373_REAR_BIT24)) == ES_1373_REAR_BIT26)
@@ -1503,7 +1503,7 @@ static int snd_es1373_rear_put(struct snd_kcontrol *kcontrol,
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
unsigned int nval1;
int change;
-
+
nval1 = ucontrol->value.integer.value[0] ?
ES_1373_REAR_BIT26 : (ES_1373_REAR_BIT27|ES_1373_REAR_BIT24);
spin_lock_irq(&ensoniq->reg_lock);
@@ -1532,7 +1532,7 @@ static int snd_es1373_line_get(struct snd_kcontrol *kcontrol,
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int val = 0;
-
+
spin_lock_irq(&ensoniq->reg_lock);
if ((ensoniq->ctrl & ES_1371_GPIO_OUTM) >= 4)
val = 1;
@@ -1547,7 +1547,7 @@ static int snd_es1373_line_put(struct snd_kcontrol *kcontrol,
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int changed;
unsigned int ctrl;
-
+
spin_lock_irq(&ensoniq->reg_lock);
ctrl = ensoniq->ctrl;
if (ucontrol->value.integer.value[0])
@@ -1690,7 +1690,7 @@ static int snd_ensoniq_control_get(struct snd_kcontrol *kcontrol,
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int mask = kcontrol->private_value;
-
+
spin_lock_irq(&ensoniq->reg_lock);
ucontrol->value.integer.value[0] = ensoniq->ctrl & mask ? 1 : 0;
spin_unlock_irq(&ensoniq->reg_lock);
@@ -1704,7 +1704,7 @@ static int snd_ensoniq_control_put(struct snd_kcontrol *kcontrol,
int mask = kcontrol->private_value;
unsigned int nval;
int change;
-
+
nval = ucontrol->value.integer.value[0] ? mask : 0;
spin_lock_irq(&ensoniq->reg_lock);
change = (ensoniq->ctrl & mask) != nval;
@@ -1864,7 +1864,7 @@ static inline void snd_ensoniq_free_gameport(struct ensoniq *ensoniq) { }
*/
-static void snd_ensoniq_proc_read(struct snd_info_entry *entry,
+static void snd_ensoniq_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct ensoniq *ensoniq = entry->private_data;
@@ -1891,7 +1891,7 @@ static void __devinit snd_ensoniq_proc_init(struct ensoniq * ensoniq)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry))
+ if (!snd_card_proc_new(ensoniq->card, "audiopci", &entry))
snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read);
}
@@ -1914,7 +1914,7 @@ static int snd_ensoniq_free(struct ensoniq *ensoniq)
if (ensoniq->irq >= 0)
synchronize_irq(ensoniq->irq);
pci_set_power_state(ensoniq->pci, 3);
- __hw_end:
+__hw_end:
#ifdef CHIP1370
if (ensoniq->dma_bug.area)
snd_dma_free_pages(&ensoniq->dma_bug);
@@ -1982,7 +1982,7 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq)
udelay(20);
outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
/* Init the sample rate converter */
- snd_es1371_wait_src_ready(ensoniq);
+ snd_es1371_wait_src_ready(ensoniq);
outl(ES_1371_SRC_DISABLE, ES_REG(ensoniq, 1371_SMPRATE));
for (idx = 0; idx < 0x80; idx++)
snd_es1371_src_write(ensoniq, idx, 0);
@@ -2021,13 +2021,13 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct ensoniq *ensoniq = card->private_data;
-
+
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(ensoniq->pcm1);
snd_pcm_suspend_all(ensoniq->pcm2);
-
-#ifdef CHIP1371
+
+#ifdef CHIP1371
snd_ac97_suspend(ensoniq->u.es1371.ac97);
#else
/* try to reset AK4531 */
@@ -2038,7 +2038,7 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state)
inw(ES_REG(ensoniq, 1370_CODEC));
udelay(100);
snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
-#endif
+#endif
pci_disable_device(pci);
pci_save_state(pci);
@@ -2063,11 +2063,11 @@ static int snd_ensoniq_resume(struct pci_dev *pci)
snd_ensoniq_chip_init(ensoniq);
-#ifdef CHIP1371
+#ifdef CHIP1371
snd_ac97_resume(ensoniq->u.es1371.ac97);
#else
snd_ak4531_resume(ensoniq->u.es1370.ak4531);
-#endif
+#endif
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
@@ -2482,7 +2482,7 @@ static struct pci_driver driver = {
.resume = snd_ensoniq_resume,
#endif
};
-
+
static int __init alsa_card_ens137x_init(void)
{
return pci_register_driver(&driver);
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 4cd9a1f..87effdc 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -5,7 +5,7 @@
* Thomas Sailer <sailer(a)ife.ee.ethz.ch>,
* Abramo Bagnara <abramo(a)alsa-project.org>,
* Markus Gruber <gruber(a)eikon.tum.de>
- *
+ *
* Rewritten from sonicvibes.c source.
*
* TODO:
@@ -63,7 +63,7 @@
#include <sound/initval.h>
#include <sound/tlv.h>
-#include <asm/io.h>
+#include <linux/io.h>
MODULE_AUTHOR("Jaromir Koutek <miri(a)punknet.cz>");
MODULE_DESCRIPTION("ESS Solo-1");
@@ -167,7 +167,7 @@ MODULE_PARM_DESC(enable, "Enable ESS Solo-1 soundcard.");
#define ESS_CMD_SETFORMAT2 0xb7
#define ESS_CMD_DMACONTROL 0xb8
#define ESS_CMD_DMATYPE 0xb9
-#define ESS_CMD_OFFSETLEFT 0xba
+#define ESS_CMD_OFFSETLEFT 0xba
#define ESS_CMD_OFFSETRIGHT 0xbb
#define ESS_CMD_READREG 0xc0
#define ESS_CMD_ENABLEEXT 0xc6
@@ -418,7 +418,7 @@ static void snd_es1938_reset(struct es1938 *chip)
}
snd_printk(KERN_ERR "ESS Solo-1 reset failed\n");
- __next:
+__next:
snd_es1938_write_cmd(chip, ESS_CMD_ENABLEEXT);
/* Demand transfer DMA: 4 bytes per DMA request */
@@ -426,7 +426,7 @@ static void snd_es1938_reset(struct es1938 *chip)
/* Change behaviour of register A1
4x oversampling
- 2nd channel DAC asynchronous */
+ 2nd channel DAC asynchronous */
snd_es1938_mixer_write(chip, ESSSB_IREG_AUDIO2MODE, 0x32);
/* enable/select DMA channel and IRQ channel */
snd_es1938_bits(chip, ESS_CMD_IRQCONTROL, 0xf0, 0x50);
@@ -469,7 +469,7 @@ static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = {
};
-static void snd_es1938_rate_set(struct es1938 *chip,
+static void snd_es1938_rate_set(struct es1938 *chip,
struct snd_pcm_substream *substream,
int mode)
{
@@ -482,7 +482,7 @@ static void snd_es1938_rate_set(struct es1938 *chip,
/* set filter register */
div0 = 256 - 7160000*20/(8*82*runtime->rate);
-
+
if (mode == DAC2) {
snd_es1938_mixer_write(chip, 0x70, bits);
snd_es1938_mixer_write(chip, 0x72, div0);
@@ -650,7 +650,7 @@ static int snd_es1938_capture_prepare(struct snd_pcm_substream *substream)
chip->dma1_shift = 2 - mono - is8;
snd_es1938_reset_fifo(chip);
-
+
/* program type */
snd_es1938_bits(chip, ESS_CMD_ANALOGCONTROL, 0x03, (mono ? 2 : 1));
@@ -663,12 +663,12 @@ static int snd_es1938_capture_prepare(struct snd_pcm_substream *substream)
/* initialize and configure ADC */
snd_es1938_write(chip, ESS_CMD_SETFORMAT2, u ? 0x51 : 0x71);
- snd_es1938_write(chip, ESS_CMD_SETFORMAT2, 0x90 |
- (u ? 0x00 : 0x20) |
- (is8 ? 0x00 : 0x04) |
+ snd_es1938_write(chip, ESS_CMD_SETFORMAT2, 0x90 |
+ (u ? 0x00 : 0x20) |
+ (is8 ? 0x00 : 0x04) |
(mono ? 0x40 : 0x08));
- // snd_es1938_reset_fifo(chip);
+ /* snd_es1938_reset_fifo(chip); */
/* 11. configure system interrupt controller and DMA controller */
snd_es1938_capture_setdma(chip);
@@ -713,7 +713,7 @@ static int snd_es1938_playback1_prepare(struct snd_pcm_substream *substream)
/* program DMA */
snd_es1938_playback1_setdma(chip);
-
+
return 0;
}
@@ -735,10 +735,10 @@ static int snd_es1938_playback2_prepare(struct snd_pcm_substream *substream)
chip->dma1_shift = 2 - mono - is8;
count = 0x10000 - count;
-
+
/* reset */
snd_es1938_reset_fifo(chip);
-
+
snd_es1938_bits(chip, ESS_CMD_ANALOGCONTROL, 0x03, (mono ? 2 : 1));
/* set clock and counters */
@@ -749,13 +749,13 @@ static int snd_es1938_playback2_prepare(struct snd_pcm_substream *substream)
/* initialized and configure DAC */
snd_es1938_write(chip, ESS_CMD_SETFORMAT, u ? 0x80 : 0x00);
snd_es1938_write(chip, ESS_CMD_SETFORMAT, u ? 0x51 : 0x71);
- snd_es1938_write(chip, ESS_CMD_SETFORMAT2,
+ snd_es1938_write(chip, ESS_CMD_SETFORMAT2,
0x90 | (mono ? 0x40 : 0x08) |
(is8 ? 0x00 : 0x04) | (u ? 0x00 : 0x20));
/* program DMA */
snd_es1938_playback2_setdma(chip);
-
+
return 0;
}
@@ -1036,7 +1036,7 @@ static int __devinit snd_es1938_new_pcm(struct es1938 *chip, int device)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_es1938_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1938_capture_ops);
-
+
pcm->private_data = chip;
pcm->info_flags = 0;
strcpy(pcm->name, "ESS Solo-1");
@@ -1049,7 +1049,7 @@ static int __devinit snd_es1938_new_pcm(struct es1938 *chip, int device)
}
/* -------------------------------------------------------------------
- *
+ *
* *** Mixer part ***
*/
@@ -1083,7 +1083,7 @@ static int snd_es1938_put_mux(struct snd_kcontrol *kcontrol,
{
struct es1938 *chip = snd_kcontrol_chip(kcontrol);
unsigned char val = ucontrol->value.enumerated.item[0];
-
+
if (val > 7)
return -EINVAL;
return snd_es1938_mixer_bits(chip, 0x1c, 0x07, val) != val;
@@ -1207,7 +1207,7 @@ static int snd_es1938_get_single(struct snd_kcontrol *kcontrol,
int mask = (kcontrol->private_value >> 16) & 0xff;
int invert = (kcontrol->private_value >> 24) & 0xff;
int val;
-
+
val = snd_es1938_reg_read(chip, reg);
ucontrol->value.integer.value[0] = (val >> shift) & mask;
if (invert)
@@ -1224,7 +1224,7 @@ static int snd_es1938_put_single(struct snd_kcontrol *kcontrol,
int mask = (kcontrol->private_value >> 16) & 0xff;
int invert = (kcontrol->private_value >> 24) & 0xff;
unsigned char val;
-
+
val = (ucontrol->value.integer.value[0] & mask);
if (invert)
val = mask - val;
@@ -1270,7 +1270,7 @@ static int snd_es1938_get_double(struct snd_kcontrol *kcontrol,
int mask = (kcontrol->private_value >> 24) & 0xff;
int invert = (kcontrol->private_value >> 22) & 1;
unsigned char left, right;
-
+
left = snd_es1938_reg_read(chip, left_reg);
if (left_reg != right_reg)
right = snd_es1938_reg_read(chip, right_reg);
@@ -1297,7 +1297,7 @@ static int snd_es1938_put_double(struct snd_kcontrol *kcontrol,
int invert = (kcontrol->private_value >> 22) & 1;
int change;
unsigned char val1, val2, mask1, mask2;
-
+
val1 = ucontrol->value.integer.value[0] & mask;
val2 = ucontrol->value.integer.value[1] & mask;
if (invert) {
@@ -1315,7 +1315,7 @@ static int snd_es1938_put_double(struct snd_kcontrol *kcontrol,
if (snd_es1938_reg_bits(chip, right_reg, mask2, val2) != val2)
change = 1;
} else {
- change = (snd_es1938_reg_bits(chip, left_reg, mask1 | mask2,
+ change = (snd_es1938_reg_bits(chip, left_reg, mask1 | mask2,
val1 | val2) != (val1 | val2));
}
return change;
@@ -1675,7 +1675,7 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
#if 0
printk("Es1938debug - interrupt status: =0x%x\n", status);
#endif
-
+
/* AUDIO 1 */
if (status & 0x10) {
#if 0
@@ -1695,7 +1695,7 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
else if (chip->active & DAC1)
snd_pcm_period_elapsed(chip->playback2_substream);
}
-
+
/* AUDIO 2 */
if (status & 0x20) {
#if 0
@@ -1731,10 +1731,10 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
/* MPU401 */
if (status & 0x80) {
- // the following line is evil! It switches off MIDI interrupt handling after the first interrupt received.
- // replacing the last 0 by 0x40 works for ESS-Solo1, but just doing nothing works as well!
- // andreas(a)flying-snail.de
- // snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); /* ack? */
+ /* the following line is evil! It switches off MIDI interrupt handling after the first interrupt received. */
+ /* replacing the last 0 by 0x40 works for ESS-Solo1, but just doing nothing works as well! */
+ /* andreas(a)flying-snail.de */
+ /* snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); ack? */
if (chip->rmidi) {
handled = 1;
snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data);
@@ -1781,7 +1781,7 @@ static int __devinit snd_es1938_mixer(struct es1938 *chip)
}
return 0;
}
-
+
static int __devinit snd_es1938_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
@@ -1851,8 +1851,8 @@ static int __devinit snd_es1938_probe(struct pci_dev *pci,
chip->irq, 0, &chip->rmidi) < 0) {
printk(KERN_ERR "es1938: unable to initialize MPU-401\n");
} else {
- // this line is vital for MIDI interrupt handling on ess-solo1
- // andreas(a)flying-snail.de
+ /* this line is vital for MIDI interrupt handling on ess-solo1 */
+ /* andreas(a)flying-snail.de */
snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0x40);
}
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 20ee759..46c383f 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2,7 +2,7 @@
* Driver for ESS Maestro 1/2/2E Sound Card (started 21.8.99)
* Copyright (c) by Matze Braun <MatzeBraun(a)gmx.de>.
* Takashi Iwai <tiwai(a)suse.de>
- *
+ *
* Most of the driver code comes from Zach Brown(zab(a)redhat.com)
* Alan Cox OSS Driver
* Rewritted from card-es1938.c source.
@@ -29,7 +29,7 @@
*
* Hardware Description
*
- * A working Maestro setup contains the Maestro chip wired to a
+ * A working Maestro setup contains the Maestro chip wired to a
* codec or 2. In the Maestro we have the APUs, the ASSP, and the
* Wavecache. The APUs can be though of as virtual audio routing
* channels. They can take data from a number of sources and perform
@@ -38,7 +38,7 @@
* APUs. The ASSP is a wacky DSP like device that ESS is loth
* to release docs on. Thankfully it isn't required on the Maestro
* until you start doing insane things like FM emulation and surround
- * encoding. The codecs are almost always AC-97 compliant codecs,
+ * encoding. The codecs are almost always AC-97 compliant codecs,
* but it appears that early Maestros may have had PT101 (an ESS
* part?) wired to them. The only real difference in the Maestro
* families is external goop like docking capability, memory for
@@ -76,7 +76,7 @@
* on open time. The sonicvibes OSS routines we inherited really want
* power of 2 buffers, so we have all those next to each other, then
* 512 byte regions for the recording wavecaches. This ends up
- * wasting quite a bit of memory. The only fixes I can see would be
+ * wasting quite a bit of memory. The only fixes I can see would be
* getting a kernel allocator that could work in zones, or figuring out
* just how to coerce the WP into doing what we want.
*
@@ -86,7 +86,7 @@
* like the APU interface that is indirect registers gotten at through
* the main maestro indirection. Ouch. We spinlock around the actual
* ports on a per card basis. This means spinlock activity at each IO
- * operation, but the only IO operation clusters are in non critical
+ * operation, but the only IO operation clusters are in non critical
* paths and it makes the code far easier to follow. Interrupts are
* blocked while holding the locks because the int handler has to
* get at some of them :(. The mixer interface doesn't, however.
@@ -94,7 +94,7 @@
* places.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -896,7 +896,7 @@ snd_es1968_calc_bob_rate(struct es1968 *chip, struct esschan *es,
static u32 snd_es1968_compute_rate(struct es1968 *chip, u32 freq)
{
u32 rate = (freq << 16) / chip->clock;
-#if 0 /* XXX: do we need this? */
+#if 0 /* XXX: do we need this? */
if (rate > 0x10000)
rate = 0x10000;
#endif
@@ -971,7 +971,7 @@ static void snd_es1968_program_wavecache(struct es1968 *chip, struct esschan *es
{
u32 tmpval = (addr - 0x10) & 0xFFF8;
- if (! capture) {
+ if (!capture) {
if (!(es->fmt & ESS_FMT_16BIT))
tmpval |= 4; /* 8bit */
if (es->fmt & ESS_FMT_STEREO)
@@ -1059,7 +1059,7 @@ static void snd_es1968_playback_setup(struct es1968 *chip, struct esschan *es,
and not the APU Regs 4-5. */
apu_set_register(chip, apu, 10,
0x8F00 | (channel ? 0 : 0x10));
- es->apu_mode[channel] += 1; /* stereo */
+ es->apu_mode[channel]++; /* stereo */
} else
apu_set_register(chip, apu, 10, 0x8F08);
}
@@ -1255,7 +1255,7 @@ static int snd_es1968_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (! es->running)
+ if (!es->running)
break;
snd_es1968_pcm_stop(chip, es);
es->running = 0;
@@ -1273,7 +1273,7 @@ static snd_pcm_uframes_t snd_es1968_pcm_pointer(struct snd_pcm_substream *substr
unsigned int ptr;
ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift;
-
+
return bytes_to_frames(substream->runtime, ptr % es->dma_size);
}
@@ -1407,7 +1407,7 @@ static void snd_es1968_free_dmabuf(struct es1968 *chip)
{
struct list_head *p;
- if (! chip->dma.area)
+ if (!chip->dma.area)
return;
snd_dma_reserve_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci));
while ((p = chip->buf_list.next) != &chip->buf_list) {
@@ -1425,11 +1425,11 @@ snd_es1968_init_dmabuf(struct es1968 *chip)
chip->dma.dev.type = SNDRV_DMA_TYPE_DEV;
chip->dma.dev.dev = snd_dma_pci_data(chip->pci);
- if (! snd_dma_get_reserved_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci))) {
+ if (!snd_dma_get_reserved_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci))) {
err = snd_dma_alloc_pages_fallback(SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci),
chip->total_bufsize, &chip->dma);
- if (err < 0 || ! chip->dma.area) {
+ if (err < 0 || !chip->dma.area) {
snd_printk(KERN_ERR "es1968: can't allocate dma pages for size %d\n",
chip->total_bufsize);
return -ENOMEM;
@@ -1478,7 +1478,7 @@ static int snd_es1968_hw_params(struct snd_pcm_substream *substream,
}
chan->memory = snd_es1968_new_memory(chip, size);
if (chan->memory == NULL) {
- // snd_printd("cannot allocate dma buffer: size = %d\n", size);
+ /* snd_printd("cannot allocate dma buffer: size = %d\n", size); */
return -ENOMEM;
}
snd_pcm_set_runtime_buffer(substream, &chan->memory->buf);
@@ -1491,7 +1491,7 @@ static int snd_es1968_hw_free(struct snd_pcm_substream *substream)
struct es1968 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct esschan *chan;
-
+
if (runtime->private_data == NULL)
return 0;
chan = runtime->private_data;
@@ -1586,7 +1586,7 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
snd_es1968_free_apu_pair(chip, apu1);
return apu2;
}
-
+
es = kzalloc(sizeof(*es), GFP_KERNEL);
if (!es) {
snd_es1968_free_apu_pair(chip, apu1);
@@ -1854,7 +1854,7 @@ static void snd_es1968_update_pcm(struct es1968 *chip, struct esschan *es)
unsigned int hwptr;
unsigned int diff;
struct snd_pcm_substream *subs = es->substream;
-
+
if (subs == NULL || !es->running)
return;
@@ -1895,7 +1895,7 @@ static void es1968_update_hw_volume(unsigned long private_data)
if (chip->in_suspend)
return;
- if (! chip->master_switch || ! chip->master_volume)
+ if (!chip->master_switch || ! chip->master_volume)
return;
/* FIXME: we can't call snd_ac97_* functions since here is in tasklet. */
@@ -2038,7 +2038,7 @@ static void snd_es1968_ac97_reset(struct es1968 *chip)
/* save configuration */
save_ringbus_a = inw(ioaddr + 0x36);
- //outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38); /* clear second codec id? */
+ /* outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38); clear second codec id? */
/* set command/status address i/o to 1st codec */
outw(inw(ioaddr + 0x3a) & 0xfffc, ioaddr + 0x3a);
outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c);
@@ -2072,7 +2072,7 @@ static void snd_es1968_ac97_reset(struct es1968 *chip)
udelay(20);
outw(0x0009, ioaddr + 0x60); /* write 9 to gpio */
msleep(500);
- //outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38);
+ /* outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38); */
outw(inw(ioaddr + 0x3a) & 0xfffc, ioaddr + 0x3a);
outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c);
@@ -2154,15 +2154,15 @@ static void snd_es1968_chip_init(struct es1968 *chip)
/* We used to muck around with pci config space that
* we had no business messing with. We don't know enough
- * about the machine to know which DMA mode is appropriate,
+ * about the machine to know which DMA mode is appropriate,
* etc. We were guessing wrong on some machines and making
* them unhappy. We now trust in the BIOS to do things right,
* which almost certainly means a new host of problems will
- * arise with broken BIOS implementations. screw 'em.
+ * arise with broken BIOS implementations. screw 'em.
* We're already intolerant of machines that don't assign
* IRQs.
*/
-
+
/* Config Reg A */
pci_read_config_word(pci, ESM_CONFIG_A, &w);
@@ -2172,7 +2172,7 @@ static void snd_es1968_chip_init(struct es1968 *chip)
w |= POST_WRITE; /* Posted write */
w |= PCI_TIMING; /* PCI timing on */
/* XXX huh? claims to be reserved.. */
- w &= ~SWAP_LR; /* swap left/right
+ w &= ~SWAP_LR; /* swap left/right
seems to only have effect on SB
Emulation */
w &= ~SUBTR_DECODE; /* Subtractive decode off */
@@ -2223,7 +2223,7 @@ static void snd_es1968_chip_init(struct es1968 *chip)
w|=1<<3; /* Turn on 978 hardware volume control. */
w&=~(1<<11); /* Turn on 978 mixer volume control. */
pci_write_config_word(pci, 0x58, w);
-
+
/* Sound Reset */
snd_es1968_reset(chip);
@@ -2241,14 +2241,14 @@ static void snd_es1968_chip_init(struct es1968 *chip)
/*
* Reset the CODEC
*/
-
+
snd_es1968_ac97_reset(chip);
/* Ring Bus Control B */
n = inl(iobase + ESM_RING_BUS_CONTR_B);
n &= ~RINGB_EN_SPDIF; /* SPDIF off */
- //w |= RINGB_EN_2CODEC; /* enable 2nd codec */
+ /* w |= RINGB_EN_2CODEC; enable 2nd codec */
outl(n, iobase + ESM_RING_BUS_CONTR_B);
/* Set hardware volume control registers to midpoints.
@@ -2306,7 +2306,7 @@ static void snd_es1968_chip_init(struct es1968 *chip)
maestro_write(chip, 0x0D, 0x7632);
- /* Wave cache control on - test off, sg off,
+ /* Wave cache control on - test off, sg off,
enable, enable extra chans 1Mb */
w = inw(iobase + WC_CONTROL);
@@ -2353,7 +2353,7 @@ static int es1968_suspend(struct pci_dev *pci, pm_message_t state)
struct snd_card *card = pci_get_drvdata(pci);
struct es1968 *chip = card->private_data;
- if (! chip->do_pm)
+ if (!chip->do_pm)
return 0;
chip->in_suspend = 1;
@@ -2374,7 +2374,7 @@ static int es1968_resume(struct pci_dev *pci)
struct es1968 *chip = card->private_data;
struct esschan *es;
- if (! chip->do_pm)
+ if (!chip->do_pm)
return 0;
/* restore all our config */
@@ -2390,7 +2390,7 @@ static int es1968_resume(struct pci_dev *pci)
snd_es1968_chip_init(chip);
- /* need to restore the base pointers.. */
+ /* need to restore the base pointers.. */
if (chip->dma.addr) {
/* set PCMBAR */
wave_set_register(chip, 0x01FC, chip->dma.addr >> 12);
@@ -2547,7 +2547,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
}
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (! chip) {
+ if (!chip) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -2581,7 +2581,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
return -EBUSY;
}
chip->irq = pci->irq;
-
+
/* Clear Maestro_map */
for (i = 0; i < 32; i++)
chip->maestro_map[i] = 0;
@@ -2648,14 +2648,14 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (!card)
return -ENOMEM;
-
+
if (total_bufsize[dev] < 128)
total_bufsize[dev] = 128;
if (total_bufsize[dev] > 4096)
total_bufsize[dev] = 4096;
if ((err = snd_es1968_create(card, pci,
total_bufsize[dev] * 1024, /* in bytes */
- pcm_substreams_p[dev],
+ pcm_substreams_p[dev],
pcm_substreams_c[dev],
pci_id->driver_data,
use_pm[dev],
@@ -2716,7 +2716,7 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
snd_es1968_start_irq(chip);
chip->clock = clock[dev];
- if (! chip->clock)
+ if (!chip->clock)
es1968_measure_clock(chip);
sprintf(card->longname, "%s at 0x%lx, irq %i",
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ymfpci/ymfpci_main.c | 98 ++++++++++++++++++++--------------------
1 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 90d0d62..baf64b9 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -36,7 +36,7 @@
#include <sound/asoundef.h>
#include <sound/mpu401.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/byteorder.h>
/*
@@ -79,7 +79,7 @@ static int snd_ymfpci_codec_ready(struct snd_ymfpci *chip, int secondary)
{
unsigned long end_time;
u32 reg = secondary ? YDSXGR_SECSTATUSADR : YDSXGR_PRISTATUSADR;
-
+
end_time = jiffies + msecs_to_jiffies(750);
do {
if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0)
@@ -94,7 +94,7 @@ static void snd_ymfpci_codec_write(struct snd_ac97 *ac97, u16 reg, u16 val)
{
struct snd_ymfpci *chip = ac97->private_data;
u32 cmd;
-
+
snd_ymfpci_codec_ready(chip, 0);
cmd = ((YDSXG_AC97WRITECMD | reg) << 16) | val;
snd_ymfpci_writel(chip, YDSXGR_AC97CMDDATA, cmd);
@@ -145,7 +145,7 @@ static u32 snd_ymfpci_calc_lpfK(u32 rate)
0x00570000, 0x06AA0000, 0x18B20000, 0x20930000,
0x2B9A0000, 0x35A10000, 0x3EAA0000, 0x40000000
};
-
+
if (rate == 44100)
return 0x40000000; /* FIXME: What's the right value? */
for (i = 0; i < 8; i++)
@@ -161,7 +161,7 @@ static u32 snd_ymfpci_calc_lpfQ(u32 rate)
0x35280000, 0x34A70000, 0x32020000, 0x31770000,
0x31390000, 0x31C90000, 0x33D00000, 0x40000000
};
-
+
if (rate == 44100)
return 0x370A0000;
for (i = 0; i < 8; i++)
@@ -184,7 +184,7 @@ static void snd_ymfpci_hw_start(struct snd_ymfpci *chip)
snd_ymfpci_writel(chip, YDSXGR_MODE,
snd_ymfpci_readl(chip, YDSXGR_MODE) | 3);
chip->active_bank = snd_ymfpci_readl(chip, YDSXGR_CTRLSELECT) & 1;
- __end:
+__end:
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
@@ -206,7 +206,7 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip)
atomic_set(&chip->interrupt_sleep_count, 0);
wake_up(&chip->interrupt_sleep);
}
- __end:
+__end:
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
@@ -220,7 +220,7 @@ static int voice_alloc(struct snd_ymfpci *chip,
{
struct snd_ymfpci_voice *voice, *voice2;
int idx;
-
+
*rvoice = NULL;
for (idx = 0; idx < YDSXG_PLAYBACK_VOICES; idx += pair ? 2 : 1) {
voice = &chip->voices[idx];
@@ -258,12 +258,12 @@ static int snd_ymfpci_voice_alloc(struct snd_ymfpci *chip,
{
unsigned long flags;
int result;
-
+
if (snd_BUG_ON(!rvoice))
return -EINVAL;
if (snd_BUG_ON(pair && type != YMFPCI_PCM))
return -EINVAL;
-
+
spin_lock_irqsave(&chip->voice_lock, flags);
for (;;) {
result = voice_alloc(chip, type, pair, rvoice);
@@ -272,14 +272,14 @@ static int snd_ymfpci_voice_alloc(struct snd_ymfpci *chip,
/* TODO: synth/midi voice deallocation */
break;
}
- spin_unlock_irqrestore(&chip->voice_lock, flags);
- return result;
+ spin_unlock_irqrestore(&chip->voice_lock, flags);
+ return result;
}
static int snd_ymfpci_voice_free(struct snd_ymfpci *chip, struct snd_ymfpci_voice *pvoice)
{
unsigned long flags;
-
+
if (snd_BUG_ON(!pvoice))
return -EINVAL;
snd_ymfpci_hw_stop(chip);
@@ -303,7 +303,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
{
struct snd_ymfpci_pcm *ypcm;
u32 pos, delta;
-
+
if ((ypcm = voice->ypcm) == NULL)
return;
if (ypcm->substream == NULL)
@@ -318,7 +318,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
ypcm->period_pos += delta;
ypcm->last_pos = pos;
if (ypcm->period_pos >= ypcm->period_size) {
- // printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start);
+ /* printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start); */
ypcm->period_pos %= ypcm->period_size;
spin_unlock(&chip->reg_lock);
snd_pcm_period_elapsed(ypcm->substream);
@@ -330,7 +330,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
unsigned int next_bank = 1 - chip->active_bank;
struct snd_ymfpci_playback_bank *bank;
u32 volume;
-
+
bank = &voice->bank[next_bank];
volume = cpu_to_le32(chip->pcm_mixer[subs].left << 15);
bank->left_gain_end = volume;
@@ -354,7 +354,7 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream
struct snd_ymfpci_pcm *ypcm = runtime->private_data;
struct snd_ymfpci *chip = ypcm->chip;
u32 pos, delta;
-
+
spin_lock(&chip->reg_lock);
if (ypcm->running) {
pos = le32_to_cpu(chip->bank_capture[ypcm->capture_bank_number][chip->active_bank]->start) >> ypcm->shift;
@@ -366,7 +366,7 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream
ypcm->last_pos = pos;
if (ypcm->period_pos >= ypcm->period_size) {
ypcm->period_pos %= ypcm->period_size;
- // printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start);
+ /* printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start); */
spin_unlock(&chip->reg_lock);
snd_pcm_period_elapsed(substream);
spin_lock(&chip->reg_lock);
@@ -414,7 +414,7 @@ static int snd_ymfpci_playback_trigger(struct snd_pcm_substream *substream,
result = -EINVAL;
break;
}
- __unlock:
+__unlock:
spin_unlock(&chip->reg_lock);
if (kctl)
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_INFO, &kctl->id);
@@ -468,7 +468,7 @@ static int snd_ymfpci_pcm_voice_alloc(struct snd_ymfpci_pcm *ypcm, int voices)
if (ypcm->voices[0] != NULL && ypcm->voices[1] == NULL) {
snd_ymfpci_voice_free(ypcm->chip, ypcm->voices[0]);
ypcm->voices[0] = NULL;
- }
+ }
}
err = snd_ymfpci_voice_alloc(ypcm->chip, YMFPCI_PCM, voices > 1, &ypcm->voices[0]);
if (err < 0)
@@ -615,7 +615,7 @@ static int snd_ymfpci_ac3_done(struct snd_ymfpci *chip)
snd_ymfpci_writel(chip, YDSXGR_MAPOFEFFECT,
snd_ymfpci_readl(chip, YDSXGR_MAPOFEFFECT) & ~(3 << 3));
spin_unlock_irq(&chip->reg_lock);
- // snd_ymfpci_irq_wait(chip);
+ /* snd_ymfpci_irq_wait(chip); */
if (chip->ac3_tmp_base.area) {
snd_dma_free_pages(&chip->ac3_tmp_base);
chip->ac3_tmp_base.area = NULL;
@@ -642,7 +642,7 @@ static int snd_ymfpci_playback_hw_free(struct snd_pcm_substream *substream)
struct snd_ymfpci *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
-
+
if (runtime->private_data == NULL)
return 0;
ypcm = runtime->private_data;
@@ -836,7 +836,7 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id)
static struct snd_pcm_hardware snd_ymfpci_playback =
{
.info = (SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_PAUSE |
@@ -905,8 +905,8 @@ static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream)
/* call with spinlock held */
static void ymfpci_open_extension(struct snd_ymfpci *chip)
{
- if (! chip->rear_opened) {
- if (! chip->spdif_opened) /* set AC3 */
+ if (!chip->rear_opened) {
+ if (!chip->spdif_opened) /* set AC3 */
snd_ymfpci_writel(chip, YDSXGR_MODE,
snd_ymfpci_readl(chip, YDSXGR_MODE) | (1 << 30));
/* enable second codec (4CHEN) */
@@ -918,8 +918,8 @@ static void ymfpci_open_extension(struct snd_ymfpci *chip)
/* call with spinlock held */
static void ymfpci_close_extension(struct snd_ymfpci *chip)
{
- if (! chip->rear_opened) {
- if (! chip->spdif_opened)
+ if (!chip->rear_opened) {
+ if (!chip->spdif_opened)
snd_ymfpci_writel(chip, YDSXGR_MODE,
snd_ymfpci_readl(chip, YDSXGR_MODE) & ~(1 << 30));
snd_ymfpci_writew(chip, YDSXGR_SECCONFIG,
@@ -933,7 +933,7 @@ static int snd_ymfpci_playback_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
int err;
-
+
if ((err = snd_ymfpci_playback_open_1(substream)) < 0)
return err;
ypcm = runtime->private_data;
@@ -955,7 +955,7 @@ static int snd_ymfpci_playback_spdif_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
int err;
-
+
if ((err = snd_ymfpci_playback_open_1(substream)) < 0)
return err;
ypcm = runtime->private_data;
@@ -983,7 +983,7 @@ static int snd_ymfpci_playback_4ch_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
int err;
-
+
if ((err = snd_ymfpci_playback_open_1(substream)) < 0)
return err;
ypcm = runtime->private_data;
@@ -1009,7 +1009,7 @@ static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream,
return -ENOMEM;
ypcm->chip = chip;
ypcm->type = capture_bank_number + CAPTURE_REC;
- ypcm->substream = substream;
+ ypcm->substream = substream;
ypcm->capture_bank_number = capture_bank_number;
chip->capture_substream[capture_bank_number] = substream;
runtime->hw = snd_ymfpci_capture;
@@ -1449,7 +1449,7 @@ static int snd_ymfpci_get_single(struct snd_kcontrol *kcontrol,
int reg = kcontrol->private_value & 0xffff;
unsigned int shift = (kcontrol->private_value >> 16) & 0xff;
unsigned int mask = 1;
-
+
switch (reg) {
case YDSXGR_SPDIFOUTCTRL: break;
case YDSXGR_SPDIFINCTRL: break;
@@ -1469,7 +1469,7 @@ static int snd_ymfpci_put_single(struct snd_kcontrol *kcontrol,
unsigned int mask = 1;
int change;
unsigned int val, oval;
-
+
switch (reg) {
case YDSXGR_SPDIFOUTCTRL: break;
case YDSXGR_SPDIFINCTRL: break;
@@ -1515,7 +1515,7 @@ static int snd_ymfpci_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e
unsigned int reg = kcontrol->private_value;
unsigned int shift_left = 0, shift_right = 16, mask = 16383;
unsigned int val;
-
+
if (reg < 0x80 || reg >= 0xc0)
return -EINVAL;
spin_lock_irq(&chip->reg_lock);
@@ -1533,7 +1533,7 @@ static int snd_ymfpci_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e
unsigned int shift_left = 0, shift_right = 16, mask = 16383;
int change;
unsigned int val1, val2, oval;
-
+
if (reg < 0x80 || reg >= 0xc0)
return -EINVAL;
val1 = ucontrol->value.integer.value[0] & mask;
@@ -1557,7 +1557,7 @@ static int snd_ymfpci_put_nativedacvol(struct snd_kcontrol *kcontrol,
unsigned int reg2 = YDSXGR_BUF441OUTVOL;
int change;
unsigned int value, oval;
-
+
value = ucontrol->value.integer.value[0] & 0x3fff;
value |= (ucontrol->value.integer.value[1] & 0x3fff) << 16;
spin_lock_irq(&chip->reg_lock);
@@ -1937,12 +1937,12 @@ int __devinit snd_ymfpci_timer(struct snd_ymfpci *chip, int device)
* proc interface
*/
-static void snd_ymfpci_proc_read(struct snd_info_entry *entry,
+static void snd_ymfpci_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ymfpci *chip = entry->private_data;
int i;
-
+
snd_iprintf(buffer, "YMFPCI\n\n");
for (i = 0; i <= YDSXGR_WORKBASE; i += 4)
snd_iprintf(buffer, "%04x: %04x\n", i, snd_ymfpci_readl(chip, i));
@@ -1951,8 +1951,8 @@ static void snd_ymfpci_proc_read(struct snd_info_entry *entry,
static int __devinit snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip)
{
struct snd_info_entry *entry;
-
- if (! snd_card_proc_new(card, "ymfpci", &entry))
+
+ if (!snd_card_proc_new(card, "ymfpci", &entry))
snd_info_set_text_ops(entry, chip, snd_ymfpci_proc_read);
return 0;
}
@@ -1966,7 +1966,7 @@ static void snd_ymfpci_aclink_reset(struct pci_dev * pci)
u8 cmd;
pci_read_config_byte(pci, PCIR_DSXG_CTRL, &cmd);
-#if 0 // force to reset
+#if 0 /* force to reset */
if (cmd & 0x03) {
#endif
pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd & 0xfc);
@@ -2082,7 +2082,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
chip->bank_size_capture = snd_ymfpci_readl(chip, YDSXGR_RECCTRLSIZE) << 2;
chip->bank_size_effect = snd_ymfpci_readl(chip, YDSXGR_EFFCTRLSIZE) << 2;
chip->work_size = YDSXG_DEFAULT_WORK_SIZE;
-
+
size = ALIGN(playback_ctrl_size, 0x100) +
ALIGN(chip->bank_size_playback * 2 * YDSXG_PLAYBACK_VOICES, 0x100) +
ALIGN(chip->bank_size_capture * 2 * YDSXG_CAPTURE_VOICES, 0x100) +
@@ -2091,7 +2091,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
/* work_ptr must be aligned to 256 bytes, but it's already
covered with the kernel page allocation mechanism */
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
- size, &chip->work_ptr) < 0)
+ size, &chip->work_ptr) < 0)
return -ENOMEM;
ptr = chip->work_ptr.area;
ptr_addr = chip->work_ptr.addr;
@@ -2137,7 +2137,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
ptr_addr = ALIGN(ptr_addr, 0x100);
chip->work_base = ptr;
chip->work_base_addr = ptr_addr;
-
+
snd_BUG_ON(ptr + chip->work_size !=
chip->work_ptr.area + chip->work_ptr.bytes);
@@ -2166,7 +2166,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
snd_ymfpci_writel(chip, YDSXGR_NATIVEDACINVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_PRIADCLOOPVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0x3fff3fff);
-
+
return 0;
}
@@ -2214,11 +2214,11 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
iounmap(chip->reg_area_virt);
if (chip->work_ptr.area)
snd_dma_free_pages(&chip->work_ptr);
-
+
release_and_free_resource(chip->res_reg_area);
pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);
-
+
pci_disable_device(chip->pci);
release_firmware(chip->dsp_microcode);
release_firmware(chip->controller_microcode);
@@ -2267,7 +2267,7 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
struct snd_card *card = pci_get_drvdata(pci);
struct snd_ymfpci *chip = card->private_data;
unsigned int i;
-
+
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_pcm_suspend_all(chip->pcm2);
@@ -2333,7 +2333,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_ymfpci_dev_free,
};
-
+
*rchip = NULL;
/* enable PCI device */
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/vx222/vx222.c | 2 +-
sound/pci/vx222/vx222_ops.c | 330 +++++++++++++++++++++---------------------
2 files changed, 166 insertions(+), 166 deletions(-)
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index acc352f..ec7c743 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -154,7 +154,7 @@ static int __devinit snd_vx222_create(struct snd_card *card, struct pci_dev *pci
vx_ops = hw->type == VX_TYPE_BOARD ? &vx222_old_ops : &vx222_ops;
chip = snd_vx_create(card, hw, vx_ops,
sizeof(struct snd_vx222) - sizeof(struct vx_core));
- if (! chip) {
+ if (!chip) {
pci_disable_device(pci);
return -ENOMEM;
}
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index 7e87f39..7d1350a 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -28,7 +28,7 @@
#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "vx222.h"
@@ -50,12 +50,12 @@ static int vx2_reg_offset[VX_REG_MAX] = {
[VX_HIFREQ] = 0x38,
[VX_CSUER] = 0x3c,
[VX_SELMIC] = 0x40,
- [VX_COMPOT] = 0x44, // Write: POTENTIOMETER ; Read: COMPRESSION LEVEL activate
- [VX_SCOMPR] = 0x48, // Read: COMPRESSION THRESHOLD activate
- [VX_GLIMIT] = 0x4c, // Read: LEVEL LIMITATION activate
- [VX_INTCSR] = 0x4c, // VX_INTCSR_REGISTER_OFFSET
- [VX_CNTRL] = 0x50, // VX_CNTRL_REGISTER_OFFSET
- [VX_GPIOC] = 0x54, // VX_GPIOC (new with PLX9030)
+ [VX_COMPOT] = 0x44, /* Write: POTENTIOMETER; Read: COMPRESSION LEVEL activate */
+ [VX_SCOMPR] = 0x48, /* Read: COMPRESSION THRESHOLD activate */
+ [VX_GLIMIT] = 0x4c, /* Read: LEVEL LIMITATION activate */
+ [VX_INTCSR] = 0x4c, /* VX_INTCSR_REGISTER_OFFSET */
+ [VX_CNTRL] = 0x50, /* VX_CNTRL_REGISTER_OFFSET */
+ [VX_GPIOC] = 0x54, /* VX_GPIOC (new with PLX9030) */
};
static int vx2_reg_index[VX_REG_MAX] = {
@@ -107,7 +107,7 @@ static unsigned char vx2_inb(struct vx_core *chip, int offset)
static void vx2_outb(struct vx_core *chip, int offset, unsigned char val)
{
outb(val, vx2_reg_addr(chip, offset));
- //printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset));
+ /* printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset)); */
}
/**
@@ -126,7 +126,7 @@ static unsigned int vx2_inl(struct vx_core *chip, int offset)
*/
static void vx2_outl(struct vx_core *chip, int offset, unsigned int val)
{
- // printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset));
+ /* printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset)); */
outl(val, vx2_reg_addr(chip, offset));
}
@@ -187,7 +187,7 @@ static int vx2_test_xilinx(struct vx_core *_chip)
vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_TEST0_MASK);
vx_inl(chip, ISR);
data = vx_inl(chip, STATUS);
- if (! (data & VX_STATUS_VAL_TEST0_MASK)) {
+ if (!(data & VX_STATUS_VAL_TEST0_MASK)) {
snd_printdd("bad! #2\n");
return -ENODEV;
}
@@ -207,7 +207,7 @@ static int vx2_test_xilinx(struct vx_core *_chip)
vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_TEST1_MASK);
vx_inl(chip, ISR);
data = vx_inl(chip, STATUS);
- if (! (data & VX_STATUS_VAL_TEST1_MASK)) {
+ if (!(data & VX_STATUS_VAL_TEST1_MASK)) {
snd_printdd("bad! #4\n");
return -ENODEV;
}
@@ -400,7 +400,7 @@ static int vx2_load_xilinx_binary(struct vx_core *chip, const struct firmware *x
return 0;
}
-
+
/*
* load the boot/dsp images
*/
@@ -439,12 +439,12 @@ static int vx2_load_dsp(struct vx_core *vx, int index, const struct firmware *ds
static int vx2_test_and_ack(struct vx_core *chip)
{
/* not booted yet? */
- if (! (chip->chip_status & VX_STAT_XILINX_LOADED))
+ if (!(chip->chip_status & VX_STAT_XILINX_LOADED))
return -ENXIO;
- if (! (vx_inl(chip, STATUS) & VX_STATUS_MEMIRQ_MASK))
+ if (!(vx_inl(chip, STATUS) & VX_STATUS_MEMIRQ_MASK))
return -EIO;
-
+
/* ok, interrupts generated, now ack it */
/* set ACQUIT bit up and down */
vx_outl(chip, STATUS, 0);
@@ -512,154 +512,154 @@ static void vx2_write_codec_reg(struct vx_core *chip, unsigned int data)
#define AKM_CODEC_RIGHT_LEVEL_CMD 0xA500
static const u8 vx2_akm_gains_lut[VX2_AKM_LEVEL_MAX+1] = {
- 0x7f, // [000] = +0.000 dB -> AKM(0x7f) = +0.000 dB error(+0.000 dB)
- 0x7d, // [001] = -0.500 dB -> AKM(0x7d) = -0.572 dB error(-0.072 dB)
- 0x7c, // [002] = -1.000 dB -> AKM(0x7c) = -0.873 dB error(+0.127 dB)
- 0x7a, // [003] = -1.500 dB -> AKM(0x7a) = -1.508 dB error(-0.008 dB)
- 0x79, // [004] = -2.000 dB -> AKM(0x79) = -1.844 dB error(+0.156 dB)
- 0x77, // [005] = -2.500 dB -> AKM(0x77) = -2.557 dB error(-0.057 dB)
- 0x76, // [006] = -3.000 dB -> AKM(0x76) = -2.937 dB error(+0.063 dB)
- 0x75, // [007] = -3.500 dB -> AKM(0x75) = -3.334 dB error(+0.166 dB)
- 0x73, // [008] = -4.000 dB -> AKM(0x73) = -4.188 dB error(-0.188 dB)
- 0x72, // [009] = -4.500 dB -> AKM(0x72) = -4.648 dB error(-0.148 dB)
- 0x71, // [010] = -5.000 dB -> AKM(0x71) = -5.134 dB error(-0.134 dB)
- 0x70, // [011] = -5.500 dB -> AKM(0x70) = -5.649 dB error(-0.149 dB)
- 0x6f, // [012] = -6.000 dB -> AKM(0x6f) = -6.056 dB error(-0.056 dB)
- 0x6d, // [013] = -6.500 dB -> AKM(0x6d) = -6.631 dB error(-0.131 dB)
- 0x6c, // [014] = -7.000 dB -> AKM(0x6c) = -6.933 dB error(+0.067 dB)
- 0x6a, // [015] = -7.500 dB -> AKM(0x6a) = -7.571 dB error(-0.071 dB)
- 0x69, // [016] = -8.000 dB -> AKM(0x69) = -7.909 dB error(+0.091 dB)
- 0x67, // [017] = -8.500 dB -> AKM(0x67) = -8.626 dB error(-0.126 dB)
- 0x66, // [018] = -9.000 dB -> AKM(0x66) = -9.008 dB error(-0.008 dB)
- 0x65, // [019] = -9.500 dB -> AKM(0x65) = -9.407 dB error(+0.093 dB)
- 0x64, // [020] = -10.000 dB -> AKM(0x64) = -9.826 dB error(+0.174 dB)
- 0x62, // [021] = -10.500 dB -> AKM(0x62) = -10.730 dB error(-0.230 dB)
- 0x61, // [022] = -11.000 dB -> AKM(0x61) = -11.219 dB error(-0.219 dB)
- 0x60, // [023] = -11.500 dB -> AKM(0x60) = -11.738 dB error(-0.238 dB)
- 0x5f, // [024] = -12.000 dB -> AKM(0x5f) = -12.149 dB error(-0.149 dB)
- 0x5e, // [025] = -12.500 dB -> AKM(0x5e) = -12.434 dB error(+0.066 dB)
- 0x5c, // [026] = -13.000 dB -> AKM(0x5c) = -13.033 dB error(-0.033 dB)
- 0x5b, // [027] = -13.500 dB -> AKM(0x5b) = -13.350 dB error(+0.150 dB)
- 0x59, // [028] = -14.000 dB -> AKM(0x59) = -14.018 dB error(-0.018 dB)
- 0x58, // [029] = -14.500 dB -> AKM(0x58) = -14.373 dB error(+0.127 dB)
- 0x56, // [030] = -15.000 dB -> AKM(0x56) = -15.130 dB error(-0.130 dB)
- 0x55, // [031] = -15.500 dB -> AKM(0x55) = -15.534 dB error(-0.034 dB)
- 0x54, // [032] = -16.000 dB -> AKM(0x54) = -15.958 dB error(+0.042 dB)
- 0x53, // [033] = -16.500 dB -> AKM(0x53) = -16.404 dB error(+0.096 dB)
- 0x52, // [034] = -17.000 dB -> AKM(0x52) = -16.874 dB error(+0.126 dB)
- 0x51, // [035] = -17.500 dB -> AKM(0x51) = -17.371 dB error(+0.129 dB)
- 0x50, // [036] = -18.000 dB -> AKM(0x50) = -17.898 dB error(+0.102 dB)
- 0x4e, // [037] = -18.500 dB -> AKM(0x4e) = -18.605 dB error(-0.105 dB)
- 0x4d, // [038] = -19.000 dB -> AKM(0x4d) = -18.905 dB error(+0.095 dB)
- 0x4b, // [039] = -19.500 dB -> AKM(0x4b) = -19.538 dB error(-0.038 dB)
- 0x4a, // [040] = -20.000 dB -> AKM(0x4a) = -19.872 dB error(+0.128 dB)
- 0x48, // [041] = -20.500 dB -> AKM(0x48) = -20.583 dB error(-0.083 dB)
- 0x47, // [042] = -21.000 dB -> AKM(0x47) = -20.961 dB error(+0.039 dB)
- 0x46, // [043] = -21.500 dB -> AKM(0x46) = -21.356 dB error(+0.144 dB)
- 0x44, // [044] = -22.000 dB -> AKM(0x44) = -22.206 dB error(-0.206 dB)
- 0x43, // [045] = -22.500 dB -> AKM(0x43) = -22.664 dB error(-0.164 dB)
- 0x42, // [046] = -23.000 dB -> AKM(0x42) = -23.147 dB error(-0.147 dB)
- 0x41, // [047] = -23.500 dB -> AKM(0x41) = -23.659 dB error(-0.159 dB)
- 0x40, // [048] = -24.000 dB -> AKM(0x40) = -24.203 dB error(-0.203 dB)
- 0x3f, // [049] = -24.500 dB -> AKM(0x3f) = -24.635 dB error(-0.135 dB)
- 0x3e, // [050] = -25.000 dB -> AKM(0x3e) = -24.935 dB error(+0.065 dB)
- 0x3c, // [051] = -25.500 dB -> AKM(0x3c) = -25.569 dB error(-0.069 dB)
- 0x3b, // [052] = -26.000 dB -> AKM(0x3b) = -25.904 dB error(+0.096 dB)
- 0x39, // [053] = -26.500 dB -> AKM(0x39) = -26.615 dB error(-0.115 dB)
- 0x38, // [054] = -27.000 dB -> AKM(0x38) = -26.994 dB error(+0.006 dB)
- 0x37, // [055] = -27.500 dB -> AKM(0x37) = -27.390 dB error(+0.110 dB)
- 0x36, // [056] = -28.000 dB -> AKM(0x36) = -27.804 dB error(+0.196 dB)
- 0x34, // [057] = -28.500 dB -> AKM(0x34) = -28.699 dB error(-0.199 dB)
- 0x33, // [058] = -29.000 dB -> AKM(0x33) = -29.183 dB error(-0.183 dB)
- 0x32, // [059] = -29.500 dB -> AKM(0x32) = -29.696 dB error(-0.196 dB)
- 0x31, // [060] = -30.000 dB -> AKM(0x31) = -30.241 dB error(-0.241 dB)
- 0x31, // [061] = -30.500 dB -> AKM(0x31) = -30.241 dB error(+0.259 dB)
- 0x30, // [062] = -31.000 dB -> AKM(0x30) = -30.823 dB error(+0.177 dB)
- 0x2e, // [063] = -31.500 dB -> AKM(0x2e) = -31.610 dB error(-0.110 dB)
- 0x2d, // [064] = -32.000 dB -> AKM(0x2d) = -31.945 dB error(+0.055 dB)
- 0x2b, // [065] = -32.500 dB -> AKM(0x2b) = -32.659 dB error(-0.159 dB)
- 0x2a, // [066] = -33.000 dB -> AKM(0x2a) = -33.038 dB error(-0.038 dB)
- 0x29, // [067] = -33.500 dB -> AKM(0x29) = -33.435 dB error(+0.065 dB)
- 0x28, // [068] = -34.000 dB -> AKM(0x28) = -33.852 dB error(+0.148 dB)
- 0x27, // [069] = -34.500 dB -> AKM(0x27) = -34.289 dB error(+0.211 dB)
- 0x25, // [070] = -35.000 dB -> AKM(0x25) = -35.235 dB error(-0.235 dB)
- 0x24, // [071] = -35.500 dB -> AKM(0x24) = -35.750 dB error(-0.250 dB)
- 0x24, // [072] = -36.000 dB -> AKM(0x24) = -35.750 dB error(+0.250 dB)
- 0x23, // [073] = -36.500 dB -> AKM(0x23) = -36.297 dB error(+0.203 dB)
- 0x22, // [074] = -37.000 dB -> AKM(0x22) = -36.881 dB error(+0.119 dB)
- 0x21, // [075] = -37.500 dB -> AKM(0x21) = -37.508 dB error(-0.008 dB)
- 0x20, // [076] = -38.000 dB -> AKM(0x20) = -38.183 dB error(-0.183 dB)
- 0x1f, // [077] = -38.500 dB -> AKM(0x1f) = -38.726 dB error(-0.226 dB)
- 0x1e, // [078] = -39.000 dB -> AKM(0x1e) = -39.108 dB error(-0.108 dB)
- 0x1d, // [079] = -39.500 dB -> AKM(0x1d) = -39.507 dB error(-0.007 dB)
- 0x1c, // [080] = -40.000 dB -> AKM(0x1c) = -39.926 dB error(+0.074 dB)
- 0x1b, // [081] = -40.500 dB -> AKM(0x1b) = -40.366 dB error(+0.134 dB)
- 0x1a, // [082] = -41.000 dB -> AKM(0x1a) = -40.829 dB error(+0.171 dB)
- 0x19, // [083] = -41.500 dB -> AKM(0x19) = -41.318 dB error(+0.182 dB)
- 0x18, // [084] = -42.000 dB -> AKM(0x18) = -41.837 dB error(+0.163 dB)
- 0x17, // [085] = -42.500 dB -> AKM(0x17) = -42.389 dB error(+0.111 dB)
- 0x16, // [086] = -43.000 dB -> AKM(0x16) = -42.978 dB error(+0.022 dB)
- 0x15, // [087] = -43.500 dB -> AKM(0x15) = -43.610 dB error(-0.110 dB)
- 0x14, // [088] = -44.000 dB -> AKM(0x14) = -44.291 dB error(-0.291 dB)
- 0x14, // [089] = -44.500 dB -> AKM(0x14) = -44.291 dB error(+0.209 dB)
- 0x13, // [090] = -45.000 dB -> AKM(0x13) = -45.031 dB error(-0.031 dB)
- 0x12, // [091] = -45.500 dB -> AKM(0x12) = -45.840 dB error(-0.340 dB)
- 0x12, // [092] = -46.000 dB -> AKM(0x12) = -45.840 dB error(+0.160 dB)
- 0x11, // [093] = -46.500 dB -> AKM(0x11) = -46.731 dB error(-0.231 dB)
- 0x11, // [094] = -47.000 dB -> AKM(0x11) = -46.731 dB error(+0.269 dB)
- 0x10, // [095] = -47.500 dB -> AKM(0x10) = -47.725 dB error(-0.225 dB)
- 0x10, // [096] = -48.000 dB -> AKM(0x10) = -47.725 dB error(+0.275 dB)
- 0x0f, // [097] = -48.500 dB -> AKM(0x0f) = -48.553 dB error(-0.053 dB)
- 0x0e, // [098] = -49.000 dB -> AKM(0x0e) = -49.152 dB error(-0.152 dB)
- 0x0d, // [099] = -49.500 dB -> AKM(0x0d) = -49.796 dB error(-0.296 dB)
- 0x0d, // [100] = -50.000 dB -> AKM(0x0d) = -49.796 dB error(+0.204 dB)
- 0x0c, // [101] = -50.500 dB -> AKM(0x0c) = -50.491 dB error(+0.009 dB)
- 0x0b, // [102] = -51.000 dB -> AKM(0x0b) = -51.247 dB error(-0.247 dB)
- 0x0b, // [103] = -51.500 dB -> AKM(0x0b) = -51.247 dB error(+0.253 dB)
- 0x0a, // [104] = -52.000 dB -> AKM(0x0a) = -52.075 dB error(-0.075 dB)
- 0x0a, // [105] = -52.500 dB -> AKM(0x0a) = -52.075 dB error(+0.425 dB)
- 0x09, // [106] = -53.000 dB -> AKM(0x09) = -52.990 dB error(+0.010 dB)
- 0x09, // [107] = -53.500 dB -> AKM(0x09) = -52.990 dB error(+0.510 dB)
- 0x08, // [108] = -54.000 dB -> AKM(0x08) = -54.013 dB error(-0.013 dB)
- 0x08, // [109] = -54.500 dB -> AKM(0x08) = -54.013 dB error(+0.487 dB)
- 0x07, // [110] = -55.000 dB -> AKM(0x07) = -55.173 dB error(-0.173 dB)
- 0x07, // [111] = -55.500 dB -> AKM(0x07) = -55.173 dB error(+0.327 dB)
- 0x06, // [112] = -56.000 dB -> AKM(0x06) = -56.512 dB error(-0.512 dB)
- 0x06, // [113] = -56.500 dB -> AKM(0x06) = -56.512 dB error(-0.012 dB)
- 0x06, // [114] = -57.000 dB -> AKM(0x06) = -56.512 dB error(+0.488 dB)
- 0x05, // [115] = -57.500 dB -> AKM(0x05) = -58.095 dB error(-0.595 dB)
- 0x05, // [116] = -58.000 dB -> AKM(0x05) = -58.095 dB error(-0.095 dB)
- 0x05, // [117] = -58.500 dB -> AKM(0x05) = -58.095 dB error(+0.405 dB)
- 0x05, // [118] = -59.000 dB -> AKM(0x05) = -58.095 dB error(+0.905 dB)
- 0x04, // [119] = -59.500 dB -> AKM(0x04) = -60.034 dB error(-0.534 dB)
- 0x04, // [120] = -60.000 dB -> AKM(0x04) = -60.034 dB error(-0.034 dB)
- 0x04, // [121] = -60.500 dB -> AKM(0x04) = -60.034 dB error(+0.466 dB)
- 0x04, // [122] = -61.000 dB -> AKM(0x04) = -60.034 dB error(+0.966 dB)
- 0x03, // [123] = -61.500 dB -> AKM(0x03) = -62.532 dB error(-1.032 dB)
- 0x03, // [124] = -62.000 dB -> AKM(0x03) = -62.532 dB error(-0.532 dB)
- 0x03, // [125] = -62.500 dB -> AKM(0x03) = -62.532 dB error(-0.032 dB)
- 0x03, // [126] = -63.000 dB -> AKM(0x03) = -62.532 dB error(+0.468 dB)
- 0x03, // [127] = -63.500 dB -> AKM(0x03) = -62.532 dB error(+0.968 dB)
- 0x03, // [128] = -64.000 dB -> AKM(0x03) = -62.532 dB error(+1.468 dB)
- 0x02, // [129] = -64.500 dB -> AKM(0x02) = -66.054 dB error(-1.554 dB)
- 0x02, // [130] = -65.000 dB -> AKM(0x02) = -66.054 dB error(-1.054 dB)
- 0x02, // [131] = -65.500 dB -> AKM(0x02) = -66.054 dB error(-0.554 dB)
- 0x02, // [132] = -66.000 dB -> AKM(0x02) = -66.054 dB error(-0.054 dB)
- 0x02, // [133] = -66.500 dB -> AKM(0x02) = -66.054 dB error(+0.446 dB)
- 0x02, // [134] = -67.000 dB -> AKM(0x02) = -66.054 dB error(+0.946 dB)
- 0x02, // [135] = -67.500 dB -> AKM(0x02) = -66.054 dB error(+1.446 dB)
- 0x02, // [136] = -68.000 dB -> AKM(0x02) = -66.054 dB error(+1.946 dB)
- 0x02, // [137] = -68.500 dB -> AKM(0x02) = -66.054 dB error(+2.446 dB)
- 0x02, // [138] = -69.000 dB -> AKM(0x02) = -66.054 dB error(+2.946 dB)
- 0x01, // [139] = -69.500 dB -> AKM(0x01) = -72.075 dB error(-2.575 dB)
- 0x01, // [140] = -70.000 dB -> AKM(0x01) = -72.075 dB error(-2.075 dB)
- 0x01, // [141] = -70.500 dB -> AKM(0x01) = -72.075 dB error(-1.575 dB)
- 0x01, // [142] = -71.000 dB -> AKM(0x01) = -72.075 dB error(-1.075 dB)
- 0x01, // [143] = -71.500 dB -> AKM(0x01) = -72.075 dB error(-0.575 dB)
- 0x01, // [144] = -72.000 dB -> AKM(0x01) = -72.075 dB error(-0.075 dB)
- 0x01, // [145] = -72.500 dB -> AKM(0x01) = -72.075 dB error(+0.425 dB)
- 0x01, // [146] = -73.000 dB -> AKM(0x01) = -72.075 dB error(+0.925 dB)
- 0x00}; // [147] = -73.500 dB -> AKM(0x00) = mute error(+infini)
+ 0x7f, /* [000] = +0.000 dB -> AKM(0x7f) = +0.000 dB error(+0.000 dB) */
+ 0x7d, /* [001] = -0.500 dB -> AKM(0x7d) = -0.572 dB error(-0.072 dB) */
+ 0x7c, /* [002] = -1.000 dB -> AKM(0x7c) = -0.873 dB error(+0.127 dB) */
+ 0x7a, /* [003] = -1.500 dB -> AKM(0x7a) = -1.508 dB error(-0.008 dB) */
+ 0x79, /* [004] = -2.000 dB -> AKM(0x79) = -1.844 dB error(+0.156 dB) */
+ 0x77, /* [005] = -2.500 dB -> AKM(0x77) = -2.557 dB error(-0.057 dB) */
+ 0x76, /* [006] = -3.000 dB -> AKM(0x76) = -2.937 dB error(+0.063 dB) */
+ 0x75, /* [007] = -3.500 dB -> AKM(0x75) = -3.334 dB error(+0.166 dB) */
+ 0x73, /* [008] = -4.000 dB -> AKM(0x73) = -4.188 dB error(-0.188 dB) */
+ 0x72, /* [009] = -4.500 dB -> AKM(0x72) = -4.648 dB error(-0.148 dB) */
+ 0x71, /* [010] = -5.000 dB -> AKM(0x71) = -5.134 dB error(-0.134 dB) */
+ 0x70, /* [011] = -5.500 dB -> AKM(0x70) = -5.649 dB error(-0.149 dB) */
+ 0x6f, /* [012] = -6.000 dB -> AKM(0x6f) = -6.056 dB error(-0.056 dB) */
+ 0x6d, /* [013] = -6.500 dB -> AKM(0x6d) = -6.631 dB error(-0.131 dB) */
+ 0x6c, /* [014] = -7.000 dB -> AKM(0x6c) = -6.933 dB error(+0.067 dB) */
+ 0x6a, /* [015] = -7.500 dB -> AKM(0x6a) = -7.571 dB error(-0.071 dB) */
+ 0x69, /* [016] = -8.000 dB -> AKM(0x69) = -7.909 dB error(+0.091 dB) */
+ 0x67, /* [017] = -8.500 dB -> AKM(0x67) = -8.626 dB error(-0.126 dB) */
+ 0x66, /* [018] = -9.000 dB -> AKM(0x66) = -9.008 dB error(-0.008 dB) */
+ 0x65, /* [019] = -9.500 dB -> AKM(0x65) = -9.407 dB error(+0.093 dB) */
+ 0x64, /* [020] = -10.000 dB -> AKM(0x64) = -9.826 dB error(+0.174 dB) */
+ 0x62, /* [021] = -10.500 dB -> AKM(0x62) = -10.730 dB error(-0.230 dB) */
+ 0x61, /* [022] = -11.000 dB -> AKM(0x61) = -11.219 dB error(-0.219 dB) */
+ 0x60, /* [023] = -11.500 dB -> AKM(0x60) = -11.738 dB error(-0.238 dB) */
+ 0x5f, /* [024] = -12.000 dB -> AKM(0x5f) = -12.149 dB error(-0.149 dB) */
+ 0x5e, /* [025] = -12.500 dB -> AKM(0x5e) = -12.434 dB error(+0.066 dB) */
+ 0x5c, /* [026] = -13.000 dB -> AKM(0x5c) = -13.033 dB error(-0.033 dB) */
+ 0x5b, /* [027] = -13.500 dB -> AKM(0x5b) = -13.350 dB error(+0.150 dB) */
+ 0x59, /* [028] = -14.000 dB -> AKM(0x59) = -14.018 dB error(-0.018 dB) */
+ 0x58, /* [029] = -14.500 dB -> AKM(0x58) = -14.373 dB error(+0.127 dB) */
+ 0x56, /* [030] = -15.000 dB -> AKM(0x56) = -15.130 dB error(-0.130 dB) */
+ 0x55, /* [031] = -15.500 dB -> AKM(0x55) = -15.534 dB error(-0.034 dB) */
+ 0x54, /* [032] = -16.000 dB -> AKM(0x54) = -15.958 dB error(+0.042 dB) */
+ 0x53, /* [033] = -16.500 dB -> AKM(0x53) = -16.404 dB error(+0.096 dB) */
+ 0x52, /* [034] = -17.000 dB -> AKM(0x52) = -16.874 dB error(+0.126 dB) */
+ 0x51, /* [035] = -17.500 dB -> AKM(0x51) = -17.371 dB error(+0.129 dB) */
+ 0x50, /* [036] = -18.000 dB -> AKM(0x50) = -17.898 dB error(+0.102 dB) */
+ 0x4e, /* [037] = -18.500 dB -> AKM(0x4e) = -18.605 dB error(-0.105 dB) */
+ 0x4d, /* [038] = -19.000 dB -> AKM(0x4d) = -18.905 dB error(+0.095 dB) */
+ 0x4b, /* [039] = -19.500 dB -> AKM(0x4b) = -19.538 dB error(-0.038 dB) */
+ 0x4a, /* [040] = -20.000 dB -> AKM(0x4a) = -19.872 dB error(+0.128 dB) */
+ 0x48, /* [041] = -20.500 dB -> AKM(0x48) = -20.583 dB error(-0.083 dB) */
+ 0x47, /* [042] = -21.000 dB -> AKM(0x47) = -20.961 dB error(+0.039 dB) */
+ 0x46, /* [043] = -21.500 dB -> AKM(0x46) = -21.356 dB error(+0.144 dB) */
+ 0x44, /* [044] = -22.000 dB -> AKM(0x44) = -22.206 dB error(-0.206 dB) */
+ 0x43, /* [045] = -22.500 dB -> AKM(0x43) = -22.664 dB error(-0.164 dB) */
+ 0x42, /* [046] = -23.000 dB -> AKM(0x42) = -23.147 dB error(-0.147 dB) */
+ 0x41, /* [047] = -23.500 dB -> AKM(0x41) = -23.659 dB error(-0.159 dB) */
+ 0x40, /* [048] = -24.000 dB -> AKM(0x40) = -24.203 dB error(-0.203 dB) */
+ 0x3f, /* [049] = -24.500 dB -> AKM(0x3f) = -24.635 dB error(-0.135 dB) */
+ 0x3e, /* [050] = -25.000 dB -> AKM(0x3e) = -24.935 dB error(+0.065 dB) */
+ 0x3c, /* [051] = -25.500 dB -> AKM(0x3c) = -25.569 dB error(-0.069 dB) */
+ 0x3b, /* [052] = -26.000 dB -> AKM(0x3b) = -25.904 dB error(+0.096 dB) */
+ 0x39, /* [053] = -26.500 dB -> AKM(0x39) = -26.615 dB error(-0.115 dB) */
+ 0x38, /* [054] = -27.000 dB -> AKM(0x38) = -26.994 dB error(+0.006 dB) */
+ 0x37, /* [055] = -27.500 dB -> AKM(0x37) = -27.390 dB error(+0.110 dB) */
+ 0x36, /* [056] = -28.000 dB -> AKM(0x36) = -27.804 dB error(+0.196 dB) */
+ 0x34, /* [057] = -28.500 dB -> AKM(0x34) = -28.699 dB error(-0.199 dB) */
+ 0x33, /* [058] = -29.000 dB -> AKM(0x33) = -29.183 dB error(-0.183 dB) */
+ 0x32, /* [059] = -29.500 dB -> AKM(0x32) = -29.696 dB error(-0.196 dB) */
+ 0x31, /* [060] = -30.000 dB -> AKM(0x31) = -30.241 dB error(-0.241 dB) */
+ 0x31, /* [061] = -30.500 dB -> AKM(0x31) = -30.241 dB error(+0.259 dB) */
+ 0x30, /* [062] = -31.000 dB -> AKM(0x30) = -30.823 dB error(+0.177 dB) */
+ 0x2e, /* [063] = -31.500 dB -> AKM(0x2e) = -31.610 dB error(-0.110 dB) */
+ 0x2d, /* [064] = -32.000 dB -> AKM(0x2d) = -31.945 dB error(+0.055 dB) */
+ 0x2b, /* [065] = -32.500 dB -> AKM(0x2b) = -32.659 dB error(-0.159 dB) */
+ 0x2a, /* [066] = -33.000 dB -> AKM(0x2a) = -33.038 dB error(-0.038 dB) */
+ 0x29, /* [067] = -33.500 dB -> AKM(0x29) = -33.435 dB error(+0.065 dB) */
+ 0x28, /* [068] = -34.000 dB -> AKM(0x28) = -33.852 dB error(+0.148 dB) */
+ 0x27, /* [069] = -34.500 dB -> AKM(0x27) = -34.289 dB error(+0.211 dB) */
+ 0x25, /* [070] = -35.000 dB -> AKM(0x25) = -35.235 dB error(-0.235 dB) */
+ 0x24, /* [071] = -35.500 dB -> AKM(0x24) = -35.750 dB error(-0.250 dB) */
+ 0x24, /* [072] = -36.000 dB -> AKM(0x24) = -35.750 dB error(+0.250 dB) */
+ 0x23, /* [073] = -36.500 dB -> AKM(0x23) = -36.297 dB error(+0.203 dB) */
+ 0x22, /* [074] = -37.000 dB -> AKM(0x22) = -36.881 dB error(+0.119 dB) */
+ 0x21, /* [075] = -37.500 dB -> AKM(0x21) = -37.508 dB error(-0.008 dB) */
+ 0x20, /* [076] = -38.000 dB -> AKM(0x20) = -38.183 dB error(-0.183 dB) */
+ 0x1f, /* [077] = -38.500 dB -> AKM(0x1f) = -38.726 dB error(-0.226 dB) */
+ 0x1e, /* [078] = -39.000 dB -> AKM(0x1e) = -39.108 dB error(-0.108 dB) */
+ 0x1d, /* [079] = -39.500 dB -> AKM(0x1d) = -39.507 dB error(-0.007 dB) */
+ 0x1c, /* [080] = -40.000 dB -> AKM(0x1c) = -39.926 dB error(+0.074 dB) */
+ 0x1b, /* [081] = -40.500 dB -> AKM(0x1b) = -40.366 dB error(+0.134 dB) */
+ 0x1a, /* [082] = -41.000 dB -> AKM(0x1a) = -40.829 dB error(+0.171 dB) */
+ 0x19, /* [083] = -41.500 dB -> AKM(0x19) = -41.318 dB error(+0.182 dB) */
+ 0x18, /* [084] = -42.000 dB -> AKM(0x18) = -41.837 dB error(+0.163 dB) */
+ 0x17, /* [085] = -42.500 dB -> AKM(0x17) = -42.389 dB error(+0.111 dB) */
+ 0x16, /* [086] = -43.000 dB -> AKM(0x16) = -42.978 dB error(+0.022 dB) */
+ 0x15, /* [087] = -43.500 dB -> AKM(0x15) = -43.610 dB error(-0.110 dB) */
+ 0x14, /* [088] = -44.000 dB -> AKM(0x14) = -44.291 dB error(-0.291 dB) */
+ 0x14, /* [089] = -44.500 dB -> AKM(0x14) = -44.291 dB error(+0.209 dB) */
+ 0x13, /* [090] = -45.000 dB -> AKM(0x13) = -45.031 dB error(-0.031 dB) */
+ 0x12, /* [091] = -45.500 dB -> AKM(0x12) = -45.840 dB error(-0.340 dB) */
+ 0x12, /* [092] = -46.000 dB -> AKM(0x12) = -45.840 dB error(+0.160 dB) */
+ 0x11, /* [093] = -46.500 dB -> AKM(0x11) = -46.731 dB error(-0.231 dB) */
+ 0x11, /* [094] = -47.000 dB -> AKM(0x11) = -46.731 dB error(+0.269 dB) */
+ 0x10, /* [095] = -47.500 dB -> AKM(0x10) = -47.725 dB error(-0.225 dB) */
+ 0x10, /* [096] = -48.000 dB -> AKM(0x10) = -47.725 dB error(+0.275 dB) */
+ 0x0f, /* [097] = -48.500 dB -> AKM(0x0f) = -48.553 dB error(-0.053 dB) */
+ 0x0e, /* [098] = -49.000 dB -> AKM(0x0e) = -49.152 dB error(-0.152 dB) */
+ 0x0d, /* [099] = -49.500 dB -> AKM(0x0d) = -49.796 dB error(-0.296 dB) */
+ 0x0d, /* [100] = -50.000 dB -> AKM(0x0d) = -49.796 dB error(+0.204 dB) */
+ 0x0c, /* [101] = -50.500 dB -> AKM(0x0c) = -50.491 dB error(+0.009 dB) */
+ 0x0b, /* [102] = -51.000 dB -> AKM(0x0b) = -51.247 dB error(-0.247 dB) */
+ 0x0b, /* [103] = -51.500 dB -> AKM(0x0b) = -51.247 dB error(+0.253 dB) */
+ 0x0a, /* [104] = -52.000 dB -> AKM(0x0a) = -52.075 dB error(-0.075 dB) */
+ 0x0a, /* [105] = -52.500 dB -> AKM(0x0a) = -52.075 dB error(+0.425 dB) */
+ 0x09, /* [106] = -53.000 dB -> AKM(0x09) = -52.990 dB error(+0.010 dB) */
+ 0x09, /* [107] = -53.500 dB -> AKM(0x09) = -52.990 dB error(+0.510 dB) */
+ 0x08, /* [108] = -54.000 dB -> AKM(0x08) = -54.013 dB error(-0.013 dB) */
+ 0x08, /* [109] = -54.500 dB -> AKM(0x08) = -54.013 dB error(+0.487 dB) */
+ 0x07, /* [110] = -55.000 dB -> AKM(0x07) = -55.173 dB error(-0.173 dB) */
+ 0x07, /* [111] = -55.500 dB -> AKM(0x07) = -55.173 dB error(+0.327 dB) */
+ 0x06, /* [112] = -56.000 dB -> AKM(0x06) = -56.512 dB error(-0.512 dB) */
+ 0x06, /* [113] = -56.500 dB -> AKM(0x06) = -56.512 dB error(-0.012 dB) */
+ 0x06, /* [114] = -57.000 dB -> AKM(0x06) = -56.512 dB error(+0.488 dB) */
+ 0x05, /* [115] = -57.500 dB -> AKM(0x05) = -58.095 dB error(-0.595 dB) */
+ 0x05, /* [116] = -58.000 dB -> AKM(0x05) = -58.095 dB error(-0.095 dB) */
+ 0x05, /* [117] = -58.500 dB -> AKM(0x05) = -58.095 dB error(+0.405 dB) */
+ 0x05, /* [118] = -59.000 dB -> AKM(0x05) = -58.095 dB error(+0.905 dB) */
+ 0x04, /* [119] = -59.500 dB -> AKM(0x04) = -60.034 dB error(-0.534 dB) */
+ 0x04, /* [120] = -60.000 dB -> AKM(0x04) = -60.034 dB error(-0.034 dB) */
+ 0x04, /* [121] = -60.500 dB -> AKM(0x04) = -60.034 dB error(+0.466 dB) */
+ 0x04, /* [122] = -61.000 dB -> AKM(0x04) = -60.034 dB error(+0.966 dB) */
+ 0x03, /* [123] = -61.500 dB -> AKM(0x03) = -62.532 dB error(-1.032 dB) */
+ 0x03, /* [124] = -62.000 dB -> AKM(0x03) = -62.532 dB error(-0.532 dB) */
+ 0x03, /* [125] = -62.500 dB -> AKM(0x03) = -62.532 dB error(-0.032 dB) */
+ 0x03, /* [126] = -63.000 dB -> AKM(0x03) = -62.532 dB error(+0.468 dB) */
+ 0x03, /* [127] = -63.500 dB -> AKM(0x03) = -62.532 dB error(+0.968 dB) */
+ 0x03, /* [128] = -64.000 dB -> AKM(0x03) = -62.532 dB error(+1.468 dB) */
+ 0x02, /* [129] = -64.500 dB -> AKM(0x02) = -66.054 dB error(-1.554 dB) */
+ 0x02, /* [130] = -65.000 dB -> AKM(0x02) = -66.054 dB error(-1.054 dB) */
+ 0x02, /* [131] = -65.500 dB -> AKM(0x02) = -66.054 dB error(-0.554 dB) */
+ 0x02, /* [132] = -66.000 dB -> AKM(0x02) = -66.054 dB error(-0.054 dB) */
+ 0x02, /* [133] = -66.500 dB -> AKM(0x02) = -66.054 dB error(+0.446 dB) */
+ 0x02, /* [134] = -67.000 dB -> AKM(0x02) = -66.054 dB error(+0.946 dB) */
+ 0x02, /* [135] = -67.500 dB -> AKM(0x02) = -66.054 dB error(+1.446 dB) */
+ 0x02, /* [136] = -68.000 dB -> AKM(0x02) = -66.054 dB error(+1.946 dB) */
+ 0x02, /* [137] = -68.500 dB -> AKM(0x02) = -66.054 dB error(+2.446 dB) */
+ 0x02, /* [138] = -69.000 dB -> AKM(0x02) = -66.054 dB error(+2.946 dB) */
+ 0x01, /* [139] = -69.500 dB -> AKM(0x01) = -72.075 dB error(-2.575 dB) */
+ 0x01, /* [140] = -70.000 dB -> AKM(0x01) = -72.075 dB error(-2.075 dB) */
+ 0x01, /* [141] = -70.500 dB -> AKM(0x01) = -72.075 dB error(-1.575 dB) */
+ 0x01, /* [142] = -71.000 dB -> AKM(0x01) = -72.075 dB error(-1.075 dB) */
+ 0x01, /* [143] = -71.500 dB -> AKM(0x01) = -72.075 dB error(-0.575 dB) */
+ 0x01, /* [144] = -72.000 dB -> AKM(0x01) = -72.075 dB error(-0.075 dB) */
+ 0x01, /* [145] = -72.500 dB -> AKM(0x01) = -72.075 dB error(+0.425 dB) */
+ 0x01, /* [146] = -73.000 dB -> AKM(0x01) = -72.075 dB error(+0.925 dB) */
+ 0x00}; /* [147] = -73.500 dB -> AKM(0x00) = mute error(+infini) */
/*
* pseudo-codec write entry
@@ -738,7 +738,7 @@ static void vx2_reset_codec(struct vx_core *_chip)
msleep(5); /* additionnel wait time for AKM's */
vx2_write_codec_reg(_chip, AKM_CODEC_POWER_CONTROL_CMD); /* DAC power up, ADC power up, Vref power down */
-
+
vx2_write_codec_reg(_chip, AKM_CODEC_CLOCK_FORMAT_CMD); /* default */
vx2_write_codec_reg(_chip, AKM_CODEC_MUTE_CMD); /* Mute = ON ,Deemphasis = OFF */
vx2_write_codec_reg(_chip, AKM_CODEC_RESET_OFF_CMD); /* DAC and ADC normal operation */
@@ -798,7 +798,7 @@ static void vx2_reset_board(struct vx_core *_chip, int cold_reset)
struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
/* initialize the register values */
- chip->regCDSP = VX_CDSP_CODEC_RESET_MASK | VX_CDSP_DSP_RESET_MASK ;
+ chip->regCDSP = VX_CDSP_CODEC_RESET_MASK | VX_CDSP_DSP_RESET_MASK;
chip->regCFG = 0;
}
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/via82xx.c | 76 ++++++++++++++++++++++----------------------
sound/pci/via82xx_modem.c | 60 ++++++++++++++++++------------------
2 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 1aafe95..8a84cb2 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -43,10 +43,10 @@
* routines for each chipset.
*
* Sep. 26, 2005 Karsten Wiese <annabellesgarden(a)yahoo.de>
- * - Optimize position calculation for the 823x chips.
+ * - Optimize position calculation for the 823x chips.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -146,7 +146,7 @@ module_param(enable, bool, 0444);
#define VIA_REG_CTRL_TERMINATE 0x40 /* WO */
#define VIA_REG_CTRL_AUTOSTART 0x20
#define VIA_REG_CTRL_PAUSE 0x08 /* RW */
-#define VIA_REG_CTRL_INT_STOP 0x04
+#define VIA_REG_CTRL_INT_STOP 0x04
#define VIA_REG_CTRL_INT_EOL 0x02
#define VIA_REG_CTRL_INT_FLAG 0x01
#define VIA_REG_CTRL_RESET 0x01 /* RW - probably reset? undocumented */
@@ -310,7 +310,7 @@ DEFINE_VIA_REGSET(CAPTURE_8233, 0x60);
struct snd_via_sg_table {
unsigned int offset;
unsigned int size;
-} ;
+};
#define VIA_TABLE_SIZE 255
#define VIA_MAX_BUFSIZE (1<<24)
@@ -431,9 +431,9 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
&dev->table) < 0)
return -ENOMEM;
}
- if (! dev->idx_table) {
+ if (!dev->idx_table) {
dev->idx_table = kmalloc(sizeof(*dev->idx_table) * VIA_TABLE_SIZE, GFP_KERNEL);
- if (! dev->idx_table)
+ if (!dev->idx_table)
return -ENOMEM;
}
@@ -459,14 +459,14 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
((u32 *)dev->table.area)[idx << 1] = cpu_to_le32(addr);
r = snd_pcm_sgbuf_get_chunk_size(substream, ofs, rest);
rest -= r;
- if (! rest) {
+ if (!rest) {
if (i == periods - 1)
flag = VIA_TBL_BIT_EOL; /* buffer boundary */
else
flag = VIA_TBL_BIT_FLAG; /* period boundary */
} else
flag = 0; /* period continues to the next */
- // printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest);
+ /* printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest); */
((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
dev->idx_table[idx].offset = ofs;
dev->idx_table[idx].size = r;
@@ -502,17 +502,17 @@ static inline unsigned int snd_via82xx_codec_xread(struct via82xx *chip)
{
return inl(VIAREG(chip, AC97));
}
-
+
static inline void snd_via82xx_codec_xwrite(struct via82xx *chip, unsigned int val)
{
outl(val, VIAREG(chip, AC97));
}
-
+
static int snd_via82xx_codec_ready(struct via82xx *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val;
-
+
while (timeout-- > 0) {
udelay(1);
if (!((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY))
@@ -522,14 +522,14 @@ static int snd_via82xx_codec_ready(struct via82xx *chip, int secondary)
secondary, snd_via82xx_codec_xread(chip));
return -EIO;
}
-
+
static int snd_via82xx_codec_valid(struct via82xx *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val, val1;
unsigned int stat = !secondary ? VIA_REG_AC97_PRIMARY_VALID :
VIA_REG_AC97_SECONDARY_VALID;
-
+
while (timeout-- > 0) {
val = snd_via82xx_codec_xread(chip);
val1 = val & (VIA_REG_AC97_BUSY | stat);
@@ -539,7 +539,7 @@ static int snd_via82xx_codec_valid(struct via82xx *chip, int secondary)
}
return -EIO;
}
-
+
static void snd_via82xx_codec_wait(struct snd_ac97 *ac97)
{
struct via82xx *chip = ac97->private_data;
@@ -602,7 +602,7 @@ static void snd_via82xx_channel_reset(struct via82xx *chip, struct viadev *viade
/* clear interrupts */
outb(0x03, VIADEV_REG(viadev, OFFSET_STATUS));
outb(0x00, VIADEV_REG(viadev, OFFSET_TYPE)); /* for via686 */
- // outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR));
+ /* outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR)); */
viadev->lastpos = 0;
viadev->hwptr_done = 0;
}
@@ -619,7 +619,7 @@ static irqreturn_t snd_via686_interrupt(int irq, void *dev_id)
unsigned int i;
status = inl(VIAREG(chip, SGD_SHADOW));
- if (! (status & chip->intr_mask)) {
+ if (!(status & chip->intr_mask)) {
if (chip->rmidi)
/* check mpu401 interrupt */
return snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data);
@@ -631,12 +631,12 @@ static irqreturn_t snd_via686_interrupt(int irq, void *dev_id)
for (i = 0; i < chip->num_devs; i++) {
struct viadev *viadev = &chip->devs[i];
unsigned char c_status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
- if (! (c_status & (VIA_REG_STAT_EOL|VIA_REG_STAT_FLAG|VIA_REG_STAT_STOPPED)))
+ if (!(c_status & (VIA_REG_STAT_EOL|VIA_REG_STAT_FLAG|VIA_REG_STAT_STOPPED)))
continue;
if (viadev->substream && viadev->running) {
/*
* Update hwptr_done based on 'period elapsed'
- * interrupts. We'll use it, when the chip returns 0
+ * interrupts. We'll use it, when the chip returns 0
* for OFFSET_CURR_COUNT.
*/
if (c_status & VIA_REG_STAT_EOL)
@@ -685,7 +685,7 @@ static irqreturn_t snd_via8233_interrupt(int irq, void *dev_id)
if (substream && viadev->running) {
/*
* Update hwptr_done based on 'period elapsed'
- * interrupts. We'll use it, when the chip returns 0
+ * interrupts. We'll use it, when the chip returns 0
* for OFFSET_CURR_COUNT.
*/
if (c_status & VIA_REG_STAT_EOL)
@@ -783,7 +783,7 @@ static inline unsigned int calc_linear_pos(struct viadev *viadev, unsigned int i
(int)size, (int)count);
res = viadev->lastpos;
} else {
- if (! count) {
+ if (!count) {
/* Some mobos report count = 0 on the DMA boundary,
* i.e. count = size indeed.
* Let's check whether this step is above the expected size.
@@ -855,7 +855,7 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
struct viadev *viadev = substream->runtime->private_data;
unsigned int idx, count, res;
int status;
-
+
if (snd_BUG_ON(!viadev->tbl_entries))
return 0;
@@ -865,7 +865,7 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
if (!status)
status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
- /* An apparent bug in the 8251 is worked around by sending a
+ /* An apparent bug in the 8251 is worked around by sending a
* REG_CTRL_START. */
if (chip->revision == VIA_REV_8251 && (status & VIA_REG_STAT_EOL))
snd_via82xx_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START);
@@ -896,7 +896,7 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
res += viadev->fragsize;
}
}
- }
+ }
unlock:
viadev->lastpos = res;
spin_unlock(&chip->reg_lock);
@@ -1166,7 +1166,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev,
struct via_rate_lock *ratep;
runtime->hw = snd_via82xx_hw;
-
+
/* set the hw rate condition */
ratep = &chip->rates[viadev->direction];
spin_lock_irq(&ratep->lock);
@@ -1185,7 +1185,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev,
SNDRV_PCM_RATE_8000_48000);
runtime->hw.rate_min = 8000;
runtime->hw.rate_max = 48000;
- } else if (! ratep->rate) {
+ } else if (!ratep->rate) {
int idx = viadev->direction ? AC97_RATES_ADC : AC97_RATES_FRONT_DAC;
runtime->hw.rates = chip->ac97->rates[idx];
snd_pcm_limit_hw_rates(runtime);
@@ -1276,11 +1276,11 @@ static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream)
ratep = &chip->rates[viadev->direction];
spin_lock_irq(&ratep->lock);
ratep->used--;
- if (! ratep->used)
+ if (!ratep->used)
ratep->rate = 0;
spin_unlock_irq(&ratep->lock);
- if (! ratep->rate) {
- if (! viadev->direction) {
+ if (!ratep->rate) {
+ if (!viadev->direction) {
snd_ac97_update_power(chip->ac97,
AC97_PCM_FRONT_DAC_RATE, 0);
snd_ac97_update_power(chip->ac97,
@@ -1457,7 +1457,7 @@ static int __devinit snd_via8233a_pcm_new(struct via82xx *chip)
64*1024, VIA_MAX_BUFSIZE);
/* SPDIF supported? */
- if (! ac97_can_spdif(chip->ac97))
+ if (!ac97_can_spdif(chip->ac97))
return 0;
/* PCM #1: DXS3 playback (for spdif) */
@@ -1921,7 +1921,7 @@ static int __devinit snd_via8233_init_misc(struct via82xx *chip)
memset(&sid, 0, sizeof(sid));
strcpy(sid.name, "PCM Playback Volume");
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
- if (! snd_ctl_find_id(chip->card, &sid)) {
+ if (!snd_ctl_find_id(chip->card, &sid)) {
snd_printd(KERN_INFO "Using DXS as PCM Playback\n");
err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_pcmdxs_volume_control, chip));
if (err < 0)
@@ -2026,7 +2026,7 @@ static void snd_via82xx_proc_read(struct snd_info_entry *entry,
{
struct via82xx *chip = entry->private_data;
int i;
-
+
snd_iprintf(buffer, "%s\n\n", chip->card->longname);
for (i = 0; i < 0xa0; i += 4) {
snd_iprintf(buffer, "%02x: %08x\n", i, inl(chip->port + i));
@@ -2037,7 +2037,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "via82xx", &entry))
+ if (!snd_card_proc_new(chip->card, "via82xx", &entry))
snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
}
@@ -2057,7 +2057,7 @@ static int snd_via82xx_chip_init(struct via82xx *chip)
pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, 0);
#endif
pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval);
- if (! (pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
+ if (!(pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
/* deassert ACLink reset, force SYNC */
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL,
VIA_ACLINK_CTRL_ENABLE |
@@ -2078,7 +2078,7 @@ static int snd_via82xx_chip_init(struct via82xx *chip)
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, VIA_ACLINK_CTRL_INIT);
udelay(100);
}
-
+
/* Make sure VRA is enabled, in case we didn't do a
* complete codec reset, above */
pci_read_config_byte(chip->pci, VIA_ACLINK_CTRL, &pval);
@@ -2239,7 +2239,7 @@ static int snd_via82xx_free(struct via82xx *chip)
if (chip->irq >= 0)
free_irq(chip->irq, chip);
- __end_hw:
+__end_hw:
release_and_free_resource(chip->mpu_res);
pci_release_regions(chip->pci);
@@ -2477,7 +2477,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
err = -EINVAL;
goto __error;
}
-
+
if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision,
ac97_clock, &chip)) < 0)
goto __error;
@@ -2493,7 +2493,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
if (chip_type == TYPE_VIA8233A) {
if ((err = snd_via8233a_pcm_new(chip)) < 0)
goto __error;
- // chip->dxs_fixed = 1; /* FIXME: use 48k for DXS #3? */
+ /* chip->dxs_fixed = 1; FIXME: use 48k for DXS #3? */
} else {
if ((err = snd_via8233_pcm_new(chip)) < 0)
goto __error;
@@ -2527,7 +2527,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
return 0;
- __error:
+__error:
snd_card_free(card);
return err;
}
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 5bd79d2..833f56e 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -31,7 +31,7 @@
* modems.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -90,7 +90,7 @@ module_param(enable, bool, 0444);
#define VIA_REG_CTRL_TERMINATE 0x40 /* WO */
#define VIA_REG_CTRL_AUTOSTART 0x20
#define VIA_REG_CTRL_PAUSE 0x08 /* RW */
-#define VIA_REG_CTRL_INT_STOP 0x04
+#define VIA_REG_CTRL_INT_STOP 0x04
#define VIA_REG_CTRL_INT_EOL 0x02
#define VIA_REG_CTRL_INT_FLAG 0x01
#define VIA_REG_CTRL_RESET 0x01 /* RW - probably reset? undocumented */
@@ -212,7 +212,7 @@ DEFINE_VIA_REGSET(MI, 0x50);
struct snd_via_sg_table {
unsigned int offset;
unsigned int size;
-} ;
+};
#define VIA_TABLE_SIZE 255
@@ -291,9 +291,9 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
&dev->table) < 0)
return -ENOMEM;
}
- if (! dev->idx_table) {
+ if (!dev->idx_table) {
dev->idx_table = kmalloc(sizeof(*dev->idx_table) * VIA_TABLE_SIZE, GFP_KERNEL);
- if (! dev->idx_table)
+ if (!dev->idx_table)
return -ENOMEM;
}
@@ -321,14 +321,14 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
if (rest < r)
r = rest;
rest -= r;
- if (! rest) {
+ if (!rest) {
if (i == periods - 1)
flag = VIA_TBL_BIT_EOL; /* buffer boundary */
else
flag = VIA_TBL_BIT_FLAG; /* period boundary */
} else
flag = 0; /* period continues to the next */
- // printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest);
+ /* printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest); */
((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
dev->idx_table[idx].offset = ofs;
dev->idx_table[idx].size = r;
@@ -363,17 +363,17 @@ static inline unsigned int snd_via82xx_codec_xread(struct via82xx_modem *chip)
{
return inl(VIAREG(chip, AC97));
}
-
+
static inline void snd_via82xx_codec_xwrite(struct via82xx_modem *chip, unsigned int val)
{
outl(val, VIAREG(chip, AC97));
}
-
+
static int snd_via82xx_codec_ready(struct via82xx_modem *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val;
-
+
while (timeout-- > 0) {
udelay(1);
if (!((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY))
@@ -383,14 +383,14 @@ static int snd_via82xx_codec_ready(struct via82xx_modem *chip, int secondary)
secondary, snd_via82xx_codec_xread(chip));
return -EIO;
}
-
+
static int snd_via82xx_codec_valid(struct via82xx_modem *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val, val1;
unsigned int stat = !secondary ? VIA_REG_AC97_PRIMARY_VALID :
VIA_REG_AC97_SECONDARY_VALID;
-
+
while (timeout-- > 0) {
val = snd_via82xx_codec_xread(chip);
val1 = val & (VIA_REG_AC97_BUSY | stat);
@@ -400,7 +400,7 @@ static int snd_via82xx_codec_valid(struct via82xx_modem *chip, int secondary)
}
return -EIO;
}
-
+
static void snd_via82xx_codec_wait(struct snd_ac97 *ac97)
{
struct via82xx_modem *chip = ac97->private_data;
@@ -416,10 +416,10 @@ static void snd_via82xx_codec_write(struct snd_ac97 *ac97,
{
struct via82xx_modem *chip = ac97->private_data;
unsigned int xval;
- if(reg == AC97_GPIO_STATUS) {
+ if (reg == AC97_GPIO_STATUS) {
outl(val, VIAREG(chip, GPI_STATUS));
return;
- }
+ }
xval = !ac97->num ? VIA_REG_AC97_CODEC_ID_PRIMARY : VIA_REG_AC97_CODEC_ID_SECONDARY;
xval <<= VIA_REG_AC97_CODEC_ID_SHIFT;
xval |= reg << VIA_REG_AC97_CMD_SHIFT;
@@ -466,7 +466,7 @@ static void snd_via82xx_channel_reset(struct via82xx_modem *chip, struct viadev
/* clear interrupts */
outb(0x03, VIADEV_REG(viadev, OFFSET_STATUS));
outb(0x00, VIADEV_REG(viadev, OFFSET_TYPE)); /* for via686 */
- // outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR));
+ /* outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR)); */
viadev->lastpos = 0;
}
@@ -482,7 +482,7 @@ static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id)
unsigned int i;
status = inl(VIAREG(chip, SGD_SHADOW));
- if (! (status & chip->intr_mask)) {
+ if (!(status & chip->intr_mask)) {
return IRQ_NONE;
}
// _skip_sgd:
@@ -493,7 +493,7 @@ static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id)
struct viadev *viadev = &chip->devs[i];
unsigned char c_status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
c_status &= (VIA_REG_STAT_EOL|VIA_REG_STAT_FLAG|VIA_REG_STAT_STOPPED);
- if (! c_status)
+ if (!c_status)
continue;
if (viadev->substream && viadev->running) {
spin_unlock(&chip->reg_lock);
@@ -583,7 +583,7 @@ static inline unsigned int calc_linear_pos(struct viadev *viadev, unsigned int i
"using last valid pointer\n");
res = viadev->lastpos;
} else {
- if (! count)
+ if (!count)
/* bogus count 0 on the DMA boundary? */
res = viadev->idx_table[idx].offset;
else
@@ -744,7 +744,7 @@ static int snd_via82xx_modem_pcm_open(struct via82xx_modem *chip, struct viadev
};
runtime->hw = snd_via82xx_hw;
-
+
if ((err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates)) < 0)
return err;
@@ -918,7 +918,7 @@ static void snd_via82xx_proc_read(struct snd_info_entry *entry, struct snd_info_
{
struct via82xx_modem *chip = entry->private_data;
int i;
-
+
snd_iprintf(buffer, "%s\n\n", chip->card->longname);
for (i = 0; i < 0xa0; i += 4) {
snd_iprintf(buffer, "%02x: %08x\n", i, inl(chip->port + i));
@@ -929,7 +929,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx_modem *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "via82xx", &entry))
+ if (!snd_card_proc_new(chip->card, "via82xx", &entry))
snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
}
@@ -944,13 +944,13 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
unsigned char pval;
pci_read_config_byte(chip->pci, VIA_MC97_CTRL, &pval);
- if((pval & VIA_MC97_CTRL_INIT) != VIA_MC97_CTRL_INIT) {
+ if ((pval & VIA_MC97_CTRL_INIT) != VIA_MC97_CTRL_INIT) {
pci_write_config_byte(chip->pci, 0x44, pval|VIA_MC97_CTRL_INIT);
udelay(100);
}
pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval);
- if (! (pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
+ if (!(pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
/* deassert ACLink reset, force SYNC */
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL,
VIA_ACLINK_CTRL_ENABLE |
@@ -970,7 +970,7 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, VIA_ACLINK_CTRL_INIT);
udelay(100);
}
-
+
pci_read_config_byte(chip->pci, VIA_ACLINK_CTRL, &pval);
if ((pval & VIA_ACLINK_CTRL_INIT) != VIA_ACLINK_CTRL_INIT) {
/* ACLink on, deassert ACLink reset, VSR, SGD data out */
@@ -1009,7 +1009,7 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
__ac97_ok2:
/* route FM trap to IRQ, disable FM trap */
- // pci_write_config_byte(chip->pci, VIA_FM_NMI_CTRL, 0);
+ /* pci_write_config_byte(chip->pci, VIA_FM_NMI_CTRL, 0); */
/* disable all GPI interrupts */
outl(0, VIAREG(chip, GPI_INTR));
@@ -1078,7 +1078,7 @@ static int snd_via82xx_free(struct via82xx_modem *chip)
for (i = 0; i < chip->num_devs; i++)
snd_via82xx_channel_reset(chip, &chip->devs[i]);
- __end_hw:
+__end_hw:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
pci_release_regions(chip->pci);
@@ -1182,7 +1182,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
err = -EINVAL;
goto __error;
}
-
+
if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision,
ac97_clock, &chip)) < 0)
goto __error;
@@ -1190,7 +1190,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
if ((err = snd_via82xx_mixer_new(chip)) < 0)
goto __error;
- if ((err = snd_via686_pcm_new(chip)) < 0 )
+ if ((err = snd_via686_pcm_new(chip)) < 0)
goto __error;
/* disable interrupts */
@@ -1209,7 +1209,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
return 0;
- __error:
+__error:
snd_card_free(card);
return err;
}
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/trident/trident.c | 4 +-
sound/pci/trident/trident_main.c | 478 ++++++++++++++++++------------------
sound/pci/trident/trident_memory.c | 12 +-
3 files changed, 247 insertions(+), 247 deletions(-)
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index d94b16f..11b49f7 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -63,9 +63,9 @@ module_param_array(wavetable_size, int, NULL, 0444);
MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
static struct pci_device_id snd_trident_ids[] = {
- {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
+ {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
- {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
+ {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
0, 0, 0},
{PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018), 0, 0, 0},
{ 0, }
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index c612b43..863f34f 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -43,7 +43,7 @@
#include <sound/trident.h>
#include <sound/asoundef.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int snd_trident_pcm_mixer_build(struct snd_trident *trident,
struct snd_trident_voice * voice,
@@ -87,7 +87,7 @@ static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
printk("ESO: 0x%x\n", val >> 16);
printk("Delta: 0x%x\n", val & 0xffff);
val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL));
- } else { // TRIDENT_DEVICE_ID_NX
+ } else { /* TRIDENT_DEVICE_ID_NX */
val = inl(TRID_REG(trident, CH_NX_DELTA_CSO));
tmp = (val >> 24) & 0xff;
printk("CSO: 0x%x\n", val & 0x00ffffff);
@@ -107,15 +107,15 @@ static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
/*---------------------------------------------------------------------------
unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned short reg)
-
+
Description: This routine will do all of the reading from the external
CODEC (AC97).
-
+
Parameters: ac97 - ac97 codec structure
reg - CODEC register index, from AC97 Hal.
-
+
returns: 16 bit value read from the AC97.
-
+
---------------------------------------------------------------------------*/
static unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned short reg)
{
@@ -167,16 +167,16 @@ static unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned sho
/*---------------------------------------------------------------------------
void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
unsigned short wdata)
-
+
Description: This routine will do all of the writing to the external
CODEC (AC97).
-
+
Parameters: ac97 - ac97 codec structure
reg - CODEC register index, from AC97 Hal.
data - Lower 16 bits are the data to write to CODEC.
-
+
returns: TRUE if everything went ok, else FALSE.
-
+
---------------------------------------------------------------------------*/
static void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
unsigned short wdata)
@@ -236,14 +236,14 @@ static void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
/*---------------------------------------------------------------------------
void snd_trident_enable_eso(struct snd_trident *trident)
-
+
Description: This routine will enable end of loop interrupts.
End of loop interrupts will occur when a running
channel reaches ESO.
Also enables middle of loop interrupts.
-
+
Parameters: trident - pointer to target device class for 4DWave.
-
+
---------------------------------------------------------------------------*/
static void snd_trident_enable_eso(struct snd_trident * trident)
@@ -260,17 +260,17 @@ static void snd_trident_enable_eso(struct snd_trident * trident)
/*---------------------------------------------------------------------------
void snd_trident_disable_eso(struct snd_trident *trident)
-
+
Description: This routine will disable end of loop interrupts.
End of loop interrupts will occur when a running
channel reaches ESO.
Also disables middle of loop interrupts.
-
- Parameters:
+
+ Parameters:
trident - pointer to target device class for 4DWave.
-
+
returns: TRUE if everything went ok, else FALSE.
-
+
---------------------------------------------------------------------------*/
static void snd_trident_disable_eso(struct snd_trident * trident)
@@ -333,13 +333,13 @@ EXPORT_SYMBOL(snd_trident_stop_voice);
/*---------------------------------------------------------------------------
int snd_trident_allocate_pcm_channel(struct snd_trident *trident)
-
+
Description: Allocate hardware channel in Bank B (32-63).
-
+
Parameters : trident - pointer to target device class for 4DWave.
-
+
Return Value: hardware channel - 32-63 or -1 when no channel is available
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_pcm_channel(struct snd_trident * trident)
@@ -360,14 +360,14 @@ static int snd_trident_allocate_pcm_channel(struct snd_trident * trident)
/*---------------------------------------------------------------------------
void snd_trident_free_pcm_channel(int channel)
-
+
Description: Free hardware channel in Bank B (32-63)
-
+
Parameters : trident - pointer to target device class for 4DWave.
channel - hardware channel number 0-63
-
+
Return Value: none
-
+
---------------------------------------------------------------------------*/
static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channel)
@@ -383,13 +383,13 @@ static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channe
/*---------------------------------------------------------------------------
unsigned int snd_trident_allocate_synth_channel(void)
-
+
Description: Allocate hardware channel in Bank A (0-31).
-
+
Parameters : trident - pointer to target device class for 4DWave.
-
+
Return Value: hardware channel - 0-31 or -1 when no channel is available
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_synth_channel(struct snd_trident * trident)
@@ -407,15 +407,15 @@ static int snd_trident_allocate_synth_channel(struct snd_trident * trident)
}
/*---------------------------------------------------------------------------
- void snd_trident_free_synth_channel( int channel )
-
+ void snd_trident_free_synth_channel( int channel)
+
Description: Free hardware channel in Bank B (0-31).
-
+
Parameters : trident - pointer to target device class for 4DWave.
channel - hardware channel number 0-63
-
+
Return Value: none
-
+
---------------------------------------------------------------------------*/
static void snd_trident_free_synth_channel(struct snd_trident *trident, int channel)
@@ -431,14 +431,14 @@ static void snd_trident_free_synth_channel(struct snd_trident *trident, int chan
/*---------------------------------------------------------------------------
snd_trident_write_voice_regs
-
+
Description: This routine will complete and write the 5 hardware channel
registers to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
Each register field.
-
+
---------------------------------------------------------------------------*/
void snd_trident_write_voice_regs(struct snd_trident * trident,
@@ -509,14 +509,14 @@ EXPORT_SYMBOL(snd_trident_write_voice_regs);
/*---------------------------------------------------------------------------
snd_trident_write_cso_reg
-
+
Description: This routine will write the new CSO offset
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
CSO - new CSO value
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_cso_reg(struct snd_trident * trident,
@@ -535,14 +535,14 @@ static void snd_trident_write_cso_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_eso_reg
-
+
Description: This routine will write the new ESO offset
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
ESO - new ESO value
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_eso_reg(struct snd_trident * trident,
@@ -561,14 +561,14 @@ static void snd_trident_write_eso_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_vol_reg
-
+
Description: This routine will write the new voice volume
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
Vol - new voice volume
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_vol_reg(struct snd_trident * trident,
@@ -583,7 +583,7 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident,
outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2));
break;
case TRIDENT_DEVICE_ID_SI7018:
- // printk("voice->Vol = 0x%x\n", voice->Vol);
+ /* printk("voice->Vol = 0x%x\n", voice->Vol); */
outw((voice->CTRL << 12) | voice->Vol,
TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
break;
@@ -592,14 +592,14 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_pan_reg
-
+
Description: This routine will write the new voice pan
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
Pan - new pan value
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_pan_reg(struct snd_trident * trident,
@@ -614,14 +614,14 @@ static void snd_trident_write_pan_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_rvol_reg
-
+
Description: This routine will write the new reverb volume
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
RVol - new reverb volume
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_rvol_reg(struct snd_trident * trident,
@@ -638,14 +638,14 @@ static void snd_trident_write_rvol_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_cvol_reg
-
+
Description: This routine will write the new chorus volume
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
CVol - new chorus volume
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_cvol_reg(struct snd_trident * trident,
@@ -664,21 +664,21 @@ static void snd_trident_write_cvol_reg(struct snd_trident * trident,
snd_trident_convert_rate
Description: This routine converts rate in HZ to hardware delta value.
-
+
Parameters: trident - pointer to target device class for 4DWave.
rate - Real or Virtual channel number.
-
+
Returns: Delta value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_convert_rate(unsigned int rate)
{
unsigned int delta;
- // We special case 44100 and 8000 since rounding with the equation
- // does not give us an accurate enough value. For 11025 and 22050
- // the equation gives us the best answer. All other frequencies will
- // also use the equation. JDW
+ /* We special case 44100 and 8000 since rounding with the equation */
+ /* does not give us an accurate enough value. For 11025 and 22050 */
+ /* the equation gives us the best answer. All other frequencies will */
+ /* also use the equation. JDW */
if (rate == 44100)
delta = 0xeb3;
else if (rate == 8000)
@@ -694,21 +694,21 @@ static unsigned int snd_trident_convert_rate(unsigned int rate)
snd_trident_convert_adc_rate
Description: This routine converts rate in HZ to hardware delta value.
-
+
Parameters: trident - pointer to target device class for 4DWave.
rate - Real or Virtual channel number.
-
+
Returns: Delta value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_convert_adc_rate(unsigned int rate)
{
unsigned int delta;
- // We special case 44100 and 8000 since rounding with the equation
- // does not give us an accurate enough value. For 11025 and 22050
- // the equation gives us the best answer. All other frequencies will
- // also use the equation. JDW
+ /* We special case 44100 and 8000 since rounding with the equation */
+ /* does not give us an accurate enough value. For 11025 and 22050 */
+ /* the equation gives us the best answer. All other frequencies will */
+ /* also use the equation. JDW */
if (rate == 44100)
delta = 0x116a;
else if (rate == 8000)
@@ -724,12 +724,12 @@ static unsigned int snd_trident_convert_adc_rate(unsigned int rate)
snd_trident_spurious_threshold
Description: This routine converts rate in HZ to spurious threshold.
-
+
Parameters: trident - pointer to target device class for 4DWave.
rate - Real or Virtual channel number.
-
+
Returns: Delta value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_spurious_threshold(unsigned int rate,
unsigned int period_size)
@@ -746,12 +746,12 @@ static unsigned int snd_trident_spurious_threshold(unsigned int rate,
snd_trident_control_mode
Description: This routine returns a control mode for a PCM channel.
-
+
Parameters: trident - pointer to target device class for 4DWave.
substream - PCM substream
-
+
Returns: Control value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream)
{
@@ -763,11 +763,11 @@ static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream
*/
CTRL = 0x00000001;
if (snd_pcm_format_width(runtime->format) == 16)
- CTRL |= 0x00000008; // 16-bit data
+ CTRL |= 0x00000008; /* 16-bit data */
if (snd_pcm_format_signed(runtime->format))
- CTRL |= 0x00000002; // signed data
+ CTRL |= 0x00000002; /* signed data */
if (runtime->channels > 1)
- CTRL |= 0x00000004; // stereo data
+ CTRL |= 0x00000004; /* stereo data */
return CTRL;
}
@@ -777,15 +777,15 @@ static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream
/*---------------------------------------------------------------------------
snd_trident_ioctl
-
+
Description: Device I/O control handler for playback/capture parameters.
-
+
Parameters: substream - PCM substream class
cmd - what ioctl message to process
- arg - additional message infoarg
-
+ arg - additional message infoarg
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_ioctl(struct snd_pcm_substream *substream,
@@ -800,14 +800,14 @@ static int snd_trident_ioctl(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_allocate_pcm_mem
-
+
Description: Allocate PCM ring buffer for given substream
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream,
@@ -834,14 +834,14 @@ static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_allocate_evoice
-
+
Description: Allocate extra voice as interrupt generator
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_evoice(struct snd_pcm_substream *substream,
@@ -874,14 +874,14 @@ static int snd_trident_allocate_evoice(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_hw_params
-
+
Description: Set the hardware parameters for the playback device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_hw_params(struct snd_pcm_substream *substream,
@@ -897,13 +897,13 @@ static int snd_trident_hw_params(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_playback_hw_free
-
+
Description: Release the hardware resources for the playback device.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_hw_free(struct snd_pcm_substream *substream)
@@ -929,13 +929,13 @@ static int snd_trident_hw_free(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_playback_prepare
-
+
Description: Prepare playback device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
@@ -946,7 +946,7 @@ static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
struct snd_trident_voice *evoice = voice->extra;
struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number];
- spin_lock_irq(&trident->reg_lock);
+ spin_lock_irq(&trident->reg_lock);
/* set delta (rate) value */
voice->Delta = snd_trident_convert_rate(runtime->rate);
@@ -957,7 +957,7 @@ static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
voice->LBA = voice->memblk->offset;
else
voice->LBA = runtime->dma_addr;
-
+
voice->CSO = 0;
voice->ESO = runtime->buffer_size - 1; /* in samples */
voice->CTRL = snd_trident_control_mode(substream);
@@ -1014,14 +1014,14 @@ static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_capture_hw_params
-
+
Description: Set the hardware parameters for the capture device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_capture_hw_params(struct snd_pcm_substream *substream,
@@ -1032,13 +1032,13 @@ static int snd_trident_capture_hw_params(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_capture_prepare
-
+
Description: Prepare capture device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
@@ -1050,29 +1050,29 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
spin_lock_irq(&trident->reg_lock);
- // Initilize the channel and set channel Mode
+ /* Initilize the channel and set channel Mode */
outb(0, TRID_REG(trident, LEGACY_DMAR15));
- // Set DMA channel operation mode register
+ /* Set DMA channel operation mode register */
outb(0x54, TRID_REG(trident, LEGACY_DMAR11));
- // Set channel buffer Address, DMAR0 expects contiguous PCI memory area
+ /* Set channel buffer Address, DMAR0 expects contiguous PCI memory area */
voice->LBA = runtime->dma_addr;
outl(voice->LBA, TRID_REG(trident, LEGACY_DMAR0));
if (voice->memblk)
voice->LBA = voice->memblk->offset;
- // set ESO
+ /* set ESO */
ESO_bytes = snd_pcm_lib_buffer_bytes(substream) - 1;
outb((ESO_bytes & 0x00ff0000) >> 16, TRID_REG(trident, LEGACY_DMAR6));
outw((ESO_bytes & 0x0000ffff), TRID_REG(trident, LEGACY_DMAR4));
ESO_bytes++;
- // Set channel sample rate, 4.12 format
+ /* Set channel sample rate, 4.12 format */
val = (((unsigned int) 48000L << 12) + (runtime->rate/2)) / runtime->rate;
outw(val, TRID_REG(trident, T4D_SBDELTA_DELTA_R));
- // Set channel interrupt blk length
+ /* Set channel interrupt blk length */
if (snd_pcm_format_width(runtime->format) == 16) {
val = (unsigned short) ((ESO_bytes >> 1) - 1);
} else {
@@ -1081,9 +1081,9 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
outl((val << 16) | val, TRID_REG(trident, T4D_SBBL_SBCL));
- // Right now, set format and start to run captureing,
- // continuous run loop enable.
- trident->bDMAStart = 0x19; // 0001 1001b
+ /* Right now, set format and start to run captureing, */
+ /* continuous run loop enable. */
+ trident->bDMAStart = 0x19; /* 0001 1001b */
if (snd_pcm_format_width(runtime->format) == 16)
trident->bDMAStart |= 0x80;
@@ -1092,7 +1092,7 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
if (runtime->channels > 1)
trident->bDMAStart |= 0x40;
- // Prepare capture intr channel
+ /* Prepare capture intr channel */
voice->Delta = snd_trident_convert_rate(runtime->rate);
voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
@@ -1100,7 +1100,7 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
voice->isync_mark = runtime->period_size;
voice->isync_max = runtime->buffer_size;
- // Set voice parameters
+ /* Set voice parameters */
voice->CSO = 0;
voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1;
voice->CTRL = snd_trident_control_mode(substream);
@@ -1123,14 +1123,14 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_si7018_capture_hw_params
-
+
Description: Set the hardware parameters for the capture device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substream,
@@ -1146,13 +1146,13 @@ static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substr
/*---------------------------------------------------------------------------
snd_trident_si7018_capture_hw_free
-
+
Description: Release the hardware resources for the capture device.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_si7018_capture_hw_free(struct snd_pcm_substream *substream)
@@ -1172,13 +1172,13 @@ static int snd_trident_si7018_capture_hw_free(struct snd_pcm_substream *substrea
/*---------------------------------------------------------------------------
snd_trident_si7018_capture_prepare
-
+
Description: Prepare capture device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substream)
@@ -1194,7 +1194,7 @@ static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substrea
voice->Delta = snd_trident_convert_adc_rate(runtime->rate);
voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
- // Set voice parameters
+ /* Set voice parameters */
voice->CSO = 0;
voice->ESO = runtime->buffer_size - 1; /* in samples */
voice->CTRL = snd_trident_control_mode(substream);
@@ -1236,20 +1236,20 @@ static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substrea
evoice->isync_mark = runtime->period_size;
evoice->ESO = (runtime->period_size * 2) - 1;
}
-
+
spin_unlock_irq(&trident->reg_lock);
return 0;
}
/*---------------------------------------------------------------------------
snd_trident_foldback_prepare
-
+
Description: Prepare foldback capture device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_foldback_prepare(struct snd_pcm_substream *substream)
@@ -1320,14 +1320,14 @@ static int snd_trident_foldback_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_spdif_hw_params
-
+
Description: Set the hardware parameters for the spdif device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
@@ -1355,21 +1355,21 @@ static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
else
trident->spdif_pcm_bits &= ~(IEC958_AES3_CON_FS << 24);
if (params_rate(hw_params) >= 48000) {
- trident->spdif_pcm_ctrl = 0x3c; // 48000 Hz
+ trident->spdif_pcm_ctrl = 0x3c; /* 48000 Hz */
trident->spdif_pcm_bits |=
trident->spdif_bits & IEC958_AES0_PROFESSIONAL ?
IEC958_AES0_PRO_FS_48000 :
(IEC958_AES3_CON_FS_48000 << 24);
}
else if (params_rate(hw_params) >= 44100) {
- trident->spdif_pcm_ctrl = 0x3e; // 44100 Hz
+ trident->spdif_pcm_ctrl = 0x3e; /* 44100 Hz */
trident->spdif_pcm_bits |=
trident->spdif_bits & IEC958_AES0_PROFESSIONAL ?
IEC958_AES0_PRO_FS_44100 :
(IEC958_AES3_CON_FS_44100 << 24);
}
else {
- trident->spdif_pcm_ctrl = 0x3d; // 32000 Hz
+ trident->spdif_pcm_ctrl = 0x3d; /* 32000 Hz */
trident->spdif_pcm_bits |=
trident->spdif_bits & IEC958_AES0_PROFESSIONAL ?
IEC958_AES0_PRO_FS_32000 :
@@ -1386,13 +1386,13 @@ static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_spdif_prepare
-
+
Description: Prepare SPDIF device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
@@ -1458,7 +1458,7 @@ static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
} else { /* SiS */
-
+
/* set delta (rate) value */
voice->Delta = 0x800;
voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size);
@@ -1524,19 +1524,19 @@ static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_trigger
-
+
Description: Start/stop devices
-
+
Parameters: substream - PCM substream class
cmd - trigger command (STOP, GO)
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_trigger(struct snd_pcm_substream *substream,
int cmd)
-
+
{
struct snd_trident *trident = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *s;
@@ -1624,13 +1624,13 @@ static int snd_trident_trigger(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_playback_pointer
-
+
Description: This routine return the playback position
-
+
Parameters: substream - PCM substream class
Returns: position of buffer
-
+
---------------------------------------------------------------------------*/
static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *substream)
@@ -1649,7 +1649,7 @@ static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *
if (trident->device != TRIDENT_DEVICE_ID_NX) {
cso = inw(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS + 2));
- } else { // ID_4DWAVE_NX
+ } else { /* ID_4DWAVE_NX */
cso = (unsigned int) inl(TRID_REG(trident, CH_NX_DELTA_CSO)) & 0x00ffffff;
}
@@ -1663,13 +1663,13 @@ static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *
/*---------------------------------------------------------------------------
snd_trident_capture_pointer
-
+
Description: This routine return the capture position
-
+
Parameters: pcm1 - PCM device class
Returns: position of buffer
-
+
---------------------------------------------------------------------------*/
static snd_pcm_uframes_t snd_trident_capture_pointer(struct snd_pcm_substream *substream)
@@ -1693,13 +1693,13 @@ static snd_pcm_uframes_t snd_trident_capture_pointer(struct snd_pcm_substream *s
/*---------------------------------------------------------------------------
snd_trident_spdif_pointer
-
+
Description: This routine return the SPDIF playback position
-
+
Parameters: substream - PCM substream class
Returns: position of buffer
-
+
---------------------------------------------------------------------------*/
static snd_pcm_uframes_t snd_trident_spdif_pointer(struct snd_pcm_substream *substream)
@@ -1868,10 +1868,10 @@ static int snd_trident_playback_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_playback_close
-
- Description: This routine will close the 4DWave playback device. For now
+
+ Description: This routine will close the 4DWave playback device. For now
we will simply free the dma transfer buffer.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -1887,13 +1887,13 @@ static int snd_trident_playback_close(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_spdif_open
-
+
Description: This routine will open the 4DWave SPDIF device.
Parameters: substream - PCM substream class
Returns: status - success or failure flag
-
+
---------------------------------------------------------------------------*/
static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
@@ -1901,7 +1901,7 @@ static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
struct snd_trident *trident = snd_pcm_substream_chip(substream);
struct snd_trident_voice *voice;
struct snd_pcm_runtime *runtime = substream->runtime;
-
+
voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
if (voice == NULL)
return -EAGAIN;
@@ -1930,9 +1930,9 @@ static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_spdif_close
-
+
Description: This routine will close the 4DWave SPDIF device.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -1943,7 +1943,7 @@ static int snd_trident_spdif_close(struct snd_pcm_substream *substream)
unsigned int temp;
spin_lock_irq(&trident->reg_lock);
- // restore default SPDIF setting
+ /* restore default SPDIF setting */
if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
@@ -1966,7 +1966,7 @@ static int snd_trident_spdif_close(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_capture_open
-
+
Description: This routine will open the 4DWave capture device.
Parameters: substream - PCM substream class
@@ -1996,10 +1996,10 @@ static int snd_trident_capture_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_capture_close
-
- Description: This routine will close the 4DWave capture device. For now
+
+ Description: This routine will close the 4DWave capture device. For now
we will simply free the dma transfer buffer.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -2010,7 +2010,7 @@ static int snd_trident_capture_close(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_foldback_open
-
+
Description: This routine will open the 4DWave foldback capture device.
Parameters: substream - PCM substream class
@@ -2039,10 +2039,10 @@ static int snd_trident_foldback_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_foldback_close
-
- Description: This routine will close the 4DWave foldback capture device.
+
+ Description: This routine will close the 4DWave foldback capture device.
For now we will simply free the dma transfer buffer.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -2052,7 +2052,7 @@ static int snd_trident_foldback_close(struct snd_pcm_substream *substream)
struct snd_trident_voice *voice;
struct snd_pcm_runtime *runtime = substream->runtime;
voice = runtime->private_data;
-
+
/* stop capture channel */
spin_lock_irq(&trident->reg_lock);
outb(0x00, TRID_REG(trident, T4D_RCI + voice->foldback_chan));
@@ -2156,13 +2156,13 @@ static struct snd_pcm_ops snd_trident_spdif_7018_ops = {
/*---------------------------------------------------------------------------
snd_trident_pcm
-
+
Description: This routine registers the 4DWave device for PCM support.
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: None
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_pcm(struct snd_trident * trident,
@@ -2214,13 +2214,13 @@ int __devinit snd_trident_pcm(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_foldback_pcm
-
+
Description: This routine registers the 4DWave device for foldback PCM support.
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: None
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_foldback_pcm(struct snd_trident * trident,
@@ -2271,13 +2271,13 @@ int __devinit snd_trident_foldback_pcm(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_spdif
-
+
Description: This routine registers the 4DWave-NX device for SPDIF support.
-
+
Parameters: trident - pointer to target device class for 4DWave-NX.
Returns: None
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_spdif_pcm(struct snd_trident * trident,
@@ -2904,7 +2904,7 @@ static void snd_trident_notify_pcm_change1(struct snd_card *card,
{
struct snd_ctl_elem_id id;
- if (! kctl)
+ if (!kctl)
return;
if (activate)
kctl->vd[num].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -2957,13 +2957,13 @@ static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_tr
/*---------------------------------------------------------------------------
snd_trident_mixer
-
+
Description: This routine registers the 4DWave device for mixer support.
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: None
-
+
---------------------------------------------------------------------------*/
static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spdif_device)
@@ -2989,7 +2989,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
_ac97.private_data = trident;
trident->ac97_detect = 1;
- __again:
+__again:
if ((err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97)) < 0) {
if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
if ((err = snd_trident_sis_reset(trident)) < 0)
@@ -3000,7 +3000,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
}
goto __out;
}
-
+
/* secondary codec? */
if (trident->device == TRIDENT_DEVICE_ID_SI7018 &&
(inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0) {
@@ -3008,7 +3008,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec);
if (err < 0)
snd_printk(KERN_ERR "SI7018: the secondary codec - invalid access\n");
-#if 0 // only for my testing purpose --jk
+#if 0 /* only for my testing purpose --jk */
{
struct snd_ac97 *mc97;
err = snd_ac97_modem(trident->card, &_ac97, &mc97);
@@ -3017,7 +3017,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
}
#endif
}
-
+
trident->ac97_detect = 0;
if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
@@ -3034,7 +3034,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
for (idx = 0; idx < 32; idx++) {
struct snd_trident_pcm_mixer *tmix;
-
+
tmix = &trident->pcm_mixer[idx];
tmix->voice = NULL;
}
@@ -3042,7 +3042,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
goto __nomem;
if ((err = snd_ctl_add(card, trident->ctl_vol)))
goto __out;
-
+
if ((trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident)) == NULL)
goto __nomem;
if ((err = snd_ctl_add(card, trident->ctl_pan)))
@@ -3114,10 +3114,10 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
err = 0;
goto __out;
- __nomem:
+__nomem:
err = -ENOMEM;
- __out:
+__out:
kfree(uctl);
return err;
@@ -3161,7 +3161,7 @@ static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes
axes[i] = inw(TRID_REG(chip, GAMEPORT_AXES + i * 2));
if (axes[i] == 0xffff) axes[i] = -1;
}
-
+
return 0;
}
@@ -3284,11 +3284,11 @@ static int snd_trident_sis_reset(struct snd_trident *trident)
return 0;
}
-/*
+/*
* /proc interface
*/
-static void snd_trident_proc_read(struct snd_info_entry *entry,
+static void snd_trident_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_trident *trident = entry->private_data;
@@ -3327,10 +3327,10 @@ static void __devinit snd_trident_proc_init(struct snd_trident * trident)
{
struct snd_info_entry *entry;
const char *s = "trident";
-
+
if (trident->device == TRIDENT_DEVICE_ID_SI7018)
s = "sis7018";
- if (! snd_card_proc_new(trident->card, s, &entry))
+ if (!snd_card_proc_new(trident->card, s, &entry))
snd_info_set_text_ops(entry, trident, snd_trident_proc_read);
}
@@ -3342,14 +3342,14 @@ static int snd_trident_dev_free(struct snd_device *device)
/*---------------------------------------------------------------------------
snd_trident_tlb_alloc
-
+
Description: Allocate and set up the TLB page table on 4D NX.
Each entry has 4 bytes (physical PCI address).
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: 0 or negative error code
-
+
---------------------------------------------------------------------------*/
static int __devinit snd_trident_tlb_alloc(struct snd_trident *trident)
@@ -3418,7 +3418,7 @@ static int snd_trident_4d_dx_init(struct snd_trident *trident)
udelay(100);
pci_write_config_byte(pci, 0x46, 0); /* release reset */
udelay(100);
-
+
/* warm reset of the AC'97 codec */
outl(0x00000001, TRID_REG(trident, DX_ACR2_AC97_COM_STAT));
udelay(100);
@@ -3436,7 +3436,7 @@ static int snd_trident_4d_dx_init(struct snd_trident *trident)
snd_printk(KERN_ERR "AC'97 codec ready error\n");
return -EIO;
- __dx_ok:
+__dx_ok:
snd_trident_stop_all_voices(trident);
return 0;
@@ -3474,7 +3474,7 @@ static int snd_trident_4d_nx_init(struct snd_trident *trident)
snd_printk(KERN_ERR "AC'97 codec ready error [0x%x]\n", inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT)));
return -EIO;
- __nx_ok:
+__nx_ok:
/* DAC on */
trident->ac97_ctrl = 0x00000002;
outl(trident->ac97_ctrl, TRID_REG(trident, NX_ACR0_AC97_COM_STAT));
@@ -3519,10 +3519,10 @@ static int snd_trident_sis_init(struct snd_trident *trident)
/*---------------------------------------------------------------------------
snd_trident_create
-
+
Description: This routine will create the device specific class for
the 4DWave card. It will also perform basic initialization.
-
+
Parameters: card - which card to create
pci - interface to PCI bus resource info
dma1ptr - playback dma buffer
@@ -3530,7 +3530,7 @@ static int snd_trident_sis_init(struct snd_trident *trident)
irqptr - interrupt resource info
Returns: 4DWave device class private data
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_create(struct snd_card *card,
@@ -3560,7 +3560,7 @@ int __devinit snd_trident_create(struct snd_card *card,
pci_disable_device(pci);
return -ENXIO;
}
-
+
trident = kzalloc(sizeof(*trident), GFP_KERNEL);
if (trident == NULL) {
pci_disable_device(pci);
@@ -3577,7 +3577,7 @@ int __devinit snd_trident_create(struct snd_card *card,
if (pcm_streams > 32)
pcm_streams = 32;
trident->ChanPCM = pcm_streams;
- if (max_wavetable_size < 0 )
+ if (max_wavetable_size < 0)
max_wavetable_size = 0;
trident->synth.max_size = max_wavetable_size * 1024;
trident->irq = -1;
@@ -3639,7 +3639,7 @@ int __devinit snd_trident_create(struct snd_card *card,
if ((err = snd_trident_mixer(trident, pcm_spdif_device)) < 0)
return err;
-
+
/* initialise synth voices */
for (i = 0; i < 64; i++) {
voice = &trident->synth.voices[i];
@@ -3665,21 +3665,21 @@ int __devinit snd_trident_create(struct snd_card *card,
/*---------------------------------------------------------------------------
snd_trident_free
-
+
Description: This routine will free the device specific class for
- the 4DWave card.
-
+ the 4DWave card.
+
Parameters: trident - device specific private data for 4DWave card
Returns: None.
-
+
---------------------------------------------------------------------------*/
static int snd_trident_free(struct snd_trident *trident)
{
snd_trident_free_gameport(trident);
snd_trident_disable_eso(trident);
- // Disable S/PDIF out
+ /* Disable S/PDIF out */
if (trident->device == TRIDENT_DEVICE_ID_NX)
outb(0x00, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
else if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
@@ -3704,9 +3704,9 @@ static int snd_trident_free(struct snd_trident *trident)
/*---------------------------------------------------------------------------
snd_trident_interrupt
-
+
Description: ISR for Trident 4DWave device
-
+
Parameters: trident - device specific private data for 4DWave card
Problems: It seems that Trident chips generates interrupts more than
@@ -3717,7 +3717,7 @@ static int snd_trident_free(struct snd_trident *trident)
work on all computers. [jaroslav]
Returns: None.
-
+
---------------------------------------------------------------------------*/
static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
@@ -3731,7 +3731,7 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
if ((audio_int & (ADDRESS_IRQ|MPU401_IRQ)) == 0)
return IRQ_NONE;
if (audio_int & ADDRESS_IRQ) {
- // get interrupt status for all channels
+ /* get interrupt status for all channels */
spin_lock(&trident->reg_lock);
stimer = inl(TRID_REG(trident, T4D_STIMER)) & 0x00ffffff;
chn_int = inl(TRID_REG(trident, T4D_AINT_A));
@@ -3813,7 +3813,7 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
inb(TRID_REG(trident, T4D_MPUR0));
}
}
- // outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT));
+ /* outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT)); */
return IRQ_HANDLED;
}
@@ -3826,7 +3826,7 @@ struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident,
spin_lock_irqsave(&trident->voice_alloc, flags);
if (type == SNDRV_TRIDENT_VOICE_TYPE_PCM) {
idx = snd_trident_allocate_pcm_channel(trident);
- if(idx < 0) {
+ if (idx < 0) {
spin_unlock_irqrestore(&trident->voice_alloc, flags);
return NULL;
}
@@ -3842,7 +3842,7 @@ struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident,
}
if (type == SNDRV_TRIDENT_VOICE_TYPE_SYNTH) {
idx = snd_trident_allocate_synth_channel(trident);
- if(idx < 0) {
+ if (idx < 0) {
spin_unlock_irqrestore(&trident->voice_alloc, flags);
return NULL;
}
diff --git a/sound/pci/trident/trident_memory.c b/sound/pci/trident/trident_memory.c
index f9779e2..4bf4bbb 100644
--- a/sound/pci/trident/trident_memory.c
+++ b/sound/pci/trident/trident_memory.c
@@ -23,7 +23,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/pci.h>
#include <linux/time.h>
#include <linux/mutex.h>
@@ -203,7 +203,7 @@ snd_trident_alloc_sg_pages(struct snd_trident *trident,
if (snd_BUG_ON(!hdr))
return NULL;
-
+
mutex_lock(&hdr->block_mutex);
blk = search_empty(hdr, runtime->dma_bytes);
@@ -211,7 +211,7 @@ snd_trident_alloc_sg_pages(struct snd_trident *trident,
mutex_unlock(&hdr->block_mutex);
return NULL;
}
-
+
/* set TLB entries */
idx = 0;
for (page = firstpg(blk); page <= lastpg(blk); page++, idx++) {
@@ -219,7 +219,7 @@ snd_trident_alloc_sg_pages(struct snd_trident *trident,
dma_addr_t addr = snd_pcm_sgbuf_get_addr(substream, ofs);
unsigned long ptr = (unsigned long)
snd_pcm_sgbuf_get_ptr(substream, ofs);
- if (! is_valid_page(addr)) {
+ if (!is_valid_page(addr)) {
__snd_util_mem_free(hdr, blk);
mutex_unlock(&hdr->block_mutex);
return NULL;
@@ -258,13 +258,13 @@ snd_trident_alloc_cont_pages(struct snd_trident *trident,
mutex_unlock(&hdr->block_mutex);
return NULL;
}
-
+
/* set TLB entries */
addr = runtime->dma_addr;
ptr = (unsigned long)runtime->dma_area;
for (page = firstpg(blk); page <= lastpg(blk); page++,
ptr += SNDRV_TRIDENT_PAGE_SIZE, addr += SNDRV_TRIDENT_PAGE_SIZE) {
- if (! is_valid_page(addr)) {
+ if (!is_valid_page(addr)) {
__snd_util_mem_free(hdr, blk);
mutex_unlock(&hdr->block_mutex);
return NULL;
1
0

[alsa-devel] [PATCH 20/24] sound/pci: coding style fixes: sonicvibes
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/sonicvibes.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index cd408b8..e6ed3a2 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -39,7 +39,7 @@
#include <sound/opl3.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
MODULE_AUTHOR("Jaroslav Kysela <perex(a)perex.cz>");
MODULE_DESCRIPTION("S3 SonicVibes PCI");
@@ -523,7 +523,7 @@ static int snd_sonicvibes_hw_constraint_dac_rate(struct snd_pcm_hw_params *param
{
unsigned int rate, div, r, m, n;
- if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min ==
+ if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min ==
hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->max) {
rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min;
div = 48000 / rate;
@@ -895,7 +895,7 @@ static int snd_sonicvibes_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl
static int snd_sonicvibes_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&sonic->reg_lock);
ucontrol->value.enumerated.item[0] = ((snd_sonicvibes_in1(sonic, SV_IREG_LEFT_ADC) & SV_RECSRC_OUT) >> 5) - 1;
ucontrol->value.enumerated.item[1] = ((snd_sonicvibes_in1(sonic, SV_IREG_RIGHT_ADC) & SV_RECSRC_OUT) >> 5) - 1;
@@ -908,7 +908,7 @@ static int snd_sonicvibes_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
unsigned short left, right, oval1, oval2;
int change;
-
+
if (ucontrol->value.enumerated.item[0] >= 7 ||
ucontrol->value.enumerated.item[1] >= 7)
return -EINVAL;
@@ -950,7 +950,7 @@ static int snd_sonicvibes_get_single(struct snd_kcontrol *kcontrol, struct snd_c
int shift = (kcontrol->private_value >> 8) & 0xff;
int mask = (kcontrol->private_value >> 16) & 0xff;
int invert = (kcontrol->private_value >> 24) & 0xff;
-
+
spin_lock_irq(&sonic->reg_lock);
ucontrol->value.integer.value[0] = (snd_sonicvibes_in1(sonic, reg)>> shift) & mask;
spin_unlock_irq(&sonic->reg_lock);
@@ -968,7 +968,7 @@ static int snd_sonicvibes_put_single(struct snd_kcontrol *kcontrol, struct snd_c
int invert = (kcontrol->private_value >> 24) & 0xff;
int change;
unsigned short val, oval;
-
+
val = (ucontrol->value.integer.value[0] & mask);
if (invert)
val = mask - val;
@@ -1008,7 +1008,7 @@ static int snd_sonicvibes_get_double(struct snd_kcontrol *kcontrol, struct snd_c
int shift_right = (kcontrol->private_value >> 19) & 0x07;
int mask = (kcontrol->private_value >> 24) & 0xff;
int invert = (kcontrol->private_value >> 22) & 1;
-
+
spin_lock_irq(&sonic->reg_lock);
ucontrol->value.integer.value[0] = (snd_sonicvibes_in1(sonic, left_reg) >> shift_left) & mask;
ucontrol->value.integer.value[1] = (snd_sonicvibes_in1(sonic, right_reg) >> shift_right) & mask;
@@ -1031,7 +1031,7 @@ static int snd_sonicvibes_put_double(struct snd_kcontrol *kcontrol, struct snd_c
int invert = (kcontrol->private_value >> 22) & 1;
int change;
unsigned short val1, val2, oval1, oval2;
-
+
val1 = ucontrol->value.integer.value[0] & mask;
val2 = ucontrol->value.integer.value[1] & mask;
if (invert) {
@@ -1110,7 +1110,7 @@ static int __devinit snd_sonicvibes_mixer(struct sonicvibes * sonic)
*/
-static void snd_sonicvibes_proc_read(struct snd_info_entry *entry,
+static void snd_sonicvibes_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct sonicvibes *sonic = entry->private_data;
@@ -1144,7 +1144,7 @@ static void __devinit snd_sonicvibes_proc_init(struct sonicvibes * sonic)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry))
+ if (!snd_card_proc_new(sonic->card, "sonicvibes", &entry))
snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
}
@@ -1422,7 +1422,7 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
dev++;
return -ENOENT;
}
-
+
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
@@ -1482,7 +1482,7 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
pci_set_drvdata(pci, card);
dev++;
return 0;
1
0

[alsa-devel] [PATCH 19/24] sound/pci: coding style fixes: sound/pci/r*
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/riptide/riptide.c | 22 +++---
sound/pci/rme32.c | 128 +++++++++++++-------------
sound/pci/rme96.c | 210 +++++++++++++++++++++---------------------
3 files changed, 180 insertions(+), 180 deletions(-)
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index e9f0706..04b21de 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -21,29 +21,29 @@
/*
History:
- 02/15/2004 first release
-
+
This Driver is based on the OSS Driver version from Linuxant (riptide-0.6lnxtbeta03111100)
credits from the original files:
-
- MODULE NAME: cnxt_rt.h
+
+ MODULE NAME: cnxt_rt.h
AUTHOR: K. Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 02/1/2000 KNL
- MODULE NAME: int_mdl.c
+ MODULE NAME: int_mdl.c
AUTHOR: Konstantin Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 10/01/99 KNL
-
- MODULE NAME: riptide.h
+
+ MODULE NAME: riptide.h
AUTHOR: O. Druzhinin (Transcribed by OLD)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 10/16/97 OLD
- MODULE NAME: Rp_Cmdif.cpp
+ MODULE NAME: Rp_Cmdif.cpp
AUTHOR: O. Druzhinin (Transcribed by OLD)
K. Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
@@ -51,7 +51,7 @@
Adopted from NT4 driver 6/22/99 OLD
Ported to Linux 9/01/99 KNL
- MODULE NAME: rt_hw.c
+ MODULE NAME: rt_hw.c
AUTHOR: O. Druzhinin (Transcribed by OLD)
C. Lazarev (Transcribed by CNL)
HISTORY: Major Revision Date By
@@ -73,13 +73,13 @@
----------------------------- -------- -----
Created 11/18/97 CNL
- MODULE NAME: rt_mdl.c
+ MODULE NAME: rt_mdl.c
AUTHOR: Konstantin Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 10/01/99 KNL
- MODULE NAME: mixer.h
+ MODULE NAME: mixer.h
AUTHOR: K. Kenney
HISTORY: Major Revision Date By
----------------------------- -------- -----
@@ -97,7 +97,7 @@
#include <linux/gameport.h>
#include <linux/device.h>
#include <linux/firmware.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index e7ef3a1..21ec1e2 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -6,7 +6,7 @@
*
* Thanks to : Anders Torger <torger(a)ludd.luth.se>,
* Henk Hesselink <henk(a)anda.nl>
- * for writing the digi96-driver
+ * for writing the digi96-driver
* and RME for all informations.
*
* This program is free software; you can redistribute it and/or modify
@@ -22,36 +22,36 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
+ *
+ *
* ****************************************************************************
- *
+ *
* Note #1 "Sek'd models" ................................... martin 2002-12-07
- *
+ *
* Identical soundcards by Sek'd were labeled:
* RME Digi 32 = Sek'd Prodif 32
* RME Digi 32 Pro = Sek'd Prodif 96
* RME Digi 32/8 = Sek'd Prodif Gold
- *
+ *
* ****************************************************************************
- *
+ *
* Note #2 "full duplex mode" ............................... martin 2002-12-07
- *
+ *
* Full duplex doesn't work. All cards (32, 32/8, 32Pro) are working identical
* in this mode. Rec data and play data are using the same buffer therefore. At
* first you have got the playing bits in the buffer and then (after playing
- * them) they were overwitten by the captured sound of the CS8412/14. Both
+ * them) they were overwitten by the captured sound of the CS8412/14. Both
* modes (play/record) are running harmonically hand in hand in the same buffer
- * and you have only one start bit plus one interrupt bit to control this
+ * and you have only one start bit plus one interrupt bit to control this
* paired action.
* This is opposite to the latter rme96 where playing and capturing is totally
- * separated and so their full duplex mode is supported by alsa (using two
- * start bits and two interrupts for two different buffers).
+ * separated and so their full duplex mode is supported by alsa (using two
+ * start bits and two interrupts for two different buffers).
* But due to the wrong sequence of playing and capturing ALSA shows no solved
* full duplex support for the rme32 at the moment. That's bad, but I'm not
* able to solve it. Are you motivated enough to solve this problem now? Your
* patch would be welcome!
- *
+ *
* ****************************************************************************
*
* "The story after the long seeking" -- tiwai
@@ -85,12 +85,12 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
-static int fullduplex[SNDRV_CARDS]; // = {[0 ... (SNDRV_CARDS - 1)] = 1};
+static int fullduplex[SNDRV_CARDS]; /* = {[0 ... (SNDRV_CARDS - 1)] = 1}; */
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for RME Digi32 soundcard.");
@@ -126,10 +126,10 @@ MODULE_SUPPORTED_DEVICE("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
#define RME32_WCR_MONO (1 << 1) /* 0=stereo, 1=mono
Setting the whole card to mono
doesn't seem to be very useful.
- A software-solution can handle
+ A software-solution can handle
full-duplex with one direction in
- stereo and the other way in mono.
- So, the hardware should work all
+ stereo and the other way in mono.
+ So, the hardware should work all
the time in stereo! */
#define RME32_WCR_MODE24 (1 << 2) /* 0=16bit, 1=32bit */
#define RME32_WCR_SEL (1 << 3) /* 0=input on output, 1=normal playback/capture */
@@ -304,13 +304,13 @@ static int snd_rme32_capture_copy(struct snd_pcm_substream *substream, int chann
static struct snd_pcm_hardware snd_rme32_spdif_info = {
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
- .formats = (SNDRV_PCM_FMTBIT_S16_LE |
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 32000,
.rate_max = 48000,
@@ -335,7 +335,7 @@ static struct snd_pcm_hardware snd_rme32_adat_info =
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
.formats= SNDRV_PCM_FMTBIT_S16_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -355,13 +355,13 @@ static struct snd_pcm_hardware snd_rme32_adat_info =
static struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
- .formats = (SNDRV_PCM_FMTBIT_S16_LE |
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 32000,
.rate_max = 48000,
@@ -386,7 +386,7 @@ static struct snd_pcm_hardware snd_rme32_adat_fd_info =
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
.formats= SNDRV_PCM_FMTBIT_S16_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -434,7 +434,7 @@ static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
int n;
*is_adat = 0;
- if (rme32->rcreg & RME32_RCR_LOCK) {
+ if (rme32->rcreg & RME32_RCR_LOCK) {
/* ADAT rate */
*is_adat = 1;
}
@@ -466,7 +466,7 @@ static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
default:
return -1;
break;
- }
+ }
else
switch (n) { /* supporting the CS8412 */
case 0:
@@ -499,38 +499,38 @@ static int snd_rme32_playback_setrate(struct rme32 * rme32, int rate)
switch (rate) {
case 32000:
rme32->wcreg &= ~RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case 44100:
rme32->wcreg &= ~RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
~RME32_WCR_FREQ_0;
break;
case 48000:
rme32->wcreg &= ~RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
case 64000:
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
return -EINVAL;
rme32->wcreg |= RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case 88200:
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
return -EINVAL;
rme32->wcreg |= RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
~RME32_WCR_FREQ_0;
break;
case 96000:
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
return -EINVAL;
rme32->wcreg |= RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
default:
@@ -552,22 +552,22 @@ static int snd_rme32_setclockmode(struct rme32 * rme32, int mode)
switch (mode) {
case RME32_CLOCKMODE_SLAVE:
/* AutoSync */
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case RME32_CLOCKMODE_MASTER_32:
/* Internal 32.0kHz */
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case RME32_CLOCKMODE_MASTER_44:
/* Internal 44.1kHz */
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
case RME32_CLOCKMODE_MASTER_48:
/* Internal 48.0kHz */
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
default:
@@ -587,19 +587,19 @@ static int snd_rme32_setinputtype(struct rme32 * rme32, int type)
{
switch (type) {
case RME32_INPUT_OPTICAL:
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) &
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) &
~RME32_WCR_INP_1;
break;
case RME32_INPUT_COAXIAL:
- rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) &
~RME32_WCR_INP_1;
break;
case RME32_INPUT_INTERNAL:
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) |
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) |
RME32_WCR_INP_1;
break;
case RME32_INPUT_XLR:
- rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) |
RME32_WCR_INP_1;
break;
default:
@@ -741,7 +741,7 @@ snd_rme32_capture_hw_params(struct snd_pcm_substream *substream,
if ((rate = snd_rme32_capture_getrate(rme32, &isadat)) > 0) {
if ((int)params_rate(params) != rate) {
spin_unlock_irq(&rme32->lock);
- return -EIO;
+ return -EIO;
}
if ((isadat && runtime->hw.channels_min == 2) ||
(!isadat && runtime->hw.channels_min == 8)) {
@@ -771,7 +771,7 @@ snd_rme32_capture_hw_params(struct snd_pcm_substream *substream,
static int snd_rme32_pcm_hw_free(struct snd_pcm_substream *substream)
{
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
- if (! rme32->fullduplex_mode)
+ if (!rme32->fullduplex_mode)
return 0;
return snd_pcm_lib_free_pages(substream);
}
@@ -800,7 +800,7 @@ static void snd_rme32_pcm_stop(struct rme32 * rme32, int to_pause)
if (rme32->wcreg & RME32_WCR_SEL)
rme32->wcreg |= RME32_WCR_MUTE;
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
- if (! to_pause)
+ if (!to_pause)
writel(0, rme32->iobase + RME32_IO_RESET_POS);
}
@@ -834,7 +834,7 @@ static struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
static void snd_rme32_set_buffer_constraint(struct rme32 *rme32, struct snd_pcm_runtime *runtime)
{
- if (! rme32->fullduplex_mode) {
+ if (!rme32->fullduplex_mode) {
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME32_BUFFER_SIZE, RME32_BUFFER_SIZE);
@@ -876,7 +876,7 @@ static int snd_rme32_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
snd_rme32_set_buffer_constraint(rme32, runtime);
@@ -931,10 +931,10 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
int rate, dummy;
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
-
+
snd_pcm_set_sync(substream);
- spin_lock_irq(&rme32->lock);
+ spin_lock_irq(&rme32->lock);
if (rme32->playback_substream != NULL) {
spin_unlock_irq(&rme32->lock);
return -EBUSY;
@@ -943,7 +943,7 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
rme32->playback_substream = substream;
spin_unlock_irq(&rme32->lock);
-
+
if (rme32->fullduplex_mode)
runtime->hw = snd_rme32_adat_fd_info;
else
@@ -954,7 +954,7 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
snd_rme32_set_buffer_constraint(rme32, runtime);
return 0;
@@ -981,8 +981,8 @@ snd_rme32_capture_adat_open(struct snd_pcm_substream *substream)
}
snd_pcm_set_sync(substream);
-
- spin_lock_irq(&rme32->lock);
+
+ spin_lock_irq(&rme32->lock);
if (rme32->capture_substream != NULL) {
spin_unlock_irq(&rme32->lock);
return -EBUSY;
@@ -1091,7 +1091,7 @@ snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
}
snd_pcm_trigger_done(s, substream);
}
-
+
/* prefill playback buffer */
if (cmd == SNDRV_PCM_TRIGGER_START && rme32->fullduplex_mode) {
snd_pcm_group_for_each_entry(s, substream) {
@@ -1108,7 +1108,7 @@ snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
snd_rme32_pcm_start(rme32, 0);
break;
case SNDRV_PCM_TRIGGER_STOP:
- if (! rme32->running && RME32_ISWORKING(rme32))
+ if (!rme32->running && RME32_ISWORKING(rme32))
snd_rme32_pcm_stop(rme32, 0);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
@@ -1402,23 +1402,23 @@ static int __devinit snd_rme32_create(struct rme32 * rme32)
1, 1, &rme32->adat_pcm)) < 0)
{
return err;
- }
+ }
rme32->adat_pcm->private_data = rme32;
rme32->adat_pcm->private_free = snd_rme32_free_adat_pcm;
strcpy(rme32->adat_pcm->name, "Digi32 ADAT");
if (rme32->fullduplex_mode) {
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_rme32_playback_adat_fd_ops);
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_rme32_capture_adat_fd_ops);
snd_pcm_lib_preallocate_pages_for_all(rme32->adat_pcm, SNDRV_DMA_TYPE_CONTINUOUS,
snd_dma_continuous_data(GFP_KERNEL),
0, RME32_MID_BUFFER_SIZE);
rme32->adat_pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
} else {
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_rme32_playback_adat_ops);
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_rme32_capture_adat_ops);
rme32->adat_pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
}
@@ -1561,7 +1561,7 @@ static void __devinit snd_rme32_proc_init(struct rme32 * rme32)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(rme32->card, "rme32", &entry))
+ if (!snd_card_proc_new(rme32->card, "rme32", &entry))
snd_info_set_text_ops(entry, rme32, snd_rme32_proc_read);
}
@@ -1697,9 +1697,9 @@ static int
snd_rme32_info_clockmode_control(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
- static char *texts[4] = { "AutoSync",
- "Internal 32.0kHz",
- "Internal 44.1kHz",
+ static char *texts[4] = { "AutoSync",
+ "Internal 32.0kHz",
+ "Internal 44.1kHz",
"Internal 48.0kHz" };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 3fdd488..fb8767e 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1,9 +1,9 @@
/*
* ALSA driver for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST audio
- * interfaces
+ * interfaces
*
* Copyright (c) 2000, 2001 Anders Torger <torger(a)ludd.luth.se>
- *
+ *
* Thanks to Henk Hesselink <henk(a)anda.nl> for the analog volume control
* code.
*
@@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#include <linux/delay.h>
#include <linux/init.h>
@@ -38,7 +38,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
/* note, two last pcis should be equal, it is not a bug */
@@ -205,7 +205,7 @@ struct rme96 {
int irq;
unsigned long port;
void __iomem *iobase;
-
+
u32 wcreg; /* cached write control register value */
u32 wcreg_spdif; /* S/PDIF setup */
u32 wcreg_spdif_stream; /* S/PDIF setup (temporary) */
@@ -220,13 +220,13 @@ struct rme96 {
int playback_frlog; /* log2 of framesize */
int capture_frlog;
-
+
size_t playback_periodsize; /* in bytes, zero if not used */
size_t capture_periodsize; /* in bytes, zero if not used */
struct snd_card *card;
struct snd_pcm *spdif_pcm;
- struct snd_pcm *adat_pcm;
+ struct snd_pcm *adat_pcm;
struct pci_dev *pci;
struct snd_kcontrol *spdif_ctl;
};
@@ -239,7 +239,7 @@ static struct pci_device_id snd_rme96_ids[] = {
{ PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
{ PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
{ 0, }
};
@@ -262,11 +262,11 @@ static int
snd_rme96_capture_prepare(struct snd_pcm_substream *substream);
static int
-snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
+snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
int cmd);
static int
-snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
+snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
int cmd);
static snd_pcm_uframes_t
@@ -275,7 +275,7 @@ snd_rme96_playback_pointer(struct snd_pcm_substream *substream);
static snd_pcm_uframes_t
snd_rme96_capture_pointer(struct snd_pcm_substream *substream);
-static void __devinit
+static void __devinit
snd_rme96_proc_init(struct rme96 *rme96);
static int
@@ -355,10 +355,10 @@ static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -384,10 +384,10 @@ static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -412,7 +412,7 @@ static struct snd_pcm_hardware snd_rme96_playback_adat_info =
SNDRV_PCM_INFO_PAUSE),
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -437,7 +437,7 @@ static struct snd_pcm_hardware snd_rme96_capture_adat_info =
SNDRV_PCM_INFO_PAUSE),
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -573,7 +573,7 @@ snd_rme96_setattenuation(struct rme96 *rme96,
static int
snd_rme96_capture_getrate(struct rme96 *rme96,
int *is_adat)
-{
+{
int n, rate;
*is_adat = 0;
@@ -610,14 +610,14 @@ snd_rme96_capture_getrate(struct rme96 *rme96,
if (rme96->rcreg & RME96_RCR_VERF) {
return -1;
}
-
+
/* S/PDIF rate */
n = ((rme96->rcreg >> RME96_RCR_BITPOS_F0) & 1) +
(((rme96->rcreg >> RME96_RCR_BITPOS_F1) & 1) << 1) +
(((rme96->rcreg >> RME96_RCR_BITPOS_F2) & 1) << 2);
-
+
switch (n) {
- case 0:
+ case 0:
if (rme96->rcreg & RME96_RCR_T_OUT) {
return 64000;
}
@@ -763,7 +763,7 @@ snd_rme96_setclockmode(struct rme96 *rme96,
{
switch (mode) {
case RME96_CLOCKMODE_SLAVE:
- /* AutoSync */
+ /* AutoSync */
rme96->wcreg &= ~RME96_WCR_MASTER;
rme96->areg &= ~RME96_AR_WSEL;
break;
@@ -774,7 +774,7 @@ snd_rme96_setclockmode(struct rme96 *rme96,
break;
case RME96_CLOCKMODE_WORDCLOCK:
/* Word clock is a master mode */
- rme96->wcreg |= RME96_WCR_MASTER;
+ rme96->wcreg |= RME96_WCR_MASTER;
rme96->areg |= RME96_AR_WSEL;
break;
default:
@@ -872,7 +872,7 @@ snd_rme96_setframelog(struct rme96 *rme96,
int is_playback)
{
int frlog;
-
+
if (n_channels == 2) {
frlog = 1;
} else {
@@ -964,7 +964,7 @@ snd_rme96_playback_hw_params(struct snd_pcm_substream *substream,
/* slave clock */
if ((int)params_rate(params) != rate) {
spin_unlock_irq(&rme96->lock);
- return -EIO;
+ return -EIO;
}
} else if ((err = snd_rme96_playback_setrate(rme96, params_rate(params))) < 0) {
spin_unlock_irq(&rme96->lock);
@@ -992,7 +992,7 @@ snd_rme96_playback_hw_params(struct snd_pcm_substream *substream,
writel(rme96->wcreg |= rme96->wcreg_spdif_stream, rme96->iobase + RME96_IO_CONTROL_REGISTER);
}
spin_unlock_irq(&rme96->lock);
-
+
return 0;
}
@@ -1003,7 +1003,7 @@ snd_rme96_capture_hw_params(struct snd_pcm_substream *substream,
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err, isadat, rate;
-
+
runtime->dma_area = (void __force *)(rme96->iobase +
RME96_IO_REC_BUFFER);
runtime->dma_addr = rme96->port + RME96_IO_REC_BUFFER;
@@ -1024,7 +1024,7 @@ snd_rme96_capture_hw_params(struct snd_pcm_substream *substream,
} else if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) {
if ((int)params_rate(params) != rate) {
spin_unlock_irq(&rme96->lock);
- return -EIO;
+ return -EIO;
}
if ((isadat && runtime->hw.channels_min == 2) ||
(!isadat && runtime->hw.channels_min == 8))
@@ -1084,7 +1084,7 @@ snd_rme96_playback_stop(struct rme96 *rme96)
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
if (rme96->rcreg & RME96_RCR_IRQ) {
writel(0, rme96->iobase + RME96_IO_CONFIRM_PLAY_IRQ);
- }
+ }
rme96->wcreg &= ~RME96_WCR_START;
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
}
@@ -1095,7 +1095,7 @@ snd_rme96_capture_stop(struct rme96 *rme96)
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
if (rme96->rcreg & RME96_RCR_IRQ_2) {
writel(0, rme96->iobase + RME96_IO_CONFIRM_REC_IRQ);
- }
+ }
rme96->wcreg &= ~RME96_WCR_START_2;
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
}
@@ -1113,7 +1113,7 @@ snd_rme96_interrupt(int irq,
{
return IRQ_NONE;
}
-
+
if (rme96->rcreg & RME96_RCR_IRQ) {
/* playback */
snd_pcm_period_elapsed(rme96->playback_substream);
@@ -1121,7 +1121,7 @@ snd_rme96_interrupt(int irq,
}
if (rme96->rcreg & RME96_RCR_IRQ_2) {
/* capture */
- snd_pcm_period_elapsed(rme96->capture_substream);
+ snd_pcm_period_elapsed(rme96->capture_substream);
writel(0, rme96->iobase + RME96_IO_CONFIRM_REC_IRQ);
}
return IRQ_HANDLED;
@@ -1161,7 +1161,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
- spin_lock_irq(&rme96->lock);
+ spin_lock_irq(&rme96->lock);
if (rme96->playback_substream != NULL) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
@@ -1180,7 +1180,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
rme96_set_buffer_size_constraint(rme96, runtime);
rme96->wcreg_spdif_stream = rme96->wcreg_spdif;
@@ -1208,7 +1208,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
-
+
spin_lock_irq(&rme96->lock);
if (rme96->capture_substream != NULL) {
spin_unlock_irq(&rme96->lock);
@@ -1216,7 +1216,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
}
rme96->capture_substream = substream;
spin_unlock_irq(&rme96->lock);
-
+
rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}
@@ -1226,9 +1226,9 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
{
int rate, dummy;
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
- struct snd_pcm_runtime *runtime = substream->runtime;
-
- spin_lock_irq(&rme96->lock);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+
+ spin_lock_irq(&rme96->lock);
if (rme96->playback_substream != NULL) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
@@ -1237,7 +1237,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
rme96->playback_substream = substream;
spin_unlock_irq(&rme96->lock);
-
+
runtime->hw = snd_rme96_playback_adat_info;
if (!(rme96->wcreg & RME96_WCR_MASTER) &&
snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
@@ -1247,7 +1247,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}
@@ -1273,8 +1273,8 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (rme96->capture_substream != NULL) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
@@ -1292,7 +1292,7 @@ snd_rme96_playback_close(struct snd_pcm_substream *substream)
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
int spdif = 0;
- spin_lock_irq(&rme96->lock);
+ spin_lock_irq(&rme96->lock);
if (RME96_ISPLAYING(rme96)) {
snd_rme96_playback_stop(rme96);
}
@@ -1312,8 +1312,8 @@ static int
snd_rme96_capture_close(struct snd_pcm_substream *substream)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (RME96_ISRECORDING(rme96)) {
snd_rme96_capture_stop(rme96);
}
@@ -1327,8 +1327,8 @@ static int
snd_rme96_playback_prepare(struct snd_pcm_substream *substream)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (RME96_ISPLAYING(rme96)) {
snd_rme96_playback_stop(rme96);
}
@@ -1341,8 +1341,8 @@ static int
snd_rme96_capture_prepare(struct snd_pcm_substream *substream)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (RME96_ISRECORDING(rme96)) {
snd_rme96_capture_stop(rme96);
}
@@ -1352,7 +1352,7 @@ snd_rme96_capture_prepare(struct snd_pcm_substream *substream)
}
static int
-snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
+snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
@@ -1387,7 +1387,7 @@ snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
snd_rme96_playback_start(rme96, 1);
}
break;
-
+
default:
return -EINVAL;
}
@@ -1395,7 +1395,7 @@ snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
}
static int
-snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
+snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
@@ -1430,7 +1430,7 @@ snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
snd_rme96_capture_start(rme96, 1);
}
break;
-
+
default:
return -EINVAL;
}
@@ -1573,8 +1573,8 @@ snd_rme96_create(struct rme96 *rme96)
rme96->irq = pci->irq;
/* read the card's revision number */
- pci_read_config_byte(pci, 8, &rme96->rev);
-
+ pci_read_config_byte(pci, 8, &rme96->rev);
+
/* set up ALSA pcm device for S/PDIF */
if ((err = snd_pcm_new(rme96->card, "Digi96 IEC958", 0,
1, 1, &rme96->spdif_pcm)) < 0)
@@ -1598,23 +1598,23 @@ snd_rme96_create(struct rme96 *rme96)
1, 1, &rme96->adat_pcm)) < 0)
{
return err;
- }
+ }
rme96->adat_pcm->private_data = rme96;
rme96->adat_pcm->private_free = snd_rme96_free_adat_pcm;
strcpy(rme96->adat_pcm->name, "Digi96 ADAT");
snd_pcm_set_ops(rme96->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_rme96_playback_adat_ops);
snd_pcm_set_ops(rme96->adat_pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_rme96_capture_adat_ops);
-
+
rme96->adat_pcm->info_flags = 0;
}
rme96->playback_periodsize = 0;
rme96->capture_periodsize = 0;
-
+
/* make sure playback/capture is stopped, if by some reason active */
snd_rme96_playback_stop(rme96);
snd_rme96_capture_stop(rme96);
-
+
/* set default values in registers */
rme96->wcreg =
RME96_WCR_FREQ_1 | /* set 44.1 kHz playback */
@@ -1626,11 +1626,11 @@ snd_rme96_create(struct rme96 *rme96)
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
-
+
/* reset the ADC */
writel(rme96->areg | RME96_AR_PD2,
rme96->iobase + RME96_IO_ADDITIONAL_REG);
- writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
+ writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
/* reset and enable the DAC (order is important). */
snd_rme96_reset_dac(rme96);
@@ -1646,7 +1646,7 @@ snd_rme96_create(struct rme96 *rme96)
if (RME96_HAS_ANALOG_OUT(rme96)) {
snd_rme96_apply_dac_volume(rme96);
}
-
+
/* init switch interface */
if ((err = snd_rme96_create_switches(rme96->card, rme96)) < 0) {
return err;
@@ -1654,7 +1654,7 @@ snd_rme96_create(struct rme96 *rme96)
/* init proc interface */
snd_rme96_proc_init(rme96);
-
+
return 0;
}
@@ -1662,12 +1662,12 @@ snd_rme96_create(struct rme96 *rme96)
* proc interface
*/
-static void
+static void
snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
int n;
struct rme96 *rme96 = (struct rme96 *)entry->private_data;
-
+
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
snd_iprintf(buffer, rme96->card->longname);
@@ -1681,7 +1681,7 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer
snd_iprintf(buffer, " period size: 2048 bytes\n");
} else {
snd_iprintf(buffer, " period size: 8192 bytes\n");
- }
+ }
snd_iprintf(buffer, "\nInput settings\n");
switch (snd_rme96_getinputtype(rme96)) {
case RME96_INPUT_OPTICAL:
@@ -1716,7 +1716,7 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer
} else {
snd_iprintf(buffer, " sample format: 16 bit\n");
}
-
+
snd_iprintf(buffer, "\nOutput settings\n");
if (rme96->wcreg & RME96_WCR_SEL) {
snd_iprintf(buffer, " output signal: normal playback\n");
@@ -1791,12 +1791,12 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer
}
}
-static void __devinit
+static void __devinit
snd_rme96_proc_init(struct rme96 *rme96)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(rme96->card, "rme96", &entry))
+ if (!snd_card_proc_new(rme96->card, "rme96", &entry))
snd_info_set_text_ops(entry, rme96, snd_rme96_proc_read);
}
@@ -1810,7 +1810,7 @@ static int
snd_rme96_get_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.integer.value[0] = rme96->wcreg & RME96_WCR_SEL ? 0 : 1;
spin_unlock_irq(&rme96->lock);
@@ -1822,7 +1822,7 @@ snd_rme96_put_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.integer.value[0] ? 0 : RME96_WCR_SEL;
spin_lock_irq(&rme96->lock);
val = (rme96->wcreg & ~RME96_WCR_SEL) | val;
@@ -1839,7 +1839,7 @@ snd_rme96_info_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_e
static char *_texts[5] = { "Optical", "Coaxial", "Internal", "XLR", "Analog" };
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
char *texts[5] = { _texts[0], _texts[1], _texts[2], _texts[3], _texts[4] };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
switch (rme96->pci->device) {
@@ -1875,10 +1875,10 @@ snd_rme96_get_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int items = 3;
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getinputtype(rme96);
-
+
switch (rme96->pci->device) {
case PCI_DEVICE_ID_RME_DIGI96:
case PCI_DEVICE_ID_RME_DIGI96_8:
@@ -1905,7 +1905,7 @@ snd_rme96_get_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
if (ucontrol->value.enumerated.item[0] >= items) {
ucontrol->value.enumerated.item[0] = items - 1;
}
-
+
spin_unlock_irq(&rme96->lock);
return 0;
}
@@ -1915,7 +1915,7 @@ snd_rme96_put_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change, items = 3;
-
+
switch (rme96->pci->device) {
case PCI_DEVICE_ID_RME_DIGI96:
case PCI_DEVICE_ID_RME_DIGI96_8:
@@ -1936,14 +1936,14 @@ snd_rme96_put_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
break;
}
val = ucontrol->value.enumerated.item[0] % items;
-
+
/* special case for PST */
if (rme96->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST && rme96->rev > 4) {
if (val == RME96_INPUT_XLR) {
val = RME96_INPUT_ANALOG;
}
}
-
+
spin_lock_irq(&rme96->lock);
change = (int)val != snd_rme96_getinputtype(rme96);
snd_rme96_setinputtype(rme96, val);
@@ -1955,7 +1955,7 @@ static int
snd_rme96_info_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[3] = { "AutoSync", "Internal", "Word" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -1969,7 +1969,7 @@ static int
snd_rme96_get_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getclockmode(rme96);
spin_unlock_irq(&rme96->lock);
@@ -1981,7 +1981,7 @@ snd_rme96_put_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.enumerated.item[0] % 3;
spin_lock_irq(&rme96->lock);
change = (int)val != snd_rme96_getclockmode(rme96);
@@ -1994,7 +1994,7 @@ static int
snd_rme96_info_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[4] = { "0 dB", "-6 dB", "-12 dB", "-18 dB" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 4;
@@ -2008,7 +2008,7 @@ static int
snd_rme96_get_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getattenuation(rme96);
spin_unlock_irq(&rme96->lock);
@@ -2020,7 +2020,7 @@ snd_rme96_put_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.enumerated.item[0] % 4;
spin_lock_irq(&rme96->lock);
@@ -2034,7 +2034,7 @@ static int
snd_rme96_info_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[4] = { "1+2", "3+4", "5+6", "7+8" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 4;
@@ -2048,7 +2048,7 @@ static int
snd_rme96_get_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getmontracks(rme96);
spin_unlock_irq(&rme96->lock);
@@ -2060,7 +2060,7 @@ snd_rme96_put_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.enumerated.item[0] % 4;
spin_lock_irq(&rme96->lock);
change = (int)val != snd_rme96_getmontracks(rme96);
@@ -2101,7 +2101,7 @@ static int snd_rme96_control_spdif_info(struct snd_kcontrol *kcontrol, struct sn
static int snd_rme96_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif);
return 0;
}
@@ -2111,7 +2111,7 @@ static int snd_rme96_control_spdif_put(struct snd_kcontrol *kcontrol, struct snd
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme96_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme96->lock);
change = val != rme96->wcreg_spdif;
@@ -2130,7 +2130,7 @@ static int snd_rme96_control_spdif_stream_info(struct snd_kcontrol *kcontrol, st
static int snd_rme96_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif_stream);
return 0;
}
@@ -2140,7 +2140,7 @@ static int snd_rme96_control_spdif_stream_put(struct snd_kcontrol *kcontrol, str
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme96_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme96->lock);
change = val != rme96->wcreg_spdif_stream;
@@ -2169,7 +2169,7 @@ static int
snd_rme96_dac_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
@@ -2258,9 +2258,9 @@ static struct snd_kcontrol_new snd_rme96_controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Input Connector",
- .info = snd_rme96_info_inputtype_control,
+ .info = snd_rme96_info_inputtype_control,
.get = snd_rme96_get_inputtype_control,
- .put = snd_rme96_put_inputtype_control
+ .put = snd_rme96_put_inputtype_control
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -2272,21 +2272,21 @@ static struct snd_kcontrol_new snd_rme96_controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Sample Clock Source",
- .info = snd_rme96_info_clockmode_control,
+ .info = snd_rme96_info_clockmode_control,
.get = snd_rme96_get_clockmode_control,
.put = snd_rme96_put_clockmode_control
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Monitor Tracks",
- .info = snd_rme96_info_montracks_control,
+ .info = snd_rme96_info_montracks_control,
.get = snd_rme96_get_montracks_control,
.put = snd_rme96_put_montracks_control
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Attenuation",
- .info = snd_rme96_info_attenuation_control,
+ .info = snd_rme96_info_attenuation_control,
.get = snd_rme96_get_attenuation_control,
.put = snd_rme96_put_attenuation_control
},
@@ -2318,7 +2318,7 @@ snd_rme96_create_switches(struct snd_card *card,
if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_rme96_controls[idx], rme96))) < 0)
return err;
}
-
+
return 0;
}
@@ -2352,7 +2352,7 @@ snd_rme96_probe(struct pci_dev *pci,
sizeof(struct rme96))) == NULL)
return -ENOMEM;
card->private_free = snd_rme96_card_free;
- rme96 = (struct rme96 *)card->private_data;
+ rme96 = (struct rme96 *)card->private_data;
rme96->card = card;
rme96->pci = pci;
snd_card_set_dev(card, &pci->dev);
@@ -2360,7 +2360,7 @@ snd_rme96_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
strcpy(card->driver, "Digi96");
switch (rme96->pci->device) {
case PCI_DEVICE_ID_RME_DIGI96:
@@ -2383,10 +2383,10 @@ snd_rme96_probe(struct pci_dev *pci,
}
sprintf(card->longname, "%s at 0x%lx, irq %d", card->shortname,
rme96->port, rme96->irq);
-
+
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
- return err;
+ return err;
}
pci_set_drvdata(pci, card);
dev++;
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/rme9652/hdsp.c | 530 +++++++++++++++++++++---------------------
sound/pci/rme9652/hdspm.c | 114 +++++-----
sound/pci/rme9652/rme9652.c | 146 ++++++------
3 files changed, 395 insertions(+), 395 deletions(-)
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index d723543..de05602 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -41,7 +41,7 @@
#include <asm/byteorder.h>
#include <asm/current.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -113,7 +113,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
/* the meters are regular i/o-mapped registers, but offset
considerably from the rest. the peak registers are reset
- when read; the least-significant 4 bits are full-scale counters;
+ when read; the least-significant 4 bits are full-scale counters;
the actual peak value is in the most-significant 24 bits.
*/
@@ -131,7 +131,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
26*3 values are read in ss mode
14*3 in ds mode, with no gap between values
*/
-#define HDSP_9652_peakBase 7164
+#define HDSP_9652_peakBase 7164
#define HDSP_9652_rmsBase 4096
/* c.f. the hdsp_9632_meters_t struct */
@@ -173,12 +173,12 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
#define HDSP_SPDIFEmphasis (1<<10) /* 0=none, 1=on */
#define HDSP_SPDIFNonAudio (1<<11) /* 0=off, 1=on */
#define HDSP_SPDIFOpticalOut (1<<12) /* 1=use 1st ADAT connector for SPDIF, 0=do not */
-#define HDSP_SyncRef2 (1<<13)
-#define HDSP_SPDIFInputSelect0 (1<<14)
-#define HDSP_SPDIFInputSelect1 (1<<15)
-#define HDSP_SyncRef0 (1<<16)
+#define HDSP_SyncRef2 (1<<13)
+#define HDSP_SPDIFInputSelect0 (1<<14)
+#define HDSP_SPDIFInputSelect1 (1<<15)
+#define HDSP_SyncRef0 (1<<16)
#define HDSP_SyncRef1 (1<<17)
-#define HDSP_AnalogExtensionBoard (1<<18) /* For H9632 cards */
+#define HDSP_AnalogExtensionBoard (1<<18) /* For H9632 cards */
#define HDSP_XLRBreakoutCable (1<<20) /* For H9632 cards */
#define HDSP_Midi0InterruptEnable (1<<22)
#define HDSP_Midi1InterruptEnable (1<<23)
@@ -314,7 +314,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
#define HDSP_TimecodeSync (1<<27)
#define HDSP_AEBO (1<<28) /* H9632 specific Analog Extension Boards */
#define HDSP_AEBI (1<<29) /* 0 = present, 1 = absent */
-#define HDSP_midi0IRQPending (1<<30)
+#define HDSP_midi0IRQPending (1<<30)
#define HDSP_midi1IRQPending (1<<31)
#define HDSP_spdifFrequencyMask (HDSP_spdifFrequency0|HDSP_spdifFrequency1|HDSP_spdifFrequency2)
@@ -391,7 +391,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
#define HDSP_CHANNEL_BUFFER_BYTES (4*HDSP_CHANNEL_BUFFER_SAMPLES)
/* the size of the area we need to allocate for DMA transfers. the
- size is the same regardless of the number of channels - the
+ size is the same regardless of the number of channels - the
Multiface still uses the same memory area.
Note that we allocate 1 more channel than is apparently needed
@@ -460,7 +460,7 @@ struct hdsp {
unsigned char qs_in_channels; /* quad speed mode for H9632 */
unsigned char ds_in_channels;
unsigned char ss_in_channels; /* different for multiface/digiface */
- unsigned char qs_out_channels;
+ unsigned char qs_out_channels;
unsigned char ds_out_channels;
unsigned char ss_out_channels;
@@ -502,9 +502,9 @@ static char channel_map_df_ss[HDSP_MAX_CHANNELS] = {
static char channel_map_mf_ss[HDSP_MAX_CHANNELS] = { /* Multiface */
/* Analog */
- 0, 1, 2, 3, 4, 5, 6, 7,
+ 0, 1, 2, 3, 4, 5, 6, 7,
/* ADAT 2 */
- 16, 17, 18, 19, 20, 21, 22, 23,
+ 16, 17, 18, 19, 20, 21, 22, 23,
/* SPDIF */
24, 25,
-1, -1, -1, -1, -1, -1, -1, -1
@@ -525,11 +525,11 @@ static char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = {
/* SPDIF */
8, 9,
/* Analog */
- 10, 11,
+ 10, 11,
/* AO4S-192 and AI4S-192 extension boards */
12, 13, 14, 15,
/* others don't exist */
- -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1
};
@@ -539,7 +539,7 @@ static char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = {
/* SPDIF */
8, 9,
/* Analog */
- 10, 11,
+ 10, 11,
/* AO4S-192 and AI4S-192 extension boards */
12, 13, 14, 15,
/* others don't exist */
@@ -587,7 +587,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
static struct pci_device_id snd_hdsp_ids[] = {
{
.vendor = PCI_VENDOR_ID_XILINX,
- .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
+ .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
}, /* RME Hammerfall-DSP */
@@ -599,15 +599,15 @@ MODULE_DEVICE_TABLE(pci, snd_hdsp_ids);
/* prototypes */
static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp);
static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp);
-static int snd_hdsp_enable_io (struct hdsp *hdsp);
-static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp);
-static void snd_hdsp_initialize_channels (struct hdsp *hdsp);
+static int snd_hdsp_enable_io(struct hdsp *hdsp);
+static void snd_hdsp_initialize_midi_flush(struct hdsp *hdsp);
+static void snd_hdsp_initialize_channels(struct hdsp *hdsp);
static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout);
static int hdsp_autosync_ref(struct hdsp *hdsp);
static int snd_hdsp_set_defaults(struct hdsp *hdsp);
-static void snd_hdsp_9652_enable_mixer (struct hdsp *hdsp);
+static void snd_hdsp_9652_enable_mixer(struct hdsp *hdsp);
-static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
+static int hdsp_playback_to_output_key(struct hdsp *hdsp, int in, int out)
{
switch (hdsp->io_type) {
case Multiface:
@@ -624,7 +624,7 @@ static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
}
}
-static int hdsp_input_to_output_key (struct hdsp *hdsp, int in, int out)
+static int hdsp_input_to_output_key(struct hdsp *hdsp, int in, int out)
{
switch (hdsp->io_type) {
case Multiface:
@@ -651,7 +651,7 @@ static unsigned int hdsp_read(struct hdsp *hdsp, int reg)
return readl (hdsp->iobase + reg);
}
-static int hdsp_check_for_iobox (struct hdsp *hdsp)
+static int hdsp_check_for_iobox(struct hdsp *hdsp)
{
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
@@ -670,19 +670,19 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
unsigned long flags;
if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
-
+
snd_printk ("Hammerfall-DSP: loading firmware\n");
hdsp_write (hdsp, HDSP_control2Reg, HDSP_S_PROGRAM);
hdsp_write (hdsp, HDSP_fifoData, 0);
-
+
if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
snd_printk ("Hammerfall-DSP: timeout waiting for download preparation\n");
return -EIO;
}
-
+
hdsp_write (hdsp, HDSP_control2Reg, HDSP_S_LOAD);
-
+
for (i = 0; i < 24413; ++i) {
hdsp_write(hdsp, HDSP_fifoData, hdsp->firmware_cache[i]);
if (hdsp_fifo_wait (hdsp, 127, HDSP_LONG_WAIT)) {
@@ -692,7 +692,7 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
}
ssleep(3);
-
+
if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
snd_printk ("Hammerfall-DSP: timeout at end of firmware loading\n");
return -EIO;
@@ -705,15 +705,15 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
#endif
hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
snd_printk ("Hammerfall-DSP: finished firmware loading\n");
-
+
}
if (hdsp->state & HDSP_InitializationComplete) {
snd_printk(KERN_INFO "Hammerfall-DSP: firmware loaded from cache, restoring defaults\n");
spin_lock_irqsave(&hdsp->lock, flags);
snd_hdsp_set_defaults(hdsp);
- spin_unlock_irqrestore(&hdsp->lock, flags);
+ spin_unlock_irqrestore(&hdsp->lock, flags);
}
-
+
hdsp->state |= HDSP_FirmwareLoaded;
return 0;
@@ -722,7 +722,7 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
static int hdsp_get_iobox_version (struct hdsp *hdsp)
{
if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
-
+
hdsp_write (hdsp, HDSP_control2Reg, HDSP_PROGRAM);
hdsp_write (hdsp, HDSP_fifoData, 0);
if (hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT) < 0)
@@ -738,7 +738,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT);
} else {
hdsp->io_type = Digiface;
- }
+ }
} else {
/* firmware was already loaded, get iobox type */
if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1)
@@ -754,19 +754,19 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
static int hdsp_request_fw_loader(struct hdsp *hdsp);
#endif
-static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
+static int hdsp_check_for_firmware(struct hdsp *hdsp, int load_on_demand)
{
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
hdsp->state &= ~HDSP_FirmwareLoaded;
- if (! load_on_demand)
+ if (!load_on_demand)
return -EIO;
snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n");
/* try to load firmware */
- if (! (hdsp->state & HDSP_FirmwareCached)) {
+ if (!(hdsp->state & HDSP_FirmwareCached)) {
#ifdef HDSP_FW_LOADER
- if (! hdsp_request_fw_loader(hdsp))
+ if (!hdsp_request_fw_loader(hdsp))
return 0;
#endif
snd_printk(KERN_ERR
@@ -786,13 +786,13 @@ static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout)
-{
+{
int i;
/* the fifoStatus registers reports on how many words
are available in the command FIFO.
*/
-
+
for (i = 0; i < timeout; i++) {
if ((int)(hdsp_read (hdsp, HDSP_fifoStatus) & 0xff) <= count)
@@ -824,11 +824,11 @@ static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short
if (addr >= HDSP_MATRIX_MIXER_SIZE)
return -1;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) {
/* from martin bjornsen:
-
+
"You can only write dwords to the
mixer memory which contain two
mixer values in the low and high
@@ -847,7 +847,7 @@ static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short
hdsp->mixer_matrix[addr] = data;
-
+
/* `addr' addresses a 16-bit wide address, but
the address space accessed via hdsp_write
uses byte offsets. put another way, addr
@@ -856,17 +856,17 @@ static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short
to access 0 to 2703 ...
*/
ad = addr/2;
-
- hdsp_write (hdsp, 4096 + (ad*4),
- (hdsp->mixer_matrix[(addr&0x7fe)+1] << 16) +
+
+ hdsp_write (hdsp, 4096 + (ad*4),
+ (hdsp->mixer_matrix[(addr&0x7fe)+1] << 16) +
hdsp->mixer_matrix[addr&0x7fe]);
-
+
return 0;
} else {
ad = (addr << 16) + data;
-
+
if (hdsp_fifo_wait(hdsp, 127, HDSP_LONG_WAIT))
return -1;
@@ -902,7 +902,7 @@ static int hdsp_spdif_sample_rate(struct hdsp *hdsp)
if (status & HDSP_SPDIFErrorFlag)
return 0;
-
+
switch (rate_bits) {
case HDSP_spdifFrequency32KHz: return 32000;
case HDSP_spdifFrequency44_1KHz: return 44100;
@@ -910,13 +910,13 @@ static int hdsp_spdif_sample_rate(struct hdsp *hdsp)
case HDSP_spdifFrequency64KHz: return 64000;
case HDSP_spdifFrequency88_2KHz: return 88200;
case HDSP_spdifFrequency96KHz: return 96000;
- case HDSP_spdifFrequency128KHz:
+ case HDSP_spdifFrequency128KHz:
if (hdsp->io_type == H9632) return 128000;
break;
- case HDSP_spdifFrequency176_4KHz:
+ case HDSP_spdifFrequency176_4KHz:
if (hdsp->io_type == H9632) return 176400;
break;
- case HDSP_spdifFrequency192KHz:
+ case HDSP_spdifFrequency192KHz:
if (hdsp->io_type == H9632) return 192000;
break;
default:
@@ -1027,7 +1027,7 @@ static void hdsp_set_dds_value(struct hdsp *hdsp, int rate)
{
u64 n;
u32 r;
-
+
if (rate >= 112000)
rate /= 4;
else if (rate >= 56000)
@@ -1053,35 +1053,35 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
there is no need for it (e.g. during module
initialization).
*/
-
- if (!(hdsp->control_register & HDSP_ClockModeMaster)) {
+
+ if (!(hdsp->control_register & HDSP_ClockModeMaster)) {
if (called_internally) {
/* request from ctl or card initialization */
snd_printk(KERN_ERR "Hammerfall-DSP: device is not running as a clock master: cannot set sample rate.\n");
return -1;
- } else {
+ } else {
/* hw_param request while in AutoSync mode */
int external_freq = hdsp_external_sample_rate(hdsp);
int spdif_freq = hdsp_spdif_sample_rate(hdsp);
-
+
if ((spdif_freq == external_freq*2) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in double speed mode\n");
else if (hdsp->io_type == H9632 && (spdif_freq == external_freq*4) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
- snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in quad speed mode\n");
+ snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in quad speed mode\n");
else if (rate != external_freq) {
snd_printk(KERN_INFO "Hammerfall-DSP: No AutoSync source for requested rate\n");
return -1;
- }
- }
+ }
+ }
}
current_rate = hdsp->system_sample_rate;
/* Changing from a "single speed" to a "double speed" rate is
not allowed if any substreams are open. This is because
- such a change causes a shift in the location of
+ such a change causes a shift in the location of
the DMA buffers and a reduction in the number of available
- buffers.
+ buffers.
Note that a similar but essentially insoluble problem
exists for externally-driven rate changes. All we can do
@@ -1089,7 +1089,7 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
if (rate > 96000 && hdsp->io_type != H9632)
return -EINVAL;
-
+
switch (rate) {
case 32000:
if (current_rate > 48000)
@@ -1179,7 +1179,7 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
break;
}
}
-
+
hdsp->system_sample_rate = rate;
return 0;
@@ -1189,7 +1189,7 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
MIDI
----------------------------------------------------------------------------*/
-static unsigned char snd_hdsp_midi_read_byte (struct hdsp *hdsp, int id)
+static unsigned char snd_hdsp_midi_read_byte(struct hdsp *hdsp, int id)
{
/* the hardware already does the relevant bit-mask with 0xff */
if (id)
@@ -1198,7 +1198,7 @@ static unsigned char snd_hdsp_midi_read_byte (struct hdsp *hdsp, int id)
return hdsp_read(hdsp, HDSP_midiDataIn0);
}
-static void snd_hdsp_midi_write_byte (struct hdsp *hdsp, int id, int val)
+static void snd_hdsp_midi_write_byte(struct hdsp *hdsp, int id, int val)
{
/* the hardware already does the relevant bit-mask with 0xff */
if (id)
@@ -1207,7 +1207,7 @@ static void snd_hdsp_midi_write_byte (struct hdsp *hdsp, int id, int val)
hdsp_write(hdsp, HDSP_midiDataOut0, val);
}
-static int snd_hdsp_midi_input_available (struct hdsp *hdsp, int id)
+static int snd_hdsp_midi_input_available(struct hdsp *hdsp, int id)
{
if (id)
return (hdsp_read(hdsp, HDSP_midiStatusIn1) & 0xff);
@@ -1215,7 +1215,7 @@ static int snd_hdsp_midi_input_available (struct hdsp *hdsp, int id)
return (hdsp_read(hdsp, HDSP_midiStatusIn0) & 0xff);
}
-static int snd_hdsp_midi_output_possible (struct hdsp *hdsp, int id)
+static int snd_hdsp_midi_output_possible(struct hdsp *hdsp, int id)
{
int fifo_bytes_used;
@@ -1230,13 +1230,13 @@ static int snd_hdsp_midi_output_possible (struct hdsp *hdsp, int id)
return 0;
}
-static void snd_hdsp_flush_midi_input (struct hdsp *hdsp, int id)
+static void snd_hdsp_flush_midi_input(struct hdsp *hdsp, int id)
{
while (snd_hdsp_midi_input_available (hdsp, id))
snd_hdsp_midi_read_byte (hdsp, id);
}
-static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi)
+static int snd_hdsp_midi_output_write(struct hdsp_midi *hmidi)
{
unsigned long flags;
int n_pending;
@@ -1245,16 +1245,16 @@ static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi)
unsigned char buf[128];
/* Output is not interrupt driven */
-
+
spin_lock_irqsave (&hmidi->lock, flags);
if (hmidi->output) {
if (!snd_rawmidi_transmit_empty (hmidi->output)) {
if ((n_pending = snd_hdsp_midi_output_possible (hmidi->hdsp, hmidi->id)) > 0) {
if (n_pending > (int)sizeof (buf))
n_pending = sizeof (buf);
-
+
if ((to_write = snd_rawmidi_transmit (hmidi->output, buf, n_pending)) > 0) {
- for (i = 0; i < to_write; ++i)
+ for (i = 0; i < to_write; ++i)
snd_hdsp_midi_write_byte (hmidi->hdsp, hmidi->id, buf[i]);
}
}
@@ -1264,7 +1264,7 @@ static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi)
return 0;
}
-static int snd_hdsp_midi_input_read (struct hdsp_midi *hmidi)
+static int snd_hdsp_midi_input_read(struct hdsp_midi *hmidi)
{
unsigned char buf[128]; /* this buffer is designed to match the MIDI input FIFO size */
unsigned long flags;
@@ -1325,14 +1325,14 @@ static void snd_hdsp_midi_output_timer(unsigned long data)
{
struct hdsp_midi *hmidi = (struct hdsp_midi *) data;
unsigned long flags;
-
+
snd_hdsp_midi_output_write(hmidi);
spin_lock_irqsave (&hmidi->lock, flags);
/* this does not bump hmidi->istimer, because the
kernel automatically removed the timer when it
expired, and we are now adding it back, thus
- leaving istimer wherever it was set before.
+ leaving istimer wherever it was set before.
*/
if (hmidi->istimer) {
@@ -1435,7 +1435,7 @@ static struct snd_rawmidi_ops snd_hdsp_midi_input =
.trigger = snd_hdsp_midi_input_trigger,
};
-static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
+static int snd_hdsp_create_midi(struct snd_card *card, struct hdsp *hdsp, int id)
{
char buf[32];
@@ -1501,7 +1501,7 @@ static int snd_hdsp_control_spdif_info(struct snd_kcontrol *kcontrol, struct snd
static int snd_hdsp_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif);
return 0;
}
@@ -1511,7 +1511,7 @@ static int snd_hdsp_control_spdif_put(struct snd_kcontrol *kcontrol, struct snd_
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_hdsp_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&hdsp->lock);
change = val != hdsp->creg_spdif;
@@ -1530,7 +1530,7 @@ static int snd_hdsp_control_spdif_stream_info(struct snd_kcontrol *kcontrol, str
static int snd_hdsp_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif_stream);
return 0;
}
@@ -1540,7 +1540,7 @@ static int snd_hdsp_control_spdif_stream_put(struct snd_kcontrol *kcontrol, stru
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_hdsp_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&hdsp->lock);
change = val != hdsp->creg_spdif_stream;
@@ -1602,7 +1602,7 @@ static int snd_hdsp_info_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_
static int snd_hdsp_get_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_spdif_in(hdsp);
return 0;
}
@@ -1612,7 +1612,7 @@ static int snd_hdsp_put_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_e
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0] % ((hdsp->io_type == H9632) ? 4 : 3);
@@ -1649,7 +1649,7 @@ static int hdsp_set_spdif_output(struct hdsp *hdsp, int out)
static int snd_hdsp_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_out(hdsp);
return 0;
}
@@ -1659,7 +1659,7 @@ static int snd_hdsp_put_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1693,7 +1693,7 @@ static int hdsp_set_spdif_professional(struct hdsp *hdsp, int val)
static int snd_hdsp_get_spdif_professional(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_professional(hdsp);
return 0;
}
@@ -1703,7 +1703,7 @@ static int snd_hdsp_put_spdif_professional(struct snd_kcontrol *kcontrol, struct
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1737,7 +1737,7 @@ static int hdsp_set_spdif_emphasis(struct hdsp *hdsp, int val)
static int snd_hdsp_get_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_emphasis(hdsp);
return 0;
}
@@ -1747,7 +1747,7 @@ static int snd_hdsp_put_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1781,7 +1781,7 @@ static int hdsp_set_spdif_nonaudio(struct hdsp *hdsp, int val)
static int snd_hdsp_get_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_nonaudio(hdsp);
return 0;
}
@@ -1791,7 +1791,7 @@ static int snd_hdsp_put_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1828,7 +1828,7 @@ static int snd_hdsp_info_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct
static int snd_hdsp_get_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
switch (hdsp_spdif_sample_rate(hdsp)) {
case 32000:
ucontrol->value.enumerated.item[0] = 0;
@@ -1858,7 +1858,7 @@ static int snd_hdsp_get_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct
ucontrol->value.enumerated.item[0] = 9;
break;
default:
- ucontrol->value.enumerated.item[0] = 6;
+ ucontrol->value.enumerated.item[0] = 6;
}
return 0;
}
@@ -1882,7 +1882,7 @@ static int snd_hdsp_info_system_sample_rate(struct snd_kcontrol *kcontrol, struc
static int snd_hdsp_get_system_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp->system_sample_rate;
return 0;
}
@@ -1899,10 +1899,10 @@ static int snd_hdsp_get_system_sample_rate(struct snd_kcontrol *kcontrol, struct
static int snd_hdsp_info_autosync_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
- static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"};
+ static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"};
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
- uinfo->value.enumerated.items = (hdsp->io_type == H9632) ? 10 : 7 ;
+ uinfo->value.enumerated.items = (hdsp->io_type == H9632) ? 10 : 7;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -1912,7 +1912,7 @@ static int snd_hdsp_info_autosync_sample_rate(struct snd_kcontrol *kcontrol, str
static int snd_hdsp_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
switch (hdsp_external_sample_rate(hdsp)) {
case 32000:
ucontrol->value.enumerated.item[0] = 0;
@@ -1940,9 +1940,9 @@ static int snd_hdsp_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, stru
break;
case 192000:
ucontrol->value.enumerated.item[0] = 9;
- break;
+ break;
default:
- ucontrol->value.enumerated.item[0] = 6;
+ ucontrol->value.enumerated.item[0] = 6;
}
return 0;
}
@@ -1968,7 +1968,7 @@ static int hdsp_system_clock_mode(struct hdsp *hdsp)
static int snd_hdsp_info_system_clock_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"Master", "Slave" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 2;
@@ -1981,7 +1981,7 @@ static int snd_hdsp_info_system_clock_mode(struct snd_kcontrol *kcontrol, struct
static int snd_hdsp_get_system_clock_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_system_clock_mode(hdsp);
return 0;
}
@@ -2018,7 +2018,7 @@ static int hdsp_clock_source(struct hdsp *hdsp)
case 192000:
return 9;
default:
- return 3;
+ return 3;
}
} else {
return 0;
@@ -2032,7 +2032,7 @@ static int hdsp_set_clock_source(struct hdsp *hdsp, int mode)
case HDSP_CLOCK_SOURCE_AUTOSYNC:
if (hdsp_external_sample_rate(hdsp) != 0) {
if (!hdsp_set_rate(hdsp, hdsp_external_sample_rate(hdsp), 1)) {
- hdsp->control_register &= ~HDSP_ClockModeMaster;
+ hdsp->control_register &= ~HDSP_ClockModeMaster;
hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
return 0;
}
@@ -2043,7 +2043,7 @@ static int hdsp_set_clock_source(struct hdsp *hdsp, int mode)
break;
case HDSP_CLOCK_SOURCE_INTERNAL_44_1KHZ:
rate = 44100;
- break;
+ break;
case HDSP_CLOCK_SOURCE_INTERNAL_48KHZ:
rate = 48000;
break;
@@ -2078,13 +2078,13 @@ static int snd_hdsp_info_clock_source(struct snd_kcontrol *kcontrol, struct snd_
{
static char *texts[] = {"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", "Internal 96.0 kHz", "Internal 128 kHz", "Internal 176.4 kHz", "Internal 192.0 KHz" };
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
if (hdsp->io_type == H9632)
uinfo->value.enumerated.items = 10;
else
- uinfo->value.enumerated.items = 7;
+ uinfo->value.enumerated.items = 7;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -2094,7 +2094,7 @@ static int snd_hdsp_info_clock_source(struct snd_kcontrol *kcontrol, struct snd_
static int snd_hdsp_get_clock_source(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_clock_source(hdsp);
return 0;
}
@@ -2104,7 +2104,7 @@ static int snd_hdsp_put_clock_source(struct snd_kcontrol *kcontrol, struct snd_c
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2130,7 +2130,7 @@ static int snd_hdsp_put_clock_source(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_hdsp_get_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp->clock_source_locked;
return 0;
}
@@ -2165,7 +2165,7 @@ static int hdsp_da_gain(struct hdsp *hdsp)
case HDSP_DAGainMinus10dBV:
return 2;
default:
- return 1;
+ return 1;
}
}
@@ -2180,8 +2180,8 @@ static int hdsp_set_da_gain(struct hdsp *hdsp, int mode)
hdsp->control_register |= HDSP_DAGainPlus4dBu;
break;
case 2:
- hdsp->control_register |= HDSP_DAGainMinus10dBV;
- break;
+ hdsp->control_register |= HDSP_DAGainMinus10dBV;
+ break;
default:
return -1;
@@ -2193,7 +2193,7 @@ static int hdsp_set_da_gain(struct hdsp *hdsp, int mode)
static int snd_hdsp_info_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"Hi Gain", "+4 dBu", "-10 dbV"};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2206,7 +2206,7 @@ static int snd_hdsp_info_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_e
static int snd_hdsp_get_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_da_gain(hdsp);
return 0;
}
@@ -2216,7 +2216,7 @@ static int snd_hdsp_put_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2250,7 +2250,7 @@ static int hdsp_ad_gain(struct hdsp *hdsp)
case HDSP_ADGainLowGain:
return 2;
default:
- return 1;
+ return 1;
}
}
@@ -2262,11 +2262,11 @@ static int hdsp_set_ad_gain(struct hdsp *hdsp, int mode)
hdsp->control_register |= HDSP_ADGainMinus10dBV;
break;
case 1:
- hdsp->control_register |= HDSP_ADGainPlus4dBu;
+ hdsp->control_register |= HDSP_ADGainPlus4dBu;
break;
case 2:
- hdsp->control_register |= HDSP_ADGainLowGain;
- break;
+ hdsp->control_register |= HDSP_ADGainLowGain;
+ break;
default:
return -1;
@@ -2278,7 +2278,7 @@ static int hdsp_set_ad_gain(struct hdsp *hdsp, int mode)
static int snd_hdsp_info_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"-10 dBV", "+4 dBu", "Lo Gain"};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2291,7 +2291,7 @@ static int snd_hdsp_info_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_e
static int snd_hdsp_get_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_ad_gain(hdsp);
return 0;
}
@@ -2301,7 +2301,7 @@ static int snd_hdsp_put_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2335,7 +2335,7 @@ static int hdsp_phone_gain(struct hdsp *hdsp)
case HDSP_PhoneGainMinus12dB:
return 2;
default:
- return 0;
+ return 0;
}
}
@@ -2347,11 +2347,11 @@ static int hdsp_set_phone_gain(struct hdsp *hdsp, int mode)
hdsp->control_register |= HDSP_PhoneGain0dB;
break;
case 1:
- hdsp->control_register |= HDSP_PhoneGainMinus6dB;
+ hdsp->control_register |= HDSP_PhoneGainMinus6dB;
break;
case 2:
- hdsp->control_register |= HDSP_PhoneGainMinus12dB;
- break;
+ hdsp->control_register |= HDSP_PhoneGainMinus12dB;
+ break;
default:
return -1;
@@ -2363,7 +2363,7 @@ static int hdsp_set_phone_gain(struct hdsp *hdsp, int mode)
static int snd_hdsp_info_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"0 dB", "-6 dB", "-12 dB"};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2376,7 +2376,7 @@ static int snd_hdsp_info_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ct
static int snd_hdsp_get_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_phone_gain(hdsp);
return 0;
}
@@ -2386,7 +2386,7 @@ static int snd_hdsp_put_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2432,7 +2432,7 @@ static int hdsp_set_xlr_breakout_cable(struct hdsp *hdsp, int mode)
static int snd_hdsp_get_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_xlr_breakout_cable(hdsp);
return 0;
}
@@ -2442,7 +2442,7 @@ static int snd_hdsp_put_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2488,7 +2488,7 @@ static int hdsp_set_aeb(struct hdsp *hdsp, int mode)
static int snd_hdsp_get_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_aeb(hdsp);
return 0;
}
@@ -2498,7 +2498,7 @@ static int snd_hdsp_put_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2576,7 +2576,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
{
static char *texts[] = {"Word", "IEC958", "ADAT1", "ADAT Sync", "ADAT2", "ADAT3" };
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
@@ -2595,7 +2595,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
uinfo->value.enumerated.items = 0;
break;
}
-
+
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -2605,7 +2605,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
static int snd_hdsp_get_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
return 0;
}
@@ -2615,7 +2615,7 @@ static int snd_hdsp_put_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change, max;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
@@ -2664,7 +2664,7 @@ static int hdsp_autosync_ref(struct hdsp *hdsp)
case HDSP_SelSyncRef_SPDIF:
return HDSP_AUTOSYNC_FROM_SPDIF;
case HDSP_SelSyncRefMask:
- return HDSP_AUTOSYNC_FROM_NONE;
+ return HDSP_AUTOSYNC_FROM_NONE;
case HDSP_SelSyncRef_ADAT1:
return HDSP_AUTOSYNC_FROM_ADAT1;
case HDSP_SelSyncRef_ADAT2:
@@ -2680,7 +2680,7 @@ static int hdsp_autosync_ref(struct hdsp *hdsp)
static int snd_hdsp_info_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"Word", "ADAT Sync", "IEC958", "None", "ADAT1", "ADAT2", "ADAT3" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 7;
@@ -2693,7 +2693,7 @@ static int snd_hdsp_info_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_
static int snd_hdsp_get_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_autosync_ref(hdsp);
return 0;
}
@@ -2727,7 +2727,7 @@ static int hdsp_set_line_output(struct hdsp *hdsp, int out)
static int snd_hdsp_get_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[0] = hdsp_line_out(hdsp);
spin_unlock_irq(&hdsp->lock);
@@ -2739,7 +2739,7 @@ static int snd_hdsp_put_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_e
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2773,7 +2773,7 @@ static int hdsp_set_precise_pointer(struct hdsp *hdsp, int precise)
static int snd_hdsp_get_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[0] = hdsp->precise_ptr;
spin_unlock_irq(&hdsp->lock);
@@ -2785,7 +2785,7 @@ static int snd_hdsp_put_precise_pointer(struct snd_kcontrol *kcontrol, struct sn
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2819,7 +2819,7 @@ static int hdsp_set_use_midi_tasklet(struct hdsp *hdsp, int use_tasklet)
static int snd_hdsp_get_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[0] = hdsp->use_midi_tasklet;
spin_unlock_irq(&hdsp->lock);
@@ -2831,7 +2831,7 @@ static int snd_hdsp_put_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct s
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2873,12 +2873,12 @@ static int snd_hdsp_get_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
source = ucontrol->value.integer.value[0];
destination = ucontrol->value.integer.value[1];
-
+
if (source >= hdsp->max_channels)
addr = hdsp_playback_to_output_key(hdsp,source-hdsp->max_channels,destination);
else
addr = hdsp_input_to_output_key(hdsp,source, destination);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[2] = hdsp_read_gain (hdsp, addr);
spin_unlock_irq(&hdsp->lock);
@@ -2926,7 +2926,7 @@ static int snd_hdsp_put_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
static int snd_hdsp_info_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
- static char *texts[] = {"No Lock", "Lock", "Sync" };
+ static char *texts[] = {"No Lock", "Lock", "Sync" };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2971,7 +2971,7 @@ static int hdsp_spdif_sync_check(struct hdsp *hdsp)
int status = hdsp_read(hdsp, HDSP_statusRegister);
if (status & HDSP_SPDIFErrorFlag)
return 0;
- else {
+ else {
if (status & HDSP_SPDIFSync)
return 2;
else
@@ -3007,7 +3007,7 @@ static int hdsp_adatsync_sync_check(struct hdsp *hdsp)
return 1;
} else
return 0;
-}
+}
static int snd_hdsp_get_adatsync_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
@@ -3025,17 +3025,17 @@ static int snd_hdsp_get_adatsync_sync_check(struct snd_kcontrol *kcontrol, struc
}
static int hdsp_adat_sync_check(struct hdsp *hdsp, int idx)
-{
+{
int status = hdsp_read(hdsp, HDSP_statusRegister);
-
+
if (status & (HDSP_Lock0>>idx)) {
if (status & (HDSP_Sync0>>idx))
return 2;
else
- return 1;
+ return 1;
} else
return 0;
-}
+}
static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
@@ -3053,7 +3053,7 @@ static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct sn
break;
case Multiface:
case H9632:
- if (offset >= 1)
+ if (offset >= 1)
return -EINVAL;
break;
default:
@@ -3115,7 +3115,7 @@ static int snd_hdsp_info_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ct
static int snd_hdsp_get_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_dds_offset(hdsp);
return 0;
}
@@ -3125,7 +3125,7 @@ static int snd_hdsp_put_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ctl
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -3170,7 +3170,7 @@ static struct snd_kcontrol_new snd_hdsp_controls[] = {
.get = snd_hdsp_control_spdif_mask_get,
.private_value = IEC958_AES0_NONAUDIO |
IEC958_AES0_PROFESSIONAL |
- IEC958_AES0_CON_EMPHASIS,
+ IEC958_AES0_CON_EMPHASIS,
},
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -3188,7 +3188,7 @@ HDSP_SPDIF_OUT("IEC958 Output also on ADAT1", 0),
HDSP_SPDIF_PROFESSIONAL("IEC958 Professional Bit", 0),
HDSP_SPDIF_EMPHASIS("IEC958 Emphasis Bit", 0),
HDSP_SPDIF_NON_AUDIO("IEC958 Non-audio Bit", 0),
-/* 'Sample Clock Source' complies with the alsa control naming scheme */
+/* 'Sample Clock Source' complies with the alsa control naming scheme */
HDSP_CLOCK_SOURCE("Sample Clock Source", 0),
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -3240,7 +3240,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
return err;
}
}
-
+
/* DA, AD and Phone gain and XLR breakout cable controls for H9632 cards */
if (hdsp->io_type == H9632) {
for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_9632_controls); idx++) {
@@ -3259,7 +3259,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
}
/*------------------------------------------------------------
- /proc interface
+ /proc interface
------------------------------------------------------------*/
static void
@@ -3298,7 +3298,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
}
}
}
-
+
status = hdsp_read(hdsp, HDSP_statusRegister);
status2 = hdsp_read(hdsp, HDSP_status2Register);
@@ -3362,17 +3362,17 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
case HDSP_CLOCK_SOURCE_INTERNAL_192KHZ:
clock_source = "Internal 192 kHz";
- break;
+ break;
default:
- clock_source = "Error";
+ clock_source = "Error";
}
snd_iprintf (buffer, "Sample Clock Source: %s\n", clock_source);
-
+
if (hdsp_system_clock_mode(hdsp))
system_clock_mode = "Slave";
else
system_clock_mode = "Master";
-
+
switch (hdsp_pref_sync_ref (hdsp)) {
case HDSP_SYNC_FROM_WORD:
pref_sync_ref = "Word Clock";
@@ -3397,7 +3397,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
}
snd_iprintf (buffer, "Preferred Sync Reference: %s\n", pref_sync_ref);
-
+
switch (hdsp_autosync_ref (hdsp)) {
case HDSP_AUTOSYNC_FROM_WORD:
autosync_ref = "Word Clock";
@@ -3410,7 +3410,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
case HDSP_AUTOSYNC_FROM_NONE:
autosync_ref = "None";
- break;
+ break;
case HDSP_AUTOSYNC_FROM_ADAT1:
autosync_ref = "ADAT1";
break;
@@ -3425,14 +3425,14 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
}
snd_iprintf (buffer, "AutoSync Reference: %s\n", autosync_ref);
-
+
snd_iprintf (buffer, "AutoSync Frequency: %d\n", hdsp_external_sample_rate(hdsp));
-
+
snd_iprintf (buffer, "System Clock Mode: %s\n", system_clock_mode);
snd_iprintf (buffer, "System Clock Frequency: %d\n", hdsp->system_sample_rate);
snd_iprintf (buffer, "System Clock Locked: %s\n", hdsp->clock_source_locked ? "Yes" : "No");
-
+
snd_iprintf(buffer, "\n");
switch (hdsp_spdif_in(hdsp)) {
@@ -3452,7 +3452,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
snd_iprintf(buffer, "IEC958 input: ???\n");
break;
}
-
+
if (hdsp->control_register & HDSP_SPDIFOpticalOut)
snd_iprintf(buffer, "IEC958 output: Coaxial & ADAT1\n");
else
@@ -3510,13 +3510,13 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
snd_iprintf (buffer, "SPDIF: No Lock\n");
else
snd_iprintf (buffer, "SPDIF: %s\n", x ? "Sync" : "Lock");
-
+
x = status2 & HDSP_wc_sync;
if (status2 & HDSP_wc_lock)
snd_iprintf (buffer, "Word Clock: %s\n", x ? "Sync" : "Lock");
else
snd_iprintf (buffer, "Word Clock: No Lock\n");
-
+
x = status & HDSP_TimecodeSync;
if (status & HDSP_TimecodeLock)
snd_iprintf(buffer, "ADAT Sync: %s\n", x ? "Sync" : "Lock");
@@ -3524,11 +3524,11 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
snd_iprintf(buffer, "ADAT Sync: No Lock\n");
snd_iprintf(buffer, "\n");
-
+
/* Informations about H9632 specific controls */
if (hdsp->io_type == H9632) {
char *tmp;
-
+
switch (hdsp_ad_gain(hdsp)) {
case 0:
tmp = "-10 dBV";
@@ -3554,7 +3554,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
}
snd_iprintf(buffer, "DA Gain : %s\n", tmp);
-
+
switch (hdsp_phone_gain(hdsp)) {
case 0:
tmp = "0 dB";
@@ -3568,8 +3568,8 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
}
snd_iprintf(buffer, "Phones Gain : %s\n", tmp);
- snd_iprintf(buffer, "XLR Breakout Cable : %s\n", hdsp_xlr_breakout_cable(hdsp) ? "yes" : "no");
-
+ snd_iprintf(buffer, "XLR Breakout Cable : %s\n", hdsp_xlr_breakout_cable(hdsp) ? "yes" : "no");
+
if (hdsp->control_register & HDSP_AnalogExtensionBoard)
snd_iprintf(buffer, "AEB : on (ADAT1 internal)\n");
else
@@ -3583,7 +3583,7 @@ static void snd_hdsp_proc_init(struct hdsp *hdsp)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(hdsp->card, "hdsp", &entry))
+ if (!snd_card_proc_new(hdsp->card, "hdsp", &entry))
snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read);
}
@@ -3632,18 +3632,18 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
/* set defaults:
- SPDIF Input via Coax
+ SPDIF Input via Coax
Master clock mode
maximum latency (7 => 2^7 = 8192 samples, 64Kbyte buffer,
which implies 2 4096 sample, 32Kbyte periods).
- Enable line out.
+ Enable line out.
*/
- hdsp->control_register = HDSP_ClockModeMaster |
- HDSP_SPDIFInputCoaxial |
- hdsp_encode_latency(7) |
+ hdsp->control_register = HDSP_ClockModeMaster |
+ HDSP_SPDIFInputCoaxial |
+ hdsp_encode_latency(7) |
HDSP_LineOut;
-
+
hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
@@ -3661,7 +3661,7 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
hdsp_compute_period_size(hdsp);
/* silence everything */
-
+
for (i = 0; i < HDSP_MATRIX_MIXER_SIZE; ++i)
hdsp->mixer_matrix[i] = MINUS_INFINITY_GAIN;
@@ -3669,7 +3669,7 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
if (hdsp_write_gain (hdsp, i, MINUS_INFINITY_GAIN))
return -EIO;
}
-
+
/* H9632 specific defaults */
if (hdsp->io_type == H9632) {
hdsp->control_register |= (HDSP_DAGainPlus4dBu | HDSP_ADGainPlus4dBu | HDSP_PhoneGain0dB);
@@ -3687,12 +3687,12 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
static void hdsp_midi_tasklet(unsigned long arg)
{
struct hdsp *hdsp = (struct hdsp *)arg;
-
+
if (hdsp->midi[0].pending)
snd_hdsp_midi_input_read (&hdsp->midi[0]);
if (hdsp->midi[1].pending)
snd_hdsp_midi_input_read (&hdsp->midi[1]);
-}
+}
static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
{
@@ -3704,7 +3704,7 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
unsigned int midi0status;
unsigned int midi1status;
int schedule = 0;
-
+
status = hdsp_read(hdsp, HDSP_statusRegister);
audio = status & HDSP_audioIRQPending;
@@ -3718,15 +3718,15 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
midi0status = hdsp_read (hdsp, HDSP_midiStatusIn0) & 0xff;
midi1status = hdsp_read (hdsp, HDSP_midiStatusIn1) & 0xff;
-
+
if (audio) {
if (hdsp->capture_substream)
snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
-
+
if (hdsp->playback_substream)
snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
}
-
+
if (midi0 && midi0status) {
if (hdsp->use_midi_tasklet) {
/* we disable interrupts for this input until processing is done */
@@ -3769,10 +3769,10 @@ static char *hdsp_channel_buffer_location(struct hdsp *hdsp,
if (snd_BUG_ON(channel < 0 || channel >= hdsp->max_channels))
return NULL;
-
+
if ((mapped_channel = hdsp->channel_map[channel]) < 0)
return NULL;
-
+
if (stream == SNDRV_PCM_STREAM_CAPTURE)
return hdsp->capture_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES);
else
@@ -3910,7 +3910,7 @@ static int snd_hdsp_hw_params(struct snd_pcm_substream *substream,
*/
spin_lock_irq(&hdsp->lock);
- if (! hdsp->clock_source_locked) {
+ if (!hdsp->clock_source_locked) {
if ((err = hdsp_set_rate(hdsp, params_rate(params), 0)) < 0) {
spin_unlock_irq(&hdsp->lock);
_snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_RATE);
@@ -3965,7 +3965,7 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd)
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *other;
int running;
-
+
if (hdsp_check_for_iobox (hdsp))
return -EIO;
@@ -4016,7 +4016,7 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
hdsp_silence_playback(hdsp);
}
- _ok:
+_ok:
snd_pcm_trigger_done(substream, substream);
if (!hdsp->running && running)
hdsp_start_audio(hdsp);
@@ -4059,10 +4059,10 @@ static struct snd_pcm_hardware snd_hdsp_playback_subinfo =
.formats = SNDRV_PCM_FMTBIT_S32_LE,
#endif
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_64000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -4088,10 +4088,10 @@ static struct snd_pcm_hardware snd_hdsp_capture_subinfo =
.formats = SNDRV_PCM_FMTBIT_S32_LE,
#endif
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_64000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -4170,7 +4170,7 @@ static int snd_hdsp_hw_rule_in_channels_rate(struct snd_pcm_hw_params *params,
.max = hdsp->qs_in_channels,
.integer = 1,
};
- return snd_interval_refine(c, &t);
+ return snd_interval_refine(c, &t);
} else if (r->min > 48000 && r->max <= 96000) {
struct snd_interval t = {
.min = hdsp->ds_in_channels,
@@ -4201,7 +4201,7 @@ static int snd_hdsp_hw_rule_out_channels_rate(struct snd_pcm_hw_params *params,
.max = hdsp->qs_out_channels,
.integer = 1,
};
- return snd_interval_refine(c, &t);
+ return snd_interval_refine(c, &t);
} else if (r->min > 48000 && r->max <= 96000) {
struct snd_interval t = {
.min = hdsp->ds_out_channels,
@@ -4318,8 +4318,8 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream)
if (hdsp->io_type == H9632) {
runtime->hw.channels_min = hdsp->qs_out_channels;
runtime->hw.channels_max = hdsp->ss_out_channels;
- }
-
+ }
+
snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_hdsp_hw_rule_out_channels, hdsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
@@ -4536,7 +4536,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
hdsp->iobase + HDSP_playbackRmsLevel + i * 8 + 4,
hdsp->iobase + HDSP_playbackRmsLevel + i * 8))
return -EFAULT;
- if (copy_u64_le(&peak_rms->input_rms[i],
+ if (copy_u64_le(&peak_rms->input_rms[i],
hdsp->iobase + HDSP_inputRmsLevel + i * 8 + 4,
hdsp->iobase + HDSP_inputRmsLevel + i * 8))
return -EFAULT;
@@ -4546,7 +4546,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg)
{
- struct hdsp *hdsp = (struct hdsp *)hw->private_data;
+ struct hdsp *hdsp = (struct hdsp *)hw->private_data;
void __user *argp = (void __user *)arg;
switch (cmd) {
@@ -4571,9 +4571,9 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
struct hdsp_config_info info;
unsigned long flags;
int i;
-
+
if (!(hdsp->state & HDSP_FirmwareLoaded)) {
- snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n");
+ snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n");
return -EINVAL;
}
spin_lock_irqsave(&hdsp->lock, flags);
@@ -4601,7 +4601,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
info.ad_gain = (unsigned char)hdsp_ad_gain(hdsp);
info.phone_gain = (unsigned char)hdsp_phone_gain(hdsp);
info.xlr_breakout_cable = (unsigned char)hdsp_xlr_breakout_cable(hdsp);
-
+
}
if (hdsp->io_type == H9632 || hdsp->io_type == H9652)
info.analog_extension_board = (unsigned char)hdsp_aeb(hdsp);
@@ -4612,7 +4612,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
}
case SNDRV_HDSP_IOCTL_GET_9632_AEB: {
struct hdsp_9632_aeb h9632_aeb;
-
+
if (hdsp->io_type != H9632) return -EINVAL;
h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS;
h9632_aeb.aebo = hdsp->ss_out_channels - H9632_SS_CHANNELS;
@@ -4623,7 +4623,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
case SNDRV_HDSP_IOCTL_GET_VERSION: {
struct hdsp_version hdsp_version;
int err;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
if (hdsp->io_type == Undefined) {
if ((err = hdsp_get_iobox_version(hdsp)) < 0)
@@ -4639,7 +4639,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
struct hdsp_firmware __user *firmware;
u32 __user *firmware_data;
int err;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
/* SNDRV_HDSP_IOCTL_GET_VERSION must have been called */
if (hdsp->io_type == Undefined) return -EINVAL;
@@ -4652,25 +4652,25 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
if (get_user(firmware_data, &firmware->firmware_data))
return -EFAULT;
-
+
if (hdsp_check_for_iobox (hdsp))
return -EIO;
if (copy_from_user(hdsp->firmware_cache, firmware_data, sizeof(hdsp->firmware_cache)) != 0)
return -EFAULT;
-
+
hdsp->state |= HDSP_FirmwareCached;
if ((err = snd_hdsp_load_firmware_from_cache(hdsp)) < 0)
return err;
-
+
if (!(hdsp->state & HDSP_InitializationComplete)) {
if ((err = snd_hdsp_enable_io(hdsp)) < 0)
return err;
-
- snd_hdsp_initialize_channels(hdsp);
+
+ snd_hdsp_initialize_channels(hdsp);
snd_hdsp_initialize_midi_flush(hdsp);
-
+
if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: error creating alsa devices\n");
return err;
@@ -4717,10 +4717,10 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
{
struct snd_hwdep *hw;
int err;
-
+
if ((err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw)) < 0)
return err;
-
+
hdsp->hwdep = hw;
hw->private_data = hdsp;
strcpy(hw->name, "HDSP hwdep interface");
@@ -4728,7 +4728,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
hw->ops.open = snd_hdsp_hwdep_dummy_op;
hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
hw->ops.release = snd_hdsp_hwdep_dummy_op;
-
+
return 0;
}
@@ -4752,33 +4752,33 @@ static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp)
return 0;
}
-static void snd_hdsp_9652_enable_mixer (struct hdsp *hdsp)
+static void snd_hdsp_9652_enable_mixer(struct hdsp *hdsp)
{
hdsp->control2_register |= HDSP_9652_ENABLE_MIXER;
hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
}
-static int snd_hdsp_enable_io (struct hdsp *hdsp)
+static int snd_hdsp_enable_io(struct hdsp *hdsp)
{
int i;
-
+
if (hdsp_fifo_wait (hdsp, 0, 100)) {
snd_printk(KERN_ERR "Hammerfall-DSP: enable_io fifo_wait failed\n");
return -EIO;
}
-
+
for (i = 0; i < hdsp->max_channels; ++i) {
hdsp_write (hdsp, HDSP_inputEnable + (4 * i), 1);
hdsp_write (hdsp, HDSP_outputEnable + (4 * i), 1);
}
-
+
return 0;
}
static void snd_hdsp_initialize_channels(struct hdsp *hdsp)
{
int status, aebi_channels, aebo_channels;
-
+
switch (hdsp->io_type) {
case Digiface:
hdsp->card_name = "RME Hammerfall DSP + Digiface";
@@ -4791,7 +4791,7 @@ static void snd_hdsp_initialize_channels(struct hdsp *hdsp)
hdsp->ss_in_channels = hdsp->ss_out_channels = H9652_SS_CHANNELS;
hdsp->ds_in_channels = hdsp->ds_out_channels = H9652_DS_CHANNELS;
break;
-
+
case H9632:
status = hdsp_read(hdsp, HDSP_statusRegister);
/* HDSP_AEBx bits are low when AEB are connected */
@@ -4811,14 +4811,14 @@ static void snd_hdsp_initialize_channels(struct hdsp *hdsp)
hdsp->ss_in_channels = hdsp->ss_out_channels = MULTIFACE_SS_CHANNELS;
hdsp->ds_in_channels = hdsp->ds_out_channels = MULTIFACE_DS_CHANNELS;
break;
-
+
default:
/* should never get here */
break;
}
}
-static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp)
+static void snd_hdsp_initialize_midi_flush(struct hdsp *hdsp)
{
snd_hdsp_flush_midi_input (hdsp, 0);
snd_hdsp_flush_midi_input (hdsp, 1);
@@ -4827,12 +4827,12 @@ static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp)
static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp)
{
int err;
-
+
if ((err = snd_hdsp_create_pcm(card, hdsp)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: Error creating pcm interface\n");
return err;
}
-
+
if ((err = snd_hdsp_create_midi(card, hdsp, 0)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: Error creating first midi interface\n");
@@ -4863,19 +4863,19 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp
snd_printk(KERN_ERR "Hammerfall-DSP: Error setting default values\n");
return err;
}
-
+
if (!(hdsp->state & HDSP_InitializationComplete)) {
strcpy(card->shortname, "Hammerfall DSP");
- sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
+ sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
hdsp->port, hdsp->irq);
-
+
if ((err = snd_card_register(card)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: error registering card\n");
return err;
}
hdsp->state |= HDSP_InitializationComplete;
}
-
+
return 0;
}
@@ -4886,7 +4886,7 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
const char *fwfile;
const struct firmware *fw;
int err;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
if (hdsp->io_type == Undefined) {
@@ -4895,7 +4895,7 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
}
-
+
/* caution: max length of firmware filename is 30! */
switch (hdsp->io_type) {
case Multiface:
@@ -4929,12 +4929,12 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
memcpy(hdsp->firmware_cache, fw->data, sizeof(hdsp->firmware_cache));
release_firmware(fw);
-
+
hdsp->state |= HDSP_FirmwareCached;
if ((err = snd_hdsp_load_firmware_from_cache(hdsp)) < 0)
return err;
-
+
if (!(hdsp->state & HDSP_InitializationComplete)) {
if ((err = snd_hdsp_enable_io(hdsp)) < 0)
return err;
@@ -4981,14 +4981,14 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
hdsp->max_channels = 26;
hdsp->card = card;
-
+
spin_lock_init(&hdsp->lock);
tasklet_init(&hdsp->midi_tasklet, hdsp_midi_tasklet, (unsigned long)hdsp);
-
+
pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev);
hdsp->firmware_rev &= 0xff;
-
+
/* From Martin Bjoernsen :
"It is important that the card's latency timer register in
the PCI configuration space is set to a value much larger
@@ -4997,7 +4997,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
to its maximum 255 to avoid problems with some computers."
*/
pci_write_config_byte(hdsp->pci, PCI_LATENCY_TIMER, 0xFF);
-
+
strcpy(card->driver, "H-DSP");
strcpy(card->mixername, "Xilinx FPGA");
@@ -5011,7 +5011,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
} else {
hdsp->card_name = "RME HDSP 9632";
hdsp->max_channels = 16;
- is_9632 = 1;
+ is_9632 = 1;
}
if ((err = pci_enable_device(pci)) < 0)
@@ -5040,7 +5040,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
if ((err = snd_hdsp_initialize_memory(hdsp)) < 0)
return err;
-
+
if (!is_9652 && !is_9632) {
/* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */
ssleep(2);
@@ -5063,35 +5063,35 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
return err;
return 0;
} else {
- snd_printk(KERN_INFO "Hammerfall-DSP: Firmware already present, initializing card.\n");
+ snd_printk(KERN_INFO "Hammerfall-DSP: Firmware already present, initializing card.\n");
if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1)
hdsp->io_type = Multiface;
- else
+ else
hdsp->io_type = Digiface;
}
}
-
+
if ((err = snd_hdsp_enable_io(hdsp)) != 0)
return err;
-
+
if (is_9652)
hdsp->io_type = H9652;
-
+
if (is_9632)
hdsp->io_type = H9632;
if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0)
return err;
-
+
snd_hdsp_initialize_channels(hdsp);
snd_hdsp_initialize_midi_flush(hdsp);
- hdsp->state |= HDSP_FirmwareLoaded;
+ hdsp->state |= HDSP_FirmwareLoaded;
if ((err = snd_hdsp_create_alsa_devices(card, hdsp)) < 0)
return err;
- return 0;
+ return 0;
}
static int snd_hdsp_free(struct hdsp *hdsp)
@@ -5107,13 +5107,13 @@ static int snd_hdsp_free(struct hdsp *hdsp)
free_irq(hdsp->irq, (void *)hdsp);
snd_hdsp_free_buffers(hdsp);
-
+
if (hdsp->iobase)
iounmap(hdsp->iobase);
if (hdsp->port)
pci_release_regions(hdsp->pci);
-
+
pci_disable_device(hdsp->pci);
return 0;
}
@@ -5156,7 +5156,7 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
}
strcpy(card->shortname, "Hammerfall DSP");
- sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
+ sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
hdsp->port, hdsp->irq);
if ((err = snd_card_register(card)) < 0) {
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 98762f9..16ca8ab 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -29,7 +29,7 @@
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -84,7 +84,7 @@ MODULE_DESCRIPTION("RME HDSPM");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
-/* --- Write registers. ---
+/* --- Write registers. ---
These are defined as byte-offsets from the iobase value. */
#define HDSPM_controlRegister 64
@@ -96,10 +96,10 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_eeprom_wr 384 /* for AES32 */
/* DMA enable for 64 channels, only Bit 0 is relevant */
-#define HDSPM_outputEnableBase 512 /* 512-767 input DMA */
+#define HDSPM_outputEnableBase 512 /* 512-767 input DMA */
#define HDSPM_inputEnableBase 768 /* 768-1023 output DMA */
-/* 16 page addresses for each of the 64 channels DMA buffer in and out
+/* 16 page addresses for each of the 64 channels DMA buffer in and out
(each 64k=16*4k) Buffer must be 4k aligned (which is default i386 ????) */
#define HDSPM_pageAddressBufferOut 8192
#define HDSPM_pageAddressBufferIn (HDSPM_pageAddressBufferOut+64*16*4)
@@ -122,15 +122,15 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_midiDataIn1 364
/* status is data bytes in MIDI-FIFO (0-128) */
-#define HDSPM_midiStatusOut0 384
-#define HDSPM_midiStatusOut1 388
-#define HDSPM_midiStatusIn0 392
-#define HDSPM_midiStatusIn1 396
+#define HDSPM_midiStatusOut0 384
+#define HDSPM_midiStatusOut1 388
+#define HDSPM_midiStatusIn0 392
+#define HDSPM_midiStatusIn1 396
/* the meters are regular i/o-mapped registers, but offset
considerably from the rest. the peak registers are reset
- when read; the least-significant 4 bits are full-scale counters;
+ when read; the least-significant 4 bits are full-scale counters;
the actual peak value is in the most-significant 24 bits.
*/
#define HDSPM_MADI_peakrmsbase 4096 /* 4096-8191 2x64x32Bit Meters */
@@ -156,7 +156,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
56channelMODE=0 */ /* MADI ONLY*/
#define HDSPM_Emphasis (1<<10) /* Emphasis */ /* AES32 ONLY */
-#define HDSPM_AutoInp (1<<11) /* Auto Input (takeover) == Safe Mode,
+#define HDSPM_AutoInp (1<<11) /* Auto Input (takeover) == Safe Mode,
0=off, 1=on */ /* MADI ONLY */
#define HDSPM_Dolby (1<<11) /* Dolby = "NonAudio" ?? */ /* AES32 ONLY */
@@ -171,7 +171,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_SyncRef3 (1<<25)
#define HDSPM_SMUX (1<<18) /* Frame ??? */ /* MADI ONY */
-#define HDSPM_clr_tms (1<<19) /* clear track marker, do not use
+#define HDSPM_clr_tms (1<<19) /* clear track marker, do not use
AES additional bits in
lower 5 Audiodatabits ??? */
#define HDSPM_taxi_reset (1<<20) /* ??? */ /* MADI ONLY ? */
@@ -272,7 +272,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_madiLock (1<<3) /* MADI Locked =1, no=0 */
#define HDSPM_BufferPositionMask 0x000FFC0 /* Bit 6..15 : h/w buffer pointer */
- /* since 64byte accurate last 6 bits
+ /* since 64byte accurate last 6 bits
are not used */
#define HDSPM_madiSync (1<<18) /* MADI is in sync */
@@ -344,7 +344,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
/* status */
#define HDSPM_AES32_wcLock 0x0200000
#define HDSPM_AES32_wcFreq_bit 22
-/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
+/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
HDSPM_bit2freq */
#define HDSPM_AES32_syncref_bit 16
/* (status >> HDSPM_AES32_syncref_bit) & 0xF gives sync source */
@@ -403,7 +403,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
/* the size of the area we need to allocate for DMA transfers. the
size is the same regardless of the number of channels, and
- also the latency to use.
+ also the latency to use.
for one direction !!!
*/
#define HDSPM_DMA_AREA_BYTES (HDSPM_MAX_CHANNELS * HDSPM_CHANNEL_BUFFER_BYTES)
@@ -563,8 +563,8 @@ static inline unsigned int hdspm_read(struct hdspm * hdspm, unsigned int reg)
return readl(hdspm->iobase + reg);
}
-/* for each output channel (chan) I have an Input (in) and Playback (pb) Fader
- mixer is write only on hardware so we have to cache him for read
+/* for each output channel (chan) I have an Input (in) and Playback (pb) Fader
+ mixer is write only on hardware so we have to cache him for read
each fader is a u32, but uses only the first 16 bit */
static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan,
@@ -764,7 +764,7 @@ static snd_pcm_uframes_t hdspm_hw_pointer(struct hdspm * hdspm)
/* hwpointer comes in bytes and is 64Bytes accurate (by docu since
PCI Burst)
- i have experimented that it is at most 64 Byte to much for playing
+ i have experimented that it is at most 64 Byte to much for playing
so substraction of 64 byte should be ok for ALSA, but use it only
for application where you know what you do since if you come to
near with record pointer it can be a disaster */
@@ -832,16 +832,16 @@ static void hdspm_set_dds_value(struct hdspm *hdspm, int rate)
{
u64 n;
u32 r;
-
+
if (rate >= 112000)
rate /= 4;
else if (rate >= 56000)
rate /= 2;
/* RME says n = 104857600000000, but in the windows MADI driver, I see:
-// return 104857600000000 / rate; // 100 MHz
- return 110100480000000 / rate; // 105 MHz
- */
+// return 104857600000000 / rate; //100 MHz
+ return 110100480000000 / rate; //105 MHz
+ */
/* n = 104857600000000ULL; */ /* = 2^20 * 10^8 */
n = 110100480000000ULL; /* Value checked for AES32 and MADI */
div64_32(&n, rate, &r);
@@ -864,13 +864,13 @@ static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
if (!(hdspm->control_register & HDSPM_ClockModeMaster)) {
- /* SLAVE --- */
+ /* SLAVE --- */
if (called_internally) {
- /* request from ctl or card initialization
- just make a warning an remember setting
+ /* request from ctl or card initialization
+ just make a warning an remember setting
for future master mode switching */
-
+
snd_printk(KERN_WARNING "HDSPM: "
"Warning: device is not running "
"as a clock master.\n");
@@ -907,7 +907,7 @@ static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
Note that a similar but essentially insoluble problem exists for
externally-driven rate changes. All we can do is to flag rate
- changes in the read/write routines.
+ changes in the read/write routines.
*/
if (current_rate <= 48000)
@@ -975,10 +975,10 @@ static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
/* For AES32, need to set DDS value in FREQ register
For MADI, also apparently */
hdspm_set_dds_value(hdspm, rate);
-
+
if (hdspm->is_aes32 && rate != current_rate)
hdspm_write(hdspm, HDSPM_eeprom_wr, 0);
-
+
/* For AES32 and for MADI (at least rev 204), channel_map needs to
* always be channel_map_madi_ss, whatever the sample rate */
hdspm->channel_map = channel_map_madi_ss;
@@ -1015,7 +1015,7 @@ static void all_in_all_mixer(struct hdspm * hdspm, int sgain)
MIDI
----------------------------------------------------------------------------*/
-static inline unsigned char snd_hdspm_midi_read_byte (struct hdspm *hdspm,
+static inline unsigned char snd_hdspm_midi_read_byte(struct hdspm *hdspm,
int id)
{
/* the hardware already does the relevant bit-mask with 0xff */
@@ -1025,7 +1025,7 @@ static inline unsigned char snd_hdspm_midi_read_byte (struct hdspm *hdspm,
return hdspm_read(hdspm, HDSPM_midiDataIn0);
}
-static inline void snd_hdspm_midi_write_byte (struct hdspm *hdspm, int id,
+static inline void snd_hdspm_midi_write_byte(struct hdspm *hdspm, int id,
int val)
{
/* the hardware already does the relevant bit-mask with 0xff */
@@ -1035,7 +1035,7 @@ static inline void snd_hdspm_midi_write_byte (struct hdspm *hdspm, int id,
hdspm_write(hdspm, HDSPM_midiDataOut0, val);
}
-static inline int snd_hdspm_midi_input_available (struct hdspm *hdspm, int id)
+static inline int snd_hdspm_midi_input_available(struct hdspm *hdspm, int id)
{
if (id)
return (hdspm_read(hdspm, HDSPM_midiStatusIn1) & 0xff);
@@ -1043,7 +1043,7 @@ static inline int snd_hdspm_midi_input_available (struct hdspm *hdspm, int id)
return (hdspm_read(hdspm, HDSPM_midiStatusIn0) & 0xff);
}
-static inline int snd_hdspm_midi_output_possible (struct hdspm *hdspm, int id)
+static inline int snd_hdspm_midi_output_possible(struct hdspm *hdspm, int id)
{
int fifo_bytes_used;
@@ -1065,7 +1065,7 @@ static void snd_hdspm_flush_midi_input(struct hdspm *hdspm, int id)
snd_hdspm_midi_read_byte (hdspm, id);
}
-static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
+static int snd_hdspm_midi_output_write(struct hdspm_midi *hmidi)
{
unsigned long flags;
int n_pending;
@@ -1074,7 +1074,7 @@ static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
unsigned char buf[128];
/* Output is not interrupt driven */
-
+
spin_lock_irqsave (&hmidi->lock, flags);
if (hmidi->output &&
!snd_rawmidi_transmit_empty (hmidi->output)) {
@@ -1083,11 +1083,11 @@ static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
if (n_pending > 0) {
if (n_pending > (int)sizeof (buf))
n_pending = sizeof (buf);
-
+
to_write = snd_rawmidi_transmit (hmidi->output, buf,
n_pending);
if (to_write > 0) {
- for (i = 0; i < to_write; ++i)
+ for (i = 0; i < to_write; ++i)
snd_hdspm_midi_write_byte (hmidi->hdspm,
hmidi->id,
buf[i]);
@@ -1098,7 +1098,7 @@ static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
return 0;
}
-static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi)
+static int snd_hdspm_midi_input_read(struct hdspm_midi *hmidi)
{
unsigned char buf[128]; /* this buffer is designed to match the MIDI
* input FIFO size
@@ -1167,14 +1167,14 @@ static void snd_hdspm_midi_output_timer(unsigned long data)
{
struct hdspm_midi *hmidi = (struct hdspm_midi *) data;
unsigned long flags;
-
+
snd_hdspm_midi_output_write(hmidi);
spin_lock_irqsave (&hmidi->lock, flags);
/* this does not bump hmidi->istimer, because the
kernel automatically removed the timer when it
expired, and we are now adding it back, thus
- leaving istimer wherever it was set before.
+ leaving istimer wherever it was set before.
*/
if (hmidi->istimer) {
@@ -1278,7 +1278,7 @@ static struct snd_rawmidi_ops snd_hdspm_midi_input =
.trigger = snd_hdspm_midi_input_trigger,
};
-static int __devinit snd_hdspm_create_midi (struct snd_card *card,
+static int __devinit snd_hdspm_create_midi(struct snd_card *card,
struct hdspm *hdspm, int id)
{
int err;
@@ -1312,12 +1312,12 @@ static int __devinit snd_hdspm_create_midi (struct snd_card *card,
static void hdspm_midi_tasklet(unsigned long arg)
{
struct hdspm *hdspm = (struct hdspm *)arg;
-
+
if (hdspm->midi[0].pending)
snd_hdspm_midi_input_read (&hdspm->midi[0]);
if (hdspm->midi[1].pending)
snd_hdspm_midi_input_read (&hdspm->midi[1]);
-}
+}
/*-----------------------------------------------------------------------------
@@ -2475,8 +2475,8 @@ static int snd_hdspm_put_qs_wire(struct snd_kcontrol *kcontrol,
/* Simple Mixer
deprecated since to much faders ???
MIXER interface says output (source, destination, value)
- where source > MAX_channels are playback channels
- on MADICARD
+ where source > MAX_channels are playback channels
+ on MADICARD
- playback mixer matrix: [channelout+64] [output] [value]
- input(thru) mixer matrix: [channelin] [output] [value]
(better do 2 kontrols for seperation ?)
@@ -2586,7 +2586,7 @@ static int snd_hdspm_put_mixer(struct snd_kcontrol *kcontrol,
/* The simple mixer control(s) provide gain control for the
basic 1:1 mappings of playback streams to output
- streams.
+ streams.
*/
#define HDSPM_PLAYBACK_MIXER \
@@ -2634,7 +2634,7 @@ static int snd_hdspm_get_playback_mixer(struct snd_kcontrol *kcontrol,
snd_printdd("get pb mixer index %d, channel %d, mapped_channel %d, "
"value %d\n",
ucontrol->id.index, channel, mapped_channel,
- ucontrol->value.integer.value[0]);
+ ucontrol->value.integer.value[0]);
*/
return 0;
}
@@ -2906,7 +2906,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, struct hdspm * hdspm
}
}
- /* Channel playback mixer as default control
+ /* Channel playback mixer as default control
Note: the whole matrix would be 128*HDSPM_MIXER_CHANNELS Faders,
thats too * big for any alsamixer they are accesible via special
IOCTL on hwdep and the mixer 2dimensional mixer control
@@ -2934,7 +2934,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, struct hdspm * hdspm
}
/*------------------------------------------------------------
- /proc interface
+ /proc interface
------------------------------------------------------------*/
static void
@@ -3341,7 +3341,7 @@ static void __devinit snd_hdspm_proc_init(struct hdspm * hdspm)
}
/*------------------------------------------------------------
- hdspm intitialize
+ hdspm intitialize
------------------------------------------------------------*/
static int snd_hdspm_set_defaults(struct hdspm * hdspm)
@@ -3417,7 +3417,7 @@ static int snd_hdspm_set_defaults(struct hdspm * hdspm)
/*------------------------------------------------------------
- interrupt
+ interrupt
------------------------------------------------------------*/
static irqreturn_t snd_hdspm_interrupt(int irq, void *dev_id)
@@ -3481,7 +3481,7 @@ static irqreturn_t snd_hdspm_interrupt(int irq, void *dev_id)
}
/*------------------------------------------------------------
- pcm interface
+ pcm interface
------------------------------------------------------------*/
@@ -3719,7 +3719,7 @@ static int snd_hdspm_hw_free(struct snd_pcm_substream *substream)
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- /* params_channels(params) should be enough,
+ /* params_channels(params) should be enough,
but to get sure in case of error */
for (i = 0; i < HDSPM_MAX_CHANNELS; ++i)
snd_hdspm_enable_out(hdspm, i, 0);
@@ -3827,7 +3827,7 @@ static int snd_hdspm_trigger(struct snd_pcm_substream *substream, int cmd)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
hdspm_silence_playback(hdspm);
}
- _ok:
+_ok:
snd_pcm_trigger_done(substream, substream);
if (!hdspm->running && running)
hdspm_start_audio(hdspm);
@@ -4124,13 +4124,13 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
/* maybe there is a chance to memorymap in future
* so dont touch just copy
*/
- if(copy_to_user_fromio((void __user *)rms.peak,
+ if (copy_to_user_fromio((void __user *)rms.peak,
hdspm->iobase+HDSPM_MADI_peakrmsbase,
- sizeof(struct hdspm_peak_rms)) != 0 )
+ sizeof(struct hdspm_peak_rms)) != 0)
return -EFAULT;
break;
-
+
case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
@@ -4222,7 +4222,7 @@ static int __devinit snd_hdspm_create_hwdep(struct snd_card *card,
/*------------------------------------------------------------
- memory interface
+ memory interface
------------------------------------------------------------*/
static int __devinit snd_hdspm_preallocate_memory(struct hdspm * hdspm)
{
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 2570907..7a4fdad 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -1,5 +1,5 @@
/*
- * ALSA driver for RME Digi9652 audio interfaces
+ * ALSA driver for RME Digi9652 audio interfaces
*
* Copyright (c) 1999 IEM - Winfried Ritsch
* Copyright (c) 1999-2001 Paul Davis
@@ -35,7 +35,7 @@
#include <sound/initval.h>
#include <asm/current.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -60,7 +60,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
capture, one for playback. Both the ADAT and S/PDIF channels appear
to the host CPU in the same block of memory. There is no functional
difference between them in terms of access.
-
+
The Hammerfall Light is identical to the Hammerfall, except that it
has 2 sets 18 channels (16 ADAT + 2 S/PDIF) for capture and playback.
*/
@@ -115,7 +115,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
/* Bits 31,30,29 are bits 5,4,3 of h/w pointer position on later
Rev G EEPROMS and Rev 1.5 cards or later.
-*/
+*/
#define RME9652_REV15_buf_pos(x) ((((x)&0xE0000000)>>26)|((x)&RME9652_buf_pos))
@@ -186,7 +186,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
#define RME9652_CHANNEL_BUFFER_BYTES (4*RME9652_CHANNEL_BUFFER_SAMPLES)
/* the size of the area we need to allocate for DMA transfers. the
- size is the same regardless of the number of channels - the
+ size is the same regardless of the number of channels - the
9636 still uses the same memory area.
Note that we allocate 1 more channel than is apparently needed
@@ -204,7 +204,7 @@ struct snd_rme9652 {
int irq;
unsigned long port;
void __iomem *iobase;
-
+
int precise_ptr;
u32 control_register; /* cached value */
@@ -217,7 +217,7 @@ struct snd_rme9652 {
size_t hw_offsetmask; /* &-with status register to get real hw_offset */
size_t prev_hw_offset; /* previous hw offset */
- size_t max_jitter; /* maximum jitter in frames for
+ size_t max_jitter; /* maximum jitter in frames for
hw pointer */
size_t period_bytes; /* guess what this is */
@@ -266,7 +266,7 @@ static char channel_map_9652_ss[26] = {
};
static char channel_map_9636_ss[26] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
/* channels 16 and 17 are S/PDIF */
24, 25,
/* channels 18-25 don't exist */
@@ -367,7 +367,7 @@ static inline void rme9652_compute_period_size(struct snd_rme9652 *rme9652)
i = rme9652->control_register & RME9652_latency;
rme9652->period_bytes = 1 << ((rme9652_decode_latency(i) + 8));
- rme9652->hw_offsetmask =
+ rme9652->hw_offsetmask =
(rme9652->period_bytes * 2 - 1) & RME9652_buf_pos;
rme9652->max_jitter = 80;
}
@@ -426,7 +426,7 @@ static inline void rme9652_reset_hw_pointer(struct snd_rme9652 *rme9652)
/* reset the FIFO pointer to zero. We do this by writing to 8
registers, each of which is a 32bit wide register, and set
them all to zero. Note that s->iobase is a pointer to
- int32, not pointer to char.
+ int32, not pointer to char.
*/
for (i = 0; i < 8; i++) {
@@ -494,9 +494,9 @@ static int rme9652_set_rate(struct snd_rme9652 *rme9652, int rate)
/* Changing from a "single speed" to a "double speed" rate is
not allowed if any substreams are open. This is because
- such a change causes a shift in the location of
+ such a change causes a shift in the location of
the DMA buffers and a reduction in the number of available
- buffers.
+ buffers.
Note that a similar but essentially insoluble problem
exists for externally-driven rate changes. All we can do
@@ -605,7 +605,7 @@ static void rme9652_set_thru(struct snd_rme9652 *rme9652, int channel, int enabl
rme9652_write(rme9652,
RME9652_thru_base + mapped_channel * 4,
- enable ? 1 : 0);
+ enable ? 1 : 0);
}
}
@@ -619,7 +619,7 @@ static int rme9652_set_passthru(struct snd_rme9652 *rme9652, int onoff)
*/
rme9652->control_register =
- RME9652_inp_0 |
+ RME9652_inp_0 |
rme9652_encode_latency(7) |
RME9652_start_bit;
@@ -630,24 +630,24 @@ static int rme9652_set_passthru(struct snd_rme9652 *rme9652, int onoff)
rme9652->passthru = 1;
} else {
rme9652_set_thru(rme9652, -1, 0);
- rme9652_stop(rme9652);
+ rme9652_stop(rme9652);
rme9652->passthru = 0;
}
return 0;
}
-static void rme9652_spdif_set_bit (struct snd_rme9652 *rme9652, int mask, int onoff)
+static void rme9652_spdif_set_bit(struct snd_rme9652 *rme9652, int mask, int onoff)
{
- if (onoff)
+ if (onoff)
rme9652->control_register |= mask;
- else
+ else
rme9652->control_register &= ~mask;
-
+
rme9652_write(rme9652, RME9652_control_register, rme9652->control_register);
}
-static void rme9652_spdif_write_byte (struct snd_rme9652 *rme9652, const int val)
+static void rme9652_spdif_write_byte(struct snd_rme9652 *rme9652, const int val)
{
long mask;
long i;
@@ -655,7 +655,7 @@ static void rme9652_spdif_write_byte (struct snd_rme9652 *rme9652, const int val
for (i = 0, mask = 0x80; i < 8; i++, mask >>= 1) {
if (val & mask)
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_WRITE, 1);
- else
+ else
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_WRITE, 0);
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_CLOCK, 1);
@@ -663,7 +663,7 @@ static void rme9652_spdif_write_byte (struct snd_rme9652 *rme9652, const int val
}
}
-static int rme9652_spdif_read_byte (struct snd_rme9652 *rme9652)
+static int rme9652_spdif_read_byte(struct snd_rme9652 *rme9652)
{
long mask;
long val;
@@ -681,7 +681,7 @@ static int rme9652_spdif_read_byte (struct snd_rme9652 *rme9652)
return val;
}
-static void rme9652_write_spdif_codec (struct snd_rme9652 *rme9652, const int address, const int data)
+static void rme9652_write_spdif_codec(struct snd_rme9652 *rme9652, const int address, const int data)
{
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_SELECT, 1);
rme9652_spdif_write_byte (rme9652, 0x20);
@@ -691,7 +691,7 @@ static void rme9652_write_spdif_codec (struct snd_rme9652 *rme9652, const int ad
}
-static int rme9652_spdif_read_codec (struct snd_rme9652 *rme9652, const int address)
+static int rme9652_spdif_read_codec(struct snd_rme9652 *rme9652, const int address)
{
int ret;
@@ -708,7 +708,7 @@ static int rme9652_spdif_read_codec (struct snd_rme9652 *rme9652, const int addr
return ret;
}
-static void rme9652_initialize_spdif_receiver (struct snd_rme9652 *rme9652)
+static void rme9652_initialize_spdif_receiver(struct snd_rme9652 *rme9652)
{
/* XXX what unsets this ? */
@@ -726,19 +726,19 @@ static inline int rme9652_spdif_sample_rate(struct snd_rme9652 *s)
if (rme9652_read(s, RME9652_status_register) & RME9652_ERF) {
return -1; /* error condition */
}
-
+
if (s->hw_rev == 15) {
int x, y, ret;
-
+
x = rme9652_spdif_read_codec (s, 30);
- if (x != 0)
+ if (x != 0)
y = 48000 * 64 / x;
else
y = 0;
- if (y > 30400 && y < 33600) ret = 32000;
+ if (y > 30400 && y < 33600) ret = 32000;
else if (y > 41900 && y < 46000) ret = 44100;
else if (y > 46000 && y < 50400) ret = 48000;
else if (y > 60800 && y < 67200) ret = 64000;
@@ -819,7 +819,7 @@ static int snd_rme9652_control_spdif_info(struct snd_kcontrol *kcontrol, struct
static int snd_rme9652_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme9652_convert_to_aes(&ucontrol->value.iec958, rme9652->creg_spdif);
return 0;
}
@@ -829,7 +829,7 @@ static int snd_rme9652_control_spdif_put(struct snd_kcontrol *kcontrol, struct s
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme9652_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme9652->lock);
change = val != rme9652->creg_spdif;
@@ -848,7 +848,7 @@ static int snd_rme9652_control_spdif_stream_info(struct snd_kcontrol *kcontrol,
static int snd_rme9652_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme9652_convert_to_aes(&ucontrol->value.iec958, rme9652->creg_spdif_stream);
return 0;
}
@@ -858,7 +858,7 @@ static int snd_rme9652_control_spdif_stream_put(struct snd_kcontrol *kcontrol, s
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme9652_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme9652->lock);
change = val != rme9652->creg_spdif_stream;
@@ -891,7 +891,7 @@ static int snd_rme9652_control_spdif_mask_get(struct snd_kcontrol *kcontrol, str
static unsigned int rme9652_adat1_in(struct snd_rme9652 *rme9652)
{
if (rme9652->control_register & RME9652_ADAT1_INTERNAL)
- return 1;
+ return 1;
return 0;
}
@@ -936,7 +936,7 @@ static int snd_rme9652_info_adat1_in(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_rme9652_get_adat1_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_adat1_in(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -948,7 +948,7 @@ static int snd_rme9652_put_adat1_in(struct snd_kcontrol *kcontrol, struct snd_ct
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
val = ucontrol->value.enumerated.item[0] % 2;
@@ -1007,7 +1007,7 @@ static int snd_rme9652_info_spdif_in(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_rme9652_get_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_spdif_in(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1019,7 +1019,7 @@ static int snd_rme9652_put_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ct
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
val = ucontrol->value.enumerated.item[0] % 3;
@@ -1069,7 +1069,7 @@ static int rme9652_set_spdif_output(struct snd_rme9652 *rme9652, int out)
static int snd_rme9652_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.integer.value[0] = rme9652_spdif_out(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1081,7 +1081,7 @@ static int snd_rme9652_put_spdif_out(struct snd_kcontrol *kcontrol, struct snd_c
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1156,7 +1156,7 @@ static int snd_rme9652_info_sync_mode(struct snd_kcontrol *kcontrol, struct snd_
static int snd_rme9652_get_sync_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_sync_mode(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1168,7 +1168,7 @@ static int snd_rme9652_put_sync_mode(struct snd_kcontrol *kcontrol, struct snd_c
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
val = ucontrol->value.enumerated.item[0] % 3;
spin_lock_irq(&rme9652->lock);
change = (int)val != rme9652_sync_mode(rme9652);
@@ -1248,7 +1248,7 @@ static int snd_rme9652_info_sync_pref(struct snd_kcontrol *kcontrol, struct snd_
static int snd_rme9652_get_sync_pref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_sync_pref(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1260,7 +1260,7 @@ static int snd_rme9652_put_sync_pref(struct snd_kcontrol *kcontrol, struct snd_c
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change, max;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
max = rme9652->ss_channels == RME9652_NCHANNELS ? 4 : 3;
@@ -1308,7 +1308,7 @@ static int snd_rme9652_put_thru(struct snd_kcontrol *kcontrol, struct snd_ctl_el
if (ucontrol->value.integer.value[chn])
thru_bits |= 1 << chn;
}
-
+
spin_lock_irq(&rme9652->lock);
change = thru_bits ^ rme9652->thru_bits;
if (change) {
@@ -1379,7 +1379,7 @@ static int snd_rme9652_info_spdif_rate(struct snd_kcontrol *kcontrol, struct snd
static int snd_rme9652_get_spdif_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.integer.value[0] = rme9652_spdif_sample_rate(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1409,11 +1409,11 @@ static int snd_rme9652_get_adat_sync(struct snd_kcontrol *kcontrol, struct snd_c
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
unsigned int mask1, mask2, val;
-
+
switch (kcontrol->private_value) {
- case 0: mask1 = RME9652_lock_0; mask2 = RME9652_sync_0; break;
- case 1: mask1 = RME9652_lock_1; mask2 = RME9652_sync_1; break;
- case 2: mask1 = RME9652_lock_2; mask2 = RME9652_sync_2; break;
+ case 0: mask1 = RME9652_lock_0; mask2 = RME9652_sync_0; break;
+ case 1: mask1 = RME9652_lock_1; mask2 = RME9652_sync_1; break;
+ case 2: mask1 = RME9652_lock_2; mask2 = RME9652_sync_2; break;
default: return -EINVAL;
}
val = rme9652_read(rme9652, RME9652_status_register);
@@ -1433,8 +1433,8 @@ static int snd_rme9652_get_adat_sync(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_rme9652_get_tc_valid(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
- ucontrol->value.integer.value[0] =
+
+ ucontrol->value.integer.value[0] =
(rme9652_read(rme9652, RME9652_status_register) & RME9652_tc_valid) ? 1 : 0;
return 0;
}
@@ -1520,7 +1520,7 @@ static struct snd_kcontrol_new snd_rme9652_controls[] = {
.get = snd_rme9652_control_spdif_mask_get,
.private_value = IEC958_AES0_NONAUDIO |
IEC958_AES0_PROFESSIONAL |
- IEC958_AES0_CON_EMPHASIS,
+ IEC958_AES0_CON_EMPHASIS,
},
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -1582,7 +1582,7 @@ static int snd_rme9652_create_controls(struct snd_card *card, struct snd_rme9652
}
/*------------------------------------------------------------
- /proc interface
+ /proc interface
------------------------------------------------------------*/
static void
@@ -1606,10 +1606,10 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
snd_iprintf(buffer, "\n");
- x = 1 << (6 + rme9652_decode_latency(rme9652->control_register &
+ x = 1 << (6 + rme9652_decode_latency(rme9652->control_register &
RME9652_latency));
- snd_iprintf(buffer, "Latency: %d samples (2 periods of %lu bytes)\n",
+ snd_iprintf(buffer, "Latency: %d samples (2 periods of %lu bytes)\n",
x, (unsigned long) rme9652->period_bytes);
snd_iprintf(buffer, "Hardware pointer (frames): %ld\n",
rme9652_hw_pointer(rme9652));
@@ -1655,7 +1655,7 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
snd_iprintf(buffer, "\n");
- switch (rme9652_decode_spdif_in(rme9652->control_register &
+ switch (rme9652_decode_spdif_in(rme9652->control_register &
RME9652_inp)) {
case RME9652_SPDIFIN_OPTICAL:
snd_iprintf(buffer, "IEC958 input: ADAT1\n");
@@ -1762,7 +1762,7 @@ static void __devinit snd_rme9652_proc_init(struct snd_rme9652 *rme9652)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(rme9652->card, "rme9652", &entry))
+ if (!snd_card_proc_new(rme9652->card, "rme9652", &entry))
snd_info_set_text_ops(entry, rme9652, snd_rme9652_proc_read);
}
@@ -1828,11 +1828,11 @@ static void snd_rme9652_set_defaults(struct snd_rme9652 *rme9652)
/* set defaults:
- SPDIF Input via Coax
+ SPDIF Input via Coax
autosync clock mode
maximum latency (7 = 8192 samples, 64Kbyte buffer,
which implies 2 4096 sample, 32Kbyte periods).
-
+
if rev 1.5, initialize the S/PDIF receiver.
*/
@@ -1893,11 +1893,11 @@ static char *rme9652_channel_buffer_location(struct snd_rme9652 *rme9652,
if (snd_BUG_ON(channel < 0 || channel >= RME9652_NCHANNELS))
return NULL;
-
+
if ((mapped_channel = rme9652->channel_map[channel]) < 0) {
return NULL;
}
-
+
if (stream == SNDRV_PCM_STREAM_CAPTURE) {
return rme9652->capture_buffer +
(mapped_channel * RME9652_CHANNEL_BUFFER_BYTES);
@@ -2142,10 +2142,10 @@ static int snd_rme9652_trigger(struct snd_pcm_substream *substream,
rme9652_silence_playback(rme9652);
}
} else {
- if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
rme9652_silence_playback(rme9652);
}
- _ok:
+_ok:
snd_pcm_trigger_done(substream, substream);
if (!rme9652->running && running)
rme9652_start(rme9652);
@@ -2178,9 +2178,9 @@ static struct snd_pcm_hardware snd_rme9652_playback_subinfo =
SNDRV_PCM_INFO_SYNC_START |
SNDRV_PCM_INFO_DOUBLE),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_88200 |
+ .rates = (SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 44100,
.rate_max = 96000,
@@ -2201,9 +2201,9 @@ static struct snd_pcm_hardware snd_rme9652_capture_subinfo =
SNDRV_PCM_INFO_NONINTERLEAVED |
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_88200 |
+ .rates = (SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 44100,
.rate_max = 96000,
@@ -2478,7 +2478,7 @@ static int __devinit snd_rme9652_create(struct snd_card *card,
snd_printk(KERN_ERR "unable to remap region 0x%lx-0x%lx\n", rme9652->port, rme9652->port + RME9652_IO_EXTENT - 1);
return -EBUSY;
}
-
+
if (request_irq(pci->irq, snd_rme9652_interrupt, IRQF_SHARED,
"rme9652", rme9652)) {
snd_printk(KERN_ERR "unable to request IRQ %d\n", pci->irq);
@@ -2503,7 +2503,7 @@ static int __devinit snd_rme9652_create(struct snd_card *card,
"Light", which does not have the expansion board. This
method comes from information received from Mathhias
Clausen at RME. Display the EEPROM and h/w revID where
- relevant.
+ relevant.
*/
switch (rev) {
@@ -2616,7 +2616,7 @@ static int __devinit snd_rme9652_probe(struct pci_dev *pci,
sprintf(card->longname, "%s at 0x%lx, irq %d",
card->shortname, rme9652->port, rme9652->irq);
-
+
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/pcxhr/pcxhr.c | 44 ++++++++++++++++++++--------------------
sound/pci/pcxhr/pcxhr_core.c | 22 ++++++++++----------
sound/pci/pcxhr/pcxhr_hwdep.c | 16 +++++++-------
sound/pci/pcxhr/pcxhr_mixer.c | 16 +++++++-------
4 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 0e06c6c..bebf866 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -197,7 +197,7 @@ static int pcxhr_get_clock_reg(struct pcxhr_mgr *mgr, unsigned int rate,
if (err < 0) {
snd_printk(KERN_ERR
"error CMD_ACCESS_IO_WRITE for PLL register : %x!\n",
- err );
+ err);
return err;
}
}
@@ -603,12 +603,12 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
/* put the streams into the running state now (increment pointer by interrupt) */
spin_lock_irqsave(&mgr->lock, flags);
- for ( i =0; i < mgr->num_cards; i++) {
+ for (i =0; i < mgr->num_cards; i++) {
struct pcxhr_stream *stream;
chip = mgr->chip[i];
- for(j = 0; j < chip->nb_streams_capt; j++) {
+ for (j = 0; j < chip->nb_streams_capt; j++) {
stream = &chip->capture_stream[j];
- if(stream->status == PCXHR_STREAM_STATUS_STARTED)
+ if (stream->status == PCXHR_STREAM_STATUS_STARTED)
stream->status = PCXHR_STREAM_STATUS_RUNNING;
}
for (j = 0; j < chip->nb_streams_play; j++) {
@@ -723,7 +723,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
subs->runtime->buffer_size);
/*
- if(subs->runtime->period_size <= PCXHR_GRANULARITY) {
+ if (subs->runtime->period_size <= PCXHR_GRANULARITY) {
snd_printk(KERN_ERR "pcxhr_prepare : error period_size too small (%x)\n",
(unsigned int)subs->runtime->period_size);
return -EINVAL;
@@ -735,11 +735,11 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
do {
/* if the stream was stopped before, format and buffer were reset */
/*
- if(stream->status == PCXHR_STREAM_STATUS_STOPPED) {
+ if (stream->status == PCXHR_STREAM_STATUS_STOPPED) {
err = pcxhr_set_format(stream);
- if(err) break;
+ if (err) break;
err = pcxhr_update_r_buffer(stream);
- if(err) break;
+ if (err) break;
}
*/
@@ -790,7 +790,7 @@ static int pcxhr_hw_params(struct snd_pcm_substream *subs,
/* set the format to the board */
/*
err = pcxhr_set_format(stream);
- if(err) {
+ if (err) {
mutex_unlock(&mgr->setup_mutex);
return err;
}
@@ -853,7 +853,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
/* copy the struct snd_pcm_hardware struct */
runtime->hw = pcxhr_caps;
- if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) {
+ if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) {
snd_printdd("pcxhr_open playback chip%d subs%d\n",
chip->chip_idx, subs->number);
stream = &chip->playback_stream[subs->number];
@@ -1025,7 +1025,7 @@ static int __devinit pcxhr_create(struct pcxhr_mgr *mgr, struct snd_card *card,
};
mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (! chip) {
+ if (!chip) {
snd_printk(KERN_ERR "cannot allocate chip\n");
return -ENOMEM;
}
@@ -1078,7 +1078,7 @@ static void pcxhr_proc_info(struct snd_info_entry *entry, struct snd_info_buffer
/* calc cpu load of the dsp */
pcxhr_init_rmh(&rmh, CMD_GET_DSP_RESOURCES);
- if( ! pcxhr_send_msg(mgr, &rmh) ) {
+ if (!pcxhr_send_msg(mgr, &rmh)) {
int cur = rmh.stat[0];
int ref = rmh.stat[1];
if (ref > 0) {
@@ -1108,7 +1108,7 @@ static void pcxhr_proc_info(struct snd_info_entry *entry, struct snd_info_buffer
rmh.stat_len = PCXHR_SIZE_MAX_STATUS;
rmh.dsp_stat = 0;
rmh.cmd_idx = CMD_LAST_INDEX;
- if( ! pcxhr_send_msg(mgr, &rmh) ) {
+ if (!pcxhr_send_msg(mgr, &rmh)) {
int i;
for (i = 0; i < rmh.stat_len; i++)
snd_iprintf(buffer, "debug[%02d] = %06x\n", i, rmh.stat[i]);
@@ -1147,9 +1147,9 @@ static void __devinit pcxhr_proc_init(struct snd_pcxhr *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "info", &entry))
+ if (!snd_card_proc_new(chip->card, "info", &entry))
snd_info_set_text_ops(entry, chip, pcxhr_proc_info);
- if (! snd_card_proc_new(chip->card, "sync", &entry))
+ if (!snd_card_proc_new(chip->card, "sync", &entry))
snd_info_set_text_ops(entry, chip, pcxhr_proc_sync);
}
/* end of proc interface */
@@ -1167,7 +1167,7 @@ static int pcxhr_free(struct pcxhr_mgr *mgr)
}
/* reset board if some firmware was loaded */
- if(mgr->dsp_loaded) {
+ if (mgr->dsp_loaded) {
pcxhr_reset_board(mgr);
snd_printdd("reset pcxhr !\n");
}
@@ -1205,7 +1205,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
if (dev >= SNDRV_CARDS)
return -ENODEV;
- if (! enable[dev]) {
+ if (!enable[dev]) {
dev++;
return -ENOENT;
}
@@ -1224,7 +1224,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
/* alloc card manager */
mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
- if (! mgr) {
+ if (!mgr) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -1271,15 +1271,15 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
/* init taslket */
tasklet_init(&mgr->msg_taskq, pcxhr_msg_tasklet, (unsigned long) mgr);
tasklet_init(&mgr->trigger_taskq, pcxhr_trigger_tasklet, (unsigned long) mgr);
- mgr->prmh = kmalloc(sizeof(*mgr->prmh) +
+ mgr->prmh = kmalloc(sizeof(*mgr->prmh) +
sizeof(u32) * (PCXHR_SIZE_MAX_LONG_STATUS - PCXHR_SIZE_MAX_STATUS),
GFP_KERNEL);
- if (! mgr->prmh) {
+ if (!mgr->prmh) {
pcxhr_free(mgr);
return -ENOMEM;
}
- for (i=0; i < PCXHR_MAX_CARDS; i++) {
+ for (i = 0; i < PCXHR_MAX_CARDS; i++) {
struct snd_card *card;
char tmpid[16];
int idx;
@@ -1296,7 +1296,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : card_name, i);
card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
- if (! card) {
+ if (!card) {
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
pcxhr_free(mgr);
return -ENOMEM;
diff --git a/sound/pci/pcxhr/pcxhr_core.c b/sound/pci/pcxhr/pcxhr_core.c
index 7143259..16575f4 100644
--- a/sound/pci/pcxhr/pcxhr_core.c
+++ b/sound/pci/pcxhr/pcxhr_core.c
@@ -23,7 +23,7 @@
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include "pcxhr.h"
#include "pcxhr_mixer.h"
@@ -246,9 +246,9 @@ void pcxhr_reset_dsp(struct pcxhr_mgr *mgr)
/* let's reset the DSP */
PCXHR_OUTPB(mgr, PCXHR_DSP_RESET, 0);
- msleep( PCXHR_WAIT_DEFAULT ); /* wait 2 msec */
+ msleep(PCXHR_WAIT_DEFAULT); /* wait 2 msec */
PCXHR_OUTPB(mgr, PCXHR_DSP_RESET, 3);
- msleep( PCXHR_WAIT_DEFAULT ); /* wait 2 msec */
+ msleep(PCXHR_WAIT_DEFAULT); /* wait 2 msec */
/* reset mailbox */
PCXHR_OUTPL(mgr, PCXHR_PLX_MBOX0, 0);
@@ -275,7 +275,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr, const struct firmware *xilin
chipsc = PCXHR_INPL(mgr, PCXHR_PLX_CHIPSC);
/* REV01 cards do not support the PCXHR_CHIPSC_GPI_USERI bit anymore */
/* this bit will always be 1; no possibility to test presence of first xilinx */
- if(second) {
+ if (second) {
if ((chipsc & PCXHR_CHIPSC_GPI_USERI) == 0) {
snd_printk(KERN_ERR "error loading first xilinx\n");
return -EINVAL;
@@ -283,7 +283,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr, const struct firmware *xilin
/* activate second xilinx */
chipsc |= PCXHR_CHIPSC_RESET_XILINX;
PCXHR_OUTPL(mgr, PCXHR_PLX_CHIPSC, chipsc);
- msleep( PCXHR_WAIT_DEFAULT ); /* wait 2 msec */
+ msleep(PCXHR_WAIT_DEFAULT); /* wait 2 msec */
}
image = xilinx->data;
for (i = 0; i < xilinx->size; i++, image++) {
@@ -304,7 +304,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr, const struct firmware *xilin
chipsc &= ~(PCXHR_CHIPSC_DATA_CLK | PCXHR_CHIPSC_DATA_IN);
PCXHR_OUTPL(mgr, PCXHR_PLX_CHIPSC, chipsc);
/* wait 2 msec (time to boot the xilinx before any access) */
- msleep( PCXHR_WAIT_DEFAULT );
+ msleep(PCXHR_WAIT_DEFAULT);
return 0;
}
@@ -627,7 +627,7 @@ static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
PCXHR_OUTPB(mgr, PCXHR_DSP_TXM, (data>>8)&0xFF);
PCXHR_OUTPB(mgr, PCXHR_DSP_TXL, (data&0xFF));
- for (i=1; i < rmh->cmd_len; i++) {
+ for (i = 1; i < rmh->cmd_len; i++) {
/* send other words */
data = rmh->cmd[i];
#ifdef CONFIG_SND_DEBUG_VERBOSE
@@ -706,7 +706,7 @@ void pcxhr_set_pipe_cmd_params(struct pcxhr_rmh *rmh, int capture,
snd_BUG_ON(param2 > MASK_FIRST_FIELD);
rmh->cmd[0] |= param2;
}
- if(param3) {
+ if (param3) {
snd_BUG_ON(param3 > MASK_DSP_WORD);
rmh->cmd[1] = param3;
rmh->cmd_len = 2;
@@ -841,7 +841,7 @@ static int pcxhr_toggle_pipes(struct pcxhr_mgr *mgr, int audio_mask)
pcxhr_init_rmh(&rmh, CMD_SEND_IRQA);
err = pcxhr_send_msg(mgr, &rmh);
if (err) {
- snd_printk(KERN_ERR "error pipe start (CMD_SEND_IRQA) err=%x!\n", err );
+ snd_printk(KERN_ERR "error pipe start (CMD_SEND_IRQA) err=%x!\n", err);
return err;
}
return 0;
@@ -1154,7 +1154,7 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
spin_lock(&mgr->lock);
reg = PCXHR_INPL(mgr, PCXHR_PLX_IRQCS);
- if (! (reg & PCXHR_IRQCS_ACTIVE_PCIDB)) {
+ if (!(reg & PCXHR_IRQCS_ACTIVE_PCIDB)) {
spin_unlock(&mgr->lock);
return IRQ_NONE; /* this device did not cause the interrupt */
}
@@ -1211,7 +1211,7 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
*/
/* better resynchronize all streams next interrupt : */
mgr->dsp_time_last = PCXHR_DSP_TIME_INVALID;
-
+
mgr->src_it_dsp = reg;
tasklet_hi_schedule(&mgr->msg_taskq);
}
diff --git a/sound/pci/pcxhr/pcxhr_hwdep.c b/sound/pci/pcxhr/pcxhr_hwdep.c
index 96640d9..9d04175 100644
--- a/sound/pci/pcxhr/pcxhr_hwdep.c
+++ b/sound/pci/pcxhr/pcxhr_hwdep.c
@@ -24,7 +24,7 @@
#include <linux/vmalloc.h>
#include <linux/firmware.h>
#include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/hwdep.h>
#include "pcxhr.h"
@@ -104,7 +104,7 @@ static int pcxhr_init_board(struct pcxhr_mgr *mgr)
mgr->board_has_analog = 1; /* analog addon board available */
else
/* analog addon board not available -> no support for instance */
- return -EINVAL;
+ return -EINVAL;
/* unmute inputs */
err = pcxhr_write_io_num_reg_cont(mgr, REG_CONT_UNMUTE_INPUTS,
@@ -144,7 +144,7 @@ void pcxhr_reset_board(struct pcxhr_mgr *mgr)
/*
* allocate a playback/capture pipe (pcmp0/pcmc0)
*/
-static int pcxhr_dsp_allocate_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe,
+static int pcxhr_dsp_allocate_pipe(struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe,
int is_capture, int pin)
{
int stream_count, audio_count;
@@ -166,10 +166,10 @@ static int pcxhr_dsp_allocate_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pi
pipe->first_audio = pin;
/* define pipe (P_PCM_ONLY_MASK (0x020000) is not necessary) */
pcxhr_init_rmh(&rmh, CMD_RES_PIPE);
- pcxhr_set_pipe_cmd_params(&rmh, is_capture, pin, audio_count, stream_count);
+ pcxhr_set_pipe_cmd_params(&rmh, is_capture, pin, audio_count, stream_count);
err = pcxhr_send_msg(mgr, &rmh);
if (err < 0) {
- snd_printk(KERN_ERR "error pipe allocation (CMD_RES_PIPE) err=%x!\n", err );
+ snd_printk(KERN_ERR "error pipe allocation (CMD_RES_PIPE) err=%x!\n", err);
return err;
}
pipe->status = PCXHR_PIPE_DEFINED;
@@ -181,7 +181,7 @@ static int pcxhr_dsp_allocate_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pi
* free playback/capture pipe (pcmp0/pcmc0)
*/
#if 0
-static int pcxhr_dsp_free_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
+static int pcxhr_dsp_free_pipe(struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
{
struct pcxhr_rmh rmh;
int capture_mask = 0;
@@ -223,7 +223,7 @@ static int pcxhr_config_pipes(struct pcxhr_mgr *mgr)
err = pcxhr_dsp_allocate_pipe( mgr, pipe, 0, i*2);
if (err)
return err;
- for(j = 0; j < chip->nb_streams_play; j++)
+ for (j = 0; j < chip->nb_streams_play; j++)
chip->playback_stream[j].pipe = pipe;
}
for (j = 0; j < chip->nb_streams_capt; j++) {
@@ -392,7 +392,7 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
fw.size = dsp->length;
fw.data = vmalloc(fw.size);
- if (! fw.data) {
+ if (!fw.data) {
snd_printk(KERN_ERR "pcxhr: cannot allocate dsp image (%lu bytes)\n",
(unsigned long)fw.size);
return -ENOMEM;
diff --git a/sound/pci/pcxhr/pcxhr_mixer.c b/sound/pci/pcxhr/pcxhr_mixer.c
index aabc7bc..fd7e60c 100644
--- a/sound/pci/pcxhr/pcxhr_mixer.c
+++ b/sound/pci/pcxhr/pcxhr_mixer.c
@@ -173,7 +173,7 @@ static int pcxhr_audio_sw_put(struct snd_kcontrol *kcontrol,
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
int i, changed = 0;
mutex_lock(&chip->mgr->mixer_mutex);
- for(i = 0; i < 2; i++) {
+ for (i = 0; i < 2; i++) {
if (chip->analog_playback_active[i] !=
ucontrol->value.integer.value[i]) {
chip->analog_playback_active[i] =
@@ -284,7 +284,7 @@ static int pcxhr_update_audio_pipe_level(struct snd_pcxhr* chip, int capture, in
rmh.cmd_len = 3;
err = pcxhr_send_msg(chip->mgr, &rmh);
- if(err<0) {
+ if (err<0) {
snd_printk(KERN_DEBUG "error update_audio_level card(%d) err(%x)\n",
chip->chip_idx, err);
return -EINVAL;
@@ -445,7 +445,7 @@ static int pcxhr_monitor_vol_put(struct snd_kcontrol *kcontrol,
ucontrol->value.integer.value[i]) {
chip->monitoring_volume[i] =
!!ucontrol->value.integer.value[i];
- if(chip->monitoring_active[i])
+ if (chip->monitoring_active[i])
/* update monitoring volume and mute */
/* do only when monitoring is unmuted */
pcxhr_update_audio_pipe_level(chip, 0, i);
@@ -566,7 +566,7 @@ static int pcxhr_set_audio_source(struct snd_pcxhr* chip)
rmh.cmd[1] = codec;
rmh.cmd[2] = (CS8420_DATA_FLOW_CTL & CHIP_SIG_AND_MAP_SPI) | (use_src ? 0x41 : 0x54);
err = pcxhr_send_msg(chip->mgr, &rmh);
- if(err)
+ if (err)
return err;
rmh.cmd[2] = (CS8420_CLOCK_SRC_CTL & CHIP_SIG_AND_MAP_SPI) | (use_src ? 0x41 : 0x49);
err = pcxhr_send_msg(chip->mgr, &rmh);
@@ -722,7 +722,7 @@ static int pcxhr_clock_rate_get(struct snd_kcontrol *kcontrol,
int i, err, rate;
mutex_lock(&mgr->mixer_mutex);
- for(i = 0; i < 3 + mgr->capture_chips; i++) {
+ for (i = 0; i < 3 + mgr->capture_chips; i++) {
if (i == PCXHR_CLOCK_TYPE_INTERNAL)
rate = mgr->sample_rate_real;
else {
@@ -802,7 +802,7 @@ static int pcxhr_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
int i, err;
mutex_lock(&chip->mgr->mixer_mutex);
- for(i = 0; i < 5; i++) {
+ for (i = 0; i < 5; i++) {
if (kcontrol->private_value == 0) /* playback */
aes_bits = chip->aes_bits[i];
else { /* capture */
@@ -835,7 +835,7 @@ static int pcxhr_iec958_update_byte(struct snd_pcxhr *chip, int aes_idx, unsigne
for (i = 0; i < 8; i++) {
if ((old_bits & 0x01) != (new_bits & 0x01)) {
cmd = chip->chip_idx & 0x03; /* chip index 0..3 */
- if(chip->chip_idx > 3)
+ if (chip->chip_idx > 3)
/* new bit used if chip_idx>3 (PCX1222HR) */
cmd |= 1 << 22;
cmd |= ((aes_idx << 3) + i) << 2; /* add bit offset */
@@ -971,7 +971,7 @@ int pcxhr_create_mixer(struct pcxhr_mgr *mgr)
snd_ctl_new1(&pcxhr_control_output_switch,
chip))) < 0)
return err;
-
+
temp = snd_pcxhr_pcm_vol;
temp.name = "PCM Playback Volume";
temp.count = PCXHR_PLAYBACK_STREAMS;
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/nm256/nm256.c | 66 +++++++++++++++++++++---------------------
sound/pci/nm256/nm256_coef.c | 4 +-
sound/pci/oxygen/oxygen_io.c | 2 +-
3 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 50c9f8a..b12e322 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1,4 +1,4 @@
-/*
+/*
* Driver for NeoMagic 256AV and 256ZX chipsets.
* Copyright (c) 2000 by Takashi Iwai <tiwai(a)suse.de>
*
@@ -23,8 +23,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-#include <asm/io.h>
+
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -190,7 +190,7 @@ struct nm256_stream {
struct snd_pcm_substream *substream;
int running;
int suspended;
-
+
u32 buf; /* offset from chip->buffer */
int bufsize; /* buffer size in bytes */
void __iomem *bufptr; /* mapped pointer */
@@ -205,7 +205,7 @@ struct nm256_stream {
};
struct nm256 {
-
+
struct snd_card *card;
void __iomem *cport; /* control port */
@@ -375,11 +375,11 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number)
if (stream == SNDRV_PCM_STREAM_CAPTURE)
number += 8;
- if (! chip->use_cache) {
+ if (!chip->use_cache) {
snd_nm256_load_one_coefficient(chip, stream, addr, number);
return;
}
- if (! chip->coeffs_current) {
+ if (!chip->coeffs_current) {
snd_nm256_write_buffer(chip, coefficients, chip->all_coeff_buf,
NM_TOTAL_COEFF_COUNT * 4);
chip->coeffs_current = 1;
@@ -400,7 +400,7 @@ static unsigned int samplerates[8] = {
8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000,
};
static struct snd_pcm_hw_constraint_list constraints_rates = {
- .count = ARRAY_SIZE(samplerates),
+ .count = ARRAY_SIZE(samplerates),
.list = samplerates,
.mask = 0,
};
@@ -571,7 +571,7 @@ snd_nm256_playback_trigger(struct snd_pcm_substream *substream, int cmd)
s->suspended = 0;
/* fallthru */
case SNDRV_PCM_TRIGGER_START:
- if (! s->running) {
+ if (!s->running) {
snd_nm256_playback_start(chip, s, substream);
s->running = 1;
}
@@ -607,7 +607,7 @@ snd_nm256_capture_trigger(struct snd_pcm_substream *substream, int cmd)
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
- if (! s->running) {
+ if (!s->running) {
snd_nm256_capture_start(chip, s, substream);
s->running = 1;
}
@@ -680,7 +680,7 @@ snd_nm256_capture_pointer(struct snd_pcm_substream *substream)
if (snd_BUG_ON(!s))
return 0;
curp = snd_nm256_readl(chip, NM_RBUFFER_CURRP) - (unsigned long)s->buf;
- curp %= s->dma_size;
+ curp %= s->dma_size;
return bytes_to_frames(substream->runtime, curp);
}
@@ -956,8 +956,8 @@ snd_nm256_pcm(struct nm256 *chip, int device)
}
-/*
- * Initialize the hardware.
+/*
+ * Initialize the hardware.
*/
static void
snd_nm256_init_chip(struct nm256 *chip)
@@ -966,8 +966,8 @@ snd_nm256_init_chip(struct nm256 *chip)
snd_nm256_writeb(chip, 0x0, 0x11);
snd_nm256_writew(chip, 0x214, 0);
/* stop sounds.. */
- //snd_nm256_playback_stop(chip);
- //snd_nm256_capture_stop(chip);
+ /* snd_nm256_playback_stop(chip); */
+ /* snd_nm256_capture_stop(chip); */
}
@@ -997,8 +997,8 @@ snd_nm256_intr_check(struct nm256 *chip)
return IRQ_NONE;
}
-/*
- * Handle a potential interrupt for the device referred to by DEV_ID.
+/*
+ * Handle a potential interrupt for the device referred to by DEV_ID.
*
* I don't like the cut-n-paste job here either between the two routines,
* but there are sufficient differences between the two interrupt handlers
@@ -1147,8 +1147,8 @@ snd_nm256_ac97_ready(struct nm256 *chip)
testaddr = chip->mixer_status_offset;
testb = chip->mixer_status_mask;
- /*
- * Loop around waiting for the mixer to become ready.
+ /*
+ * Loop around waiting for the mixer to become ready.
*/
while (timeout-- > 0) {
if ((snd_nm256_readw(chip, testaddr) & testb) == 0)
@@ -1158,7 +1158,7 @@ snd_nm256_ac97_ready(struct nm256 *chip)
return 0;
}
-/*
+/*
* Initial register values to be written to the AC97 mixer.
* While most of these are identical to the reset values, we do this
* so that we have most of the register contents cached--this avoids
@@ -1187,7 +1187,7 @@ static struct initialValues nm256_ac97_init_val[] =
{ AC97_REC_SEL, 0x0000 },
{ AC97_REC_GAIN, 0x0B0B },
{ AC97_GENERAL_PURPOSE, 0x0000 },
- { AC97_3D_CONTROL, 0x8000 },
+ { AC97_3D_CONTROL, 0x8000 },
{ AC97_VENDOR_ID1, 0x8384 },
{ AC97_VENDOR_ID2, 0x7609 },
};
@@ -1217,7 +1217,7 @@ snd_nm256_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
return chip->ac97_regs[idx];
}
-/*
+/*
*/
static void
snd_nm256_ac97_write(struct snd_ac97 *ac97,
@@ -1273,16 +1273,16 @@ snd_nm256_ac97_reset(struct snd_ac97 *ac97)
/* Reset the mixer. 'Tis magic! */
snd_nm256_writeb(chip, 0x6c0, 1);
- if (! chip->reset_workaround) {
+ if (!chip->reset_workaround) {
/* Dell latitude LS will lock up by this */
snd_nm256_writeb(chip, 0x6cc, 0x87);
}
- if (! chip->reset_workaround_2) {
+ if (!chip->reset_workaround_2) {
/* Dell latitude CSx will lock up by this */
snd_nm256_writeb(chip, 0x6cc, 0x80);
snd_nm256_writeb(chip, 0x6cc, 0x0);
}
- if (! chip->in_resume) {
+ if (!chip->in_resume) {
int i;
for (i = 0; i < ARRAY_SIZE(nm256_ac97_init_val); i++) {
/* preload the cache, so as to avoid even a single
@@ -1309,7 +1309,7 @@ snd_nm256_mixer(struct nm256 *chip)
chip->ac97_regs = kcalloc(ARRAY_SIZE(nm256_ac97_init_val),
sizeof(short), GFP_KERNEL);
- if (! chip->ac97_regs)
+ if (!chip->ac97_regs)
return -ENOMEM;
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
@@ -1323,14 +1323,14 @@ snd_nm256_mixer(struct nm256 *chip)
err = snd_ac97_mixer(pbus, &ac97, &chip->ac97);
if (err < 0)
return err;
- if (! (chip->ac97->id & (0xf0000000))) {
+ if (!(chip->ac97->id & (0xf0000000))) {
/* looks like an invalid id */
sprintf(chip->card->mixername, "%s AC97", chip->card->driver);
}
return 0;
}
-/*
+/*
* See if the signature left by the NM256 BIOS is intact; if so, we use
* the associated address as the end of our audio buffer in the video
* RAM.
@@ -1498,7 +1498,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
chip->streams[SNDRV_PCM_STREAM_PLAYBACK].bufsize = playback_bufsize * 1024;
chip->streams[SNDRV_PCM_STREAM_CAPTURE].bufsize = capture_bufsize * 1024;
- /*
+ /*
* The NM256 has two memory ports. The first port is nothing
* more than a chunk of video RAM, which is used as the I/O ring
* buffer. The second port has the actual juicy stuff (like the
@@ -1529,7 +1529,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
/* Ok, try to see if this is a non-AC97 version of the hardware. */
pval = snd_nm256_readw(chip, NM_MIXER_PRESENCE);
if ((pval & NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
- if (! force_ac97) {
+ if (!force_ac97) {
printk(KERN_ERR "nm256: no ac97 is found!\n");
printk(KERN_ERR " force the driver to load by "
"passing in the module parameter\n");
@@ -1555,7 +1555,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
chip->mixer_status_offset = NM2_MIXER_STATUS_OFFSET;
chip->mixer_status_mask = NM2_MIXER_READY_MASK;
}
-
+
chip->buffer_size = chip->streams[SNDRV_PCM_STREAM_PLAYBACK].bufsize +
chip->streams[SNDRV_PCM_STREAM_CAPTURE].bufsize;
if (chip->use_cache)
@@ -1614,8 +1614,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
snd_nm256_init_chip(chip);
- // pci_set_master(pci); /* needed? */
-
+ /* pci_set_master(pci); needed? */
+
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
goto __error;
diff --git a/sound/pci/nm256/nm256_coef.c b/sound/pci/nm256/nm256_coef.c
index 747d5d6..a75e037 100644
--- a/sound/pci/nm256/nm256_coef.c
+++ b/sound/pci/nm256/nm256_coef.c
@@ -1,6 +1,6 @@
#define NM_TOTAL_COEFF_COUNT 0x3158
-static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
+static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21,
0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01,
0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD,
@@ -4594,7 +4594,7 @@ static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
0x9A, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xAD,
0xFF, 0x48, 0x01, 0xE2, 0xFC, 0xDA, 0x05, 0x97, 0xF6, 0x0B, 0x0F,
0x79, 0x42, 0xC7, 0x03, 0x9E, 0xFA, 0x71, 0x04, 0x28, 0xFD, 0x63,
- 0x01, 0x8D, 0xFF, 0x0F, 0x00
+ 0x01, 0x8D, 0xFF, 0x0F, 0x00
};
static u16
diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
index 83f135f..17618c1 100644
--- a/sound/pci/oxygen/oxygen_io.c
+++ b/sound/pci/oxygen/oxygen_io.c
@@ -20,7 +20,7 @@
#include <linux/delay.h>
#include <linux/sched.h>
#include <sound/core.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "oxygen.h"
u8 oxygen_read8(struct oxygen *chip, unsigned int reg)
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/mixart/mixart.c | 148 +++++++++++++++++++-------------------
sound/pci/mixart/mixart_core.c | 100 +++++++++++++-------------
sound/pci/mixart/mixart_hwdep.c | 128 +++++++++++++++++-----------------
sound/pci/mixart/mixart_hwdep.h | 28 ++++----
sound/pci/mixart/mixart_mixer.c | 56 +++++++-------
5 files changed, 230 insertions(+), 230 deletions(-)
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 2d0dce6..9db4225 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -80,10 +80,10 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
switch(pipe->status) {
case PIPE_RUNNING:
case PIPE_CLOCK_SET:
- if(start) return 0; /* already started */
+ if (start) return 0; /* already started */
break;
case PIPE_STOPPED:
- if(!start) return 0; /* already stopped */
+ if (!start) return 0; /* already stopped */
break;
default:
snd_printk(KERN_ERR "error mixart_set_pipe_state called with wrong pipe->status!\n");
@@ -100,7 +100,7 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
request.size = sizeof(system_msg_uid);
err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid);
- if(err) {
+ if (err) {
snd_printk(KERN_ERR "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n");
return err;
}
@@ -111,7 +111,7 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
group_state.pipe_count = 1;
group_state.pipe_uid[0] = pipe->group_uid;
- if(start)
+ if (start)
request.message_id = MSG_STREAM_START_STREAM_GRP_PACKET;
else
request.message_id = MSG_STREAM_STOP_STREAM_GRP_PACKET;
@@ -126,7 +126,7 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
return -EINVAL;
}
- if(start) {
+ if (start) {
u32 stat;
group_state.pipe_count = 0; /* in case of start same command once again with pipe_count=0 */
@@ -171,10 +171,10 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
case PIPE_CLOCK_SET:
break;
case PIPE_RUNNING:
- if(rate != 0)
+ if (rate != 0)
break;
default:
- if(rate == 0)
+ if (rate == 0)
return 0; /* nothing to do */
else {
snd_printk(KERN_ERR "error mixart_set_clock(%d) called with wrong pipe->status !\n", rate);
@@ -202,7 +202,7 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
return -EINVAL;
}
- if(rate) pipe->status = PIPE_CLOCK_SET;
+ if (rate) pipe->status = PIPE_CLOCK_SET;
else pipe->status = PIPE_RUNNING;
return 0;
@@ -220,7 +220,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
struct mixart_pipe *pipe;
struct mixart_msg request;
- if(capture) {
+ if (capture) {
if (pcm_number == MIXART_PCM_ANALOG) {
pipe = &(chip->pipe_in_ana); /* analog inputs */
} else {
@@ -239,12 +239,12 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
}
/* a new stream is opened and there are already all streams in use */
- if( (monitoring == 0) && (pipe->references >= stream_count) ) {
+ if ((monitoring == 0) && (pipe->references >= stream_count)) {
return NULL;
}
/* pipe is not yet defined */
- if( pipe->status == PIPE_UNDEFINED ) {
+ if (pipe->status == PIPE_UNDEFINED) {
int err, i;
struct {
struct mixart_streaming_group_req sgroup_req;
@@ -268,11 +268,11 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
buf->sgroup_req.latency = 256;
buf->sgroup_req.connector = pipe->uid_left_connector; /* the left connector */
- for (i=0; i<stream_count; i++) {
+ for (i = 0; i < stream_count; i++) {
int j;
struct mixart_flowinfo *flowinfo;
struct mixart_bufferinfo *bufferinfo;
-
+
/* we don't yet know the format, so config 16 bit pcm audio for instance */
buf->sgroup_req.stream_info[i].size_max_byte_frame = 1024;
buf->sgroup_req.stream_info[i].size_max_sample_frame = 256;
@@ -280,7 +280,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
/* find the right bufferinfo_array */
j = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (pcm_number * (MIXART_PLAYBACK_STREAMS + MIXART_CAPTURE_STREAMS)) + i;
- if(capture) j += MIXART_PLAYBACK_STREAMS; /* in the array capture is behind playback */
+ if (capture) j += MIXART_PLAYBACK_STREAMS; /* in the array capture is behind playback */
buf->sgroup_req.flow_entry[i] = j;
@@ -294,13 +294,13 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
/* construct the identifier of the stream buffer received in the interrupts ! */
bufferinfo[j].buffer_id = (chip->chip_idx << MIXART_NOTIFY_CARD_OFFSET) + (pcm_number << MIXART_NOTIFY_PCM_OFFSET ) + i;
- if(capture) {
+ if (capture) {
bufferinfo[j].buffer_id |= MIXART_NOTIFY_CAPT_MASK;
}
}
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp);
- if((err < 0) || (buf->sgroup_resp.status != 0)) {
+ if ((err < 0) || (buf->sgroup_resp.status != 0)) {
snd_printk(KERN_ERR "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n", err, buf->sgroup_resp.status);
kfree(buf);
return NULL;
@@ -314,7 +314,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
kfree(buf);
}
- if(monitoring) pipe->monitoring = 1;
+ if (monitoring) pipe->monitoring = 1;
else pipe->references++;
return pipe;
@@ -326,28 +326,28 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
{
int err = 0;
- if(pipe->status == PIPE_UNDEFINED)
+ if (pipe->status == PIPE_UNDEFINED)
return 0;
- if(monitoring)
+ if (monitoring)
pipe->monitoring = 0;
else
pipe->references--;
- if((pipe->references <= 0) && (pipe->monitoring == 0)) {
+ if ((pipe->references <= 0) && (pipe->monitoring == 0)) {
struct mixart_msg request;
struct mixart_delete_group_resp delete_resp;
/* release the clock */
err = mixart_set_clock( mgr, pipe, 0);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "mixart_set_clock(0) return error!\n");
}
/* stop the pipe */
err = mixart_set_pipe_state(mgr, pipe, 0);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error stopping pipe!\n");
}
@@ -376,7 +376,7 @@ static int mixart_set_stream_state(struct mixart_stream *stream, int start)
struct mixart_stream_state_req stream_state_req;
struct mixart_msg request;
- if(!stream->substream)
+ if (!stream->substream)
return -EINVAL;
memset(&stream_state_req, 0, sizeof(stream_state_req));
@@ -416,7 +416,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
snd_printdd("SNDRV_PCM_TRIGGER_START\n");
/* START_STREAM */
- if( mixart_set_stream_state(stream, 1) )
+ if (mixart_set_stream_state(stream, 1))
return -EINVAL;
stream->status = MIXART_STREAM_STATUS_RUNNING;
@@ -425,7 +425,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
case SNDRV_PCM_TRIGGER_STOP:
/* STOP_STREAM */
- if( mixart_set_stream_state(stream, 0) )
+ if (mixart_set_stream_state(stream, 0))
return -EINVAL;
stream->status = MIXART_STREAM_STATUS_OPEN;
@@ -479,12 +479,12 @@ static int snd_mixart_prepare(struct snd_pcm_substream *subs)
/* only the first stream can choose the sample rate */
/* the further opened streams will be limited to its frequency (see open) */
- if(chip->mgr->ref_count_rate == 1)
+ if (chip->mgr->ref_count_rate == 1)
chip->mgr->sample_rate = subs->runtime->rate;
/* set the clock only once (first stream) on the same pipe */
- if(stream->pipe->references == 1) {
- if( mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate) )
+ if (stream->pipe->references == 1) {
+ if (mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate))
return -EINVAL;
}
@@ -508,7 +508,7 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
stream_param.number_of_channel = stream->channels;
stream_param.sampling_freq = chip->mgr->sample_rate;
- if(stream_param.sampling_freq == 0)
+ if (stream_param.sampling_freq == 0)
stream_param.sampling_freq = 44100; /* if frequency not yet defined, use some default */
switch(format){
@@ -564,7 +564,7 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
request.size = sizeof(stream_param);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
- if((err < 0) || resp.error_code) {
+ if ((err < 0) || resp.error_code) {
snd_printk(KERN_ERR "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n", err, resp.error_code);
return -EINVAL;
}
@@ -594,9 +594,9 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
mutex_lock(&mgr->setup_mutex);
/* update the stream levels */
- if( stream->pcm_number <= MIXART_PCM_DIGITAL ) {
+ if (stream->pcm_number <= MIXART_PCM_DIGITAL) {
int is_aes = stream->pcm_number > MIXART_PCM_ANALOG;
- if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK )
+ if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK)
mixart_update_playback_stream_level(chip, is_aes, subs->number);
else
mixart_update_capture_stream_level( chip, is_aes);
@@ -606,7 +606,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
/* set the format to the board */
err = mixart_set_format(stream, format);
- if(err < 0) {
+ if (err < 0) {
return err;
}
@@ -616,10 +616,10 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
if (err > 0) {
struct mixart_bufferinfo *bufferinfo;
int i = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (stream->pcm_number * (MIXART_PLAYBACK_STREAMS+MIXART_CAPTURE_STREAMS)) + subs->number;
- if( subs->stream == SNDRV_PCM_STREAM_CAPTURE ) {
+ if (subs->stream == SNDRV_PCM_STREAM_CAPTURE) {
i += MIXART_PLAYBACK_STREAMS; /* in array capture is behind playback */
}
-
+
bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area;
bufferinfo[i].buffer_address = subs->runtime->dma_addr;
bufferinfo[i].available_length = subs->runtime->dma_bytes;
@@ -704,7 +704,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
mutex_lock(&mgr->setup_mutex);
- if ( pcm == chip->pcm ) {
+ if (pcm == chip->pcm) {
pcm_number = MIXART_PCM_ANALOG;
runtime->hw = snd_mixart_analog_caps;
} else {
@@ -734,7 +734,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
/* start the pipe if necessary */
err = mixart_set_pipe_state(chip->mgr, pipe, 1);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error starting pipe!\n");
snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
err = -EINVAL;
@@ -753,13 +753,13 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
/* if a sample rate is already used, another stream cannot change */
- if(mgr->ref_count_rate++) {
- if(mgr->sample_rate) {
+ if (mgr->ref_count_rate++) {
+ if (mgr->sample_rate) {
runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate;
}
}
- _exit_open:
+_exit_open:
mutex_unlock(&mgr->setup_mutex);
return err;
@@ -779,7 +779,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
mutex_lock(&mgr->setup_mutex);
- if ( pcm == chip->pcm ) {
+ if (pcm == chip->pcm) {
pcm_number = MIXART_PCM_ANALOG;
runtime->hw = snd_mixart_analog_caps;
} else {
@@ -812,7 +812,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
/* start the pipe if necessary */
err = mixart_set_pipe_state(chip->mgr, pipe, 1);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error starting pipe!\n");
snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
err = -EINVAL;
@@ -831,13 +831,13 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
/* if a sample rate is already used, another stream cannot change */
- if(mgr->ref_count_rate++) {
- if(mgr->sample_rate) {
+ if (mgr->ref_count_rate++) {
+ if (mgr->sample_rate) {
runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate;
}
}
- _exit_open:
+_exit_open:
mutex_unlock(&mgr->setup_mutex);
return err;
@@ -856,7 +856,7 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number);
/* sample rate released */
- if(--mgr->ref_count_rate == 0) {
+ if (--mgr->ref_count_rate == 0) {
mgr->sample_rate = 0;
}
@@ -1011,7 +1011,7 @@ static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *
};
mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (! chip) {
+ if (!chip) {
snd_printk(KERN_ERR "cannot allocate chip\n");
return -ENOMEM;
}
@@ -1038,7 +1038,7 @@ int snd_mixart_create_pcm(struct snd_mixart* chip)
if (err < 0)
return err;
- if(chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
+ if (chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
err = snd_mixart_pcm_digital(chip);
if (err < 0)
@@ -1068,7 +1068,7 @@ static int snd_mixart_free(struct mixart_mgr *mgr)
free_irq(mgr->irq, mgr);
/* reset board if some firmware was loaded */
- if(mgr->dsp_loaded) {
+ if (mgr->dsp_loaded) {
snd_mixart_reset_board(mgr);
snd_printdd("reset miXart !\n");
}
@@ -1081,12 +1081,12 @@ static int snd_mixart_free(struct mixart_mgr *mgr)
pci_release_regions(mgr->pci);
/* free flowarray */
- if(mgr->flowinfo.area) {
+ if (mgr->flowinfo.area) {
snd_dma_free_pages(&mgr->flowinfo);
mgr->flowinfo.area = NULL;
}
/* free bufferarray */
- if(mgr->bufferinfo.area) {
+ if (mgr->bufferinfo.area) {
snd_dma_free_pages(&mgr->bufferinfo);
mgr->bufferinfo.area = NULL;
}
@@ -1120,7 +1120,7 @@ static long long snd_mixart_BA0_llseek(struct snd_info_entry *entry,
default:
return -EINVAL;
}
- if(file->f_pos > MIXART_BA0_SIZE)
+ if (file->f_pos > MIXART_BA0_SIZE)
file->f_pos = MIXART_BA0_SIZE;
return file->f_pos;
}
@@ -1146,7 +1146,7 @@ static long long snd_mixart_BA1_llseek(struct snd_info_entry *entry,
default:
return -EINVAL;
}
- if(file->f_pos > MIXART_BA1_SIZE)
+ if (file->f_pos > MIXART_BA1_SIZE)
file->f_pos = MIXART_BA1_SIZE;
return file->f_pos;
}
@@ -1161,11 +1161,11 @@ static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private
struct mixart_mgr *mgr = entry->private_data;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
- if(count <= 0)
+ if (count <= 0)
return 0;
- if(pos + count > MIXART_BA0_SIZE)
+ if (pos + count > MIXART_BA0_SIZE)
count = (long)(MIXART_BA0_SIZE - pos);
- if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count))
+ if (copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count))
return -EFAULT;
return count;
}
@@ -1180,11 +1180,11 @@ static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private
struct mixart_mgr *mgr = entry->private_data;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
- if(count <= 0)
+ if (count <= 0)
return 0;
- if(pos + count > MIXART_BA1_SIZE)
+ if (pos + count > MIXART_BA1_SIZE)
count = (long)(MIXART_BA1_SIZE - pos);
- if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count))
+ if (copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count))
return -EFAULT;
return count;
}
@@ -1200,25 +1200,25 @@ static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = {
};
-static void snd_mixart_proc_read(struct snd_info_entry *entry,
+static void snd_mixart_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
- struct snd_mixart *chip = entry->private_data;
- u32 ref;
+ struct snd_mixart *chip = entry->private_data;
+ u32 ref;
snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx);
/* stats available when embedded OS is running */
if (chip->mgr->dsp_loaded & ( 1 << MIXART_MOTHERBOARD_ELF_INDEX)) {
snd_iprintf(buffer, "- hardware -\n");
- switch (chip->mgr->board_type ) {
+ switch (chip->mgr->board_type) {
case MIXART_DAUGHTER_TYPE_NONE : snd_iprintf(buffer, "\tmiXart8 (no daughter board)\n\n"); break;
case MIXART_DAUGHTER_TYPE_AES : snd_iprintf(buffer, "\tmiXart8 AES/EBU\n\n"); break;
case MIXART_DAUGHTER_TYPE_COBRANET : snd_iprintf(buffer, "\tmiXart8 Cobranet\n\n"); break;
default: snd_iprintf(buffer, "\tUNKNOWN!\n\n"); break;
}
- snd_iprintf(buffer, "- system load -\n");
+ snd_iprintf(buffer, "- system load -\n");
/* get perf reference */
@@ -1241,18 +1241,18 @@ static void __devinit snd_mixart_proc_init(struct snd_mixart *chip)
struct snd_info_entry *entry;
/* text interface to read perf and temp meters */
- if (! snd_card_proc_new(chip->card, "board_info", &entry)) {
+ if (!snd_card_proc_new(chip->card, "board_info", &entry)) {
entry->private_data = chip;
entry->c.text.read = snd_mixart_proc_read;
}
- if (! snd_card_proc_new(chip->card, "mixart_BA0", &entry)) {
+ if (!snd_card_proc_new(chip->card, "mixart_BA0", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
- entry->private_data = chip->mgr;
+ entry->private_data = chip->mgr;
entry->c.ops = &snd_mixart_proc_ops_BA0;
entry->size = MIXART_BA0_SIZE;
}
- if (! snd_card_proc_new(chip->card, "mixart_BA1", &entry)) {
+ if (!snd_card_proc_new(chip->card, "mixart_BA1", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip->mgr;
entry->c.ops = &snd_mixart_proc_ops_BA1;
@@ -1278,7 +1278,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
*/
if (dev >= SNDRV_CARDS)
return -ENODEV;
- if (! enable[dev]) {
+ if (!enable[dev]) {
dev++;
return -ENOENT;
}
@@ -1298,7 +1298,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
/*
*/
mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
- if (! mgr) {
+ if (!mgr) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -1367,7 +1367,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i);
card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
- if (! card) {
+ if (!card) {
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
snd_mixart_free(mgr);
return -ENOMEM;
@@ -1382,7 +1382,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
return err;
}
- if(i==0) {
+ if (i==0) {
/* init proc interface only for chip0 */
snd_mixart_proc_init(mgr->chip[i]);
}
@@ -1398,7 +1398,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
/* create array of streaminfo */
size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
- sizeof(struct mixart_flowinfo)) );
+ sizeof(struct mixart_flowinfo)));
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &mgr->flowinfo) < 0) {
snd_mixart_free(mgr);
@@ -1409,7 +1409,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
/* create array of bufferinfo */
size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
- sizeof(struct mixart_bufferinfo)) );
+ sizeof(struct mixart_bufferinfo)));
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &mgr->bufferinfo) < 0) {
snd_mixart_free(mgr);
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c
index b9a06c2..26b5f46 100644
--- a/sound/pci/mixart/mixart_core.c
+++ b/sound/pci/mixart/mixart_core.c
@@ -23,7 +23,7 @@
#include <linux/interrupt.h>
#include <linux/mutex.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include "mixart.h"
#include "mixart_hwdep.h"
@@ -65,7 +65,7 @@ static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
/* increment the tail index */
tailptr += 4;
- if( tailptr >= (MSG_OUTBOUND_POST_STACK+MSG_BOUND_STACK_SIZE) )
+ if (tailptr >= (MSG_OUTBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))
tailptr = MSG_OUTBOUND_POST_STACK;
writel_be(tailptr, MIXART_MEM(mgr, MSG_OUTBOUND_POST_TAIL));
@@ -73,7 +73,7 @@ static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
}
static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
- u32 msg_frame_address )
+ u32 msg_frame_address)
{
unsigned long flags;
u32 headptr;
@@ -92,7 +92,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
resp->uid.object_id = readl_be(MIXART_MEM(mgr, msg_frame_address + 8)); /* uidDest */
resp->uid.desc = readl_be(MIXART_MEM(mgr, msg_frame_address + 12)); /* */
- if( (size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) {
+ if ((size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) {
err = -EINVAL;
snd_printk(KERN_ERR "problem with response size = %d\n", size);
goto _clean_exit;
@@ -105,7 +105,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
/* swap if necessary */
#ifndef __BIG_ENDIAN
size /= 4; /* u32 size */
- for(i=0; i < size; i++) {
+ for (i = 0; i < size; i++) {
((u32*)resp->data)[i] = be32_to_cpu(((u32*)resp->data)[i]);
}
#endif
@@ -115,7 +115,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
*/
headptr = readl_be(MIXART_MEM(mgr, MSG_OUTBOUND_FREE_HEAD));
- if( (headptr < MSG_OUTBOUND_FREE_STACK) || ( headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
+ if ((headptr < MSG_OUTBOUND_FREE_STACK) || ( headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
err = -EINVAL;
goto _clean_exit;
}
@@ -125,12 +125,12 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
/* increment the outbound free head */
headptr += 4;
- if( headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE) )
+ if (headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))
headptr = MSG_OUTBOUND_FREE_STACK;
writel_be(headptr, MIXART_MEM(mgr, MSG_OUTBOUND_FREE_HEAD));
- _clean_exit:
+_clean_exit:
spin_unlock_irqrestore(&mgr->msg_lock, flags);
return err;
@@ -141,7 +141,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
* send a message to miXart. return: the msg_frame used for this message
*/
/* call with mgr->msg_lock held! */
-static int send_msg( struct mixart_mgr *mgr,
+static int send_msg(struct mixart_mgr *mgr,
struct mixart_msg *msg,
int max_answersize,
int mark_pending,
@@ -165,7 +165,7 @@ static int send_msg( struct mixart_mgr *mgr,
return -EBUSY;
}
- if( (tailptr < MSG_INBOUND_FREE_STACK) || (tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
+ if ((tailptr < MSG_INBOUND_FREE_STACK) || (tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
return -EINVAL;
}
@@ -174,7 +174,7 @@ static int send_msg( struct mixart_mgr *mgr,
/* increment the inbound free tail */
tailptr += 4;
- if( tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE) )
+ if (tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))
tailptr = MSG_INBOUND_FREE_STACK;
writel_be(tailptr, MIXART_MEM(mgr, MSG_INBOUND_FREE_TAIL));
@@ -182,24 +182,24 @@ static int send_msg( struct mixart_mgr *mgr,
/* TODO : use memcpy_toio() with intermediate buffer to copy the message */
/* copy message descriptor to card memory */
- writel_be( msg->size + MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address) ); /* size of descriptor + request */
- writel_be( msg->message_id , MIXART_MEM(mgr, msg_frame_address + 4) ); /* dwMessageID */
- writel_be( msg->uid.object_id, MIXART_MEM(mgr, msg_frame_address + 8) ); /* uidDest */
- writel_be( msg->uid.desc, MIXART_MEM(mgr, msg_frame_address + 12) ); /* */
- writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 16) ); /* SizeHeader */
- writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 20) ); /* OffsetDLL_T16 */
- writel_be( msg->size, MIXART_MEM(mgr, msg_frame_address + 24) ); /* SizeDLL_T16 */
- writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 28) ); /* OffsetDLL_DRV */
- writel_be( 0, MIXART_MEM(mgr, msg_frame_address + 32) ); /* SizeDLL_DRV */
- writel_be( MSG_DESCRIPTOR_SIZE + max_answersize, MIXART_MEM(mgr, msg_frame_address + 36) ); /* dwExpectedAnswerSize */
+ writel_be( msg->size + MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address)); /* size of descriptor + request */
+ writel_be( msg->message_id , MIXART_MEM(mgr, msg_frame_address + 4)); /* dwMessageID */
+ writel_be( msg->uid.object_id, MIXART_MEM(mgr, msg_frame_address + 8)); /* uidDest */
+ writel_be( msg->uid.desc, MIXART_MEM(mgr, msg_frame_address + 12)); /* */
+ writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 16)); /* SizeHeader */
+ writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 20)); /* OffsetDLL_T16 */
+ writel_be( msg->size, MIXART_MEM(mgr, msg_frame_address + 24)); /* SizeDLL_T16 */
+ writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 28)); /* OffsetDLL_DRV */
+ writel_be( 0, MIXART_MEM(mgr, msg_frame_address + 32)); /* SizeDLL_DRV */
+ writel_be( MSG_DESCRIPTOR_SIZE + max_answersize, MIXART_MEM(mgr, msg_frame_address + 36)); /* dwExpectedAnswerSize */
/* copy message data to card memory */
- for( i=0; i < msg->size; i+=4 ) {
- writel_be( *(u32*)(msg->data + i), MIXART_MEM(mgr, MSG_HEADER_SIZE + msg_frame_address + i) );
+ for (i = 0; i < msg->size; i += 4) {
+ writel_be( *(u32*)(msg->data + i), MIXART_MEM(mgr, MSG_HEADER_SIZE + msg_frame_address + i) );
}
- if( mark_pending ) {
- if( *msg_event ) {
+ if (mark_pending) {
+ if (*msg_event) {
/* the pending event is the notification we wait for ! */
mgr->pending_event = *msg_event;
}
@@ -218,7 +218,7 @@ static int send_msg( struct mixart_mgr *mgr,
/* post the frame */
headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_POST_HEAD));
- if( (headptr < MSG_INBOUND_POST_STACK) || (headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))) {
+ if ((headptr < MSG_INBOUND_POST_STACK) || (headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))) {
return -EINVAL;
}
@@ -226,7 +226,7 @@ static int send_msg( struct mixart_mgr *mgr,
/* increment the inbound post head */
headptr += 4;
- if( headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE) )
+ if (headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))
headptr = MSG_INBOUND_POST_STACK;
writel_be(headptr, MIXART_MEM(mgr, MSG_INBOUND_POST_HEAD));
@@ -262,7 +262,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int
timeout = schedule_timeout(MSG_TIMEOUT_JIFFIES);
remove_wait_queue(&mgr->msg_sleep, &wait);
- if (! timeout) {
+ if (!timeout) {
/* error - no ack */
mutex_unlock(&mgr->msg_mutex);
snd_printk(KERN_ERR "error: no reponse on msg %x\n", msg_frame);
@@ -277,7 +277,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int
err = get_msg(mgr, &resp, msg_frame);
- if( request->message_id != resp.message_id )
+ if (request->message_id != resp.message_id)
snd_printk(KERN_ERR "REPONSE ERROR!\n");
mutex_unlock(&mgr->msg_mutex);
@@ -306,7 +306,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
spin_lock_irq(&mgr->msg_lock);
/* send the message */
err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 1, ¬if_event); /* send and mark the notification event pending */
- if(err) {
+ if (err) {
spin_unlock_irq(&mgr->msg_lock);
mutex_unlock(&mgr->msg_mutex);
return err;
@@ -318,7 +318,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
timeout = schedule_timeout(MSG_TIMEOUT_JIFFIES);
remove_wait_queue(&mgr->msg_sleep, &wait);
- if (! timeout) {
+ if (!timeout) {
/* error - no ack */
mutex_unlock(&mgr->msg_mutex);
snd_printk(KERN_ERR "error: notification %x not received\n", notif_event);
@@ -354,7 +354,7 @@ static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4];
void snd_mixart_msg_tasklet(unsigned long arg)
{
- struct mixart_mgr *mgr = ( struct mixart_mgr*)(arg);
+ struct mixart_mgr *mgr = (struct mixart_mgr*)(arg);
struct mixart_msg resp;
u32 msg, addr, type;
int err;
@@ -377,7 +377,7 @@ void snd_mixart_msg_tasklet(unsigned long arg)
resp.data = mixart_msg_data;
resp.size = sizeof(mixart_msg_data);
err = get_msg(mgr, &resp, addr);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "tasklet: error(%d) reading mf %x\n", err, msg);
break;
}
@@ -387,7 +387,7 @@ void snd_mixart_msg_tasklet(unsigned long arg)
case MSG_STREAM_START_OUTPUT_STAGE_PACKET:
case MSG_STREAM_STOP_INPUT_STAGE_PACKET:
case MSG_STREAM_STOP_OUTPUT_STAGE_PACKET:
- if(mixart_msg_data[0])
+ if (mixart_msg_data[0])
snd_printk(KERN_ERR "tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n", mixart_msg_data[0]);
break;
default:
@@ -425,7 +425,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
spin_lock(&mgr->lock);
it_reg = readl_le(MIXART_REG(mgr, MIXART_PCI_OMISR_OFFSET));
- if( !(it_reg & MIXART_OIDI) ) {
+ if (!(it_reg & MIXART_OIDI)) {
/* this device did not cause the interrupt */
spin_unlock(&mgr->lock);
return IRQ_NONE;
@@ -439,7 +439,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
writel(it_reg, MIXART_REG(mgr, MIXART_PCI_ODBR_OFFSET));
/* clear interrupt */
- writel_le( MIXART_OIDI, MIXART_REG(mgr, MIXART_PCI_OMISR_OFFSET) );
+ writel_le( MIXART_OIDI, MIXART_REG(mgr, MIXART_PCI_OMISR_OFFSET));
/* process interrupt */
while (retrieve_msg_frame(mgr, &msg)) {
@@ -450,17 +450,17 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
resp.data = mixart_msg_data;
resp.size = sizeof(mixart_msg_data);
err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "interrupt: error(%d) reading mf %x\n", err, msg);
break;
}
- if(resp.message_id == MSG_SERVICES_TIMER_NOTIFY) {
+ if (resp.message_id == MSG_SERVICES_TIMER_NOTIFY) {
int i;
struct mixart_timer_notify *notify;
notify = (struct mixart_timer_notify *)mixart_msg_data;
- for(i=0; i<notify->stream_count; i++) {
+ for (i = 0; i < notify->stream_count; i++) {
u32 buffer_id = notify->streams[i].buffer_id;
unsigned int chip_number = (buffer_id & MIXART_NOTIFY_CARD_MASK) >> MIXART_NOTIFY_CARD_OFFSET; /* card0 to 3 */
@@ -503,9 +503,9 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
stream->abs_period_elapsed = new_elapse_pos;
}
}
- stream->buf_period_frag = (u32)( sample_count - stream->abs_period_elapsed );
+ stream->buf_period_frag = (u32)(sample_count - stream->abs_period_elapsed);
- if(elapsed) {
+ if (elapsed) {
spin_unlock(&mgr->lock);
snd_pcm_period_elapsed(stream->substream);
spin_lock(&mgr->lock);
@@ -514,12 +514,12 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
}
break;
}
- if(resp.message_id == MSG_SERVICES_REPORT_TRACES) {
- if(resp.size > 1) {
+ if (resp.message_id == MSG_SERVICES_REPORT_TRACES) {
+ if (resp.size > 1) {
#ifndef __BIG_ENDIAN
/* Traces are text: the swapped msg_data has to be swapped back ! */
int i;
- for(i=0; i<(resp.size/4); i++) {
+ for (i = 0; i < (resp.size/4); i++) {
(mixart_msg_data)[i] = cpu_to_be32((mixart_msg_data)[i]);
}
#endif
@@ -533,7 +533,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
break;
case MSG_TYPE_NOTIFY:
- if(msg & MSG_CANCEL_NOTIFY_MASK) {
+ if (msg & MSG_CANCEL_NOTIFY_MASK) {
msg &= ~MSG_CANCEL_NOTIFY_MASK;
snd_printk(KERN_ERR "canceled notification %x !\n", msg);
}
@@ -541,7 +541,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
case MSG_TYPE_ANSWER:
/* answer or notification to a message we are waiting for*/
spin_lock(&mgr->msg_lock);
- if( (msg & ~MSG_TYPE_MASK) == mgr->pending_event ) {
+ if ((msg & ~MSG_TYPE_MASK) == mgr->pending_event) {
wake_up(&mgr->msg_sleep);
mgr->pending_event = 0;
}
@@ -573,11 +573,11 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
void snd_mixart_init_mailbox(struct mixart_mgr *mgr)
{
- writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ) );
- writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ) );
+ writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ));
+ writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ));
/* allow outbound messagebox to generate interrupts */
- if(mgr->irq >= 0) {
+ if (mgr->irq >= 0) {
writel_le( MIXART_ALLOW_OUTBOUND_DOORBELL, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET));
}
return;
@@ -593,6 +593,6 @@ void snd_mixart_exit_mailbox(struct mixart_mgr *mgr)
void snd_mixart_reset_board(struct mixart_mgr *mgr)
{
/* reset miXart */
- writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) );
+ writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET));
return;
}
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index 3782b52..18639aa 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -24,7 +24,7 @@
#include <linux/pci.h>
#include <linux/firmware.h>
#include <linux/vmalloc.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include "mixart.h"
#include "mixart_mixer.h"
@@ -53,20 +53,20 @@ static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr,
cond_resched();
read = readl_be( MIXART_MEM( mgr, offset ));
- if(is_egal) {
- if(read == value) return 0;
+ if (is_egal) {
+ if (read == value) return 0;
}
else { /* wait for different value */
- if(read != value) return 0;
+ if (read != value) return 0;
}
- } while ( time_after_eq(end_time, jiffies) );
+ } while ( time_after_eq(end_time, jiffies));
return -EBUSY;
}
/*
- structures needed to upload elf code packets
+ structures needed to upload elf code packets
*/
struct snd_mixart_elf32_ehdr {
u8 e_ident[16];
@@ -96,27 +96,27 @@ struct snd_mixart_elf32_phdr {
u32 p_align;
};
-static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp )
+static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp)
{
char elf32_magic_number[4] = {0x7f,'E','L','F'};
struct snd_mixart_elf32_ehdr *elf_header;
int i;
elf_header = (struct snd_mixart_elf32_ehdr *)dsp->data;
- for( i=0; i<4; i++ )
- if ( elf32_magic_number[i] != elf_header->e_ident[i] )
+ for (i = 0; i < 4; i++)
+ if (elf32_magic_number[i] != elf_header->e_ident[i])
return -EINVAL;
- if( elf_header->e_phoff != 0 ) {
+ if (elf_header->e_phoff != 0) {
struct snd_mixart_elf32_phdr elf_programheader;
- for( i=0; i < be16_to_cpu(elf_header->e_phnum); i++ ) {
+ for (i = 0; i < be16_to_cpu(elf_header->e_phnum); i++) {
u32 pos = be32_to_cpu(elf_header->e_phoff) + (u32)(i * be16_to_cpu(elf_header->e_phentsize));
- memcpy( &elf_programheader, dsp->data + pos, sizeof(elf_programheader) );
+ memcpy( &elf_programheader, dsp->data + pos, sizeof(elf_programheader));
- if(elf_programheader.p_type != 0) {
- if( elf_programheader.p_filesz != 0 ) {
+ if (elf_programheader.p_type != 0) {
+ if (elf_programheader.p_filesz != 0) {
memcpy_toio( MIXART_MEM( mgr, be32_to_cpu(elf_programheader.p_vaddr)),
dsp->data + be32_to_cpu( elf_programheader.p_offset ),
be32_to_cpu( elf_programheader.p_filesz ));
@@ -147,7 +147,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
connector = kmalloc(sizeof(*connector), GFP_KERNEL);
audio_info_req = kmalloc(sizeof(*audio_info_req), GFP_KERNEL);
audio_info = kmalloc(sizeof(*audio_info), GFP_KERNEL);
- if (! connector || ! audio_info_req || ! audio_info) {
+ if (!connector || !audio_info_req || !audio_info) {
err = -ENOMEM;
goto __error;
}
@@ -162,21 +162,21 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = 0;
err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector);
- if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
+ if ((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n");
err = -EINVAL;
goto __error;
}
- for(k=0; k < connector->uid_count; k++) {
+ for (k=0; k < connector->uid_count; k++) {
struct mixart_pipe *pipe;
- if(k < MIXART_FIRST_DIG_AUDIO_ID) {
+ if (k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_out_ana;
} else {
pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_out_dig;
}
- if(k & 1) {
+ if (k & 1) {
pipe->uid_right_connector = connector->uid[k]; /* odd */
} else {
pipe->uid_left_connector = connector->uid[k]; /* even */
@@ -191,7 +191,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = sizeof(*audio_info_req);
err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n");
goto __error;
}
@@ -204,21 +204,21 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = 0;
err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector);
- if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
+ if ((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n");
err = -EINVAL;
goto __error;
}
- for(k=0; k < connector->uid_count; k++) {
+ for (k=0; k < connector->uid_count; k++) {
struct mixart_pipe *pipe;
- if(k < MIXART_FIRST_DIG_AUDIO_ID) {
+ if (k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_in_ana;
} else {
pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_in_dig;
}
- if(k & 1) {
+ if (k & 1) {
pipe->uid_right_connector = connector->uid[k]; /* odd */
} else {
pipe->uid_left_connector = connector->uid[k]; /* even */
@@ -233,7 +233,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = sizeof(*audio_info_req);
err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n");
goto __error;
}
@@ -241,7 +241,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
}
err = 0;
- __error:
+__error:
kfree(connector);
kfree(audio_info_req);
kfree(audio_info);
@@ -269,7 +269,7 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr);
- if( (err < 0) || (console_mgr.error_code != 0) ) {
+ if ((err < 0) || (console_mgr.error_code != 0)) {
snd_printk(KERN_DEBUG "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", console_mgr.error_code);
return -EINVAL;
}
@@ -283,8 +283,8 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
request.size = sizeof(console_mgr.uid);
err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io);
- if( (err < 0) || ( phys_io.error_code != 0 ) ) {
- snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code );
+ if ((err < 0) || ( phys_io.error_code != 0 )) {
+ snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code);
return -EINVAL;
}
@@ -292,9 +292,9 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
if (phys_io.nb_uid < MIXART_MAX_CARDS * 2)
return -EINVAL;
- for(k=0; k<mgr->num_cards; k++) {
+ for (k=0; k<mgr->num_cards; k++) {
mgr->chip[k]->uid_in_analog_physio = phys_io.uid[k];
- mgr->chip[k]->uid_out_analog_physio = phys_io.uid[phys_io.nb_uid/2 + k];
+ mgr->chip[k]->uid_out_analog_physio = phys_io.uid[phys_io.nb_uid/2 + k];
}
return 0;
@@ -307,9 +307,9 @@ static int mixart_first_init(struct mixart_mgr *mgr)
int err;
struct mixart_msg request;
- if((err = mixart_enum_connectors(mgr)) < 0) return err;
+ if ((err = mixart_enum_connectors(mgr)) < 0) return err;
- if((err = mixart_enum_physio(mgr)) < 0) return err;
+ if ((err = mixart_enum_physio(mgr)) < 0) return err;
/* send a synchro command to card (necessary to do this before first MSG_STREAM_START_STREAM_GRP_PACKET) */
/* though why not here */
@@ -319,7 +319,7 @@ static int mixart_first_init(struct mixart_mgr *mgr)
request.size = 0;
/* this command has no data. response is a 32 bit status */
err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k);
- if( (err < 0) || (k != 0) ) {
+ if ((err < 0) || (k != 0)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n");
return err == 0 ? -EINVAL : err;
}
@@ -345,22 +345,22 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET ));
/* motherboard xilinx status 5 will say that the board is performing a reset */
- if( status_xilinx == 5 ) {
- snd_printk( KERN_ERR "miXart is resetting !\n");
+ if (status_xilinx == 5) {
+ snd_printk(KERN_ERR "miXart is resetting !\n");
return -EAGAIN; /* try again later */
}
switch (index) {
case MIXART_MOTHERBOARD_XLX_INDEX:
- /* xilinx already loaded ? */
- if( status_xilinx == 4 ) {
- snd_printk( KERN_DEBUG "xilinx is already loaded !\n");
+ /* xilinx already loaded ? */
+ if (status_xilinx == 4) {
+ snd_printk(KERN_DEBUG "xilinx is already loaded !\n");
return 0;
}
/* the status should be 0 == "idle" */
- if( status_xilinx != 0 ) {
- snd_printk( KERN_ERR "xilinx load error ! status = %d\n", status_xilinx);
+ if (status_xilinx != 0) {
+ snd_printk(KERN_ERR "xilinx load error ! status = %d\n", status_xilinx);
return -EIO; /* modprob -r may help ? */
}
@@ -380,7 +380,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* copy xilinx code */
memcpy_toio( MIXART_MEM( mgr, MIXART_MOTHERBOARD_XLX_BASE_ADDRESS), dsp->data, dsp->size);
-
+
/* set xilinx status to copy finished */
writel_be( 2, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET ));
@@ -389,33 +389,33 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
case MIXART_MOTHERBOARD_ELF_INDEX:
- if( status_elf == 4 ) {
- snd_printk( KERN_DEBUG "elf file already loaded !\n");
+ if (status_elf == 4) {
+ snd_printk(KERN_DEBUG "elf file already loaded !\n");
return 0;
}
/* the status should be 0 == "idle" */
- if( status_elf != 0 ) {
- snd_printk( KERN_ERR "elf load error ! status = %d\n", status_elf);
+ if (status_elf != 0) {
+ snd_printk(KERN_ERR "elf load error ! status = %d\n", status_elf);
return -EIO; /* modprob -r may help ? */
}
/* wait for xilinx status == 4 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */
if (err < 0) {
- snd_printk( KERN_ERR "xilinx was not loaded or could not be started\n");
+ snd_printk(KERN_ERR "xilinx was not loaded or could not be started\n");
return err;
}
/* init some data on the card */
- writel_be( 0, MIXART_MEM( mgr, MIXART_PSEUDOREG_BOARDNUMBER ) ); /* set miXart boardnumber to 0 */
- writel_be( 0, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* reset pointer to flow table on miXart */
+ writel_be( 0, MIXART_MEM( mgr, MIXART_PSEUDOREG_BOARDNUMBER )); /* set miXart boardnumber to 0 */
+ writel_be( 0, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR )); /* reset pointer to flow table on miXart */
/* set elf status to copying */
writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET ));
/* process the copying of the elf packets */
- err = mixart_load_elf( mgr, dsp );
+ err = mixart_load_elf( mgr, dsp);
if (err < 0) return err;
/* set elf status to copy finished */
@@ -424,12 +424,12 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for elf status == 4 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */
if (err < 0) {
- snd_printk( KERN_ERR "elf could not be started\n");
+ snd_printk(KERN_ERR "elf could not be started\n");
return err;
}
/* miXart waits at this point on the pointer to the flow table */
- writel_be( (u32)mgr->flowinfo.addr, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* give pointer of flow table to miXart */
+ writel_be( (u32)mgr->flowinfo.addr, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR )); /* give pointer of flow table to miXart */
return 0; /* return, another xilinx file has to be loaded before */
@@ -437,15 +437,15 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
default:
/* elf and xilinx should be loaded */
- if( (status_elf != 4) || (status_xilinx != 4) ) {
- printk( KERN_ERR "xilinx or elf not successfully loaded\n");
+ if ((status_elf != 4) || (status_xilinx != 4)) {
+ printk(KERN_ERR "xilinx or elf not successfully loaded\n");
return -EIO; /* modprob -r may help ? */
}
/* wait for daughter detection != 0 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */
if (err < 0) {
- snd_printk( KERN_ERR "error starting elf file\n");
+ snd_printk(KERN_ERR "error starting elf file\n");
return err;
}
@@ -455,16 +455,16 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
if (mgr->board_type == MIXART_DAUGHTER_TYPE_NONE)
break; /* no daughter board; the file does not have to be loaded, continue after the switch */
- /* only if aesebu daughter board presence (elf code must run) */
- if (mgr->board_type != MIXART_DAUGHTER_TYPE_AES )
+ /* only if aesebu daughter board presence (elf code must run) */
+ if (mgr->board_type != MIXART_DAUGHTER_TYPE_AES)
return -EINVAL;
/* daughter should be idle */
- if( status_daught != 0 ) {
- printk( KERN_ERR "daughter load error ! status = %d\n", status_daught);
+ if (status_daught != 0) {
+ printk(KERN_ERR "daughter load error ! status = %d\n", status_daught);
return -EIO; /* modprob -r may help ? */
}
-
+
/* check daughterboard xilinx validity */
if (((u32*)(dsp->data))[0] == 0xffffffff)
return -EINVAL;
@@ -480,7 +480,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for status == 2 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */
if (err < 0) {
- snd_printk( KERN_ERR "daughter board load error\n");
+ snd_printk(KERN_ERR "daughter board load error\n");
return err;
}
@@ -502,7 +502,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for daughter status == 3 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */
if (err < 0) {
- snd_printk( KERN_ERR "daughter board could not be initialised\n");
+ snd_printk(KERN_ERR "daughter board could not be initialised\n");
return err;
}
@@ -512,7 +512,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* first communication with embedded */
err = mixart_first_init(mgr);
if (err < 0) {
- snd_printk( KERN_ERR "miXart could not be set up\n");
+ snd_printk(KERN_ERR "miXart could not be set up\n");
return err;
}
@@ -615,7 +615,7 @@ static int mixart_hwdep_dsp_load(struct snd_hwdep *hw,
fw.size = dsp->length;
fw.data = vmalloc(dsp->length);
- if (! fw.data) {
+ if (!fw.data) {
snd_printk(KERN_ERR "miXart: cannot allocate image size %d\n",
(int)dsp->length);
return -ENOMEM;
diff --git a/sound/pci/mixart/mixart_hwdep.h b/sound/pci/mixart/mixart_hwdep.h
index a46f508..ce1f109 100644
--- a/sound/pci/mixart/mixart_hwdep.h
+++ b/sound/pci/mixart/mixart_hwdep.h
@@ -36,12 +36,12 @@
/* Daughter board Type */
-#define DAUGHTER_TYPE_MASK 0x0F
-#define DAUGHTER_VER_MASK 0xF0
+#define DAUGHTER_TYPE_MASK 0x0F
+#define DAUGHTER_VER_MASK 0xF0
#define DAUGHTER_TYPEVER_MASK (DAUGHTER_TYPE_MASK|DAUGHTER_VER_MASK)
-
-#define MIXART_DAUGHTER_TYPE_NONE 0x00
-#define MIXART_DAUGHTER_TYPE_COBRANET 0x08
+
+#define MIXART_DAUGHTER_TYPE_NONE 0x00
+#define MIXART_DAUGHTER_TYPE_COBRANET 0x08
#define MIXART_DAUGHTER_TYPE_AES 0x0E
@@ -63,28 +63,28 @@
#define MIXART_PSEUDOREG_PERF_INTERR_LOAD_OFFSET MIXART_PSEUDOREG+0x74 /* interrupt handling load */
/* motherboard xilinx loader info */
-#define MIXART_PSEUDOREG_MXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x9C /* 0x00600000 */
-#define MIXART_PSEUDOREG_MXLX_SIZE_OFFSET MIXART_PSEUDOREG+0xA0 /* xilinx size in bytes */
-#define MIXART_PSEUDOREG_MXLX_STATUS_OFFSET MIXART_PSEUDOREG+0xA4 /* status = EMBEBBED_STAT_XXX */
+#define MIXART_PSEUDOREG_MXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x9C /* 0x00600000 */
+#define MIXART_PSEUDOREG_MXLX_SIZE_OFFSET MIXART_PSEUDOREG+0xA0 /* xilinx size in bytes */
+#define MIXART_PSEUDOREG_MXLX_STATUS_OFFSET MIXART_PSEUDOREG+0xA4 /* status = EMBEBBED_STAT_XXX */
/* elf loader info */
-#define MIXART_PSEUDOREG_ELF_STATUS_OFFSET MIXART_PSEUDOREG+0xB0 /* status = EMBEBBED_STAT_XXX */
+#define MIXART_PSEUDOREG_ELF_STATUS_OFFSET MIXART_PSEUDOREG+0xB0 /* status = EMBEBBED_STAT_XXX */
-/*
+/*
* after the elf code is loaded, and the flowtable info was passed to it,
* the driver polls on this address, until it shows 1 (presence) or 2 (absence)
* once it is non-zero, the daughter board type may be read
*/
-#define MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET MIXART_PSEUDOREG+0x990
+#define MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET MIXART_PSEUDOREG+0x990
/* Global info structure */
#define MIXART_PSEUDOREG_DBRD_TYPE_OFFSET MIXART_PSEUDOREG+0x994 /* Type and version of daughterboard */
/* daughterboard xilinx loader info */
-#define MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x998 /* get the address here where to write the file */
-#define MIXART_PSEUDOREG_DXLX_SIZE_OFFSET MIXART_PSEUDOREG+0x99C /* xilinx size in bytes */
-#define MIXART_PSEUDOREG_DXLX_STATUS_OFFSET MIXART_PSEUDOREG+0x9A0 /* status = EMBEBBED_STAT_XXX */
+#define MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x998 /* get the address here where to write the file */
+#define MIXART_PSEUDOREG_DXLX_SIZE_OFFSET MIXART_PSEUDOREG+0x99C /* xilinx size in bytes */
+#define MIXART_PSEUDOREG_DXLX_STATUS_OFFSET MIXART_PSEUDOREG+0x9A0 /* status = EMBEBBED_STAT_XXX */
/* */
#define MIXART_FLOWTABLE_PTR 0x3000 /* pointer to flow table */
diff --git a/sound/pci/mixart/mixart_mixer.c b/sound/pci/mixart/mixart_mixer.c
index 3ba6174..388c257 100644
--- a/sound/pci/mixart/mixart_mixer.c
+++ b/sound/pci/mixart/mixart_mixer.c
@@ -310,25 +310,25 @@ static int mixart_update_analog_audio_level(struct snd_mixart* chip, int is_capt
memset(&io_level, 0, sizeof(io_level));
io_level.channel = -1; /* left and right */
- for(i=0; i<2; i++) {
- if(is_capture) {
+ for (i = 0; i < 2; i++) {
+ if (is_capture) {
io_level.level[i].analog_level = mixart_analog_level[chip->analog_capture_volume[i]];
} else {
- if(chip->analog_playback_active[i])
+ if (chip->analog_playback_active[i])
io_level.level[i].analog_level = mixart_analog_level[chip->analog_playback_volume[i]];
else
io_level.level[i].analog_level = mixart_analog_level[MIXART_ANALOG_PLAYBACK_LEVEL_MIN];
}
}
- if(is_capture) request.uid = chip->uid_in_analog_physio;
+ if (is_capture) request.uid = chip->uid_in_analog_physio;
else request.uid = chip->uid_out_analog_physio;
request.message_id = MSG_PHYSICALIO_SET_LEVEL;
request.data = &io_level;
request.size = sizeof(io_level);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
- if((err<0) || (resp.error_code)) {
+ if ((err<0) || (resp.error_code)) {
snd_printk(KERN_DEBUG "error MSG_PHYSICALIO_SET_LEVEL card(%d) is_capture(%d) error_code(%x)\n", chip->chip_idx, is_capture, resp.error_code);
return -EINVAL;
}
@@ -342,7 +342,7 @@ static int mixart_analog_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
- if(kcontrol->private_value == 0) { /* playback */
+ if (kcontrol->private_value == 0) { /* playback */
uinfo->value.integer.min = MIXART_ANALOG_PLAYBACK_LEVEL_MIN; /* -96 dB */
uinfo->value.integer.max = MIXART_ANALOG_PLAYBACK_LEVEL_MAX; /* 0 dB */
} else { /* capture */
@@ -356,7 +356,7 @@ static int mixart_analog_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e
{
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
- if(kcontrol->private_value == 0) { /* playback */
+ if (kcontrol->private_value == 0) { /* playback */
ucontrol->value.integer.value[0] = chip->analog_playback_volume[0];
ucontrol->value.integer.value[1] = chip->analog_playback_volume[1];
} else { /* capture */
@@ -731,7 +731,7 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
set_level.nb_of_stream = 1;
set_level.stream_level.desc.stream_idx = idx;
- if(is_aes) {
+ if (is_aes) {
pipe = &chip->pipe_out_dig; /* AES playback */
idx += MIXART_PLAYBACK_STREAMS;
} else {
@@ -739,13 +739,13 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
}
/* only when pipe exists ! */
- if(pipe->status == PIPE_UNDEFINED)
+ if (pipe->status == PIPE_UNDEFINED)
return 0;
set_level.stream_level.desc.uid_pipe = pipe->group_uid;
- for(i=0; i<2; i++) {
- if(chip->digital_playback_active[idx][i])
+ for (i = 0; i < 2; i++) {
+ if (chip->digital_playback_active[idx][i])
volume[i] = chip->digital_playback_volume[idx][i];
else
volume[i] = MIXART_DIGITAL_LEVEL_MIN;
@@ -761,7 +761,7 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
request.size = sizeof(set_level);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status);
- if((err<0) || status) {
+ if ((err<0) || status) {
snd_printk(KERN_DEBUG "error MSG_STREAM_SET_OUT_STREAM_LEVEL card(%d) status(%x)\n", chip->chip_idx, status);
return -EINVAL;
}
@@ -776,7 +776,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
struct mixart_set_in_audio_level_req set_level;
u32 status;
- if(is_aes) {
+ if (is_aes) {
idx = 1;
pipe = &chip->pipe_in_dig;
} else {
@@ -785,7 +785,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
}
/* only when pipe exists ! */
- if(pipe->status == PIPE_UNDEFINED)
+ if (pipe->status == PIPE_UNDEFINED)
return 0;
memset(&set_level, 0, sizeof(set_level));
@@ -793,7 +793,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
set_level.level[0].connector = pipe->uid_left_connector;
set_level.level[1].connector = pipe->uid_right_connector;
- for(i=0; i<2; i++) {
+ for (i = 0; i < 2; i++) {
set_level.level[i].valid_mask1 = MIXART_AUDIO_LEVEL_DIGITAL_MASK;
set_level.level[i].digital_level = mixart_digital_level[chip->digital_capture_volume[idx][i]];
}
@@ -804,7 +804,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
request.size = sizeof(set_level);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status);
- if((err<0) || status) {
+ if ((err<0) || status) {
snd_printk(KERN_DEBUG "error MSG_STREAM_SET_IN_AUDIO_LEVEL card(%d) status(%x)\n", chip->chip_idx, status);
return -EINVAL;
}
@@ -833,12 +833,12 @@ static int mixart_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK;
int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK;
mutex_lock(&chip->mgr->mixer_mutex);
- if(is_capture) {
- if(is_aes) stored_volume = chip->digital_capture_volume[1]; /* AES capture */
+ if (is_capture) {
+ if (is_aes) stored_volume = chip->digital_capture_volume[1]; /* AES capture */
else stored_volume = chip->digital_capture_volume[0]; /* analog capture */
} else {
snd_BUG_ON(idx >= MIXART_PLAYBACK_STREAMS);
- if(is_aes) stored_volume = chip->digital_playback_volume[MIXART_PLAYBACK_STREAMS + idx]; /* AES playback */
+ if (is_aes) stored_volume = chip->digital_playback_volume[MIXART_PLAYBACK_STREAMS + idx]; /* AES playback */
else stored_volume = chip->digital_playback_volume[idx]; /* analog playback */
}
ucontrol->value.integer.value[0] = stored_volume[0];
@@ -911,7 +911,7 @@ static int mixart_pcm_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
snd_BUG_ON(idx >= MIXART_PLAYBACK_STREAMS);
mutex_lock(&chip->mgr->mixer_mutex);
- if(kcontrol->private_value & MIXART_VOL_AES_MASK) /* AES playback */
+ if (kcontrol->private_value & MIXART_VOL_AES_MASK) /* AES playback */
idx += MIXART_PLAYBACK_STREAMS;
ucontrol->value.integer.value[0] = chip->digital_playback_active[idx][0];
ucontrol->value.integer.value[1] = chip->digital_playback_active[idx][1];
@@ -961,10 +961,10 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
struct mixart_set_out_audio_level audio_level;
u32 resp;
- if(chip->pipe_out_ana.status == PIPE_UNDEFINED)
+ if (chip->pipe_out_ana.status == PIPE_UNDEFINED)
return -EINVAL; /* no pipe defined */
- if(!channel) request.uid = chip->pipe_out_ana.uid_left_connector;
+ if (!channel) request.uid = chip->pipe_out_ana.uid_left_connector;
else request.uid = chip->pipe_out_ana.uid_right_connector;
request.message_id = MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL;
request.data = &audio_level;
@@ -976,7 +976,7 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
audio_level.monitor_mute1 = !chip->monitoring_active[channel!=0];
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
- if((err<0) || resp) {
+ if ((err<0) || resp) {
snd_printk(KERN_DEBUG "error MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL card(%d) resp(%x)\n", chip->chip_idx, resp);
return -EINVAL;
}
@@ -1097,7 +1097,7 @@ static void mixart_reset_audio_levels(struct snd_mixart *chip)
/* analog volumes can be set even if there is no pipe */
mixart_update_analog_audio_level(chip, 0);
/* analog levels for capture only on the first two chips */
- if(chip->chip_idx < 2) {
+ if (chip->chip_idx < 2) {
mixart_update_analog_audio_level(chip, 1);
}
return;
@@ -1111,7 +1111,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
mutex_init(&mgr->mixer_mutex); /* can be in another place */
- for(i=0; i<mgr->num_cards; i++) {
+ for (i = 0; i < mgr->num_cards; i++) {
struct snd_kcontrol_new temp;
chip = mgr->chip[i];
@@ -1126,7 +1126,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
return err;
/* analog input level control only on first two chips !*/
- if(i<2) {
+ if (i<2) {
temp = mixart_control_analog_level;
temp.name = "Master Capture Volume";
temp.private_value = 1; /* capture */
@@ -1147,7 +1147,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&temp, chip))) < 0)
return err;
- if(mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
+ if (mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
temp.name = "AES Playback Volume";
temp.count = MIXART_PLAYBACK_STREAMS;
temp.private_value = MIXART_VOL_AES_MASK; /* playback AES/EBU */
@@ -1166,7 +1166,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&temp, chip))) < 0)
return err;
- if(mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
+ if (mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
temp.name = "AES Playback Switch";
temp.private_value = MIXART_VOL_AES_MASK; /* playback AES/EBU */
if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&temp, chip))) < 0)
1
0

[alsa-devel] [PATCH 14/24] sound/pci: coding style fixes: maestro3
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/maestro3.c | 130 +++++++++++++++++++++++++-------------------------
1 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 9ff3f9e..0aae83b 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -27,11 +27,11 @@
* - Added Canyon3D-2 support by Rob Riggs <rob(a)pangalactic.org>
*
*/
-
+
#define CARD_NAME "ESS Maestro3/Allegro/Canyon3D-2"
#define DRIVER_NAME "Maestro3"
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -569,7 +569,7 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
#define KDATA_ADC2_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x0045)
#define KDATA_ADC2_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x0046)
-#define KDATA_CD_XFER0 (KDATA_BASE_ADDR + 0x0047)
+#define KDATA_CD_XFER0 (KDATA_BASE_ADDR + 0x0047)
#define KDATA_CD_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0048)
#define KDATA_CD_LEFT_VOLUME (KDATA_BASE_ADDR + 0x0049)
#define KDATA_CD_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x004A)
@@ -727,9 +727,9 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
#define SRC3_TEMP_INBUF_ADDR_OFFSET (CDATA_HEADER_LEN + 16)
#define SRC3_TEMP_OUTBUF_ADDR_OFFSET (CDATA_HEADER_LEN + 17)
-#define MINISRC_IN_BUFFER_SIZE ( 0x50 * 2 )
+#define MINISRC_IN_BUFFER_SIZE ( 0x50 * 2)
#define MINISRC_OUT_BUFFER_SIZE ( 0x50 * 2 * 2)
-#define MINISRC_TMP_BUFFER_SIZE ( 112 + ( MINISRC_BIQUAD_STAGE * 3 + 4 ) * 2 * 2 )
+#define MINISRC_TMP_BUFFER_SIZE ( 112 + ( MINISRC_BIQUAD_STAGE * 3 + 4 ) * 2 * 2)
#define MINISRC_BIQUAD_STAGE 2
#define MINISRC_COEF_LOC 0x175
@@ -762,10 +762,10 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
/*
* an arbitrary volume we set the internal
* volume settings to so that the ac97 volume
- * range is a little less insane. 0x7fff is
+ * range is a little less insane. 0x7fff is
* max.
*/
-#define ARB_VOLUME ( 0x6800 )
+#define ARB_VOLUME ( 0x6800)
/*
*/
@@ -798,13 +798,13 @@ struct m3_dma {
struct m3_list *index_list[3];
int in_lists;
-
+
struct list_head list;
};
-
+
struct snd_m3 {
-
+
struct snd_card *card;
unsigned long iobase;
@@ -1077,7 +1077,7 @@ static void snd_m3_remove_list(struct snd_m3 *chip, struct m3_list *list, int in
static void snd_m3_inc_timer_users(struct snd_m3 *chip)
{
chip->timer_users++;
- if (chip->timer_users != 1)
+ if (chip->timer_users != 1)
return;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1096,7 +1096,7 @@ static void snd_m3_inc_timer_users(struct snd_m3 *chip)
static void snd_m3_dec_timer_users(struct snd_m3 *chip)
{
chip->timer_users--;
- if (chip->timer_users > 0)
+ if (chip->timer_users > 0)
return;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1120,7 +1120,7 @@ static void snd_m3_dec_timer_users(struct snd_m3 *chip)
static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_substream *subs)
{
- if (! s || ! subs)
+ if (!s || !subs)
return -EINVAL;
snd_m3_inc_timer_users(chip);
@@ -1147,7 +1147,7 @@ static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,
static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_substream *subs)
{
- if (! s || ! subs)
+ if (!s || !subs)
return -EINVAL;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1157,7 +1157,7 @@ static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s,
case SNDRV_PCM_STREAM_PLAYBACK:
chip->dacs_active--;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
- KDATA_MIXER_TASK_NUMBER,
+ KDATA_MIXER_TASK_NUMBER,
chip->dacs_active);
break;
case SNDRV_PCM_STREAM_CAPTURE:
@@ -1191,7 +1191,7 @@ snd_m3_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (! s->running)
+ if (!s->running)
err = 0; /* should return error? */
else {
s->running = 0;
@@ -1206,7 +1206,7 @@ snd_m3_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
/*
* setup
*/
-static void
+static void
snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs)
{
int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer;
@@ -1270,7 +1270,7 @@ snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substrea
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_IN_BUF_HEAD,
dsp_in_buffer);
-
+
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_IN_BUF_TAIL,
dsp_in_buffer);
@@ -1297,10 +1297,10 @@ static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s,
{
u32 freq;
- /*
+ /*
* put us in the lists if we're not already there
*/
- if (! s->in_lists) {
+ if (!s->in_lists) {
s->index[0] = snd_m3_add_list(chip, s->index_list[0],
s->inst.data >> DP_SHIFT_COUNT);
s->index[1] = snd_m3_add_list(chip, s->index_list[1],
@@ -1312,16 +1312,16 @@ static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s,
/* write to 'mono' word */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
- s->inst.data + SRC3_DIRECTION_OFFSET + 1,
+ s->inst.data + SRC3_DIRECTION_OFFSET + 1,
runtime->channels == 2 ? 0 : 1);
/* write to '8bit' word */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
- s->inst.data + SRC3_DIRECTION_OFFSET + 2,
+ s->inst.data + SRC3_DIRECTION_OFFSET + 2,
snd_pcm_format_width(runtime->format) == 16 ? 0 : 1);
/* set up dac/adc rate */
freq = ((runtime->rate << 15) + 24000 ) / 48000;
- if (freq)
+ if (freq)
freq--;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1380,7 +1380,7 @@ snd_m3_playback_setup(struct snd_m3 *chip, struct m3_dma *s,
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + SRC3_DIRECTION_OFFSET + 22,
subs->runtime->rate > 45000 ? 0xff : 0);
-
+
/* tell it which way dma is going? */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_DMA_CONTROL,
@@ -1389,13 +1389,13 @@ snd_m3_playback_setup(struct snd_m3 *chip, struct m3_dma *s,
/*
* set an armload of static initializers
*/
- for (i = 0; i < ARRAY_SIZE(pv); i++)
+ for (i = 0; i < ARRAY_SIZE(pv); i++)
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + pv[i].addr, pv[i].val);
}
/*
- * Native record driver
+ * Native record driver
*/
static const struct rec_vals {
u16 addr, val;
@@ -1441,13 +1441,13 @@ snd_m3_capture_setup(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_subst
/* tell it which way dma is going? */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_DMA_CONTROL,
- DMACONTROL_DIRECTION + DMACONTROL_AUTOREPEAT +
+ DMACONTROL_DIRECTION + DMACONTROL_AUTOREPEAT +
DMAC_PAGE3_SELECTOR + DMAC_BLOCKF_SELECTOR);
/*
* set an armload of static initializers
*/
- for (i = 0; i < ARRAY_SIZE(rv); i++)
+ for (i = 0; i < ARRAY_SIZE(rv); i++)
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + rv[i].addr, rv[i].val);
}
@@ -1472,7 +1472,7 @@ static int snd_m3_pcm_hw_params(struct snd_pcm_substream *substream,
static int snd_m3_pcm_hw_free(struct snd_pcm_substream *substream)
{
struct m3_dma *s;
-
+
if (substream->runtime->private_data == NULL)
return 0;
s = substream->runtime->private_data;
@@ -1567,7 +1567,7 @@ static void snd_m3_update_ptr(struct snd_m3 *chip, struct m3_dma *s)
unsigned int hwptr;
int diff;
- if (! s->running)
+ if (!s->running)
return;
hwptr = snd_m3_get_pointer(chip, s, subs);
@@ -1764,7 +1764,7 @@ snd_m3_substream_open(struct snd_m3 *chip, struct snd_pcm_substream *subs)
spin_lock_irq(&chip->reg_lock);
for (i = 0; i < chip->num_substreams; i++) {
s = &chip->substreams[i];
- if (! s->opened)
+ if (!s->opened)
goto __found;
}
spin_unlock_irq(&chip->reg_lock);
@@ -1885,7 +1885,7 @@ static struct snd_pcm_ops snd_m3_capture_ops = {
};
static int __devinit
-snd_m3_pcm(struct snd_m3 * chip, int device)
+snd_m3_pcm(struct snd_m3 *chip, int device)
{
struct snd_pcm *pcm;
int err;
@@ -1902,7 +1902,7 @@ snd_m3_pcm(struct snd_m3 * chip, int device)
pcm->info_flags = 0;
strcpy(pcm->name, chip->card->driver);
chip->pcm = pcm;
-
+
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci), 64*1024, 64*1024);
@@ -1923,7 +1923,7 @@ static int snd_m3_ac97_wait(struct snd_m3 *chip)
int i = 10000;
do {
- if (! (snd_m3_inb(chip, 0x30) & 1))
+ if (!(snd_m3_inb(chip, 0x30) & 1))
return 0;
cpu_relax();
} while (i-- > 0);
@@ -1979,8 +1979,8 @@ static void snd_m3_remote_codec_config(int io, int isremote)
io + SDO_IN_DEST_CTRL);
}
-/*
- * hack, returns non zero on err
+/*
+ * hack, returns non zero on err
*/
static int snd_m3_try_read_vendor(struct snd_m3 *chip)
{
@@ -2007,9 +2007,9 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip)
if (chip->allegro_flag) {
/*
- * the onboard codec on the allegro seems
+ * the onboard codec on the allegro seems
* to want to wait a very long time before
- * coming back to life
+ * coming back to life
*/
delay1 = 50;
delay2 = 800;
@@ -2044,7 +2044,7 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip)
schedule_timeout_uninterruptible(msecs_to_jiffies(delay2));
- if (! snd_m3_try_read_vendor(chip))
+ if (!snd_m3_try_read_vendor(chip))
break;
delay1 += 10;
@@ -2079,7 +2079,7 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
return err;
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0)
@@ -2120,7 +2120,7 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
/* zero kernel data */
for (i = 0; i < (REV_B_DATA_MEMORY_UNIT_LENGTH * NUM_UNITS_KERNEL_DATA) / 2; i++)
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
KDATA_BASE_ADDR + i, 0);
/* zero mixer data? */
@@ -2135,8 +2135,8 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
/* write kernel into code memory.. */
data = (const u16 *)chip->assp_kernel_image->data;
- for (i = 0 ; i * 2 < chip->assp_kernel_image->size; i++) {
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
+ for (i = 0; i * 2 < chip->assp_kernel_image->size; i++) {
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
REV_B_CODE_MEMORY_BEGIN + i,
le16_to_cpu(data[i]));
}
@@ -2149,14 +2149,14 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
*/
data = (const u16 *)chip->assp_minisrc_image->data;
for (i = 0; i * 2 < chip->assp_minisrc_image->size; i++) {
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
0x400 + i, le16_to_cpu(data[i]));
}
/*
* write the coefficients for the low pass filter?
*/
- for (i = 0; i < MINISRC_LPF_LEN ; i++) {
+ for (i = 0; i < MINISRC_LPF_LEN; i++) {
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
0x400 + MINISRC_COEF_LOC + i,
minisrc_lpf[i]);
@@ -2170,7 +2170,7 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
* the minisrc is the only thing on
* our task list..
*/
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
KDATA_TASK0,
0x400);
@@ -2206,14 +2206,14 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
static int __devinit snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s, int index)
{
- int data_bytes = 2 * ( MINISRC_TMP_BUFFER_SIZE / 2 +
+ int data_bytes = 2 * ( MINISRC_TMP_BUFFER_SIZE / 2 +
MINISRC_IN_BUFFER_SIZE / 2 +
- 1 + MINISRC_OUT_BUFFER_SIZE / 2 + 1 );
+ 1 + MINISRC_OUT_BUFFER_SIZE / 2 + 1);
int address, i;
/*
* the revb memory map has 0x1100 through 0x1c00
- * free.
+ * free.
*/
/*
@@ -2243,7 +2243,7 @@ static int __devinit snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma
}
-/*
+/*
* this works for the reference board, have to find
* out about others
*
@@ -2255,7 +2255,7 @@ snd_m3_amp_enable(struct snd_m3 *chip, int enable)
int io = chip->iobase;
u16 gpo, polarity;
- if (! chip->external_amp)
+ if (!chip->external_amp)
return;
polarity = enable ? 0 : 1;
@@ -2323,10 +2323,10 @@ snd_m3_chip_init(struct snd_m3 *chip)
pci_read_config_dword(pcidev, PCI_ALLEGRO_CONFIG, &n);
n &= ~INT_CLK_SELECT;
if (!chip->allegro_flag) {
- n &= ~INT_CLK_MULT_ENABLE;
+ n &= ~INT_CLK_MULT_ENABLE;
n |= INT_CLK_SRC_NOT_PCI;
}
- n &= ~( CLK_MULT_MODE_SELECT | CLK_MULT_MODE_SELECT_2 );
+ n &= ~( CLK_MULT_MODE_SELECT | CLK_MULT_MODE_SELECT_2);
pci_write_config_dword(pcidev, PCI_ALLEGRO_CONFIG, n);
if (chip->allegro_flag) {
@@ -2338,11 +2338,11 @@ snd_m3_chip_init(struct snd_m3 *chip)
t = inb(chip->iobase + ASSP_CONTROL_A);
t &= ~( DSP_CLK_36MHZ_SELECT | ASSP_CLK_49MHZ_SELECT);
t |= ASSP_CLK_49MHZ_SELECT;
- t |= ASSP_0_WS_ENABLE;
+ t |= ASSP_0_WS_ENABLE;
outb(t, chip->iobase + ASSP_CONTROL_A);
snd_m3_assp_init(chip); /* download DSP code before starting ASSP below */
- outb(RUN_ASSP, chip->iobase + ASSP_CONTROL_B);
+ outb(RUN_ASSP, chip->iobase + ASSP_CONTROL_B);
outb(0x00, io + HARDWARE_VOL_CTRL);
outb(0x88, io + SHADOW_MIX_REG_VOICE);
@@ -2351,7 +2351,7 @@ snd_m3_chip_init(struct snd_m3 *chip)
outb(0x88, io + HW_VOL_COUNTER_MASTER);
return 0;
-}
+}
static void
snd_m3_enable_ints(struct snd_m3 *chip)
@@ -2437,7 +2437,7 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++)
chip->suspend_mem[dsp_index++] =
snd_m3_assp_read(chip, MEMTYPE_INTERNAL_CODE, i);
- for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
+ for (i = REV_B_DATA_MEMORY_BEGIN; i <= REV_B_DATA_MEMORY_END; i++)
chip->suspend_mem[dsp_index++] =
snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
@@ -2477,14 +2477,14 @@ static int m3_resume(struct pci_dev *pci)
/* restore dsp image */
dsp_index = 0;
for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++)
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE, i,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE, i,
chip->suspend_mem[dsp_index++]);
- for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, i,
+ for (i = REV_B_DATA_MEMORY_BEGIN; i <= REV_B_DATA_MEMORY_END; i++)
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, i,
chip->suspend_mem[dsp_index++]);
/* tell the dma engine to restart itself */
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
KDATA_DMA_ACTIVE, 0);
/* restore ac97 registers */
@@ -2614,7 +2614,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
return err;
}
chip->iobase = pci_resource_start(pci, 0);
-
+
/* just to be sure */
pci_set_master(pci);
@@ -2659,7 +2659,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
if ((err = snd_m3_pcm(chip, 0)) < 0)
return err;
-
+
snd_m3_enable_ints(chip);
snd_m3_assp_continue(chip);
@@ -2667,7 +2667,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
*chip_ret = chip;
- return 0;
+ return 0;
}
/*
@@ -2758,7 +2758,7 @@ static struct pci_driver driver = {
.resume = m3_resume,
#endif
};
-
+
static int __init alsa_card_m3_init(void)
{
return pci_register_driver(&driver);
1
0

[alsa-devel] [PATCH 13/24] sound/pci: coding style fixes: korg1212
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/korg1212/korg1212.c | 492 ++++++++++++++++++++--------------------
1 files changed, 246 insertions(+), 246 deletions(-)
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 5f8006b..d4c7dd7 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -36,7 +36,7 @@
#include <sound/pcm_params.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
// ----------------------------------------------------------------------------
// Debug Stuff
@@ -54,7 +54,7 @@
#endif
// ----------------------------------------------------------------------------
-// Record/Play Buffer Allocation Method. If K1212_LARGEALLOC is defined all
+// Record/Play Buffer Allocation Method. If K1212_LARGEALLOC is defined all
// buffers are alocated as a large piece inside KorgSharedBuffer.
// ----------------------------------------------------------------------------
//#define K1212_LARGEALLOC 1
@@ -63,21 +63,21 @@
// Valid states of the Korg 1212 I/O card.
// ----------------------------------------------------------------------------
enum CardState {
- K1212_STATE_NONEXISTENT, // there is no card here
- K1212_STATE_UNINITIALIZED, // the card is awaiting DSP download
- K1212_STATE_DSP_IN_PROCESS, // the card is currently downloading its DSP code
- K1212_STATE_DSP_COMPLETE, // the card has finished the DSP download
- K1212_STATE_READY, // the card can be opened by an application. Any application
- // requests prior to this state should fail. Only an open
- // request can be made at this state.
- K1212_STATE_OPEN, // an application has opened the card
- K1212_STATE_SETUP, // the card has been setup for play
- K1212_STATE_PLAYING, // the card is playing
- K1212_STATE_MONITOR, // the card is in the monitor mode
- K1212_STATE_CALIBRATING, // the card is currently calibrating
- K1212_STATE_ERRORSTOP, // the card has stopped itself because of an error and we
- // are in the process of cleaning things up.
- K1212_STATE_MAX_STATE // state values of this and beyond are invalid
+ K1212_STATE_NONEXISTENT, /* there is no card here */
+ K1212_STATE_UNINITIALIZED, /* the card is awaiting DSP download */
+ K1212_STATE_DSP_IN_PROCESS, /* the card is currently downloading its DSP code */
+ K1212_STATE_DSP_COMPLETE, /* the card has finished the DSP download */
+ K1212_STATE_READY, /* the card can be opened by an application. Any application */
+ /* requests prior to this state should fail. Only an open */
+ /* request can be made at this state. */
+ K1212_STATE_OPEN, /* an application has opened the card */
+ K1212_STATE_SETUP, /* the card has been setup for play */
+ K1212_STATE_PLAYING, /* the card is playing */
+ K1212_STATE_MONITOR, /* the card is in the monitor mode */
+ K1212_STATE_CALIBRATING, /* the card is currently calibrating */
+ K1212_STATE_ERRORSTOP, /* the card has stopped itself because of an error and we */
+ /* are in the process of cleaning things up. */
+ K1212_STATE_MAX_STATE /* state values of this and beyond are invalid */
};
// ----------------------------------------------------------------------------
@@ -85,48 +85,48 @@ enum CardState {
// host-to-card doorbell to initiate a command.
// ----------------------------------------------------------------------------
enum korg1212_dbcnst {
- K1212_DB_RequestForData = 0, // sent by the card to request a buffer fill.
- K1212_DB_TriggerPlay = 1, // starts playback/record on the card.
- K1212_DB_SelectPlayMode = 2, // select monitor, playback setup, or stop.
- K1212_DB_ConfigureBufferMemory = 3, // tells card where the host audio buffers are.
- K1212_DB_RequestAdatTimecode = 4, // asks the card for the latest ADAT timecode value.
- K1212_DB_SetClockSourceRate = 5, // sets the clock source and rate for the card.
- K1212_DB_ConfigureMiscMemory = 6, // tells card where other buffers are.
- K1212_DB_TriggerFromAdat = 7, // tells card to trigger from Adat at a specific
- // timecode value.
- K1212_DB_DMAERROR = 0x80, // DMA Error - the PCI bus is congestioned.
- K1212_DB_CARDSTOPPED = 0x81, // Card has stopped by user request.
- K1212_DB_RebootCard = 0xA0, // instructs the card to reboot.
- K1212_DB_BootFromDSPPage4 = 0xA4, // instructs the card to boot from the DSP microcode
- // on page 4 (local page to card).
- K1212_DB_DSPDownloadDone = 0xAE, // sent by the card to indicate the download has
- // completed.
- K1212_DB_StartDSPDownload = 0xAF // tells the card to download its DSP firmware.
+ K1212_DB_RequestForData = 0, /* sent by the card to request a buffer fill. */
+ K1212_DB_TriggerPlay = 1, /* starts playback/record on the card. */
+ K1212_DB_SelectPlayMode = 2, /* select monitor, playback setup, or stop. */
+ K1212_DB_ConfigureBufferMemory = 3, /* tells card where the host audio buffers are. */
+ K1212_DB_RequestAdatTimecode = 4, /* asks the card for the latest ADAT timecode value. */
+ K1212_DB_SetClockSourceRate = 5, /* sets the clock source and rate for the card. */
+ K1212_DB_ConfigureMiscMemory = 6, /* tells card where other buffers are. */
+ K1212_DB_TriggerFromAdat = 7, /* tells card to trigger from Adat at a specific */
+ /* timecode value. */
+ K1212_DB_DMAERROR = 0x80, /* DMA Error - the PCI bus is congestioned. */
+ K1212_DB_CARDSTOPPED = 0x81, /* Card has stopped by user request. */
+ K1212_DB_RebootCard = 0xA0, /* instructs the card to reboot. */
+ K1212_DB_BootFromDSPPage4 = 0xA4, /* instructs the card to boot from the DSP microcode */
+ /* on page 4 (local page to card). */
+ K1212_DB_DSPDownloadDone = 0xAE, /* sent by the card to indicate the download has */
+ /* completed. */
+ K1212_DB_StartDSPDownload = 0xAF /* tells the card to download its DSP firmware. */
};
// ----------------------------------------------------------------------------
-// The following enumeration defines return codes
+// The following enumeration defines return codes
// to the Korg 1212 I/O driver.
// ----------------------------------------------------------------------------
enum snd_korg1212rc {
- K1212_CMDRET_Success = 0, // command was successfully placed
- K1212_CMDRET_DIOCFailure, // the DeviceIoControl call failed
- K1212_CMDRET_PMFailure, // the protected mode call failed
- K1212_CMDRET_FailUnspecified, // unspecified failure
- K1212_CMDRET_FailBadState, // the specified command can not be given in
- // the card's current state. (or the wave device's
- // state)
- K1212_CMDRET_CardUninitialized, // the card is uninitialized and cannot be used
- K1212_CMDRET_BadIndex, // an out of range card index was specified
- K1212_CMDRET_BadHandle, // an invalid card handle was specified
- K1212_CMDRET_NoFillRoutine, // a play request has been made before a fill routine set
- K1212_CMDRET_FillRoutineInUse, // can't set a new fill routine while one is in use
- K1212_CMDRET_NoAckFromCard, // the card never acknowledged a command
- K1212_CMDRET_BadParams, // bad parameters were provided by the caller
-
- K1212_CMDRET_BadDevice, // the specified wave device was out of range
- K1212_CMDRET_BadFormat // the specified wave format is unsupported
+ K1212_CMDRET_Success = 0, /* command was successfully placed */
+ K1212_CMDRET_DIOCFailure, /* the DeviceIoControl call failed */
+ K1212_CMDRET_PMFailure, /* the protected mode call failed */
+ K1212_CMDRET_FailUnspecified, /* unspecified failure */
+ K1212_CMDRET_FailBadState, /* the specified command can not be given in */
+ /* the card's current state. (or the wave device's */
+ /* state) */
+ K1212_CMDRET_CardUninitialized, /* the card is uninitialized and cannot be used */
+ K1212_CMDRET_BadIndex, /* an out of range card index was specified */
+ K1212_CMDRET_BadHandle, /* an invalid card handle was specified */
+ K1212_CMDRET_NoFillRoutine, /* a play request has been made before a fill routine set */
+ K1212_CMDRET_FillRoutineInUse, /* can't set a new fill routine while one is in use */
+ K1212_CMDRET_NoAckFromCard, /* the card never acknowledged a command */
+ K1212_CMDRET_BadParams, /* bad parameters were provided by the caller */
+
+ K1212_CMDRET_BadDevice, /* the specified wave device was out of range */
+ K1212_CMDRET_BadFormat /* the specified wave format is unsupported */
};
// ----------------------------------------------------------------------------
@@ -134,10 +134,10 @@ enum snd_korg1212rc {
// mode for the card in the SelectPlayMode command.
// ----------------------------------------------------------------------------
enum PlayModeSelector {
- K1212_MODE_SetupPlay = 0x00000001, // provides card with pre-play information
- K1212_MODE_MonitorOn = 0x00000002, // tells card to turn on monitor mode
- K1212_MODE_MonitorOff = 0x00000004, // tells card to turn off monitor mode
- K1212_MODE_StopPlay = 0x00000008 // stops playback on the card
+ K1212_MODE_SetupPlay = 0x00000001, /* provides card with pre-play information */
+ K1212_MODE_MonitorOn = 0x00000002, /* tells card to turn on monitor mode */
+ K1212_MODE_MonitorOff = 0x00000004, /* tells card to turn off monitor mode */
+ K1212_MODE_StopPlay = 0x00000008 /* stops playback on the card */
};
// ----------------------------------------------------------------------------
@@ -145,28 +145,28 @@ enum PlayModeSelector {
// mode for the card in the SetMonitorMode command.
// ----------------------------------------------------------------------------
enum MonitorModeSelector {
- K1212_MONMODE_Off = 0, // tells card to turn off monitor mode
- K1212_MONMODE_On // tells card to turn on monitor mode
+ K1212_MONMODE_Off = 0, /* tells card to turn off monitor mode */
+ K1212_MONMODE_On /* tells card to turn on monitor mode */
};
-#define MAILBOX0_OFFSET 0x40 // location of mailbox 0 relative to base address
-#define MAILBOX1_OFFSET 0x44 // location of mailbox 1 relative to base address
-#define MAILBOX2_OFFSET 0x48 // location of mailbox 2 relative to base address
-#define MAILBOX3_OFFSET 0x4c // location of mailbox 3 relative to base address
-#define OUT_DOORBELL_OFFSET 0x60 // location of PCI to local doorbell
-#define IN_DOORBELL_OFFSET 0x64 // location of local to PCI doorbell
-#define STATUS_REG_OFFSET 0x68 // location of interrupt control/status register
-#define PCI_CONTROL_OFFSET 0x6c // location of the EEPROM, PCI, User I/O, init control
- // register
-#define SENS_CONTROL_OFFSET 0x6e // location of the input sensitivity setting register.
- // this is the upper word of the PCI control reg.
-#define DEV_VEND_ID_OFFSET 0x70 // location of the device and vendor ID register
-
-#define MAX_COMMAND_RETRIES 5 // maximum number of times the driver will attempt
- // to send a command before giving up.
-#define COMMAND_ACK_MASK 0x8000 // the MSB is set in the command acknowledgment from
- // the card.
-#define DOORBELL_VAL_MASK 0x00FF // the doorbell value is one byte
+#define MAILBOX0_OFFSET 0x40 /* location of mailbox 0 relative to base address */
+#define MAILBOX1_OFFSET 0x44 /* location of mailbox 1 relative to base address */
+#define MAILBOX2_OFFSET 0x48 /* location of mailbox 2 relative to base address */
+#define MAILBOX3_OFFSET 0x4c /* location of mailbox 3 relative to base address */
+#define OUT_DOORBELL_OFFSET 0x60 /* location of PCI to local doorbell */
+#define IN_DOORBELL_OFFSET 0x64 /* location of local to PCI doorbell */
+#define STATUS_REG_OFFSET 0x68 /* location of interrupt control/status register */
+#define PCI_CONTROL_OFFSET 0x6c /* location of the EEPROM, PCI, User I/O, init control */
+ /* register */
+#define SENS_CONTROL_OFFSET 0x6e /* location of the input sensitivity setting register. */
+ /* this is the upper word of the PCI control reg. */
+#define DEV_VEND_ID_OFFSET 0x70 /* location of the device and vendor ID register */
+
+#define MAX_COMMAND_RETRIES 5 /* maximum number of times the driver will attempt */
+ /* to send a command before giving up. */
+#define COMMAND_ACK_MASK 0x8000 /* the MSB is set in the command acknowledgment from */
+ /* the card. */
+#define DOORBELL_VAL_MASK 0x00FF /* the doorbell value is one byte */
#define CARD_BOOT_DELAY_IN_MS 10
#define CARD_BOOT_TIMEOUT 10
@@ -255,25 +255,25 @@ enum MonitorModeSelector {
#define SENSCLKPULSE_WIDTH 4
#define LOADSHIFT_DELAY 4
#define INTERCOMMAND_DELAY 40
-#define STOPCARD_DELAY 300 // max # RTC ticks for the card to stop once we write
- // the command register. (could be up to 180 us)
-#define COMMAND_ACK_DELAY 13 // number of RTC ticks to wait for an acknowledgement
- // from the card after sending a command.
+#define STOPCARD_DELAY 300 /* max # RTC ticks for the card to stop once we write */
+ /* the command register. (could be up to 180 us) */
+#define COMMAND_ACK_DELAY 13 /* number of RTC ticks to wait for an acknowledgement */
+ /* from the card after sending a command. */
enum ClockSourceIndex {
- K1212_CLKIDX_AdatAt44_1K = 0, // selects source as ADAT at 44.1 kHz
- K1212_CLKIDX_AdatAt48K, // selects source as ADAT at 48 kHz
- K1212_CLKIDX_WordAt44_1K, // selects source as S/PDIF at 44.1 kHz
- K1212_CLKIDX_WordAt48K, // selects source as S/PDIF at 48 kHz
- K1212_CLKIDX_LocalAt44_1K, // selects source as local clock at 44.1 kHz
- K1212_CLKIDX_LocalAt48K, // selects source as local clock at 48 kHz
- K1212_CLKIDX_Invalid // used to check validity of the index
+ K1212_CLKIDX_AdatAt44_1K = 0, /* selects source as ADAT at 44.1 kHz */
+ K1212_CLKIDX_AdatAt48K, /* selects source as ADAT at 48 kHz */
+ K1212_CLKIDX_WordAt44_1K, /* selects source as S/PDIF at 44.1 kHz */
+ K1212_CLKIDX_WordAt48K, /* selects source as S/PDIF at 48 kHz */
+ K1212_CLKIDX_LocalAt44_1K, /* selects source as local clock at 44.1 kHz */
+ K1212_CLKIDX_LocalAt48K, /* selects source as local clock at 48 kHz */
+ K1212_CLKIDX_Invalid /* used to check validity of the index */
};
enum ClockSourceType {
- K1212_CLKIDX_Adat = 0, // selects source as ADAT
- K1212_CLKIDX_Word, // selects source as S/PDIF
- K1212_CLKIDX_Local // selects source as local clock
+ K1212_CLKIDX_Adat = 0, /* selects source as ADAT */
+ K1212_CLKIDX_Word, /* selects source as S/PDIF */
+ K1212_CLKIDX_Local /* selects source as local clock */
};
struct KorgAudioFrame {
@@ -294,7 +294,7 @@ struct KorgSharedBuffer {
short volumeData[kAudioChannels];
u32 cardCommand;
u16 routeData [kAudioChannels];
- u32 AdatTimeCode; // ADAT timecode value
+ u32 AdatTimeCode; /* ADAT timecode value */
};
struct SensBits {
@@ -354,16 +354,16 @@ struct snd_korg1212 {
u32 RoutingTablePhy;
u32 AdatTimeCodePhy;
- u32 __iomem * statusRegPtr; // address of the interrupt status/control register
- u32 __iomem * outDoorbellPtr; // address of the host->card doorbell register
- u32 __iomem * inDoorbellPtr; // address of the card->host doorbell register
- u32 __iomem * mailbox0Ptr; // address of mailbox 0 on the card
- u32 __iomem * mailbox1Ptr; // address of mailbox 1 on the card
- u32 __iomem * mailbox2Ptr; // address of mailbox 2 on the card
- u32 __iomem * mailbox3Ptr; // address of mailbox 3 on the card
- u32 __iomem * controlRegPtr; // address of the EEPROM, PCI, I/O, Init ctrl reg
- u16 __iomem * sensRegPtr; // address of the sensitivity setting register
- u32 __iomem * idRegPtr; // address of the device and vendor ID registers
+ u32 __iomem * statusRegPtr; /* address of the interrupt status/control register */
+ u32 __iomem * outDoorbellPtr; /* address of the host->card doorbell register */
+ u32 __iomem * inDoorbellPtr; /* address of the card->host doorbell register */
+ u32 __iomem * mailbox0Ptr; /* address of mailbox 0 on the card */
+ u32 __iomem * mailbox1Ptr; /* address of mailbox 1 on the card */
+ u32 __iomem * mailbox2Ptr; /* address of mailbox 2 on the card */
+ u32 __iomem * mailbox3Ptr; /* address of mailbox 3 on the card */
+ u32 __iomem * controlRegPtr; /* address of the EEPROM, PCI, I/O, Init ctrl reg */
+ u16 __iomem * sensRegPtr; /* address of the sensitivity setting register */
+ u32 __iomem * idRegPtr; /* address of the device and vendor ID registers */
size_t periodsize;
int channels;
@@ -377,24 +377,24 @@ struct snd_korg1212 {
enum CardState cardState;
int running;
- int idleMonitorOn; // indicates whether the card is in idle monitor mode.
- u32 cmdRetryCount; // tracks how many times we have retried sending to the card.
+ int idleMonitorOn; /* indicates whether the card is in idle monitor mode. */
+ u32 cmdRetryCount; /* tracks how many times we have retried sending to the card. */
- enum ClockSourceIndex clkSrcRate; // sample rate and clock source
+ enum ClockSourceIndex clkSrcRate; /* sample rate and clock source */
- enum ClockSourceType clkSource; // clock source
- int clkRate; // clock rate
+ enum ClockSourceType clkSource; /* clock source */
+ int clkRate; /* clock rate */
int volumePhase[kAudioChannels];
- u16 leftADCInSens; // ADC left channel input sensitivity
- u16 rightADCInSens; // ADC right channel input sensitivity
+ u16 leftADCInSens; /* ADC left channel input sensitivity */
+ u16 rightADCInSens; /* ADC right channel input sensitivity */
- int opencnt; // Open/Close count
- int setcnt; // SetupForPlay count
- int playcnt; // TriggerPlay count
- int errorcnt; // Error Count
- unsigned long totalerrorcnt; // Total Error Count
+ int opencnt; /* Open/Close count */
+ int setcnt; /* SetupForPlay count */
+ int playcnt; /* TriggerPlay count */
+ int errorcnt; /* Error Count */
+ unsigned long totalerrorcnt; /* Total Error Count */
int dsp_is_loaded;
int dsp_stop_is_processed;
@@ -471,12 +471,12 @@ static char *channelName[] = {
};
static u16 ClockSourceSelector[] = {
- 0x8000, // selects source as ADAT at 44.1 kHz
- 0x0000, // selects source as ADAT at 48 kHz
- 0x8001, // selects source as S/PDIF at 44.1 kHz
- 0x0001, // selects source as S/PDIF at 48 kHz
- 0x8002, // selects source as local clock at 44.1 kHz
- 0x0002 // selects source as local clock at 48 kHz
+ 0x8000, /* selects source as ADAT at 44.1 kHz */
+ 0x0000, /* selects source as ADAT at 48 kHz */
+ 0x8001, /* selects source as S/PDIF at 44.1 kHz */
+ 0x0001, /* selects source as S/PDIF at 48 kHz */
+ 0x8002, /* selects source as local clock at 44.1 kHz */
+ 0x0002 /* selects source as local clock at 48 kHz */
};
union swap_u32 { unsigned char c[4]; u32 i; };
@@ -541,23 +541,23 @@ static int snd_korg1212_Send1212Command(struct snd_korg1212 *korg1212,
writel(mailBox2Val, korg1212->mailbox2Ptr);
writel(mailBox1Val, korg1212->mailbox1Ptr);
writel(mailBox0Val, korg1212->mailbox0Ptr);
- writel(doorbellVal, korg1212->outDoorbellPtr); // interrupt the card
+ writel(doorbellVal, korg1212->outDoorbellPtr); /* interrupt the card */
- // --------------------------------------------------------------
- // the reboot command will not give an acknowledgement.
- // --------------------------------------------------------------
- if ( doorbellVal == K1212_DB_RebootCard ||
+ /* -------------------------------------------------------------- */
+ /* the reboot command will not give an acknowledgement. */
+ /* -------------------------------------------------------------- */
+ if (doorbellVal == K1212_DB_RebootCard ||
doorbellVal == K1212_DB_BootFromDSPPage4 ||
- doorbellVal == K1212_DB_StartDSPDownload ) {
+ doorbellVal == K1212_DB_StartDSPDownload) {
rc = K1212_CMDRET_Success;
break;
}
- // --------------------------------------------------------------
- // See if the card acknowledged the command. Wait a bit, then
- // read in the low word of mailbox3. If the MSB is set and the
- // low byte is equal to the doorbell value, then it ack'd.
- // --------------------------------------------------------------
+ /* -------------------------------------------------------------- */
+ /* See if the card acknowledged the command. Wait a bit, then */
+ /* read in the low word of mailbox3. If the MSB is set and the */
+ /* low byte is equal to the doorbell value, then it ack'd. */
+ /* -------------------------------------------------------------- */
udelay(COMMAND_ACK_DELAY);
mailBox3Lo = readl(korg1212->mailbox3Ptr);
if (mailBox3Lo & COMMAND_ACK_MASK) {
@@ -581,7 +581,7 @@ static int snd_korg1212_Send1212Command(struct snd_korg1212 *korg1212,
/* spinlock already held */
static void snd_korg1212_SendStop(struct snd_korg1212 *korg1212)
{
- if (! korg1212->stop_pending_cnt) {
+ if (!korg1212->stop_pending_cnt) {
korg1212->sharedBufferPtr->cardCommand = 0xffffffff;
/* program the timer */
korg1212->stop_pending_cnt = HZ;
@@ -605,7 +605,7 @@ static void snd_korg1212_timer_func(unsigned long data)
{
struct snd_korg1212 *korg1212 = (struct snd_korg1212 *) data;
unsigned long flags;
-
+
spin_lock_irqsave(&korg1212->lock, flags);
if (korg1212->sharedBufferPtr->cardCommand == 0) {
/* ack'ed */
@@ -757,7 +757,7 @@ static int snd_korg1212_StopPlay(struct snd_korg1212 * korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: StopPlay [%s] %d\n",
stateName[korg1212->cardState], korg1212->playcnt);
- if (--(korg1212->playcnt))
+ if (--(korg1212->playcnt))
return 0;
korg1212->setcnt = 0;
@@ -897,24 +897,24 @@ static int snd_korg1212_WriteADCSensitivity(struct snd_korg1212 *korg1212)
int channel;
int clkIs48K;
int monModeSet;
- u16 controlValue; // this keeps the current value to be written to
- // the card's eeprom control register.
+ u16 controlValue; /* this keeps the current value to be written to */
+ /* the card's eeprom control register. */
u16 count;
unsigned long flags;
K1212_DEBUG_PRINTK("K1212_DEBUG: WriteADCSensivity [%s]\n",
stateName[korg1212->cardState]);
- // ----------------------------------------------------------------------------
- // initialize things. The local init bit is always set when writing to the
- // card's control register.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* initialize things. The local init bit is always set when writing to the */
+ /* card's control register. */
+ /* ---------------------------------------------------------------------------- */
controlValue = 0;
- SetBitInWord(&controlValue, SET_SENS_LOCALINIT_BITPOS); // init the control value
+ SetBitInWord(&controlValue, SET_SENS_LOCALINIT_BITPOS); /* init the control value */
- // ----------------------------------------------------------------------------
- // make sure the card is not in monitor mode when we do this update.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* make sure the card is not in monitor mode when we do this update. */
+ /* ---------------------------------------------------------------------------- */
if (korg1212->cardState == K1212_STATE_MONITOR || korg1212->idleMonitorOn) {
monModeSet = 1;
snd_korg1212_SendStopAndWait(korg1212);
@@ -923,17 +923,17 @@ static int snd_korg1212_WriteADCSensitivity(struct snd_korg1212 *korg1212)
spin_lock_irqsave(&korg1212->lock, flags);
- // ----------------------------------------------------------------------------
- // we are about to send new values to the card, so clear the new values queued
- // flag. Also, clear out mailbox 3, so we don't lockup.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* we are about to send new values to the card, so clear the new values queued */
+ /* flag. Also, clear out mailbox 3, so we don't lockup. */
+ /* ---------------------------------------------------------------------------- */
writel(0, korg1212->mailbox3Ptr);
udelay(LOADSHIFT_DELAY);
- // ----------------------------------------------------------------------------
- // determine whether we are running a 48K or 44.1K clock. This info is used
- // later when setting the SPDIF FF after the volume has been shifted in.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* determine whether we are running a 48K or 44.1K clock. This info is used */
+ /* later when setting the SPDIF FF after the volume has been shifted in. */
+ /* ---------------------------------------------------------------------------- */
switch (korg1212->clkSrcRate) {
case K1212_CLKIDX_AdatAt44_1K:
case K1212_CLKIDX_WordAt44_1K:
@@ -949,76 +949,76 @@ static int snd_korg1212_WriteADCSensitivity(struct snd_korg1212 *korg1212)
break;
}
- // ----------------------------------------------------------------------------
- // start the update. Setup the bit structure and then shift the bits.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* start the update. Setup the bit structure and then shift the bits. */
+ /* ---------------------------------------------------------------------------- */
sensVals.l.v.leftChanId = SET_SENS_LEFTCHANID;
sensVals.r.v.rightChanId = SET_SENS_RIGHTCHANID;
sensVals.l.v.leftChanVal = korg1212->leftADCInSens;
sensVals.r.v.rightChanVal = korg1212->rightADCInSens;
- // ----------------------------------------------------------------------------
- // now start shifting the bits in. Start with the left channel then the right.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* now start shifting the bits in. Start with the left channel then the right. */
+ /* ---------------------------------------------------------------------------- */
for (channel = 0; channel < 2; channel++) {
- // ----------------------------------------------------------------------------
- // Bring the load/shift line low, then wait - the spec says >150ns from load/
- // shift low to the first rising edge of the clock.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* Bring the load/shift line low, then wait - the spec says >150ns from load/ */
+ /* shift low to the first rising edge of the clock. */
+ /* ---------------------------------------------------------------------------- */
ClearBitInWord(&controlValue, SET_SENS_LOADSHIFT_BITPOS);
ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // load/shift goes low
+ writew(controlValue, korg1212->sensRegPtr); /* load/shift goes low */
udelay(LOADSHIFT_DELAY);
- for (bitPosition = 15; bitPosition >= 0; bitPosition--) { // for all the bits
+ for (bitPosition = 15; bitPosition >= 0; bitPosition--) { /* for all the bits */
if (channel == 0) {
if (sensVals.l.leftSensBits & (0x0001 << bitPosition))
- SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set high
+ SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set high */
else
- ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set low
+ ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set low */
} else {
if (sensVals.r.rightSensBits & (0x0001 << bitPosition))
- SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set high
+ SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set high */
else
- ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set low
+ ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set low */
}
ClearBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes low
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes low */
udelay(SENSCLKPULSE_WIDTH);
SetBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes high
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes high */
udelay(SENSCLKPULSE_WIDTH);
}
- // ----------------------------------------------------------------------------
- // finish up SPDIF for left. Bring the load/shift line high, then write a one
- // bit if the clock rate is 48K otherwise write 0.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* finish up SPDIF for left. Bring the load/shift line high, then write a one */
+ /* bit if the clock rate is 48K otherwise write 0. */
+ /* ---------------------------------------------------------------------------- */
ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS);
ClearBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
SetBitInWord(&controlValue, SET_SENS_LOADSHIFT_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // load shift goes high - clk low
+ writew(controlValue, korg1212->sensRegPtr); /* load shift goes high - clk low */
udelay(SENSCLKPULSE_WIDTH);
if (clkIs48K)
SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // set/clear data bit
+ writew(controlValue, korg1212->sensRegPtr); /* set/clear data bit */
udelay(ONE_RTC_TICK);
SetBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes high
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes high */
udelay(SENSCLKPULSE_WIDTH);
ClearBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes low
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes low */
udelay(SENSCLKPULSE_WIDTH);
}
- // ----------------------------------------------------------------------------
- // The update is complete. Set a timeout. This is the inter-update delay.
- // Also, if the card was in monitor mode, restore it.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* The update is complete. Set a timeout. This is the inter-update delay. */
+ /* Also, if the card was in monitor mode, restore it. */
+ /* ---------------------------------------------------------------------------- */
for (count = 0; count < 10; count++)
udelay(SENSCLKPULSE_WIDTH);
@@ -1042,9 +1042,9 @@ static void snd_korg1212_OnDSPDownloadComplete(struct snd_korg1212 *korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: DSP download is complete. [%s]\n",
stateName[korg1212->cardState]);
- // ----------------------------------------------------
- // tell the card to boot
- // ----------------------------------------------------
+ /* ---------------------------------------------------- */
+ /* tell the card to boot */
+ /* ---------------------------------------------------- */
rc = snd_korg1212_Send1212Command(korg1212, K1212_DB_BootFromDSPPage4, 0, 0, 0, 0);
if (rc)
@@ -1052,17 +1052,17 @@ static void snd_korg1212_OnDSPDownloadComplete(struct snd_korg1212 *korg1212)
rc, stateName[korg1212->cardState]);
msleep(DSP_BOOT_DELAY_IN_MS);
- // --------------------------------------------------------------------------------
- // Let the card know where all the buffers are.
- // --------------------------------------------------------------------------------
+ /* -------------------------------------------------------------------------------- */
+ /* Let the card know where all the buffers are. */
+ /* -------------------------------------------------------------------------------- */
rc = snd_korg1212_Send1212Command(korg1212,
K1212_DB_ConfigureBufferMemory,
LowerWordSwap(korg1212->PlayDataPhy),
LowerWordSwap(korg1212->RecDataPhy),
- ((kNumBuffers * kPlayBufferFrames) / 2), // size given to the card
- // is based on 2 buffers
+ ((kNumBuffers * kPlayBufferFrames) / 2), /* size given to the card */
+ /* is based on 2 buffers */
0
- );
+ );
if (rc)
K1212_DEBUG_PRINTK("K1212_DEBUG: Configure Buffer Memory - RC = %d [%s]\n",
@@ -1076,20 +1076,20 @@ static void snd_korg1212_OnDSPDownloadComplete(struct snd_korg1212 *korg1212)
LowerWordSwap(korg1212->RoutingTablePhy),
LowerWordSwap(korg1212->AdatTimeCodePhy),
0
- );
+ );
if (rc)
K1212_DEBUG_PRINTK("K1212_DEBUG: Configure Misc Memory - RC = %d [%s]\n",
rc, stateName[korg1212->cardState]);
- // --------------------------------------------------------------------------------
- // Initialize the routing and volume tables, then update the card's state.
- // --------------------------------------------------------------------------------
+ /* -------------------------------------------------------------------------------- */
+ /* Initialize the routing and volume tables, then update the card's state. */
+ /* -------------------------------------------------------------------------------- */
udelay(INTERCOMMAND_DELAY);
for (channel = 0; channel < kAudioChannels; channel++) {
korg1212->sharedBufferPtr->volumeData[channel] = k1212MaxVolume;
- //korg1212->sharedBufferPtr->routeData[channel] = channel;
+ /* korg1212->sharedBufferPtr->routeData[channel] = channel; */
korg1212->sharedBufferPtr->routeData[channel] = 8 + (channel & 1);
}
@@ -1142,9 +1142,9 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id)
}
break;
- // ------------------------------------------------------------------------
- // an error occurred - stop the card
- // ------------------------------------------------------------------------
+ /* ------------------------------------------------------------------------ */
+ /* an error occurred - stop the card */
+ /* ------------------------------------------------------------------------ */
case K1212_DB_DMAERROR:
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: IRQ DMAE count - %ld, %x, [%s].\n",
korg1212->irqcount, doorbellValue,
@@ -1156,10 +1156,10 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id)
snd_korg1212_setCardState(korg1212, K1212_STATE_ERRORSTOP);
break;
- // ------------------------------------------------------------------------
- // the card has stopped by our request. Clear the command word and signal
- // the semaphore in case someone is waiting for this.
- // ------------------------------------------------------------------------
+ /* ------------------------------------------------------------------------ */
+ /* the card has stopped by our request. Clear the command word and signal */
+ /* the semaphore in case someone is waiting for this. */
+ /* ------------------------------------------------------------------------ */
case K1212_DB_CARDSTOPPED:
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: IRQ CSTP count - %ld, %x, [%s].\n",
korg1212->irqcount, doorbellValue,
@@ -1169,7 +1169,7 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id)
default:
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: IRQ DFLT count - %ld, %x, cpos=%d [%s].\n",
- korg1212->irqcount, doorbellValue,
+ korg1212->irqcount, doorbellValue,
korg1212->currentBuffer, stateName[korg1212->cardState]);
if ((korg1212->cardState > K1212_STATE_SETUP) || korg1212->idleMonitorOn) {
korg1212->currentBuffer++;
@@ -1209,9 +1209,9 @@ static int snd_korg1212_downloadDSPCode(struct snd_korg1212 *korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: DSP download is starting... [%s]\n",
stateName[korg1212->cardState]);
- // ---------------------------------------------------------------
- // verify the state of the card before proceeding.
- // ---------------------------------------------------------------
+ /* --------------------------------------------------------------- */
+ /* verify the state of the card before proceeding. */
+ /* --------------------------------------------------------------- */
if (korg1212->cardState >= K1212_STATE_DSP_IN_PROCESS)
return 1;
@@ -1226,7 +1226,7 @@ static int snd_korg1212_downloadDSPCode(struct snd_korg1212 *korg1212)
korg1212->dsp_is_loaded = 0;
wait_event_timeout(korg1212->wait, korg1212->dsp_is_loaded, HZ * CARD_BOOT_TIMEOUT);
- if (! korg1212->dsp_is_loaded )
+ if (!korg1212->dsp_is_loaded)
return -EBUSY; /* timeout */
snd_korg1212_OnDSPDownloadComplete(korg1212);
@@ -1284,10 +1284,10 @@ static int snd_korg1212_silence(struct snd_korg1212 *korg1212, int pos, int coun
if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
return -EINVAL;
- for (i=0; i < count; i++) {
+ for (i = 0; i < count; i++) {
#if K1212_DEBUG_LEVEL > 0
- if ( (void *) dst < (void *) korg1212->playDataBufsPtr ||
- (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) {
+ if ((void *) dst < (void *) korg1212->playDataBufsPtr ||
+ (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData) {
printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_silence KERNEL EFAULT dst=%p iter=%d\n",
dst, i);
return -EFAULT;
@@ -1310,10 +1310,10 @@ static int snd_korg1212_copy_to(struct snd_korg1212 *korg1212, void __user *dst,
if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
return -EINVAL;
- for (i=0; i < count; i++) {
+ for (i = 0; i < count; i++) {
#if K1212_DEBUG_LEVEL > 0
- if ( (void *) src < (void *) korg1212->recordDataBufsPtr ||
- (void *) src > (void *) korg1212->recordDataBufsPtr[8].bufferData ) {
+ if ((void *) src < (void *) korg1212->recordDataBufsPtr ||
+ (void *) src > (void *) korg1212->recordDataBufsPtr[8].bufferData) {
printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_copy_to KERNEL EFAULT, src=%p dst=%p iter=%d\n", src, dst, i);
return -EFAULT;
}
@@ -1341,10 +1341,10 @@ static int snd_korg1212_copy_from(struct snd_korg1212 *korg1212, void __user *sr
if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
return -EINVAL;
- for (i=0; i < count; i++) {
+ for (i = 0; i < count; i++) {
#if K1212_DEBUG_LEVEL > 0
- if ( (void *) dst < (void *) korg1212->playDataBufsPtr ||
- (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) {
+ if ((void *) dst < (void *) korg1212->playDataBufsPtr ||
+ (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData) {
printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_copy_from KERNEL EFAULT, src=%p dst=%p iter=%d\n", src, dst, i);
return -EFAULT;
}
@@ -1475,7 +1475,7 @@ static int snd_korg1212_ioctl(struct snd_pcm_substream *substream,
{
K1212_DEBUG_PRINTK("K1212_DEBUG: snd_korg1212_ioctl: cmd=%d\n", cmd);
- if (cmd == SNDRV_PCM_IOCTL1_CHANNEL_INFO ) {
+ if (cmd == SNDRV_PCM_IOCTL1_CHANNEL_INFO) {
struct snd_pcm_channel_info *info = arg;
info->offset = 0;
info->first = info->channel * 16;
@@ -1619,7 +1619,7 @@ static snd_pcm_uframes_t snd_korg1212_playback_pointer(struct snd_pcm_substream
pos = korg1212->currentBuffer * kPlayBufferFrames;
- K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_playback_pointer [%s] %ld\n",
+ K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_playback_pointer [%s] %ld\n",
stateName[korg1212->cardState], pos);
return pos;
@@ -1648,7 +1648,7 @@ static int snd_korg1212_playback_copy(struct snd_pcm_substream *substream,
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_playback_copy [%s] %ld %ld\n",
stateName[korg1212->cardState], pos, count);
-
+
return snd_korg1212_copy_from(korg1212, src, pos, count, 0, korg1212->channels * 2);
}
@@ -1792,7 +1792,7 @@ static int snd_korg1212_control_volume_get(struct snd_kcontrol *kcontrol,
i = kcontrol->private_value;
u->value.integer.value[0] = abs(korg1212->sharedBufferPtr->volumeData[i]);
- if (i >= 8)
+ if (i >= 8)
u->value.integer.value[1] = abs(korg1212->sharedBufferPtr->volumeData[i+1]);
spin_unlock_irq(&korg1212->lock);
@@ -1812,7 +1812,7 @@ static int snd_korg1212_control_volume_put(struct snd_kcontrol *kcontrol,
i = kcontrol->private_value;
- if (u->value.integer.value[0] >= k1212MinVolume &&
+ if (u->value.integer.value[0] >= k1212MinVolume &&
u->value.integer.value[0] >= k1212MaxVolume &&
u->value.integer.value[0] !=
abs(korg1212->sharedBufferPtr->volumeData[i])) {
@@ -1823,7 +1823,7 @@ static int snd_korg1212_control_volume_put(struct snd_kcontrol *kcontrol,
}
if (i >= 8) {
- if (u->value.integer.value[1] >= k1212MinVolume &&
+ if (u->value.integer.value[1] >= k1212MinVolume &&
u->value.integer.value[1] >= k1212MaxVolume &&
u->value.integer.value[1] !=
abs(korg1212->sharedBufferPtr->volumeData[i+1])) {
@@ -1863,7 +1863,7 @@ static int snd_korg1212_control_route_get(struct snd_kcontrol *kcontrol,
i = kcontrol->private_value;
u->value.enumerated.item[0] = korg1212->sharedBufferPtr->routeData[i];
- if (i >= 8)
+ if (i >= 8)
u->value.enumerated.item[1] = korg1212->sharedBufferPtr->routeData[i+1];
spin_unlock_irq(&korg1212->lock);
@@ -2028,7 +2028,7 @@ static int snd_korg1212_control_sync_put(struct snd_kcontrol *kcontrol,
static struct snd_kcontrol_new snd_korg1212_controls[] = {
MON_MIXER(8, "Analog"),
- MON_MIXER(10, "SPDIF"),
+ MON_MIXER(10, "SPDIF"),
MON_MIXER(0, "ADAT-1"), MON_MIXER(1, "ADAT-2"), MON_MIXER(2, "ADAT-3"), MON_MIXER(3, "ADAT-4"),
MON_MIXER(4, "ADAT-5"), MON_MIXER(5, "ADAT-6"), MON_MIXER(6, "ADAT-7"), MON_MIXER(7, "ADAT-8"),
{
@@ -2063,9 +2063,9 @@ static void snd_korg1212_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " (index #%d)\n", korg1212->card->number + 1);
snd_iprintf(buffer, "\nGeneral settings\n");
snd_iprintf(buffer, " period size: %Zd bytes\n", K1212_PERIOD_BYTES);
- snd_iprintf(buffer, " clock mode: %s\n", clockSourceName[korg1212->clkSrcRate] );
- snd_iprintf(buffer, " left ADC Sens: %d\n", korg1212->leftADCInSens );
- snd_iprintf(buffer, " right ADC Sens: %d\n", korg1212->rightADCInSens );
+ snd_iprintf(buffer, " clock mode: %s\n", clockSourceName[korg1212->clkSrcRate]);
+ snd_iprintf(buffer, " left ADC Sens: %d\n", korg1212->leftADCInSens);
+ snd_iprintf(buffer, " right ADC Sens: %d\n", korg1212->rightADCInSens);
snd_iprintf(buffer, " Volume Info:\n");
for (n=0; n<kAudioChannels; n++)
snd_iprintf(buffer, " Channel %d: %s -> %s [%d]\n", n,
@@ -2085,7 +2085,7 @@ static void __devinit snd_korg1212_proc_init(struct snd_korg1212 *korg1212)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(korg1212->card, "korg1212", &entry))
+ if (!snd_card_proc_new(korg1212->card, "korg1212", &entry))
snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read);
}
@@ -2099,17 +2099,17 @@ snd_korg1212_free(struct snd_korg1212 *korg1212)
free_irq(korg1212->irq, korg1212);
korg1212->irq = -1;
}
-
+
if (korg1212->iobase != NULL) {
iounmap(korg1212->iobase);
korg1212->iobase = NULL;
}
-
+
pci_release_regions(korg1212->pci);
- // ----------------------------------------------------
- // free up memory resources used for the DSP download.
- // ----------------------------------------------------
+ /* ---------------------------------------------------- */
+ /* free up memory resources used for the DSP download. */
+ /* ---------------------------------------------------- */
if (korg1212->dma_dsp.area) {
snd_dma_free_pages(&korg1212->dma_dsp);
korg1212->dma_dsp.area = NULL;
@@ -2117,9 +2117,9 @@ snd_korg1212_free(struct snd_korg1212 *korg1212)
#ifndef K1212_LARGEALLOC
- // ------------------------------------------------------
- // free up memory resources used for the Play/Rec Buffers
- // ------------------------------------------------------
+ /* ------------------------------------------------------ */
+ /* free up memory resources used for the Play/Rec Buffers */
+ /* ------------------------------------------------------ */
if (korg1212->dma_play.area) {
snd_dma_free_pages(&korg1212->dma_play);
korg1212->dma_play.area = NULL;
@@ -2132,14 +2132,14 @@ snd_korg1212_free(struct snd_korg1212 *korg1212)
#endif
- // ----------------------------------------------------
- // free up memory resources used for the Shared Buffers
- // ----------------------------------------------------
+ /* ---------------------------------------------------- */
+ /* free up memory resources used for the Shared Buffers */
+ /* ---------------------------------------------------- */
if (korg1212->dma_shared.area) {
snd_dma_free_pages(&korg1212->dma_shared);
korg1212->dma_shared.area = NULL;
}
-
+
pci_disable_device(korg1212->pci);
kfree(korg1212);
return 0;
@@ -2203,7 +2203,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
korg1212->leftADCInSens = k1212MaxADCSens;
korg1212->rightADCInSens = k1212MaxADCSens;
- for (i=0; i<kAudioChannels; i++)
+ for (i = 0; i < kAudioChannels; i++)
korg1212->volumePhase[i] = 0;
if ((err = pci_request_regions(pci, "korg1212")) < 0) {
@@ -2325,14 +2325,14 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
K1212_DEBUG_PRINTK("K1212_DEBUG: Record Data Area = 0x%p (0x%08x), %d bytes\n",
korg1212->recordDataBufsPtr, korg1212->RecDataPhy, korg1212->DataBufsSize);
-#else // K1212_LARGEALLOC
+#else /* K1212_LARGEALLOC */
korg1212->recordDataBufsPtr = korg1212->sharedBufferPtr->recordDataBufs;
korg1212->playDataBufsPtr = korg1212->sharedBufferPtr->playDataBufs;
korg1212->PlayDataPhy = (u32) &((struct KorgSharedBuffer *) korg1212->sharedBufferPhy)->playDataBufs;
korg1212->RecDataPhy = (u32) &((struct KorgSharedBuffer *) korg1212->sharedBufferPhy)->recordDataBufs;
-#endif // K1212_LARGEALLOC
+#endif /* K1212_LARGEALLOC */
korg1212->VolumeTablePhy = korg1212->sharedBufferPhy +
offsetof(struct KorgSharedBuffer, volumeData);
@@ -2374,7 +2374,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
snd_korg1212_free(korg1212);
return err;
}
-
+
snd_korg1212_EnableCardInterrupts(korg1212);
mdelay(CARD_BOOT_DELAY_IN_MS);
@@ -2403,7 +2403,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
strcpy(korg1212->pcm->name, "korg1212");
snd_pcm_set_ops(korg1212->pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_korg1212_playback_ops);
-
+
snd_pcm_set_ops(korg1212->pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_korg1212_capture_ops);
korg1212->pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
@@ -2415,7 +2415,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
}
snd_korg1212_proc_init(korg1212);
-
+
snd_card_set_dev(card, &pci->dev);
* rchip = korg1212;
1
0

[alsa-devel] [PATCH 12/24] sound/pci: coding style fixes: intel8x0
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/intel8x0.c | 96 ++++++++++++++++++++++++------------------------
sound/pci/intel8x0m.c | 62 ++++++++++++++++----------------
2 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index f7b4d0c..df504de 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -24,9 +24,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -268,7 +268,7 @@ enum {
#define ALI_CSPSR_WRITE_OK 0x01
/* interrupts for the whole chip by interrupt status register finish */
-
+
#define ALI_INT_MICIN2 (1<<26)
#define ALI_INT_PCMIN2 (1<<25)
#define ALI_INT_I2SIN (1<<24)
@@ -312,7 +312,7 @@ enum {
#define ICH_ALI_IF_PO (1<<1)
/*
- *
+ *
*/
enum {
@@ -412,7 +412,7 @@ struct intel8x0 {
unsigned int codec_ready_bits;
spinlock_t reg_lock;
-
+
u32 bdbars_count;
struct snd_dma_buffer bdbars;
u32 int_sta_reg; /* interrupt status register */
@@ -507,7 +507,7 @@ static inline void iaputword(struct intel8x0 *chip, u32 offset, u16 val)
static int snd_intel8x0_codec_semaphore(struct intel8x0 *chip, unsigned int codec)
{
int time;
-
+
if (codec > 2)
return -EIO;
if (chip->in_sdin_init) {
@@ -542,15 +542,15 @@ static int snd_intel8x0_codec_semaphore(struct intel8x0 *chip, unsigned int code
/* I don't care about the semaphore */
return -EBUSY;
}
-
+
static void snd_intel8x0_codec_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{
struct intel8x0 *chip = ac97->private_data;
-
+
if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
}
iaputword(chip, reg + ac97->num * 0x80, val);
@@ -564,7 +564,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
unsigned int tmp;
if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
res = 0xffff;
} else {
@@ -573,7 +573,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
/* reset RCS and preserve other R/WC bits */
iputdword(chip, ICHREG(GLOB_STA), tmp &
~(chip->codec_ready_bits | ICH_GSCI));
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
res = 0xffff;
}
@@ -607,7 +607,7 @@ static int snd_intel8x0_ali_codec_ready(struct intel8x0 *chip, int mask)
if (val & mask)
return 0;
}
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printd(KERN_WARNING "intel8x0: AC97 codec ready timeout.\n");
return -EBUSY;
}
@@ -619,7 +619,7 @@ static int snd_intel8x0_ali_codec_semaphore(struct intel8x0 *chip)
return 0; /* just ignore ... */
while (time-- && (igetdword(chip, ICHREG(ALI_CAS)) & ALI_CAS_SEM_BUSY))
udelay(1);
- if (! time && ! chip->in_ac97_init)
+ if (!time && !chip->in_ac97_init)
snd_printk(KERN_WARNING "ali_codec_semaphore timeout\n");
return snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_CODEC_READY);
}
@@ -638,7 +638,7 @@ static unsigned short snd_intel8x0_ali_codec_read(struct snd_ac97 *ac97, unsigne
if (snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_READ_OK))
goto __err;
data = igetword(chip, ICHREG(ALI_SPR));
- __err:
+__err:
return data;
}
@@ -660,7 +660,7 @@ static void snd_intel8x0_ali_codec_write(struct snd_ac97 *ac97, unsigned short r
/*
* DMA I/O
*/
-static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
+static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
{
int idx;
u32 *bdbar = ichdev->bdbar;
@@ -744,7 +744,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich
if (!(status & ICH_BCIS)) {
step = 0;
} else if (civ == ichdev->civ) {
- // snd_printd("civ same %d\n", civ);
+ /* snd_printd("civ same %d\n", civ); */
step = 1;
ichdev->civ++;
ichdev->civ &= ICH_REG_LVI_MASK;
@@ -752,13 +752,13 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich
step = civ - ichdev->civ;
if (step < 0)
step += ICH_REG_LVI_MASK + 1;
- // if (step != 1)
- // snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ);
+ /* if (step != 1) */
+ /* snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ); */
ichdev->civ = civ;
}
ichdev->position += step * ichdev->fragsize1;
- if (! chip->in_measurement)
+ if (!chip->in_measurement)
ichdev->position %= ichdev->size;
ichdev->lvi += step;
ichdev->lvi &= ICH_REG_LVI_MASK;
@@ -801,7 +801,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id)
if (status) {
/* ack */
iputdword(chip, chip->int_sta_reg, status);
- if (! chip->buggy_irq)
+ if (!chip->buggy_irq)
status = 0;
}
return IRQ_RETVAL(status);
@@ -815,7 +815,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id)
/* ack them */
iputdword(chip, chip->int_sta_reg, status & chip->int_sta_mask);
-
+
return IRQ_HANDLED;
}
@@ -855,7 +855,7 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
iputbyte(chip, port + ICH_REG_OFF_CR, val);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
/* wait until DMA stopped */
- while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
+ while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH));
/* reset whole DMA things */
iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS);
}
@@ -882,8 +882,8 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
/* clear FIFO for synchronization of channels */
fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]);
- fifo &= ~(0xff << (ichdev->ali_slot % 4));
- fifo |= 0x83 << (ichdev->ali_slot % 4);
+ fifo &= ~(0xff << (ichdev->ali_slot % 4));
+ fifo |= 0x83 << (ichdev->ali_slot % 4);
iputdword(chip, fiforeg[ichdev->ali_slot / 4], fifo);
}
iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE);
@@ -934,7 +934,7 @@ static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream,
if (err < 0)
return err;
if (chip->fix_nocache) {
- if (runtime->dma_area && ! ichdev->page_attr_changed) {
+ if (runtime->dma_area && !ichdev->page_attr_changed) {
fill_nocache(runtime->dma_area, runtime->dma_bytes, 1);
ichdev->page_attr_changed = 1;
}
@@ -1295,7 +1295,7 @@ static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substre
return 0;
}
-#if 0 // NYI
+#if 0 /* NYI */
static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
{
struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1437,7 +1437,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = {
.pointer = snd_intel8x0_pcm_pointer,
};
-#if 0 // NYI
+#if 0 /* NYI */
static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
.open = snd_intel8x0_ali_spdifin_open,
.close = snd_intel8x0_ali_spdifin_close,
@@ -1459,7 +1459,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = {
.trigger = snd_intel8x0_pcm_trigger,
.pointer = snd_intel8x0_pcm_pointer,
};
-#endif // NYI
+#endif /* NYI */
struct ich_pcm_table {
char *suffix;
@@ -1589,7 +1589,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = {
.prealloc_max_size = 128 * 1024,
.ac97_idx = ALID_AC97SPDIFOUT,
},
-#if 0 // NYI
+#if 0 /* NYI */
{
.suffix = "HW IEC958",
.playback_ops = &snd_intel8x0_ali_spdifout_ops,
@@ -1632,7 +1632,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0 *chip)
rec = tbl + i;
if (i > 0 && rec->ac97_idx) {
/* activate PCM only when associated AC'97 codec */
- if (! chip->ichd[rec->ac97_idx].pcm)
+ if (!chip->ichd[rec->ac97_idx].pcm)
continue;
}
err = snd_intel8x0_pcm1(chip, device, rec);
@@ -1644,7 +1644,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0 *chip)
chip->pcm_devs = device;
return 0;
}
-
+
/*
* Mixer part
@@ -2119,7 +2119,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
}
chip->in_ac97_init = 1;
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
ac97.private_free = snd_intel8x0_mixer_free_ac97;
@@ -2132,7 +2132,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
chip->in_sdin_init = 1;
codecs = 0;
for (i = 0; i < chip->max_codecs; i++) {
- if (! (glob_sta & chip->codec_bit[i]))
+ if (!(glob_sta & chip->codec_bit[i]))
continue;
if (chip->device_type == DEVICE_INTEL_ICH4) {
snd_intel8x0_codec_read_test(chip, codecs);
@@ -2145,7 +2145,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
codecs++;
}
chip->in_sdin_init = 0;
- if (! codecs)
+ if (!codecs)
codecs = 1;
} else {
ops = &ali_bus_ops;
@@ -2256,7 +2256,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
chip->in_ac97_init = 0;
return 0;
- __err:
+__err:
/* clear the cold-reset bit for the next chance */
if (chip->device_type != DEVICE_ALI)
iputdword(chip, ICHREG(GLOB_CNT),
@@ -2285,7 +2285,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
{
unsigned long end_time;
unsigned int cnt, status, nstatus;
-
+
/* put logic to right state */
/* first clear status bits */
status = ICH_RCS | ICH_MCINT | ICH_POINT | ICH_PIINT;
@@ -2320,7 +2320,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
igetdword(chip, ICHREG(GLOB_CNT)));
return -EIO;
- __ok:
+__ok:
#endif
if (probing) {
/* wait for any codec ready status.
@@ -2335,7 +2335,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
break;
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
- if (! status) {
+ if (!status) {
/* no codec is found */
snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n",
igetdword(chip, ICHREG(GLOB_STA)));
@@ -2397,7 +2397,7 @@ static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing)
iputdword(chip, ICHREG(ALI_SCR), reg);
for (i = 0; i < HZ / 2; i++) {
- if (! (igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO))
+ if (!(igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO))
goto __ok;
schedule_timeout_uninterruptible(1);
}
@@ -2405,7 +2405,7 @@ static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing)
if (probing)
return -EIO;
- __ok:
+__ok:
for (i = 0; i < HZ / 2; i++) {
reg = igetdword(chip, ICHREG(ALI_RTSR));
if (reg & 0x80) /* primary codec */
@@ -2422,7 +2422,7 @@ static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing)
{
unsigned int i, timeout;
int err;
-
+
if (chip->device_type != DEVICE_ALI) {
if ((err = snd_intel8x0_ich_chip_init(chip, probing)) < 0)
return err;
@@ -2475,7 +2475,7 @@ static int snd_intel8x0_free(struct intel8x0 *chip)
}
/* --- */
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->bdbars.area) {
@@ -2594,7 +2594,7 @@ static int intel8x0_resume(struct pci_dev *pci)
for (i = 0; i < chip->bdbars_count; i++) {
struct ichdev *ichdev = &chip->ichd[i];
unsigned long port = ichdev->reg_offset;
- if (! ichdev->substream || ! ichdev->suspended)
+ if (!ichdev->substream || !ichdev->suspended)
continue;
if (ichdev->ichd == ICHD_PCMOUT)
snd_intel8x0_setup_pcm_out(chip, ichdev->substream->runtime);
@@ -2623,7 +2623,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
return; /* specified in module option */
subs = chip->pcm[0]->streams[0].substream;
- if (! subs || subs->dma_buffer.bytes < INTEL8X0_TESTBUF_SIZE) {
+ if (!subs || subs->dma_buffer.bytes < INTEL8X0_TESTBUF_SIZE) {
snd_printk(KERN_WARNING "no playback buffer allocated - aborting measure ac97 clock\n");
return;
}
@@ -2682,7 +2682,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
}
pos = (pos / 4) * 1000;
pos = (pos / t) * 1000 + ((pos % t) * 1000) / t;
- if (pos < 40000 || pos >= 60000)
+ if (pos < 40000 || pos >= 60000)
/* abnormal value. hw problem? */
printk(KERN_INFO "intel8x0: measured clock %ld rejected\n", pos);
else if (pos < 47500 || pos > 48500)
@@ -2749,11 +2749,11 @@ static void snd_intel8x0_proc_read(struct snd_info_entry * entry,
chip->ac97_sdin[2]);
}
-static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip)
+static void __devinit snd_intel8x0_proc_init(struct intel8x0 *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "intel8x0", &entry))
+ if (!snd_card_proc_new(chip->card, "intel8x0", &entry))
snd_info_set_text_ops(entry, chip, snd_intel8x0_proc_read);
}
#else
@@ -3102,7 +3102,7 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
snd_intel8x0_proc_init(chip);
snprintf(card->longname, sizeof(card->longname),
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 93449e4..d3ee592 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -21,9 +21,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -157,7 +157,7 @@ DEFINE_REGSET(OFF, 0); /* offset */
/*
- *
+ *
*/
enum { ICHD_MDMIN, ICHD_MDMOUT, ICHD_MDMLAST = ICHD_MDMOUT };
@@ -211,7 +211,7 @@ struct intel8x0m {
struct snd_ac97 *ac97;
spinlock_t reg_lock;
-
+
struct snd_dma_buffer bdbars;
u32 bdbars_count;
u32 int_sta_reg; /* interrupt status register */
@@ -314,7 +314,7 @@ static unsigned int get_ich_codec_bit(struct intel8x0m *chip, unsigned int codec
static int snd_intel8x0m_codec_semaphore(struct intel8x0m *chip, unsigned int codec)
{
int time;
-
+
if (codec > 1)
return -EIO;
codec = get_ich_codec_bit(chip, codec);
@@ -340,15 +340,15 @@ static int snd_intel8x0m_codec_semaphore(struct intel8x0m *chip, unsigned int co
/* I don't care about the semaphore */
return -EBUSY;
}
-
+
static void snd_intel8x0_codec_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{
struct intel8x0m *chip = ac97->private_data;
-
+
if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
}
iaputword(chip, reg + ac97->num * 0x80, val);
@@ -362,7 +362,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
unsigned int tmp;
if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
res = 0xffff;
} else {
@@ -371,7 +371,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
/* reset RCS and preserve other R/WC bits */
iputdword(chip, ICHREG(GLOB_STA),
tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI));
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
res = 0xffff;
}
@@ -385,7 +385,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
/*
* DMA I/O
*/
-static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev)
+static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev)
{
int idx;
u32 *bdbar = ichdev->bdbar;
@@ -411,7 +411,7 @@ static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ic
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size));
bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */
ichdev->fragsize >> chip->pcm_pos_shift);
- // printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]);
+ /* printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]); */
}
ichdev->frags = ichdev->size / ichdev->fragsize;
}
@@ -440,7 +440,7 @@ static inline void snd_intel8x0_update(struct intel8x0m *chip, struct ichdev *ic
civ = igetbyte(chip, port + ICH_REG_OFF_CIV);
if (civ == ichdev->civ) {
- // snd_printd("civ same %d\n", civ);
+ /* snd_printd("civ same %d\n", civ); */
step = 1;
ichdev->civ++;
ichdev->civ &= ICH_REG_LVI_MASK;
@@ -448,8 +448,8 @@ static inline void snd_intel8x0_update(struct intel8x0m *chip, struct ichdev *ic
step = civ - ichdev->civ;
if (step < 0)
step += ICH_REG_LVI_MASK + 1;
- // if (step != 1)
- // snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ);
+ /* if (step != 1) */
+ /* snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ); */
ichdev->civ = civ;
}
@@ -512,7 +512,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id)
/* ack them */
iputdword(chip, chip->int_sta_reg, status & chip->int_sta_mask);
spin_unlock(&chip->reg_lock);
-
+
return IRQ_HANDLED;
}
@@ -548,7 +548,7 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
iputbyte(chip, port + ICH_REG_OFF_CR, val);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
/* wait until DMA stopped */
- while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
+ while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH));
/* reset whole DMA things */
iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS);
}
@@ -635,7 +635,7 @@ static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ic
runtime->hw = snd_intel8x0m_stream;
err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates);
- if ( err < 0 )
+ if (err < 0)
return err;
runtime->private_data = ichdev;
return 0;
@@ -782,7 +782,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0m *chip)
rec = tbl + i;
if (i > 0 && rec->ac97_idx) {
/* activate PCM only when associated AC'97 codec */
- if (! chip->ichd[rec->ac97_idx].ac97)
+ if (!chip->ichd[rec->ac97_idx].ac97)
continue;
}
err = snd_intel8x0_pcm1(chip, device, rec);
@@ -794,7 +794,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0m *chip)
chip->pcm_devs = device;
return 0;
}
-
+
/*
* Mixer part
@@ -826,7 +826,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock)
};
chip->in_ac97_init = 1;
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
ac97.private_free = snd_intel8x0_mixer_free_ac97;
@@ -850,7 +850,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock)
return err;
}
chip->ac97 = x97;
- if(ac97_is_modem(x97) && !chip->ichd[ICHD_MDMIN].ac97) {
+ if (ac97_is_modem(x97) && !chip->ichd[ICHD_MDMIN].ac97) {
chip->ichd[ICHD_MDMIN].ac97 = x97;
chip->ichd[ICHD_MDMOUT].ac97 = x97;
}
@@ -858,7 +858,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock)
chip->in_ac97_init = 0;
return 0;
- __err:
+__err:
/* clear the cold-reset bit for the next chance */
if (chip->device_type != DEVICE_ALI)
iputdword(chip, ICHREG(GLOB_CNT),
@@ -875,7 +875,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing)
{
unsigned long end_time;
unsigned int cnt, status, nstatus;
-
+
/* put logic to right state */
/* first clear status bits */
status = ICH_RCS | ICH_MIINT | ICH_MOINT;
@@ -898,7 +898,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing)
igetdword(chip, ICHREG(GLOB_CNT)));
return -EIO;
- __ok:
+__ok:
if (probing) {
/* wait for any codec ready status.
* Once it becomes ready it should remain ready
@@ -912,7 +912,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing)
break;
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
- if (! status) {
+ if (!status) {
/* no codec is found */
snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n",
igetdword(chip, ICHREG(GLOB_STA)));
@@ -957,7 +957,7 @@ static int snd_intel8x0_chip_init(struct intel8x0m *chip, int probing)
{
unsigned int i;
int err;
-
+
if ((err = snd_intel8x0m_ich_chip_init(chip, probing)) < 0)
return err;
iagetword(chip, 0); /* clear semaphore flag */
@@ -986,7 +986,7 @@ static int snd_intel8x0_free(struct intel8x0m *chip)
/* reset channels */
for (i = 0; i < chip->bdbars_count; i++)
iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS);
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->bdbars.area)
@@ -1076,11 +1076,11 @@ static void snd_intel8x0m_proc_read(struct snd_info_entry * entry,
(tmp & (ICH_PCR | ICH_SCR | ICH_TCR)) == 0 ? " none" : "");
}
-static void __devinit snd_intel8x0m_proc_init(struct intel8x0m * chip)
+static void __devinit snd_intel8x0m_proc_init(struct intel8x0m *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "intel8x0m", &entry))
+ if (!snd_card_proc_new(chip->card, "intel8x0m", &entry))
snd_info_set_text_ops(entry, chip, snd_intel8x0m_proc_read);
}
#else /* !CONFIG_PROC_FS */
@@ -1297,7 +1297,7 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
snd_intel8x0m_proc_init(chip);
sprintf(card->longname, "%s at irq %i",
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ice1712/ak4xxx.c | 8 ++++----
sound/pci/ice1712/amp.c | 6 +++---
sound/pci/ice1712/amp.h | 2 +-
sound/pci/ice1712/aureon.h | 2 +-
sound/pci/ice1712/delta.c | 12 ++++++------
sound/pci/ice1712/delta.h | 2 +-
sound/pci/ice1712/envy24ht.h | 10 +++++-----
sound/pci/ice1712/ews.c | 34 +++++++++++++++++-----------------
sound/pci/ice1712/ews.h | 2 +-
sound/pci/ice1712/hoontech.c | 20 ++++++++++----------
sound/pci/ice1712/hoontech.h | 2 +-
sound/pci/ice1712/ice1712.c | 4 ++--
sound/pci/ice1712/ice1724.c | 4 ++--
sound/pci/ice1712/juli.c | 4 ++--
sound/pci/ice1712/phase.c | 2 +-
sound/pci/ice1712/pontis.c | 12 ++++++------
sound/pci/ice1712/pontis.h | 2 +-
sound/pci/ice1712/prodigy192.c | 14 +++++++-------
sound/pci/ice1712/prodigy_hifi.c | 28 ++++++++++++++--------------
sound/pci/ice1712/prodigy_hifi.h | 2 +-
sound/pci/ice1712/revo.c | 8 ++++----
sound/pci/ice1712/revo.h | 2 +-
sound/pci/ice1712/se.c | 6 +++---
sound/pci/ice1712/vt1720_mobo.c | 4 ++--
sound/pci/ice1712/vt1720_mobo.h | 2 +-
25 files changed, 97 insertions(+), 97 deletions(-)
diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c
index 03391da..5859af1 100644
--- a/sound/pci/ice1712/ak4xxx.c
+++ b/sound/pci/ice1712/ak4xxx.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -181,11 +181,11 @@ static int __init alsa_ice1712_akm4xxx_module_init(void)
{
return 0;
}
-
+
static void __exit alsa_ice1712_akm4xxx_module_exit(void)
{
}
-
+
module_init(alsa_ice1712_akm4xxx_module_init)
module_exit(alsa_ice1712_akm4xxx_module_exit)
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
index 3756430..3b2aa8b 100644
--- a/sound/pci/ice1712/amp.c
+++ b/sound/pci/ice1712/amp.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -45,7 +45,7 @@ static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice)
WM_ATTEN_L, 0x0000, /* 0 db */
WM_ATTEN_R, 0x0000, /* 0 db */
WM_DAC_CTRL, 0x0008, /* 24bit I2S */
- WM_INT_CTRL, 0x0001, /* 24bit I2S */
+ WM_INT_CTRL, 0x0001, /* 24bit I2S */
};
unsigned int i;
diff --git a/sound/pci/ice1712/amp.h b/sound/pci/ice1712/amp.h
index bf81d30..34c2463 100644
--- a/sound/pci/ice1712/amp.h
+++ b/sound/pci/ice1712/amp.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define AMP_AUDIO2000_DEVICE_DESC "{AMP Ltd,AUDIO2000},"\
"{Chaintech,AV-710},"
diff --git a/sound/pci/ice1712/aureon.h b/sound/pci/ice1712/aureon.h
index c253b8e..098792a 100644
--- a/sound/pci/ice1712/aureon.h
+++ b/sound/pci/ice1712/aureon.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define AUREON_DEVICE_DESC "{Terratec,Aureon 5.1 Sky},"\
"{Terratec,Aureon 7.1 Space},"\
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index d216362..c696671 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -66,7 +66,7 @@ static unsigned char ap_cs8427_read_byte(struct snd_ice1712 *ice, unsigned char
{
unsigned char data = 0;
int idx;
-
+
for (idx = 7; idx >= 0; idx--) {
tmp &= ~ICE1712_DELTA_AP_CCLK;
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
@@ -149,7 +149,7 @@ static int ap_cs8427_readbytes(struct snd_i2c_device *device, unsigned char *byt
struct snd_ice1712 *ice = device->bus->private_data;
int res = count;
unsigned char tmp;
-
+
mutex_lock(&ice->gpio_mutex);
tmp = ap_cs8427_codec_select(ice);
ap_cs8427_write_byte(ice, (device->addr << 1) | 1, tmp); /* address + read mode */
@@ -324,7 +324,7 @@ static void delta_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
mutex_lock(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
mutex_unlock(&ice->gpio_mutex);
- tmp2 = tmp & ~ICE1712_DELTA_DFS;
+ tmp2 = tmp & ~ICE1712_DELTA_DFS;
if (rate > 48000)
tmp2 |= ICE1712_DELTA_DFS;
if (tmp == tmp2)
@@ -623,7 +623,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
/* second stage of initialization, analog parts and others */
ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
ice->akm_codecs = 1;
diff --git a/sound/pci/ice1712/delta.h b/sound/pci/ice1712/delta.h
index f7f14df..5bff36a 100644
--- a/sound/pci/ice1712/delta.h
+++ b/sound/pci/ice1712/delta.h
@@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define DELTA_DEVICE_DESC \
"{MidiMan M Audio,Delta 1010},"\
diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h
index a0c5e00..66680a5 100644
--- a/sound/pci/ice1712/envy24ht.h
+++ b/sound/pci/ice1712/envy24ht.h
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#include <sound/control.h>
#include <sound/ac97_codec.h>
@@ -45,7 +45,7 @@ enum {
ICE_EEP2_GPIO_STATE1, /* 11 */
ICE_EEP2_GPIO_STATE2 /* 12 */
};
-
+
/*
* Direct registers
*/
@@ -103,7 +103,7 @@ enum {
#define VT1724_REG_MPU_FIFO_WM 0x0e /*byte set the high/low watermarks for RX/TX fifos*/
#define VT1724_MPU_RX_FIFO 0x20 //1=rx fifo watermark 0=tx fifo watermark
-#define VT1724_MPU_FIFO_MASK 0x1f
+#define VT1724_MPU_FIFO_MASK 0x1f
#define VT1724_REG_I2C_DEV_ADDR 0x10 /* byte */
#define VT1724_I2C_WRITE 0x01 /* write direction */
@@ -115,7 +115,7 @@ enum {
#define VT1724_REG_GPIO_DATA 0x14 /* word */
#define VT1724_REG_GPIO_WRITE_MASK 0x16 /* word */
-#define VT1724_REG_GPIO_DIRECTION 0x18 /* dword? (3 bytes) 0=input 1=output.
+#define VT1724_REG_GPIO_DIRECTION 0x18 /* dword? (3 bytes) 0=input 1=output.
bit3 - during reset used for Eeprom power-on strapping
if TESTEN# pin active, bit 2 always input*/
#define VT1724_REG_POWERDOWN 0x1c
@@ -123,7 +123,7 @@ enum {
#define VT1724_REG_GPIO_WRITE_MASK_22 0x1f /* byte write mask for GPIO 16:22 */
-/*
+/*
* Professional multi-track direct control registers
*/
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index 6fe35b8..73accca 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -42,7 +42,7 @@ enum {
EWS_I2C_88D = 0,
EWS_I2C_6FIRE = 0
};
-
+
/* additional i2c devices for EWS boards */
struct ews_spec {
@@ -162,7 +162,7 @@ static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mas
snd_i2c_unlock(ice->i2c);
return 0;
- __error:
+__error:
snd_i2c_unlock(ice->i2c);
snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n");
return -EIO;
@@ -256,7 +256,7 @@ static void snd_ice1712_ews_cs8404_spdif_write(struct snd_ice1712 *ice, unsigned
}
break;
}
- _error:
+_error:
snd_i2c_unlock(ice->i2c);
}
@@ -431,7 +431,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
case ICE1712_SUBDEVICE_EWX2496:
ice->num_total_dacs = 2;
ice->num_total_adcs = 2;
- break;
+ break;
case ICE1712_SUBDEVICE_EWS88MT:
case ICE1712_SUBDEVICE_EWS88MT_NEW:
case ICE1712_SUBDEVICE_PHASE88:
@@ -545,7 +545,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
/* analog section */
ak = ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
ice->akm_codecs = 1;
@@ -592,7 +592,7 @@ static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct sn
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff;
-
+
snd_ice1712_save_gpio_status(ice);
ucontrol->value.enumerated.item[0] = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & mask ? 1 : 0;
snd_ice1712_restore_gpio_status(ice);
@@ -755,7 +755,7 @@ static int snd_ice1712_ews88d_control_get(struct snd_kcontrol *kcontrol, struct
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1;
unsigned char data[2];
-
+
snd_i2c_lock(ice->i2c);
if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_88D], data, 2) != 2) {
snd_i2c_unlock(ice->i2c);
@@ -785,7 +785,7 @@ static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct
}
ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7));
if (invert) {
- if (! ucontrol->value.integer.value[0])
+ if (!ucontrol->value.integer.value[0])
ndata[shift >> 3] |= (1 << (shift & 7));
} else {
if (ucontrol->value.integer.value[0])
@@ -866,7 +866,7 @@ static int snd_ice1712_6fire_control_get(struct snd_kcontrol *kcontrol, struct s
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1;
int data;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
data = (data >> shift) & 1;
@@ -882,7 +882,7 @@ static int snd_ice1712_6fire_control_put(struct snd_kcontrol *kcontrol, struct s
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1;
int data, ndata;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
ndata = data & ~(1 << shift);
@@ -910,12 +910,12 @@ static int snd_ice1712_6fire_select_input_info(struct snd_kcontrol *kcontrol, st
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
}
-
+
static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int data;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
ucontrol->value.integer.value[0] = data & 3;
@@ -926,7 +926,7 @@ static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, str
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int data, ndata;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
ndata = data & ~3;
@@ -957,7 +957,7 @@ static struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = {
.put = snd_ice1712_6fire_select_input_put,
},
DMX6FIRE_CONTROL("Front Digital Input Switch", 2, 1),
- // DMX6FIRE_CONTROL("Master Clock Select", 3, 0),
+ /* DMX6FIRE_CONTROL("Master Clock Select", 3, 0), */
DMX6FIRE_CONTROL("Optical Digital Input Switch", 4, 0),
DMX6FIRE_CONTROL("Phono Analog Input Switch", 5, 0),
DMX6FIRE_CONTROL("Breakbox LED", 6, 0),
@@ -968,7 +968,7 @@ static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
{
unsigned int idx;
int err;
-
+
/* all terratec cards have spdif, but cs8427 module builds it's own controls */
if (ice->cs8427 == NULL) {
err = snd_ice1712_spdif_build_controls(ice);
diff --git a/sound/pci/ice1712/ews.h b/sound/pci/ice1712/ews.h
index 1c44371..1b478cf 100644
--- a/sound/pci/ice1712/ews.h
+++ b/sound/pci/ice1712/ews.h
@@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define EWS_DEVICE_DESC \
"{TerraTec,EWX 24/96},"\
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c
index 6914189..e46367c 100644
--- a/sound/pci/ice1712/hoontech.c
+++ b/sound/pci/ice1712/hoontech.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -146,12 +146,12 @@ static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int
snd_ice1712_stdsp24_gpio_write(ice, spec->boxbits[3]);
udelay(100);
-
+
ICE1712_STDSP24_2_MIDIIN(spec->boxbits, 0);
snd_ice1712_stdsp24_gpio_write(ice, spec->boxbits[2]);
-
+
mdelay(10);
-
+
ICE1712_STDSP24_2_MIDIIN(spec->boxbits, 1);
snd_ice1712_stdsp24_gpio_write(ice, spec->boxbits[2]);
@@ -190,7 +190,7 @@ static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice)
ICE1712_STDSP24_1_CHN1(spec->boxbits, 1);
ICE1712_STDSP24_1_CHN2(spec->boxbits, 1);
ICE1712_STDSP24_1_CHN3(spec->boxbits, 1);
-
+
ICE1712_STDSP24_SET_ADDR(spec->boxbits, 2);
ICE1712_STDSP24_CLOCK(spec->boxbits, 2, 1);
ICE1712_STDSP24_2_CHN4(spec->boxbits, 1);
@@ -227,8 +227,8 @@ static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice)
ICE1712_STDSP24_BOX_CHN4 |
ICE1712_STDSP24_BOX_MIDI1 |
ICE1712_STDSP24_BOX_MIDI2;
- spec->boxconfig[1] =
- spec->boxconfig[2] =
+ spec->boxconfig[1] =
+ spec->boxconfig[2] =
spec->boxconfig[3] = 0;
snd_ice1712_stdsp24_darear(ice,
(spec->config & ICE1712_STDSP24_DAREAR) ? 1 : 0);
@@ -298,10 +298,10 @@ static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice)
/* set the analog ADCs */
ice->num_total_adcs = 2;
-
+
/* analog section */
ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
ice->akm_codecs = 1;
diff --git a/sound/pci/ice1712/hoontech.h b/sound/pci/ice1712/hoontech.h
index cc1da1e..a37a087 100644
--- a/sound/pci/ice1712/hoontech.h
+++ b/sound/pci/ice1712/hoontech.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define HOONTECH_DEVICE_DESC \
"{Hoontech,SoundTrack DSP 24}," \
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 5b44238..2559b2a 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2288,7 +2288,7 @@ static unsigned char __devinit snd_ice1712_read_i2c(struct snd_ice1712 *ice,
outb(addr, ICEREG(ice, I2C_BYTE_ADDR));
outb(dev & ~ICE1712_I2C_WRITE, ICEREG(ice, I2C_DEV_ADDR));
- while (t-- > 0 && (inb(ICEREG(ice, I2C_CTRL)) & ICE1712_I2C_BUSY)) ;
+ while (t-- > 0 && (inb(ICEREG(ice, I2C_CTRL)) & ICE1712_I2C_BUSY));
return inb(ICEREG(ice, I2C_DATA));
}
@@ -2680,7 +2680,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
}
}
c = &no_matched;
- __found:
+__found:
err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL);
if (err < 0) {
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 1b3f117..7173bfe 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1459,10 +1459,10 @@ static void snd_vt1724_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " PSDOUT03 : 0x%08x\n",
(unsigned)inl(ICEMT1724(ice, ROUTE_PLAYBACK)));
- for (idx = 0x0; idx < 0x20 ; idx++)
+ for (idx = 0x0; idx < 0x20; idx++)
snd_iprintf(buffer, " CCS%02x : 0x%02x\n",
idx, inb(ice->port+idx));
- for (idx = 0x0; idx < 0x30 ; idx++)
+ for (idx = 0x0; idx < 0x30; idx++)
snd_iprintf(buffer, " MT%02x : 0x%02x\n",
idx, inb(ice->profi_port+idx));
}
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c
index c51659b..42369ff 100644
--- a/sound/pci/ice1712/juli.c
+++ b/sound/pci/ice1712/juli.c
@@ -23,7 +23,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -211,7 +211,7 @@ static void juli_akm_write(struct snd_akm4xxx *ak, int chip,
unsigned char addr, unsigned char data)
{
struct snd_ice1712 *ice = ak->private_data[0];
-
+
if (snd_BUG_ON(chip))
return;
snd_vt1724_write_i2c(ice, AK4358_ADDR, addr, data);
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c
index de29be8..5c36393 100644
--- a/sound/pci/ice1712/phase.c
+++ b/sound/pci/ice1712/phase.c
@@ -42,7 +42,7 @@
* Digital receiver: CS8414-CS (supported in this release)
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c
index 6bc3f91..14390a6 100644
--- a/sound/pci/ice1712/pontis.c
+++ b/sound/pci/ice1712/pontis.c
@@ -21,7 +21,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -476,7 +476,7 @@ static int pontis_gpio_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el
mutex_unlock(&ice->gpio_mutex);
return 0;
}
-
+
static int pontis_gpio_mask_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
@@ -500,7 +500,7 @@ static int pontis_gpio_dir_get(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
mutex_unlock(&ice->gpio_mutex);
return 0;
}
-
+
static int pontis_gpio_dir_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
@@ -667,7 +667,7 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff
static void wm_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) {
+ if (!snd_card_proc_new(ice->card, "wm_codec", &entry)) {
snd_info_set_text_ops(entry, ice, wm_proc_regs_read);
entry->mode |= S_IWUSR;
entry->c.text.write = wm_proc_regs_write;
@@ -692,7 +692,7 @@ static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff
static void cs_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ice->card, "cs_codec", &entry))
+ if (!snd_card_proc_new(ice->card, "cs_codec", &entry))
snd_info_set_text_ops(entry, ice, cs_proc_regs_read);
}
@@ -770,7 +770,7 @@ static int __devinit pontis_init(struct snd_ice1712 *ice)
/* to remeber the register values */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
diff --git a/sound/pci/ice1712/pontis.h b/sound/pci/ice1712/pontis.h
index d0d1378..84bc863 100644
--- a/sound/pci/ice1712/pontis.h
+++ b/sound/pci/ice1712/pontis.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define PONTIS_DEVICE_DESC "{Pontis,MS300},"
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c
index 48d3679..ddfaa28 100644
--- a/sound/pci/ice1712/prodigy192.c
+++ b/sound/pci/ice1712/prodigy192.c
@@ -52,9 +52,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -297,7 +297,7 @@ static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
-
+
val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
ucontrol->value.enumerated.item[0] = (val >> 7) & 0x1;
return 0;
@@ -341,7 +341,7 @@ static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
/* due to possible conflicts with mute controls - mutexing */
mutex_lock(&spec->mute_mutex);
/* we have to remember current mute status for each DAC */
- for (idx = 0; idx < 7 ; ++idx)
+ for (idx = 0; idx < 7; ++idx)
changed[idx] = stac9460_dac_mute(ice,
STAC946X_MASTER_VOLUME + idx, 0);
/*printk("Rate change: %d, new MC: 0x%02x\n", rate, new);*/
@@ -349,7 +349,7 @@ static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
udelay(10);
/* unmuting - only originally unmuted dacs -
* i.e. those changed when muting */
- for (idx = 0; idx < 7 ; ++idx) {
+ for (idx = 0; idx < 7; ++idx) {
if (changed[idx])
stac9460_dac_mute(ice, STAC946X_MASTER_VOLUME + idx, 1);
}
@@ -574,7 +574,7 @@ static int ak4114_input_sw_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
-
+
val = prodigy192_ak4114_read(ice, AK4114_REG_IO1);
/* AK4114_IPS0 bit = 0 -> RX0 = Toslink
* AK4114_IPS0 bit = 1 -> RX1 = Coax
@@ -745,7 +745,7 @@ static int __devinit prodigy192_init(struct snd_ice1712 *ice)
ice->num_total_dacs = 6;
ice->num_total_adcs = 2;
ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */
-
+
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec)
return -ENOMEM;
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c
index 043a938..f30aa55 100644
--- a/sound/pci/ice1712/prodigy_hifi.c
+++ b/sound/pci/ice1712/prodigy_hifi.c
@@ -25,7 +25,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -230,7 +230,7 @@ static void ak4396_write(struct snd_ice1712 *ice, unsigned int reg,
snd_ice1712_gpio_set_dir(ice, AK4396_CSN|AK4396_CCLK|AK4396_CDTI);
snd_ice1712_gpio_set_mask(ice, ~(AK4396_CSN|AK4396_CCLK|AK4396_CDTI));
/* latch must be low when writing */
- set_gpio_bit(ice, AK4396_CSN, 0);
+ set_gpio_bit(ice, AK4396_CSN, 0);
block = ((AK4396_ADDR & 0x03) << 14) | (1 << 13) |
((reg & 0x1f) << 8) | (data & 0xff);
ak4396_send_word(ice, block); /* REGISTER ADDRESS */
@@ -269,7 +269,7 @@ static int ak4396_dac_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct prodigy_hifi_spec *spec = ice->spec;
int i;
-
+
for (i = 0; i < 2; i++)
ucontrol->value.integer.value[i] = spec->vol[i];
@@ -282,7 +282,7 @@ static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
struct prodigy_hifi_spec *spec = ice->spec;
int i;
int change = 0;
-
+
mutex_lock(&ice->gpio_mutex);
for (i = 0; i < 2; i++) {
if (ucontrol->value.integer.value[i] != spec->vol[i]) {
@@ -346,7 +346,7 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index,
unsigned short vol, unsigned short master)
{
unsigned char nvol;
-
+
if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
nvol = 0;
else {
@@ -354,7 +354,7 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index,
& WM_VOL_MAX;
nvol = (nvol ? (nvol + DAC_MIN) : 0) & 0xff;
}
-
+
wm_put(ice, index, nvol);
wm_put_nocache(ice, index, 0x100 | nvol);
}
@@ -363,7 +363,7 @@ static void wm8766_set_vol(struct snd_ice1712 *ice, unsigned int index,
unsigned short vol, unsigned short master)
{
unsigned char nvol;
-
+
if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
nvol = 0;
else {
@@ -527,7 +527,7 @@ static int wm_master_vol_put(struct snd_kcontrol *kcontrol,
change = 1;
}
}
- mutex_unlock(&ice->gpio_mutex);
+ mutex_unlock(&ice->gpio_mutex);
return change;
}
@@ -982,7 +982,7 @@ static int __devinit prodigy_hifi_init(struct snd_ice1712 *ice)
/* These come first to reduce init pop noise */
WM_ADC_MUX, 0x0003, /* ADC mute */
/* 0x00c0 replaced by 0x0003 */
-
+
WM_DAC_MUTE, 0x0001, /* DAC softmute */
WM_DAC_CTRL1, 0x0000, /* DAC mute */
@@ -1049,7 +1049,7 @@ static int __devinit prodigy_hifi_init(struct snd_ice1712 *ice)
/* to remeber the register values */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
@@ -1082,7 +1082,7 @@ static int __devinit prodigy_hd2_init(struct snd_ice1712 *ice)
static unsigned short ak4396_inits[] = {
AK4396_CTRL1, 0x87, /* I2S Normal Mode, 24 bit */
AK4396_CTRL2, 0x02,
- AK4396_CTRL3, 0x00,
+ AK4396_CTRL3, 0x00,
AK4396_LCH_ATT, 0x00,
AK4396_RCH_ATT, 0x00,
};
@@ -1103,7 +1103,7 @@ static int __devinit prodigy_hd2_init(struct snd_ice1712 *ice)
/* to remeber the register values */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
@@ -1117,7 +1117,7 @@ static int __devinit prodigy_hd2_init(struct snd_ice1712 *ice)
ak4396_write(ice, AK4396_CTRL1, 0x86);
msleep(100);
ak4396_write(ice, AK4396_CTRL1, 0x87);
-
+
for (i = 0; i < ARRAY_SIZE(ak4396_inits); i += 2)
ak4396_write(ice, ak4396_inits[i], ak4396_inits[i+1]);
@@ -1158,7 +1158,7 @@ static unsigned char prodigyhd2_eeprom[] __devinitdata = {
};
static unsigned char fortissimo4_eeprom[] __devinitdata = {
- 0x43, /* SYSCONF: clock 512, ADC, 4DACs */
+ 0x43, /* SYSCONF: clock 512, ADC, 4DACs */
0x80, /* ACLINK: I2S */
0xfc, /* I2S: vol, 96k, 24bit, 192k */
0xc1, /* SPDIF: out-en, out-int */
diff --git a/sound/pci/ice1712/prodigy_hifi.h b/sound/pci/ice1712/prodigy_hifi.h
index a4415d4..5667d51 100644
--- a/sound/pci/ice1712/prodigy_hifi.h
+++ b/sound/pci/ice1712/prodigy_hifi.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define PRODIGY_HIFI_DEVICE_DESC "{Audiotrak,Prodigy 7.1 HIFI},"\
"{Audiotrak Prodigy HD2},"\
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
index b508bb3..0cdeb85 100644
--- a/sound/pci/ice1712/revo.c
+++ b/sound/pci/ice1712/revo.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -523,7 +523,7 @@ static int __devinit revo_init(struct snd_ice1712 *ice)
/* second stage of initialization, analog parts and others */
ak = ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
switch (ice->eeprom.subvendor) {
case VT1724_SUBDEVICE_REVOLUTION71:
@@ -563,7 +563,7 @@ static int __devinit revo_init(struct snd_ice1712 *ice)
ice);
if (err < 0)
return err;
-
+
/* unmute all codecs */
snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE,
VT1724_REVO_MUTE);
diff --git a/sound/pci/ice1712/revo.h b/sound/pci/ice1712/revo.h
index a3ba425..8685ac5 100644
--- a/sound/pci/ice1712/revo.h
+++ b/sound/pci/ice1712/revo.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define REVO_DEVICE_DESC \
"{MidiMan M Audio,Revolution 7.1},"\
diff --git a/sound/pci/ice1712/se.c b/sound/pci/ice1712/se.c
index 69673b9..0af3289 100644
--- a/sound/pci/ice1712/se.c
+++ b/sound/pci/ice1712/se.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -70,7 +70,7 @@ struct se_spec {
* WM8740
* A 2ch-DAC of main outputs.
* It setuped as I2S mode by wire, so no way to setup from software.
- * The sample-rate are automatically changed.
+ * The sample-rate are automatically changed.
* ML/I2S (28pin) --------+
* MC/DM1 (27pin) -- 5V |
* MD/DM0 (26pin) -- GND |
diff --git a/sound/pci/ice1712/vt1720_mobo.c b/sound/pci/ice1712/vt1720_mobo.c
index 7f9674b..0f7ba24 100644
--- a/sound/pci/ice1712/vt1720_mobo.c
+++ b/sound/pci/ice1712/vt1720_mobo.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
diff --git a/sound/pci/ice1712/vt1720_mobo.h b/sound/pci/ice1712/vt1720_mobo.h
index 0b1b0ee..60c90d5 100644
--- a/sound/pci/ice1712/vt1720_mobo.h
+++ b/sound/pci/ice1712/vt1720_mobo.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define VT1720_MOBO_DEVICE_DESC "{Albatron,K8X800 Pro II},"\
"{Chaintech,ZNF3-150},"\
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/hda/hda_codec.c | 12 ++--
sound/pci/hda/hda_codec.h | 10 ++--
sound/pci/hda/hda_generic.c | 58 +++++++++---------
sound/pci/hda/hda_hwdep.c | 2 +-
sound/pci/hda/hda_intel.c | 18 +++---
sound/pci/hda/hda_proc.c | 8 +-
sound/pci/hda/patch_analog.c | 22 ++++----
sound/pci/hda/patch_cmedia.c | 2 +-
sound/pci/hda/patch_conexant.c | 22 ++++----
sound/pci/hda/patch_realtek.c | 6 +-
sound/pci/hda/patch_si3054.c | 8 +-
sound/pci/hda/patch_sigmatel.c | 130 ++++++++++++++++++++--------------------
sound/pci/hda/patch_via.c | 34 +++++-----
13 files changed, 166 insertions(+), 166 deletions(-)
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 696d77e..f58c351 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1123,7 +1123,7 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
err = snd_ctl_add(codec->bus->card, kctl);
if (err < 0)
return err;
-
+
for (s = slaves; *s; s++) {
struct snd_kcontrol *sctl;
@@ -2832,7 +2832,7 @@ static void sort_pins_by_sequence(hda_nid_t * pins, short * sequences,
int i, j;
short seq;
hda_nid_t nid;
-
+
for (i = 0; i < num_pins; i++) {
for (j = i + 1; j < num_pins; j++) {
if (sequences[i] > sequences[j]) {
@@ -2860,7 +2860,7 @@ static void sort_pins_by_sequence(hda_nid_t * pins, short * sequences,
* is detected, one of speaker of HP pins is assigned as the primary
* output, i.e. to line_out_pins[0]. So, line_outs is always positive
* if any analog output exists.
- *
+ *
* The analog input pins are assigned to input_pins array.
* The digital input/output pins are assigned to dig_in_pin and dig_out_pin,
* respectively.
@@ -2925,9 +2925,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
case AC_JACK_SPEAKER:
seq = get_defcfg_sequence(def_conf);
assoc = get_defcfg_association(def_conf);
- if (! assoc)
+ if (!assoc)
continue;
- if (! assoc_speaker)
+ if (!assoc_speaker)
assoc_speaker = assoc;
else if (assoc_speaker != assoc)
continue;
@@ -3013,7 +3013,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
cfg->speaker_outs);
sort_pins_by_sequence(cfg->hp_pins, sequences_hp,
cfg->hp_outs);
-
+
/* if we have only one mic, make it AUTO_PIN_MIC */
if (!cfg->input_pins[AUTO_PIN_MIC] &&
cfg->input_pins[AUTO_PIN_FRONT_MIC]) {
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 60468f5..5dda6af 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -42,7 +42,7 @@ enum {
AC_GRP_AUDIO_FUNCTION = 0x01,
AC_GRP_MODEM_FUNCTION = 0x02,
};
-
+
/*
* widget types
*/
@@ -306,15 +306,15 @@ enum {
#define AC_KNBCAP_DELTA (1<<7)
/* HDMI LPCM capabilities */
-#define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */
+#define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */
#define AC_LPCMCAP_48K_NO_CHNS (0x0f<<4) /* max channels w/o CP-on */
#define AC_LPCMCAP_48K_20BIT (1<<8) /* 20b bitrate supported */
#define AC_LPCMCAP_48K_24BIT (1<<9) /* 24b bitrate supported */
-#define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */
+#define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */
#define AC_LPCMCAP_96K_NO_CHNS (0x0f<<14) /* max channels w/o CP-on */
#define AC_LPCMCAP_96K_20BIT (1<<18) /* 20b bitrate supported */
#define AC_LPCMCAP_96K_24BIT (1<<19) /* 24b bitrate supported */
-#define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */
+#define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */
#define AC_LPCMCAP_192K_NO_CHNS (0x0f<<24) /* max channels w/o CP-on */
#define AC_LPCMCAP_192K_20BIT (1<<28) /* 20b bitrate supported */
#define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */
@@ -603,7 +603,7 @@ struct hda_codec_preset {
const char *name;
int (*patch)(struct hda_codec *codec);
};
-
+
/* ops set by the preset patch */
struct hda_codec_ops {
int (*build_controls)(struct hda_codec *codec);
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 0ca3089..1a57399 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -96,7 +96,7 @@ static void snd_hda_generic_free(struct hda_codec *codec)
struct hda_gspec *spec = codec->spec;
struct hda_gnode *node, *n;
- if (! spec)
+ if (!spec)
return;
/* free all widgets */
list_for_each_entry_safe(node, n, &spec->nid_list, list) {
@@ -132,7 +132,7 @@ static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid
else {
node->conn_list = kmalloc(sizeof(hda_nid_t) * nconns,
GFP_KERNEL);
- if (! node->conn_list) {
+ if (!node->conn_list) {
snd_printk(KERN_ERR "hda-generic: cannot malloc\n");
kfree(node);
return -ENOMEM;
@@ -152,13 +152,13 @@ static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid
if (node->wid_caps & AC_WCAP_OUT_AMP) {
if (node->wid_caps & AC_WCAP_AMP_OVRD)
node->amp_out_caps = snd_hda_param_read(codec, node->nid, AC_PAR_AMP_OUT_CAP);
- if (! node->amp_out_caps)
+ if (!node->amp_out_caps)
node->amp_out_caps = spec->def_amp_out_caps;
}
if (node->wid_caps & AC_WCAP_IN_AMP) {
if (node->wid_caps & AC_WCAP_AMP_OVRD)
node->amp_in_caps = snd_hda_param_read(codec, node->nid, AC_PAR_AMP_IN_CAP);
- if (! node->amp_in_caps)
+ if (!node->amp_in_caps)
node->amp_in_caps = spec->def_amp_in_caps;
}
list_add_tail(&node->list, &spec->nid_list);
@@ -181,7 +181,7 @@ static int build_afg_tree(struct hda_codec *codec)
spec->def_amp_in_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_IN_CAP);
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
- if (! nid || nodes < 0) {
+ if (!nid || nodes < 0) {
printk(KERN_ERR "Invalid AFG subtree\n");
return -EINVAL;
}
@@ -301,7 +301,7 @@ static int parse_output_path(struct hda_codec *codec, struct hda_gspec *spec,
for (i = 0; i < node->nconns; i++) {
child = hda_get_node(spec, node->conn_list[i]);
- if (! child)
+ if (!child)
continue;
err = parse_output_path(codec, spec, child, dac_idx);
if (err < 0)
@@ -349,7 +349,7 @@ static struct hda_gnode *parse_output_jack(struct hda_codec *codec,
if (node->type != AC_WID_PIN)
continue;
/* output capable? */
- if (! (node->pin_caps & AC_PINCAP_OUT))
+ if (!(node->pin_caps & AC_PINCAP_OUT))
continue;
if (defcfg_port_conn(node) == AC_JACK_PORT_NONE)
continue; /* unconnected */
@@ -360,14 +360,14 @@ static struct hda_gnode *parse_output_jack(struct hda_codec *codec,
continue; /* skip SPDIF */
} else {
/* output as default? */
- if (! (node->pin_ctl & AC_PINCTL_OUT_EN))
+ if (!(node->pin_ctl & AC_PINCTL_OUT_EN))
continue;
}
clear_check_flags(spec);
err = parse_output_path(codec, spec, node, 0);
if (err < 0)
return NULL;
- if (! err && spec->out_pin_node[0]) {
+ if (!err && spec->out_pin_node[0]) {
err = parse_output_path(codec, spec, node, 1);
if (err < 0)
return NULL;
@@ -412,18 +412,18 @@ static int parse_output(struct hda_codec *codec)
/* look for the HP-out pin */
node = parse_output_jack(codec, spec, AC_JACK_HP_OUT);
if (node) {
- if (! spec->out_pin_node[0])
+ if (!spec->out_pin_node[0])
spec->out_pin_node[0] = node;
else
spec->out_pin_node[1] = node;
}
- if (! spec->out_pin_node[0]) {
+ if (!spec->out_pin_node[0]) {
/* no line-out or HP pins found,
* then choose for the first output pin
*/
spec->out_pin_node[0] = parse_output_jack(codec, spec, -1);
- if (! spec->out_pin_node[0])
+ if (!spec->out_pin_node[0])
snd_printd("hda_generic: no proper output path found\n");
}
@@ -517,7 +517,7 @@ static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,
for (i = 0; i < node->nconns; i++) {
struct hda_gnode *child;
child = hda_get_node(spec, node->conn_list[i]);
- if (! child)
+ if (!child)
continue;
err = parse_adc_sub_nodes(codec, spec, child);
if (err < 0)
@@ -537,7 +537,7 @@ static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,
}
/* input capable? */
- if (! (node->pin_caps & AC_PINCAP_IN))
+ if (!(node->pin_caps & AC_PINCAP_IN))
return 0;
if (defcfg_port_conn(node) == AC_JACK_PORT_NONE)
@@ -554,9 +554,9 @@ static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,
pinctl = AC_PINCTL_IN_EN;
/* create a proper capture source label */
type = get_input_type(node, &pinctl);
- if (! type) {
+ if (!type) {
/* input as default? */
- if (! (node->pin_ctl & AC_PINCTL_IN_EN))
+ if (!(node->pin_ctl & AC_PINCTL_IN_EN))
return 0;
type = "Input";
}
@@ -584,7 +584,7 @@ static void add_cap_src(struct hda_gspec *spec, int idx)
csrc = &spec->input_mux.items[num];
buf = spec->cap_labels[num];
for (ocap = 0; ocap < num; ocap++) {
- if (! strcmp(buf, spec->cap_labels[ocap])) {
+ if (!strcmp(buf, spec->cap_labels[ocap])) {
/* same label already exists,
* put the index number to be unique
*/
@@ -608,9 +608,9 @@ static int parse_input_path(struct hda_codec *codec, struct hda_gnode *adc_node)
snd_printdd("AUD_IN = %x\n", adc_node->nid);
clear_check_flags(spec);
- // awk added - fixed no recording due to muted widget
+ /* awk added - fixed no recording due to muted widget */
unmute_input(codec, adc_node, 0);
-
+
/*
* check each connection of the ADC
* if it reaches to a proper input PIN, add the path as the
@@ -639,7 +639,7 @@ static int parse_input_path(struct hda_codec *codec, struct hda_gnode *adc_node)
}
}
- if (! spec->input_mux.num_items)
+ if (!spec->input_mux.num_items)
return 0; /* no input path found... */
snd_printdd("[Capture Source] NID=0x%x, #SRC=%d\n", adc_node->nid, spec->input_mux.num_items);
@@ -830,7 +830,7 @@ static int build_input_controls(struct hda_codec *codec)
.put = capture_source_put,
};
- if (! adc_node || ! spec->input_mux.num_items)
+ if (!adc_node || !spec->input_mux.num_items)
return 0; /* not found */
spec->cur_cap_src = 0;
@@ -854,8 +854,8 @@ static int build_input_controls(struct hda_codec *codec)
return err;
/* no volume control? */
- if (! (adc_node->wid_caps & AC_WCAP_IN_AMP) ||
- ! (adc_node->amp_in_caps & AC_AMPCAP_NUM_STEPS))
+ if (!(adc_node->wid_caps & AC_WCAP_IN_AMP) ||
+ !(adc_node->amp_in_caps & AC_AMPCAP_NUM_STEPS))
return 0;
for (i = 0; i < spec->input_mux.num_items; i++) {
@@ -901,7 +901,7 @@ static int parse_loopback_path(struct hda_codec *codec, struct hda_gspec *spec,
for (i = 0; i < node->nconns; i++) {
struct hda_gnode *child = hda_get_node(spec, node->conn_list[i]);
- if (! child)
+ if (!child)
continue;
err = parse_loopback_path(codec, spec, child, dest_node, type);
if (err < 0)
@@ -938,14 +938,14 @@ static int build_loopback_controls(struct hda_codec *codec)
int err;
const char *type;
- if (! spec->out_pin_node[0])
+ if (!spec->out_pin_node[0])
return 0;
list_for_each_entry(node, &spec->nid_list, list) {
if (node->type != AC_WID_PIN)
continue;
/* input capable? */
- if (! (node->pin_caps & AC_PINCAP_IN))
+ if (!(node->pin_caps & AC_PINCAP_IN))
return 0;
type = get_input_type(node, NULL);
if (type) {
@@ -957,7 +957,7 @@ static int build_loopback_controls(struct hda_codec *codec)
node, type);
if (err < 0)
return err;
- if (! err)
+ if (!err)
continue;
}
}
@@ -1018,7 +1018,7 @@ static int build_generic_pcms(struct hda_codec *codec)
struct hda_gspec *spec = codec->spec;
struct hda_pcm *info = &spec->pcm_rec;
- if (! spec->dac_node[0] && ! spec->adc_node) {
+ if (!spec->dac_node[0] && !spec->adc_node) {
snd_printd("hda_generic: no PCM found\n");
return 0;
}
@@ -1071,7 +1071,7 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)
struct hda_gspec *spec;
int err;
- if(!codec->afg)
+ if (!codec->afg)
return 0;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 6e18a42..22c44fc 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -49,7 +49,7 @@ static int get_wcap_ioctl(struct hda_codec *codec,
struct hda_verb_ioctl __user *arg)
{
u32 verb, res;
-
+
if (get_user(verb, &arg->verb))
return -EFAULT;
res = get_wcaps(codec, verb >> 24);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 60cc44a..3448c42 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -31,10 +31,10 @@
* CHANGES:
*
* 2004.12.01 Major rewrite by tiwai, merged the work of pshou
- *
+ *
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
@@ -139,7 +139,7 @@ MODULE_DESCRIPTION("Intel HDA driver");
#define ICH6_REG_INTCTL 0x20
#define ICH6_REG_INTSTS 0x24
#define ICH6_REG_WALCLK 0x30
-#define ICH6_REG_SYNC 0x34
+#define ICH6_REG_SYNC 0x34
#define ICH6_REG_CORBLBASE 0x40
#define ICH6_REG_CORBUBASE 0x44
#define ICH6_REG_CORBWP 0x48
@@ -422,7 +422,7 @@ static char *driver_short_names[] __devinitdata = {
[AZX_DRIVER_SIS] = "HDA SIS966",
[AZX_DRIVER_ULI] = "HDA ULI M5461",
[AZX_DRIVER_NVIDIA] = "HDA NVidia",
- [AZX_DRIVER_TERA] = "HDA Teradici",
+ [AZX_DRIVER_TERA] = "HDA Teradici",
};
/*
@@ -554,7 +554,7 @@ static void azx_update_rirb(struct azx *chip)
if (wp == chip->rirb.wp)
return;
chip->rirb.wp = wp;
-
+
while (chip->rirb.rp != wp) {
chip->rirb.rp++;
chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES;
@@ -777,7 +777,7 @@ static int azx_reset(struct azx *chip)
/*
* Lowlevel interface
- */
+ */
/* enable interrupts */
static void azx_int_enable(struct azx *chip)
@@ -913,7 +913,7 @@ static void azx_init_pci(struct azx *chip)
case AZX_DRIVER_ATI:
/* For ATI SB450 azalia HD audio, we need to enable snoop */
update_pci_byte(chip->pci,
- ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR,
+ ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR,
0x07, ATI_SB450_HDAUDIO_ENABLE_SNOOP);
break;
case AZX_DRIVER_NVIDIA:
@@ -964,7 +964,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
spin_unlock(&chip->reg_lock);
return IRQ_NONE;
}
-
+
for (i = 0; i < chip->num_streams; i++) {
azx_dev = &chip->azx_dev[i];
if (status & azx_dev->sd_int_sta_mask) {
@@ -1004,7 +1004,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
azx_writeb(chip, STATESTS, 0x04);
#endif
spin_unlock(&chip->reg_lock);
-
+
return IRQ_HANDLED;
}
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 4927c4b..5833f7e 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -1,6 +1,6 @@
/*
* Universal Interface for Intel High Definition Audio Codec
- *
+ *
* Generic proc interface
*
* Copyright (c) 2004 Takashi Iwai <tiwai(a)suse.de>
@@ -99,7 +99,7 @@ static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm)
pcm &= AC_SUPPCM_RATES;
snd_iprintf(buffer, " rates [0x%x]:", pcm);
- for (i = 0; i < ARRAY_SIZE(rates); i++)
+ for (i = 0; i < ARRAY_SIZE(rates); i++)
if (pcm & (1 << i))
snd_iprintf(buffer, " %d", rates[i]);
snd_iprintf(buffer, "\n");
@@ -527,7 +527,7 @@ static void print_codec_info(struct snd_info_entry *entry,
else
snd_iprintf(buffer, "No Modem Function Group found\n");
- if (! codec->afg)
+ if (!codec->afg)
return;
snd_hda_power_up(codec);
snd_iprintf(buffer, "Default PCM:\n");
@@ -538,7 +538,7 @@ static void print_codec_info(struct snd_info_entry *entry,
print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT);
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
- if (! nid || nodes < 0) {
+ if (!nid || nodes < 0) {
snd_iprintf(buffer, "Invalid AFG subtree\n");
snd_hda_power_down(codec);
return;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 0899b6b..f5b125a 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -174,7 +174,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
spec->multiout.share_spdif = 1;
- }
+ }
if (spec->dig_in_nid) {
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
if (err < 0)
@@ -412,7 +412,7 @@ static int ad198x_eapd_get(struct snd_kcontrol *kcontrol,
struct ad198x_spec *spec = codec->spec;
int invert = (kcontrol->private_value >> 8) & 1;
if (invert)
- ucontrol->value.integer.value[0] = ! spec->cur_eapd;
+ ucontrol->value.integer.value[0] = !spec->cur_eapd;
else
ucontrol->value.integer.value[0] = spec->cur_eapd;
return 0;
@@ -1413,7 +1413,7 @@ static int ad1981_hp_master_sw_put(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ad198x_spec *spec = codec->spec;
- if (! ad198x_eapd_put(kcontrol, ucontrol))
+ if (!ad198x_eapd_put(kcontrol, ucontrol))
return 0;
/* change speaker pin appropriately */
snd_hda_codec_write(codec, 0x05, 0,
@@ -2426,7 +2426,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res)
snd_hda_sequence_write(codec, ad1988_laptop_hp_on);
else
snd_hda_sequence_write(codec, ad1988_laptop_hp_off);
-}
+}
#ifdef CONFIG_SND_HDA_POWER_SAVE
static struct hda_amp_list ad1988_loopbacks[] = {
@@ -2466,7 +2466,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC;
knew = kcalloc(num + 1, sizeof(*knew), GFP_KERNEL); /* array + terminator */
- if (! knew)
+ if (!knew)
return -ENOMEM;
if (spec->kctl_alloc) {
memcpy(knew, spec->kctl_alloc, sizeof(*knew) * spec->num_kctl_alloc);
@@ -2479,7 +2479,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
knew = &spec->kctl_alloc[spec->num_kctl_used];
*knew = ad1988_control_templates[type];
knew->name = kstrdup(name, GFP_KERNEL);
- if (! knew->name)
+ if (!knew->name)
return -ENOMEM;
knew->private_value = val;
spec->num_kctl_used++;
@@ -2581,7 +2581,7 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec,
for (i = 0; i < cfg->line_outs; i++) {
hda_nid_t dac = spec->multiout.dac_nids[i];
- if (! dac)
+ if (!dac)
continue;
nid = ad1988_mixer_nids[ad1988_pin_idx(cfg->line_out_pins[i])];
if (i == 2) {
@@ -2631,7 +2631,7 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
int i, idx, err;
char name[32];
- if (! pin)
+ if (!pin)
return 0;
idx = ad1988_pin_idx(pin);
@@ -2784,7 +2784,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
- if (! nid)
+ if (!nid)
continue;
switch (nid) {
case 0x15: /* port-C */
@@ -2818,7 +2818,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec)
return err;
if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0)
return err;
- if (! spec->autocfg.line_outs)
+ if (!spec->autocfg.line_outs)
return 0; /* can't find valid BIOS pin config */
if ((err = ad1988_auto_create_multi_out_ctls(spec, &spec->autocfg)) < 0 ||
(err = ad1988_auto_create_extra_out(codec,
@@ -2904,7 +2904,7 @@ static int patch_ad1988(struct hda_codec *codec)
if (err < 0) {
ad198x_free(codec);
return err;
- } else if (! err) {
+ } else if (!err) {
printk(KERN_INFO "hda_codec: Cannot set up configuration from BIOS. Using 6-stack mode...\n");
board_config = AD1988_6STACK;
}
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index 6ef57fb..473157b 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -372,7 +372,7 @@ static int cmi9880_fill_multi_dac_nids(struct hda_codec *codec, const struct aut
continue;
/* search for an empty channel */
for (j = 0; j < cfg->line_outs; j++) {
- if (! assigned[j]) {
+ if (!assigned[j]) {
spec->dac_nids[i] = j + 0x03;
assigned[j] = 1;
break;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 7c1eb23..f2b16f8 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -377,7 +377,7 @@ static int conexant_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
spec->multiout.share_spdif = 1;
- }
+ }
if (spec->dig_in_nid) {
err = snd_hda_create_spdif_in_ctls(codec,spec->dig_in_nid);
if (err < 0)
@@ -428,7 +428,7 @@ static int cxt_eapd_put(struct snd_kcontrol *kcontrol,
eapd = !eapd;
if (eapd == spec->cur_eapd)
return 0;
-
+
spec->cur_eapd = eapd;
snd_hda_codec_write_cache(codec, nid,
0, AC_VERB_SET_EAPD_BTLENABLE,
@@ -592,7 +592,7 @@ static void cxt5045_hp_automute(struct hda_codec *codec)
spec->hp_present = snd_hda_codec_read(codec, 0x11, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
- bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
+ bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x10, HDA_OUTPUT, 0,
HDA_AMP_MUTE, bits);
}
@@ -706,7 +706,7 @@ static struct hda_verb cxt5045_init_verbs[] = {
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{ 0x13, AC_VERB_SET_CONNECT_SEL, 0x0 },
/* EAPD */
- {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2 }, /* default on */
+ {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2 }, /* default on */
{ } /* end */
};
@@ -772,7 +772,7 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = {
HDA_CODEC_MUTE("Node 11 Playback Switch", 0x11, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Node 12 Playback Volume", 0x12, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Node 12 Playback Switch", 0x12, 0x0, HDA_OUTPUT),
-
+
/* Modes for retasking pin widgets */
CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT),
CXT_PIN_MODE("LINE1 pin mode", 0x12, CXT_PIN_DIR_INOUT),
@@ -1004,8 +1004,8 @@ static int patch_cxt5045(struct hda_codec *codec)
spec->mixers[0] = cxt5045_test_mixer;
spec->init_verbs[0] = cxt5045_test_init_verbs;
break;
-
-#endif
+
+#endif
}
switch (codec->subsystem_id >> 16) {
@@ -1395,7 +1395,7 @@ static struct hda_verb cxt5047_test_init_verbs[] = {
*/
{0x18, AC_VERB_SET_DIGI_CONVERT_1, 0},
- /* Ensure mic1, mic2, line1 pin widgets take input from the
+ /* Ensure mic1, mic2, line1 pin widgets take input from the
* OUT1 sum bus when acting as an output.
*/
{0x1a, AC_VERB_SET_CONNECT_SEL, 0},
@@ -1530,7 +1530,7 @@ static int patch_cxt5047(struct hda_codec *codec)
spec->mixers[0] = cxt5047_test_mixer;
spec->init_verbs[0] = cxt5047_test_init_verbs;
codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
-#endif
+#endif
}
return 0;
}
@@ -1685,7 +1685,7 @@ static struct hda_verb cxt5051_init_verbs[] = {
/* HP, Amp */
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
- /* DAC1 */
+ /* DAC1 */
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Record selector: Int mic */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
@@ -1694,7 +1694,7 @@ static struct hda_verb cxt5051_init_verbs[] = {
/* SPDIF route: PCM */
{0x1c, AC_VERB_SET_CONNECT_SEL, 0x0},
/* EAPD */
- {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
+ {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
{0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT},
{0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT},
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTC_EVENT},
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5c80a27..80e66d2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9291,7 +9291,7 @@ static struct hda_verb alc262_hippo1_unsol_verbs[] = {
static struct hda_verb alc262_sony_unsol_verbs[] = {
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
- {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic
+ {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, /* Front Mic */
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
@@ -15209,7 +15209,7 @@ static void alc662_eeepc_unsol_event(struct hda_codec *codec,
unsigned int res)
{
if ((res >> 26) == ALC880_HP_EVENT)
- alc262_hippo1_automute( codec );
+ alc262_hippo1_automute(codec);
if ((res >> 26) == ALC880_MIC_EVENT)
alc662_eeepc_mic_automute(codec);
@@ -15217,7 +15217,7 @@ static void alc662_eeepc_unsol_event(struct hda_codec *codec,
static void alc662_eeepc_inithook(struct hda_codec *codec)
{
- alc262_hippo1_automute( codec );
+ alc262_hippo1_automute(codec);
alc662_eeepc_mic_automute(codec);
}
diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c
index 9332b63..1148d8d 100644
--- a/sound/pci/hda/patch_si3054.c
+++ b/sound/pci/hda/patch_si3054.c
@@ -103,7 +103,7 @@ static int si3054_switch_get(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
u16 reg = PRIVATE_REG(kcontrol->private_value);
u16 mask = PRIVATE_MASK(kcontrol->private_value);
- uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0 ;
+ uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0;
return 0;
}
@@ -128,7 +128,7 @@ static int si3054_switch_put(struct snd_kcontrol *kcontrol,
.put = si3054_switch_put, \
.private_value = PRIVATE_VALUE(reg,mask), \
}
-
+
static struct snd_kcontrol_new si3054_modem_mixer[] = {
SI3054_KCONTROL("Off-hook Switch", SI3054_GPIO_CONTROL, SI3054_GPIO_OH),
@@ -233,7 +233,7 @@ static int si3054_init(struct hda_codec *codec)
val = GET_REG(codec, SI3054_EXTENDED_MID);
} while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--);
- if((val&SI3054_MEI_READY) != SI3054_MEI_READY) {
+ if ((val&SI3054_MEI_READY) != SI3054_MEI_READY) {
snd_printk(KERN_ERR "si3054: cannot initialize. EXT MID = %04x\n", val);
/* let's pray that this is no fatal error */
/* return -EACCES; */
@@ -244,7 +244,7 @@ static int si3054_init(struct hda_codec *codec)
SET_REG(codec, SI3054_MISC_AFE, 0);
SET_REG(codec, SI3054_LINE_CFG1,0x200);
- if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
+ if ((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
snd_printd("Link Frame Detect(FDT) is not ready (line status: %04x)\n",
GET_REG(codec,SI3054_LINE_STATUS));
}
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 238aebf..6c4cfe8 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -405,12 +405,12 @@ static hda_nid_t stac9205_dmic_nids[STAC9205_NUM_DMICS + 1] = {
};
static hda_nid_t stac9200_pin_nids[8] = {
- 0x08, 0x09, 0x0d, 0x0e,
+ 0x08, 0x09, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12,
};
static hda_nid_t stac925x_pin_nids[8] = {
- 0x07, 0x08, 0x0a, 0x0b,
+ 0x07, 0x08, 0x0a, 0x0b,
0x0c, 0x0d, 0x10, 0x11,
};
@@ -796,23 +796,23 @@ static struct hda_verb stac925x_core_init[] = {
};
static struct hda_verb stac922x_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
{}
};
static struct hda_verb d965_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
/* unmute node 0x1b */
{ 0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
- /* select node 0x03 as DAC */
+ /* select node 0x03 as DAC */
{ 0x0b, AC_VERB_SET_CONNECT_SEL, 0x01},
{}
};
static struct hda_verb stac927x_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
/* enable analog pc beep path */
{ 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
@@ -820,7 +820,7 @@ static struct hda_verb stac927x_core_init[] = {
};
static struct hda_verb stac9205_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
/* enable analog pc beep path */
{ 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
@@ -1159,7 +1159,7 @@ static int stac92xx_build_controls(struct hda_codec *codec)
return err;
}
- return 0;
+ return 0;
}
static unsigned int ref9200_pin_configs[8] = {
@@ -1167,28 +1167,28 @@ static unsigned int ref9200_pin_configs[8] = {
0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
};
-/*
+/*
STAC 9200 pin configs for
102801A8
102801DE
102801E8
*/
static unsigned int dell9200_d21_pin_configs[8] = {
- 0x400001f0, 0x400001f1, 0x02214030, 0x01014010,
+ 0x400001f0, 0x400001f1, 0x02214030, 0x01014010,
0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
};
-/*
+/*
STAC 9200 pin configs for
102801C0
102801C1
*/
static unsigned int dell9200_d22_pin_configs[8] = {
- 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
+ 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
0x01813020, 0x02a19021, 0x90100140, 0x400001f2,
};
-/*
+/*
STAC 9200 pin configs for
102801C4 (Dell Dimension E310)
102801C5
@@ -1198,12 +1198,12 @@ static unsigned int dell9200_d22_pin_configs[8] = {
102801E3
*/
static unsigned int dell9200_d23_pin_configs[8] = {
- 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
- 0x01813020, 0x01a19021, 0x90100140, 0x400001f2,
+ 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
+ 0x01813020, 0x01a19021, 0x90100140, 0x400001f2,
};
-/*
+/*
STAC 9200-32 pin configs for
102801B5 (Dell Inspiron 630m)
102801D8 (Dell Inspiron 640m)
@@ -1213,20 +1213,20 @@ static unsigned int dell9200_m21_pin_configs[8] = {
0x408003fb, 0x03a11020, 0x401003fc, 0x403003fd,
};
-/*
+/*
STAC 9200-32 pin configs for
102801C2 (Dell Latitude D620)
- 102801C8
+ 102801C8
102801CC (Dell Latitude D820)
- 102801D4
- 102801D6
+ 102801D4
+ 102801D6
*/
static unsigned int dell9200_m22_pin_configs[8] = {
- 0x40c003fa, 0x0144131f, 0x0321121f, 0x90170310,
+ 0x40c003fa, 0x0144131f, 0x0321121f, 0x90170310,
0x90a70321, 0x03a11020, 0x401003fb, 0x40f000fc,
};
-/*
+/*
STAC 9200-32 pin configs for
102801CE (Dell XPS M1710)
102801CF (Dell Precision M90)
@@ -1237,15 +1237,15 @@ static unsigned int dell9200_m23_pin_configs[8] = {
};
/*
- STAC 9200-32 pin configs for
+ STAC 9200-32 pin configs for
102801C9
102801CA
102801CB (Dell Latitude 120L)
102801D3
*/
static unsigned int dell9200_m24_pin_configs[8] = {
- 0x40c003fa, 0x404003fb, 0x0321121f, 0x90170310,
- 0x408003fc, 0x03a11020, 0x401003fd, 0x403003fe,
+ 0x40c003fa, 0x404003fb, 0x0321121f, 0x90170310,
+ 0x408003fc, 0x03a11020, 0x401003fd, 0x403003fe,
};
/*
@@ -1255,7 +1255,7 @@ static unsigned int dell9200_m24_pin_configs[8] = {
102801EF
*/
static unsigned int dell9200_m25_pin_configs[8] = {
- 0x40c003fa, 0x01441340, 0x0421121f, 0x90170310,
+ 0x40c003fa, 0x01441340, 0x0421121f, 0x90170310,
0x408003fb, 0x04a11020, 0x401003fc, 0x403003fd,
};
@@ -1265,7 +1265,7 @@ static unsigned int dell9200_m25_pin_configs[8] = {
102801F6
*/
static unsigned int dell9200_m26_pin_configs[8] = {
- 0x40c003fa, 0x404003fb, 0x0421121f, 0x90170310,
+ 0x40c003fa, 0x404003fb, 0x0421121f, 0x90170310,
0x408003fc, 0x04a11020, 0x401003fd, 0x403003fe,
};
@@ -1601,7 +1601,7 @@ static unsigned int dell_922x_d82_pin_configs[10] = {
*/
static unsigned int dell_922x_m81_pin_configs[10] = {
0x0321101f, 0x01112024, 0x01111222, 0x91174220,
- 0x03a11050, 0x01116221, 0x90a70330, 0x01452340,
+ 0x03a11050, 0x01116221, 0x90a70330, 0x01452340,
0x40C003f1, 0x405003f0,
};
@@ -1610,9 +1610,9 @@ static unsigned int dell_922x_m81_pin_configs[10] = {
102801D7 (Dell XPS M1210)
*/
static unsigned int dell_922x_m82_pin_configs[10] = {
- 0x02211211, 0x408103ff, 0x02a1123e, 0x90100310,
- 0x408003f1, 0x0221121f, 0x03451340, 0x40c003f2,
- 0x508003f3, 0x405003f4,
+ 0x02211211, 0x408103ff, 0x02a1123e, 0x90100310,
+ 0x408003f1, 0x0221121f, 0x03451340, 0x40c003f2,
+ 0x508003f3, 0x405003f4,
};
static unsigned int d945gtp3_pin_configs[10] = {
@@ -1682,9 +1682,9 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
[STAC_IMAC_INTEL_20] = intel_mac_v3_pin_configs,
[STAC_ECS_202] = ecs202_pin_configs,
[STAC_922X_DELL_D81] = dell_922x_d81_pin_configs,
- [STAC_922X_DELL_D82] = dell_922x_d82_pin_configs,
+ [STAC_922X_DELL_D82] = dell_922x_d82_pin_configs,
[STAC_922X_DELL_M81] = dell_922x_m81_pin_configs,
- [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,
+ [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,
};
static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -1823,7 +1823,7 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
static unsigned int ref927x_pin_configs[14] = {
0x02214020, 0x02a19080, 0x0181304e, 0x01014010,
- 0x01a19040, 0x01011012, 0x01016011, 0x0101201f,
+ 0x01a19040, 0x01011012, 0x01016011, 0x0101201f,
0x183301f0, 0x18a001f0, 0x18a001f0, 0x01442070,
0x01c42190, 0x40000100,
};
@@ -2015,25 +2015,25 @@ static int stac92xx_save_bios_config_regs(struct hda_codec *codec)
{
int i;
struct sigmatel_spec *spec = codec->spec;
-
- if (! spec->bios_pin_configs) {
+
+ if (!spec->bios_pin_configs) {
spec->bios_pin_configs = kcalloc(spec->num_pins,
sizeof(*spec->bios_pin_configs), GFP_KERNEL);
- if (! spec->bios_pin_configs)
+ if (!spec->bios_pin_configs)
return -ENOMEM;
}
-
+
for (i = 0; i < spec->num_pins; i++) {
hda_nid_t nid = spec->pin_nids[i];
unsigned int pin_cfg;
-
- pin_cfg = snd_hda_codec_read(codec, nid, 0,
- AC_VERB_GET_CONFIG_DEFAULT, 0x00);
+
+ pin_cfg = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_CONFIG_DEFAULT, 0x00);
snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x bios pin config %8.8x\n",
nid, pin_cfg);
spec->bios_pin_configs[i] = pin_cfg;
}
-
+
return 0;
}
@@ -2055,7 +2055,7 @@ static void stac92xx_set_config_reg(struct hda_codec *codec,
pin_config >> 24);
i = snd_hda_codec_read(codec, pin_nid, 0,
AC_VERB_GET_CONFIG_DEFAULT,
- 0x00);
+ 0x00);
snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x pin config %8.8x\n",
pin_nid, i);
}
@@ -2442,7 +2442,7 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC;
knew = kcalloc(num + 1, sizeof(*knew), GFP_KERNEL); /* array + terminator */
- if (! knew)
+ if (!knew)
return -ENOMEM;
if (spec->kctl_alloc) {
memcpy(knew, spec->kctl_alloc, sizeof(*knew) * spec->num_kctl_alloc);
@@ -2456,7 +2456,7 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
*knew = stac92xx_control_templates[type];
knew->index = idx;
knew->name = kstrdup(name, GFP_KERNEL);
- if (! knew->name)
+ if (!knew->name)
return -ENOMEM;
knew->private_value = val;
spec->num_kctl_used++;
@@ -2477,7 +2477,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
struct sigmatel_spec *spec = codec->spec;
unsigned int wcaps, wtype;
int i, num_dacs = 0;
-
+
/* use the wcaps cache to count all DACs available for line-outs */
for (i = 0; i < codec->num_nodes; i++) {
wcaps = codec->wcaps[i];
@@ -2488,7 +2488,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
}
snd_printdd("%s: total dac count=%d\n", __func__, num_dacs);
-
+
switch (cfg->line_outs) {
case 3:
/* add line-in as side */
@@ -2538,7 +2538,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
static int is_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid)
{
int i;
-
+
for (i = 0; i < spec->multiout.num_dacs; i++) {
if (spec->multiout.dac_nids[i] == nid)
return 1;
@@ -2558,10 +2558,10 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec,
struct auto_pin_cfg *cfg)
{
struct sigmatel_spec *spec = codec->spec;
- int i, j, conn_len = 0;
+ int i, j, conn_len = 0;
hda_nid_t nid, conn[HDA_MAX_CONNECTIONS];
unsigned int wcaps, wtype;
-
+
for (i = 0; i < cfg->line_outs; i++) {
nid = cfg->line_out_pins[i];
conn_len = snd_hda_get_connections(codec, nid, conn,
@@ -2772,7 +2772,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
if (check_in_dac_nids(spec, nid))
nid = 0;
- if (! nid)
+ if (!nid)
continue;
add_spec_dacs(spec, nid);
}
@@ -2781,7 +2781,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
if (check_in_dac_nids(spec, nid))
nid = 0;
- if (! nid)
+ if (!nid)
continue;
add_spec_dacs(spec, nid);
}
@@ -2790,7 +2790,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
if (check_in_dac_nids(spec, nid))
nid = 0;
- if (! nid)
+ if (!nid)
continue;
add_spec_dacs(spec, nid);
}
@@ -3082,7 +3082,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
&spec->autocfg,
spec->dmic_nids)) < 0)
return err;
- if (! spec->autocfg.line_outs)
+ if (!spec->autocfg.line_outs)
return 0; /* can't find valid pin config */
/* If we have no real line-out pin and multiple hp-outs, HPs should
@@ -3258,7 +3258,7 @@ static int stac9200_auto_create_hp_ctls(struct hda_codec *codec,
hda_nid_t pin = cfg->hp_pins[0];
unsigned int wid_caps;
- if (! pin)
+ if (!pin)
return 0;
wid_caps = get_wcaps(codec, pin);
@@ -3503,7 +3503,7 @@ static void stac92xx_free(struct hda_codec *codec)
struct sigmatel_spec *spec = codec->spec;
int i;
- if (! spec)
+ if (!spec)
return;
if (spec->kctl_alloc) {
@@ -3544,7 +3544,7 @@ static void stac92xx_set_pinctl(struct hda_codec *codec, hda_nid_t nid,
direction bits first */
if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))
pin_ctl &= ~(AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN);
-
+
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
pin_ctl | flag);
@@ -3628,7 +3628,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
}
if (!spec->hp_switch && cfg->hp_outs > 1 && presence)
stac92xx_set_pinctl(codec, nid, AC_PINCTL_OUT_EN);
-}
+}
static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
{
@@ -3779,7 +3779,7 @@ static int patch_stac925x(struct hda_codec *codec)
stac925x_cfg_tbl);
again:
if (spec->board_config < 0) {
- snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
+ snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
"using BIOS defaults\n");
err = stac92xx_save_bios_config_regs(codec);
if (err < 0) {
@@ -4309,7 +4309,7 @@ static int patch_stac922x(struct hda_codec *codec)
spec->mixer = stac922x_mixer;
spec->multiout.dac_nids = spec->dac_nids;
-
+
err = stac92xx_parse_auto_config(codec, 0x08, 0x09);
if (!err) {
if (spec->board_config < 0) {
@@ -4510,7 +4510,7 @@ static int patch_stac9205(struct hda_codec *codec)
spec->aloopback_mask = 0x40;
spec->aloopback_shift = 0;
spec->multiout.dac_nids = spec->dac_nids;
-
+
switch (spec->board_config){
case STAC_9205_DELL_M43:
/* Enable SPDIF in/out */
@@ -4700,7 +4700,7 @@ static void stac9872_vaio_hp_detect(struct hda_codec *codec, unsigned int res)
stac92xx_reset_pinctl(codec, 0x0a, AC_PINCTL_OUT_EN);
stac92xx_set_pinctl(codec, 0x0f, AC_PINCTL_OUT_EN);
}
-}
+}
static void stac9872_vaio_unsol_event(struct hda_codec *codec, unsigned int res)
{
@@ -4725,7 +4725,7 @@ static struct hda_codec_ops stac9872_vaio_patch_ops = {
enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */
CXD9872RD_VAIO,
/* Unknown. id=0x83847662 and subsys=0x104D1200 or 104D1000. */
- STAC9872AK_VAIO,
+ STAC9872AK_VAIO,
/* Unknown. id=0x83847661 and subsys=0x104D1200. */
STAC9872K_VAIO,
/* AR Series. id=0x83847664 and subsys=104D1300 */
@@ -4757,7 +4757,7 @@ static int patch_stac9872(struct hda_codec *codec)
if (board_config < 0)
/* unknown config, let generic-parser do its job... */
return snd_hda_parse_generic_codec(codec);
-
+
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL)
return -ENOMEM;
@@ -4780,7 +4780,7 @@ static int patch_stac9872(struct hda_codec *codec)
spec->mux_nids = vaio_mux_nids;
codec->patch_ops = stac9872_vaio_patch_ops;
break;
-
+
case CXD9872AKD_VAIO:
spec->mixer = vaio_ar_mixer;
spec->init = vaio_ar_init;
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index e7e4352..4597ec9 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -344,7 +344,7 @@ static struct hda_verb vt1708_volume_init_verbs[] = {
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-
+
/* Setup default input to PW4 */
{0x20, AC_VERB_SET_CONNECT_SEL, 0x1},
/* PW9 Output enable */
@@ -644,8 +644,8 @@ static int vt1708_auto_fill_dac_nids(struct via_spec *spec,
spec->multiout.num_dacs = cfg->line_outs;
spec->multiout.dac_nids = spec->private_dac_nids;
-
- for(i = 0; i < 4; i++) {
+
+ for (i = 0; i < 4; i++) {
nid = cfg->line_out_pins[i];
if (nid) {
/* config dac list */
@@ -683,7 +683,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
if (!nid)
continue;
-
+
if (i != AUTO_SEQ_FRONT)
nid_vol = 0x1b - i + 1;
@@ -727,7 +727,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
HDA_INPUT));
if (err < 0)
return err;
-
+
/* add control to PW3 */
sprintf(name, "%s Playback Volume", chname[i]);
err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name,
@@ -806,7 +806,7 @@ static int vt1708_auto_create_analog_input_ctls(struct via_spec *spec,
case 0x1d: /* Mic */
idx = 2;
break;
-
+
case 0x1e: /* Line In */
idx = 3;
break;
@@ -874,7 +874,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
if (spec->kctl_alloc)
spec->mixers[spec->num_mixers++] = spec->kctl_alloc;
- spec->init_verbs = vt1708_volume_init_verbs;
+ spec->init_verbs = vt1708_volume_init_verbs;
spec->input_mux = &spec->private_imux;
@@ -913,7 +913,7 @@ static int patch_vt1708(struct hda_codec *codec)
"from BIOS. Using genenic mode...\n");
}
-
+
spec->stream_name_analog = "VT1708 Analog";
spec->stream_analog_playback = &vt1708_pcm_analog_playback;
/* disable 32bit format on VT1708 */
@@ -925,7 +925,7 @@ static int patch_vt1708(struct hda_codec *codec)
spec->stream_digital_playback = &vt1708_pcm_digital_playback;
spec->stream_digital_capture = &vt1708_pcm_digital_capture;
-
+
if (!spec->adc_nids && spec->input_mux) {
spec->adc_nids = vt1708_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(vt1708_adc_nids);
@@ -1104,7 +1104,7 @@ static int vt1709_auto_fill_dac_nids(struct via_spec *spec,
spec->multiout.dac_nids[cfg->line_outs] = 0x28; /* AOW4 */
} else if (cfg->line_outs == 3) { /* 6 channels */
- for(i = 0; i < cfg->line_outs; i++) {
+ for (i = 0; i < cfg->line_outs; i++) {
nid = cfg->line_out_pins[i];
if (nid) {
/* config dac list */
@@ -1143,7 +1143,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec,
for (i = 0; i <= AUTO_SEQ_SIDE; i++) {
nid = cfg->line_out_pins[i];
- if (!nid)
+ if (!nid)
continue;
if (i == AUTO_SEQ_CENLFE) {
@@ -1186,7 +1186,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec,
HDA_INPUT));
if (err < 0)
return err;
-
+
/* add control to PW3 */
sprintf(name, "%s Playback Volume", chname[i]);
err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name,
@@ -1281,7 +1281,7 @@ static int vt1709_auto_create_analog_input_ctls(struct via_spec *spec,
case 0x1d: /* Mic */
idx = 2;
break;
-
+
case 0x1e: /* Line In */
idx = 3;
break;
@@ -1375,7 +1375,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
"Using genenic mode...\n");
}
- spec->init_verbs = vt1709_10ch_volume_init_verbs;
+ spec->init_verbs = vt1709_10ch_volume_init_verbs;
spec->stream_name_analog = "VT1709 Analog";
spec->stream_analog_playback = &vt1709_10ch_pcm_analog_playback;
@@ -1385,7 +1385,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
spec->stream_digital_playback = &vt1709_pcm_digital_playback;
spec->stream_digital_capture = &vt1709_pcm_digital_capture;
-
+
if (!spec->adc_nids && spec->input_mux) {
spec->adc_nids = vt1709_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids);
@@ -1466,7 +1466,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
"Using genenic mode...\n");
}
- spec->init_verbs = vt1709_6ch_volume_init_verbs;
+ spec->init_verbs = vt1709_6ch_volume_init_verbs;
spec->stream_name_analog = "VT1709 Analog";
spec->stream_analog_playback = &vt1709_6ch_pcm_analog_playback;
@@ -1476,7 +1476,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
spec->stream_digital_playback = &vt1709_pcm_digital_playback;
spec->stream_digital_capture = &vt1709_pcm_digital_capture;
-
+
if (!spec->adc_nids && spec->input_mux) {
spec->adc_nids = vt1709_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids);
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/emu10k1/emu10k1.c | 8 +-
sound/pci/emu10k1/emu10k1_callback.c | 28 ++--
sound/pci/emu10k1/emu10k1_main.c | 266 +++++++++++++++++-----------------
sound/pci/emu10k1/emu10k1_patch.c | 14 +-
sound/pci/emu10k1/emu10k1_synth.c | 2 +-
sound/pci/emu10k1/emu10k1x.c | 156 ++++++++++----------
sound/pci/emu10k1/emufx.c | 148 ++++++++++----------
sound/pci/emu10k1/emumixer.c | 130 ++++++++--------
sound/pci/emu10k1/emumpu401.c | 2 +-
sound/pci/emu10k1/emupcm.c | 56 ++++----
sound/pci/emu10k1/emuproc.c | 80 +++++-----
sound/pci/emu10k1/io.c | 32 ++--
sound/pci/emu10k1/irq.c | 18 +-
sound/pci/emu10k1/memory.c | 8 +-
sound/pci/emu10k1/p16v.c | 132 +++++++++---------
sound/pci/emu10k1/p16v.h | 14 +-
sound/pci/emu10k1/p17v.h | 6 +-
sound/pci/emu10k1/voice.c | 32 ++--
18 files changed, 566 insertions(+), 566 deletions(-)
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 8354c1a..094a874 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- *
+ *
*/
#include <linux/init.h>
@@ -134,7 +134,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
if ((err = snd_emu10k1_pcm_efx(emu, 2, NULL)) < 0)
goto error;
/* This stores the periods table. */
- if (emu->card_capabilities->ca0151_chip) { /* P16V */
+ if (emu->card_capabilities->ca0151_chip) { /* P16V */
if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
1024, &emu->p16v_buffer)) < 0)
goto error;
@@ -142,7 +142,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0)
goto error;
-
+
if ((err = snd_emu10k1_timer(emu, 0)) < 0)
goto error;
@@ -176,7 +176,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
arg->max_voices = max_synth_voices[dev];
}
#endif
-
+
strcpy(card->driver, emu->card_capabilities->driver);
strcpy(card->shortname, emu->card_capabilities->name);
snprintf(card->longname, sizeof(card->longname),
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index 0e649dc..7bc7fce 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -103,7 +103,7 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
int ch;
vp = &emu->voices[best[i].voice];
if ((ch = vp->ch) < 0) {
- //printk("synth_get_voice: ch < 0 (%d) ??", i);
+ /* printk("synth_get_voice: ch < 0 (%d) ??", i); */
continue;
}
vp->emu->num_voices--;
@@ -128,7 +128,7 @@ release_voice(struct snd_emux_voice *vp)
{
int dcysusv;
struct snd_emu10k1 *hw;
-
+
hw = vp->hw;
dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease;
snd_emu10k1_ptr_write(hw, DCYSUSM, vp->ch, dcysusv);
@@ -144,7 +144,7 @@ static void
terminate_voice(struct snd_emux_voice *vp)
{
struct snd_emu10k1 *hw;
-
+
if (snd_BUG_ON(!vp))
return;
hw = vp->hw;
@@ -164,7 +164,7 @@ static void
free_voice(struct snd_emux_voice *vp)
{
struct snd_emu10k1 *hw;
-
+
hw = vp->hw;
/* FIXME: emu10k1_synth is broken. */
/* This can get called with hw == 0 */
@@ -173,7 +173,7 @@ free_voice(struct snd_emux_voice *vp)
if (hw && (vp->ch >= 0)) {
snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00);
snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
- // snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0);
+ /* snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0); */
snd_emu10k1_ptr_write(hw, VTFT, vp->ch, 0xffff);
snd_emu10k1_ptr_write(hw, CVCF, vp->ch, 0xffff);
snd_emu10k1_voice_free(hw, &hw->voices[vp->ch]);
@@ -190,7 +190,7 @@ static void
update_voice(struct snd_emux_voice *vp, int update)
{
struct snd_emu10k1 *hw;
-
+
hw = vp->hw;
if (update & SNDRV_EMUX_UPDATE_VOLUME)
snd_emu10k1_ptr_write(hw, IFATN_ATTENUATION, vp->ch, vp->avol);
@@ -250,7 +250,7 @@ lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
bp = best + V_RELEASED;
#if 1
val = snd_emu10k1_ptr_read(hw, CVCF_CURRENTVOL, vp->ch);
- if (! val)
+ if (!val)
bp = best + V_OFF;
#endif
}
@@ -323,7 +323,7 @@ start_voice(struct snd_emux_voice *vp)
struct snd_midi_channel *chan;
struct snd_emu10k1 *hw;
struct snd_emu10k1_memblk *emem;
-
+
hw = vp->hw;
ch = vp->ch;
if (snd_BUG_ON(ch < 0))
@@ -335,7 +335,7 @@ start_voice(struct snd_emux_voice *vp)
return -EINVAL;
emem->map_locked++;
if (snd_emu10k1_memblk_map(hw, emem) < 0) {
- // printk("emu: cannot map!\n");
+ /* printk("emu: cannot map!\n"); */
return -ENOMEM;
}
mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;
@@ -347,11 +347,11 @@ start_voice(struct snd_emux_voice *vp)
/* set channel routing */
/* A = left(0), B = right(1), C = reverb(c), D = chorus(d) */
if (hw->audigy) {
- temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) |
+ temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) |
(FXBUS_MIDI_REVERB << 16) | (FXBUS_MIDI_CHORUS << 24);
snd_emu10k1_ptr_write(hw, A_FXRT1, ch, temp);
} else {
- temp = (FXBUS_MIDI_LEFT << 16) | (FXBUS_MIDI_RIGHT << 20) |
+ temp = (FXBUS_MIDI_LEFT << 16) | (FXBUS_MIDI_RIGHT << 20) |
(FXBUS_MIDI_REVERB << 24) | (FXBUS_MIDI_CHORUS << 28);
snd_emu10k1_ptr_write(hw, FXRT, ch, temp);
}
@@ -437,7 +437,7 @@ start_voice(struct snd_emux_voice *vp)
temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK;
snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
-
+
/* fill cache */
val -= 4;
val <<= 25;
@@ -476,11 +476,11 @@ trigger_voice(struct snd_emux_voice *vp)
unsigned int temp, ptarget;
struct snd_emu10k1 *hw;
struct snd_emu10k1_memblk *emem;
-
+
hw = vp->hw;
emem = (struct snd_emu10k1_memblk *)vp->block;
- if (! emem || emem->mapped_page < 0)
+ if (!emem || emem->mapped_page < 0)
return; /* not mapped */
#if 0
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 2f283ea..ab57586 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -153,7 +153,7 @@ static unsigned int i2c_adc_init[][2] = {
{ 0x14, 0xa6 }, /* Limiter control */
{ 0x15, ADC_MUX_2 }, /* ADC Mixer control. Mic for Audigy 2 ZS Notebook */
};
-
+
static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
{
unsigned int silent_page;
@@ -197,12 +197,12 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
/* Hacks for Alice3 to work independent of haP16V driver */
- //Setup SRCMulti_I2S SamplingRate
+ /* Setup SRCMulti_I2S SamplingRate */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
tmp &= 0xfffff1ff;
tmp |= (0x2<<9);
snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, 0, tmp);
-
+
/* Setup SRCSel (Enable Spdif,I2S SRCMulti) */
snd_emu10k1_ptr20_write(emu, SRCSel, 0, 0x14);
/* Setup SRCMulti Input Audio Enable */
@@ -217,7 +217,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */
/* Hacks for Alice3 to work independent of haP16V driver */
snd_printk(KERN_INFO "Audigy2 value: Special config.\n");
- //Setup SRCMulti_I2S SamplingRate
+ /* Setup SRCMulti_I2S SamplingRate */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
tmp &= 0xfffff1ff;
tmp |= (0x2<<9);
@@ -276,7 +276,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
}
}
-
+
snd_emu10k1_ptr_write(emu, PTB, 0, emu->ptb_pages.addr);
snd_emu10k1_ptr_write(emu, TCB, 0, 0); /* taken from original driver */
snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */
@@ -313,7 +313,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
(emu->model == 0x21 && emu->revision < 6))
outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE, emu->port + HCFG);
else
- // With on-chip joystick
+ /* With on-chip joystick */
outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
if (enable_ir) { /* enable IR for SB Live */
@@ -337,7 +337,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
outl(reg, emu->port + HCFG);
}
}
-
+
if (emu->card_capabilities->emu_model) {
; /* Disable all access to A_IOCFG for the emu1010 */
} else if (emu->card_capabilities->i2c_adc) {
@@ -364,7 +364,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
; /* Disable A_IOCFG for Audigy 2 ZS Notebook */
} else if (emu->audigy) {
outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG);
-
+
if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
/* Unmute Analog now. Set GPO6 to 1 for Apollo.
* This has to be done after init ALice3 I2SOut beyond 48KHz.
@@ -378,12 +378,12 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
}
}
-
+
#if 0
{
unsigned int tmp;
/* FIXME: the following routine disables LiveDrive-II !! */
- // TOSLink detection
+ /* TOSLink detection */
emu->tos_link = 0;
tmp = inl(emu->port + HCFG);
if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {
@@ -495,7 +495,7 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
#define EC_LAST_PROMFILE_ADDR 0x2f
-#define EC_SERIALNUM_ADDR 0x30 /* First word of serial number. The
+#define EC_SERIALNUM_ADDR 0x30 /* First word of serial number. The
* can be up to 30 characters in length
* and is stored as a NULL-terminated
* ASCII string. Any unused bytes must be
@@ -503,8 +503,8 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
#define EC_CHECKSUM_ADDR 0x3f /* Location at which checksum is stored */
-/* Most of this stuff is pretty self-evident. According to the hardware
- * dudes, we need to leave the ADCCAL bit low in order to avoid a DC
+/* Most of this stuff is pretty self-evident. According to the hardware
+ * dudes, we need to leave the ADCCAL bit low in order to avoid a DC
* offset problem. Weird.
*/
#define EC_RAW_RUN_MODE (EC_DACMUTEN | EC_ADCRSTN | EC_TRIM_MUTEN | \
@@ -574,7 +574,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
for (bit = (1 << 15); bit; bit >>= 1) {
unsigned int value;
-
+
value = emu->ecard_ctrl & ~(EC_TRIM_CSN | EC_TRIM_SDATA);
if (gain & bit)
@@ -598,7 +598,7 @@ static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
EC_SPDIF0_SELECT(EC_DEFAULT_SPDIF0_SEL) |
EC_SPDIF1_SELECT(EC_DEFAULT_SPDIF1_SEL);
- /* Step 0: Set the codec type in the hardware control register
+ /* Step 0: Set the codec type in the hardware control register
* and enable audio output */
hc_value = inl(emu->port + HCFG);
outl(hc_value | HCFG_AUDIOENABLE | HCFG_CODECFORMAT_I2S, emu->port + HCFG);
@@ -685,13 +685,13 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
outl(0x80, emu->port + A_IOCFG); /* Leave bit 7 set during netlist setup. */
write_post = inl(emu->port + A_IOCFG);
udelay(100); /* Allow FPGA memory to clean */
- for(n = 0; n < fw_entry->size; n++) {
- value=fw_entry->data[n];
- for(i = 0; i < 8; i++) {
+ for (n = 0; n < fw_entry->size; n++) {
+ value=fw_entry->data[n];
+ for (i = 0; i < 8; i++) {
reg = 0x80;
if (value & 0x1)
reg = reg | 0x20;
- value = value >> 1;
+ value = value >> 1;
outl(reg, emu->port + A_IOCFG);
write_post = inl(emu->port + A_IOCFG);
outl(reg | 0x40, emu->port + A_IOCFG);
@@ -719,13 +719,13 @@ static int emu1010_firmware_thread(void *data)
msleep_interruptible(1000);
if (kthread_should_stop())
break;
- snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp ); /* IRQ Status */
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® ); /* OPTIONS: Which cards are attached to the EMU */
+ snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp); /* IRQ Status */
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®); /* OPTIONS: Which cards are attached to the EMU */
if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) {
/* Audio Dock attached */
/* Return to Audio Dock programming mode */
snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n");
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK );
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK);
if (emu->card_capabilities->emu_model ==
EMU_MODEL_EMU1010) {
if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) {
@@ -743,11 +743,11 @@ static int emu1010_firmware_thread(void *data)
}
}
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 );
- snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ® );
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0);
+ snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ®);
snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg);
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg);
if ((reg & 0x1f) != 0x15) {
/* FPGA failed to be programmed */
@@ -755,14 +755,14 @@ static int emu1010_firmware_thread(void *data)
continue;
}
snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n");
- snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp );
- snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2 );
+ snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp);
+ snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2);
snd_printk("Audio Dock ver:%d.%d\n",tmp ,tmp2);
/* Sync clocking between 1010 and Dock */
/* Allow DLL to settle */
msleep(10);
/* Unmute all. Default is muted after a firmware load */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
}
}
snd_printk(KERN_INFO "emu1010: firmware thread stopping\n");
@@ -818,7 +818,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
* Lock Tank Memory Cache,
* Mute all codecs.
*/
- outl(0x0005a004, emu->port + HCFG);
+ outl(0x0005a004, emu->port + HCFG);
/* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
* Mute all codecs.
*/
@@ -829,18 +829,18 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
outl(0x0005a000, emu->port + HCFG);
/* Disable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
/* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
snd_printdd("reg1=0x%x\n",reg);
if ((reg & 0x3f) == 0x15) {
/* FPGA netlist already present so clear it */
/* Return to programming mode */
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02);
}
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
snd_printdd("reg2=0x%x\n",reg);
if ((reg & 0x3f) == 0x15) {
/* FPGA failed to return to programming mode */
@@ -876,7 +876,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
}
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
if ((reg & 0x3f) != 0x15) {
/* FPGA failed to be programmed */
snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg);
@@ -884,17 +884,17 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
}
snd_printk(KERN_INFO "emu1010: Hana Firmware loaded\n");
- snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp );
- snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2 );
+ snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp);
+ snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2);
snd_printk("Hana ver:%d.%d\n",tmp ,tmp2);
/* Enable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®);
snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®);
snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp);
/* Optical -> ADAT I/O */
/* 0 : SPDIF
* 1 : ADAT
@@ -904,41 +904,41 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
tmp = 0;
tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : 0) |
(emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : 0);
- snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp );
- snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp );
+ snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp);
+ snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp);
/* Set no attenuation on Audio Dock pads. */
- snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00);
emu->emu1010.adc_pads = 0x00;
- snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
+ snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp);
/* Unmute Audio dock DACs, Headphone source DAC-4. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
- snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
+ snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp);
/* DAC PADs. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f);
emu->emu1010.dac_pads = 0x0f;
- snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
- snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
+ snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp);
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
+ snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp);
/* SPDIF Format. Set Consumer mode, 24bit, copy enable */
- snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10);
/* MIDI routing */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19);
/* Unknown. */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c );
- /* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); // IRQ Enable: All on */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c);
+ /* snd_emu1010_fpga_write(emu, 0x09, 0x0f); IRQ Enable: All on */
/* IRQ Enable: All off */
- snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®);
snd_printk(KERN_INFO "emu1010: Card options3=0x%x\n",reg);
/* Default WCLK set to 48kHz. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00);
/* Word Clock source, Internal 48kHz x1 */
- snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K );
- //snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
+ snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
+ /* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
/* Audio Dock LEDs. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
#if 0
/* For 96kHz */
@@ -992,7 +992,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
* Defaults only, users will set their own values anyways, let's
* just copy/paste.
*/
-
+
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE2_EMU32_8, EMU_SRC_DOCK_MIC_A1);
snd_emu1010_fpga_link_dst_src_write(emu,
@@ -1037,19 +1037,19 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE2_EMU32_F, EMU_SRC_HAMOA_ADC_LEFT2);
#endif
- for (i = 0;i < 0x20; i++ ) {
+ for (i = 0; i < 0x20; i++) {
/* AudioDock Elink <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, 0x0100+i, EMU_SRC_SILENCE);
}
- for (i = 0;i < 4; i++) {
+ for (i = 0; i < 4; i++) {
/* Hana SPDIF Out <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, 0x0200+i, EMU_SRC_SILENCE);
}
- for (i = 0;i < 7; i++) {
+ for (i = 0; i < 7; i++) {
/* Hamoa DAC <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, 0x0300+i, EMU_SRC_SILENCE);
}
- for (i = 0;i < 7; i++) {
+ for (i = 0; i < 7; i++) {
/* Hana ADAT Out <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, EMU_DST_HANA_ADAT + i, EMU_SRC_SILENCE);
}
@@ -1065,30 +1065,30 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
EMU_DST_ALICE_I2S2_LEFT, EMU_SRC_DOCK_ADC3_LEFT1);
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE_I2S2_RIGHT, EMU_SRC_DOCK_ADC3_RIGHT1);
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01 ); // Unmute all
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01); /* Unmute all */
+
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
-
/* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
* Lock Sound Memory Cache, Lock Tank Memory Cache,
* Mute all codecs.
*/
- outl(0x0000a000, emu->port + HCFG);
+ outl(0x0000a000, emu->port + HCFG);
/* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
* Lock Sound Memory Cache, Lock Tank Memory Cache,
* Un-Mute all codecs.
*/
outl(0x0000a001, emu->port + HCFG);
-
+
/* Initial boot complete. Now patches */
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
- snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
- snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19); /* MIDI Route */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c); /* Unknown */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19); /* MIDI Route */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c); /* Unknown */
+ snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp);
+ snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10); /* SPDIF Format spdif (or 0x11 for aes/ebu) */
/* Start Micro/Audio Dock firmware loader thread */
if (!emu->emu1010.firmware_thread) {
@@ -1218,20 +1218,20 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
emu->emu1010.output_source[23] = 28;
}
/* TEMP: Select SPDIF in/out */
- //snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); /* Output spdif */
+ /* snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); Output spdif */
/* TEMP: Select 48kHz SPDIF out */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x0); /* Mute all */
snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x0); /* Default fallback clock 48kHz */
/* Word Clock source, Internal 48kHz x1 */
- snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K );
- //snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
+ snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
+ /* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
emu->emu1010.internal_clock = 1; /* 48000 */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x1); /* Unmute all */
- //snd_emu1010_fpga_write(emu, 0x7, 0x0); /* Mute all */
- //snd_emu1010_fpga_write(emu, 0x7, 0x1); /* Unmute all */
- //snd_emu1010_fpga_write(emu, 0xe, 0x12); /* Set LEDs on Audio Dock */
+ /* snd_emu1010_fpga_write(emu, 0x7, 0x0); Mute all */
+ /* snd_emu1010_fpga_write(emu, 0x7, 0x1); Unmute all */
+ /* snd_emu1010_fpga_write(emu, 0xe, 0x12); Set LEDs on Audio Dock */
return 0;
}
@@ -1253,7 +1253,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
}
if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) {
/* Disable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
}
if (emu->emu1010.firmware_thread)
kthread_stop(emu->emu1010.firmware_thread);
@@ -1278,7 +1278,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
#endif
if (emu->port)
pci_release_regions(emu->pci);
- if (emu->card_capabilities->ca0151_chip) /* P16V */
+ if (emu->card_capabilities->ca0151_chip) /* P16V */
snd_p16v_free(emu);
pci_disable_device(emu->pci);
kfree(emu);
@@ -1301,7 +1301,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: None
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
- .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]",
+ .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1346,7 +1346,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: None
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
- .driver = "Audigy2", .name = "Audigy 4 [SB0610]",
+ .driver = "Audigy2", .name = "Audigy 4 [SB0610]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1359,7 +1359,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* Digital output working. (AC3 not checked, only PCM)
* Audio Mic/Line inputs working.
* Digital input not tested.
- */
+ */
/* DSP: Tina2
* DAC: Wolfson WM8768/WM8568
* ADC: Wolfson WM8775
@@ -1386,7 +1386,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102,
- .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1396,7 +1396,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spk71 = 1} ,
/* Tested by James(a)superbug.co.uk 4th Nov 2007. */
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102,
- .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]",
+ .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]",
.id = "EMU1010",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1405,7 +1405,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.emu_model = EMU_MODEL_EMU1616},
/* Tested by James(a)superbug.co.uk 4th Nov 2007. */
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102,
- .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]",
+ .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]",
.id = "EMU1010",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1436,15 +1436,15 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spk71 = 1,
.emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */
/* Audigy4 (Not PRO) SB0610 */
- {.vendor = 0x1102, .device = 0x0008,
- .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]",
+ {.vendor = 0x1102, .device = 0x0008,
+ .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
.ac97_chip = 1} ,
/* Tested by James(a)superbug.co.uk 3rd July 2005 */
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102,
- .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]",
+ .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1457,7 +1457,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* Just like 0x20021102
*/
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20061102,
- .driver = "Audigy2", .name = "Audigy 2 [SB0350b]",
+ .driver = "Audigy2", .name = "Audigy 2 [SB0350b]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1466,7 +1466,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
- .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1475,7 +1475,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
- .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1492,7 +1492,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: Yes
*/
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10071102,
- .driver = "Audigy2", .name = "Audigy 2 [SB0240]",
+ .driver = "Audigy2", .name = "Audigy 2 [SB0240]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1502,7 +1502,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.adc_1361t = 1, /* 24 bit capture instead of 16bit */
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10051102,
- .driver = "Audigy2", .name = "Audigy 2 EX [1005]",
+ .driver = "Audigy2", .name = "Audigy 2 EX [1005]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1521,7 +1521,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
- .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]",
+ .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1540,44 +1540,44 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00531102,
- .driver = "Audigy", .name = "Audigy 1 [SB0090]",
+ .driver = "Audigy", .name = "Audigy 1 [SB0090]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00521102,
- .driver = "Audigy", .name = "Audigy 1 ES [SB0160]",
+ .driver = "Audigy", .name = "Audigy 1 ES [SB0160]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00511102,
- .driver = "Audigy", .name = "Audigy 1 [SB0090]",
+ .driver = "Audigy", .name = "Audigy 1 [SB0090]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004,
- .driver = "Audigy", .name = "Audigy 1 [Unknown]",
+ .driver = "Audigy", .name = "Audigy 1 [Unknown]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806B1102,
- .driver = "EMU10K1", .name = "SBLive! [SB0105]",
+ .driver = "EMU10K1", .name = "SBLive! [SB0105]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806A1102,
- .driver = "EMU10K1", .name = "SBLive! Value [SB0103]",
+ .driver = "EMU10K1", .name = "SBLive! Value [SB0103]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80691102,
- .driver = "EMU10K1", .name = "SBLive! Value [SB0101]",
+ .driver = "EMU10K1", .name = "SBLive! Value [SB0101]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
@@ -1585,26 +1585,26 @@ static struct snd_emu_chip_details emu_chip_details[] = {
/* Tested by ALSA bug#1680 26th December 2005 */
/* note: It really has SB0220 written on the card. */
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80661102,
- .driver = "EMU10K1", .name = "SB Live 5.1 Dell OEM [SB0220]",
+ .driver = "EMU10K1", .name = "SB Live 5.1 Dell OEM [SB0220]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
/* Tested by Thomas Zehetbauer 27th Aug 2005 */
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80651102,
- .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
+ .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x100a1102,
- .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
+ .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102,
- .driver = "EMU10K1", .name = "SB Live 5.1",
+ .driver = "EMU10K1", .name = "SB Live 5.1",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
@@ -1619,78 +1619,78 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*/
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80511102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4850]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4850]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102,
- .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]",
+ .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80321102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4871]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4871]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80311102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4831]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4831]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80281102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4870]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4870]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
/* Tested by James(a)superbug.co.uk 3rd July 2005 */
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80271102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4832]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4832]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80261102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4830]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4830]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80231102,
- .driver = "EMU10K1", .name = "SB PCI512 [CT4790]",
+ .driver = "EMU10K1", .name = "SB PCI512 [CT4790]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80221102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4780]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4780]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x40011102,
- .driver = "EMU10K1", .name = "E-mu APS [4001]",
+ .driver = "EMU10K1", .name = "E-mu APS [4001]",
.id = "APS",
.emu10k1_chip = 1,
.ecard = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00211102,
- .driver = "EMU10K1", .name = "SBLive! [CT4620]",
+ .driver = "EMU10K1", .name = "SBLive! [CT4620]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00201102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4670]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4670]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002,
- .driver = "EMU10K1", .name = "SB Live [Unknown]",
+ .driver = "EMU10K1", .name = "SB Live [Unknown]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
@@ -1715,7 +1715,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_emu10k1_dev_free,
};
-
+
*remu = NULL;
/* enable PCI device */
@@ -1751,11 +1751,11 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
for (c = emu_chip_details; c->vendor; c++) {
if (c->vendor == pci->vendor && c->device == pci->device) {
if (subsystem) {
- if (c->subsystem && (c->subsystem == subsystem) ) {
+ if (c->subsystem && (c->subsystem == subsystem)) {
break;
} else continue;
} else {
- if (c->subsystem && (c->subsystem != emu->serial) )
+ if (c->subsystem && (c->subsystem != emu->serial))
continue;
if (c->revision && c->revision != emu->revision)
continue;
@@ -1772,13 +1772,13 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
emu->card_capabilities = c;
if (c->subsystem && !subsystem)
snd_printdd("Sound card name=%s\n", c->name);
- else if (subsystem)
+ else if (subsystem)
snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x. Forced to subsytem=0x%x\n",
c->name, pci->vendor, pci->device, emu->serial, c->subsystem);
- else
+ else
snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x.\n",
c->name, pci->vendor, pci->device, emu->serial);
-
+
if (!*card->id && c->id) {
int i, n = 0;
strlcpy(card->id, c->id, sizeof(card->id));
@@ -1913,7 +1913,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
snd_emu10k1_synth_alloc(emu, 4096);
if (emu->reserved_page)
emu->reserved_page->map_locked = 1;
-
+
/* Clear silent pages and set up pointers */
memset(emu->silent_page.area, 0, PAGE_SIZE);
silent_page = emu->silent_page.addr << 1;
@@ -1978,7 +1978,7 @@ static int __devinit alloc_pm_buffer(struct snd_emu10k1 *emu)
if (emu->audigy)
size += ARRAY_SIZE(saved_regs_audigy);
emu->saved_ptr = vmalloc(4 * NUM_G * size);
- if (! emu->saved_ptr)
+ if (!emu->saved_ptr)
return -ENOMEM;
if (snd_emu10k1_efx_alloc_pm_buffer(emu) < 0)
return -ENOMEM;
diff --git a/sound/pci/emu10k1/emu10k1_patch.c b/sound/pci/emu10k1/emu10k1_patch.c
index e10f027..8e59bba 100644
--- a/sound/pci/emu10k1/emu10k1_patch.c
+++ b/sound/pci/emu10k1/emu10k1_patch.c
@@ -88,7 +88,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* try to allocate a memory block */
blocksize = truesize;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
blocksize *= 2;
sp->block = snd_emu10k1_synth_alloc(emu, blocksize);
if (sp->block == NULL) {
@@ -102,7 +102,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* write blank samples at head */
offset = 0;
size = BLANK_HEAD_SIZE;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
size *= 2;
if (offset + size > blocksize)
return -EINVAL;
@@ -111,7 +111,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* copy start->loopend */
size = loopend;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
size *= 2;
if (offset + size > blocksize)
return -EINVAL;
@@ -127,7 +127,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* handle reverse (or bidirectional) loop */
if (sp->v.mode_flags & (SNDRV_SFNT_SAMPLE_BIDIR_LOOP|SNDRV_SFNT_SAMPLE_REVERSE_LOOP)) {
/* copy loop in reverse */
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
int woffset;
unsigned short *wblock = (unsigned short*)block;
woffset = offset / 2;
@@ -160,7 +160,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
size = sp->v.size - loopend;
if (size < 0)
return -EINVAL;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
size *= 2;
if (snd_emu10k1_synth_copy_from_user(emu, sp->block, offset, data, size)) {
snd_emu10k1_synth_free(emu, sp->block);
@@ -184,7 +184,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
#if 0 /* not supported yet */
if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_UNSIGNED) {
/* unsigned -> signed */
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
unsigned short *wblock = (unsigned short*)block;
for (i = 0; i < truesize; i++)
wblock[i] ^= 0x8000;
@@ -197,7 +197,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* recalculate offset */
start_addr = BLANK_HEAD_SIZE * 2;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
start_addr >>= 1;
sp->v.start += start_addr;
sp->v.end += start_addr;
diff --git a/sound/pci/emu10k1/emu10k1_synth.c b/sound/pci/emu10k1/emu10k1_synth.c
index ad7b714..bedb7dd 100644
--- a/sound/pci/emu10k1/emu10k1_synth.c
+++ b/sound/pci/emu10k1/emu10k1_synth.c
@@ -105,7 +105,7 @@ static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
static int __init alsa_emu10k1_synth_init(void)
{
-
+
static struct snd_seq_dev_ops ops = {
snd_emu10k1_synth_new_device,
snd_emu10k1_synth_delete_device,
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 5ff4dbb..0c02d87 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -107,7 +107,7 @@ MODULE_PARM_DESC(enable, "Enable the EMU10K1X soundcard.");
/* Emu10k1x pointer-offset register set, accessed through the PTR and DATA registers */
/********************************************************************************************************/
#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.
@@ -186,7 +186,7 @@ MODULE_PARM_DESC(enable, "Enable the EMU10K1X soundcard.");
* - channel 1 is the rear channel
* - channel 2 is the center/lfe chanel
* Volume is controlled by the AC97 for the front and rear channels by
- * the PCM Playback Volume, Sigmatel Surround Playback Volume and
+ * the PCM Playback Volume, Sigmatel Surround Playback Volume and
* Surround Playback Volume. The Sigmatel 4-Speaker Stereo switch affects
* the front/rear channel mixing in the REAR OUT jack. When using the
* 4-Speaker Stereo, both front and rear channels will be mixed in the
@@ -199,7 +199,7 @@ struct emu10k1x_voice {
struct emu10k1x *emu;
int number;
int use;
-
+
struct emu10k1x_pcm *epcm;
};
@@ -246,7 +246,7 @@ struct emu10k1x {
struct emu10k1x_voice voices[3];
struct emu10k1x_voice capture_voice;
- u32 spdif_bits[3]; // SPDIF out setup
+ u32 spdif_bits[3]; /* SPDIF out setup */
struct snd_dma_buffer dma_buffer;
@@ -255,7 +255,7 @@ struct emu10k1x {
/* hardware definition */
static struct snd_pcm_hardware snd_emu10k1x_playback_hw = {
- .info = (SNDRV_PCM_INFO_MMAP |
+ .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -274,7 +274,7 @@ static struct snd_pcm_hardware snd_emu10k1x_playback_hw = {
};
static struct snd_pcm_hardware snd_emu10k1x_capture_hw = {
- .info = (SNDRV_PCM_INFO_MMAP |
+ .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -292,13 +292,13 @@ static struct snd_pcm_hardware snd_emu10k1x_capture_hw = {
.fifo_size = 0,
};
-static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
- unsigned int reg,
+static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
+ unsigned int reg,
unsigned int chn)
{
unsigned long flags;
unsigned int regptr, val;
-
+
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -308,9 +308,9 @@ static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
return val;
}
-static void snd_emu10k1x_ptr_write(struct emu10k1x *emu,
- unsigned int reg,
- unsigned int chn,
+static void snd_emu10k1x_ptr_write(struct emu10k1x *emu,
+ unsigned int reg,
+ unsigned int chn,
unsigned int data)
{
unsigned int regptr;
@@ -396,10 +396,10 @@ static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream)
return -ENOMEM;
epcm->emu = chip;
epcm->substream = substream;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_emu10k1x_pcm_free_substream;
-
+
runtime->hw = snd_emu10k1x_playback_hw;
return 0;
@@ -418,7 +418,7 @@ static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_runtime *runtime = substream->runtime;
struct emu10k1x_pcm *epcm = runtime->private_data;
- if (! epcm->voice) {
+ if (!epcm->voice) {
epcm->voice = &epcm->emu->voices[substream->pcm->device];
epcm->voice->use = 1;
epcm->voice->epcm = epcm;
@@ -436,7 +436,7 @@ static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream)
if (runtime->private_data == NULL)
return 0;
-
+
epcm = runtime->private_data;
if (epcm->voice) {
@@ -458,8 +458,8 @@ static int snd_emu10k1x_pcm_prepare(struct snd_pcm_substream *substream)
u32 *table_base = (u32 *)(emu->dma_buffer.area+1024*voice);
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
int i;
-
- for(i = 0; i < runtime->periods; i++) {
+
+ for (i = 0; i < runtime->periods; i++) {
*table_base++=runtime->dma_addr+(i*period_size_bytes);
*table_base++=period_size_bytes<<16;
}
@@ -491,7 +491,7 @@ static int snd_emu10k1x_pcm_trigger(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- if(runtime->periods == 2)
+ if (runtime->periods == 2)
snd_emu10k1x_intr_enable(emu, (INTE_CH_0_LOOP | INTE_CH_0_HALF_LOOP) << channel);
else
snd_emu10k1x_intr_enable(emu, INTE_CH_0_LOOP << channel);
@@ -527,10 +527,10 @@ snd_emu10k1x_pcm_pointer(struct snd_pcm_substream *substream)
ptr1 = snd_emu10k1x_ptr_read(emu, PLAYBACK_POINTER, channel);
ptr4 = snd_emu10k1x_ptr_read(emu, PLAYBACK_LIST_PTR, channel);
- if(ptr4 == 0 && ptr1 == frames_to_bytes(runtime, runtime->buffer_size))
+ if (ptr4 == 0 && ptr1 == frames_to_bytes(runtime, runtime->buffer_size))
return 0;
-
- if (ptr3 != ptr4)
+
+ if (ptr3 != ptr4)
ptr1 = snd_emu10k1x_ptr_read(emu, PLAYBACK_POINTER, channel);
ptr2 = bytes_to_frames(runtime, ptr1);
ptr2 += (ptr4 >> 3) * runtime->period_size;
@@ -595,7 +595,7 @@ static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substrea
struct snd_pcm_runtime *runtime = substream->runtime;
struct emu10k1x_pcm *epcm = runtime->private_data;
- if (! epcm->voice) {
+ if (!epcm->voice) {
if (epcm->emu->capture_voice.use)
return -EBUSY;
epcm->voice = &epcm->emu->capture_voice;
@@ -634,7 +634,7 @@ static int snd_emu10k1x_pcm_prepare_capture(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr);
- snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
+ snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); /* buffer size in bytes */
snd_emu10k1x_ptr_write(emu, CAPTURE_POINTER, 0, 0);
snd_emu10k1x_ptr_write(emu, CAPTURE_UNKNOWN, 0, 0);
@@ -652,14 +652,14 @@ static int snd_emu10k1x_pcm_trigger_capture(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- snd_emu10k1x_intr_enable(emu, INTE_CAP_0_LOOP |
+ snd_emu10k1x_intr_enable(emu, INTE_CAP_0_LOOP |
INTE_CAP_0_HALF_LOOP);
snd_emu10k1x_ptr_write(emu, TRIGGER_CHANNEL, 0, snd_emu10k1x_ptr_read(emu, TRIGGER_CHANNEL, 0)|TRIGGER_CAPTURE);
epcm->running = 1;
break;
case SNDRV_PCM_TRIGGER_STOP:
epcm->running = 0;
- snd_emu10k1x_intr_disable(emu, INTE_CAP_0_LOOP |
+ snd_emu10k1x_intr_disable(emu, INTE_CAP_0_LOOP |
INTE_CAP_0_HALF_LOOP);
snd_emu10k1x_ptr_write(emu, TRIGGER_CHANNEL, 0, snd_emu10k1x_ptr_read(emu, TRIGGER_CHANNEL, 0) & ~(TRIGGER_CAPTURE));
break;
@@ -706,7 +706,7 @@ static unsigned short snd_emu10k1x_ac97_read(struct snd_ac97 *ac97,
struct emu10k1x *emu = ac97->private_data;
unsigned long flags;
unsigned short val;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
val = inw(emu->port + AC97DATA);
@@ -719,7 +719,7 @@ static void snd_emu10k1x_ac97_write(struct snd_ac97 *ac97,
{
struct emu10k1x *emu = ac97->private_data;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
outw(val, emu->port + AC97DATA);
@@ -735,7 +735,7 @@ static int snd_emu10k1x_ac97(struct emu10k1x *chip)
.write = snd_emu10k1x_ac97_write,
.read = snd_emu10k1x_ac97_read,
};
-
+
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
return err;
pbus->no_vra = 1; /* we don't need VRA */
@@ -749,26 +749,26 @@ static int snd_emu10k1x_ac97(struct emu10k1x *chip)
static int snd_emu10k1x_free(struct emu10k1x *chip)
{
snd_emu10k1x_ptr_write(chip, TRIGGER_CHANNEL, 0, 0);
- // disable interrupts
+ /* disable interrupts */
outl(0, chip->port + INTE);
- // disable audio
+ /* disable audio */
outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
/* release the irq */
if (chip->irq >= 0)
free_irq(chip->irq, chip);
- // release the i/o port
+ /* release the i/o port */
release_and_free_resource(chip->res_port);
- // release the DMA
+ /* release the DMA */
if (chip->dma_buffer.area) {
snd_dma_free_pages(&chip->dma_buffer);
}
pci_disable_device(chip->pci);
- // release the data
+ /* release the data */
kfree(chip);
return 0;
}
@@ -790,43 +790,43 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id)
status = inl(chip->port + IPR);
- if (! status)
+ if (!status)
return IRQ_NONE;
- // capture interrupt
+ /* capture interrupt */
if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) {
struct emu10k1x_voice *cap_voice = &chip->capture_voice;
if (cap_voice->use)
snd_emu10k1x_pcm_interrupt(chip, cap_voice);
else
- snd_emu10k1x_intr_disable(chip,
+ snd_emu10k1x_intr_disable(chip,
INTE_CAP_0_LOOP |
INTE_CAP_0_HALF_LOOP);
}
-
+
mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP;
for (i = 0; i < 3; i++) {
if (status & mask) {
if (pvoice->use)
snd_emu10k1x_pcm_interrupt(chip, pvoice);
- else
+ else
snd_emu10k1x_intr_disable(chip, mask);
}
pvoice++;
mask <<= 1;
}
-
+
if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) {
if (chip->midi.interrupt)
chip->midi.interrupt(chip, status);
else
snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE);
}
-
- // acknowledge the interrupt if necessary
+
+ /* acknowledge the interrupt if necessary */
outl(status, chip->port + IPR);
- // snd_printk(KERN_INFO "interrupt %08x\n", status);
+ /* snd_printk(KERN_INFO "interrupt %08x\n", status); */
return IRQ_HANDLED;
}
@@ -835,17 +835,17 @@ static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct s
struct snd_pcm *pcm;
int err;
int capture = 0;
-
+
if (rpcm)
*rpcm = NULL;
if (device == 0)
capture = 1;
-
+
if ((err = snd_pcm_new(emu->card, "emu10k1x", device, 1, capture, &pcm)) < 0)
return err;
-
+
pcm->private_data = emu;
-
+
switch(device) {
case 0:
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1x_playback_ops);
@@ -873,12 +873,12 @@ static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct s
emu->pcm = pcm;
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ snd_dma_pci_data(emu->pci),
32*1024, 32*1024);
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -916,10 +916,10 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
spin_lock_init(&chip->emu_lock);
spin_lock_init(&chip->voice_lock);
-
+
chip->port = pci_resource_start(pci, 0);
if ((chip->res_port = request_region(chip->port, 8,
- "EMU10K1X")) == NULL) {
+ "EMU10K1X")) == NULL) {
snd_printk(KERN_ERR "emu10k1x: cannot allocate the port 0x%lx\n", chip->port);
snd_emu10k1x_free(chip);
return -EBUSY;
@@ -932,8 +932,8 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
return -EBUSY;
}
chip->irq = pci->irq;
-
- if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
+
+ if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
4 * 1024, &chip->dma_buffer) < 0) {
snd_emu10k1x_free(chip);
return -ENOMEM;
@@ -947,9 +947,9 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
snd_printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model,
chip->revision, chip->serial);
- outl(0, chip->port + INTE);
+ outl(0, chip->port + INTE);
- for(ch = 0; ch < 3; ch++) {
+ for (ch = 0; ch < 3; ch++) {
chip->voices[ch].emu = chip;
chip->voices[ch].number = ch;
}
@@ -969,27 +969,27 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
* P = 0 (Consumer)
*/
snd_emu10k1x_ptr_write(chip, SPCS0, 0,
- chip->spdif_bits[0] =
+ chip->spdif_bits[0] =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
snd_emu10k1x_ptr_write(chip, SPCS1, 0,
- chip->spdif_bits[1] =
+ chip->spdif_bits[1] =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
snd_emu10k1x_ptr_write(chip, SPCS2, 0,
- chip->spdif_bits[2] =
+ chip->spdif_bits[2] =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
- snd_emu10k1x_ptr_write(chip, SPDIF_SELECT, 0, 0x700); // disable SPDIF
- snd_emu10k1x_ptr_write(chip, ROUTING, 0, 0x1003F); // routing
- snd_emu10k1x_gpio_write(chip, 0x1080); // analog mode
+ snd_emu10k1x_ptr_write(chip, SPDIF_SELECT, 0, 0x700); /* disable SPDIF */
+ snd_emu10k1x_ptr_write(chip, ROUTING, 0, 0x1003F); /* routing */
+ snd_emu10k1x_gpio_write(chip, 0x1080); /* analog mode */
outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
@@ -1002,7 +1002,7 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
return 0;
}
-static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
+static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct emu10k1x *emu = entry->private_data;
@@ -1011,16 +1011,16 @@ static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=4) {
+ for (i = 0; i < 0x20; i += 4) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inl(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
snd_iprintf(buffer, "Register %02X: %08lX\n", i, value);
}
snd_iprintf(buffer, "\nRegisters\n\n");
- for(i = 0; i <= 0x48; i++) {
+ for (i = 0; i <= 0x48; i++) {
value = snd_emu10k1x_ptr_read(emu, i, 0);
- if(i < 0x10 || (i >= 0x20 && i < 0x40)) {
+ if (i < 0x10 || (i >= 0x20 && i < 0x40)) {
value1 = snd_emu10k1x_ptr_read(emu, i, 1);
value2 = snd_emu10k1x_ptr_read(emu, i, 2);
snd_iprintf(buffer, "%02X: %08lX %08lX %08lX\n", i, value, value1, value2);
@@ -1030,7 +1030,7 @@ static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
}
}
-static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
+static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct emu10k1x *emu = entry->private_data;
@@ -1041,8 +1041,8 @@ static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
continue;
- if ((reg < 0x49) && (reg >= 0) && (val <= 0xffffffff)
- && (channel_id >= 0) && (channel_id <= 2) )
+ if ((reg < 0x49) && (reg >= 0) && (val <= 0xffffffff)
+ && (channel_id >= 0) && (channel_id <= 2))
snd_emu10k1x_ptr_write(emu, reg, channel_id, val);
}
}
@@ -1050,14 +1050,14 @@ static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu)
{
struct snd_info_entry *entry;
-
- if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
+
+ if (!snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu10k1x_proc_reg_read);
entry->c.text.write = snd_emu10k1x_proc_reg_write;
entry->mode |= S_IWUSR;
entry->private_data = emu;
}
-
+
return 0;
}
@@ -1080,15 +1080,15 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,
unsigned int val;
int change = 0;
- val = ucontrol->value.integer.value[0] ;
+ val = ucontrol->value.integer.value[0];
if (val) {
- // enable spdif output
+ /* enable spdif output */
snd_emu10k1x_ptr_write(emu, SPDIF_SELECT, 0, 0x000);
snd_emu10k1x_ptr_write(emu, ROUTING, 0, 0x700);
snd_emu10k1x_gpio_write(emu, 0x1000);
} else {
- // disable spdif output
+ /* disable spdif output */
snd_emu10k1x_ptr_write(emu, SPDIF_SELECT, 0, 0x700);
snd_emu10k1x_ptr_write(emu, ROUTING, 0, 0x1003F);
snd_emu10k1x_gpio_write(emu, 0x1080);
@@ -1317,7 +1317,7 @@ static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
struct emu10k1x *emu;
struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
-
+
emu = midi->emu;
if (snd_BUG_ON(!emu))
return -ENXIO;
@@ -1439,7 +1439,7 @@ static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *subst
if (up) {
int max = 4;
unsigned char byte;
-
+
/* try to send some amount of bytes here before interrupts */
spin_lock_irqsave(&midi->output_lock, flags);
while (max > 0) {
@@ -1575,7 +1575,7 @@ static int __devinit snd_emu10k1x_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
if ((err = snd_emu10k1x_midi(chip)) < 0) {
snd_card_free(card);
return err;
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 7dba08f..f8ce97b 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -52,7 +52,7 @@
/*
* Tables
- */
+ */
static char *fxbuses[16] = {
/* 0x00 */ "PCM Left",
@@ -303,7 +303,7 @@ static const u32 onoff_table[2] = {
/*
*/
-
+
static inline mm_segment_t snd_enter_user(void)
{
mm_segment_t fs = get_fs();
@@ -342,7 +342,7 @@ static int snd_emu10k1_gpr_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl
(struct snd_emu10k1_fx8010_ctl *) kcontrol->private_value;
unsigned long flags;
unsigned int i;
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
for (i = 0; i < ctl->vcount; i++)
ucontrol->value.integer.value[i] = ctl->value[i];
@@ -359,7 +359,7 @@ static int snd_emu10k1_gpr_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl
unsigned int nval, val;
unsigned int i, j;
int change = 0;
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
for (i = 0; i < ctl->vcount; i++) {
nval = ucontrol->value.integer.value[i];
@@ -398,7 +398,7 @@ static int snd_emu10k1_gpr_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl
break;
}
}
- __error:
+__error:
spin_unlock_irqrestore(&emu->reg_lock, flags);
return change;
}
@@ -431,7 +431,7 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
{
struct snd_emu10k1_fx8010_irq *irq;
unsigned long flags;
-
+
irq = kmalloc(sizeof(*irq), GFP_ATOMIC);
if (irq == NULL)
return -ENOMEM;
@@ -459,7 +459,7 @@ int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
{
struct snd_emu10k1_fx8010_irq *tmp;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->fx8010.irq_lock, flags);
if ((tmp = emu->fx8010.irq_handlers) == irq) {
emu->fx8010.irq_handlers = tmp->next;
@@ -703,7 +703,7 @@ static int copy_gctl_to_user(struct snd_emu10k1 *emu,
if (emu->support_tlv)
return copy_to_user(&_gctl[idx], gctl, sizeof(*gctl));
-
+
octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl;
return copy_to_user(&octl[idx], gctl, sizeof(*octl));
}
@@ -716,7 +716,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
struct snd_ctl_elem_id id;
struct snd_emu10k1_fx8010_control_gpr *gctl;
int err;
-
+
for (i = 0, _id = icode->gpr_del_controls;
i < icode->gpr_del_control_count; i++, _id++) {
if (copy_from_user(&id, _id, sizeof(id)))
@@ -725,7 +725,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
return -ENOENT;
}
gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
- if (! gctl)
+ if (!gctl)
return -ENOMEM;
err = 0;
for (i = 0; i < icode->gpr_add_control_count; i++) {
@@ -755,7 +755,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
goto __error;
}
}
- __error:
+__error:
kfree(gctl);
return err;
}
@@ -763,7 +763,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
static void snd_emu10k1_ctl_private_free(struct snd_kcontrol *kctl)
{
struct snd_emu10k1_fx8010_ctl *ctl;
-
+
ctl = (struct snd_emu10k1_fx8010_ctl *) kctl->private_value;
kctl->private_value = 0;
list_del(&ctl->list);
@@ -801,7 +801,7 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,
err = -EINVAL;
goto __error;
}
- if (! gctl->id.name[0]) {
+ if (!gctl->id.name[0]) {
err = -EINVAL;
goto __error;
}
@@ -857,7 +857,7 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,
}
snd_emu10k1_gpr_ctl_put(ctl->kcontrol, val);
}
- __error:
+__error:
kfree(nctl);
kfree(gctl);
kfree(val);
@@ -872,7 +872,7 @@ static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu,
struct snd_ctl_elem_id __user *_id;
struct snd_emu10k1_fx8010_ctl *ctl;
struct snd_card *card = emu->card;
-
+
for (i = 0, _id = icode->gpr_del_controls;
i < icode->gpr_del_control_count; i++, _id++) {
if (copy_from_user(&id, _id, sizeof(id)))
@@ -896,7 +896,7 @@ static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu,
struct snd_ctl_elem_id *id;
gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
- if (! gctl)
+ if (!gctl)
return -ENOMEM;
list_for_each_entry(ctl, &emu->fx8010.gpr_ctl, list) {
@@ -959,7 +959,7 @@ static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu,
snd_emu10k1_ptr_write(emu, A_DBG, 0, emu->fx8010.dbg);
else
snd_emu10k1_ptr_write(emu, DBG, 0, emu->fx8010.dbg);
- __error:
+__error:
mutex_unlock(&emu->fx8010.lock);
return err;
}
@@ -1023,7 +1023,7 @@ static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,
for (i = 0; i < pcm->channels; i++)
pcm->etram[i] = ipcm->etram[i];
}
- __error:
+__error:
spin_unlock_irq(&emu->reg_lock);
mutex_unlock(&emu->fx8010.lock);
return err;
@@ -1075,7 +1075,7 @@ snd_emu10k1_init_mono_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
ctl->min = 0;
ctl->max = 100;
ctl->tlv = snd_emu10k1_db_scale1;
- ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
+ ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
}
static void __devinit
@@ -1177,7 +1177,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
/* clear free GPRs */
for (i = 0; i < 512; i++)
set_bit(i, icode->gpr_valid);
-
+
/* clear TRAM data & address lines */
for (i = 0; i < 256; i++)
set_bit(i, icode->tram_valid);
@@ -1210,7 +1210,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Surround Playback Volume", gpr, 100);
gpr += 2;
-
+
/* PCM Side Playback (independent from stereo mix) */
if (emu->card_capabilities->spk71) {
A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_SIDE));
@@ -1228,7 +1228,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LFE));
snd_emu10k1_init_mono_control(&controls[nctl++], "PCM LFE Playback Volume", gpr, 100);
gpr++;
-
+
/*
* Stereo Mix
*/
@@ -1255,7 +1255,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr+1), A_FXBUS(FXBUS_MIDI_RIGHT));
snd_emu10k1_init_stereo_control(&controls[nctl++], "Synth Capture Volume", gpr, 0);
gpr += 2;
-
+
/*
* inputs
*/
@@ -1288,7 +1288,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
snd_emu10k1_init_stereo_control(&controls[nctl++], "Mic Capture Volume", gpr, 0);
gpr += 2;
- /* mic capture buffer */
+ /* mic capture buffer */
A_OP(icode, &ptr, iINTERP, A_EXTOUT(A_EXTOUT_MIC_CAP), A_EXTIN(A_EXTIN_AC97_L), 0xcd, A_EXTIN(A_EXTIN_AC97_R));
/* Audigy CD Playback Volume */
@@ -1331,7 +1331,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
emu->card_capabilities->ac97_chip ? "Line2 Capture Volume" : "Line Capture Volume",
gpr, 0);
gpr += 2;
-
+
/* Philips ADC Playback Volume */
A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_ADC_L);
A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_ADC_R);
@@ -1357,13 +1357,13 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
emu->card_capabilities->ac97_chip ? "Aux2 Capture Volume" : "Aux Capture Volume",
gpr, 0);
gpr += 2;
-
+
/* Stereo Mix Front Playback Volume */
A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_GPR(playback), A_GPR(gpr), A_GPR(stereo_mix));
A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_GPR(playback+1), A_GPR(gpr+1), A_GPR(stereo_mix+1));
snd_emu10k1_init_stereo_control(&controls[nctl++], "Front Playback Volume", gpr, 100);
gpr += 2;
-
+
/* Stereo Mix Surround Playback */
A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_GPR(playback+2), A_GPR(gpr), A_GPR(stereo_mix));
A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_GPR(playback+3), A_GPR(gpr+1), A_GPR(stereo_mix+1));
@@ -1381,7 +1381,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_GPR(playback+5), A_GPR(gpr), A_GPR(tmp));
snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 0);
gpr++;
-
+
if (emu->card_capabilities->spk71) {
/* Stereo Mix Side Playback */
A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_GPR(playback+6), A_GPR(gpr), A_GPR(stereo_mix));
@@ -1420,7 +1420,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 6), A_GPR(playback + 6), A_C_00000000, A_C_00000000); /* side left */
A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 7), A_GPR(playback + 7), A_C_00000000, A_C_00000000); /* side right */
}
-
+
ctl = &controls[nctl + 0];
ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
@@ -1529,7 +1529,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
}
}
- /* IEC958 Optical Raw Playback Switch */
+ /* IEC958 Optical Raw Playback Switch */
gpr_map[gpr++] = 0;
gpr_map[gpr++] = 0x1008;
gpr_map[gpr++] = 0xffff0000;
@@ -1552,7 +1552,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
}
snd_emu10k1_init_stereo_onoff_control(controls + nctl++, SNDRV_CTL_NAME_IEC958("Optical Raw ",PLAYBACK,SWITCH), gpr, 0);
gpr += 2;
-
+
A_PUT_STEREO_OUTPUT(A_EXTOUT_REAR_L, A_EXTOUT_REAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
A_PUT_OUTPUT(A_EXTOUT_CENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS);
A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
@@ -1569,10 +1569,10 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
if (emu->card_capabilities->ca0108_chip) {
snd_printk("EMU2 inputs on\n");
for (z = 0; z < 0x10; z++) {
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
bit_shifter16,
A3_EMU32IN(z),
- A_FXBUS2(z*2) );
+ A_FXBUS2(z*2));
}
} else {
snd_printk("EMU inputs on\n");
@@ -1584,7 +1584,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
* so all other A_P16VIN channels will need to also be delayed
*/
/* Left ADC in. 1 of 2 */
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0));
/* Right ADC in 1 of 2 */
gpr_map[gpr++] = 0x00000000;
/* Delaying by one sample: instead of copying the input
@@ -1592,28 +1592,28 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
* we use an auxiliary register, delaying the value by one
* sample
*/
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x1), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(4) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(4));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x2), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(6) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(6));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x3), A_C_00000000, A_C_00000000);
/* For 96kHz mode */
/* Left ADC in. 2 of 2 */
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0x8) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0x8));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x4), A_C_00000000, A_C_00000000);
/* Right ADC in 2 of 2 */
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xa) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xa));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x5), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xc) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xc));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x6), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x7), A_C_00000000, A_C_00000000);
/* Pavel Hofman - we still have voices, A_FXBUS2s, and
* A_P16VINs available -
@@ -1692,7 +1692,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
A_OP(icode, &ptr, iACC3, A_FXBUS2(z), A_C_00000000, A_C_00000000, A_EXTIN(z));
}
}
-
+
#endif /* JCD test */
/*
* ok, set up done..
@@ -1715,7 +1715,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
emu->support_tlv = 0; /* clear again */
snd_leave_user(seg);
- __err:
+__err:
kfree(controls);
if (icode != NULL) {
kfree((void __force *)icode->gpr_map);
@@ -1804,7 +1804,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
icode->tram_data_map = icode->gpr_map + 256;
icode->tram_addr_map = icode->tram_data_map + 160;
icode->code = icode->tram_addr_map + 160;
-
+
/* clear free GPRs */
for (i = 0; i < 256; i++)
set_bit(i, icode->gpr_valid);
@@ -1904,7 +1904,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
/* 18: */ OP(icode, &ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_MINUS, C_00000001);
/* 19: */ OP(icode, &ptr, iACC3, GPR(tmp + 0), C_00000000, C_00000000, C_00000000);
/* 1a: */ OP(icode, &ptr, iACC3, GPR(ipcm->gpr_ptr), GPR(tmp + 0), C_00000000, C_00000000);
-
+
/* 1b: */ OP(icode, &ptr, iACC3, GPR(ipcm->gpr_tmpcount), GPR(ipcm->gpr_tmpcount), C_ffffffff, C_00000000);
/* 1c: */ OP(icode, &ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002);
/* 1d: */ OP(icode, &ptr, iACC3, GPR(ipcm->gpr_tmpcount), GPR(ipcm->gpr_count), C_00000000, C_00000000);
@@ -1931,7 +1931,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
VOLUME(icode, &ptr, playback + 2 + z, z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Wave Surround Playback Volume", gpr, 0);
gpr += 2;
-
+
/* Wave Center/LFE Playback Volume */
OP(icode, &ptr, iACC3, GPR(tmp + 0), FXBUS(FXBUS_PCM_LEFT), FXBUS(FXBUS_PCM_RIGHT), C_00000000);
OP(icode, &ptr, iMACINT0, GPR(tmp + 0), C_00000000, GPR(tmp + 0), C_00000002);
@@ -2016,14 +2016,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
VOLUME_ADDIN(icode, &ptr, capture + 1, EXTIN_AC97_R, gpr); gpr++;
snd_emu10k1_init_stereo_control(controls + i++, "AC97 Capture Volume", gpr-2, 100);
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_SPDIF_CD_L)|(1<<EXTIN_SPDIF_CD_R))) {
/* IEC958 TTL Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_SPDIF_CD_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, SNDRV_CTL_NAME_IEC958("TTL ",PLAYBACK,VOLUME), gpr, 0);
gpr += 2;
-
+
/* IEC958 TTL Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_SPDIF_CD_L + z, gpr + 2 + z);
@@ -2033,14 +2033,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, SNDRV_CTL_NAME_IEC958("TTL ",CAPTURE,SWITCH), gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_ZOOM_L)|(1<<EXTIN_ZOOM_R))) {
/* Zoom Video Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_ZOOM_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Zoom Video Playback Volume", gpr, 0);
gpr += 2;
-
+
/* Zoom Video Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_ZOOM_L + z, gpr + 2 + z);
@@ -2050,14 +2050,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Zoom Video Capture Switch", gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_TOSLINK_L)|(1<<EXTIN_TOSLINK_R))) {
/* IEC958 Optical Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_TOSLINK_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, SNDRV_CTL_NAME_IEC958("LiveDrive ",PLAYBACK,VOLUME), gpr, 0);
gpr += 2;
-
+
/* IEC958 Optical Capture Volume */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_TOSLINK_L + z, gpr + 2 + z);
@@ -2067,14 +2067,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, SNDRV_CTL_NAME_IEC958("LiveDrive ",CAPTURE,SWITCH), gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_LINE1_L)|(1<<EXTIN_LINE1_R))) {
/* Line LiveDrive Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_LINE1_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Line LiveDrive Playback Volume", gpr, 0);
gpr += 2;
-
+
/* Line LiveDrive Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_LINE1_L + z, gpr + 2 + z);
@@ -2084,14 +2084,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Line LiveDrive Capture Switch", gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_COAX_SPDIF_L)|(1<<EXTIN_COAX_SPDIF_R))) {
/* IEC958 Coax Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_COAX_SPDIF_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, SNDRV_CTL_NAME_IEC958("Coaxial ",PLAYBACK,VOLUME), gpr, 0);
gpr += 2;
-
+
/* IEC958 Coax Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_COAX_SPDIF_L + z, gpr + 2 + z);
@@ -2101,7 +2101,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, SNDRV_CTL_NAME_IEC958("Coaxial ",CAPTURE,SWITCH), gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_LINE2_L)|(1<<EXTIN_LINE2_R))) {
/* Line LiveDrive Playback Volume */
for (z = 0; z < 2; z++)
@@ -2109,7 +2109,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_control(controls + i++, "Line2 LiveDrive Playback Volume", gpr, 0);
controls[i-1].id.index = 1;
gpr += 2;
-
+
/* Line LiveDrive Capture Volume */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_LINE2_L + z, gpr + 2 + z);
@@ -2249,7 +2249,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
gpr += 4;
}
-
+
if (emu->fx8010.extout_mask & ((1<<EXTOUT_REAR_L)|(1<<EXTOUT_REAR_R)))
for (z = 0; z < 2; z++)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_REAR_L + z), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 2 + z), C_00000000, C_00000000);
@@ -2277,12 +2277,12 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ALFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
#endif
}
-
+
#ifndef EMU10K1_CAPTURE_DIGITAL_OUT
for (z = 0; z < 2; z++)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ADC_CAP_L + z), GPR(capture + z), C_00000000, C_00000000);
#endif
-
+
if (emu->fx8010.extout_mask & (1<<EXTOUT_MIC_CAP))
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_MIC_CAP), GPR(capture + 2), C_00000000, C_00000000);
@@ -2291,10 +2291,10 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
/* On the Live! 5.1, FXBUS2(1) and FXBUS(2) are shared with EXTOUT_ACENTER
* and EXTOUT_ALFE, so we can't connect inputs to them for multitrack recording.
*
- * Since only 14 of the 16 EXTINs are used, this is not a big problem.
- * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture
- * 0 and 3, then the rest of the EXTINs to the corresponding FX capture
- * channel. Multitrack recorders will still see the center/lfe output signal
+ * Since only 14 of the 16 EXTINs are used, this is not a big problem.
+ * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture
+ * 0 and 3, then the rest of the EXTINs to the corresponding FX capture
+ * channel. Multitrack recorders will still see the center/lfe output signal
* on the second and third channels.
*/
OP(icode, &ptr, iACC3, FXBUS2(14), C_00000000, C_00000000, EXTIN(0));
@@ -2307,7 +2307,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
for (z = 0; z < 16; z++)
OP(icode, &ptr, iACC3, FXBUS2(z), C_00000000, C_00000000, EXTIN(z));
}
-
+
if (gpr > tmp) {
snd_BUG();
@@ -2319,7 +2319,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
err = -EIO;
goto __err;
}
-
+
/* clear remaining instruction memory */
while (ptr < 0x200)
OP(icode, &ptr, iACC3, C_00000000, C_00000000, C_00000000, C_00000000);
@@ -2335,7 +2335,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_leave_user(seg);
if (err >= 0)
err = snd_emu10k1_ipcm_poke(emu, ipcm);
- __err:
+__err:
kfree(ipcm);
kfree(controls);
if (icode != NULL) {
@@ -2471,7 +2471,7 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
unsigned int addr;
void __user *argp = (void __user *)arg;
int res;
-
+
switch (cmd) {
case SNDRV_EMU10K1_IOCTL_PVERSION:
emu->support_tlv = 1;
@@ -2617,7 +2617,7 @@ int __devinit snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct
{
struct snd_hwdep *hw;
int err;
-
+
if (rhwdep)
*rhwdep = NULL;
if ((err = snd_hwdep_new(emu->card, "FX8010", device, &hw)) < 0)
@@ -2640,16 +2640,16 @@ int __devinit snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu)
len = emu->audigy ? 0x200 : 0x100;
emu->saved_gpr = kmalloc(len * 4, GFP_KERNEL);
- if (! emu->saved_gpr)
+ if (!emu->saved_gpr)
return -ENOMEM;
len = emu->audigy ? 0x100 : 0xa0;
emu->tram_val_saved = kmalloc(len * 4, GFP_KERNEL);
emu->tram_addr_saved = kmalloc(len * 4, GFP_KERNEL);
- if (! emu->tram_val_saved || ! emu->tram_addr_saved)
+ if (!emu->tram_val_saved || ! emu->tram_addr_saved)
return -ENOMEM;
len = emu->audigy ? 2 * 1024 : 2 * 512;
emu->saved_icode = vmalloc(len * 4);
- if (! emu->saved_icode)
+ if (!emu->saved_icode)
return -ENOMEM;
return 0;
}
@@ -2721,7 +2721,7 @@ void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu)
for (i = 0; i < len; i++) {
snd_emu10k1_ptr_write(emu, TANKMEMDATAREGBASE + i, 0,
emu->tram_val_saved[i]);
- if (! emu->audigy)
+ if (!emu->audigy)
snd_emu10k1_ptr_write(emu, TANKMEMADDRREGBASE + i, 0,
emu->tram_addr_saved[i]);
else {
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index f34bbfb..a1366e0 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -83,7 +83,7 @@ static int snd_emu10k1_spdif_get_mask(struct snd_kcontrol *kcontrol,
* Items labels in enum mixer controls assigning source data to
* each destination
*/
-static char *emu1010_src_texts[] = {
+static char *emu1010_src_texts[] = {
"Silence",
"Dock Mic A",
"Dock Mic B",
@@ -615,12 +615,12 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct
unsigned int val, cache;
val = ucontrol->value.integer.value[0];
cache = emu->emu1010.adc_pads;
- if (val == 1)
+ if (val == 1)
cache = cache | mask;
else
cache = cache & ~mask;
if (cache != emu->emu1010.adc_pads) {
- snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache );
+ snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache);
emu->emu1010.adc_pads = cache;
}
@@ -663,12 +663,12 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct
unsigned int val, cache;
val = ucontrol->value.integer.value[0];
cache = emu->emu1010.dac_pads;
- if (val == 1)
+ if (val == 1)
cache = cache | mask;
else
cache = cache & ~mask;
if (cache != emu->emu1010.dac_pads) {
- snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache);
emu->emu1010.dac_pads = cache;
}
@@ -702,7 +702,7 @@ static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol,
static char *texts[4] = {
"44100", "48000", "SPDIF", "ADAT"
};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 4;
@@ -710,8 +710,8 @@ static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol,
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
-
-
+
+
}
static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol,
@@ -730,7 +730,7 @@ static int snd_emu1010_internal_clock_put(struct snd_kcontrol *kcontrol,
unsigned int val;
int change = 0;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
/* Limit: uinfo->value.enumerated.items = 4; */
if (val >= 4)
return -EINVAL;
@@ -741,75 +741,75 @@ static int snd_emu1010_internal_clock_put(struct snd_kcontrol *kcontrol,
case 0:
/* 44100 */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_44_1K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_44_1K);
/* Word Clock source, Internal 44.1kHz x1 */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_INT_44_1K | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_INT_44_1K | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
- EMU_HANA_DOCK_LEDS_2_44K | EMU_HANA_DOCK_LEDS_2_LOCK );
+ EMU_HANA_DOCK_LEDS_2_44K | EMU_HANA_DOCK_LEDS_2_LOCK);
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
break;
case 1:
/* 48000 */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
/* Word Clock source, Internal 48kHz x1 */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
- EMU_HANA_DOCK_LEDS_2_48K | EMU_HANA_DOCK_LEDS_2_LOCK );
+ EMU_HANA_DOCK_LEDS_2_48K | EMU_HANA_DOCK_LEDS_2_LOCK);
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
break;
-
+
case 2: /* Take clock from S/PDIF IN */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
/* Word Clock source, sync to S/PDIF input */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_HANA_SPDIF_IN | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_HANA_SPDIF_IN | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
- EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK );
- /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
+ EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK);
+ /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
break;
-
- case 3:
+
+ case 3:
/* Take clock from ADAT IN */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
/* Word Clock source, sync to ADAT input */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_HANA_ADAT_IN | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_HANA_ADAT_IN | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK );
- /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK);
+ /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
-
-
- break;
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
+
+
+ break;
}
}
return change;
@@ -958,7 +958,7 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol,
return 0;
if (ogain != ngain) {
if (emu->i2c_capture_source == source_id)
- snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
+ snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
emu->i2c_capture_volume[source_id][0] = ngain;
change = 1;
}
@@ -1014,7 +1014,7 @@ static int snd_audigy_spdif_output_rate_get(struct snd_kcontrol *kcontrol,
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int tmp;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
@@ -1058,7 +1058,7 @@ static int snd_audigy_spdif_output_rate_put(struct snd_kcontrol *kcontrol,
break;
}
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
reg = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
tmp = reg & ~A_SPDIF_RATE_MASK;
@@ -1182,7 +1182,7 @@ static int snd_emu10k1_send_routing_get(struct snd_kcontrol *kcontrol,
spin_lock_irqsave(&emu->reg_lock, flags);
for (voice = 0; voice < 3; voice++)
for (idx = 0; idx < num_efx; idx++)
- ucontrol->value.integer.value[(voice * num_efx) + idx] =
+ ucontrol->value.integer.value[(voice * num_efx) + idx] =
mix->send_routing[voice][idx] & mask;
spin_unlock_irqrestore(&emu->reg_lock, flags);
return 0;
@@ -1207,7 +1207,7 @@ static int snd_emu10k1_send_routing_put(struct snd_kcontrol *kcontrol,
mix->send_routing[voice][idx] = val;
change = 1;
}
- }
+ }
if (change && mix->epcm) {
if (mix->epcm->voices[0] && mix->epcm->voices[1]) {
update_emu10k1_fxrt(emu, mix->epcm->voices[0]->number,
@@ -1395,7 +1395,7 @@ static int snd_emu10k1_efx_send_routing_get(struct snd_kcontrol *kcontrol,
spin_lock_irqsave(&emu->reg_lock, flags);
for (idx = 0; idx < num_efx; idx++)
- ucontrol->value.integer.value[idx] =
+ ucontrol->value.integer.value[idx] =
mix->send_routing[0][idx] & mask;
spin_unlock_irqrestore(&emu->reg_lock, flags);
return 0;
@@ -1419,7 +1419,7 @@ static int snd_emu10k1_efx_send_routing_put(struct snd_kcontrol *kcontrol,
mix->send_routing[0][idx] = val;
change = 1;
}
- }
+ }
if (change && mix->epcm) {
if (mix->epcm->voices[ch]) {
@@ -1581,7 +1581,7 @@ static int snd_emu10k1_shared_spdif_get(struct snd_kcontrol *kcontrol,
if (emu->card_capabilities->invert_shared_spdif)
ucontrol->value.integer.value[0] =
!ucontrol->value.integer.value[0];
-
+
return 0;
}
@@ -1597,7 +1597,7 @@ static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol,
if (emu->card_capabilities->invert_shared_spdif)
sw = !sw;
spin_lock_irqsave(&emu->reg_lock, flags);
- if ( emu->card_capabilities->i2c_adc) {
+ if (emu->card_capabilities->i2c_adc) {
/* Do nothing for Audigy 2 ZS Notebook */
} else if (emu->audigy) {
reg = inl(emu->port + A_IOCFG);
@@ -1738,7 +1738,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
NULL
};
static char *audigy_rename_ctls_i2c_adc[] = {
- //"Analog Mix Capture Volume","OLD Analog Mix Capture Volume",
+ /*"Analog Mix Capture Volume","OLD Analog Mix Capture Volume", */
"Line Capture Volume", "Analog Mix Capture Volume",
"Wave Playback Volume", "OLD PCM Playback Volume",
"Wave Master Playback Volume", "Master Playback Volume",
@@ -1808,7 +1808,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0)
return err;
pbus->no_vra = 1; /* we don't need VRA */
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = emu;
ac97.private_free = snd_emu10k1_mixer_free_ac97;
@@ -1828,7 +1828,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000);
if (emu->card_capabilities->adc_1361t)
c = audigy_remove_ctls_1361t_adc;
- else
+ else
c = audigy_remove_ctls;
} else {
/*
@@ -1906,13 +1906,13 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
kctl->id.device = multi_device;
if ((err = snd_ctl_add(card, kctl)))
return err;
-
+
if ((kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu)) == NULL)
return -ENOMEM;
kctl->id.device = multi_device;
if ((err = snd_ctl_add(card, kctl)))
return err;
-
+
if ((kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu)) == NULL)
return -ENOMEM;
kctl->id.device = multi_device;
@@ -1923,27 +1923,27 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
for (pcm = 0; pcm < 32; pcm++) {
struct snd_emu10k1_pcm_mixer *mix;
int v;
-
+
mix = &emu->pcm_mixer[pcm];
mix->epcm = NULL;
for (v = 0; v < 4; v++)
- mix->send_routing[0][v] =
- mix->send_routing[1][v] =
+ mix->send_routing[0][v] =
+ mix->send_routing[1][v] =
mix->send_routing[2][v] = v;
-
+
memset(&mix->send_volume, 0, sizeof(mix->send_volume));
mix->send_volume[0][0] = mix->send_volume[0][1] =
mix->send_volume[1][0] = mix->send_volume[2][1] = 255;
-
+
mix->attn[0] = mix->attn[1] = mix->attn[2] = 0xffff;
}
-
+
/* initialize the routing and volume table for the multichannel playback stream */
for (pcm = 0; pcm < NUM_EFX_PLAYBACK; pcm++) {
struct snd_emu10k1_pcm_mixer *mix;
int v;
-
+
mix = &emu->efx_pcm_mixer[pcm];
mix->epcm = NULL;
@@ -1954,14 +1954,14 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
if (emu->audigy)
for (v = 0; v < 4; v++)
mix->send_routing[0][4+v] = 60+v;
-
+
memset(&mix->send_volume, 0, sizeof(mix->send_volume));
mix->send_volume[0][0] = 255;
-
+
mix->attn[0] = 0xffff;
}
-
- if (! emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */
+
+ if (!emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */
/* sb live! and audigy */
if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
return -ENOMEM;
@@ -1990,7 +1990,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
if ((err = snd_ctl_add(card, kctl)))
return err;
#endif
- } else if (! emu->card_capabilities->ecard) {
+ } else if (!emu->card_capabilities->ecard) {
/* sb live! */
if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL)
return -ENOMEM;
@@ -2073,7 +2073,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
return err;
}
- if ( emu->card_capabilities->i2c_adc) {
+ if (emu->card_capabilities->i2c_adc) {
int i;
err = snd_ctl_add(card, snd_ctl_new1(&snd_audigy_i2c_capture_source, emu));
@@ -2086,6 +2086,6 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
return err;
}
}
-
+
return 0;
}
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index 8578c70..18495b4 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -277,7 +277,7 @@ static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substr
if (up) {
int max = 4;
unsigned char byte;
-
+
/* try to send some amount of bytes here before interrupts */
spin_lock_irqsave(&midi->output_lock, flags);
while (max > 0) {
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index cf9276d..f9144dc 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -86,7 +86,7 @@ static void snd_emu10k1_pcm_efx_interrupt(struct snd_emu10k1 *emu,
}
#endif
snd_pcm_period_elapsed(emu->pcm_capture_efx_substream);
-}
+}
static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(struct snd_pcm_substream *substream)
{
@@ -130,7 +130,7 @@ static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voic
epcm->type == PLAYBACK_EMUVOICE ? EMU10K1_PCM : EMU10K1_EFX,
voices,
&epcm->voices[0]);
-
+
if (err < 0)
return err;
epcm->voices[0]->epcm = epcm;
@@ -253,12 +253,12 @@ static unsigned int emu10k1_select_interprom(unsigned int pitch_target)
return CCCA_INTERPROM_4;
else if (pitch_target >= PITCH_57081)
return CCCA_INTERPROM_3;
- else
+ else
return CCCA_INTERPROM_2;
}
/*
- * calculate cache invalidate size
+ * calculate cache invalidate size
*
* stereo: channel is stereo
* w_16: using 16bit samples
@@ -323,7 +323,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
}
ccis = emu10k1_ccis(stereo, w_16);
-
+
if (master) {
evoice->epcm->ccca_start_addr = start_addr + ccis;
if (extra) {
@@ -359,7 +359,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24));
if (emu->card_capabilities->emu_model)
pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
- else
+ else
pitch_target = emu10k1_calc_pitch_target(runtime->rate);
if (extra)
snd_emu10k1_ptr_write(emu, CCCA, voice, start_addr |
@@ -416,7 +416,7 @@ static int snd_emu10k1_playback_hw_params(struct snd_pcm_substream *substream,
snd_emu10k1_free_pages(emu, epcm->memblk);
epcm->memblk = snd_emu10k1_alloc_pages(emu, substream);
epcm->start_addr = 0;
- if (! epcm->memblk)
+ if (!epcm->memblk)
return -ENOMEM;
mapped = ((struct snd_emu10k1_memblk *)epcm->memblk)->mapped_page;
if (mapped < 0)
@@ -602,7 +602,7 @@ static int snd_emu10k1_capture_prepare(struct snd_pcm_substream *substream)
break;
default:
break;
- }
+ }
snd_emu10k1_ptr_write(emu, epcm->capture_ba_reg, 0, runtime->dma_addr);
epcm->capture_bufsize = snd_pcm_lib_buffer_bytes(substream);
epcm->capture_bs_val = 0;
@@ -685,7 +685,7 @@ static void snd_emu10k1_playback_prepare_voice(struct snd_emu10k1 *emu, struct s
snd_emu10k1_ptr_write(emu, CVCF, voice, vattn | 0xffff);
snd_emu10k1_ptr_write(emu, DCYSUSV, voice, 0x7f7f);
snd_emu10k1_voice_clear_loop_stop(emu, voice);
-}
+}
static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice, int master, int extra)
{
@@ -702,7 +702,7 @@ static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct s
pitch = snd_emu10k1_rate_to_pitch(runtime->rate) >> 8;
if (emu->card_capabilities->emu_model)
pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
- else
+ else
pitch_target = emu10k1_calc_pitch_target(runtime->rate);
snd_emu10k1_ptr_write(emu, PTRX_PITCHTARGET, voice, pitch_target);
if (master || evoice->epcm->type == PLAYBACK_EFX)
@@ -799,7 +799,7 @@ static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
} else
snd_emu10k1_ptr_write(emu, FXWC, 0, epcm->capture_cr_val);
break;
- default:
+ default:
break;
}
snd_emu10k1_ptr_write(emu, epcm->capture_bs_reg, 0, epcm->capture_bs_val);
@@ -875,7 +875,7 @@ static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
/* prepare voices */
- for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
+ for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
snd_emu10k1_playback_invalidate_cache(emu, 0, epcm->voices[i]);
}
snd_emu10k1_playback_invalidate_cache(emu, 1, epcm->extra);
@@ -899,7 +899,7 @@ static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
epcm->running = 0;
- for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
+ for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
snd_emu10k1_playback_stop_voice(emu, epcm->voices[i]);
}
snd_emu10k1_playback_stop_voice(emu, epcm->extra);
@@ -985,8 +985,8 @@ static struct snd_pcm_hardware snd_emu10k1_capture_efx =
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
- .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
+ .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
.rate_min = 44100,
.rate_max = 192000,
@@ -1008,7 +1008,7 @@ static void snd_emu10k1_pcm_mixer_notify1(struct snd_emu10k1 *emu, struct snd_kc
{
struct snd_ctl_elem_id id;
- if (! kctl)
+ if (!kctl)
return;
if (activate)
kctl->vd[idx].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -1066,13 +1066,13 @@ static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream)
epcm->emu = emu;
epcm->type = PLAYBACK_EFX;
epcm->substream = substream;
-
+
emu->pcm_playback_efx_substream = substream;
runtime->private_data = epcm;
runtime->private_free = snd_emu10k1_pcm_free_substream;
runtime->hw = snd_emu10k1_efx_playback;
-
+
for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
mix = &emu->efx_pcm_mixer[i];
mix->send_routing[0][0] = i;
@@ -1243,7 +1243,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
* channels_min = 16,
* channels_max = 16,
* Need to add mixer control to fix sample rate
- *
+ *
* There are 32 mono channels of 16bits each.
* 24bit Audio uses 2x channels over 16bit
* 96kHz uses 2x channels over 48kHz
@@ -1470,7 +1470,7 @@ static int snd_emu10k1_pcm_efx_voices_mask_get(struct snd_kcontrol *kcontrol, st
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
int nefx = emu->audigy ? 64 : 32;
int idx;
-
+
spin_lock_irq(&emu->reg_lock);
for (idx = 0; idx < nefx; idx++)
ucontrol->value.integer.value[idx] = (emu->efx_voices_mask[idx / 32] & (1 << (idx % 32))) ? 1 : 0;
@@ -1485,18 +1485,18 @@ static int snd_emu10k1_pcm_efx_voices_mask_put(struct snd_kcontrol *kcontrol, st
int nefx = emu->audigy ? 64 : 32;
int nefxb = emu->audigy ? 7 : 6;
int change, idx;
-
+
nval[0] = nval[1] = 0;
for (idx = 0, bits = 0; idx < nefx; idx++)
if (ucontrol->value.integer.value[idx]) {
nval[idx / 32] |= 1 << (idx % 32);
bits++;
}
-
+
for (idx = 0; idx < nefxb; idx++)
if (1 << idx == bits)
break;
-
+
if (idx >= nefxb)
return -EINVAL;
@@ -1622,7 +1622,7 @@ static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substre
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
unsigned int i;
-
+
/* printk("prepare: etram_pages = 0x%p, dma_area = 0x%x, buffer_size = 0x%x (0x%x)\n", emu->fx8010.etram_pages, runtime->dma_area, runtime->buffer_size, runtime->buffer_size << 2); */
memset(&pcm->pcm_rec, 0, sizeof(pcm->pcm_rec));
pcm->pcm_rec.hw_buffer_size = pcm->buffer_size * 2; /* byte size */
@@ -1682,7 +1682,7 @@ static int snd_emu10k1_fx8010_playback_trigger(struct snd_pcm_substream *substre
result = -EINVAL;
break;
}
- __err:
+__err:
spin_unlock(&emu->reg_lock);
return result;
}
@@ -1783,10 +1783,10 @@ int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct s
if (rpcm)
*rpcm = pcm;
- /* EFX capture - record the "FXBUS2" channels, by default we connect the EXTINs
+ /* EFX capture - record the "FXBUS2" channels, by default we connect the EXTINs
* to these
- */
-
+ */
+
/* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */
if (emu->audigy) {
emu->efx_voices_mask[0] = 0;
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 216f974..012c0c3 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -46,7 +46,7 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
static char *channel[16] = { "unspec", "left", "right", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" };
static char *emphasis[8] = { "none", "50/15 usec 2 channel", "2", "3", "4", "5", "6", "7" };
unsigned int status, rate = 0;
-
+
status = snd_emu10k1_ptr_read(emu, status_reg, 0);
snd_iprintf(buffer, "\n%s\n", title);
@@ -70,7 +70,7 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
snd_iprintf(buffer, "S/PDIF Locked : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off");
snd_iprintf(buffer, "Rate Locked : %s\n", rate & SRCS_RATELOCKED ? "on" : "off");
/* From ((Rate * 48000 ) / 262144); */
- snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11);
+ snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11);
}
} else {
snd_iprintf(buffer, "No signal detected.\n");
@@ -78,7 +78,7 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
}
-static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
/* FIXME - output names are in emufx.c too */
@@ -189,7 +189,7 @@ static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
int nefx = emu->audigy ? 64 : 32;
char **outputs = emu->audigy ? audigy_outs : creative_outs;
int idx;
-
+
snd_iprintf(buffer, "EMU10K1\n\n");
snd_iprintf(buffer, "Card : %s\n",
emu->audigy ? "Audigy" : (emu->card_capabilities->ecard ? "EMU APS" : "Creative"));
@@ -235,7 +235,7 @@ static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " Output %02i [%s]\n", idx, outputs[idx]);
}
-static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_emu10k1 *emu = entry->private_data;
@@ -253,7 +253,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
snd_emu1010_fpga_read(emu, 0x2a, &value);
snd_emu1010_fpga_read(emu, 0x2b, &value2);
spin_unlock_irqrestore(&emu->emu_lock, flags);
- rate = 0x1770000 / (((value << 5) | value2)+1);
+ rate = 0x1770000 / (((value << 5) | value2)+1);
snd_iprintf(buffer, "ADAT Locked : %u\n", rate);
} else {
snd_iprintf(buffer, "ADAT Unlocked\n");
@@ -266,7 +266,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
snd_emu1010_fpga_read(emu, 0x28, &value);
snd_emu1010_fpga_read(emu, 0x29, &value2);
spin_unlock_irqrestore(&emu->emu_lock, flags);
- rate = 0x1770000 / (((value << 5) | value2)+1);
+ rate = 0x1770000 / (((value << 5) | value2)+1);
snd_iprintf(buffer, "SPDIF Locked : %d\n", rate);
} else {
snd_iprintf(buffer, "SPDIF Unlocked\n");
@@ -283,7 +283,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
#endif
}
-static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
static int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 };
@@ -298,7 +298,7 @@ static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
}
}
-static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
u32 pc;
@@ -308,7 +308,7 @@ static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " Code dump :\n");
for (pc = 0; pc < (emu->audigy ? 1024 : 512); pc++) {
u32 low, high;
-
+
low = snd_emu10k1_efx_read(emu, pc * 2);
high = snd_emu10k1_efx_read(emu, pc * 2 + 1);
if (emu->audigy)
@@ -350,7 +350,7 @@ static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
struct snd_emu10k1 *emu = entry->private_data;
unsigned int offset;
int tram_addr = 0;
-
+
if (!strcmp(entry->name, "fx8010_tram_addr")) {
offset = TANKMEMADDRREGBASE;
tram_addr = 1;
@@ -374,7 +374,7 @@ static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
if (tram_addr && emu->audigy) {
tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0) >> 11;
tmp[idx] |= snd_emu10k1_ptr_read(emu, 0x100 + idx + (pos >> 2), 0) << 20;
- } else
+ } else
tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0);
if (copy_to_user(buf, ((char *)tmp) + (pos & 3), size))
res = -EFAULT;
@@ -387,13 +387,13 @@ static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
return 0;
}
-static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_emu10k1 *emu = entry->private_data;
struct snd_emu10k1_voice *voice;
int idx;
-
+
snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n");
for (idx = 0; idx < NUM_G; idx++) {
voice = &emu->voices[idx];
@@ -417,7 +417,7 @@ static void snd_emu_proc_emu1010_reg_read(struct snd_info_entry *entry,
int i;
snd_iprintf(buffer, "EMU1010 Registers:\n\n");
- for(i = 0; i < 0x40; i+=1) {
+ for (i = 0; i < 0x40; i++) {
spin_lock_irqsave(&emu->emu_lock, flags);
snd_emu1010_fpga_read(emu, i, &value);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -433,7 +433,7 @@ static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "IO Registers:\n\n");
- for(i = 0; i < 0x40; i+=4) {
+ for (i = 0; i < 0x40; i += 4) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inl(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -451,7 +451,7 @@ static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x", ®, &val) != 2)
continue;
- if ((reg < 0x40) && (reg >= 0) && (val <= 0xffffffff) ) {
+ if ((reg < 0x40) && (reg >= 0) && (val <= 0xffffffff)) {
spin_lock_irqsave(&emu->emu_lock, flags);
outl(val, emu->port + (reg & 0xfffffffc));
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -505,10 +505,10 @@ static void snd_emu_proc_ptr_reg_read(struct snd_info_entry *entry,
return;
}
snd_iprintf(buffer, "Registers 0x%x\n", iobase);
- for(i = offset; i < offset+length; i++) {
+ for (i = offset; i < offset+length; i++) {
snd_iprintf(buffer, "%02X: ",i);
for (j = 0; j < voices; j++) {
- if(iobase == 0)
+ if (iobase == 0)
value = snd_ptr_read(emu, 0, i, j);
else
value = snd_ptr_read(emu, 0x20, i, j);
@@ -527,7 +527,7 @@ static void snd_emu_proc_ptr_reg_write(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
continue;
- if ((reg < 0xa0) && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) && (channel_id <= 3) )
+ if ((reg < 0xa0) && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) && (channel_id <= 3))
snd_ptr_write(emu, iobase, reg, channel_id, val);
}
}
@@ -543,7 +543,7 @@ static void snd_emu_proc_ptr_reg_write20(struct snd_info_entry *entry,
{
snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
}
-
+
static void snd_emu_proc_ptr_reg_read00a(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
@@ -585,85 +585,85 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
struct snd_info_entry *entry;
#ifdef CONFIG_SND_DEBUG
if (emu->card_capabilities->emu_model) {
- if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry))
+ if (!snd_card_proc_new(emu->card, "emu1010_regs", &entry))
snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read);
}
- if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {
+ if (!snd_card_proc_new(emu->card, "io_regs", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_io_reg_read);
entry->c.text.write = snd_emu_proc_io_reg_write;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00a);
entry->c.text.write = snd_emu_proc_ptr_reg_write00;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00b);
entry->c.text.write = snd_emu_proc_ptr_reg_write00;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20a);
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20b);
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20c);
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
entry->mode |= S_IWUSR;
}
#endif
-
- if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
+
+ if (!snd_card_proc_new(emu->card, "emu10k1", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_read);
if (emu->card_capabilities->emu10k2_chip) {
- if (! snd_card_proc_new(emu->card, "spdif-in", &entry))
+ if (!snd_card_proc_new(emu->card, "spdif-in", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_spdif_read);
}
if (emu->card_capabilities->ca0151_chip) {
- if (! snd_card_proc_new(emu->card, "capture-rates", &entry))
+ if (!snd_card_proc_new(emu->card, "capture-rates", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_rates_read);
}
- if (! snd_card_proc_new(emu->card, "voices", &entry))
+ if (!snd_card_proc_new(emu->card, "voices", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_voices_read);
- if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
entry->size = emu->audigy ? A_TOTAL_SIZE_GPR : TOTAL_SIZE_GPR;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_tram_data", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_tram_data", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
- entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_DATA : TOTAL_SIZE_TANKMEM_DATA ;
+ entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_DATA : TOTAL_SIZE_TANKMEM_DATA;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_tram_addr", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_tram_addr", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
- entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_ADDR : TOTAL_SIZE_TANKMEM_ADDR ;
+ entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_ADDR : TOTAL_SIZE_TANKMEM_ADDR;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_code", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_code", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
entry->size = emu->audigy ? A_TOTAL_SIZE_CODE : TOTAL_SIZE_CODE;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_acode", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_acode", &entry)) {
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index b5a802b..c77f5f2 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -42,16 +42,16 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un
if (reg & 0xff000000) {
unsigned char size, offset;
-
+
size = (reg >> 24) & 0x3f;
offset = (reg >> 16) & 0x1f;
mask = ((1 << size) - 1) << offset;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outl(regptr, emu->port + PTR);
val = inl(emu->port + DATA);
spin_unlock_irqrestore(&emu->emu_lock, flags);
-
+
return (val & mask) >> offset;
} else {
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -90,7 +90,7 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
outl(regptr, emu->port + PTR);
data |= inl(emu->port + DATA) & ~mask;
outl(data, emu->port + DATA);
- spin_unlock_irqrestore(&emu->emu_lock, flags);
+ spin_unlock_irqrestore(&emu->emu_lock, flags);
} else {
spin_lock_irqsave(&emu->emu_lock, flags);
outl(regptr, emu->port + PTR);
@@ -101,13 +101,13 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
EXPORT_SYMBOL(snd_emu10k1_ptr_write);
-unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
- unsigned int reg,
+unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
+ unsigned int reg,
unsigned int chn)
{
unsigned long flags;
unsigned int regptr, val;
-
+
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -117,9 +117,9 @@ unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
return val;
}
-void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
- unsigned int reg,
- unsigned int chn,
+void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
+ unsigned int reg,
+ unsigned int chn,
unsigned int data)
{
unsigned int regptr;
@@ -230,7 +230,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
break;
}
}
- //Read back and see if the transaction is successful
+ /* Read back and see if the transaction is successful */
if ((status & I2C_A_ADC_ABORT) == 0)
break;
}
@@ -242,7 +242,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
/* dump_stack(); */
err = -EINVAL;
}
-
+
spin_unlock(&emu->i2c_lock);
return err;
}
@@ -291,10 +291,10 @@ int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value)
*/
int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, u32 dst, u32 src)
{
- snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f) );
- snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f) );
- snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f) );
- snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f) );
+ snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f));
+ snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f));
+ snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f));
+ snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f));
return 0;
}
diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
index 30bfed6..e4947a6 100644
--- a/sound/pci/emu10k1/irq.c
+++ b/sound/pci/emu10k1/irq.c
@@ -157,19 +157,19 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]);
struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice);
- //printk(KERN_INFO "status2=0x%x\n", status2);
+ /* printk(KERN_INFO "status2=0x%x\n", status2); */
orig_status2 = status2;
- if(status2 & mask) {
- if(pvoice->use) {
+ if (status2 & mask) {
+ if (pvoice->use) {
snd_pcm_period_elapsed(pvoice->epcm->substream);
- } else {
+ } else {
snd_printk(KERN_ERR "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n", status2, mask, pvoice, pvoice->use);
}
}
- if(status2 & 0x110000) {
- //printk(KERN_INFO "capture int found\n");
- if(cvoice->use) {
- //printk(KERN_INFO "capture period_elapsed\n");
+ if (status2 & 0x110000) {
+ /* printk(KERN_INFO "capture int found\n"); */
+ if (cvoice->use) {
+ /* printk(KERN_INFO "capture period_elapsed\n"); */
snd_pcm_period_elapsed(cvoice->epcm->substream);
}
}
@@ -181,7 +181,7 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
if (status) {
unsigned int bits;
snd_printk(KERN_ERR "emu10k1: unhandled interrupt: 0x%08x\n", status);
- //make sure any interrupts we don't handle are disabled:
+ /* make sure any interrupts we don't handle are disabled: */
bits = INTE_FXDSPENABLE |
INTE_PCIERRORENABLE |
INTE_VOLINCRENABLE |
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index 6a47672..e6067f6 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -323,7 +323,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
unsigned long ofs = idx << PAGE_SHIFT;
dma_addr_t addr;
addr = snd_pcm_sgbuf_get_addr(substream, ofs);
- if (! is_valid_page(emu, addr)) {
+ if (!is_valid_page(emu, addr)) {
printk(KERN_ERR "emu: failure page = %d\n", idx);
mutex_unlock(&hdr->block_mutex);
return NULL;
@@ -368,7 +368,7 @@ struct snd_util_memblk *
snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size)
{
struct snd_emu10k1_memblk *blk;
- struct snd_util_memhdr *hdr = hw->memhdr;
+ struct snd_util_memhdr *hdr = hw->memhdr;
mutex_lock(&hdr->block_mutex);
blk = (struct snd_emu10k1_memblk *)__snd_util_mem_alloc(hdr, size);
@@ -394,7 +394,7 @@ EXPORT_SYMBOL(snd_emu10k1_synth_alloc);
int
snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *memblk)
{
- struct snd_util_memhdr *hdr = emu->memhdr;
+ struct snd_util_memhdr *hdr = emu->memhdr;
struct snd_emu10k1_memblk *blk = (struct snd_emu10k1_memblk *)memblk;
unsigned long flags;
@@ -499,7 +499,7 @@ static inline void *offset_ptr(struct snd_emu10k1 *emu, int page, int offset)
if (snd_BUG_ON(page < 0 || page >= emu->max_cache_pages))
return NULL;
ptr = emu->page_ptr_table[page];
- if (! ptr) {
+ if (!ptr) {
printk(KERN_ERR "emu10k1: access to NULL ptr: page = %d\n", page);
return NULL;
}
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index 749a21b..dd71b65 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -123,17 +123,17 @@
/* hardware definition */
static struct snd_pcm_hardware snd_p16v_playback_hw = {
- .info = SNDRV_PCM_INFO_MMAP |
+ .info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_SYNC_START,
.formats = SNDRV_PCM_FMTBIT_S32_LE, /* Only supports 24-bit samples padded to 32 bits. */
- .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
+ .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.rate_min = 44100,
.rate_max = 192000,
- .channels_min = 8,
+ .channels_min = 8,
.channels_max = 8,
.buffer_bytes_max = ((65536 - 64) * 8),
.period_bytes_min = 64,
@@ -150,7 +150,7 @@ static struct snd_pcm_hardware snd_p16v_capture_hw = {
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
- .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
+ .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.rate_min = 44100,
.rate_max = 192000,
.channels_min = 2,
@@ -166,9 +166,9 @@ static struct snd_pcm_hardware snd_p16v_capture_hw = {
static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime)
{
struct snd_emu10k1_pcm *epcm = runtime->private_data;
-
+
if (epcm) {
- //snd_printk("epcm free: %p\n", epcm);
+ /* snd_printk("epcm free: %p\n", epcm); */
kfree(epcm);
}
}
@@ -183,26 +183,26 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
int err;
epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
- //snd_printk("epcm kcalloc: %p\n", epcm);
+ /* snd_printk("epcm kcalloc: %p\n", epcm); */
if (epcm == NULL)
return -ENOMEM;
epcm->emu = emu;
epcm->substream = substream;
- //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id);
-
+ /* snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); */
+
runtime->private_data = epcm;
runtime->private_free = snd_p16v_pcm_free_substream;
-
+
runtime->hw = snd_p16v_playback_hw;
channel->emu = emu;
channel->number = channel_id;
channel->use=1;
- //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use);
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_p16v_pcm_channel_interrupt;
+ /* snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); */
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
channel->epcm=epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -224,26 +224,26 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
int err;
epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
- //snd_printk("epcm kcalloc: %p\n", epcm);
+ /* snd_printk("epcm kcalloc: %p\n", epcm); */
if (epcm == NULL)
return -ENOMEM;
epcm->emu = emu;
epcm->substream = substream;
- //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id);
+ /* snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); */
runtime->private_data = epcm;
runtime->private_free = snd_p16v_pcm_free_substream;
-
+
runtime->hw = snd_p16v_capture_hw;
channel->emu = emu;
channel->number = channel_id;
channel->use=1;
- //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use);
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_p16v_pcm_channel_interrupt;
+ /* snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); */
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
channel->epcm=epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -256,8 +256,8 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)
{
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
- //struct snd_pcm_runtime *runtime = substream->runtime;
- //struct snd_emu10k1_pcm *epcm = runtime->private_data;
+ /* struct snd_pcm_runtime *runtime = substream->runtime; */
+ /* struct snd_emu10k1_pcm *epcm = runtime->private_data; */
emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0;
/* FIXME: maybe zero others */
return 0;
@@ -267,8 +267,8 @@ static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)
static int snd_p16v_pcm_close_capture(struct snd_pcm_substream *substream)
{
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
- //struct snd_pcm_runtime *runtime = substream->runtime;
- //struct snd_emu10k1_pcm *epcm = runtime->private_data;
+ /* struct snd_pcm_runtime *runtime = substream->runtime; */
+ /* struct snd_emu10k1_pcm *epcm = runtime->private_data; */
emu->p16v_capture_voice.use = 0;
/* FIXME: maybe zero others */
return 0;
@@ -281,7 +281,7 @@ static int snd_p16v_pcm_open_playback_front(struct snd_pcm_substream *substream)
static int snd_p16v_pcm_open_capture(struct snd_pcm_substream *substream)
{
- // Only using channel 0 for now, but the card has 2 channels.
+ /* Only using channel 0 for now, but the card has 2 channels. */
return snd_p16v_pcm_open_capture_channel(substream, 0);
}
@@ -333,10 +333,10 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
int i;
u32 tmp;
-
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes);
+
+ /* snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes); */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
switch (runtime->rate) {
case 44100:
@@ -354,17 +354,17 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
break;
}
/* FIXME: Check emu->buffer.size before actually writing to it. */
- for(i = 0; i < runtime->periods; i++) {
+ for (i = 0; i < runtime->periods; i++) {
table_base[i*2]=runtime->dma_addr+(i*period_size_bytes);
table_base[(i*2)+1]=period_size_bytes<<16;
}
-
+
snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_ADDR, channel, emu->p16v_buffer.addr+(8*16*channel));
snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19);
snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0);
snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr);
- //snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes
- snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes
+ /* snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); buffer size in bytes */
+ snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); /* buffer size in bytes */
snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0);
snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0);
snd_emu10k1_ptr20_write(emu, 0x08, channel, 0);
@@ -379,7 +379,7 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
int channel = substream->pcm->device - emu->p16v_device_offset;
u32 tmp;
- //printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1));
+ /* printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
switch (runtime->rate) {
case 44100:
@@ -399,10 +399,10 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
/* FIXME: Check emu->buffer.size before actually writing to it. */
snd_emu10k1_ptr20_write(emu, 0x13, channel, 0);
snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr);
- snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size) << 16); // buffer size in bytes
+ snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size) << 16); /* buffer size in bytes */
snd_emu10k1_ptr20_write(emu, CAPTURE_POINTER, channel, 0);
- //snd_emu10k1_ptr20_write(emu, CAPTURE_SOURCE, 0x0, 0x333300e4); /* Select MIC or Line in */
- //snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) | (0x110000<<channel));
+ /* snd_emu10k1_ptr20_write(emu, CAPTURE_SOURCE, 0x0, 0x333300e4); Select MIC or Line in */
+ /* snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) | (0x110000<<channel)); */
return 0;
}
@@ -459,13 +459,13 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
runtime = s->runtime;
epcm = runtime->private_data;
channel = substream->pcm->device-emu->p16v_device_offset;
- //snd_printk("p16v channel=%d\n",channel);
+ /* snd_printk("p16v channel=%d\n",channel); */
epcm->running = running;
basic |= (0x1<<channel);
inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel);
snd_pcm_trigger_done(s, substream);
}
- //snd_printk("basic=0x%x, inte=0x%x\n",basic, inte);
+ /* snd_printk("basic=0x%x, inte=0x%x\n",basic, inte); */
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -503,7 +503,7 @@ static int snd_p16v_pcm_trigger_capture(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_STOP:
snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) & ~(0x100<<channel));
snd_p16v_intr_disable(emu, inte);
- //snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) & ~(0x110000<<channel));
+ /* snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) & ~(0x110000<<channel)); */
epcm->running = 0;
break;
default:
@@ -558,7 +558,7 @@ snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream)
ptr -= runtime->buffer_size;
printk(KERN_WARNING "buffer capture limited!\n");
}
- //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
+ /* printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); */
return ptr;
}
@@ -589,10 +589,10 @@ static struct snd_pcm_ops snd_p16v_capture_ops = {
int snd_p16v_free(struct snd_emu10k1 *chip)
{
- // release the data
+ /* release the data */
if (chip->p16v_buffer.area) {
snd_dma_free_pages(&chip->p16v_buffer);
- //snd_printk("period lables free: %p\n", &chip->p16v_buffer);
+ /* snd_printk("period lables free: %p\n", &chip->p16v_buffer); */
}
return 0;
}
@@ -603,18 +603,18 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
struct snd_pcm_substream *substream;
int err;
int capture=1;
-
- //snd_printk("snd_p16v_pcm called. device=%d\n", device);
+
+ /* snd_printk("snd_p16v_pcm called. device=%d\n", device); */
emu->p16v_device_offset = device;
if (rpcm)
*rpcm = NULL;
if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0)
return err;
-
+
pcm->private_data = emu;
- // Single playback 8 channel device.
- // Single capture 2 channel device.
+ /* Single playback 8 channel device. */
+ /* Single capture 2 channel device. */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_p16v_playback_front_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_p16v_capture_ops);
@@ -623,31 +623,31 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
strcpy(pcm->name, "p16v");
emu->pcm_p16v = pcm;
- for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
- ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
+ ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
return err;
- //snd_printk("preallocate playback substream: err=%d\n", err);
+ /* snd_printk("preallocate playback substream: err=%d\n", err); */
}
- for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
65536 - 64, 65536 - 64)) < 0)
return err;
- //snd_printk("preallocate capture substream: err=%d\n", err);
+ /* snd_printk("preallocate capture substream: err=%d\n", err); */
}
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -696,7 +696,7 @@ static int snd_p16v_volume_put(struct snd_kcontrol *kcontrol,
} else {
value &= 0xffff0000;
value |= ((0xff - ucontrol->value.integer.value[0]) << 8) |
- ((0xff - ucontrol->value.integer.value[1]) );
+ ((0xff - ucontrol->value.integer.value[1]));
}
if (value != oval) {
snd_emu10k1_ptr20_write(emu, reg, 0, value);
@@ -740,7 +740,7 @@ static int snd_p16v_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 > 7)
return -EINVAL;
change = (emu->p16v_capture_source != val);
@@ -784,7 +784,7 @@ static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
int change = 0;
u32 tmp;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
if (val > 3)
return -EINVAL;
change = (emu->p16v_capture_channel != val);
@@ -854,7 +854,7 @@ int __devinit snd_p16v_mixer(struct snd_emu10k1 *emu)
int __devinit snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu)
{
emu->p16v_saved = vmalloc(NUM_CHS * 4 * 0x80);
- if (! emu->p16v_saved)
+ if (!emu->p16v_saved)
return -ENOMEM;
return 0;
}
diff --git a/sound/pci/emu10k1/p16v.h b/sound/pci/emu10k1/p16v.h
index 1532149..7964c8e 100644
--- a/sound/pci/emu10k1/p16v.h
+++ b/sound/pci/emu10k1/p16v.h
@@ -81,14 +81,14 @@
/********************************************************************************************************/
/* Audigy2 P16V pointer-offset register set, accessed through the PTR2 and DATA2 registers */
/********************************************************************************************************/
-
+
/* The sample rate of the SPDIF outputs is set by modifying a register in the EMU10K2 PTR register A_SPDIF_SAMPLERATE.
* The sample rate is also controlled by the same registers that control the rate of the EMU10K2 sample rate converters.
*/
/* 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.
@@ -167,11 +167,11 @@
* 3 - 192 khz
* 7 - undefined rate.
* [19] Channel 0. 1 - Valid, 0 - Not Valid.
- * [22:20] Channel 1 Detected sample rate.
+ * [22:20] Channel 1 Detected sample rate.
* [23] Channel 1. 1 - Valid, 0 - Not Valid.
- * [26:24] Channel 2 Detected sample rate.
+ * [26:24] Channel 2 Detected sample rate.
* [27] Channel 2. 1 - Valid, 0 - Not Valid.
- * [30:28] Channel 3 Detected sample rate.
+ * [30:28] Channel 3 Detected sample rate.
* [31] Channel 3. 1 - Valid, 0 - Not Valid.
*/
/* 0x18 - 0x1f unused */
@@ -204,7 +204,7 @@
/* 0x43,0x48 do not remember settings */
/* 0x41-45 unused */
#define WATERMARK 0x46 /* Test bit to indicate cache level usage */
- /* Values it can have while playing on channel 0.
+ /* Values it can have while playing on channel 0.
* 0000f000, 0000f004, 0000f008, 0000f00c.
* Readonly.
*/
@@ -253,7 +253,7 @@
* [23:16] The corresponding P16V channel to SRCMulti SPDIF enabled.
* [31:24] The corresponding E10K2 channel to SRCMulti SPDIF enabled.
*/
- /* Bypass P16V 0xff00ff00
+ /* Bypass P16V 0xff00ff00
* Bitmap. 0 = Off, 1 = On.
* P16V playback outputs:
* 0xXXXXXXX1 = PCM0 Left. (Front)
diff --git a/sound/pci/emu10k1/p17v.h b/sound/pci/emu10k1/p17v.h
index 4ef5f68..0a28974 100644
--- a/sound/pci/emu10k1/p17v.h
+++ b/sound/pci/emu10k1/p17v.h
@@ -27,11 +27,11 @@
/* 00 - 07: Not used */
#define P17V_PLAYBACK_FIFO_PTR 0x08 /* Current playback fifo pointer
* and number of sound samples in cache.
- */
+ */
/* 09 - 12: Not used */
#define P17V_CAPTURE_FIFO_PTR 0x13 /* Current capture fifo pointer
* and number of sound samples in cache.
- */
+ */
/* 14 - 17: Not used */
#define P17V_PB_CHN_SEL 0x18 /* P17v playback channel select */
#define P17V_SE_SLOT_SEL_L 0x19 /* Sound Engine slot select low */
@@ -58,7 +58,7 @@
#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 */
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index d7300a1..de271d0 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -5,7 +5,7 @@
* Routines for control of EMU10K1 chips - voice manager
*
* Rewrote voice allocator for multichannel support - rlrevell 12/2004
- *
+ *
* BUGS:
* --
*
@@ -32,14 +32,14 @@
#include <sound/core.h>
#include <sound/emu10k1.h>
-/* Previously the voice allocator started at 0 every time. The new voice
- * allocator uses a round robin scheme. The next free voice is tracked in
- * the card record and each allocation begins where the last left off. The
- * hardware requires stereo interleaved voices be aligned to an even/odd
- * boundary. For multichannel voice allocation we ensure than the block of
- * voices does not cross the 32 voice boundary. This simplifies the
- * multichannel support and ensures we can use a single write to the
- * (set|clear)_loop_stop registers. Otherwise (for example) the voices would
+/* Previously the voice allocator started at 0 every time. The new voice
+ * allocator uses a round robin scheme. The next free voice is tracked in
+ * the card record and each allocation begins where the last left off. The
+ * hardware requires stereo interleaved voices be aligned to an even/odd
+ * boundary. For multichannel voice allocation we ensure than the block of
+ * voices does not cross the 32 voice boundary. This simplifies the
+ * multichannel support and ensures we can use a single write to the
+ * (set|clear)_loop_stop registers. Otherwise (for example) the voices would
* get out of sync when pausing/resuming a stream.
* --rlrevell
*/
@@ -52,8 +52,8 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
*rvoice = NULL;
first_voice = last_voice = 0;
- for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) {
- // printk("i %d j %d next free %d!\n", i, j, emu->next_free_voice);
+ for (i = emu->next_free_voice, j = 0; j < NUM_G; i += number, j += number) {
+ /* printk("i %d j %d next free %d!\n", i, j, emu->next_free_voice); */
i %= NUM_G;
/* stereo voices must be even/odd */
@@ -61,7 +61,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
i++;
continue;
}
-
+
skip = 0;
for (k = 0; k < number; k++) {
voice = &emu->voices[(i+k) % NUM_G];
@@ -71,20 +71,20 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
}
}
if (!skip) {
- // printk("allocated voice %d\n", i);
+ /* printk("allocated voice %d\n", i); */
first_voice = i;
last_voice = (i + number) % NUM_G;
emu->next_free_voice = last_voice;
break;
}
}
-
+
if (first_voice == last_voice)
return -ENOMEM;
-
+
for (i = 0; i < number; i++) {
voice = &emu->voices[(first_voice + i) % NUM_G];
- // printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number);
+ /* printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number); */
voice->use = 1;
switch (type) {
case EMU10K1_PCM:
1
0

[alsa-devel] [PATCH 07/24] sound/pci: coding style fixes: echoaudio
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/echoaudio/darla20.c | 2 +-
sound/pci/echoaudio/darla24.c | 2 +-
sound/pci/echoaudio/echo3g.c | 2 +-
sound/pci/echoaudio/echoaudio.c | 2 +-
sound/pci/echoaudio/echoaudio.h | 2 +-
sound/pci/echoaudio/echoaudio_dsp.h | 16 ++++++++--------
sound/pci/echoaudio/gina20.c | 2 +-
sound/pci/echoaudio/gina24.c | 2 +-
sound/pci/echoaudio/indigo.c | 2 +-
sound/pci/echoaudio/indigodj.c | 2 +-
sound/pci/echoaudio/indigoio.c | 2 +-
sound/pci/echoaudio/layla20.c | 2 +-
sound/pci/echoaudio/layla24.c | 2 +-
sound/pci/echoaudio/layla24_dsp.c | 4 ++--
sound/pci/echoaudio/mia.c | 2 +-
sound/pci/echoaudio/midi.c | 2 +-
sound/pci/echoaudio/mona.c | 2 +-
sound/pci/echoaudio/mona_dsp.c | 2 +-
18 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/sound/pci/echoaudio/darla20.c b/sound/pci/echoaudio/darla20.c
index 8c6db3a..c9a128a 100644
--- a/sound/pci/echoaudio/darla20.c
+++ b/sound/pci/echoaudio/darla20.c
@@ -51,7 +51,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/darla24.c b/sound/pci/echoaudio/darla24.c
index 04cbf3e..3771d02 100644
--- a/sound/pci/echoaudio/darla24.c
+++ b/sound/pci/echoaudio/darla24.c
@@ -55,7 +55,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/echo3g.c b/sound/pci/echoaudio/echo3g.c
index 4022e43..eb9bf6e 100644
--- a/sound/pci/echoaudio/echo3g.c
+++ b/sound/pci/echoaudio/echo3g.c
@@ -63,7 +63,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 8dbc5c4..3004a58 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1098,7 +1098,7 @@ static struct snd_kcontrol_new snd_echo_line_input_gain __devinitdata = {
#ifdef ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL
/************ Analog output nominal level (+4dBu / -10dBV) ***************/
-static int snd_echo_output_nominal_info (struct snd_kcontrol *kcontrol,
+static int snd_echo_output_nominal_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct echoaudio *chip;
diff --git a/sound/pci/echoaudio/echoaudio.h b/sound/pci/echoaudio/echoaudio.h
index 1c88e05..674ebf4 100644
--- a/sound/pci/echoaudio/echoaudio.h
+++ b/sound/pci/echoaudio/echoaudio.h
@@ -218,7 +218,7 @@
/****************************************************************************
-
+
Clocks
*****************************************************************************/
diff --git a/sound/pci/echoaudio/echoaudio_dsp.h b/sound/pci/echoaudio/echoaudio_dsp.h
index e352f3a..09ddbd3 100644
--- a/sound/pci/echoaudio/echoaudio_dsp.h
+++ b/sound/pci/echoaudio/echoaudio_dsp.h
@@ -103,7 +103,7 @@
#define CHI32_STATUS_IRQ 0x00000040
-/*
+/*
*
* DSP commands sent via slave mode; these are sent to the DSP by write_dsp()
*
@@ -369,7 +369,7 @@ SET_LAYLA24_FREQUENCY_REG command.
* via input and output pipes. LE means little-endian,
* BE means big-endian.
*
- * DSP_AUDIOFORM_MS_8
+ * DSP_AUDIOFORM_MS_8
*
* 8-bit mono unsigned samples. For playback,
* mono data is duplicated out the left and right channels
@@ -388,10 +388,10 @@ SET_LAYLA24_FREQUENCY_REG command.
* they would be stored in memory like this: 33 22 11 66 55 44.
*
* DSP_AUDIOFORM_MS_32LE
- *
- * 24-bit signed little-endian mono samples in a 32-bit
- * container. In other words, each sample is a 32-bit signed
- * integer, where the actual audio data is left-justified
+ *
+ * 24-bit signed little-endian mono samples in a 32-bit
+ * container. In other words, each sample is a 32-bit signed
+ * integer, where the actual audio data is left-justified
* in the 32 bits and only the 24 most significant bits are valid.
*
* DSP_AUDIOFORM_SS_8
@@ -435,8 +435,8 @@ SET_LAYLA24_FREQUENCY_REG command.
* Super-interleave is defined as interleaving by 4 or more. Darla20 and Gina20
* do not support super interleave.
*
- * 16 bit, 24 bit, and 32 bit little endian samples are supported for super
- * interleave. The interleave factor must be even. 16 - way interleave is the
+ * 16 bit, 24 bit, and 32 bit little endian samples are supported for super
+ * interleave. The interleave factor must be even. 16 - way interleave is the
* current maximum, so you can interleave by 4, 6, 8, 10, 12, 14, and 16.
*
* The actual format code is derived by taking the define below and or-ing with
diff --git a/sound/pci/echoaudio/gina20.c b/sound/pci/echoaudio/gina20.c
index c0e64b8..fa70fb1 100644
--- a/sound/pci/echoaudio/gina20.c
+++ b/sound/pci/echoaudio/gina20.c
@@ -55,7 +55,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/gina24.c b/sound/pci/echoaudio/gina24.c
index c36a78d..a33cc5a 100644
--- a/sound/pci/echoaudio/gina24.c
+++ b/sound/pci/echoaudio/gina24.c
@@ -61,7 +61,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/indigo.c b/sound/pci/echoaudio/indigo.c
index 0a58a7c..9097281 100644
--- a/sound/pci/echoaudio/indigo.c
+++ b/sound/pci/echoaudio/indigo.c
@@ -53,7 +53,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/indigodj.c b/sound/pci/echoaudio/indigodj.c
index 2db24d2..b3ff9a2 100644
--- a/sound/pci/echoaudio/indigodj.c
+++ b/sound/pci/echoaudio/indigodj.c
@@ -53,7 +53,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/indigoio.c b/sound/pci/echoaudio/indigoio.c
index a60c0a0..bd0c403 100644
--- a/sound/pci/echoaudio/indigoio.c
+++ b/sound/pci/echoaudio/indigoio.c
@@ -54,7 +54,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/layla20.c b/sound/pci/echoaudio/layla20.c
index 5061946..4a32154 100644
--- a/sound/pci/echoaudio/layla20.c
+++ b/sound/pci/echoaudio/layla20.c
@@ -61,7 +61,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/layla24.c b/sound/pci/echoaudio/layla24.c
index e09e3ea..a9b0ec0 100644
--- a/sound/pci/echoaudio/layla24.c
+++ b/sound/pci/echoaudio/layla24.c
@@ -63,7 +63,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/layla24_dsp.c b/sound/pci/echoaudio/layla24_dsp.c
index d61b5cb..03a3b38 100644
--- a/sound/pci/echoaudio/layla24_dsp.c
+++ b/sound/pci/echoaudio/layla24_dsp.c
@@ -149,7 +149,7 @@ static int load_asic(struct echoaudio *chip)
if (!err)
err = write_control_reg(chip, GML_CONVERTER_ENABLE | GML_48KHZ,
TRUE);
-
+
DE_INIT(("load_asic() done\n"));
return err;
}
@@ -307,7 +307,7 @@ static int switch_asic(struct echoaudio *chip, const struct firmware *asic)
if (asic != chip->asic_code) {
monitors = kmemdup(chip->comm_page->monitors,
MONITOR_ARRAY_SIZE, GFP_KERNEL);
- if (! monitors)
+ if (!monitors)
return -ENOMEM;
memset(chip->comm_page->monitors, ECHOGAIN_MUTED,
diff --git a/sound/pci/echoaudio/mia.c b/sound/pci/echoaudio/mia.c
index f3b9b45..021b926 100644
--- a/sound/pci/echoaudio/mia.c
+++ b/sound/pci/echoaudio/mia.c
@@ -61,7 +61,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c
index 77bf2a8..837d239 100644
--- a/sound/pci/echoaudio/midi.c
+++ b/sound/pci/echoaudio/midi.c
@@ -66,7 +66,7 @@ static int write_midi(struct echoaudio *chip, u8 *data, int bytes)
return -EIO;
/* HF4 indicates that it is safe to write MIDI output data */
- if (! (get_dsp_register(chip, CHI32_STATUS_REG) & CHI32_STATUS_REG_HF4))
+ if (!(get_dsp_register(chip, CHI32_STATUS_REG) & CHI32_STATUS_REG_HF4))
return 0;
chip->comm_page->midi_output[0] = bytes;
diff --git a/sound/pci/echoaudio/mona.c b/sound/pci/echoaudio/mona.c
index b05bad9..ead9ed4 100644
--- a/sound/pci/echoaudio/mona.c
+++ b/sound/pci/echoaudio/mona.c
@@ -59,7 +59,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/mona_dsp.c b/sound/pci/echoaudio/mona_dsp.c
index eaa619b..dc99bc0 100644
--- a/sound/pci/echoaudio/mona_dsp.c
+++ b/sound/pci/echoaudio/mona_dsp.c
@@ -114,7 +114,7 @@ static u32 detect_input_clocks(const struct echoaudio *chip)
-/* Mona has an ASIC on the PCI card and another ASIC in the external box;
+/* Mona has an ASIC on the PCI card and another ASIC in the external box;
both need to be loaded. */
static int load_asic(struct echoaudio *chip)
{
1
0

[alsa-devel] [PATCH 06/24] sound/pci: coding style fixes: sound/pci/c*
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/bt87x.c | 4 +-
sound/pci/cmipci.c | 80 +++++++++++++++---------------
sound/pci/cs4281.c | 82 ++++++++++++++++----------------
sound/pci/cs5530.c | 8 ++--
sound/pci/cs5535audio/cs5535audio.c | 8 ++--
sound/pci/cs5535audio/cs5535audio_pm.c | 12 ++--
6 files changed, 97 insertions(+), 97 deletions(-)
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 3aa8d97..e9a4fad 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -27,7 +27,7 @@
#include <linux/slab.h>
#include <linux/moduleparam.h>
#include <linux/bitops.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -603,7 +603,7 @@ static int snd_bt87x_capture_boost_get(struct snd_kcontrol *kcontrol,
{
struct snd_bt87x *chip = snd_kcontrol_chip(kcontrol);
- value->value.integer.value[0] = !! (chip->reg_control & CTL_A_G2X);
+ value->value.integer.value[0] = !!(chip->reg_control & CTL_A_G2X);
return 0;
}
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 1a74ca6..411ff65 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -16,11 +16,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/* Does not work. Warning may block system in capture mode */
/* #define USE_VAR48KRATE */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -125,7 +125,7 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address.");
#define CM_SPD24SEL 0x00020000 /* 24bit spdif: model 037 */
/* #define CM_SPDIF_INVERSE 0x00010000 */ /* ??? */
-#define CM_ADCBITLEN_MASK 0x0000C000
+#define CM_ADCBITLEN_MASK 0x0000C000
#define CM_ADCBITLEN_16 0x00000000
#define CM_ADCBITLEN_15 0x00004000
#define CM_ADCBITLEN_14 0x00008000
@@ -255,7 +255,7 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address.");
#define CM_UPDDMA_2048 0x00000000
#define CM_UPDDMA_1024 0x00000004
#define CM_UPDDMA_512 0x00000008
-#define CM_UPDDMA_256 0x0000000C
+#define CM_UPDDMA_256 0x0000000C
#define CM_TWAIT_MASK 0x00000003 /* model 037 */
#define CM_TWAIT1 0x00000002 /* FM i/o cycle, 0: 48, 1: 64 PCICLKs */
#define CM_TWAIT0 0x00000001 /* i/o cycle, 0: 4, 1: 6 PCICLKs */
@@ -450,7 +450,7 @@ static const struct cmipci_mixer_auto_switches cm_saved_mixer[] = {
{"PCM Playback Switch", 0},
{"IEC958 Output Switch", 1},
{"IEC958 Mix Analog", 0},
- // {"IEC958 Out To DAC", 1}, // no longer used
+ /* {"IEC958 Out To DAC", 1}, // no longer used */
{"IEC958 Loop", 0},
};
#define CM_SAVED_MIXERS ARRAY_SIZE(cm_saved_mixer)
@@ -827,7 +827,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
else
cm->ctrl |= val;
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
- //snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl);
+ /* snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl); */
/* set sample rate */
freq = 0;
@@ -850,7 +850,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
val |= (freq << CM_ASFC_SHIFT) & CM_ASFC_MASK;
}
snd_cmipci_write(cm, CM_REG_FUNCTRL1, val);
- //snd_printd("cmipci: functrl1 = %08x\n", val);
+ /* snd_printd("cmipci: functrl1 = %08x\n", val); */
/* set format */
val = snd_cmipci_read(cm, CM_REG_CHFORMAT);
@@ -866,7 +866,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
val |= freq_ext << (rec->ch * 2);
}
snd_cmipci_write(cm, CM_REG_CHFORMAT, val);
- //snd_printd("cmipci: chformat = %08x\n", val);
+ /* snd_printd("cmipci: chformat = %08x\n", val); */
if (!rec->is_dac && cm->chip_version) {
if (runtime->rate > 44100)
@@ -904,7 +904,7 @@ static int snd_cmipci_pcm_trigger(struct cmipci *cm, struct cmipci_pcm *rec,
cm->ctrl |= chen;
/* enable channel */
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
- //snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl);
+ /* snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl); */
break;
case SNDRV_PCM_TRIGGER_STOP:
rec->running = 0;
@@ -944,7 +944,7 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
unsigned int reg;
if (!rec->running)
return 0;
-#if 1 // this seems better..
+#if 1 /* this seems better.. */
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1);
ptr >>= rec->shift;
@@ -1127,7 +1127,7 @@ static struct snd_kcontrol_new snd_cmipci_spdif_stream __devinitdata =
/* save mixer setting and mute for AC3 playback */
static int save_mixer_state(struct cmipci *cm)
{
- if (! cm->mixer_insensitive) {
+ if (!cm->mixer_insensitive) {
struct snd_ctl_elem_value *val;
unsigned int i;
@@ -1199,7 +1199,7 @@ static void setup_ac3(struct cmipci *cm, struct snd_pcm_substream *subs, int do_
snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_AC3EN1);
/* AC3EN for 039 */
snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_AC3EN2);
-
+
if (cm->can_ac3_hw) {
/* SPD24SEL for 037, 0x02 */
/* SPD24SEL for 039, 0x20, but cannot be set */
@@ -1294,7 +1294,7 @@ static int snd_cmipci_playback_prepare(struct snd_pcm_substream *substream)
do_spdif = (rate >= 44100 && rate <= 96000 &&
substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE &&
substream->runtime->channels == 2);
- if (do_spdif && cm->can_ac3_hw)
+ if (do_spdif && cm->can_ac3_hw)
do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
if ((err = setup_spdif_playback(cm, substream, do_spdif, do_ac3)) < 0)
return err;
@@ -1307,7 +1307,7 @@ static int snd_cmipci_playback_spdif_prepare(struct snd_pcm_substream *substream
struct cmipci *cm = snd_pcm_substream_chip(substream);
int err, do_ac3;
- if (cm->can_ac3_hw)
+ if (cm->can_ac3_hw)
do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
else
do_ac3 = 1; /* doesn't matter */
@@ -1335,7 +1335,7 @@ static void snd_cmipci_silence_hack(struct cmipci *cm, struct cmipci_pcm *rec)
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
val = ((PAGE_SIZE / 4) - 1) | (((PAGE_SIZE / 4) / 2 - 1) << 16);
snd_cmipci_write(cm, reg, val);
-
+
/* configure for 16 bits, 2 channels, 8 kHz */
if (runtime->channels > 2)
set_dac_channels(cm, rec, 2);
@@ -1350,7 +1350,7 @@ static void snd_cmipci_silence_hack(struct cmipci *cm, struct cmipci_pcm *rec)
if (cm->can_96k)
val &= ~(CM_CH0_SRATE_MASK << (rec->ch * 2));
snd_cmipci_write(cm, CM_REG_CHFORMAT, val);
-
+
/* start stream (we don't need interrupts) */
cm->ctrl |= CM_CHEN0 << rec->ch;
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
@@ -1436,7 +1436,7 @@ static irqreturn_t snd_cmipci_interrupt(int irq, void *dev_id)
{
struct cmipci *cm = dev_id;
unsigned int status, mask = 0;
-
+
/* fastpath out, to ease interrupt sharing */
status = snd_cmipci_read(cm, CM_REG_INT_STATUS);
if (!(status & CM_INTR))
@@ -1616,7 +1616,7 @@ static int open_device_check(struct cmipci *cm, int mode, struct snd_pcm_substre
}
cm->opened[ch] = mode;
cm->channel[ch].substream = subs;
- if (! (mode & CM_OPEN_DAC)) {
+ if (!(mode & CM_OPEN_DAC)) {
/* disable dual DAC mode */
cm->channel[ch].is_dac = 0;
spin_lock_irq(&cm->reg_lock);
@@ -1639,7 +1639,7 @@ static void close_device_check(struct cmipci *cm, int mode)
cm->channel[ch].substream = NULL;
}
cm->opened[ch] = 0;
- if (! cm->channel[ch].is_dac) {
+ if (!cm->channel[ch].is_dac) {
/* enable dual DAC mode again */
cm->channel[ch].is_dac = 1;
spin_lock_irq(&cm->reg_lock);
@@ -1688,7 +1688,7 @@ static int snd_cmipci_capture_open(struct snd_pcm_substream *substream)
if ((err = open_device_check(cm, CM_OPEN_CAPTURE, substream)) < 0)
return err;
runtime->hw = snd_cmipci_capture;
- if (cm->chip_version == 68) { // 8768 only supports 44k/48k recording
+ if (cm->chip_version == 68) { /* 8768 only supports 44k/48k recording */
runtime->hw.rate_min = 41000;
runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
} else if (cm->chip_version == 55) {
@@ -1713,7 +1713,7 @@ static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream)
return err;
runtime->hw = snd_cmipci_playback2;
mutex_lock(&cm->open_mutex);
- if (! cm->opened[CM_CH_PLAY]) {
+ if (!cm->opened[CM_CH_PLAY]) {
if (cm->can_multi_ch) {
runtime->hw.channels_max = cm->max_channels;
if (cm->max_channels == 4)
@@ -2030,7 +2030,7 @@ static int snd_cmipci_info_volume(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = reg.mask;
return 0;
}
-
+
static int snd_cmipci_get_volume(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -2112,7 +2112,7 @@ static int snd_cmipci_info_input_sw(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = 1;
return 0;
}
-
+
static int snd_cmipci_get_input_sw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -2260,7 +2260,7 @@ static int snd_cmipci_put_native_mixer(struct snd_kcontrol *kcontrol,
static int snd_cmipci_get_native_mixer_sensitive(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- //struct cmipci *cm = snd_kcontrol_chip(kcontrol);
+ /* struct cmipci *cm = snd_kcontrol_chip(kcontrol); */
return snd_cmipci_get_native_mixer(kcontrol, ucontrol);
}
@@ -2280,7 +2280,7 @@ static struct snd_kcontrol_new snd_cmipci_mixers[] __devinitdata = {
CMIPCI_SB_VOL_STEREO("Master Playback Volume", SB_DSP4_MASTER_DEV, 3, 31),
CMIPCI_MIXER_SW_MONO("3D Control - Switch", CM_REG_MIXER1, CM_X3DEN_SHIFT, 0),
CMIPCI_SB_VOL_STEREO("PCM Playback Volume", SB_DSP4_PCM_DEV, 3, 31),
- //CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1),
+ /* CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1), */
{ /* switch with sensitivity */
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Switch",
@@ -2380,7 +2380,7 @@ static int _snd_cmipci_uswitch_put(struct snd_kcontrol *kcontrol,
val = inb(cm->iobase + args->reg);
else
val = snd_cmipci_read(cm, args->reg);
- change = (val & args->mask) != (ucontrol->value.integer.value[0] ?
+ change = (val & args->mask) != (ucontrol->value.integer.value[0] ?
args->mask_on : (args->mask & ~args->mask_on));
if (change) {
val &= ~args->mask;
@@ -2415,7 +2415,7 @@ static struct cmipci_switch_args cmipci_switch_arg_##sname = { \
.is_byte = xis_byte, \
.ac3_sensitive = xac3, \
}
-
+
#define DEFINE_BIT_SWITCH_ARG(sname, xreg, xmask, xis_byte, xac3) \
DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask, xis_byte, xac3)
@@ -2572,7 +2572,7 @@ static int snd_cmipci_mic_in_mode_get(struct snd_kcontrol *kcontrol,
struct cmipci *cm = snd_kcontrol_chip(kcontrol);
/* same bit as spdi_phase */
spin_lock_irq(&cm->reg_lock);
- ucontrol->value.enumerated.item[0] =
+ ucontrol->value.enumerated.item[0] =
(snd_cmipci_read_b(cm, CM_REG_MISC) & CM_SPDIF_INVERSE) ? 1 : 0;
spin_unlock_irq(&cm->reg_lock);
return 0;
@@ -2616,7 +2616,7 @@ static struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] __devinitdata =
DEFINE_MIXER_SWITCH("IEC958 Out", spdif_out),
DEFINE_MIXER_SWITCH("IEC958 Out To DAC", spdo2dac),
#endif
- // DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable),
+ /* DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable), */
{ .name = "IEC958 Output Switch",
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.info = snd_cmipci_uswitch_info,
@@ -2676,7 +2676,7 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
spin_unlock_irq(&cm->reg_lock);
for (idx = 0; idx < ARRAY_SIZE(snd_cmipci_mixers); idx++) {
- if (cm->chip_version == 68) { // 8768 has no PCM volume
+ if (cm->chip_version == 68) { /* 8768 has no PCM volume */
if (!strcmp(snd_cmipci_mixers[idx].name,
"PCM Playback Volume"))
continue;
@@ -2692,7 +2692,7 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
if (err < 0)
return err;
}
- if (! cm->can_multi_ch) {
+ if (!cm->can_multi_ch) {
err = snd_ctl_add(cm->card, snd_ctl_new1(&snd_cmipci_nomulti_switch, cm));
if (err < 0)
return err;
@@ -2766,12 +2766,12 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
*/
#ifdef CONFIG_PROC_FS
-static void snd_cmipci_proc_read(struct snd_info_entry *entry,
+static void snd_cmipci_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct cmipci *cm = entry->private_data;
int i, v;
-
+
snd_iprintf(buffer, "%s\n", cm->card->longname);
for (i = 0; i < 0x94; i++) {
if (i == 0x28)
@@ -2788,7 +2788,7 @@ static void __devinit snd_cmipci_proc_init(struct cmipci *cm)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(cm->card, "cmipci", &entry))
+ if (!snd_card_proc_new(cm->card, "cmipci", &entry))
snd_info_set_text_ops(entry, cm, snd_cmipci_proc_read);
}
#else /* !CONFIG_PROC_FS */
@@ -2816,7 +2816,7 @@ static void __devinit query_chip(struct cmipci *cm)
/* check reg 0Ch, bit 24-31 */
detect = snd_cmipci_read(cm, CM_REG_INT_HLDCLR) & CM_CHIP_MASK2;
- if (! detect) {
+ if (!detect) {
/* check reg 08h, bit 24-28 */
detect = snd_cmipci_read(cm, CM_REG_CHFORMAT) & CM_CHIP_MASK1;
switch (detect) {
@@ -3115,7 +3115,7 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
switch (pci->device) {
case PCI_DEVICE_ID_CMEDIA_CM8738:
case PCI_DEVICE_ID_CMEDIA_CM8738B:
- if (!pci_dev_present(intel_82437vx))
+ if (!pci_dev_present(intel_82437vx))
snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_TXVX);
break;
default:
@@ -3267,7 +3267,7 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
if (dev >= SNDRV_CARDS)
return -ENODEV;
- if (! enable[dev]) {
+ if (!enable[dev]) {
dev++;
return -ENOENT;
}
@@ -3275,7 +3275,7 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
-
+
switch (pci->device) {
case PCI_DEVICE_ID_CMEDIA_CM8738:
case PCI_DEVICE_ID_CMEDIA_CM8738B:
@@ -3343,7 +3343,7 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state)
int i;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
-
+
snd_pcm_suspend_all(cm->pcm);
snd_pcm_suspend_all(cm->pcm2);
snd_pcm_suspend_all(cm->pcm_spdif);
@@ -3406,7 +3406,7 @@ static struct pci_driver driver = {
.resume = snd_cmipci_resume,
#endif
};
-
+
static int __init alsa_card_cmipci_init(void)
{
return pci_register_driver(&driver);
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ef9308f..24cc52b 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -19,7 +19,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -573,13 +573,13 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
struct cs4281 *chip = ac97->private_data;
int count;
unsigned short result;
- // FIXME: volatile is necessary in the following due to a bug of
- // some gcc versions
+ /* FIXME: volatile is necessary in the following due to a bug of */
+ /* some gcc versions */
volatile int ac97_num = ((volatile struct snd_ac97 *)ac97)->num;
/*
* 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
- * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
+ * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
* 3. Write ACCTL = Control Register = 460h for initiating the write
* 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 17h
* 5. if DCV not cleared, break and return error
@@ -627,7 +627,7 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
snd_printk(KERN_ERR "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg);
result = 0xffff;
goto __end;
-
+
__ok1:
/*
* Wait for the valid status bit to go active.
@@ -642,7 +642,7 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
goto __ok2;
udelay(10);
}
-
+
snd_printk(KERN_ERR "AC'97 read problem (ACSTS_VSTS), reg = 0x%x\n", reg);
result = 0xffff;
goto __end;
@@ -654,7 +654,7 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
*/
result = snd_cs4281_peekBA0(chip, ac97_num ? BA0_ACSDA2 : BA0_ACSDA);
- __end:
+__end:
return result;
}
@@ -707,7 +707,7 @@ static int snd_cs4281_trigger(struct snd_pcm_substream *substream, int cmd)
static unsigned int snd_cs4281_rate(unsigned int rate, unsigned int *real_rate)
{
unsigned int val = ~0;
-
+
if (real_rate)
*real_rate = rate;
/* special "hardcoded" rates */
@@ -721,7 +721,7 @@ static unsigned int snd_cs4281_rate(unsigned int rate, unsigned int *real_rate)
default:
goto __variable;
}
- __variable:
+__variable:
val = 1536000 / rate;
if (real_rate)
*real_rate = 1536000 / val;
@@ -776,7 +776,7 @@ static void snd_cs4281_mode(struct cs4281 *chip, struct cs4281_dma *dma,
snd_cs4281_pokeBA0(chip, BA0_ADCSR, val);
}
}
- __skip_src:
+__skip_src:
/* Deactivate wave playback FIFO before changing slot assignments */
if (dma->regFCR == BA0_FCR0)
snd_cs4281_pokeBA0(chip, dma->regFCR, snd_cs4281_peekBA0(chip, dma->regFCR) & ~BA0_FCR_FEN);
@@ -834,7 +834,7 @@ static snd_pcm_uframes_t snd_cs4281_pointer(struct snd_pcm_substream *substream)
struct cs4281_dma *dma = runtime->private_data;
struct cs4281 *chip = snd_pcm_substream_chip(substream);
- // printk("DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n", snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, jiffies);
+ /* printk("DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n", snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, jiffies); */
return runtime->buffer_size -
snd_cs4281_peekBA0(chip, dma->regDCC) - 1;
}
@@ -965,7 +965,7 @@ static struct snd_pcm_ops snd_cs4281_capture_ops = {
.pointer = snd_cs4281_pointer,
};
-static int __devinit snd_cs4281_pcm(struct cs4281 * chip, int device,
+static int __devinit snd_cs4281_pcm(struct cs4281 *chip, int device,
struct snd_pcm ** rpcm)
{
struct snd_pcm *pcm;
@@ -1008,7 +1008,7 @@ static int snd_cs4281_info_volume(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = CS_VOL_MASK;
return 0;
}
-
+
static int snd_cs4281_get_volume(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -1052,24 +1052,24 @@ static int snd_cs4281_put_volume(struct snd_kcontrol *kcontrol,
static const DECLARE_TLV_DB_SCALE(db_scale_dsp, -4650, 150, 0);
-static struct snd_kcontrol_new snd_cs4281_fm_vol =
+static struct snd_kcontrol_new snd_cs4281_fm_vol =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Synth Playback Volume",
- .info = snd_cs4281_info_volume,
+ .info = snd_cs4281_info_volume,
.get = snd_cs4281_get_volume,
- .put = snd_cs4281_put_volume,
+ .put = snd_cs4281_put_volume,
.private_value = ((BA0_FMLVC << 16) | BA0_FMRVC),
.tlv = { .p = db_scale_dsp },
};
-static struct snd_kcontrol_new snd_cs4281_pcm_vol =
+static struct snd_kcontrol_new snd_cs4281_pcm_vol =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Stream Playback Volume",
- .info = snd_cs4281_info_volume,
+ .info = snd_cs4281_info_volume,
.get = snd_cs4281_get_volume,
- .put = snd_cs4281_put_volume,
+ .put = snd_cs4281_put_volume,
.private_value = ((BA0_PPLVC << 16) | BA0_PPRVC),
.tlv = { .p = db_scale_dsp },
};
@@ -1089,7 +1089,7 @@ static void snd_cs4281_mixer_free_ac97(struct snd_ac97 *ac97)
chip->ac97 = NULL;
}
-static int __devinit snd_cs4281_mixer(struct cs4281 * chip)
+static int __devinit snd_cs4281_mixer(struct cs4281 *chip)
{
struct snd_card *card = chip->card;
struct snd_ac97_template ac97;
@@ -1125,7 +1125,7 @@ static int __devinit snd_cs4281_mixer(struct cs4281 * chip)
* proc interface
*/
-static void snd_cs4281_proc_read(struct snd_info_entry *entry,
+static void snd_cs4281_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct cs4281 *chip = entry->private_data;
@@ -1142,7 +1142,7 @@ static long snd_cs4281_BA0_read(struct snd_info_entry *entry,
{
long size;
struct cs4281 *chip = entry->private_data;
-
+
size = count;
if (pos + size > CS4281_BA0_SIZE)
size = (long)CS4281_BA0_SIZE - pos;
@@ -1160,7 +1160,7 @@ static long snd_cs4281_BA1_read(struct snd_info_entry *entry,
{
long size;
struct cs4281 *chip = entry->private_data;
-
+
size = count;
if (pos + size > CS4281_BA1_SIZE)
size = (long)CS4281_BA1_SIZE - pos;
@@ -1179,19 +1179,19 @@ static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = {
.read = snd_cs4281_BA1_read,
};
-static void __devinit snd_cs4281_proc_init(struct cs4281 * chip)
+static void __devinit snd_cs4281_proc_init(struct cs4281 *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "cs4281", &entry))
+ if (!snd_card_proc_new(chip->card, "cs4281", &entry))
snd_info_set_text_ops(entry, chip, snd_cs4281_proc_read);
- if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
+ if (!snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
entry->c.ops = &snd_cs4281_proc_ops_BA0;
entry->size = CS4281_BA0_SIZE;
}
- if (! snd_card_proc_new(chip->card, "cs4281_BA1", &entry)) {
+ if (!snd_card_proc_new(chip->card, "cs4281_BA1", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
entry->c.ops = &snd_cs4281_proc_ops_BA1;
@@ -1229,16 +1229,16 @@ static int snd_cs4281_gameport_cooked_read(struct gameport *gameport,
{
struct cs4281 *chip = gameport_get_port_data(gameport);
unsigned js1, js2, jst;
-
+
if (snd_BUG_ON(!chip))
return 0;
js1 = snd_cs4281_peekBA0(chip, BA0_JSC1);
js2 = snd_cs4281_peekBA0(chip, BA0_JSC2);
jst = snd_cs4281_peekBA0(chip, BA0_JSPT);
-
- *buttons = (~jst >> 4) & 0x0F;
-
+
+ *buttons = (~jst >> 4) & 0x0F;
+
axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
@@ -1286,7 +1286,7 @@ static int __devinit snd_cs4281_create_gameport(struct cs4281 *chip)
gp->cooked_read = snd_cs4281_gameport_cooked_read;
gameport_set_port_data(gp, chip);
- snd_cs4281_pokeBA0(chip, BA0_JSIO, 0xFF); // ?
+ snd_cs4281_pokeBA0(chip, BA0_JSIO, 0xFF); /* ? */
snd_cs4281_pokeBA0(chip, BA0_JSCTL, JSCTL_SP_MEDIUM_SLOW);
gameport_register_port(gp);
@@ -1388,7 +1388,7 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
snd_cs4281_free(chip);
return -ENOMEM;
}
-
+
if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_SHARED,
"CS4281", chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
@@ -1427,7 +1427,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
if (tmp & BA0_EPPMC_FPDN)
snd_cs4281_pokeBA0(chip, BA0_EPPMC, tmp & ~BA0_EPPMC_FPDN);
- __retry:
+__retry:
tmp = snd_cs4281_peekBA0(chip, BA0_CFLR);
if (tmp != BA0_CFLR_DEFAULT) {
snd_cs4281_pokeBA0(chip, BA0_CFLR, BA0_CFLR_DEFAULT);
@@ -1440,9 +1440,9 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
/* Set the 'Configuration Write Protect' register
* to 4281h. Allows vendor-defined configuration
- * space between 0e4h and 0ffh to be written. */
+ * space between 0e4h and 0ffh to be written. */
snd_cs4281_pokeBA0(chip, BA0_CWPR, 0x4281);
-
+
if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC1)) != (BA0_SERC1_SO1EN | BA0_SERC1_AC97)) {
snd_printk(KERN_ERR "SERC1 AC'97 check failed (0x%x)\n", tmp);
return -EIO;
@@ -1469,7 +1469,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
* the Sync pulse on the AC97 link. */
snd_cs4281_pokeBA0(chip, BA0_ACCTL, 0);
udelay(50);
-
+
/* Drive the ARST# pin low for a minimum of 1uS (as defined in the AC97
* spec) and then drive it high. This is done for non AC97 modes since
* there might be logic external to the CS4281 that uses the ARST# line
@@ -1549,7 +1549,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
} while (time_after_eq(end_time, jiffies));
snd_printk(KERN_INFO "secondary codec doesn't respond. disable it...\n");
chip->dual_codec = 0;
- __codec2_ok: ;
+ __codec2_ok:;
}
/*
@@ -1787,7 +1787,7 @@ static struct snd_rawmidi_ops snd_cs4281_midi_input =
.trigger = snd_cs4281_midi_input_trigger,
};
-static int __devinit snd_cs4281_midi(struct cs4281 * chip, int device,
+static int __devinit snd_cs4281_midi(struct cs4281 *chip, int device,
struct snd_rawmidi **rrawmidi)
{
struct snd_rawmidi *rmidi;
@@ -1855,7 +1855,7 @@ static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id)
if ((status & BA0_HISR_MIDI) && chip->rmidi) {
unsigned char c;
-
+
spin_lock(&chip->reg_lock);
while ((snd_cs4281_peekBA0(chip, BA0_MIDSR) & BA0_MIDSR_RBE) == 0) {
c = snd_cs4281_peekBA0(chip, BA0_MIDRP);
@@ -2102,7 +2102,7 @@ static struct pci_driver driver = {
.resume = cs4281_resume,
#endif
};
-
+
static int __init alsa_card_cs4281_init(void)
{
return pci_register_driver(&driver);
diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c
index 7ff8b68..2e46ac7 100644
--- a/sound/pci/cs5530.c
+++ b/sound/pci/cs5530.c
@@ -10,8 +10,8 @@
* simultaneously play back audio at 16bit 44100kHz, the device actually plays
* back in the same format in which it is capturing. By forcing the chip to
* always play/capture in 16/44100, we can let alsa-lib convert the samples and
- * that way we can hack up some full duplex audio.
- *
+ * that way we can hack up some full duplex audio.
+ *
* XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
* The older version (VSA1) provides fairly good soundblaster emulation
* although there are a couple of bugs: large DMA buffers break record,
@@ -126,7 +126,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card,
err = pci_request_regions(pci, "CS5530");
if (err < 0) {
- kfree(chip);
+ kfree(chip);
pci_disable_device(pci);
return err;
}
@@ -207,7 +207,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card,
return -ENODEV;
}
- printk(KERN_INFO "CS5530: IRQ: %d DMA8: %d DMA16: %d\n", irq, dma8,
+ printk(KERN_INFO "CS5530: IRQ: %d DMA8: %d DMA16: %d\n", irq, dma8,
dma16);
err = snd_sbdsp_create(card, sb_base, irq, snd_sb16dsp_interrupt, dma8,
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 1d8b160..07c908c 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -27,7 +27,7 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/moduleparam.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -46,9 +46,9 @@ MODULE_PARM_DESC(ac97_quirk, "AC'97 board specific workarounds.");
static struct ac97_quirk ac97_quirks[] __devinitdata = {
#if 0 /* Not yet confirmed if all 5536 boards are HP only */
{
- .subvendor = PCI_VENDOR_ID_AMD,
- .subdevice = PCI_DEVICE_ID_AMD_CS5536_AUDIO,
- .name = "AMD RDK",
+ .subvendor = PCI_VENDOR_ID_AMD,
+ .subdevice = PCI_DEVICE_ID_AMD_CS5536_AUDIO,
+ .name = "AMD RDK",
.type = AC97_TUNE_HP_ONLY
},
#endif
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 564c33b..ea67963 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -32,18 +32,18 @@
static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
{
- /*
+ /*
we depend on snd_ac97_suspend to tell the
AC97 codec to shutdown. the amd spec suggests
that the LNK_SHUTDOWN be done at the same time
that the codec power-down is issued. instead,
- we do it just after rather than at the same
+ we do it just after rather than at the same
time. excluding codec specific build_ops->suspend
ac97 powerdown hits:
- 0x8000 EAPD
- 0x4000 Headphone amplifier
- 0x0300 ADC & DAC
- 0x0400 Analog Mixer powerdown (Vref on)
+ 0x8000 EAPD
+ 0x4000 Headphone amplifier
+ 0x0300 ADC & DAC
+ 0x0400 Analog Mixer powerdown (Vref on)
I am not sure if this is the best that we can do.
The remainder to be investigated are:
- analog mixer (vref off) 0x0800
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/cs46xx/cs46xx.c | 2 +-
sound/pci/cs46xx/cs46xx_lib.c | 316 ++++++++++----------
sound/pci/cs46xx/dsp_spos.c | 428 ++++++++++++++--------------
sound/pci/cs46xx/dsp_spos.h | 8 +-
sound/pci/cs46xx/dsp_spos_scb_lib.c | 546 +++++++++++++++++-----------------
sound/pci/cs46xx/imgs/cwcbinhack.h | 2 +-
6 files changed, 651 insertions(+), 651 deletions(-)
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index e876b32..d766d85 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -21,7 +21,7 @@
/*
NOTES:
- - sometimes the sound is metallic and sibilant, unloading and
+ - sometimes the sound is metallic and sibilant, unloading and
reloading the module may solve this.
*/
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index a10ab82..d8ab1ad 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -7,7 +7,7 @@
* KNOWN BUGS:
* - Sometimes the SPDIF input DSP tasks get's unsynchronized
* and the SPDIF get somewhat "distorcionated", or/and left right channel
- * are swapped. To get around this problem when it happens, mute and unmute
+ * are swapped. To get around this problem when it happens, mute and unmute
* the SPDIF input mixer control.
* - On the Hercules Game Theater XP the amplifier are sometimes turned
* off on inadecuate moments which causes distorcions on sound.
@@ -22,13 +22,13 @@
* is default configuration), no SPDIF, no secondary codec, no
* multi channel PCM. But known to work.
*
- * FINALLY: A credit to the developers Tom and Jordan
+ * FINALLY: A credit to the developers Tom and Jordan
* at Cirrus for have helping me out with the DSP, however we
* still don't have sufficient documentation and technical
* references to be able to implement all fancy feutures
- * supported by the cs46xx DSP's.
+ * supported by the cs46xx DSP's.
* Benny <benny(a)hostmobility.com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -62,7 +62,7 @@
#include <sound/pcm_params.h>
#include <sound/cs46xx.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "cs46xx_lib.h"
#include "dsp_spos.h"
@@ -102,7 +102,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
/*
* 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
- * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
+ * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
* 3. Write ACCTL = Control Register = 460h for initiating the write7---55
* 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 17h
* 5. if DCV not cleared, break and return error
@@ -114,10 +114,10 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL);
if ((tmp & ACCTL_VFRM) == 0) {
snd_printk(KERN_WARNING "cs46xx: ACCTL_VFRM not set 0x%x\n",tmp);
- snd_cs46xx_pokeBA0(chip, BA0_ACCTL, (tmp & (~ACCTL_ESYN)) | ACCTL_VFRM );
+ snd_cs46xx_pokeBA0(chip, BA0_ACCTL, (tmp & (~ACCTL_ESYN)) | ACCTL_VFRM);
msleep(50);
tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL + offset);
- snd_cs46xx_pokeBA0(chip, BA0_ACCTL, tmp | ACCTL_ESYN | ACCTL_VFRM );
+ snd_cs46xx_pokeBA0(chip, BA0_ACCTL, tmp | ACCTL_ESYN | ACCTL_VFRM);
}
@@ -137,7 +137,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
snd_cs46xx_pokeBA0(chip, BA0_ACCAD, reg);
snd_cs46xx_pokeBA0(chip, BA0_ACCDA, 0);
if (codec_index == CS46XX_PRIMARY_CODEC_INDEX) {
- snd_cs46xx_pokeBA0(chip, BA0_ACCTL,/* clear ACCTL_DCV */ ACCTL_CRW |
+ snd_cs46xx_pokeBA0(chip, BA0_ACCTL,/* clear ACCTL_DCV */ ACCTL_CRW |
ACCTL_VFRM | ACCTL_ESYN |
ACCTL_RSTN);
snd_cs46xx_pokeBA0(chip, BA0_ACCTL, ACCTL_DCV | ACCTL_CRW |
@@ -168,7 +168,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
snd_printk(KERN_ERR "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg);
result = 0xffff;
goto end;
-
+
ok1:
/*
* Wait for the valid status bit to go active.
@@ -183,7 +183,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
goto ok2;
udelay(10);
}
-
+
snd_printk(KERN_ERR "AC'97 read problem (ACSTS_VSTS), codec_index %d, reg = 0x%x\n", codec_index, reg);
result = 0xffff;
goto end;
@@ -199,14 +199,14 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
snd_cs46xx_peekBA0(chip, BA0_ACCAD));
#endif
- //snd_cs46xx_peekBA0(chip, BA0_ACCAD);
+ /* snd_cs46xx_peekBA0(chip, BA0_ACCAD); */
result = snd_cs46xx_peekBA0(chip, BA0_ACSDA + offset);
end:
chip->active_ctrl(chip, -1);
return result;
}
-static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 * ac97,
+static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{
struct snd_cs46xx *chip = ac97->private_data;
@@ -339,7 +339,7 @@ int snd_cs46xx_download(struct snd_cs46xx *chip,
int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip,
unsigned long offset,
- unsigned long len)
+ unsigned long len)
{
void __iomem *dst;
unsigned int bank = offset >> 16;
@@ -374,7 +374,7 @@ int snd_cs46xx_download_image(struct snd_cs46xx *chip)
BA1Struct.memory[idx].size)) < 0)
return err;
offset += BA1Struct.memory[idx].size >> 2;
- }
+ }
return 0;
}
#endif /* CONFIG_SND_CS46XX_NEW_DSP */
@@ -412,23 +412,23 @@ static void snd_cs46xx_reset(struct snd_cs46xx *chip)
snd_cs46xx_poke(chip, BA1_FRMT, 0xadf);
}
-static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout)
+static int cs46xx_wait_for_fifo(struct snd_cs46xx *chip, int retry_timeout)
{
u32 i, status = 0;
/*
* Make sure the previous FIFO write operation has completed.
*/
- for(i = 0; i < 50; i++){
+ for (i = 0; i < 50; i++){
status = snd_cs46xx_peekBA0(chip, BA0_SERBST);
-
- if( !(status & SERBST_WBSY) )
+
+ if (!(status & SERBST_WBSY))
break;
mdelay(retry_timeout);
}
-
- if(status & SERBST_WBSY) {
- snd_printk( KERN_ERR "cs46xx: failure waiting for FIFO command to complete\n");
+
+ if (status & SERBST_WBSY) {
+ snd_printk(KERN_ERR "cs46xx: failure waiting for FIFO command to complete\n");
return -EINVAL;
}
@@ -470,7 +470,7 @@ static void snd_cs46xx_clear_serial_FIFOs(struct snd_cs46xx *chip)
if (powerdown)
snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp);
-
+
break;
}
/*
@@ -668,7 +668,7 @@ static void snd_cs46xx_set_capture_sample_rate(struct snd_cs46xx *chip, unsigned
frameGroupLength *= 3;
}
for (cnt = 5; cnt <= 125; cnt *= 5) {
- if (((rate / cnt) * cnt) != rate)
+ if (((rate / cnt) * cnt) != rate)
frameGroupLength *= 5;
}
@@ -778,7 +778,7 @@ static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
#ifdef CONFIG_SND_CS46XX_NEW_DSP
struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
- if (! cpcm->pcm_channel) {
+ if (!cpcm->pcm_channel) {
return -ENXIO;
}
#endif
@@ -787,7 +787,7 @@ static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_RESUME:
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* magic value to unmute PCM stream playback volume */
- snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
+ snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
SCBVolumeCtrl) << 2, 0x80008000);
if (cpcm->pcm_channel->unlinked)
@@ -811,7 +811,7 @@ static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_SUSPEND:
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* magic mute channel */
- snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
+ snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
SCBVolumeCtrl) << 2, 0xffffffff);
if (!cpcm->pcm_channel->unlinked)
@@ -865,13 +865,13 @@ static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream,
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm,
- int sample_rate)
+static int _cs46xx_adjust_sample_rate(struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm,
+ int sample_rate)
{
/* If PCMReaderSCB and SrcTaskSCB not created yet ... */
- if ( cpcm->pcm_channel == NULL) {
- cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate,
+ if (cpcm->pcm_channel == NULL) {
+ cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel(chip, sample_rate,
cpcm, cpcm->hw_buf.addr,cpcm->pcm_channel_id);
if (cpcm->pcm_channel == NULL) {
snd_printk(KERN_ERR "cs46xx: failed to create virtual PCM channel\n");
@@ -882,9 +882,9 @@ static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46x
/* if sample rate is changed */
if ((int)cpcm->pcm_channel->sample_rate != sample_rate) {
int unlinked = cpcm->pcm_channel->unlinked;
- cs46xx_dsp_destroy_pcm_channel (chip,cpcm->pcm_channel);
+ cs46xx_dsp_destroy_pcm_channel(chip,cpcm->pcm_channel);
- if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm,
+ if ((cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel(chip, sample_rate, cpcm,
cpcm->hw_buf.addr,
cpcm->pcm_channel_id)) == NULL) {
snd_printk(KERN_ERR "cs46xx: failed to re-create virtual PCM channel\n");
@@ -1017,7 +1017,7 @@ static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream)
if (runtime->dma_area != cpcm->hw_buf.area)
snd_pcm_lib_free_pages(substream);
-
+
runtime->dma_area = NULL;
runtime->dma_addr = 0;
runtime->dma_bytes = 0;
@@ -1039,7 +1039,7 @@ static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
if (snd_BUG_ON(!cpcm->pcm_channel))
return -ENXIO;
- pfie = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2 );
+ pfie = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2);
pfie &= ~0x0000f03f;
#else
/* old dsp */
@@ -1068,7 +1068,7 @@ static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
if (snd_pcm_format_big_endian(runtime->format))
pfie |= 0x00004000;
}
-
+
memset(&cpcm->pcm_rec, 0, sizeof(cpcm->pcm_rec));
cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
cpcm->pcm_rec.hw_buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift;
@@ -1161,7 +1161,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
struct snd_cs46xx *chip = dev_id;
u32 status1;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
u32 status2;
int i;
struct snd_cs46xx_pcm *cpcm = NULL;
@@ -1181,7 +1181,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
for (i = 0; i < DSP_MAX_PCM_CHANNELS; ++i) {
if (i <= 15) {
- if ( status1 & (1 << i) ) {
+ if (status1 & (1 << i)) {
if (i == CS46XX_DSP_CAPTURE_CHANNEL) {
if (chip->capt.substream)
snd_pcm_period_elapsed(chip->capt.substream);
@@ -1195,8 +1195,8 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
}
}
} else {
- if ( status2 & (1 << (i - 16))) {
- if (ins->pcm_channels[i].active &&
+ if (status2 & (1 << (i - 16))) {
+ if (ins->pcm_channels[i].active &&
ins->pcm_channels[i].private_data &&
!ins->pcm_channels[i].unlinked) {
cpcm = ins->pcm_channels[i].private_data;
@@ -1220,7 +1220,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
if ((status1 & HISR_MIDI) && chip->rmidi) {
unsigned char c;
-
+
spin_lock(&chip->reg_lock);
while ((snd_cs46xx_peekBA0(chip, BA0_MIDSR) & MIDSR_RBE) == 0) {
c = snd_cs46xx_peekBA0(chip, BA0_MIDRP);
@@ -1251,7 +1251,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
static struct snd_pcm_hardware snd_cs46xx_playback =
{
.info = (SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER /*|*/
/*SNDRV_PCM_INFO_RESUME*/),
.formats = (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |
@@ -1307,7 +1307,7 @@ static void snd_cs46xx_pcm_free_substream(struct snd_pcm_runtime *runtime)
kfree(runtime->private_data);
}
-static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id)
+static int _cs46xx_playback_open_channel(struct snd_pcm_substream *substream, int pcm_channel_id)
{
struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
struct snd_cs46xx_pcm * cpcm;
@@ -1329,12 +1329,12 @@ static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,in
cpcm->substream = substream;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
mutex_lock(&chip->spos_mutex);
- cpcm->pcm_channel = NULL;
+ cpcm->pcm_channel = NULL;
cpcm->pcm_channel_id = pcm_channel_id;
snd_pcm_hw_constraint_list(runtime, 0,
- SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_sizes);
mutex_unlock(&chip->spos_mutex);
@@ -1389,7 +1389,7 @@ static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream)
{
int err;
struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
-
+
snd_printdd("close raw iec958 channel\n");
err = snd_cs46xx_playback_close(substream);
@@ -1419,7 +1419,7 @@ static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_pcm_hw_constraint_list(substream->runtime, 0,
- SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_sizes);
#endif
return 0;
@@ -1734,7 +1734,7 @@ static void snd_cs46xx_mixer_free_ac97(struct snd_ac97 *ac97)
chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL;
}
-static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
@@ -1758,7 +1758,7 @@ static int snd_cs46xx_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
- unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
+ unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
(0xffff - ucontrol->value.integer.value[1]));
unsigned int old = snd_cs46xx_peek(chip, reg);
int change = (old != val);
@@ -1827,7 +1827,7 @@ static int snd_cs46xx_vol_iec958_put(struct snd_kcontrol *kcontrol, struct snd_c
#define snd_mixer_boolean_info snd_ctl_boolean_mono_info
-static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1841,7 +1841,7 @@ static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1851,7 +1851,7 @@ static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
case CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT:
mutex_lock(&chip->spos_mutex);
change = (chip->dsp_spos_instance->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED);
- if (ucontrol->value.integer.value[0] && !change)
+ if (ucontrol->value.integer.value[0] && !change)
cs46xx_dsp_enable_spdif_out(chip);
else if (change && !ucontrol->value.integer.value[0])
cs46xx_dsp_disable_spdif_out(chip);
@@ -1867,7 +1867,7 @@ static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
}
else if (change && !ucontrol->value.integer.value[0])
cs46xx_dsp_disable_spdif_in(chip);
-
+
res = (change != chip->dsp_spos_instance->spdif_status_in);
break;
default:
@@ -1878,25 +1878,25 @@ static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
return res;
}
-static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if (ins->adc_input != NULL)
+ if (ins->adc_input != NULL)
ucontrol->value.integer.value[0] = 1;
- else
+ else
ucontrol->value.integer.value[0] = 0;
-
+
return 0;
}
-static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int change = 0;
if (ucontrol->value.integer.value[0] && !ins->adc_input) {
@@ -1909,26 +1909,26 @@ static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
return change;
}
-static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if (ins->pcm_input != NULL)
+ if (ins->pcm_input != NULL)
ucontrol->value.integer.value[0] = 1;
- else
+ else
ucontrol->value.integer.value[0] = 0;
return 0;
}
-static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int change = 0;
if (ucontrol->value.integer.value[0] && !ins->pcm_input) {
@@ -1942,7 +1942,7 @@ static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
return change;
}
-static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
+static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1959,8 +1959,8 @@ static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
/*
* Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial.
- */
-static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
+ */
+static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1969,9 +1969,9 @@ static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[0]) {
/* optical is default */
- snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
EGPIODR_GPOE0 | val1); /* enable EGPIO0 output */
- snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
EGPIOPTR_GPPT0 | val2); /* open-drain on output */
} else {
/* coaxial */
@@ -1979,7 +1979,7 @@ static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, val2 & ~EGPIOPTR_GPPT0); /* disable */
}
- /* checking diff from the EGPIO direction register
+ /* checking diff from the EGPIO direction register
should be enough */
return (val1 != (int)snd_cs46xx_peekBA0(chip, BA0_EGPIODR));
}
@@ -1996,7 +1996,7 @@ static int snd_cs46xx_spdif_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
mutex_lock(&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff);
@@ -2012,7 +2012,7 @@ static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned int val;
int change;
@@ -2027,7 +2027,7 @@ static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
change = (unsigned int)ins->spdif_csuv_default != val;
ins->spdif_csuv_default = val;
- if ( !(ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) )
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN))
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV,val);
mutex_unlock(&chip->spos_mutex);
@@ -2049,7 +2049,7 @@ static int snd_cs46xx_spdif_stream_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
mutex_lock(&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff);
@@ -2065,7 +2065,7 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned int val;
int change;
@@ -2080,7 +2080,7 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
change = ins->spdif_csuv_stream != val;
ins->spdif_csuv_stream = val;
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN )
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN)
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV,val);
mutex_unlock(&chip->spos_mutex);
@@ -2187,7 +2187,7 @@ static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = {
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* set primary cs4294 codec into Extended Audio Mode */
-static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -2197,7 +2197,7 @@ static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -2228,13 +2228,13 @@ static struct snd_kcontrol_new snd_hercules_controls[] = {
};
-static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
+static void snd_cs46xx_codec_reset(struct snd_ac97 *ac97)
{
unsigned long end_time;
int err;
/* reset to defaults */
- snd_ac97_write(ac97, AC97_RESET, 0);
+ snd_ac97_write(ac97, AC97_RESET, 0);
/* set the desired CODEC mode */
if (ac97->num == CS46XX_PRIMARY_CODEC_INDEX) {
@@ -2255,7 +2255,7 @@ static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
end_time = jiffies + HZ;
do {
unsigned short ext_mid;
-
+
/* use preliminary reads to settle the communication */
snd_ac97_read(ac97, AC97_RESET);
snd_ac97_read(ac97, AC97_VENDOR_ID1);
@@ -2273,7 +2273,7 @@ static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
msleep(10);
} while (time_after_eq(end_time, jiffies));
- snd_printk(KERN_ERR "CS46xx secondary codec doesn't respond!\n");
+ snd_printk(KERN_ERR "CS46xx secondary codec doesn't respond!\n");
}
#endif
@@ -2338,7 +2338,7 @@ int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_printdd("snd_cs46xx: detecting seconadry codec\n");
/* try detect a secondary codec */
- if (! cs46xx_detect_codec(chip, CS46XX_SECONDARY_CODEC_INDEX))
+ if (!cs46xx_detect_codec(chip, CS46XX_SECONDARY_CODEC_INDEX))
chip->nr_ac97_codecs = 2;
#endif /* CONFIG_SND_CS46XX_NEW_DSP */
@@ -2357,7 +2357,7 @@ int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(id.name, "External Amplifier");
chip->eapd_switch = snd_ctl_find_id(chip->card, &id);
-
+
#ifdef CONFIG_SND_CS46XX_NEW_DSP
if (chip->nr_ac97_codecs == 1) {
unsigned int id2 = chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]->id & 0xffff;
@@ -2378,7 +2378,7 @@ int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
/* turn on amplifier */
chip->amplifier_ctrl(chip, 1);
-
+
return 0;
}
@@ -2563,7 +2563,7 @@ static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
if (snd_BUG_ON(!chip))
return;
- snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF);
+ snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); /* outb(gameport->io, 0xFF); */
}
static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
@@ -2572,7 +2572,7 @@ static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
if (snd_BUG_ON(!chip))
return 0;
- return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io);
+ return snd_cs46xx_peekBA0(chip, BA0_JSPT); /* inb(gameport->io); */
}
static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
@@ -2586,16 +2586,16 @@ static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes,
js1 = snd_cs46xx_peekBA0(chip, BA0_JSC1);
js2 = snd_cs46xx_peekBA0(chip, BA0_JSC2);
jst = snd_cs46xx_peekBA0(chip, BA0_JSPT);
-
- *buttons = (~jst >> 4) & 0x0F;
-
+
+ *buttons = (~jst >> 4) & 0x0F;
+
axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
axes[3] = ((js2 & JSC2_X2V_MASK) >> JSC2_X2V_SHIFT) & 0xFFFF;
- for(jst=0;jst<4;++jst)
- if(axes[jst]==0xFFFF) axes[jst] = -1;
+ for (jst=0; jst<4; ++jst)
+ if (axes[jst]==0xFFFF) axes[jst] = -1;
return 0;
}
@@ -2632,7 +2632,7 @@ int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip)
gp->trigger = snd_cs46xx_gameport_trigger;
gp->cooked_read = snd_cs46xx_gameport_cooked_read;
- snd_cs46xx_pokeBA0(chip, BA0_JSIO, 0xFF); // ?
+ snd_cs46xx_pokeBA0(chip, BA0_JSIO, 0xFF); /* ? */
snd_cs46xx_pokeBA0(chip, BA0_JSCTL, JSCTL_SP_MEDIUM_SLOW);
gameport_register_port(gp);
@@ -2663,7 +2663,7 @@ static long snd_cs46xx_io_read(struct snd_info_entry *entry, void *file_private_
{
long size;
struct snd_cs46xx_region *region = entry->private_data;
-
+
size = count;
if (pos + (size_t)size > region->size)
size = region->size - pos;
@@ -2682,10 +2682,10 @@ static int __devinit snd_cs46xx_proc_init(struct snd_card *card, struct snd_cs46
{
struct snd_info_entry *entry;
int idx;
-
+
for (idx = 0; idx < 5; idx++) {
struct snd_cs46xx_region *region = &chip->region.idx[idx];
- if (! snd_card_proc_new(card, region->name, &entry)) {
+ if (!snd_card_proc_new(card, region->name, &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
entry->c.ops = &snd_cs46xx_proc_io_ops;
@@ -2753,7 +2753,7 @@ static void snd_cs46xx_hw_stop(struct snd_cs46xx *chip)
snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, 0);
/*
- * Turn off the Processor by turning off the software clock enable flag in
+ * Turn off the Processor by turning off the software clock enable flag in
* the clock control register.
*/
tmp = snd_cs46xx_peekBA0(chip, BA0_CLKCR1) & ~CLKCR1_SWCE;
@@ -2775,7 +2775,7 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
if (chip->amplifier_ctrl)
chip->amplifier_ctrl(chip, -chip->amplifier); /* force to off */
-
+
snd_cs46xx_proc_done(chip);
if (chip->region.idx[0].resource)
@@ -2800,7 +2800,7 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
chip->dsp_spos_instance = NULL;
}
#endif
-
+
#ifdef CONFIG_PM
kfree(chip->saved_regs);
#endif
@@ -2823,7 +2823,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
{
int timeout;
- /*
+ /*
* First, blast the clock control register to zero so that the PLL starts
* out in a known state, and blast the master serial port control register
* to zero so that the serial ports also start out in a known state.
@@ -2834,9 +2834,9 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
/*
* If we are in AC97 mode, then we must set the part to a host controlled
* AC-link. Otherwise, we won't be able to bring up the link.
- */
+ */
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- snd_cs46xx_pokeBA0(chip, BA0_SERACC, SERACC_HSP | SERACC_CHIP_TYPE_2_0 |
+ snd_cs46xx_pokeBA0(chip, BA0_SERACC, SERACC_HSP | SERACC_CHIP_TYPE_2_0 |
SERACC_TWO_CODECS); /* 2.00 dual codecs */
/* snd_cs46xx_pokeBA0(chip, BA0_SERACC, SERACC_HSP | SERACC_CHIP_TYPE_2_0); */ /* 2.00 codec */
#else
@@ -2858,7 +2858,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_cs46xx_pokeBA0(chip, BA0_ACCTL2, ACCTL_RSTN);
#endif
-
+
/*
* The first thing we do here is to enable sync generation. As soon
* as we start receiving bit clock, we'll start producing the SYNC
@@ -2966,7 +2966,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
for (count = 0; count < 150; count++) {
/* First, we want to wait for a short time. */
udelay(25);
-
+
if (snd_cs46xx_peekBA0(chip, BA0_ACSTS2) & ACSTS_CRDY)
break;
}
@@ -3009,7 +3009,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
return -EIO;
#else
/* This may happen on a cold boot with a Terratec SiXPack 5.1.
- Reloading the driver may help, if there's other soundcards
+ Reloading the driver may help, if there's other soundcards
with the same problem I would like to know. (Benny) */
snd_printk(KERN_ERR "ERROR: snd-cs46xx: never read ISV3 & ISV4 from AC'97\n");
@@ -3036,7 +3036,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
/* snd_cs46xx_pokeBA0(chip, BA0_AC97_POWERDOWN, 0x300); */
/*
- * Turn off the Processor by turning off the software clock enable flag in
+ * Turn off the Processor by turning off the software clock enable flag in
* the clock control register.
*/
/* tmp = snd_cs46xx_peekBA0(chip, BA0_CLKCR1) & ~CLKCR1_SWCE; */
@@ -3046,7 +3046,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
}
/*
- * start and load DSP
+ * start and load DSP
*/
static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip)
@@ -3054,7 +3054,7 @@ static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip)
unsigned int tmp;
snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_IEV | HICR_CHGM);
-
+
tmp = snd_cs46xx_peek(chip, BA1_PFIE);
tmp &= ~0x0000f03f;
snd_cs46xx_poke(chip, BA1_PFIE, tmp); /* playback interrupt enable */
@@ -3066,7 +3066,7 @@ static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip)
}
int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
-{
+{
unsigned int tmp;
/*
* Reset the processor.
@@ -3140,9 +3140,9 @@ int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
snd_cs46xx_proc_start(chip);
cs46xx_enable_stream_irqs(chip);
-
+
#ifndef CONFIG_SND_CS46XX_NEW_DSP
- /* set the attenuation to 0dB */
+ /* set the attenuation to 0dB */
snd_cs46xx_poke(chip, BA1_PVOL, 0x80008000);
snd_cs46xx_poke(chip, BA1_CVOL, 0x80008000);
#endif
@@ -3154,15 +3154,15 @@ int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
/*
* AMP control - null AMP
*/
-
+
static void amp_none(struct snd_cs46xx *chip, int change)
-{
+{
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
{
-
+
u32 idx, valid_slots,tmp,powerdown = 0;
u16 modem_power,pin_config,logic_type;
@@ -3183,39 +3183,39 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
* Clear PRA. The Bonzo chip will be used for GPIO not for modem
* stuff.
*/
- if(chip->nr_ac97_codecs != 2) {
+ if (chip->nr_ac97_codecs != 2) {
snd_printk (KERN_ERR "cs46xx: cs46xx_setup_eapd_slot() - no secondary codec configured\n");
return -EINVAL;
}
- modem_power = snd_cs46xx_codec_read (chip,
+ modem_power = snd_cs46xx_codec_read (chip,
AC97_EXTENDED_MSTATUS,
CS46XX_SECONDARY_CODEC_INDEX);
modem_power &=0xFEFF;
- snd_cs46xx_codec_write(chip,
+ snd_cs46xx_codec_write(chip,
AC97_EXTENDED_MSTATUS, modem_power,
CS46XX_SECONDARY_CODEC_INDEX);
/*
* Set GPIO pin's 7 and 8 so that they are configured for output.
*/
- pin_config = snd_cs46xx_codec_read (chip,
+ pin_config = snd_cs46xx_codec_read (chip,
AC97_GPIO_CFG,
CS46XX_SECONDARY_CODEC_INDEX);
pin_config &=0x27F;
- snd_cs46xx_codec_write(chip,
+ snd_cs46xx_codec_write(chip,
AC97_GPIO_CFG, pin_config,
CS46XX_SECONDARY_CODEC_INDEX);
-
+
/*
* Set GPIO pin's 7 and 8 so that they are compatible with CMOS logic.
*/
logic_type = snd_cs46xx_codec_read(chip, AC97_GPIO_POLARITY,
CS46XX_SECONDARY_CODEC_INDEX);
- logic_type &=0x27F;
+ logic_type &=0x27F;
snd_cs46xx_codec_write (chip, AC97_GPIO_POLARITY, logic_type,
CS46XX_SECONDARY_CODEC_INDEX);
@@ -3224,16 +3224,16 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
valid_slots |= 0x200;
snd_cs46xx_pokeBA0(chip, BA0_ACOSV, valid_slots);
- if ( cs46xx_wait_for_fifo(chip,1) ) {
+ if (cs46xx_wait_for_fifo(chip,1)) {
snd_printdd("FIFO is busy\n");
-
+
return -EINVAL;
}
/*
- * Fill slots 12 with the correct value for the GPIO pins.
+ * Fill slots 12 with the correct value for the GPIO pins.
*/
- for(idx = 0x90; idx <= 0x9F; idx++) {
+ for (idx = 0x90; idx <= 0x9F; idx++) {
/*
* Initialize the fifo so that bits 7 and 8 are on.
*
@@ -3245,17 +3245,17 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
/*
* Wait for command to complete
*/
- if ( cs46xx_wait_for_fifo(chip,200) ) {
+ if (cs46xx_wait_for_fifo(chip,200)) {
snd_printdd("failed waiting for FIFO at addr (%02X)\n",idx);
return -EINVAL;
}
-
+
/*
* Write the serial port FIFO index.
*/
snd_cs46xx_pokeBA0(chip, BA0_SERBAD, idx);
-
+
/*
* Tell the serial port to load the new value into the FIFO location.
*/
@@ -3279,17 +3279,17 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
/*
* Crystal EAPD mode
*/
-
+
static void amp_voyetra(struct snd_cs46xx *chip, int change)
{
- /* Manage the EAPD bit on the Crystal 4297
+ /* Manage the EAPD bit on the Crystal 4297
and the Analog AD1885 */
-
+
#ifdef CONFIG_SND_CS46XX_NEW_DSP
int old = chip->amplifier;
#endif
int oval, val;
-
+
chip->amplifier += change;
oval = snd_cs46xx_codec_read(chip, AC97_POWERDOWN,
CS46XX_PRIMARY_CODEC_INDEX);
@@ -3316,7 +3316,7 @@ static void amp_voyetra(struct snd_cs46xx *chip, int change)
#endif
}
-static void hercules_init(struct snd_cs46xx *chip)
+static void hercules_init(struct snd_cs46xx *chip)
{
/* default: AMP off, and SPDIF input optical */
snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0);
@@ -3326,7 +3326,7 @@ static void hercules_init(struct snd_cs46xx *chip)
/*
* Game Theatre XP card - EGPIO[2] is used to enable the external amp.
- */
+ */
static void amp_hercules(struct snd_cs46xx *chip, int change)
{
int old = chip->amplifier;
@@ -3337,9 +3337,9 @@ static void amp_hercules(struct snd_cs46xx *chip, int change)
if (chip->amplifier && !old) {
snd_printdd ("Hercules amplifier ON\n");
- snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
EGPIODR_GPOE2 | val1); /* enable EGPIO2 output */
- snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
EGPIOPTR_GPPT2 | val2); /* open-drain on output */
} else if (old && !chip->amplifier) {
snd_printdd ("Hercules amplifier OFF\n");
@@ -3348,7 +3348,7 @@ static void amp_hercules(struct snd_cs46xx *chip, int change)
}
}
-static void voyetra_mixer_init (struct snd_cs46xx *chip)
+static void voyetra_mixer_init(struct snd_cs46xx *chip)
{
snd_printdd ("initializing Voyetra mixer\n");
@@ -3357,7 +3357,7 @@ static void voyetra_mixer_init (struct snd_cs46xx *chip)
snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0);
}
-static void hercules_mixer_init (struct snd_cs46xx *chip)
+static void hercules_mixer_init(struct snd_cs46xx *chip)
{
#ifdef CONFIG_SND_CS46XX_NEW_DSP
unsigned int idx;
@@ -3374,7 +3374,7 @@ static void hercules_mixer_init (struct snd_cs46xx *chip)
if (chip->in_suspend)
return;
- for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
+ for (idx = 0; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
struct snd_kcontrol *kctl;
kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip);
@@ -3391,7 +3391,7 @@ static void hercules_mixer_init (struct snd_cs46xx *chip)
/*
* Untested
*/
-
+
static void amp_voyetra_4294(struct snd_cs46xx *chip, int change)
{
chip->amplifier += change;
@@ -3421,21 +3421,21 @@ static void amp_voyetra_4294(struct snd_cs46xx *chip, int change)
* Linuxcare. Perhaps one day Crystal will document their chips well
* enough to make them useful.
*/
-
+
static void clkrun_hack(struct snd_cs46xx *chip, int change)
{
u16 control, nval;
-
+
if (!chip->acpi_port)
return;
chip->amplifier += change;
-
- /* Read ACPI port */
+
+ /* Read ACPI port */
nval = control = inw(chip->acpi_port + 0x10);
/* Flip CLKRUN off while running */
- if (! chip->amplifier)
+ if (!chip->amplifier)
nval |= 0x2000;
else
nval &= ~0x2000;
@@ -3443,7 +3443,7 @@ static void clkrun_hack(struct snd_cs46xx *chip, int change)
outw(nval, chip->acpi_port + 0x10);
}
-
+
/*
* detect intel piix4
*/
@@ -3453,13 +3453,13 @@ static void clkrun_init(struct snd_cs46xx *chip)
u8 pp;
chip->acpi_port = 0;
-
+
pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3, NULL);
if (pdev == NULL)
return; /* Not a thinkpad thats for sure */
- /* Find the control port */
+ /* Find the control port */
pci_read_config_byte(pdev, 0x41, &pp);
chip->acpi_port = pp << 8;
pci_dev_put(pdev);
@@ -3469,7 +3469,7 @@ static void clkrun_init(struct snd_cs46xx *chip)
/*
* Card subid table
*/
-
+
struct cs_card_type
{
u16 vendor;
@@ -3595,8 +3595,8 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
chip->in_suspend = 1;
snd_pcm_suspend_all(chip->pcm);
- // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL);
- // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE);
+ /* chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL); */
+ /* chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE); */
snd_ac97_suspend(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]);
snd_ac97_suspend(chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]);
@@ -3652,9 +3652,9 @@ int snd_cs46xx_resume(struct pci_dev *pci)
#endif
#if 0
- snd_cs46xx_codec_write(chip, BA0_AC97_GENERAL_PURPOSE,
+ snd_cs46xx_codec_write(chip, BA0_AC97_GENERAL_PURPOSE,
chip->ac97_general_purpose);
- snd_cs46xx_codec_write(chip, AC97_POWER_CONTROL,
+ snd_cs46xx_codec_write(chip, AC97_POWER_CONTROL,
chip->ac97_powerdown);
mdelay(10);
snd_cs46xx_codec_write(chip, BA0_AC97_POWERDOWN,
@@ -3700,7 +3700,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_cs46xx_dev_free,
};
-
+
*rchip = NULL;
/* enable PCI device */
@@ -3782,7 +3782,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
chip->active_ctrl = clkrun_hack;
clkrun_init(chip);
}
-
+
if (chip->amplifier_ctrl == NULL)
chip->amplifier_ctrl = amp_none;
if (chip->active_ctrl == NULL)
@@ -3835,7 +3835,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
snd_cs46xx_free(chip);
return err;
}
-
+
snd_cs46xx_proc_init(card, chip);
#ifdef CONFIG_PM
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index f4f0c8f..ad6e433 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -20,7 +20,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
@@ -37,10 +37,10 @@
#include "cs46xx_lib.h"
#include "dsp_spos.h"
-static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
- struct dsp_scb_descriptor * fg_entry);
+static int cs46xx_dsp_async_init(struct snd_cs46xx *chip,
+ struct dsp_scb_descriptor *fg_entry);
-static enum wide_opcode wide_opcodes[] = {
+static enum wide_opcode wide_opcodes[] = {
WIDE_FOR_BEGIN_LOOP,
WIDE_FOR_BEGIN_LOOP2,
WIDE_COND_GOTO_ADDR,
@@ -55,17 +55,17 @@ static enum wide_opcode wide_opcodes[] = {
WIDE_TBEQ_NCOND_CALL1_ADDR
};
-static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 size,
+static int shadow_and_reallocate_code(struct snd_cs46xx *chip, u32 *data, u32 size,
u32 overlay_begin_address)
{
unsigned int i = 0, j, nreallocated = 0;
u32 hival,loval,address;
u32 mop_operands,mop_type,wide_op;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(size %2))
return -EINVAL;
-
+
while (i < size) {
loval = data[i++];
hival = data[i++];
@@ -73,37 +73,37 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32
if (ins->code.offset > 0) {
mop_operands = (hival >> 6) & 0x03fff;
mop_type = mop_operands >> 10;
-
+
/* check for wide type instruction */
if (mop_type == 0 &&
(mop_operands & WIDE_LADD_INSTR_MASK) == 0 &&
(mop_operands & WIDE_INSTR_MASK) != 0) {
wide_op = loval & 0x7f;
- for (j = 0;j < ARRAY_SIZE(wide_opcodes); ++j) {
+ for (j = 0; j < ARRAY_SIZE(wide_opcodes); ++j) {
if (wide_opcodes[j] == wide_op) {
/* need to reallocate instruction */
address = (hival & 0x00FFF) << 5;
address |= loval >> 15;
-
+
snd_printdd("handle_wideop[1]: %05x:%05x addr %04x\n",hival,loval,address);
-
- if ( !(address & 0x8000) ) {
+
+ if (!(address & 0x8000)) {
address += (ins->code.offset / 2) - overlay_begin_address;
} else {
snd_printdd("handle_wideop[1]: ROM symbol not reallocated\n");
}
-
+
hival &= 0xFF000;
loval &= 0x07FFF;
-
+
hival |= ( (address >> 5) & 0x00FFF);
loval |= ( (address << 15) & 0xF8000);
-
+
address = (hival & 0x00FFF) << 5;
address |= loval >> 15;
-
- snd_printdd("handle_wideop:[2] %05x:%05x addr %04x\n",hival,loval,address);
- nreallocated ++;
+
+ snd_printdd("handle_wideop:[2] %05x:%05x addr %04x\n",hival,loval,address);
+ nreallocated++;
} /* wide_opcodes[j] == wide_op */
} /* for */
} /* mod_type == 0 ... */
@@ -117,10 +117,10 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32
return nreallocated;
}
-static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * module, int seg_type)
+static struct dsp_segment_desc *get_segment_desc(struct dsp_module_desc *module, int seg_type)
{
int i;
- for (i = 0;i < module->nsegments; ++i) {
+ for (i = 0; i < module->nsegments; ++i) {
if (module->segments[i].segment_type == seg_type) {
return (module->segments + i);
}
@@ -129,7 +129,7 @@ static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * modu
return NULL;
};
-static int find_free_symbol_index (struct dsp_spos_instance * ins)
+static int find_free_symbol_index(struct dsp_spos_instance *ins)
{
int index = ins->symbol_table.nsymbols,i;
@@ -143,19 +143,19 @@ static int find_free_symbol_index (struct dsp_spos_instance * ins)
return index;
}
-static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * module)
+static int add_symbols(struct snd_cs46xx *chip, struct dsp_module_desc *module)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (module->symbol_table.nsymbols > 0) {
if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") &&
- module->symbol_table.symbols[0].symbol_type == SYMBOL_CONSTANT ) {
+ module->symbol_table.symbols[0].symbol_type == SYMBOL_CONSTANT) {
module->overlay_begin_address = module->symbol_table.symbols[0].address;
}
}
- for (i = 0;i < module->symbol_table.nsymbols; ++i) {
+ for (i = 0; i < module->symbol_table.nsymbols; ++i) {
if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
snd_printk(KERN_ERR "dsp_spos: symbol table is full\n");
return -ENOMEM;
@@ -171,7 +171,7 @@ static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * modul
ins->symbol_table.symbols[ins->symbol_table.nsymbols].module = module;
ins->symbol_table.symbols[ins->symbol_table.nsymbols].deleted = 0;
- if (ins->symbol_table.nsymbols > ins->symbol_table.highest_frag_index)
+ if (ins->symbol_table.nsymbols > ins->symbol_table.highest_frag_index)
ins->symbol_table.highest_frag_index = ins->symbol_table.nsymbols;
ins->symbol_table.nsymbols++;
@@ -185,17 +185,17 @@ static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * modul
}
static struct dsp_symbol_entry *
-add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
+add_symbol(struct snd_cs46xx *chip, char *symbol_name, u32 address, int type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_symbol_entry * symbol = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_symbol_entry *symbol = NULL;
int index;
if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
snd_printk(KERN_ERR "dsp_spos: symbol table is full\n");
return NULL;
}
-
+
if (cs46xx_dsp_lookup_symbol(chip,
symbol_name,
type) != NULL) {
@@ -212,7 +212,7 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
ins->symbol_table.symbols[index].deleted = 0;
symbol = (ins->symbol_table.symbols + index);
- if (index > ins->symbol_table.highest_frag_index)
+ if (index > ins->symbol_table.highest_frag_index)
ins->symbol_table.highest_frag_index = index;
if (index == ins->symbol_table.nsymbols)
@@ -221,11 +221,11 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
return symbol;
}
-struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
+struct dsp_spos_instance *cs46xx_dsp_spos_create(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL);
+ struct dsp_spos_instance *ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL);
- if (ins == NULL)
+ if (ins == NULL)
return NULL;
/* better to use vmalloc for this big table */
@@ -271,8 +271,8 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
/* set left and right validity bits and
default channel status */
- ins->spdif_csuv_default =
- ins->spdif_csuv_stream =
+ ins->spdif_csuv_default =
+ ins->spdif_csuv_stream =
/* byte 0 */ ((unsigned int)_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF & 0xff)) << 24) |
/* byte 1 */ ((unsigned int)_wrap_all_bits( ((SNDRV_PCM_DEFAULT_CON_SPDIF >> 8) & 0xff)) << 16) |
/* byte 3 */ (unsigned int)_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF >> 24) & 0xff) |
@@ -285,10 +285,10 @@ error:
return NULL;
}
-void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
+void cs46xx_dsp_spos_destroy(struct snd_cs46xx *chip)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins))
return;
@@ -297,7 +297,7 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
for (i = 0; i < ins->nscb; ++i) {
if (ins->scbs[i].deleted) continue;
- cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i) );
+ cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i));
}
kfree(ins->code.data);
@@ -354,10 +354,10 @@ static int dsp_load_sample(struct snd_cs46xx *chip,
return 0;
}
-int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module)
+int cs46xx_dsp_load_module(struct snd_cs46xx *chip, struct dsp_module_desc *module)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_segment_desc *code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
u32 doffset, dsize;
int err;
@@ -367,12 +367,12 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m
}
snd_printdd("dsp_spos: loading module %s into DSP\n", module->module_name);
-
+
if (ins->nmodules == 0) {
snd_printdd("dsp_spos: clearing parameter area\n");
snd_cs46xx_clear_BA1(chip, DSP_PARAMETER_BYTE_OFFSET, DSP_PARAMETER_BYTE_SIZE);
}
-
+
err = dsp_load_parameter(chip, get_segment_desc(module,
SEGTYPE_SP_PARAMETER));
if (err < 0)
@@ -412,11 +412,11 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m
snd_printk(KERN_ERR "dsp_spos: failed to load symbol table\n");
return -ENOMEM;
}
-
+
doffset = (code->offset * 4 + ins->code.offset * 4 + DSP_CODE_BYTE_OFFSET);
dsize = code->size * 4;
snd_printdd("dsp_spos: downloading code to chip (%08x-%08x)\n",
- doffset,doffset + dsize);
+ doffset,doffset + dsize);
module->nfixups = shadow_and_reallocate_code(chip,code->data,code->size,module->overlay_begin_address);
@@ -438,12 +438,12 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m
}
struct dsp_symbol_entry *
-cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type)
+cs46xx_dsp_lookup_symbol(struct snd_cs46xx *chip, char *symbol_name, int symbol_type)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
+ for (i = 0; i < ins->symbol_table.nsymbols; ++i) {
if (ins->symbol_table.symbols[i].deleted)
continue;
@@ -465,12 +465,12 @@ cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symb
#ifdef CONFIG_PROC_FS
static struct dsp_symbol_entry *
-cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type)
+cs46xx_dsp_lookup_symbol_addr(struct snd_cs46xx *chip, u32 address, int symbol_type)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
+ for (i = 0; i < ins->symbol_table.nsymbols; ++i) {
if (ins->symbol_table.symbols[i].deleted)
continue;
@@ -486,15 +486,15 @@ cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol
}
-static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_symbol_table_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
snd_iprintf(buffer, "SYMBOLS:\n");
- for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
+ for (i = 0; i < ins->symbol_table.nsymbols; ++i) {
char *module_str = "system";
if (ins->symbol_table.symbols[i].deleted)
@@ -504,32 +504,32 @@ static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
module_str = ins->symbol_table.symbols[i].module->module_name;
}
-
+
snd_iprintf(buffer, "%04X <%02X> %s [%s]\n",
ins->symbol_table.symbols[i].address,
ins->symbol_table.symbols[i].symbol_type,
ins->symbol_table.symbols[i].symbol_name,
- module_str);
+ module_str);
}
}
-static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_modules_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i,j;
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer, "MODULES:\n");
- for ( i = 0; i < ins->nmodules; ++i ) {
+ for (i = 0; i < ins->nmodules; ++i) {
snd_iprintf(buffer, "\n%s:\n", ins->modules[i].module_name);
snd_iprintf(buffer, " %d symbols\n", ins->modules[i].symbol_table.nsymbols);
snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups);
for (j = 0; j < ins->modules[i].nsegments; ++ j) {
- struct dsp_segment_desc * desc = (ins->modules[i].segments + j);
+ struct dsp_segment_desc *desc = (ins->modules[i].segments + j);
snd_iprintf(buffer, " segment %02x offset %08x size %08x\n",
desc->segment_type,desc->offset, desc->size);
}
@@ -537,20 +537,20 @@ static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
mutex_unlock(&chip->spos_mutex);
}
-static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_task_tree_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i, j, col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer, "TASK TREES:\n");
- for ( i = 0; i < ins->ntask; ++i) {
+ for (i = 0; i < ins->ntask; ++i) {
snd_iprintf(buffer,"\n%04x %s:\n",ins->tasks[i].address,ins->tasks[i].task_name);
- for (col = 0,j = 0;j < ins->tasks[i].size; j++,col++) {
+ for (col = 0,j = 0; j < ins->tasks[i].size; j++, col++) {
u32 val;
if (col == 4) {
snd_iprintf(buffer,"\n");
@@ -561,26 +561,26 @@ static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry,
}
}
- snd_iprintf(buffer,"\n");
+ snd_iprintf(buffer,"\n");
mutex_unlock(&chip->spos_mutex);
}
-static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_scb_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer, "SCB's:\n");
- for ( i = 0; i < ins->nscb; ++i) {
+ for (i = 0; i < ins->nscb; ++i) {
if (ins->scbs[i].deleted)
continue;
snd_iprintf(buffer,"\n%04x %s:\n\n",ins->scbs[i].address,ins->scbs[i].scb_name);
if (ins->scbs[i].parent_scb_ptr != NULL) {
- snd_iprintf(buffer,"parent [%s:%04x] ",
+ snd_iprintf(buffer,"parent [%s:%04x] ",
ins->scbs[i].parent_scb_ptr->scb_name,
ins->scbs[i].parent_scb_ptr->address);
} else snd_iprintf(buffer,"parent [none] ");
@@ -598,22 +598,22 @@ static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry,
mutex_unlock(&chip->spos_mutex);
}
-static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_parameter_dump_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- /*struct dsp_spos_instance * ins = chip->dsp_spos_instance; */
+ /*struct dsp_spos_instance *ins = chip->dsp_spos_instance; */
unsigned int i, col = 0;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
- struct dsp_symbol_entry * symbol;
+ struct dsp_symbol_entry *symbol;
- for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) {
+ for (i = 0; i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
- if ( (symbol = cs46xx_dsp_lookup_symbol_addr (chip,i / sizeof(u32), SYMBOL_PARAMETER)) != NULL) {
+ if ((symbol = cs46xx_dsp_lookup_symbol_addr (chip,i / sizeof(u32), SYMBOL_PARAMETER)) != NULL) {
col = 0;
snd_iprintf (buffer,"\n%s:\n",symbol->symbol_name);
}
@@ -626,15 +626,15 @@ static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry,
}
}
-static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_sample_dump_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- int i,col = 0;
+ int i, col = 0;
void __iomem *dst = chip->region.idx[2].remap_addr;
snd_iprintf(buffer,"PCMREADER:\n");
- for (i = PCM_READER_BUF1;i < PCM_READER_BUF1 + 0x30; i += sizeof(u32),col ++) {
+ for (i = PCM_READER_BUF1; i < PCM_READER_BUF1 + 0x30; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -650,7 +650,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nMIX_SAMPLE_BUF1:\n");
col = 0;
- for (i = MIX_SAMPLE_BUF1;i < MIX_SAMPLE_BUF1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = MIX_SAMPLE_BUF1; i < MIX_SAMPLE_BUF1 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -665,12 +665,12 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nSRC_TASK_SCB1:\n");
col = 0;
- for (i = 0x2480 ; i < 0x2480 + 0x40 ; i += sizeof(u32),col ++) {
+ for (i = 0x2480; i < 0x2480 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
-
+
if (col == 0) {
snd_iprintf(buffer, "%04X ",i);
}
@@ -681,7 +681,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nSPDIFO_BUFFER:\n");
col = 0;
- for (i = SPDIFO_IP_OUTPUT_BUFFER1;i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x30; i += sizeof(u32),col ++) {
+ for (i = SPDIFO_IP_OUTPUT_BUFFER1; i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x30; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -697,7 +697,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\n...\n");
col = 0;
- for (i = SPDIFO_IP_OUTPUT_BUFFER1+0xD0;i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x110; i += sizeof(u32),col ++) {
+ for (i = SPDIFO_IP_OUTPUT_BUFFER1+0xD0; i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x110; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -713,7 +713,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nOUTPUT_SNOOP:\n");
col = 0;
- for (i = OUTPUT_SNOOP_BUFFER;i < OUTPUT_SNOOP_BUFFER + 0x40; i += sizeof(u32),col ++) {
+ for (i = OUTPUT_SNOOP_BUFFER; i < OUTPUT_SNOOP_BUFFER + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -728,7 +728,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nCODEC_INPUT_BUF1: \n");
col = 0;
- for (i = CODEC_INPUT_BUF1;i < CODEC_INPUT_BUF1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = CODEC_INPUT_BUF1; i < CODEC_INPUT_BUF1 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -743,7 +743,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
#if 0
snd_iprintf(buffer,"\nWRITE_BACK_BUF1: \n");
col = 0;
- for (i = WRITE_BACK_BUF1;i < WRITE_BACK_BUF1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = WRITE_BACK_BUF1; i < WRITE_BACK_BUF1 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -759,7 +759,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nSPDIFI_IP_OUTPUT_BUFFER1: \n");
col = 0;
- for (i = SPDIFI_IP_OUTPUT_BUFFER1;i < SPDIFI_IP_OUTPUT_BUFFER1 + 0x80; i += sizeof(u32),col ++) {
+ for (i = SPDIFI_IP_OUTPUT_BUFFER1; i < SPDIFI_IP_OUTPUT_BUFFER1 + 0x80; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -768,16 +768,16 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
if (col == 0) {
snd_iprintf(buffer, "%04X ",i);
}
-
+
snd_iprintf(buffer,"%08X ",readl(dst + i));
}
snd_iprintf(buffer,"\n");
}
-int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
+int cs46xx_dsp_proc_init(struct snd_card *card, struct snd_cs46xx *chip)
{
struct snd_info_entry *entry;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
ins->snd_card = card;
@@ -785,7 +785,7 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
if ((entry = snd_info_create_card_entry(card, "dsp", card->proc_root)) != NULL) {
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
-
+
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
entry = NULL;
@@ -808,7 +808,7 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
}
}
ins->proc_sym_info_entry = entry;
-
+
if ((entry = snd_info_create_card_entry(card, "spos_modules", ins->proc_dsp_dir)) != NULL) {
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = chip;
@@ -881,9 +881,9 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
+int cs46xx_dsp_proc_done(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
snd_info_free_entry(ins->proc_sym_info_entry);
@@ -907,7 +907,7 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
mutex_lock(&chip->spos_mutex);
for (i = 0; i < ins->nscb; ++i) {
if (ins->scbs[i].deleted) continue;
- cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i) );
+ cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i));
}
mutex_unlock(&chip->spos_mutex);
@@ -919,10 +919,10 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
#endif /* CONFIG_PROC_FS */
static int debug_tree;
-static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
+static void _dsp_create_task_tree(struct snd_cs46xx *chip, u32 *task_data,
u32 dest, int size)
{
- void __iomem *spdst = chip->region.idx[1].remap_addr +
+ void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
int i;
@@ -934,9 +934,9 @@ static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
}
static int debug_scb;
-static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest)
+static void _dsp_create_scb(struct snd_cs46xx *chip, u32 *scb_data, u32 dest)
{
- void __iomem *spdst = chip->region.idx[1].remap_addr +
+ void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
int i;
@@ -947,7 +947,7 @@ static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest)
}
}
-static int find_free_scb_index (struct dsp_spos_instance * ins)
+static int find_free_scb_index(struct dsp_spos_instance *ins)
{
int index = ins->nscb, i;
@@ -961,10 +961,10 @@ static int find_free_scb_index (struct dsp_spos_instance * ins)
return index;
}
-static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * name, u32 dest)
+static struct dsp_scb_descriptor *_map_scb(struct snd_cs46xx *chip, char *name, u32 dest)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * desc = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *desc = NULL;
int index;
if (ins->nscb == DSP_MAX_SCB_DESC - 1) {
@@ -995,10 +995,10 @@ static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * nam
}
static struct dsp_task_descriptor *
-_map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size)
+_map_task_tree(struct snd_cs46xx *chip, char *name, u32 dest, u32 size)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_task_descriptor * desc = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_task_descriptor *desc = NULL;
if (ins->ntask == DSP_MAX_TASK_DESC - 1) {
snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n");
@@ -1023,9 +1023,9 @@ _map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size)
}
struct dsp_scb_descriptor *
-cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest)
+cs46xx_dsp_create_scb(struct snd_cs46xx *chip, char *name, u32 *scb_data, u32 dest)
{
- struct dsp_scb_descriptor * desc;
+ struct dsp_scb_descriptor *desc;
desc = _map_scb (chip,name,dest);
if (desc) {
@@ -1040,10 +1040,10 @@ cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32
static struct dsp_task_descriptor *
-cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_data,
+cs46xx_dsp_create_task_tree(struct snd_cs46xx *chip, char *name, u32 *task_data,
u32 dest, int size)
{
- struct dsp_task_descriptor * desc;
+ struct dsp_task_descriptor *desc;
desc = _map_task_tree (chip,name,dest,size);
if (desc) {
@@ -1056,28 +1056,28 @@ cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_da
return desc;
}
-int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
+int cs46xx_dsp_scb_and_task_init(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_symbol_entry * fg_task_tree_header_code;
- struct dsp_symbol_entry * task_tree_header_code;
- struct dsp_symbol_entry * task_tree_thread;
- struct dsp_symbol_entry * null_algorithm;
- struct dsp_symbol_entry * magic_snoop_task;
-
- struct dsp_scb_descriptor * timing_master_scb;
- struct dsp_scb_descriptor * codec_out_scb;
- struct dsp_scb_descriptor * codec_in_scb;
- struct dsp_scb_descriptor * src_task_scb;
- struct dsp_scb_descriptor * master_mix_scb;
- struct dsp_scb_descriptor * rear_mix_scb;
- struct dsp_scb_descriptor * record_mix_scb;
- struct dsp_scb_descriptor * write_back_scb;
- struct dsp_scb_descriptor * vari_decimate_scb;
- struct dsp_scb_descriptor * rear_codec_out_scb;
- struct dsp_scb_descriptor * clfe_codec_out_scb;
- struct dsp_scb_descriptor * magic_snoop_scb;
-
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_symbol_entry *fg_task_tree_header_code;
+ struct dsp_symbol_entry *task_tree_header_code;
+ struct dsp_symbol_entry *task_tree_thread;
+ struct dsp_symbol_entry *null_algorithm;
+ struct dsp_symbol_entry *magic_snoop_task;
+
+ struct dsp_scb_descriptor *timing_master_scb;
+ struct dsp_scb_descriptor *codec_out_scb;
+ struct dsp_scb_descriptor *codec_in_scb;
+ struct dsp_scb_descriptor *src_task_scb;
+ struct dsp_scb_descriptor *master_mix_scb;
+ struct dsp_scb_descriptor *rear_mix_scb;
+ struct dsp_scb_descriptor *record_mix_scb;
+ struct dsp_scb_descriptor *write_back_scb;
+ struct dsp_scb_descriptor *vari_decimate_scb;
+ struct dsp_scb_descriptor *rear_codec_out_scb;
+ struct dsp_scb_descriptor *clfe_codec_out_scb;
+ struct dsp_scb_descriptor *magic_snoop_scb;
+
int fifo_addr, fifo_span, valid_slots;
static struct dsp_spos_control_block sposcb = {
@@ -1107,18 +1107,18 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
return -EIO;
}
- fg_task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "FGTASKTREEHEADERCODE", SYMBOL_CODE);
+ fg_task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "FGTASKTREEHEADERCODE", SYMBOL_CODE);
if (fg_task_tree_header_code == NULL) {
snd_printk(KERN_ERR "dsp_spos: symbol FGTASKTREEHEADERCODE not found\n");
return -EIO;
}
- task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "TASKTREEHEADERCODE", SYMBOL_CODE);
+ task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "TASKTREEHEADERCODE", SYMBOL_CODE);
if (task_tree_header_code == NULL) {
snd_printk(KERN_ERR "dsp_spos: symbol TASKTREEHEADERCODE not found\n");
return -EIO;
}
-
+
task_tree_thread = cs46xx_dsp_lookup_symbol(chip, "TASKTREETHREAD", SYMBOL_CODE);
if (task_tree_thread == NULL) {
snd_printk(KERN_ERR "dsp_spos: symbol TASKTREETHREAD not found\n");
@@ -1130,7 +1130,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
snd_printk(KERN_ERR "dsp_spos: symbol MAGICSNOOPTASK not found\n");
return -EIO;
}
-
+
{
/* create the null SCB */
static struct dsp_generic_scb null_scb = {
@@ -1165,14 +1165,14 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
DSP_SPOS_DC,DSP_SPOS_DC },
-
+
{
- BG_TREE_SCB_ADDR,TIMINGMASTER_SCB_ADDR,
+ BG_TREE_SCB_ADDR,TIMINGMASTER_SCB_ADDR,
0,
- FG_TASK_HEADER_ADDR + TCBData,
+ FG_TASK_HEADER_ADDR + TCBData,
},
- {
+ {
4,0,
1,0,
2,SPOSCB_ADDR + HFGFlags,
@@ -1215,9 +1215,9 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
- DSP_SPOS_DCDC
- },
- {
+ DSP_SPOS_DCDC
+ },
+ {
FG_INTERVAL_TIMER_PERIOD,DSP_SPOS_UU,
0,0
}
@@ -1241,14 +1241,14 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
DSP_SPOS_DC,DSP_SPOS_DC },
-
+
{
NULL_SCB_ADDR,NULL_SCB_ADDR, /* Set up the background to do nothing */
0,
BG_TREE_SCB_ADDR + TCBData,
},
- {
+ {
9999,0,
0,1,
0,SPOSCB_ADDR + HFGFlags,
@@ -1291,9 +1291,9 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
- DSP_SPOS_DCDC
- },
- {
+ DSP_SPOS_DCDC
+ },
+ {
BG_INTERVAL_TIMER_PERIOD,DSP_SPOS_UU,
0,0
}
@@ -1344,7 +1344,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
0x00020000,
0x0000ffff
};
-
+
if (!cs46xx_dsp_create_task_tree(chip, NULL,
(u32 *)&mix2_ostream_spb,
WRITE_BACK_SPB, 2))
@@ -1376,7 +1376,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
goto _fail_end;
if (chip->nr_ac97_codecs == 1) {
- /* output on slot 5 and 11
+ /* output on slot 5 and 11
on primary CODEC */
fifo_addr = 0x20;
fifo_span = 0x60;
@@ -1384,7 +1384,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
/* enable slot 5 and 11 */
valid_slots |= ACOSV_SLV5 | ACOSV_SLV11;
} else {
- /* output on slot 7 and 8
+ /* output on slot 7 and 8
on secondary CODEC */
fifo_addr = 0x40;
fifo_span = 0x10;
@@ -1398,8 +1398,8 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
REAR_CODECOUT_SCB_ADDR,codec_in_scb,
SCB_ON_PARENT_NEXT_SCB);
if (!rear_codec_out_scb) goto _fail_end;
-
-
+
+
/* create the rear PCM channel mixer SCB */
rear_mix_scb = cs46xx_dsp_create_mix_only_scb(chip,"RearMixerSCB",
MIX_SAMPLE_BUF3,
@@ -1408,9 +1408,9 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
SCB_ON_PARENT_SUBLIST_SCB);
ins->rear_mix_scb = rear_mix_scb;
if (!rear_mix_scb) goto _fail_end;
-
+
if (chip->nr_ac97_codecs == 2) {
- /* create CODEC tasklet for rear Center/LFE output
+ /* create CODEC tasklet for rear Center/LFE output
slot 6 and 9 on seconadry CODEC */
clfe_codec_out_scb = cs46xx_dsp_create_codec_out_scb(chip,"CodecOutSCB_CLFE",0x0030,0x0030,
CLFE_MIXER_SCB_ADDR,
@@ -1418,8 +1418,8 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
rear_codec_out_scb,
SCB_ON_PARENT_NEXT_SCB);
if (!clfe_codec_out_scb) goto _fail_end;
-
-
+
+
/* create the rear PCM channel mixer SCB */
ins->center_lfe_mix_scb = cs46xx_dsp_create_mix_only_scb(chip,"CLFEMixerSCB",
MIX_SAMPLE_BUF4,
@@ -1445,7 +1445,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
clfe_codec_out_scb,
SCB_ON_PARENT_NEXT_SCB);
-
+
if (!magic_snoop_scb) goto _fail_end;
ins->ref_snoop_scb = magic_snoop_scb;
@@ -1473,19 +1473,19 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
cs46xx_dsp_async_init(chip,timing_master_scb);
return 0;
- _fail_end:
+_fail_end:
snd_printk(KERN_ERR "dsp_spos: failed to setup SCB's in DSP\n");
return -EINVAL;
}
-static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
- struct dsp_scb_descriptor * fg_entry)
+static int cs46xx_dsp_async_init(struct snd_cs46xx *chip,
+ struct dsp_scb_descriptor *fg_entry)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_symbol_entry * s16_async_codec_input_task;
- struct dsp_symbol_entry * spdifo_task;
- struct dsp_symbol_entry * spdifi_task;
- struct dsp_scb_descriptor * spdifi_scb_desc, * spdifo_scb_desc, * async_codec_scb_desc;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_symbol_entry *s16_async_codec_input_task;
+ struct dsp_symbol_entry *spdifo_task;
+ struct dsp_symbol_entry *spdifi_task;
+ struct dsp_scb_descriptor *spdifi_scb_desc, *spdifo_scb_desc, *async_codec_scb_desc;
s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE);
if (s16_async_codec_input_task == NULL) {
@@ -1509,10 +1509,10 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
struct dsp_spdifoscb spdifo_scb = {
/* 0 */ DSP_SPOS_UUUU,
{
- /* 1 */ 0xb0,
- /* 2 */ 0,
- /* 3 */ 0,
- /* 4 */ 0,
+ /* 1 */ 0xb0,
+ /* 2 */ 0,
+ /* 3 */ 0,
+ /* 4 */ 0,
},
/* NOTE: the SPDIF output task read samples in mono
format, the AsynchFGTxSCB task writes to buffer
@@ -1520,9 +1520,9 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
*/
/* 5 */ RSCONFIG_SAMPLE_16MONO + RSCONFIG_MODULO_256,
/* 6 */ ( SPDIFO_IP_OUTPUT_BUFFER1 << 0x10 ) | 0xFFFC,
- /* 7 */ 0,0,
- /* 8 */ 0,
- /* 9 */ FG_TASK_HEADER_ADDR, NULL_SCB_ADDR,
+ /* 7 */ 0,0,
+ /* 8 */ 0,
+ /* 9 */ FG_TASK_HEADER_ADDR, NULL_SCB_ADDR,
/* A */ spdifo_task->address,
SPDIFO_SCB_INST + SPDIFOFIFOPointer,
{
@@ -1539,7 +1539,7 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
/* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI,
/* 1 */ 0,
/* 2 */ 0,
- /* 3 */ 1,4000, /* SPDIFICountLimit SPDIFICount */
+ /* 3 */ 1,4000, /* SPDIFICountLimit SPDIFICount */
/* 4 */ DSP_SPOS_UUUU, /* SPDIFIStatusData */
/* 5 */ 0,DSP_SPOS_UUHI, /* StatusData, Free4 */
/* 6 */ DSP_SPOS_UUUU, /* Free3 */
@@ -1549,8 +1549,8 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
/* A */ spdifi_task->address,
SPDIFI_SCB_INST + SPDIFIFIFOPointer,
/* NOTE: The SPDIF input task write the sample in mono
- format from the HW FIFO, the AsynchFGRxSCB task reads
- them in stereo
+ format from the HW FIFO, the AsynchFGRxSCB task reads
+ them in stereo
*/
/* B */ RSCONFIG_SAMPLE_16MONO + RSCONFIG_MODULO_128,
/* C */ (SPDIFI_IP_OUTPUT_BUFFER1 << 0x10) | 0xFFFC,
@@ -1573,40 +1573,40 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
/* 9 */ SPDIFI_SCB_INST,NULL_SCB_ADDR,
/* A */ s16_async_codec_input_task->address,
HFG_TREE_SCB + AsyncCIOFIFOPointer,
-
+
/* B */ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_64,
/* C */ (ASYNC_IP_OUTPUT_BUFFER1 << 0x10), /*(ASYNC_IP_OUTPUT_BUFFER1 << 0x10) | 0xFFFC,*/
-
+
#ifdef UseASER1Input
- /* short AsyncCIFIFOPointer:AsyncCIStatRegAddr;
+ /* short AsyncCIFIFOPointer:AsyncCIStatRegAddr;
Init. 0000:8042: for ASER1
0000:8044: for ASER2 */
/* D */ 0x8042,0,
-
+
/* short AsyncCIStMoFormat:AsyncCIFIFOBaseAddr;
Init 1 stero:8050 ASER1
Init 0 mono:8070 ASER2
Init 1 Stereo : 0100 ASER1 (Set by script) */
/* E */ 0x0100,0x0001,
-
+
#endif
-
+
#ifdef UseASER2Input
/* short AsyncCIFIFOPointer:AsyncCIStatRegAddr;
Init. 0000:8042: for ASER1
0000:8044: for ASER2 */
/* D */ 0x8044,0,
-
+
/* short AsyncCIStMoFormat:AsyncCIFIFOBaseAddr;
Init 1 stero:8050 ASER1
Init 0 mono:8070 ASER2
Init 1 Stereo : 0100 ASER1 (Set by script) */
/* E */ 0x0110,0x0001,
-
+
#endif
-
+
/* short AsyncCIOutputBufModulo:AsyncCIFree;
- AsyncCIOutputBufModulo: The modulo size for
+ AsyncCIOutputBufModulo: The modulo size for
the output buffer of this task */
/* F */ 0, /* DSP_SPOS_UUUU */
};
@@ -1647,15 +1647,15 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
cs46xx_dsp_proc_register_scb_desc (chip,async_codec_scb_desc);
/* Async MASTER ENABLE, affects both SPDIF input and output */
- snd_cs46xx_pokeBA0(chip, BA0_ASER_MASTER, 0x1 );
+ snd_cs46xx_pokeBA0(chip, BA0_ASER_MASTER, 0x1);
}
return 0;
}
-static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
+static void cs46xx_dsp_disable_spdif_hw(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* set SPDIF output FIFO slot */
snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0);
@@ -1674,16 +1674,16 @@ static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED;
}
-int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_spdif_hw(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* if hw-ctrl already enabled, turn off to reset logic ... */
cs46xx_dsp_disable_spdif_hw (chip);
udelay(50);
/* set SPDIF output FIFO slot */
- snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, ( 0x8000 | ((SP_SPDOUT_FIFO >> 4) << 4) ));
+ snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, ( 0x8000 | ((SP_SPDOUT_FIFO >> 4) << 4)));
/* SPDIF output MASTER ENABLE */
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CONTROL, 0x80000000);
@@ -1699,7 +1699,7 @@ int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip)
int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* turn on amplifier */
chip->active_ctrl(chip, 1);
@@ -1712,7 +1712,7 @@ int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
mutex_lock(&chip->spos_mutex);
- if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED) ) {
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED)) {
/* time countdown enable */
cs46xx_poke_via_dsp (chip,SP_ASER_COUNTDOWN, 0x80000005);
/* NOTE: 80000005 value is just magic. With all values
@@ -1761,7 +1761,7 @@ int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->asynch_rx_scb))
return -EINVAL;
@@ -1787,9 +1787,9 @@ int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_pcm_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(ins->pcm_input))
return -EINVAL;
@@ -1804,9 +1804,9 @@ int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_disable_pcm_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->pcm_input))
return -EINVAL;
@@ -1819,9 +1819,9 @@ int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_adc_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(ins->adc_input))
return -EINVAL;
@@ -1836,9 +1836,9 @@ int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_disable_adc_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->adc_input))
return -EINVAL;
@@ -1851,7 +1851,7 @@ int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
+int cs46xx_poke_via_dsp(struct snd_cs46xx *chip, u32 address, u32 data)
{
u32 temp;
int i;
@@ -1860,19 +1860,19 @@ int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
a rough guess from looking at the controller spec.) */
if (address < 0x8000 || address >= 0x9000)
return -EINVAL;
-
+
/* initialize the SP_IO_WRITE SCB with the data. */
temp = ( address << 16 ) | ( address & 0x0000FFFF); /* offset 0 <-- address2 : address1 */
snd_cs46xx_poke(chip,( SPIOWRITE_SCB_ADDR << 2), temp);
snd_cs46xx_poke(chip,((SPIOWRITE_SCB_ADDR + 1) << 2), data); /* offset 1 <-- data1 */
snd_cs46xx_poke(chip,((SPIOWRITE_SCB_ADDR + 2) << 2), data); /* offset 1 <-- data2 */
-
+
/* Poke this location to tell the task to start */
snd_cs46xx_poke(chip,((SPIOWRITE_SCB_ADDR + 6) << 2), SPIOWRITE_SCB_ADDR << 0x10);
/* Verify that the task ran */
- for (i=0; i<25; i++) {
+ for (i = 0; i < 25; i++) {
udelay(125);
temp = snd_cs46xx_peek(chip,((SPIOWRITE_SCB_ADDR + 6) << 2));
@@ -1888,13 +1888,13 @@ int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
return 0;
}
-int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right)
+int cs46xx_dsp_set_dac_volume(struct snd_cs46xx *chip, u16 left, u16 right)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
mutex_lock(&chip->spos_mutex);
-
+
/* main output */
scb = ins->master_mix_scb->sub_list_ptr;
while (scb != ins->the_null_scb) {
@@ -1917,9 +1917,9 @@ int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right)
return 0;
}
-int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
+int cs46xx_dsp_set_iec958_volume(struct snd_cs46xx *chip, u16 left, u16 right)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
mutex_lock(&chip->spos_mutex);
@@ -1936,9 +1936,9 @@ int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
}
#ifdef CONFIG_PM
-int cs46xx_dsp_resume(struct snd_cs46xx * chip)
+int cs46xx_dsp_resume(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i, err;
/* clear parameter, sample and code areas */
diff --git a/sound/pci/cs46xx/dsp_spos.h b/sound/pci/cs46xx/dsp_spos.h
index f9e169d..a005f85 100644
--- a/sound/pci/cs46xx/dsp_spos.h
+++ b/sound/pci/cs46xx/dsp_spos.h
@@ -189,9 +189,9 @@ enum wide_opcode {
static inline u8 _wrap_all_bits (u8 val)
{
u8 wrapped;
-
+
/* wrap all 8 bits */
- wrapped =
+ wrapped =
((val & 0x1 ) << 7) |
((val & 0x2 ) << 5) |
((val & 0x4 ) << 3) |
@@ -205,13 +205,13 @@ static inline u8 _wrap_all_bits (u8 val)
}
static inline void cs46xx_dsp_spos_update_scb (struct snd_cs46xx * chip,
- struct dsp_scb_descriptor * scb)
+ struct dsp_scb_descriptor * scb)
{
/* update nextSCB and subListPtr in SCB */
snd_cs46xx_poke(chip,
(scb->address + SCBsubListPtr) << 2,
(scb->sub_list_ptr->address << 0x10) |
- (scb->next_scb_ptr->address));
+ (scb->next_scb_ptr->address));
}
static inline void cs46xx_dsp_scb_set_volume (struct snd_cs46xx * chip,
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index dd7c41b..ac14c46 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -21,7 +21,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
@@ -37,13 +37,13 @@
#include "dsp_spos.h"
struct proc_scb_info {
- struct dsp_scb_descriptor * scb_desc;
+ struct dsp_scb_descriptor *scb_desc;
struct snd_cs46xx *chip;
};
-static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * symbol)
+static void remove_symbol(struct snd_cs46xx *chip, struct dsp_symbol_entry *symbol)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int symbol_index = (int)(symbol - ins->symbol_table.symbols);
if (snd_BUG_ON(ins->symbol_table.nsymbols <= 0))
@@ -57,7 +57,7 @@ static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * s
if (symbol_index < ins->symbol_table.highest_frag_index) {
ins->symbol_table.highest_frag_index = symbol_index;
}
-
+
if (symbol_index == ins->symbol_table.nsymbols - 1)
ins->symbol_table.nsymbols --;
@@ -68,14 +68,14 @@ static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * s
}
#ifdef CONFIG_PROC_FS
-static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_scb_info_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
- struct proc_scb_info * scb_info = entry->private_data;
- struct dsp_scb_descriptor * scb = scb_info->scb_desc;
- struct dsp_spos_instance * ins;
+ struct proc_scb_info *scb_info = entry->private_data;
+ struct dsp_scb_descriptor *scb = scb_info->scb_desc;
+ struct dsp_spos_instance *ins;
struct snd_cs46xx *chip = scb_info->chip;
- int j,col;
+ int j, col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
ins = chip->dsp_spos_instance;
@@ -83,22 +83,22 @@ static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer,"%04x %s:\n",scb->address,scb->scb_name);
- for (col = 0,j = 0;j < 0x10; j++,col++) {
+ for (col = 0,j = 0; j < 0x10; j++, col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
snd_iprintf(buffer,"%08x ",readl(dst + (scb->address + j) * sizeof(u32)));
}
-
+
snd_iprintf(buffer,"\n");
if (scb->parent_scb_ptr != NULL) {
- snd_iprintf(buffer,"parent [%s:%04x] ",
+ snd_iprintf(buffer,"parent [%s:%04x] ",
scb->parent_scb_ptr->scb_name,
scb->parent_scb_ptr->address);
} else snd_iprintf(buffer,"parent [none] ");
-
+
snd_iprintf(buffer,"sub_list_ptr [%s:%04x]\nnext_scb_ptr [%s:%04x] task_entry [%s:%04x]\n",
scb->sub_list_ptr->scb_name,
scb->sub_list_ptr->address,
@@ -107,22 +107,22 @@ static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
scb->task_entry->symbol_name,
scb->task_entry->address);
- snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count);
+ snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count);
mutex_unlock(&chip->spos_mutex);
}
#endif
-static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
+static void _dsp_unlink_scb(struct snd_cs46xx *chip, struct dsp_scb_descriptor *scb)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned long flags;
- if ( scb->parent_scb_ptr ) {
+ if (scb->parent_scb_ptr) {
/* unlink parent SCB */
if (snd_BUG_ON(scb->parent_scb_ptr->sub_list_ptr != scb &&
scb->parent_scb_ptr->next_scb_ptr != scb))
return;
-
+
if (scb->parent_scb_ptr->sub_list_ptr == scb) {
if (scb->next_scb_ptr == ins->the_null_scb) {
@@ -153,7 +153,7 @@ static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor
scb->next_scb_ptr = ins->the_null_scb;
}
- spin_lock_irqsave(&chip->reg_lock, flags);
+ spin_lock_irqsave(&chip->reg_lock, flags);
/* update parent first entry in DSP RAM */
cs46xx_dsp_spos_update_scb(chip,scb->parent_scb_ptr);
@@ -166,21 +166,21 @@ static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor
}
}
-static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer_addr,
- int dword_count)
+static void _dsp_clear_sample_buffer(struct snd_cs46xx *chip, u32 sample_buffer_addr,
+ int dword_count)
{
void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr;
int i;
-
- for (i = 0; i < dword_count ; ++i ) {
+
+ for (i = 0; i < dword_count; ++i) {
writel(0, dst);
dst += 4;
- }
+ }
}
-void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
+void cs46xx_dsp_remove_scb(struct snd_cs46xx *chip, struct dsp_scb_descriptor *scb)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned long flags;
/* check integrety */
@@ -190,7 +190,7 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
return;
#if 0
- /* can't remove a SCB with childs before
+ /* can't remove a SCB with childs before
removing childs first */
if (snd_BUG_ON(scb->sub_list_ptr != ins->the_null_scb ||
scb->next_scb_ptr != ins->the_null_scb))
@@ -221,7 +221,7 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
#if 0
/* !!!! THIS IS A PIECE OF SHIT MADE BY ME !!! */
- for(i = scb->index + 1;i < ins->nscb; ++i) {
+ for (i = scb->index + 1; i < ins->nscb; ++i) {
ins->scbs[i - 1].index = i - 1;
}
#endif
@@ -229,10 +229,10 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
#ifdef CONFIG_PROC_FS
-void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
+void cs46xx_dsp_proc_free_scb_desc(struct dsp_scb_descriptor *scb)
{
if (scb->proc_info) {
- struct proc_scb_info * scb_info = scb->proc_info->private_data;
+ struct proc_scb_info *scb_info = scb->proc_info->private_data;
snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name);
@@ -243,18 +243,18 @@ void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
}
}
-void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
- struct dsp_scb_descriptor * scb)
+void cs46xx_dsp_proc_register_scb_desc(struct snd_cs46xx *chip,
+ struct dsp_scb_descriptor *scb)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
struct snd_info_entry * entry;
- struct proc_scb_info * scb_info;
+ struct proc_scb_info *scb_info;
/* register to proc */
if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL &&
scb->proc_info == NULL) {
-
- if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
+
+ if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
ins->proc_dsp_dir)) != NULL) {
scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL);
if (!scb_info) {
@@ -265,13 +265,13 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
scb_info->chip = chip;
scb_info->scb_desc = scb;
-
+
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = scb_info;
entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-
+
entry->c.text.read = cs46xx_dsp_proc_scb_info_read;
-
+
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
kfree (scb_info);
@@ -284,22 +284,22 @@ out:
}
#endif /* CONFIG_PROC_FS */
-static struct dsp_scb_descriptor *
-_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest,
- struct dsp_symbol_entry * task_entry,
- struct dsp_scb_descriptor * parent_scb,
+static struct dsp_scb_descriptor *
+_dsp_create_generic_scb(struct snd_cs46xx *chip, char *name, u32 *scb_data, u32 dest,
+ struct dsp_symbol_entry *task_entry,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
+
unsigned long flags;
if (snd_BUG_ON(!ins->the_null_scb))
return NULL;
/* fill the data that will be wroten to DSP */
- scb_data[SCBsubListPtr] =
+ scb_data[SCBsubListPtr] =
(ins->the_null_scb->address << 0x10) | ins->the_null_scb->address;
scb_data[SCBfuncEntryPtr] &= 0xFFFF0000;
@@ -316,7 +316,7 @@ _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u
scb->parent_scb_ptr = parent_scb;
scb->task_entry = task_entry;
-
+
/* update parent SCB */
if (scb->parent_scb_ptr) {
#if 0
@@ -356,31 +356,31 @@ _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u
return scb;
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data,
- u32 dest, char * task_entry_name,
- struct dsp_scb_descriptor * parent_scb,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_generic_scb(struct snd_cs46xx *chip, char *name, u32 *scb_data,
+ u32 dest, char *task_entry_name,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_symbol_entry * task_entry;
+ struct dsp_symbol_entry *task_entry;
task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name,
SYMBOL_CODE);
-
+
if (task_entry == NULL) {
snd_printk (KERN_ERR "dsp_spos: symbol %s not found\n",task_entry_name);
return NULL;
}
-
+
return _dsp_create_generic_scb (chip,name,scb_data,dest,task_entry,
parent_scb,scb_child_type);
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_timing_master_scb(struct snd_cs46xx *chip)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_timing_master_scb timing_master_scb = {
{ 0,
0,
@@ -400,8 +400,8 @@ cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
0x0001,0x8000, /* fracSampAccumQm1:TMfrmsLeftInGroup */
0x0001,0x0000, /* fracSampCorrectionQm1:TMfrmGroupLength */
0x00060000 /* nSampPerFrmQ15 */
- };
-
+ };
+
scb = cs46xx_dsp_create_generic_scb(chip,"TimingMasterSCBInst",(u32 *)&timing_master_scb,
TIMINGMASTER_SCB_ADDR,
"TIMINGMASTER",NULL,SCB_NO_PARENT);
@@ -410,14 +410,14 @@ cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx *chip, char *codec_name,
u16 channel_disp, u16 fifo_addr, u16 child_scb_addr,
- u32 dest, struct dsp_scb_descriptor * parent_scb,
+ u32 dest, struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_codec_output_scb codec_out_scb = {
{ 0,
0,
@@ -439,23 +439,23 @@ cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
0x0000,0x0080, /* (!AC97!) COexpVolChangeRate:COscaleShiftCount */
0,child_scb_addr /* COreserved - need child scb to work with rom code */
};
-
-
+
+
scb = cs46xx_dsp_create_generic_scb(chip,codec_name,(u32 *)&codec_out_scb,
dest,"S16_CODECOUTPUTTASK",parent_scb,
scb_child_type);
-
+
return scb;
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx *chip, char *codec_name,
u16 channel_disp, u16 fifo_addr, u16 sample_buffer_addr,
- u32 dest, struct dsp_scb_descriptor * parent_scb,
+ u32 dest, struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_codec_input_scb codec_input_scb = {
{ 0,
0,
@@ -469,7 +469,7 @@ cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
0,
0
},
-
+
#if 0 /* cs4620 */
SyncIOSCB,NULL_SCB_ADDR
#else
@@ -479,13 +479,13 @@ cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_64, /* strmRsConfig */
sample_buffer_addr << 0x10, /* strmBufPtr; defined as a dword ptr, used as a byte ptr */
- channel_disp,fifo_addr, /* (!AC97!) leftChanBaseINaddr=AC97primary
+ channel_disp,fifo_addr, /* (!AC97!) leftChanBaseINaddr=AC97primary
link input slot 3 :rightChanINdisp=""slot 4 */
- 0x0000,0x0000, /* (!AC97!) ????:scaleShiftCount; no shift needed
+ 0x0000,0x0000, /* (!AC97!) ????:scaleShiftCount; no shift needed
because AC97 is already 20 bits */
0x80008000 /* ??clw cwcgame.scb has 0 */
};
-
+
scb = cs46xx_dsp_create_generic_scb(chip,codec_name,(u32 *)&codec_input_scb,
dest,"S16_CODECINPUTTASK",parent_scb,
scb_child_type);
@@ -493,18 +493,18 @@ cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx *chip, char *scb_name,
u16 sample_buffer_addr, u32 dest,
int virtual_channel, u32 playback_hw_addr,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
+
struct dsp_generic_scb pcm_reader_scb = {
-
+
/*
Play DMA Task xfers data from host buffer to SP buffer
init/runtime variables:
@@ -524,7 +524,7 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
DMA_RQ_C2_AC_MONO_TO_STEREO 0x00002000L
DMA_RQ_C2_AC_ENDIAN_CONVERT 0x00004000L
DMA_RQ_C2_AC_SIGNED_CONVERT 0x00008000L
-
+
HostBuffAddr: Host Buffer Physical Byte Address - SCB loc:3rd dword, Mask: 0xFFFFFFFFL
aligned to dword boundary
*/
@@ -551,7 +551,7 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
0,
0,
0,
- 0
+ 0
},
/* Sublist pointer & next stream control block (SCB) link. */
NULL_SCB_ADDR,NULL_SCB_ADDR,
@@ -568,7 +568,7 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
/* Stream sample pointer & MAC-unit mode for this stream */
(sample_buffer_addr << 0x10),
/* Fractional increment per output sample in the input sample buffer */
- 0,
+ 0,
{
/* Standard stereo volume control
default muted */
@@ -580,34 +580,34 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
if (ins->null_algorithm == NULL) {
ins->null_algorithm = cs46xx_dsp_lookup_symbol (chip,"NULLALGORITHM",
SYMBOL_CODE);
-
+
if (ins->null_algorithm == NULL) {
snd_printk (KERN_ERR "dsp_spos: symbol NULLALGORITHM not found\n");
return NULL;
- }
+ }
}
scb = _dsp_create_generic_scb(chip,scb_name,(u32 *)&pcm_reader_scb,
dest,ins->null_algorithm,parent_scb,
scb_child_type);
-
+
return scb;
}
#define GOF_PER_SEC 200
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_src_task_scb(struct snd_cs46xx *chip, char *scb_name,
int rate,
u16 src_buffer_addr,
u16 src_delay_buffer_addr, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type,
int pass_through)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
unsigned int tmp1, tmp2;
unsigned int phiIncr;
unsigned int correctionPerGOF, correctionPerSec;
@@ -650,35 +650,35 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
0x0000,0x0000,
src_buffer_addr,1,
correctionPerGOF,correctionPerSec,
- RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
- 0x0000,src_delay_buffer_addr,
- 0x0,
+ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
+ 0x0000,src_delay_buffer_addr,
+ 0x0,
0x080,(src_delay_buffer_addr + (24 * 4)),
0,0, /* next_scb, sub_list_ptr */
0,0, /* entry, this_spb */
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_8,
src_buffer_addr << 0x10,
phiIncr,
- {
+ {
0xffff - ins->dac_volume_right,0xffff - ins->dac_volume_left,
0xffff - ins->dac_volume_right,0xffff - ins->dac_volume_left
}
};
-
+
if (ins->s16_up == NULL) {
ins->s16_up = cs46xx_dsp_lookup_symbol (chip,"S16_UPSRC",
SYMBOL_CODE);
-
+
if (ins->s16_up == NULL) {
snd_printk (KERN_ERR "dsp_spos: symbol S16_UPSRC not found\n");
return NULL;
- }
+ }
}
-
+
/* clear buffers */
_dsp_clear_sample_buffer (chip,src_buffer_addr,8);
_dsp_clear_sample_buffer (chip,src_delay_buffer_addr,32);
-
+
if (pass_through) {
/* wont work with any other rate than
the native DSP rate */
@@ -700,13 +700,13 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
}
#if 0 /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_filter_scb(struct snd_cs46xx *chip, char *scb_name,
u16 buffer_addr, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type) {
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_filter_scb filter_scb = {
.a0_right = 0x41a9,
.a0_left = 0x41a9,
@@ -714,7 +714,7 @@ cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
.a1_left = 0xb8e4,
.a2_right = 0x3e55,
.a2_left = 0x3e55,
-
+
.filter_unused3 = 0x0000,
.filter_unused2 = 0x0000,
@@ -750,14 +750,14 @@ cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
}
#endif /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx *chip, char *scb_name,
u16 mix_buffer_addr, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_mix_only_scb master_mix_scb = {
/* 0 */ { 0,
/* 1 */ 0,
@@ -774,7 +774,7 @@ cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
/* 9 */ 0,0,
/* A */ 0,0,
/* B */ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
- /* C */ (mix_buffer_addr + (16 * 4)) << 0x10,
+ /* C */ (mix_buffer_addr + (16 * 4)) << 0x10,
/* D */ 0,
{
/* E */ 0x8000,0x8000,
@@ -790,92 +790,92 @@ cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx *chip, char *scb_name,
u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_mix2_ostream_scb mix2_ostream_scb = {
/* Basic (non scatter/gather) DMA requestor (4 ints) */
- {
+ {
DMA_RQ_C1_SOURCE_MOD64 +
DMA_RQ_C1_DEST_ON_HOST +
DMA_RQ_C1_DEST_MOD1024 +
- DMA_RQ_C1_WRITEBACK_SRC_FLAG +
+ DMA_RQ_C1_WRITEBACK_SRC_FLAG +
DMA_RQ_C1_WRITEBACK_DEST_FLAG +
- 15,
-
+ 15,
+
DMA_RQ_C2_AC_NONE +
- DMA_RQ_C2_SIGNAL_DEST_PINGPONG +
-
- CS46XX_DSP_CAPTURE_CHANNEL,
- DMA_RQ_SD_SP_SAMPLE_ADDR +
- mix_buffer_addr,
- 0x0
+ DMA_RQ_C2_SIGNAL_DEST_PINGPONG +
+
+ CS46XX_DSP_CAPTURE_CHANNEL,
+ DMA_RQ_SD_SP_SAMPLE_ADDR +
+ mix_buffer_addr,
+ 0x0
},
-
+
{ 0, 0, 0, 0, 0, },
0,0,
0,writeback_spb,
-
- RSCONFIG_DMA_ENABLE +
- (19 << RSCONFIG_MAX_DMA_SIZE_SHIFT) +
-
+
+ RSCONFIG_DMA_ENABLE +
+ (19 << RSCONFIG_MAX_DMA_SIZE_SHIFT) +
+
((dest >> 4) << RSCONFIG_STREAM_NUM_SHIFT) +
- RSCONFIG_DMA_TO_HOST +
+ RSCONFIG_DMA_TO_HOST +
RSCONFIG_SAMPLE_16STEREO +
- RSCONFIG_MODULO_64,
+ RSCONFIG_MODULO_64,
(mix_buffer_addr + (32 * 4)) << 0x10,
- 1,0,
+ 1,0,
0x0001,0x0080,
0xFFFF,0
};
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&mix2_ostream_scb,
-
+
dest,"S16_MIX_TO_OSTREAM",parent_scb,
scb_child_type);
-
+
return scb;
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx *chip,char *scb_name,
u16 vari_buffer_addr0,
u16 vari_buffer_addr1,
u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_vari_decimate_scb vari_decimate_scb = {
0x0028,0x00c8,
0x5555,0x0000,
0x0000,0x0000,
vari_buffer_addr0,vari_buffer_addr1,
-
+
0x0028,0x00c8,
- RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_256,
-
- 0xFF800000,
+ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_256,
+
+ 0xFF800000,
0,
- 0x0080,vari_buffer_addr1 + (25 * 4),
-
- 0,0,
+ 0x0080,vari_buffer_addr1 + (25 * 4),
+
+ 0,0,
0,0,
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_8,
- vari_buffer_addr0 << 0x10,
- 0x04000000,
+ vari_buffer_addr0 << 0x10,
+ 0x04000000,
{
- 0x8000,0x8000,
+ 0x8000,0x8000,
0xFFFF,0xFFFF
}
};
@@ -883,19 +883,19 @@ cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&vari_decimate_scb,
dest,"VARIDECIMATE",parent_scb,
scb_child_type);
-
+
return scb;
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
struct dsp_scb_descriptor * input_scb,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_pcm_serial_input_scb pcm_serial_input_scb = {
@@ -931,15 +931,15 @@ cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_asynch_fg_tx_scb asynch_fg_tx_scb = {
0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */
@@ -949,27 +949,27 @@ cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u3
0,0, /* Initialize current Delta and Consumer ptr adjustment count */
0, /* Initialize accumulated Phi to 0 */
0,0x2aab, /* Const 1/3 */
-
+
{
0, /* Define the unused elements */
0,
0
},
-
+
0,0,
0,dest + AFGTxAccumPhi,
-
+
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_256, /* Stereo, 256 dword */
(asynch_buffer_address) << 0x10, /* This should be automagically synchronized
to the producer pointer */
-
+
/* There is no correct initial value, it will depend upon the detected
rate etc */
0x18000000, /* Phi increment for approx 32k operation */
0x8000,0x8000, /* Volume controls are unused at this time */
0x8000,0x8000
};
-
+
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&asynch_fg_tx_scb,
dest,"ASYNCHFGTXCODE",parent_scb,
scb_child_type);
@@ -978,15 +978,15 @@ cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u3
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
struct dsp_asynch_fg_rx_scb asynch_fg_rx_scb = {
0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */
@@ -1001,18 +1001,18 @@ cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u3
0,
0
},
-
+
0,0,
0,dest,
-
+
RSCONFIG_MODULO_128 |
RSCONFIG_SAMPLE_16STEREO, /* Stereo, 128 dword */
- ( (asynch_buffer_address + (16 * 4)) << 0x10), /* This should be automagically
+ ( (asynch_buffer_address + (16 * 4)) << 0x10), /* This should be automagically
synchrinized to the producer pointer */
-
+
/* There is no correct initial value, it will depend upon the detected
rate etc */
- 0x18000000,
+ 0x18000000,
/* Set IEC958 input volume */
0xffff - ins->spdif_input_volume_right,0xffff - ins->spdif_input_volume_left,
@@ -1028,16 +1028,16 @@ cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u3
#if 0 /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 snoop_buffer_address,
struct dsp_scb_descriptor * snoop_scb,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_output_snoop_scb output_snoop_scb = {
{ 0, /* not used. Zero */
0,
@@ -1051,17 +1051,17 @@ cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u3
0,
0
},
-
+
0,0,
0,0,
-
+
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_64,
- snoop_buffer_address << 0x10,
+ snoop_buffer_address << 0x10,
0,0,
0,
0,snoop_scb->address
};
-
+
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&output_snoop_scb,
dest,"OUTPUTSNOOP",parent_scb,
scb_child_type);
@@ -1070,13 +1070,13 @@ cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u3
#endif /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_spio_write_scb spio_write_scb = {
0,0, /* SPIOWAddress2:SPIOWAddress1; */
0, /* SPIOWData1; */
@@ -1086,11 +1086,11 @@ cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32
0, /* SPIOWData4; */
0,0, /* SPIOWDataPtr:Unused1; */
{ 0,0 }, /* Unused2[2]; */
-
+
0,0, /* SPIOWChildPtr:SPIOWSiblingPtr; */
0,0, /* SPIOWThisPtr:SPIOWEntryPoint; */
-
- {
+
+ {
0,
0,
0,
@@ -1107,14 +1107,14 @@ cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32
}
struct dsp_scb_descriptor *
-cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 snoop_buffer_address,
struct dsp_scb_descriptor * snoop_scb,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_magic_snoop_task magic_snoop_scb = {
/* 0 */ 0, /* i0 */
/* 1 */ 0, /* i1 */
@@ -1143,10 +1143,10 @@ cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32
}
static struct dsp_scb_descriptor *
-find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from)
+find_next_free_scb(struct snd_cs46xx *chip, struct dsp_scb_descriptor *from)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb = from;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb = from;
while (scb->next_scb_ptr != ins->the_null_scb) {
if (snd_BUG_ON(!scb->next_scb_ptr))
@@ -1198,9 +1198,9 @@ static u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = {
0x2BA0,
0x2BC0,
0x2BE0,
- 0x2D00,
- 0x2D20,
- 0x2D40,
+ 0x2D00,
+ 0x2D20,
+ 0x2D40,
0x2D60,
0x2D80,
0x2DA0,
@@ -1228,16 +1228,16 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
};
struct dsp_pcm_channel_descriptor *
-cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
- u32 sample_rate, void * private_data,
+cs46xx_dsp_create_pcm_channel(struct snd_cs46xx *chip,
+ u32 sample_rate, void * private_data,
u32 hw_dma_addr,
int pcm_channel_id)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * src_scb = NULL, * pcm_scb, * mixer_scb = NULL;
- struct dsp_scb_descriptor * src_parent_scb = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *src_scb = NULL, *pcm_scb, *mixer_scb = NULL;
+ struct dsp_scb_descriptor *src_parent_scb = NULL;
- /* struct dsp_scb_descriptor * pcm_parent_scb; */
+ /* struct dsp_scb_descriptor *pcm_parent_scb; */
char scb_name[DSP_MAX_SCB_NAME];
int i, pcm_index = -1, insert_point, src_index = -1, pass_through = 0;
unsigned long flags;
@@ -1278,19 +1278,19 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
if (!sample_rate) sample_rate = 44100;
/* search for a already created SRC SCB with the same sample rate */
- for (i = 0; i < DSP_MAX_PCM_CHANNELS &&
+ for (i = 0; i < DSP_MAX_PCM_CHANNELS &&
(pcm_index == -1 || src_scb == NULL); ++i) {
- /* virtual channel reserved
+ /* virtual channel reserved
for capture */
if (i == CS46XX_DSP_CAPTURE_CHANNEL) continue;
if (ins->pcm_channels[i].active) {
- if (!src_scb &&
+ if (!src_scb &&
ins->pcm_channels[i].sample_rate == sample_rate &&
ins->pcm_channels[i].mixer_scb == mixer_scb) {
src_scb = ins->pcm_channels[i].src_scb;
- ins->pcm_channels[i].src_scb->ref_count ++;
+ ins->pcm_channels[i].src_scb->ref_count++;
src_index = ins->pcm_channels[i].src_slot;
}
} else if (pcm_index == -1) {
@@ -1330,7 +1330,7 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
}
snprintf (scb_name,DSP_MAX_SCB_NAME,"SrcTask_SCB%d",src_index);
-
+
snd_printdd( "dsp_spos: creating SRC \"%s\"\n",scb_name);
src_scb = cs46xx_dsp_create_src_task_scb(chip,scb_name,
sample_rate,
@@ -1349,10 +1349,10 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
/* cs46xx_dsp_set_src_sample_rate(chip,src_scb,sample_rate); */
- ins->nsrc_scb ++;
- }
-
-
+ ins->nsrc_scb++;
+ }
+
+
snprintf (scb_name,DSP_MAX_SCB_NAME,"PCMReader_SCB%d",pcm_index);
snd_printdd( "dsp_spos: creating PCM \"%s\" (%d)\n",scb_name,
@@ -1365,14 +1365,14 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
pcm_index, /* virtual channel 0-31 */
hw_dma_addr, /* pcm hw addr */
NULL, /* parent SCB ptr */
- 0 /* insert point */
- );
+ 0 /* insert point */
+ );
if (!pcm_scb) {
snd_printk (KERN_ERR "dsp_spos: failed to create PCMreaderSCB\n");
return NULL;
}
-
+
spin_lock_irqsave(&chip->reg_lock, flags);
ins->pcm_channels[pcm_index].sample_rate = sample_rate;
ins->pcm_channels[pcm_index].pcm_reader_scb = pcm_scb;
@@ -1383,14 +1383,14 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
ins->pcm_channels[pcm_index].active = 1;
ins->pcm_channels[pcm_index].pcm_slot = pcm_index;
ins->pcm_channels[pcm_index].mixer_scb = mixer_scb;
- ins->npcm_channels ++;
+ ins->npcm_channels++;
spin_unlock_irqrestore(&chip->reg_lock, flags);
return (ins->pcm_channels + pcm_index);
}
-int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel,
+int cs46xx_dsp_pcm_channel_set_period(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel,
int period_size)
{
u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2);
@@ -1414,10 +1414,10 @@ int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
break;
case 64:
temp |= DMA_RQ_C1_SOURCE_MOD32;
- break;
+ break;
case 32:
temp |= DMA_RQ_C1_SOURCE_MOD16;
- break;
+ break;
default:
snd_printdd ("period size (%d) not supported by HW\n", period_size);
return -EINVAL;
@@ -1428,7 +1428,7 @@ int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
return 0;
}
-int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
+int cs46xx_dsp_pcm_ostream_set_period(struct snd_cs46xx *chip,
int period_size)
{
u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2);
@@ -1452,10 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
break;
case 64:
temp |= DMA_RQ_C1_DEST_MOD32;
- break;
+ break;
case 32:
temp |= DMA_RQ_C1_DEST_MOD16;
- break;
+ break;
default:
snd_printdd ("period size (%d) not supported by HW\n", period_size);
return -EINVAL;
@@ -1466,10 +1466,10 @@ int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
return 0;
}
-void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel)
+void cs46xx_dsp_destroy_pcm_channel(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned long flags;
if (snd_BUG_ON(!pcm_channel->active ||
@@ -1499,8 +1499,8 @@ void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
}
}
-int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel)
+int cs46xx_dsp_pcm_unlink(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel)
{
unsigned long flags;
@@ -1525,12 +1525,12 @@ int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
return 0;
}
-int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel)
+int cs46xx_dsp_pcm_link(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * parent_scb;
- struct dsp_scb_descriptor * src_scb = pcm_channel->src_scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *parent_scb;
+ struct dsp_scb_descriptor *src_scb = pcm_channel->src_scb;
unsigned long flags;
spin_lock(&pcm_channel->src_scb->lock);
@@ -1568,12 +1568,12 @@ int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
}
struct dsp_scb_descriptor *
-cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
- u16 addr, char * scb_name)
+cs46xx_add_record_source(struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
+ u16 addr, char *scb_name)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * parent;
- struct dsp_scb_descriptor * pcm_input;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *parent;
+ struct dsp_scb_descriptor *pcm_input;
int insert_point;
if (snd_BUG_ON(!ins->record_mixer_scb))
@@ -1594,7 +1594,7 @@ cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * s
return pcm_input;
}
-int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
+int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor *src)
{
if (snd_BUG_ON(!src->parent_scb_ptr))
return -EINVAL;
@@ -1607,10 +1607,10 @@ int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
return 0;
}
-int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
+int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor *src)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * parent_scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *parent_scb;
if (snd_BUG_ON(src->parent_scb_ptr))
return -EINVAL;
@@ -1629,20 +1629,20 @@ int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
/* update entry in DSP RAM */
cs46xx_dsp_spos_update_scb(chip,parent_scb);
-
+
return 0;
}
-int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_spdif_out(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED)) {
cs46xx_dsp_enable_spdif_hw (chip);
}
/* dont touch anything if SPDIF is open */
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
/* when cs46xx_iec958_post_close(...) is called it
will call this function if necessary depending on
this bit */
@@ -1659,8 +1659,8 @@ int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
/* reset output snooper sample buffer pointer */
snd_cs46xx_poke (chip, (ins->ref_snoop_scb->address + 2) << 2,
- (OUTPUT_SNOOP_BUFFER + 0x10) << 0x10 );
-
+ (OUTPUT_SNOOP_BUFFER + 0x10) << 0x10);
+
/* The asynch. transfer task */
ins->asynch_tx_scb = cs46xx_dsp_create_asynch_fg_tx_scb(chip,"AsynchFGTxSCB",ASYNCTX_SCB_ADDR,
SPDIFO_SCB_INST,
@@ -1674,8 +1674,8 @@ int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
ins->ref_snoop_scb,
ins->asynch_tx_scb,
SCB_ON_PARENT_SUBLIST_SCB);
-
-
+
+
if (!ins->spdif_pcm_input_scb) return -ENOMEM;
/* monitor state */
@@ -1684,12 +1684,12 @@ int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip)
+int cs46xx_dsp_disable_spdif_out(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* dont touch anything if SPDIF is open */
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_OUTPUT_ENABLED;
return -EBUSY;
}
@@ -1723,18 +1723,18 @@ int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip)
int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED) {
/* remove AsynchFGTxSCB and and PCMSerialInput_II */
cs46xx_dsp_disable_spdif_out (chip);
/* save state */
ins->spdif_status_out |= DSP_SPDIF_STATUS_OUTPUT_ENABLED;
}
-
+
/* if not enabled already */
- if ( !(ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED)) {
cs46xx_dsp_enable_spdif_hw (chip);
}
@@ -1754,9 +1754,9 @@ int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
+int cs46xx_iec958_post_close(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->asynch_tx_scb))
return -EINVAL;
@@ -1765,7 +1765,7 @@ int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
/* restore settings */
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, ins->spdif_csuv_default);
-
+
/* deallocate stuff */
if (ins->spdif_pcm_input_scb != NULL) {
cs46xx_dsp_remove_scb (chip,ins->spdif_pcm_input_scb);
@@ -1779,9 +1779,9 @@ int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
_dsp_clear_sample_buffer(chip,SPDIFO_IP_OUTPUT_BUFFER1,256);
/* restore state */
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED) {
cs46xx_dsp_enable_spdif_out (chip);
}
-
+
return 0;
}
diff --git a/sound/pci/cs46xx/imgs/cwcbinhack.h b/sound/pci/cs46xx/imgs/cwcbinhack.h
index f4d9368..0587ab3 100644
--- a/sound/pci/cs46xx/imgs/cwcbinhack.h
+++ b/sound/pci/cs46xx/imgs/cwcbinhack.h
@@ -1,4 +1,4 @@
-/* generated by Benny
+/* generated by Benny
MODIFY ON YOUR OWN RISK */
#ifndef __HEADER_cwcbinhack_H__
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
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(-)
diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h
index 74175fc..645980f 100644
--- a/sound/pci/ca0106/ca0106.h
+++ b/sound/pci/ca0106/ca0106.h
@@ -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);
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 6abe8a3..6d4534a 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -18,7 +18,7 @@
* So, to record from the MIC, set the MIC Playback volume to max,
* unmute the MIC and turn up the MASTER Playback volume.
* So, to prevent feedback when capturing, minimise the "Capture feedback into Playback" volume.
- *
+ *
* The only playback controls that currently do anything are: -
* Analog Front
* Analog Rear
@@ -26,12 +26,12 @@
* SPDIF Front
* SPDIF Rear
* SPDIF Center/LFE
- *
+ *
* For capture from Mic in or Line in.
* Digital/Analog ( switch must be in Analog mode for CAPTURE. )
- *
+ *
* CAPTURE feedback into PLAYBACK
- *
+ *
* Changelog:
* Support interrupts per period.
* Removed noise from Center/LFE channel when in Analog mode.
@@ -108,7 +108,7 @@
* DAC: CS4382 (114 dB, 24-Bit, 192 kHz, 8-Channel D/A Converter with DSD Support)
* SPDIF Out control switches between Mic in and SPDIF out.
* No sound out or mic input working yet.
- *
+ *
* GENERAL INFO:
* Model: SB0413
* P17 Chip: CA0106-DAT
@@ -202,7 +202,7 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
/* AudigyLS[SB0310] */
{ .serial = 0x10021102,
.name = "AudigyLS [SB0310]",
- .ac97 = 1 } ,
+ .ac97 = 1 } ,
/* Unknown AudigyLS that also says SB0310 on it */
{ .serial = 0x10051102,
.name = "AudigyLS [SB0310b]",
@@ -279,7 +279,7 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
/* hardware definition */
static struct snd_pcm_hardware snd_ca0106_playback_hw = {
- .info = SNDRV_PCM_INFO_MMAP |
+ .info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -289,8 +289,8 @@ static struct snd_pcm_hardware snd_ca0106_playback_hw = {
SNDRV_PCM_RATE_192000),
.rate_min = 48000,
.rate_max = 192000,
- .channels_min = 2, //1,
- .channels_max = 2, //6,
+ .channels_min = 2, /* 1, */
+ .channels_max = 2, /* 6, */
.buffer_bytes_max = ((65536 - 64) * 8),
.period_bytes_min = 64,
.period_bytes_max = (65536 - 64),
@@ -300,7 +300,7 @@ static struct snd_pcm_hardware snd_ca0106_playback_hw = {
};
static struct snd_pcm_hardware snd_ca0106_capture_hw = {
- .info = (SNDRV_PCM_INFO_MMAP |
+ .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -319,13 +319,13 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
.fifo_size = 0,
};
-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)
{
unsigned long flags;
unsigned int regptr, val;
-
+
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -335,9 +335,9 @@ unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
return val;
}
-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)
{
unsigned int regptr;
@@ -351,7 +351,7 @@ void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-int snd_ca0106_spi_write(struct snd_ca0106 * emu,
+int snd_ca0106_spi_write(struct snd_ca0106 *emu,
unsigned int data)
{
unsigned int reset, set;
@@ -398,7 +398,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
}
tmp = reg << 25 | value << 16;
- // snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value);
+ /* snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value); */
/* Not sure what this I2C channel controls. */
/* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */
@@ -407,8 +407,8 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
for (retry = 0; retry < 10; retry++) {
/* Send the data to i2c */
- //tmp = snd_ca0106_ptr_read(emu, I2C_A, 0);
- //tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK);
+ /* tmp = snd_ca0106_ptr_read(emu, I2C_A, 0); */
+ /* tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK); */
tmp = 0;
tmp = tmp | (I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD);
snd_ca0106_ptr_write(emu, I2C_A, 0, tmp);
@@ -416,7 +416,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
/* Wait till the transaction ends */
while (1) {
status = snd_ca0106_ptr_read(emu, I2C_A, 0);
- //snd_printk("I2C:status=0x%x\n", status);
+ /* snd_printk("I2C:status=0x%x\n", status); */
timeout++;
if ((status & I2C_A_ADC_START) == 0)
break;
@@ -424,7 +424,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
if (timeout > 1000)
break;
}
- //Read back and see if the transaction is successful
+ /* Read back and see if the transaction is successful */
if ((status & I2C_A_ADC_ABORT) == 0)
break;
}
@@ -433,7 +433,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
snd_printk(KERN_ERR "Writing to ADC failed!\n");
return -EINVAL;
}
-
+
return 0;
}
@@ -496,18 +496,18 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
epcm->emu = chip;
epcm->substream = substream;
epcm->channel_id=channel_id;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_ca0106_pcm_free_substream;
-
+
runtime->hw = snd_ca0106_playback_hw;
channel->emu = chip;
channel->number = channel_id;
channel->use = 1;
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_ca0106_pcm_channel_interrupt; */
channel->epcm = epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -584,22 +584,22 @@ static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substre
epcm->emu = chip;
epcm->substream = substream;
epcm->channel_id=channel_id;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_ca0106_pcm_free_substream;
-
+
runtime->hw = snd_ca0106_capture_hw;
channel->emu = chip;
channel->number = channel_id;
channel->use = 1;
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_ca0106_pcm_channel_interrupt; */
channel->epcm = epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
- //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes);
+ /* snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); */
if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
return err;
return 0;
@@ -680,37 +680,37 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
u32 reg40_set = 0;
u32 reg40;
/* FIXME: Depending on mixer selection of SPDIF out or not, select the spdif rate or the DAC rate. */
- u32 reg71_mask = 0x03030000 ; /* Global. Set SPDIF rate. We only support 44100 to spdif, not to DAC. */
+ u32 reg71_mask = 0x03030000; /* Global. Set SPDIF rate. We only support 44100 to spdif, not to DAC. */
u32 reg71_set = 0;
u32 reg71;
int i;
-
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
+
+ /* snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); */
/* Rate can be set per channel. */
/* reg40 control host to fifo */
/* reg71 controls DAC rate. */
switch (runtime->rate) {
case 44100:
reg40_set = 0x10000 << (channel<<1);
- reg71_set = 0x01010000;
+ reg71_set = 0x01010000;
break;
case 48000:
reg40_set = 0;
- reg71_set = 0;
+ reg71_set = 0;
break;
case 96000:
reg40_set = 0x20000 << (channel<<1);
- reg71_set = 0x02020000;
+ reg71_set = 0x02020000;
break;
case 192000:
reg40_set = 0x30000 << (channel<<1);
- reg71_set = 0x03030000;
+ reg71_set = 0x03030000;
break;
default:
reg40_set = 0;
- reg71_set = 0;
+ reg71_set = 0;
break;
}
/* Format is a global setting */
@@ -726,7 +726,7 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
hcfg_set = 0;
break;
}
- hcfg = inl(emu->port + HCFG) ;
+ hcfg = inl(emu->port + HCFG);
hcfg = (hcfg & ~hcfg_mask) | hcfg_set;
outl(hcfg, emu->port + HCFG);
reg40 = snd_ca0106_ptr_read(emu, 0x40, 0);
@@ -737,18 +737,18 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
snd_ca0106_ptr_write(emu, 0x71, 0, reg71);
/* FIXME: Check emu->buffer.size before actually writing to it. */
- for(i=0; i < runtime->periods; i++) {
+ for (i = 0; i < runtime->periods; i++) {
table_base[i*2] = runtime->dma_addr + (i * period_size_bytes);
table_base[i*2+1] = period_size_bytes << 16;
}
-
+
snd_ca0106_ptr_write(emu, PLAYBACK_LIST_ADDR, channel, emu->buffer.addr+(8*16*channel));
snd_ca0106_ptr_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19);
snd_ca0106_ptr_write(emu, PLAYBACK_LIST_PTR, channel, 0);
snd_ca0106_ptr_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr);
- snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes
+ snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); /* buffer size in bytes */
/* FIXME test what 0 bytes does. */
- snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes
+ snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); /* buffer size in bytes */
snd_ca0106_ptr_write(emu, PLAYBACK_POINTER, channel, 0);
snd_ca0106_ptr_write(emu, 0x07, channel, 0x0);
snd_ca0106_ptr_write(emu, 0x08, channel, 0);
@@ -758,7 +758,7 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
- 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT );
+ 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
}
#endif
@@ -776,31 +776,31 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
u32 hcfg_set = 0x00000000;
u32 hcfg;
u32 over_sampling=0x2;
- u32 reg71_mask = 0x0000c000 ; /* Global. Set ADC rate. */
+ u32 reg71_mask = 0x0000c000; /* Global. Set ADC rate. */
u32 reg71_set = 0;
u32 reg71;
-
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
+
+ /* snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); */
/* reg71 controls ADC rate. */
switch (runtime->rate) {
case 44100:
reg71_set = 0x00004000;
break;
case 48000:
- reg71_set = 0;
+ reg71_set = 0;
break;
case 96000:
reg71_set = 0x00008000;
over_sampling=0xa;
break;
case 192000:
- reg71_set = 0x0000c000;
+ reg71_set = 0x0000c000;
over_sampling=0xa;
break;
default:
- reg71_set = 0;
+ reg71_set = 0;
break;
}
/* Format is a global setting */
@@ -816,7 +816,7 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
hcfg_set = 0;
break;
}
- hcfg = inl(emu->port + HCFG) ;
+ hcfg = inl(emu->port + HCFG);
hcfg = (hcfg & ~hcfg_mask) | hcfg_set;
outl(hcfg, emu->port + HCFG);
reg71 = snd_ca0106_ptr_read(emu, 0x71, 0);
@@ -827,10 +827,10 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
}
- //printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1));
+ /* printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); */
snd_ca0106_ptr_write(emu, 0x13, channel, 0);
snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr);
- snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
+ snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); /* buffer size in bytes */
snd_ca0106_ptr_write(emu, CAPTURE_POINTER, channel, 0);
return 0;
@@ -866,13 +866,13 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
runtime = s->runtime;
epcm = runtime->private_data;
channel = epcm->channel_id;
- //snd_printk("channel=%d\n",channel);
+ /* snd_printk("channel=%d\n",channel); */
epcm->running = running;
basic |= (0x1<<channel);
extended |= (0x10<<channel);
snd_pcm_trigger_done(s, substream);
}
- //snd_printk("basic=0x%x, extended=0x%x\n",basic, extended);
+ /* snd_printk("basic=0x%x, extended=0x%x\n",basic, extended); */
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -940,7 +940,7 @@ snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream)
ptr=ptr2;
if (ptr >= runtime->buffer_size)
ptr -= runtime->buffer_size;
- //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
+ /* printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); */
return ptr;
}
@@ -963,7 +963,7 @@ snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream)
ptr=ptr2;
if (ptr >= runtime->buffer_size)
ptr -= runtime->buffer_size;
- //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
+ /* printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); */
return ptr;
}
@@ -1030,9 +1030,9 @@ static struct snd_pcm_ops snd_ca0106_playback_center_lfe_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_ca0106_pcm_hw_params_playback,
.hw_free = snd_ca0106_pcm_hw_free_playback,
- .prepare = snd_ca0106_pcm_prepare_playback,
- .trigger = snd_ca0106_pcm_trigger_playback,
- .pointer = snd_ca0106_pcm_pointer_playback,
+ .prepare = snd_ca0106_pcm_prepare_playback,
+ .trigger = snd_ca0106_pcm_trigger_playback,
+ .pointer = snd_ca0106_pcm_pointer_playback,
};
static struct snd_pcm_ops snd_ca0106_playback_unknown_ops = {
@@ -1041,9 +1041,9 @@ static struct snd_pcm_ops snd_ca0106_playback_unknown_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_ca0106_pcm_hw_params_playback,
.hw_free = snd_ca0106_pcm_hw_free_playback,
- .prepare = snd_ca0106_pcm_prepare_playback,
- .trigger = snd_ca0106_pcm_trigger_playback,
- .pointer = snd_ca0106_pcm_pointer_playback,
+ .prepare = snd_ca0106_pcm_prepare_playback,
+ .trigger = snd_ca0106_pcm_trigger_playback,
+ .pointer = snd_ca0106_pcm_pointer_playback,
};
static struct snd_pcm_ops snd_ca0106_playback_rear_ops = {
@@ -1052,9 +1052,9 @@ static struct snd_pcm_ops snd_ca0106_playback_rear_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_ca0106_pcm_hw_params_playback,
.hw_free = snd_ca0106_pcm_hw_free_playback,
- .prepare = snd_ca0106_pcm_prepare_playback,
- .trigger = snd_ca0106_pcm_trigger_playback,
- .pointer = snd_ca0106_pcm_pointer_playback,
+ .prepare = snd_ca0106_pcm_prepare_playback,
+ .trigger = snd_ca0106_pcm_trigger_playback,
+ .pointer = snd_ca0106_pcm_pointer_playback,
};
@@ -1077,7 +1077,7 @@ static void snd_ca0106_ac97_write(struct snd_ac97 *ac97,
{
struct snd_ca0106 *emu = ac97->private_data;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
outw(val, emu->port + AC97DATA);
@@ -1093,7 +1093,7 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip)
.write = snd_ca0106_ac97_write,
.read = snd_ca0106_ac97_read,
};
-
+
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
return err;
pbus->no_vra = 1; /* we don't need VRA */
@@ -1107,13 +1107,13 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip)
static int snd_ca0106_free(struct snd_ca0106 *chip)
{
if (chip->res_port != NULL) { /* avoid access to already used hardware */
- // disable interrupts
+ /* disable interrupts */
snd_ca0106_ptr_write(chip, BASIC_INTERRUPT, 0, 0);
outl(0, chip->port + INTE);
snd_ca0106_ptr_write(chip, EXTENDED_INT_MASK, 0, 0);
udelay(1000);
- // disable audio
- //outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
+ /* disable audio */
+ /* outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG); */
outl(0, chip->port + HCFG);
/* FIXME: We need to stop and DMA transfers here.
* But as I am not sure how yet, we cannot from the dma pages.
@@ -1122,13 +1122,13 @@ static int snd_ca0106_free(struct snd_ca0106 *chip)
}
if (chip->irq >= 0)
free_irq(chip->irq, chip);
- // release the data
+ /* release the data */
#if 1
if (chip->buffer.area)
snd_dma_free_pages(&chip->buffer);
#endif
- // release the i/o port
+ /* release the i/o port */
release_and_free_resource(chip->res_port);
pci_disable_device(chip->pci);
@@ -1153,38 +1153,38 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
struct snd_ca0106_channel *pchannel;
status = inl(chip->port + IPR);
- if (! status)
+ if (!status)
return IRQ_NONE;
stat76 = snd_ca0106_ptr_read(chip, EXTENDED_INT, 0);
- //snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76);
- //snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0));
+ /* snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76); */
+ /* snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0)); */
mask = 0x11; /* 0x1 for one half, 0x10 for the other half period. */
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
pchannel = &(chip->playback_channels[i]);
if (stat76 & mask) {
/* FIXME: Select the correct substream for period elapsed */
- if(pchannel->use) {
+ if (pchannel->use) {
snd_pcm_period_elapsed(pchannel->epcm->substream);
- //printk(KERN_INFO "interrupt [%d] used\n", i);
+ /* printk(KERN_INFO "interrupt [%d] used\n", i); */
}
}
- //printk(KERN_INFO "channel=%p\n",pchannel);
- //printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number);
+ /* printk(KERN_INFO "channel=%p\n",pchannel); */
+ /* printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number); */
mask <<= 1;
}
mask = 0x110000; /* 0x1 for one half, 0x10 for the other half period. */
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
pchannel = &(chip->capture_channels[i]);
if (stat76 & mask) {
/* FIXME: Select the correct substream for period elapsed */
- if(pchannel->use) {
+ if (pchannel->use) {
snd_pcm_period_elapsed(pchannel->epcm->substream);
- //printk(KERN_INFO "interrupt [%d] used\n", i);
+ /* printk(KERN_INFO "interrupt [%d] used\n", i); */
}
}
- //printk(KERN_INFO "channel=%p\n",pchannel);
- //printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number);
+ /* printk(KERN_INFO "channel=%p\n",pchannel); */
+ /* printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number); */
mask <<= 1;
}
@@ -1198,7 +1198,7 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
chip->midi.interrupt_disable(&chip->midi, chip->midi.tx_enable | chip->midi.rx_enable);
}
- // acknowledge the interrupt if necessary
+ /* acknowledge the interrupt if necessary */
outl(status, chip->port+IPR);
return IRQ_HANDLED;
@@ -1209,12 +1209,12 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s
struct snd_pcm *pcm;
struct snd_pcm_substream *substream;
int err;
-
+
if (rpcm)
*rpcm = NULL;
if ((err = snd_pcm_new(emu->card, "ca0106", device, 1, 1, &pcm)) < 0)
return err;
-
+
pcm->private_data = emu;
switch (device) {
@@ -1241,29 +1241,29 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s
strcpy(pcm->name, "CA0106");
emu->pcm = pcm;
- for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
64*1024, 64*1024)) < 0) /* FIXME: 32*1024 for sound buffer, between 32and64 for Periods table. */
return err;
}
- for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
64*1024, 64*1024)) < 0)
return err;
}
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -1313,9 +1313,9 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_ca0106_dev_free,
};
-
+
*rchip = NULL;
-
+
if ((err = pci_enable_device(pci)) < 0)
return err;
if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
@@ -1324,22 +1324,22 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
pci_disable_device(pci);
return -ENXIO;
}
-
+
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
pci_disable_device(pci);
return -ENOMEM;
}
-
+
chip->card = card;
chip->pci = pci;
chip->irq = -1;
spin_lock_init(&chip->emu_lock);
-
+
chip->port = pci_resource_start(pci, 0);
if ((chip->res_port = request_region(chip->port, 0x20,
- "snd_ca0106")) == NULL) {
+ "snd_ca0106")) == NULL) {
snd_ca0106_free(chip);
printk(KERN_ERR "cannot allocate the port\n");
return -EBUSY;
@@ -1352,9 +1352,9 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
return -EBUSY;
}
chip->irq = pci->irq;
-
- /* This stores the periods table. */
- if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &chip->buffer) < 0) {
+
+ /* This stores the periods table. */
+ if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &chip->buffer) < 0) {
snd_ca0106_free(chip);
return -ENOMEM;
}
@@ -1441,13 +1441,13 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
snd_ca0106_ptr_write(chip, 0x44, 0, 0x2108006);
#endif
- //snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0xf0f003f); /* OSS drivers set this. */
+ /* snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0xf0f003f); OSS drivers set this. */
/* Analog or Digital output */
snd_ca0106_ptr_write(chip, SPDIF_SELECT1, 0, 0xf);
snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0x000f0000); /* 0x0b000000 for digital, 0x000b0000 for analog, from win2000 drivers. Use 0x000f0000 for surround71 */
chip->spdif_enable = 0; /* Set digital SPDIF output off */
- //snd_ca0106_ptr_write(chip, 0x45, 0, 0); /* Analogue out */
- //snd_ca0106_ptr_write(chip, 0x45, 0, 0xf00); /* Digital out */
+ /* snd_ca0106_ptr_write(chip, 0x45, 0, 0); Analogue out */
+ /* snd_ca0106_ptr_write(chip, 0x45, 0, 0xf00); Digital out */
snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 0, 0x40c81000); /* goes to 0x40c80000 when doing SPDIF IN/OUT */
snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 1, 0xffffffff); /* (Mute) CAPTURE feedback into PLAYBACK volume. Only lower 16 bits matter. */
@@ -1457,11 +1457,11 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
snd_ca0106_ptr_write(chip, PLAYBACK_ROUTING2, 0, 0x76767676);
snd_ca0106_ptr_write(chip, CAPTURE_ROUTING1, 0, 0x32765410);
snd_ca0106_ptr_write(chip, CAPTURE_ROUTING2, 0, 0x76767676);
- for(ch = 0; ch < 4; ch++) {
+ for (ch = 0; ch < 4; ch++) {
snd_ca0106_ptr_write(chip, CAPTURE_VOLUME1, ch, 0x30303030); /* Only high 16 bits matter */
snd_ca0106_ptr_write(chip, CAPTURE_VOLUME2, ch, 0x30303030);
- //snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0x40404040); /* Mute */
- //snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0x40404040); /* Mute */
+ /* snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0x40404040); Mute */
+ /* snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0x40404040); Mute */
snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0xffffffff); /* Mute */
snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0xffffffff); /* Mute */
}
@@ -1485,30 +1485,30 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
if (chip->details->gpio_type == 2) { /* The SB0438 use GPIO differently. */
/* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
outl(0x0, chip->port+GPIO);
- //outl(0x00f0e000, chip->port+GPIO); /* Analog */
+ /* outl(0x00f0e000, chip->port+GPIO); Analog */
outl(0x005f5301, chip->port+GPIO); /* Analog */
} else if (chip->details->gpio_type == 1) { /* The SB0410 and SB0413 use GPIO differently. */
/* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
outl(0x0, chip->port+GPIO);
- //outl(0x00f0e000, chip->port+GPIO); /* Analog */
+ /* outl(0x00f0e000, chip->port+GPIO); Analog */
outl(0x005f5301, chip->port+GPIO); /* Analog */
} else {
outl(0x0, chip->port+GPIO);
outl(0x005f03a3, chip->port+GPIO); /* Analog */
- //outl(0x005f02a2, chip->port+GPIO); /* SPDIF */
+ /* outl(0x005f02a2, chip->port+GPIO); SPDIF */
}
snd_ca0106_intr_enable(chip, 0x105); /* Win2000 uses 0x1e0 */
- //outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
- //outl(0x00001409, chip->port+HCFG); /* 0x1000 causes AC3 to fails. Maybe it effects 24 bit output. */
- //outl(0x00000009, chip->port+HCFG);
+ /* outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG); */
+ /* outl(0x00001409, chip->port+HCFG); 0x1000 causes AC3 to fails. Maybe it effects 24 bit output. */
+ /* outl(0x00000009, chip->port+HCFG); */
outl(HCFG_AC97 | HCFG_AUDIOENABLE, chip->port+HCFG); /* AC97 2.0, Enable outputs. */
if (chip->details->i2c_adc == 1) { /* The SB0410 and SB0413 use I2C to control ADC. */
int size, n;
size = ARRAY_SIZE(i2c_adc_init);
- //snd_printk("I2C:array size=0x%x\n", size);
+ /* snd_printk("I2C:array size=0x%x\n", size); */
for (n=0; n < size; n++) {
snd_ca0106_i2c_write(chip, i2c_adc_init[n][0], i2c_adc_init[n][1]);
}
@@ -1517,7 +1517,7 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
chip->i2c_capture_volume[n][1]= 0xcf;
}
chip->i2c_capture_source=2; /* Line in */
- //snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); /* Enable Line-in capture. MIC in currently untested. */
+ /* snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); Enable Line-in capture. MIC in currently untested. */
}
if (chip->details->spi_dac == 1) { /* The SB0570 use SPI to control DAC. */
int size, n;
@@ -1616,7 +1616,7 @@ static int __devinit snd_ca0106_midi(struct snd_ca0106 *chip, unsigned int chann
midi->get_dev_id_port = ca0106_dev_id_port;
midi->dev_id = chip;
-
+
if ((err = ca_midi_init(chip, midi, 0, name)) < 0)
return err;
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
index 3025ed1..9bfc92d 100644
--- a/sound/pci/ca0106/ca0106_mixer.c
+++ b/sound/pci/ca0106/ca0106_mixer.c
@@ -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;
}
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c
index c62b7d1..16789b4 100644
--- a/sound/pci/ca0106/ca0106_proc.c
+++ b/sound/pci/ca0106/ca0106_proc.c
@@ -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/asoundef.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "ca0106.h"
@@ -98,7 +98,7 @@ static struct snd_ca0106_category_str snd_ca0106_con_category[] = {
};
-static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 value)
+static void snd_ca0106_proc_dump_iec958(struct snd_info_buffer *buffer, u32 value)
{
int i;
u32 status[4];
@@ -106,8 +106,8 @@ static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 val
status[1] = (value >> 8) & 0xff;
status[2] = (value >> 16) & 0xff;
status[3] = (value >> 24) & 0xff;
-
- if (! (status[0] & IEC958_AES0_PROFESSIONAL)) {
+
+ if (!(status[0] & IEC958_AES0_PROFESSIONAL)) {
/* consumer */
snd_iprintf(buffer, "Mode: consumer\n");
snd_iprintf(buffer, "Data: ");
@@ -272,7 +272,7 @@ static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 val
}
}
-static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
+static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -282,9 +282,9 @@ static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
snd_iprintf(buffer, "Status: %s, %s, %s\n",
(value & 0x100000) ? "Rate Locked" : "Not Rate Locked",
(value & 0x200000) ? "SPDIF Locked" : "No SPDIF Lock",
- (value & 0x400000) ? "Audio Valid" : "No valid audio" );
- snd_iprintf(buffer, "Estimated sample rate: %u\n",
- ((value & 0xfffff) * 48000) / 0x8000 );
+ (value & 0x400000) ? "Audio Valid" : "No valid audio");
+ snd_iprintf(buffer, "Estimated sample rate: %u\n",
+ ((value & 0xfffff) * 48000) / 0x8000);
if (value & 0x200000) {
snd_iprintf(buffer, "IEC958/SPDIF input status:\n");
value = snd_ca0106_ptr_read(emu, SPDIF_INPUT_STATUS, 0);
@@ -294,7 +294,7 @@ static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
snd_iprintf(buffer, "\n");
}
-static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -304,7 +304,7 @@ static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x", ®, &val) != 2)
continue;
- if ((reg < 0x40) && (reg >=0) && (val <= 0xffffffff) ) {
+ if ((reg < 0x40) && (reg >=0) && (val <= 0xffffffff)) {
spin_lock_irqsave(&emu->emu_lock, flags);
outl(val, emu->port + (reg & 0xfffffffc));
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -312,7 +312,7 @@ static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -320,7 +320,7 @@ static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=4) {
+ for (i = 0; i < 0x20; i += 4) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inl(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -328,7 +328,7 @@ static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -336,7 +336,7 @@ static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=2) {
+ for (i = 0; i < 0x20; i += 2) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inw(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -344,7 +344,7 @@ static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -352,7 +352,7 @@ static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=1) {
+ for (i = 0; i < 0x20; i++) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inb(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -360,7 +360,7 @@ static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -368,7 +368,7 @@ static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
int i,j;
snd_iprintf(buffer, "Registers\n");
- for(i = 0; i < 0x40; i++) {
+ for (i = 0; i < 0x40; i++) {
snd_iprintf(buffer, "%02X: ",i);
for (j = 0; j < 4; j++) {
value = snd_ca0106_ptr_read(emu, i, j);
@@ -378,7 +378,7 @@ static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -386,7 +386,7 @@ static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
int i,j;
snd_iprintf(buffer, "Registers\n");
- for(i = 0x40; i < 0x80; i++) {
+ for (i = 0x40; i < 0x80; i++) {
snd_iprintf(buffer, "%02X: ",i);
for (j = 0; j < 4; j++) {
value = snd_ca0106_ptr_read(emu, i, j);
@@ -396,7 +396,7 @@ static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -405,12 +405,12 @@ static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
continue;
- if ((reg < 0x80) && (reg >=0) && (val <= 0xffffffff) && (channel_id >=0) && (channel_id <= 3) )
+ if ((reg < 0x80) && (reg >=0) && (val <= 0xffffffff) && (channel_id >=0) && (channel_id <= 3))
snd_ca0106_ptr_write(emu, reg, channel_id, val);
}
}
-static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry,
+static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -425,32 +425,32 @@ static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry,
}
}
-int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu)
+int __devinit snd_ca0106_proc_init(struct snd_ca0106 *emu)
{
struct snd_info_entry *entry;
-
- if(! snd_card_proc_new(emu->card, "iec958", &entry))
+
+ if (!snd_card_proc_new(emu->card, "iec958", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_iec958);
- if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read32);
entry->c.text.write = snd_ca0106_proc_reg_write32;
entry->mode |= S_IWUSR;
}
- if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
+ if (!snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read16);
- if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
+ if (!snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read8);
- if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1);
entry->c.text.write = snd_ca0106_proc_reg_write;
entry->mode |= S_IWUSR;
}
- if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
entry->c.text.write = snd_ca0106_proc_i2c_write;
entry->private_data = emu;
entry->mode |= S_IWUSR;
}
- if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
+ if (!snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2);
return 0;
}
diff --git a/sound/pci/ca0106/ca_midi.c b/sound/pci/ca0106/ca_midi.c
index c788511..3056f98 100644
--- a/sound/pci/ca0106/ca_midi.c
+++ b/sound/pci/ca0106/ca_midi.c
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 10/16/2005 Tilman Kranz <tilde(a)tk-sls.de>
* 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, int
unsigned 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, c
SNDRV_RAWMIDI_INFO_DUPLEX;
rmidi->private_data = midi;
rmidi->private_free = ca_rmidi_free;
-
+
midi->rmidi = rmidi;
return 0;
}
diff --git a/sound/pci/ca0106/ca_midi.h b/sound/pci/ca0106/ca_midi.h
index 922ed3e..d285456 100644
--- a/sound/pci/ca0106/ca_midi.h
+++ b/sound/pci/ca0106/ca_midi.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 10/16/2005 Tilman Kranz <tilde(a)tk-sls.de>
* 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;
1
0

[alsa-devel] [PATCH 03/24] sound/pci: coding style fixes: sound/pci/a*
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ad1889.c | 116 +++++++++++++++++++++---------------------
sound/pci/ak4531_codec.c | 14 +++---
sound/pci/als300.c | 16 +++---
sound/pci/als4000.c | 70 +++++++++++++-------------
sound/pci/atiixp.c | 64 ++++++++++++------------
sound/pci/atiixp_modem.c | 46 +++++++++---------
sound/pci/aw2/aw2-alsa.c | 2 +-
sound/pci/aw2/aw2-saa7146.c | 2 +-
sound/pci/azt3328.c | 12 ++--
sound/pci/azt3328.h | 6 +-
10 files changed, 174 insertions(+), 174 deletions(-)
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index 92f3a97..5fdca0e 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -45,7 +45,7 @@
#include <sound/initval.h>
#include <sound/ac97_codec.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "ad1889.h"
#include "ac97/ac97_id.h"
@@ -137,7 +137,7 @@ static inline void
ad1889_unmute(struct snd_ad1889 *chip)
{
u16 st;
- st = ad1889_readw(chip, AD_DS_WADA) &
+ st = ad1889_readw(chip, AD_DS_WADA) &
~(AD_DS_WADA_RWAM | AD_DS_WADA_LWAM);
ad1889_writew(chip, AD_DS_WADA, st);
ad1889_readw(chip, AD_DS_WADA);
@@ -198,13 +198,13 @@ static void
ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
{
u16 reg;
-
+
if (channel & AD_CHAN_WAV) {
/* Disable wave channel */
reg = ad1889_readw(chip, AD_DS_WSMC) & ~AD_DS_WSMC_WAEN;
ad1889_writew(chip, AD_DS_WSMC, reg);
chip->wave.reg = reg;
-
+
/* disable IRQs */
reg = ad1889_readw(chip, AD_DMA_WAV);
reg &= AD_DMA_IM_DIS;
@@ -219,7 +219,7 @@ ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
/* flush */
ad1889_readw(chip, AD_DMA_WAV);
}
-
+
if (channel & AD_CHAN_ADC) {
/* Disable ADC channel */
reg = ad1889_readw(chip, AD_DS_RAMC) & ~AD_DS_RAMC_ADEN;
@@ -230,7 +230,7 @@ ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
reg &= AD_DMA_IM_DIS;
reg &= ~AD_DMA_LOOP;
ad1889_writew(chip, AD_DMA_ADC, reg);
-
+
ad1889_load_adc_buffer_address(chip, 0x0);
ad1889_load_adc_buffer_count(chip, 0x0);
ad1889_load_adc_interrupt_count(chip, 0x0);
@@ -258,8 +258,8 @@ static int
snd_ad1889_ac97_ready(struct snd_ad1889 *chip)
{
int retry = 400; /* average needs 352 msec */
-
- while (!(ad1889_readw(chip, AD_AC97_ACIC) & AD_AC97_ACIC_ACRDY)
+
+ while (!(ad1889_readw(chip, AD_AC97_ACIC) & AD_AC97_ACIC_ACRDY)
&& --retry)
mdelay(1);
if (!retry) {
@@ -272,11 +272,11 @@ snd_ad1889_ac97_ready(struct snd_ad1889 *chip)
return 0;
}
-static int
+static int
snd_ad1889_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
- return snd_pcm_lib_malloc_pages(substream,
+ return snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
}
@@ -372,7 +372,7 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
ad1889_channel_reset(chip, AD_CHAN_WAV);
reg = ad1889_readw(chip, AD_DS_WSMC);
-
+
/* Mask out 16-bit / Stereo */
reg &= ~(AD_DS_WSMC_WA16 | AD_DS_WSMC_WAST);
@@ -384,13 +384,13 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
/* let's make sure we don't clobber ourselves */
spin_lock_irq(&chip->lock);
-
+
chip->wave.size = size;
chip->wave.reg = reg;
chip->wave.addr = rt->dma_addr;
ad1889_writew(chip, AD_DS_WSMC, chip->wave.reg);
-
+
/* Set sample rates on the codec */
ad1889_writew(chip, AD_DS_WAS, rt->rate);
@@ -401,9 +401,9 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
/* writes flush */
ad1889_readw(chip, AD_DS_WSMC);
-
+
spin_unlock_irq(&chip->lock);
-
+
ad1889_debug("prepare playback: addr = 0x%x, count = %u, "
"size = %u, reg = 0x%x, rate = %u\n", chip->wave.addr,
count, size, reg, rt->rate);
@@ -420,7 +420,7 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
u16 reg;
ad1889_channel_reset(chip, AD_CHAN_ADC);
-
+
reg = ad1889_readw(chip, AD_DS_RAMC);
/* Mask out 16-bit / Stereo */
@@ -434,7 +434,7 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
/* let's make sure we don't clobber ourselves */
spin_lock_irq(&chip->lock);
-
+
chip->ramc.size = size;
chip->ramc.reg = reg;
chip->ramc.addr = rt->dma_addr;
@@ -448,9 +448,9 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
/* writes flush */
ad1889_readw(chip, AD_DS_RAMC);
-
+
spin_unlock_irq(&chip->lock);
-
+
ad1889_debug("prepare capture: addr = 0x%x, count = %u, "
"size = %u, reg = 0x%x, rate = %u\n", chip->ramc.addr,
count, size, reg, rt->rate);
@@ -466,7 +466,7 @@ snd_ad1889_playback_trigger(struct snd_pcm_substream *ss, int cmd)
{
u16 wsmc;
struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-
+
wsmc = ad1889_readw(chip, AD_DS_WSMC);
switch (cmd) {
@@ -486,9 +486,9 @@ snd_ad1889_playback_trigger(struct snd_pcm_substream *ss, int cmd)
snd_BUG();
return -EINVAL;
}
-
+
chip->wave.reg = wsmc;
- ad1889_writew(chip, AD_DS_WSMC, wsmc);
+ ad1889_writew(chip, AD_DS_WSMC, wsmc);
ad1889_readw(chip, AD_DS_WSMC); /* flush */
/* reset the chip when STOP - will disable IRQs */
@@ -509,7 +509,7 @@ snd_ad1889_capture_trigger(struct snd_pcm_substream *ss, int cmd)
struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
ramc = ad1889_readw(chip, AD_DS_RAMC);
-
+
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
/* enable DMA loop & interrupts */
@@ -524,15 +524,15 @@ snd_ad1889_capture_trigger(struct snd_pcm_substream *ss, int cmd)
default:
return -EINVAL;
}
-
+
chip->ramc.reg = ramc;
- ad1889_writew(chip, AD_DS_RAMC, ramc);
+ ad1889_writew(chip, AD_DS_RAMC, ramc);
ad1889_readw(chip, AD_DS_RAMC); /* flush */
-
+
/* reset the chip when STOP - will disable IRQs */
if (cmd == SNDRV_PCM_TRIGGER_STOP)
ad1889_channel_reset(chip, AD_CHAN_ADC);
-
+
return 0;
}
@@ -548,10 +548,10 @@ snd_ad1889_playback_pointer(struct snd_pcm_substream *ss)
ptr = ad1889_readl(chip, AD_DMA_WAVCA);
ptr -= chip->wave.addr;
-
+
if (snd_BUG_ON(ptr >= chip->wave.size))
return 0;
-
+
return bytes_to_frames(ss->runtime, ptr);
}
@@ -570,7 +570,7 @@ snd_ad1889_capture_pointer(struct snd_pcm_substream *ss)
if (snd_BUG_ON(ptr >= chip->ramc.size))
return 0;
-
+
return bytes_to_frames(ss->runtime, ptr);
}
@@ -582,7 +582,7 @@ static struct snd_pcm_ops snd_ad1889_playback_ops = {
.hw_free = snd_ad1889_hw_free,
.prepare = snd_ad1889_playback_prepare,
.trigger = snd_ad1889_playback_trigger,
- .pointer = snd_ad1889_playback_pointer,
+ .pointer = snd_ad1889_playback_pointer,
};
static struct snd_pcm_ops snd_ad1889_capture_ops = {
@@ -593,7 +593,7 @@ static struct snd_pcm_ops snd_ad1889_capture_ops = {
.hw_free = snd_ad1889_hw_free,
.prepare = snd_ad1889_capture_prepare,
.trigger = snd_ad1889_capture_trigger,
- .pointer = snd_ad1889_capture_pointer,
+ .pointer = snd_ad1889_capture_pointer,
};
static irqreturn_t
@@ -636,7 +636,7 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
if (err < 0)
return err;
- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_ad1889_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_ad1889_capture_ops);
@@ -644,7 +644,7 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
pcm->private_data = chip;
pcm->info_flags = 0;
strcpy(pcm->name, chip->card->shortname);
-
+
chip->pcm = pcm;
chip->psubs = NULL;
chip->csubs = NULL;
@@ -658,10 +658,10 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
snd_printk(KERN_ERR PFX "buffer allocation error: %d\n", err);
return err;
}
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -679,24 +679,24 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
snd_iprintf(buffer, "Wave Quality: %d-bit linear\n",
(reg & AD_DS_WSMC_WA16) ? 16 : 8);
-
+
/* WARQ is at offset 12 */
tmp = (reg & AD_DS_WSMC_WARQ) ?
(((reg & AD_DS_WSMC_WARQ >> 12) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1;
-
+
snd_iprintf(buffer, "Wave FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-
-
+
+
snd_iprintf(buffer, "Synthesis output: %s\n",
reg & AD_DS_WSMC_SYEN ? "enabled" : "disabled");
-
+
/* SYRQ is at offset 4 */
tmp = (reg & AD_DS_WSMC_SYRQ) ?
(((reg & AD_DS_WSMC_SYRQ >> 4) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1;
-
+
snd_iprintf(buffer, "Synthesis FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
@@ -707,27 +707,27 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
snd_iprintf(buffer, "ADC Quality: %d-bit linear\n",
(reg & AD_DS_RAMC_AD16) ? 16 : 8);
-
+
/* ACRQ is at offset 4 */
tmp = (reg & AD_DS_RAMC_ACRQ) ?
(((reg & AD_DS_RAMC_ACRQ >> 4) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1;
-
+
snd_iprintf(buffer, "ADC FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
-
+
snd_iprintf(buffer, "Resampler input: %s\n",
reg & AD_DS_RAMC_REEN ? "enabled" : "disabled");
-
+
/* RERQ is at offset 12 */
tmp = (reg & AD_DS_RAMC_RERQ) ?
(((reg & AD_DS_RAMC_RERQ >> 12) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1;
-
+
snd_iprintf(buffer, "Resampler FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-
-
+
+
/* doc says LSB represents -1.5dB, but the max value (-94.5dB)
suggests that LSB is -3dB, which is more coherent with the logarithmic
nature of the dB scale */
@@ -739,7 +739,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
snd_iprintf(buffer, "Right: %s, -%d dB\n",
(reg & AD_DS_WADA_RWAM) ? "mute" : "unmute",
((reg & AD_DS_WADA_RWAA) >> 8) * 3);
-
+
reg = ad1889_readw(chip, AD_DS_WAS);
snd_iprintf(buffer, "Wave samplerate: %u Hz\n", reg);
reg = ad1889_readw(chip, AD_DS_RES);
@@ -779,7 +779,7 @@ snd_ad1889_ac97_xinit(struct snd_ad1889 *chip)
/* Interface Enable */
reg |= AD_AC97_ACIC_ACIE;
ad1889_writew(chip, AD_AC97_ACIC, reg);
-
+
snd_ad1889_ac97_ready(chip);
/* Audio Stream Output | Variable Sample Rate Mode */
@@ -820,7 +820,7 @@ snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override)
err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus);
if (err < 0)
return err;
-
+
chip->ac97_bus->private_free = snd_ad1889_ac97_bus_free;
memset(&ac97, 0, sizeof(ac97));
@@ -831,9 +831,9 @@ snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override)
err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97);
if (err < 0)
return err;
-
+
snd_ac97_tune_hardware(chip->ac97, ac97_quirks, quirk_override);
-
+
return 0;
}
@@ -871,14 +871,14 @@ skip_hw:
}
static int
-snd_ad1889_dev_free(struct snd_device *device)
+snd_ad1889_dev_free(struct snd_device *device)
{
struct snd_ad1889 *chip = device->device_data;
return snd_ad1889_free(chip);
}
static int __devinit
-snd_ad1889_init(struct snd_ad1889 *chip)
+snd_ad1889_init(struct snd_ad1889 *chip)
{
ad1889_writew(chip, AD_DS_CCS, AD_DS_CCS_CLKEN); /* turn on clock */
ad1889_readw(chip, AD_DS_CCS); /* flush posted write */
@@ -938,7 +938,7 @@ snd_ad1889_create(struct snd_card *card,
err = -EBUSY;
goto free_and_ret;
}
-
+
pci_set_master(pci);
spin_lock_init(&chip->lock); /* only now can we call ad1889_free */
@@ -1017,7 +1017,7 @@ snd_ad1889_probe(struct pci_dev *pci,
err = snd_ad1889_ac97_init(chip, ac97_quirk[devno]);
if (err < 0)
goto free_and_ret;
-
+
err = snd_ad1889_pcm_init(chip, 0, NULL);
if (err < 0)
goto free_and_ret;
diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c
index 0f819dd..0275686 100644
--- a/sound/pci/ak4531_codec.c
+++ b/sound/pci/ak4531_codec.c
@@ -43,13 +43,13 @@ static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak453
/*
*
*/
-
+
#if 0
static void snd_ak4531_dump(struct snd_ak4531 *ak4531)
{
int idx;
-
+
for (idx = 0; idx < 0x19; idx++)
printk("ak4531 0x%x: 0x%x\n", idx, ak4531->regs[idx]);
}
@@ -84,7 +84,7 @@ static int snd_ak4531_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_
uinfo->value.integer.max = mask;
return 0;
}
-
+
static int snd_ak4531_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ak4531 *ak4531 = snd_kcontrol_chip(kcontrol);
@@ -151,7 +151,7 @@ static int snd_ak4531_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_
uinfo->value.integer.max = mask;
return 0;
}
-
+
static int snd_ak4531_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ak4531 *ak4531 = snd_kcontrol_chip(kcontrol);
@@ -226,7 +226,7 @@ static int snd_ak4531_info_input_sw(struct snd_kcontrol *kcontrol, struct snd_ct
uinfo->value.integer.max = 1;
return 0;
}
-
+
static int snd_ak4531_get_input_sw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ak4531 *ak4531 = snd_kcontrol_chip(kcontrol);
@@ -469,7 +469,7 @@ void snd_ak4531_resume(struct snd_ak4531 *ak4531)
* /proc interface
*/
-static void snd_ak4531_proc_read(struct snd_info_entry *entry,
+static void snd_ak4531_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ak4531 *ak4531 = entry->private_data;
@@ -486,7 +486,7 @@ snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(card, "ak4531", &entry))
+ if (!snd_card_proc_new(card, "ak4531", &entry))
snd_info_set_text_ops(entry, ak4531, snd_ak4531_proc_read);
}
#endif
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 8df6824..9799051 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -38,7 +38,7 @@
#include <linux/interrupt.h>
#include <linux/slab.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -104,7 +104,7 @@
#define snd_als300_dbgplay(format, args...) printk(KERN_ERR format, ##args)
#else
#define snd_als300_dbgplay(format, args...)
-#endif
+#endif
enum {DEVICE_ALS300, DEVICE_ALS300_PLUS};
@@ -136,7 +136,7 @@ struct snd_als300 {
int chip_type; /* ALS300 or ALS300+ */
- char revision;
+ char revision;
};
struct snd_als300_substream_data {
@@ -239,7 +239,7 @@ static irqreturn_t snd_als300plus_interrupt(int irq, void *dev_id)
u8 general, mpu, dram;
struct snd_als300 *chip = dev_id;
struct snd_als300_substream_data *data;
-
+
general = inb(chip->port+ALS300P_IRQ_STATUS);
mpu = inb(chip->port+MPU_IRQ_STATUS);
dram = inb(chip->port+ALS300P_DRAM_IRQ_STATUS);
@@ -461,7 +461,7 @@ static int snd_als300_playback_prepare(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned short period_bytes = snd_pcm_lib_period_bytes(substream);
unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
-
+
snd_als300_dbgcallenter();
spin_lock_irq(&chip->reg_lock);
tmp = snd_als300_gcr_read(chip->port, PLAYBACK_CONTROL);
@@ -469,7 +469,7 @@ static int snd_als300_playback_prepare(struct snd_pcm_substream *substream)
snd_als300_dbgplay("Period bytes: %d Buffer bytes %d\n",
period_bytes, buffer_bytes);
-
+
/* set block size */
tmp &= 0xffff0000;
tmp |= period_bytes - 1;
@@ -571,7 +571,7 @@ static snd_pcm_uframes_t snd_als300_pointer(struct snd_pcm_substream *substream)
data = substream->runtime->private_data;
period_bytes = snd_pcm_lib_period_bytes(substream);
-
+
snd_als300_dbgcallenter();
spin_lock(&chip->reg_lock);
current_ptr = (u16) snd_als300_gcr_read(chip->port,
@@ -641,7 +641,7 @@ static void snd_als300_init(struct snd_als300 *chip)
{
unsigned long flags;
u32 tmp;
-
+
snd_als300_dbgcallenter();
spin_lock_irqsave(&chip->reg_lock, flags);
chip->revision = (snd_als300_gcr_read(chip->port, MISC_CONTROL) >> 16)
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index ba57005..14d58d8 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -33,15 +33,15 @@
* refer to: ALS4000a.PDF specs Ver 1.0, May 28th, 1998.
*
* The ALS4000 seems to be the PCI-cousin of the ALS100. It contains an
- * ALS100-like SB DSP/mixer, an OPL3 synth, a MPU401 and a gameport
- * interface. These subsystems can be mapped into ISA io-port space,
- * using the PCI-interface. In addition, the PCI-bit provides DMA and IRQ
+ * ALS100-like SB DSP/mixer, an OPL3 synth, a MPU401 and a gameport
+ * interface. These subsystems can be mapped into ISA io-port space,
+ * using the PCI-interface. In addition, the PCI-bit provides DMA and IRQ
* services to the subsystems.
- *
+ *
* While ALS4000 is very similar to a SoundBlaster, the differences in
* DMA and capturing require more changes to the SoundBlaster than
* desirable, so I made this separate driver.
- *
+ *
* The ALS4000 can do real full duplex playback/capture.
*
* FMDAC:
@@ -65,7 +65,7 @@
* - power management? (card can do voice wakeup according to datasheet!!)
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
@@ -228,7 +228,7 @@ static inline void snd_als4k_gcr_write(struct snd_sb *sb,
u32 val)
{
snd_als4k_gcr_write_addr(sb->alt_port, reg, val);
-}
+}
static inline u32 snd_als4k_gcr_read_addr(unsigned long iobase,
enum als4k_gcr_t reg)
@@ -337,7 +337,7 @@ static const struct {
} playback_cmd_vals[]={
/* ALS4000_FORMAT_U8_MONO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_UNS_MONO },
-/* ALS4000_FORMAT_S8_MONO */
+/* ALS4000_FORMAT_S8_MONO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_SIGN_MONO },
/* ALS4000_FORMAT_U16L_MONO */
{ SB_DSP4_OUT16_AI, SB_DSP_DMA16_ON, SB_DSP_DMA16_OFF, SB_DSP4_MODE_UNS_MONO },
@@ -345,7 +345,7 @@ static const struct {
{ SB_DSP4_OUT16_AI, SB_DSP_DMA16_ON, SB_DSP_DMA16_OFF, SB_DSP4_MODE_SIGN_MONO },
/* ALS4000_FORMAT_U8_STEREO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_UNS_STEREO },
-/* ALS4000_FORMAT_S8_STEREO */
+/* ALS4000_FORMAT_S8_STEREO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_SIGN_STEREO },
/* ALS4000_FORMAT_U16L_STEREO */
{ SB_DSP4_OUT16_AI, SB_DSP_DMA16_ON, SB_DSP_DMA16_OFF, SB_DSP4_MODE_UNS_STEREO },
@@ -359,14 +359,14 @@ enum { CMD_WIDTH8=0x04, CMD_SIGNED=0x10, CMD_MONO=0x80, CMD_STEREO=0xA0 };
static const unsigned char capture_cmd_vals[]=
{
CMD_WIDTH8|CMD_MONO, /* ALS4000_FORMAT_U8_MONO */
-CMD_WIDTH8|CMD_SIGNED|CMD_MONO, /* ALS4000_FORMAT_S8_MONO */
+CMD_WIDTH8|CMD_SIGNED|CMD_MONO, /* ALS4000_FORMAT_S8_MONO */
CMD_MONO, /* ALS4000_FORMAT_U16L_MONO */
CMD_SIGNED|CMD_MONO, /* ALS4000_FORMAT_S16L_MONO */
CMD_WIDTH8|CMD_STEREO, /* ALS4000_FORMAT_U8_STEREO */
-CMD_WIDTH8|CMD_SIGNED|CMD_STEREO, /* ALS4000_FORMAT_S8_STEREO */
+CMD_WIDTH8|CMD_SIGNED|CMD_STEREO, /* ALS4000_FORMAT_S8_STEREO */
CMD_STEREO, /* ALS4000_FORMAT_U16L_STEREO */
CMD_SIGNED|CMD_STEREO, /* ALS4000_FORMAT_S16L_STEREO */
-};
+};
#define capture_cmd(chip) (capture_cmd_vals[(chip)->capture_format])
static int snd_als4000_hw_params(struct snd_pcm_substream *substream,
@@ -389,10 +389,10 @@ static int snd_als4000_capture_prepare(struct snd_pcm_substream *substream)
unsigned count;
chip->capture_format = snd_als4000_get_format(runtime);
-
+
size = snd_pcm_lib_buffer_bytes(substream);
count = snd_pcm_lib_period_bytes(substream);
-
+
if (chip->capture_format & ALS4000_FORMAT_16BIT)
count >>= 1;
count--;
@@ -416,14 +416,14 @@ static int snd_als4000_playback_prepare(struct snd_pcm_substream *substream)
unsigned count;
chip->playback_format = snd_als4000_get_format(runtime);
-
+
size = snd_pcm_lib_buffer_bytes(substream);
count = snd_pcm_lib_period_bytes(substream);
-
+
if (chip->playback_format & ALS4000_FORMAT_16BIT)
count >>= 1;
count--;
-
+
/* FIXME: from second playback on, there's a lot more clicks and pops
* involved here than on first playback. Fiddling with
* tons of different settings didn't help (DMA, speaker on/off,
@@ -433,16 +433,16 @@ static int snd_als4000_playback_prepare(struct snd_pcm_substream *substream)
spin_lock_irq(&chip->reg_lock);
snd_als4000_set_rate(chip, runtime->rate);
snd_als4000_set_playback_dma(chip, runtime->dma_addr, size);
-
+
/* SPEAKER_ON not needed, since dma_on seems to also enable speaker */
/* snd_sbdsp_command(chip, SB_DSP_SPEAKER_ON); */
snd_sbdsp_command(chip, playback_cmd(chip).dsp_cmd);
snd_sbdsp_command(chip, playback_cmd(chip).format);
snd_sbdsp_command(chip, count & 0xff);
snd_sbdsp_command(chip, count >> 8);
- snd_sbdsp_command(chip, playback_cmd(chip).dma_off);
+ snd_sbdsp_command(chip, playback_cmd(chip).dma_off);
spin_unlock_irq(&chip->reg_lock);
-
+
return 0;
}
@@ -450,7 +450,7 @@ static int snd_als4000_capture_trigger(struct snd_pcm_substream *substream, int
{
struct snd_sb *chip = snd_pcm_substream_chip(substream);
int result = 0;
-
+
/* FIXME race condition in here!!!
chip->mode non-atomic update gets consistently protected
by reg_lock always, _except_ for this place!!
@@ -509,11 +509,11 @@ static snd_pcm_uframes_t snd_als4000_capture_pointer(struct snd_pcm_substream *s
struct snd_sb *chip = snd_pcm_substream_chip(substream);
unsigned int result;
- spin_lock(&chip->reg_lock);
+ spin_lock(&chip->reg_lock);
result = snd_als4k_gcr_read(chip, ALS4K_GCRA4_FIFO2_CURRENT_ADDR);
spin_unlock(&chip->reg_lock);
result &= 0xffff;
- return bytes_to_frames( substream->runtime, result );
+ return bytes_to_frames(substream->runtime, result);
}
static snd_pcm_uframes_t snd_als4000_playback_pointer(struct snd_pcm_substream *substream)
@@ -521,11 +521,11 @@ static snd_pcm_uframes_t snd_als4000_playback_pointer(struct snd_pcm_substream *
struct snd_sb *chip = snd_pcm_substream_chip(substream);
unsigned result;
- spin_lock(&chip->reg_lock);
+ spin_lock(&chip->reg_lock);
result = snd_als4k_gcr_read(chip, ALS4K_GCRA0_FIFO1_CURRENT_ADDR);
spin_unlock(&chip->reg_lock);
result &= 0xffff;
- return bytes_to_frames( substream->runtime, result );
+ return bytes_to_frames(substream->runtime, result);
}
/* FIXME: this IRQ routine doesn't really support IRQ sharing (we always
@@ -563,12 +563,12 @@ static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id)
/* ACK the PCI block IRQ */
snd_als4k_iobase_writeb(chip->alt_port,
ALS4K_IOB_0E_IRQTYPE_SB_CR1E_MPU, pci_irqstatus);
-
+
spin_lock(&chip->mixer_lock);
/* SPECS_PAGE: 20 */
sb_irqstatus = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
spin_unlock(&chip->mixer_lock);
-
+
if (sb_irqstatus & SB_IRQTYPE_8BIT)
snd_sb_ack_8bit(chip);
if (sb_irqstatus & SB_IRQTYPE_16BIT)
@@ -755,7 +755,7 @@ static void snd_als4000_configure(struct snd_sb *chip)
snd_als4_cr_write(chip, ALS4K_CR0_SB_CONFIG,
tmp & ~ALS4K_CR0_MX80_81_REG_WRITE_ENABLE);
spin_unlock_irq(&chip->mixer_lock);
-
+
spin_lock_irq(&chip->reg_lock);
/* enable interrupts */
snd_als4k_gcr_write(chip, ALS4K_GCR8C_MISC_CTRL,
@@ -764,7 +764,7 @@ static void snd_als4000_configure(struct snd_sb *chip)
/* SPECS_PAGE: 39 */
for (i = ALS4K_GCR91_DMA0_ADDR; i <= ALS4K_GCR96_DMA3_MODE_COUNT; ++i)
snd_als4k_gcr_write(chip, i, 0);
-
+
snd_als4k_gcr_write(chip, ALS4K_GCR99_DMA_EMULATION_CTRL,
snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL));
spin_unlock_irq(&chip->reg_lock);
@@ -836,7 +836,7 @@ static inline int snd_als4000_create_gameport(struct snd_card_als4000 *acard, in
static inline void snd_als4000_free_gameport(struct snd_card_als4000 *acard) { }
#endif
-static void snd_card_als4000_free( struct snd_card *card )
+static void snd_card_als4000_free(struct snd_card *card)
{
struct snd_card_als4000 *acard = card->private_data;
@@ -888,8 +888,8 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
pci_read_config_word(pci, PCI_COMMAND, &word);
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
pci_set_master(pci);
-
- card = snd_card_new(index[dev], id[dev], THIS_MODULE,
+
+ card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(*acard) /* private_data: acard */);
if (card == NULL) {
pci_release_regions(pci);
@@ -948,7 +948,7 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
}
if ((err = snd_sbmixer_new(chip)) < 0) {
goto out_err;
- }
+ }
if (snd_opl3_create(card,
iobase + ALS4K_IOB_10_ADLIB_ADDR0,
@@ -975,7 +975,7 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
out_err:
snd_card_free(card);
-
+
out:
return err;
}
@@ -994,7 +994,7 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
struct snd_sb *chip = acard->chip;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
-
+
snd_pcm_suspend_all(chip->pcm);
snd_sbmixer_suspend(chip);
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 085a52b..3f9a2c5 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -19,7 +19,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -265,7 +265,7 @@ struct atiixp {
unsigned long addr;
void __iomem *remap_addr;
int irq;
-
+
struct snd_ac97_bus *ac97_bus;
struct snd_ac97 *ac97[NUM_ATI_CODECS];
@@ -350,7 +350,7 @@ static int snd_atiixp_update_bits(struct atiixp *chip, unsigned int reg,
* list. although we can change the list dynamically, in this version,
* a static RING of buffer descriptors is used.
*
- * the ring is built in this function, and is set up to the hardware.
+ * the ring is built in this function, and is set up to the hardware.
*/
static int atiixp_build_dma_packets(struct atiixp *chip, struct atiixp_dma *dma,
struct snd_pcm_substream *substream,
@@ -430,7 +430,7 @@ static int snd_atiixp_acquire_codec(struct atiixp *chip)
int timeout = 1000;
while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) {
- if (! timeout--) {
+ if (!timeout--) {
snd_printk(KERN_WARNING "atiixp: codec acquire timeout\n");
return -EBUSY;
}
@@ -471,7 +471,7 @@ static void snd_atiixp_codec_write(struct atiixp *chip, unsigned short codec,
unsigned short reg, unsigned short val)
{
unsigned int data;
-
+
if (snd_atiixp_acquire_codec(chip) < 0)
return;
data = ((unsigned int)val << ATI_REG_PHYS_OUT_DATA_SHIFT) |
@@ -486,7 +486,7 @@ static unsigned short snd_atiixp_ac97_read(struct snd_ac97 *ac97,
{
struct atiixp *chip = ac97->private_data;
return snd_atiixp_codec_read(chip, ac97->num, reg);
-
+
}
static void snd_atiixp_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
@@ -512,9 +512,9 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
atiixp_read(chip, CMD);
udelay(10);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SOFT_RESET, 0);
-
+
timeout = 10;
- while (! (atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
+ while (!(atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
/* do a hard reset */
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SYNC|ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_AC_SYNC);
@@ -537,8 +537,8 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
#ifdef CONFIG_PM
static int snd_atiixp_aclink_down(struct atiixp *chip)
{
- // if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */
- // return -EBUSY;
+ /* if (atiixp_read(chip, MODEM_MIRROR) & 0x1) modem running, too? */
+ /* return -EBUSY; */
atiixp_update(chip, CMD,
ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_POWERDOWN);
@@ -582,7 +582,7 @@ static int __devinit snd_atiixp_codec_detect(struct atiixp *chip)
if (ac97_codec == -1)
ac97_codec = ac97_probing_bugs(chip->pci);
if (ac97_codec >= 0) {
- chip->codec_not_ready_bits |=
+ chip->codec_not_ready_bits |=
CODEC_CHECK_BITS ^ (1 << (ac97_codec + 10));
return 0;
}
@@ -684,7 +684,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr
*/
static void snd_atiixp_xrun_dma(struct atiixp *chip, struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_printdd("atiixp: XRUN detected (DMA %d)\n", dma->ops->type);
snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
@@ -695,7 +695,7 @@ static void snd_atiixp_xrun_dma(struct atiixp *chip, struct atiixp_dma *dma)
*/
static void snd_atiixp_update_dma(struct atiixp *chip, struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_pcm_period_elapsed(dma->substream);
}
@@ -747,7 +747,7 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
err = -EINVAL;
break;
}
- if (! err) {
+ if (!err) {
snd_atiixp_check_bus_busy(chip);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
dma->ops->flush_dma(chip);
@@ -805,7 +805,7 @@ static void atiixp_in_enable_transfer(struct atiixp *chip, int on)
{
if (on) {
unsigned int data = atiixp_read(chip, CMD);
- if (! (data & ATI_REG_CMD_RECEIVE_EN)) {
+ if (!(data & ATI_REG_CMD_RECEIVE_EN)) {
data |= ATI_REG_CMD_RECEIVE_EN;
#if 0 /* FIXME: this causes the endless loop */
/* wait until slot 3/4 are finished */
@@ -852,10 +852,10 @@ static void atiixp_spdif_flush_dma(struct atiixp *chip)
/* DMA off, transfer on */
atiixp_spdif_enable_dma(chip, 0);
atiixp_spdif_enable_transfer(chip, 1);
-
+
timeout = 100;
do {
- if (! (atiixp_read(chip, SPDF_DMA_DT_SIZE) & ATI_REG_DMA_FIFO_USED))
+ if (!(atiixp_read(chip, SPDF_DMA_DT_SIZE) & ATI_REG_DMA_FIFO_USED))
break;
udelay(1);
} while (timeout-- > 0);
@@ -930,7 +930,7 @@ static int snd_atiixp_playback_prepare(struct snd_pcm_substream *substream)
*/
atiixp_update(chip, 6CH_REORDER, ATI_REG_6CH_REORDER_EN,
substream->runtime->channels >= 6 ? ATI_REG_6CH_REORDER_EN: 0);
-
+
spin_unlock_irq(&chip->reg_lock);
return 0;
}
@@ -1226,7 +1226,7 @@ static struct atiixp_dma_ops snd_atiixp_playback_dma_ops = {
.enable_transfer = atiixp_out_enable_transfer,
.flush_dma = atiixp_out_flush_dma,
};
-
+
static struct atiixp_dma_ops snd_atiixp_capture_dma_ops = {
.type = ATI_DMA_CAPTURE,
.llp_offset = ATI_REG_IN_DMA_LINKPTR,
@@ -1235,7 +1235,7 @@ static struct atiixp_dma_ops snd_atiixp_capture_dma_ops = {
.enable_transfer = atiixp_in_enable_transfer,
.flush_dma = atiixp_in_flush_dma,
};
-
+
static struct atiixp_dma_ops snd_atiixp_spdif_dma_ops = {
.type = ATI_DMA_SPDIF,
.llp_offset = ATI_REG_SPDF_DMA_LINKPTR,
@@ -1244,7 +1244,7 @@ static struct atiixp_dma_ops snd_atiixp_spdif_dma_ops = {
.enable_transfer = atiixp_spdif_enable_transfer,
.flush_dma = atiixp_spdif_flush_dma,
};
-
+
static int __devinit snd_atiixp_pcm_new(struct atiixp *chip)
{
@@ -1255,7 +1255,7 @@ static int __devinit snd_atiixp_pcm_new(struct atiixp *chip)
/* initialize constants */
chip->dmas[ATI_DMA_PLAYBACK].ops = &snd_atiixp_playback_dma_ops;
chip->dmas[ATI_DMA_CAPTURE].ops = &snd_atiixp_capture_dma_ops;
- if (! chip->spdif_over_aclink)
+ if (!chip->spdif_over_aclink)
chip->dmas[ATI_DMA_SPDIF].ops = &snd_atiixp_spdif_dma_ops;
/* assign AC97 pcm */
@@ -1293,9 +1293,9 @@ static int __devinit snd_atiixp_pcm_new(struct atiixp *chip)
64*1024, 128*1024);
/* no SPDIF support on codec? */
- if (chip->pcms[ATI_PCM_SPDIF] && ! chip->pcms[ATI_PCM_SPDIF]->rates)
+ if (chip->pcms[ATI_PCM_SPDIF] && !chip->pcms[ATI_PCM_SPDIF]->rates)
return 0;
-
+
/* FIXME: non-48k sample rate doesn't work on my test machine with AD1888 */
if (chip->pcms[ATI_PCM_SPDIF])
chip->pcms[ATI_PCM_SPDIF]->rates = SNDRV_PCM_RATE_48000;
@@ -1340,7 +1340,7 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id)
status = atiixp_read(chip, ISR);
- if (! status)
+ if (!status)
return IRQ_NONE;
/* process audio DMA */
@@ -1352,7 +1352,7 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id)
snd_atiixp_xrun_dma(chip, &chip->dmas[ATI_DMA_CAPTURE]);
else if (status & ATI_REG_ISR_IN_STATUS)
snd_atiixp_update_dma(chip, &chip->dmas[ATI_DMA_CAPTURE]);
- if (! chip->spdif_over_aclink) {
+ if (!chip->spdif_over_aclink) {
if (status & ATI_REG_ISR_SPDF_XRUN)
snd_atiixp_xrun_dma(chip, &chip->dmas[ATI_DMA_SPDIF]);
else if (status & ATI_REG_ISR_SPDF_STATUS)
@@ -1430,7 +1430,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock,
ac97.pci = chip->pci;
ac97.num = i;
ac97.scaps = AC97_SCAP_SKIP_MODEM | AC97_SCAP_POWER_SAVE;
- if (! chip->spdif_over_aclink)
+ if (!chip->spdif_over_aclink)
ac97.scaps |= AC97_SCAP_NO_SPDIF;
if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {
chip->ac97[i] = NULL; /* to be sure */
@@ -1440,7 +1440,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock,
codec_count++;
}
- if (! codec_count) {
+ if (!codec_count) {
snd_printk(KERN_ERR "atiixp: no codec available\n");
return -ENODEV;
}
@@ -1541,7 +1541,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "atiixp", &entry))
+ if (!snd_card_proc_new(chip->card, "atiixp", &entry))
snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
}
#else /* !CONFIG_PROC_FS */
@@ -1559,7 +1559,7 @@ static int snd_atiixp_free(struct atiixp *chip)
goto __hw_end;
snd_atiixp_chip_stop(chip);
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->remap_addr)
@@ -1665,7 +1665,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
if ((err = snd_atiixp_pcm_new(chip)) < 0)
goto __error;
-
+
snd_atiixp_proc_init(chip);
snd_atiixp_chip_start(chip);
@@ -1682,7 +1682,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
return 0;
- __error:
+__error:
snd_card_free(card);
return err;
}
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 2f10630..b198f4c 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -19,7 +19,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -240,7 +240,7 @@ struct atiixp_modem {
unsigned long addr;
void __iomem *remap_addr;
int irq;
-
+
struct snd_ac97_bus *ac97_bus;
struct snd_ac97 *ac97[NUM_ATI_CODECS];
@@ -319,7 +319,7 @@ static int snd_atiixp_update_bits(struct atiixp_modem *chip, unsigned int reg,
* list. although we can change the list dynamically, in this version,
* a static RING of buffer descriptors is used.
*
- * the ring is built in this function, and is set up to the hardware.
+ * the ring is built in this function, and is set up to the hardware.
*/
static int atiixp_build_dma_packets(struct atiixp_modem *chip,
struct atiixp_dma *dma,
@@ -399,7 +399,7 @@ static int snd_atiixp_acquire_codec(struct atiixp_modem *chip)
int timeout = 1000;
while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) {
- if (! timeout--) {
+ if (!timeout--) {
snd_printk(KERN_WARNING "atiixp-modem: codec acquire timeout\n");
return -EBUSY;
}
@@ -443,7 +443,7 @@ static void snd_atiixp_codec_write(struct atiixp_modem *chip,
unsigned short reg, unsigned short val)
{
unsigned int data;
-
+
if (snd_atiixp_acquire_codec(chip) < 0)
return;
data = ((unsigned int)val << ATI_REG_PHYS_OUT_DATA_SHIFT) |
@@ -458,7 +458,7 @@ static unsigned short snd_atiixp_ac97_read(struct snd_ac97 *ac97,
{
struct atiixp_modem *chip = ac97->private_data;
return snd_atiixp_codec_read(chip, ac97->num, reg);
-
+
}
static void snd_atiixp_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
@@ -489,9 +489,9 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
atiixp_read(chip, CMD);
udelay(10);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SOFT_RESET, 0);
-
+
timeout = 10;
- while (! (atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
+ while (!(atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
/* do a hard reset */
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SYNC|ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_AC_SYNC);
@@ -514,8 +514,8 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
#ifdef CONFIG_PM
static int snd_atiixp_aclink_down(struct atiixp_modem *chip)
{
- // if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */
- // return -EBUSY;
+ /* if (atiixp_read(chip, MODEM_MIRROR) & 0x1) modem running, too? */
+ /* return -EBUSY; */
atiixp_update(chip, CMD,
ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_POWERDOWN);
@@ -570,7 +570,7 @@ static int snd_atiixp_chip_start(struct atiixp_modem *chip)
/* set up spdif, enable burst mode */
reg = atiixp_read(chip, CMD);
reg |= ATI_REG_CMD_BURST_EN;
- if(!(reg & ATI_REG_CMD_MODEM_PRESENT))
+ if (!(reg & ATI_REG_CMD_MODEM_PRESENT))
reg |= ATI_REG_CMD_MODEM_PRESENT;
atiixp_write(chip, CMD, reg);
@@ -635,7 +635,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr
static void snd_atiixp_xrun_dma(struct atiixp_modem *chip,
struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_printdd("atiixp-modem: XRUN detected (DMA %d)\n", dma->ops->type);
snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
@@ -647,7 +647,7 @@ static void snd_atiixp_xrun_dma(struct atiixp_modem *chip,
static void snd_atiixp_update_dma(struct atiixp_modem *chip,
struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_pcm_period_elapsed(dma->substream);
}
@@ -692,7 +692,7 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
err = -EINVAL;
break;
}
- if (! err) {
+ if (!err) {
snd_atiixp_check_bus_busy(chip);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
dma->ops->flush_dma(chip);
@@ -750,7 +750,7 @@ static void atiixp_in_enable_transfer(struct atiixp_modem *chip, int on)
{
if (on) {
unsigned int data = atiixp_read(chip, CMD);
- if (! (data & ATI_REG_CMD_MODEM_RECEIVE_EN)) {
+ if (!(data & ATI_REG_CMD_MODEM_RECEIVE_EN)) {
data |= ATI_REG_CMD_MODEM_RECEIVE_EN;
atiixp_write(chip, CMD, data);
}
@@ -811,7 +811,7 @@ static int snd_atiixp_pcm_hw_params(struct snd_pcm_substream *substream,
/* set up modem rate */
for (i = 0; i < NUM_ATI_CODECS; i++) {
- if (! chip->ac97[i])
+ if (!chip->ac97[i])
continue;
snd_ac97_write(chip->ac97[i], AC97_LINE1_RATE, params_rate(hw_params));
snd_ac97_write(chip->ac97[i], AC97_LINE1_LEVEL, 0);
@@ -978,7 +978,7 @@ static struct atiixp_dma_ops snd_atiixp_playback_dma_ops = {
.enable_transfer = atiixp_out_enable_transfer,
.flush_dma = atiixp_out_flush_dma,
};
-
+
static struct atiixp_dma_ops snd_atiixp_capture_dma_ops = {
.type = ATI_DMA_CAPTURE,
.llp_offset = ATI_REG_MODEM_IN_DMA_LINKPTR,
@@ -1027,7 +1027,7 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id)
status = atiixp_read(chip, ISR);
- if (! status)
+ if (!status)
return IRQ_NONE;
/* process audio DMA */
@@ -1102,7 +1102,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
codec_count++;
}
- if (! codec_count) {
+ if (!codec_count) {
snd_printk(KERN_ERR "atiixp-modem: no codec available\n");
return -ENODEV;
}
@@ -1184,7 +1184,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp_modem *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry))
+ if (!snd_card_proc_new(chip->card, "atiixp-modem", &entry))
snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
}
#else
@@ -1202,7 +1202,7 @@ static int snd_atiixp_free(struct atiixp_modem *chip)
goto __hw_end;
snd_atiixp_chip_stop(chip);
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->remap_addr)
@@ -1306,7 +1306,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
if ((err = snd_atiixp_pcm_new(chip)) < 0)
goto __error;
-
+
snd_atiixp_proc_init(chip);
snd_atiixp_chip_start(chip);
@@ -1320,7 +1320,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
return 0;
- __error:
+__error:
snd_card_free(card);
return err;
}
diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c
index 3f00ddf..efb0802 100644
--- a/sound/pci/aw2/aw2-alsa.c
+++ b/sound/pci/aw2/aw2-alsa.c
@@ -26,7 +26,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c
index 6a3891a..3be6ac2 100644
--- a/sound/pci/aw2/aw2-saa7146.c
+++ b/sound/pci/aw2/aw2-saa7146.c
@@ -29,7 +29,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <asm/system.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 333007c..72cca10 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -159,7 +159,7 @@
* - use MMIO (memory-mapped I/O)? Slightly faster access, e.g. for gameport.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/delay.h>
@@ -1360,7 +1360,7 @@ snd_azf3328_playback_pointer(struct snd_pcm_substream *substream)
/* calculate offset */
result -= bufptr;
- frmres = bytes_to_frames( substream->runtime, result);
+ frmres = bytes_to_frames(substream->runtime, result);
snd_azf3328_dbgplay("PLAY @ 0x%8lx, frames %8ld\n", result, frmres);
return frmres;
}
@@ -1381,7 +1381,7 @@ snd_azf3328_capture_pointer(struct snd_pcm_substream *substream)
/* calculate offset */
result -= bufptr;
- frmres = bytes_to_frames( substream->runtime, result);
+ frmres = bytes_to_frames(substream->runtime, result);
snd_azf3328_dbgplay("REC @ 0x%8lx, frames %8ld\n", result, frmres);
return frmres;
}
@@ -2063,14 +2063,14 @@ snd_azf3328_debug_show_ports(const struct snd_azf3328 *chip)
snd_azf3328_game_inb(chip, 5)
);
- for (tmp = 0; tmp < 0x07; tmp += 1)
+ for (tmp = 0; tmp < 0x07; tmp++)
snd_azf3328_dbgmisc("mpu_io 0x%04x\n", inb(chip->mpu_io + tmp));
- for (tmp = 0; tmp <= 0x07; tmp += 1)
+ for (tmp = 0; tmp <= 0x07; tmp++)
snd_azf3328_dbgmisc("0x%02x: game200 0x%04x, game208 0x%04x\n",
tmp, inb(0x200 + tmp), inb(0x208 + tmp));
- for (tmp = 0; tmp <= 0x01; tmp += 1)
+ for (tmp = 0; tmp <= 0x01; tmp++)
snd_azf3328_dbgmisc(
"0x%02x: mpu300 0x%04x, mpu310 0x%04x, mpu320 0x%04x, "
"mpu330 0x%04x opl388 0x%04x opl38c 0x%04x\n",
diff --git a/sound/pci/azt3328.h b/sound/pci/azt3328.h
index 974e051..3038efb 100644
--- a/sound/pci/azt3328.h
+++ b/sound/pci/azt3328.h
@@ -119,7 +119,7 @@ enum azf_freq_t {
/* general */
#define IDX_IO_42H 0x42 /* PU:0x0001 */
-/** DirectX timer, main interrupt area (FIXME: and something else?) **/
+/** DirectX timer, main interrupt area (FIXME: and something else?) **/
#define IDX_IO_TIMER_VALUE 0x60 /* found this timer area by pure luck :-) */
/* timer countdown value; triggers IRQ when timer is finished */
#define TIMER_VALUE_MASK 0x000fffffUL
@@ -204,7 +204,7 @@ enum azf_freq_t {
/*** Gameport area port indices ***/
-/* (only 0x06 of 0x08 bytes saved/restored by Windows driver) */
+/* (only 0x06 of 0x08 bytes saved/restored by Windows driver) */
#define AZF_IO_SIZE_GAME 0x08
#define AZF_IO_SIZE_GAME_PM 0x06
@@ -333,7 +333,7 @@ enum {
#define MIXER_ADVCTL2_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic; Win driver: "MonoSelectSource"?? */
#define MIXER_ADVCTL2_3D 0x2000 /* 3D Enhancement 1=on */
#define MIXER_ADVCTL2_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
-
+
#define IDX_MIXER_SOMETHING30H 0x30 /* used, but unknown??? */
/* driver internal flags */
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/au88x0/au88x0.c | 46 ++++----
sound/pci/au88x0/au88x0.h | 4 +-
sound/pci/au88x0/au88x0_a3d.c | 46 ++++----
sound/pci/au88x0/au88x0_core.c | 254 +++++++++++++++++++-------------------
sound/pci/au88x0/au88x0_eq.c | 24 ++--
sound/pci/au88x0/au88x0_mixer.c | 2 +-
sound/pci/au88x0/au88x0_mpu401.c | 2 +-
sound/pci/au88x0/au88x0_pcm.c | 46 ++++----
sound/pci/au88x0/au88x0_synth.c | 46 ++++----
sound/pci/au88x0/au88x0_xtalk.c | 26 ++--
sound/pci/au88x0/au88x0_xtalk.h | 2 +-
11 files changed, 249 insertions(+), 249 deletions(-)
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 68368e4..440be0b 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -125,7 +125,7 @@ static int snd_vortex_dev_free(struct snd_device *device)
vortex_gameport_unregister(vortex);
vortex_core_shutdown(vortex);
- // Take down PCI interface.
+ /* Take down PCI interface. */
free_irq(vortex->irq, vortex);
iounmap(vortex->mmio);
pci_release_regions(vortex->pci_dev);
@@ -148,7 +148,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
*rchip = NULL;
- // check PCI availability (DMA).
+ /* check PCI availability (DMA). */
if ((err = pci_enable_device(pci)) < 0)
return err;
if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
@@ -166,7 +166,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
chip->card = card;
- // initialize the stuff
+ /* initialize the stuff */
chip->pci_dev = pci;
chip->io = pci_resource_start(pci, 0);
chip->vendor = pci->vendor;
@@ -174,8 +174,8 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
chip->card = card;
chip->irq = -1;
- // (1) PCI resource allocation
- // Get MMIO area
+ /* (1) PCI resource allocation */
+ /* Get MMIO area */
//
if ((err = pci_request_regions(pci, CARD_NAME_SHORT)) != 0)
goto regions_out;
@@ -205,9 +205,9 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
chip->irq = pci->irq;
pci_set_master(pci);
- // End of PCI setup.
+ /* End of PCI setup. */
- // Register alsa root device.
+ /* Register alsa root device. */
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
goto alloc_out;
}
@@ -228,7 +228,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
pci_release_regions(chip->pci_dev);
regions_out:
pci_disable_device(chip->pci_dev);
- //FIXME: this not the right place to unregister the gameport
+ /* FIXME: this not the right place to unregister the gameport */
vortex_gameport_unregister(chip);
kfree(chip);
return err;
@@ -243,64 +243,64 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
vortex_t *chip;
int err;
- // (1)
+ /* (1) */
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
dev++;
return -ENOENT;
}
- // (2)
+ /* (2) */
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
- // (3)
+ /* (3) */
if ((err = snd_vortex_create(card, pci, &chip)) < 0) {
snd_card_free(card);
return err;
}
snd_vortex_workaround(pci, pcifix[dev]);
- // Card details needed in snd_vortex_midi
+ /* Card details needed in snd_vortex_midi */
strcpy(card->driver, CARD_NAME_SHORT);
sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
sprintf(card->longname, "%s at 0x%lx irq %i",
card->shortname, chip->io, chip->irq);
- // (4) Alloc components.
- // ADB pcm.
+ /* (4) Alloc components. */
+ /* ADB pcm. */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
snd_card_free(card);
return err;
}
#ifndef CHIP_AU8820
- // ADB SPDIF
+ /* ADB SPDIF */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_SPDIF, 1)) < 0) {
snd_card_free(card);
return err;
}
- // A3D
+ /* A3D */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_A3D, NR_A3D)) < 0) {
snd_card_free(card);
return err;
}
#endif
/*
- // ADB I2S
+ //ADB I2S
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_I2S, 1)) < 0) {
snd_card_free(card);
return err;
}
*/
#ifndef CHIP_AU8810
- // WT pcm.
+ /* WT pcm. */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_WT, NR_WT)) < 0) {
snd_card_free(card);
return err;
}
#endif
- // snd_ac97_mixer and Vortex mixer.
+ /* snd_ac97_mixer and Vortex mixer. */
if ((err = snd_vortex_mixer(chip)) < 0) {
snd_card_free(card);
return err;
@@ -329,12 +329,12 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
}
#endif
- // (5)
+ /* (5) */
if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
&(chip->device))) < 0) {
snd_card_free(card);
return err;
- }
+ }
if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
&(chip->vendor))) < 0) {
snd_card_free(card);
@@ -354,12 +354,12 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
}
#endif
- // (6)
+ /* (6) */
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
}
- // (7)
+ /* (7) */
pci_set_drvdata(pci, card);
dev++;
vortex_connect_default(chip, 1);
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index cf46bba..02e949d 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -13,13 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
#ifndef __SOUND_AU88X0_H
#define __SOUND_AU88X0_H
#ifdef __KERNEL__
#include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index 649849e..526fb5f 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -49,7 +49,7 @@ static void
a3dsrc_GetTimeConsts(a3dsrc_t * a, short *HrtfTrack, short *ItdTrack,
short *GTrack, short *CTrack)
{
- // stub!
+ /* stub! */
}
#endif
@@ -219,7 +219,7 @@ static void a3dsrc_GetHrtfState(a3dsrc_t * a, a3d_Hrtf_t aa, a3d_Hrtf_t b)
{
vortex_t *vortex = (vortex_t *) (a->vortex);
int i;
- // FIXME: verify this!
+ /* FIXME: verify this! */
for (i = 0; i < HRTF_SZ; i++)
aa[i] =
hwread(vortex->mmio,
@@ -245,10 +245,10 @@ static void a3dsrc_GetHrtfOutput(a3dsrc_t * a, short *left, short *right)
#endif
-/* Interaural Time Difference.
- * "The other main clue that humans use to locate sounds, is called
- * Interaural Time Difference (ITD). The differences in distance from
- * the sound source to a listeners ears means that the sound will
+/* Interaural Time Difference.
+ * "The other main clue that humans use to locate sounds, is called
+ * Interaural Time Difference (ITD). The differences in distance from
+ * the sound source to a listeners ears means that the sound will
* reach one ear slightly before the other....", found somewhere with google.*/
static void a3dsrc_SetItdTarget(a3dsrc_t * a, short litd, short ritd)
{
@@ -265,7 +265,7 @@ static void a3dsrc_SetItdTarget(a3dsrc_t * a, short litd, short ritd)
hwwrite(vortex->mmio,
a3d_addrB(a->slice, a->source, A3D_B_ITDTarget),
(ritd << 0x10) | litd);
- //hwwrite(vortex->mmio, addr(0x191DF+5, this04, this08), (ritd<<0x10)|litd);
+ /* hwwrite(vortex->mmio, addr(0x191DF+5, this04, this08), (ritd<<0x10)|litd); */
}
static void a3dsrc_SetItdCurrent(a3dsrc_t * a, short litd, short ritd)
@@ -283,7 +283,7 @@ static void a3dsrc_SetItdCurrent(a3dsrc_t * a, short litd, short ritd)
hwwrite(vortex->mmio,
a3d_addrB(a->slice, a->source, A3D_B_ITDCurrent),
(ritd << 0x10) | litd);
- //hwwrite(vortex->mmio, addr(0x191DF+1, this04, this08), (ritd<<0x10)|litd);
+ /* hwwrite(vortex->mmio, addr(0x191DF+1, this04, this08), (ritd<<0x10)|litd); */
}
static void a3dsrc_SetItdDline(a3dsrc_t * a, a3d_ItdDline_t const dline)
@@ -392,7 +392,7 @@ static void a3dsrc_SetA3DSampleRate(a3dsrc_t * a, int sr)
esp0 = (((esp0 & 0x7fffffff) | 0xB8000000) & 0x7) | ((sr & 0x1f) << 3);
hwwrite(vortex->mmio, A3D_SLICE_Control + ((a->slice) << 0xd), esp0);
- //hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), esp0);
+ /* hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), esp0); */
}
static void a3dsrc_EnableA3D(a3dsrc_t * a)
@@ -400,7 +400,7 @@ static void a3dsrc_EnableA3D(a3dsrc_t * a)
vortex_t *vortex = (vortex_t *) (a->vortex);
hwwrite(vortex->mmio, A3D_SLICE_Control + ((a->slice) << 0xd),
0xF0000001);
- //hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), 0xF0000001);
+ /* hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), 0xF0000001); */
}
static void a3dsrc_DisableA3D(a3dsrc_t * a)
@@ -428,7 +428,7 @@ static void a3dsrc_GetA3DSampleRate(a3dsrc_t * a, int *sr)
vortex_t *vortex = (vortex_t *) (a->vortex);
*sr = ((hwread(vortex->mmio, A3D_SLICE_Control + (a->slice << 0xd))
>> 3) & 0x1f);
- //*sr = ((hwread(vortex->mmio, 0x19C38 + (this08<<0xd))>>3)&0x1f);
+ /**sr = ((hwread(vortex->mmio, 0x19C38 + (this08<<0xd))>>3)&0x1f); */
}
static void a3dsrc_GetA3DControlReg(a3dsrc_t * a, unsigned long *ctrl)
@@ -463,7 +463,7 @@ static void a3dsrc_ZeroSliceIO(a3dsrc_t * a)
static void a3dsrc_ZeroState(a3dsrc_t * a)
{
- //printk("vortex: ZeroState slice: %d, source %d\n", a->slice, a->source);
+ /* printk("vortex: ZeroState slice: %d, source %d\n", a->slice, a->source); */
a3dsrc_SetAtmosState(a, 0, 0, 0, 0);
a3dsrc_SetHrtfState(a, A3dHrirZeros, A3dHrirZeros);
@@ -500,7 +500,7 @@ static void a3dsrc_ZeroStateA3D(a3dsrc_t * a)
for (i = 0; i < 4; i++) {
a->slice = i;
a3dsrc_ZeroSliceIO(a);
- //a3dsrc_ZeroState(a);
+ /* a3dsrc_ZeroState(a); */
}
a->source = var2;
a->slice = var;
@@ -524,8 +524,8 @@ static void a3dsrc_ProgramPipe(a3dsrc_t * a)
a3dsrc_SetHrtfTarget(a, A3dHrirImpulse, A3dHrirImpulse);
/* Test: Sounds saturated. */
- //a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest);
- //a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest);
+ /* a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest); */
+ /* a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest); */
}
/* VDB = Vortex audio Dataflow Bus */
@@ -534,7 +534,7 @@ static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
{
vortex_t *vortex = (vortex_t *) (a->vortex);
- // ((aa >> 2) << 8) - (aa >> 2)
+ /* ((aa >> 2) << 8) - (aa >> 2) */
hwwrite(vortex->mmio,
a3d_addrS(a->slice, A3D_SLICE_VDBDest) + (a->source << 2), 0);
hwwrite(vortex->mmio,
@@ -552,7 +552,7 @@ static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
static void vortex_A3dSourceHw_Initialize(vortex_t * v, int source, int slice)
{
a3dsrc_t *a3dsrc = &(v->a3d[source + (slice * 4)]);
- //a3dsrc_t *a3dsrc = &(v->a3d[source + (slice*4)]);
+ /* a3dsrc_t *a3dsrc = &(v->a3d[source + (slice*4)]); */
a3dsrc->vortex = (void *)v;
a3dsrc->source = source; /* source */
@@ -616,12 +616,12 @@ static void vortex_Vort3D_disable(vortex_t * v)
static void vortex_Vort3D_connect(vortex_t * v, int en)
{
int i;
-
+
// Disable AU8810 routes, since they seem to be wrong (in au8810.h).
#ifdef CHIP_AU8810
return;
#endif
-
+
#if 1
/* Alloc Xtalk mixin resources */
v->mixxtlk[0] =
@@ -642,7 +642,7 @@ static void vortex_Vort3D_connect(vortex_t * v, int en)
/* Connect A3D -> XTALK */
for (i = 0; i < 4; i++) {
- // 2 outputs per each A3D slice.
+ /* 2 outputs per each A3D slice. */
vortex_route(v, en, 0x11, ADB_A3DOUT(i * 2), ADB_XTALKIN(i));
vortex_route(v, en, 0x11, ADB_A3DOUT(i * 2) + 1, ADB_XTALKIN(5 + i));
}
@@ -689,8 +689,8 @@ static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en)
ItdTCDefault, GainTCDefault,
CoefTCDefault);
/* Remark: zero gain is muted. */
- //a3dsrc_SetGainTarget(a,0,0);
- //a3dsrc_SetGainCurrent(a,0,0);
+ /* a3dsrc_SetGainTarget(a,0,0); */
+ /* a3dsrc_SetGainCurrent(a,0,0); */
a3dsrc_EnableA3D(a);
} else {
a3dsrc_DisableA3D(a);
@@ -764,7 +764,7 @@ snd_vortex_a3d_filter_info(struct snd_kcontrol *kcontrol,
static int
snd_vortex_a3d_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- //a3dsrc_t *a = kcontrol->private_data;
+ /* a3dsrc_t *a = kcontrol->private_data; */
/* No read yet. Would this be really useable/needed ? */
return 0;
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index b070e57..9009d38 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -16,7 +16,7 @@
/*
Vortex core low level functions.
-
+
Author: Manuel Jander (mjander(a)users.sourceforge.cl)
These functions are mainly the result of translations made
from the original disassembly of the au88x0 binary drivers,
@@ -73,7 +73,7 @@
06-06-2003 Buffer shifter bugfix. Mixer volume fix.
07-12-2003 A3D routing finally fixed. Believed to be OK.
25-03-2004 Many thanks to Claudia, for such valuable bug reports.
-
+
*/
#include "au88x0.h"
@@ -112,7 +112,7 @@ static int vortex_mix_getvolume(vortex_t * vortex, unsigned char mix)
{
int a;
a = hwread(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2)) & 0xff;
- //FP2LinearFrac(a);
+ /* FP2LinearFrac(a); */
return (a);
}
@@ -144,7 +144,7 @@ static void vortex_mix_rampvolume(vortex_t * vortex, int mix)
{
int ch;
char a;
- // This function is intended for ramping down only (see vortex_disableinput()).
+ /* This function is intended for ramping down only (see vortex_disableinput()). */
for (ch = 0; ch < 0x20; ch++) {
if (((1 << ch) & rampchs[mix]) == 0)
continue;
@@ -260,8 +260,8 @@ vortex_mix_disableinput(vortex_t * vortex, unsigned char mix, int channel,
{
if (ramp) {
rampchs[mix] |= (1 << channel);
- // Register callback.
- //vortex_mix_startrampvolume(vortex);
+ /* Register callback. */
+ /* vortex_mix_startrampvolume(vortex); */
vortex_mix_killinput(vortex, mix, channel);
} else
vortex_mix_killinput(vortex, mix, channel);
@@ -283,7 +283,7 @@ vortex_mixer_addWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
while (temp & 0x10) {
prev = VORTEX_MIXER_RTBASE + ((temp & 0xf) << 2);
temp = hwread(vortex->mmio, prev);
- //printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp);
+ /* printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp); */
if ((++lifeboat) > 0xf) {
printk(KERN_ERR
"vortex_mixer_addWTD: lifeboat overflow\n");
@@ -299,7 +299,7 @@ static int
vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
{
int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0;
- //int esp1f=edi(while)=src, esp10=ch;
+ /* int esp1f=edi(while)=src, esp10=ch; */
eax = hwread(vortex->mmio, VORTEX_MIXER_SR);
if (((1 << ch) & eax) == 0) {
@@ -313,15 +313,15 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
if (mix == ebx) {
ebx = VORTEX_MIXER_RTBASE + (mix << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio, ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
} else {
- //7ad3
+ /* 7ad3 */
edx =
hwread(vortex->mmio,
VORTEX_MIXER_RTBASE + (ebx << 2));
- //printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src);
+ /* printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); */
while ((edx & 0xf) != mix) {
if ((esi) > 0xf) {
printk(KERN_ERR
@@ -334,21 +334,21 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
edx =
hwread(vortex->mmio,
VORTEX_MIXER_RTBASE + ebp);
- //printk(KERN_INFO "vortex: mixdelWTD: while addr=%x, val=%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex: mixdelWTD: while addr=%x, val=%x\n", ebp, edx); */
esi++;
}
- //7b30
+ /* 7b30 */
ebp = ebx << 2;
if (edx & 0x10) { /* Delete entry in between others */
ebx = VORTEX_MIXER_RTBASE + ((edx & 0xf) << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio,
VORTEX_MIXER_RTBASE + ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
- //printk(KERN_INFO "vortex mixdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex mixdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx); */
} else { /* Delete last entry */
- //7b83
+ /* 7b83 */
if (esp14 == -1)
hwwrite(vortex->mmio,
VORTEX_MIXER_CHNBASE +
@@ -358,7 +358,7 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
hwwrite(vortex->mmio,
VORTEX_MIXER_RTBASE +
(esp14 << 2), ebx);
- //printk(KERN_INFO "vortex mixdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx);
+ /* printk(KERN_INFO "vortex mixdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx); */
}
hwwrite(vortex->mmio,
VORTEX_MIXER_RTBASE + ebp, 0);
@@ -366,8 +366,8 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
}
}
} else {
- //printk(KERN_INFO "removed last mix\n");
- //7be0
+ /* printk(KERN_INFO "removed last mix\n"); */
+ /* 7be0 */
vortex_mixer_dis_sr(vortex, ch);
hwwrite(vortex->mmio, ebp, 0);
}
@@ -379,7 +379,7 @@ static void vortex_mixer_init(vortex_t * vortex)
u32 addr;
int x;
- // FIXME: get rid of this crap.
+ /* FIXME: get rid of this crap. */
memset(mchannels, 0, NR_MIXOUT * sizeof(int));
memset(rampchs, 0, NR_MIXOUT * sizeof(int));
@@ -572,12 +572,12 @@ static void vortex_src_setupchannel(vortex_t * card, unsigned char src,
unsigned int cr, unsigned int b, int sweep, int d,
int dirplay, int sl, unsigned int tr, int thsource)
{
- // noplayback: d=2,4,7,0xa,0xb when using first 2 src's.
- // c: enables pitch sweep.
- // looks like g is c related. Maybe g is a sweep parameter ?
- // g = cvr
- // dirplay: 0 = recording, 1 = playback
- // d = src hw index.
+ /* noplayback: d=2,4,7,0xa,0xb when using first 2 src's. */
+ /* c: enables pitch sweep. */
+ /* looks like g is c related. Maybe g is a sweep parameter ? */
+ /* g = cvr */
+ /* dirplay: 0 = recording, 1 = playback */
+ /* d = src hw index. */
int esi, ebp = 0, esp10;
@@ -634,7 +634,7 @@ static void vortex_src_setupchannel(vortex_t * card, unsigned char src,
hwwrite(card->mmio, VORTEX_SRC_U2 + (src << 2),
(tr << 0x11) | (dirplay << 0x10) | (ebp << 0x8) | esp10);
/* 0x30f00 e=g=1 esp10=0 ebp=f */
- //printk(KERN_INFO "vortex: SRC %d, d=0x%x, esi=0x%x, esp10=0x%x, ebp=0x%x\n", src, d, esi, esp10, ebp);
+ /* printk(KERN_INFO "vortex: SRC %d, d=0x%x, esi=0x%x, esp10=0x%x, ebp=0x%x\n", src, d, esi, esp10, ebp); */
}
static void vortex_srcblock_init(vortex_t * vortex)
@@ -647,15 +647,15 @@ static void vortex_srcblock_init(vortex_t * vortex)
vortex_src_init(&vortex_src[x], x);
}
*/
- //addr = 0xcc3c;
- //addr = 0x26c3c;
+ /* addr = 0xcc3c; */
+ /* addr = 0x26c3c; */
addr = VORTEX_SRC_RTBASE + 0x3c;
for (x = 0xf; x >= 0; x--) {
hwwrite(vortex->mmio, addr, 0);
addr -= 4;
}
- //addr = 0xcc94;
- //addr = 0x26c94;
+ /* addr = 0xcc94; */
+ /* addr = 0x26c94; */
addr = VORTEX_SRC_CHNBASE + 0x54;
for (x = 0x15; x >= 0; x--) {
hwwrite(vortex->mmio, addr, 0);
@@ -667,7 +667,7 @@ static int
vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
{
int temp, lifeboat = 0, prev;
- // esp13 = src
+ /* esp13 = src */
temp = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR);
if ((temp & (1 << ch)) == 0) {
@@ -677,12 +677,12 @@ vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
}
prev = VORTEX_SRC_CHNBASE + (ch << 2); /*ebp */
temp = hwread(vortex->mmio, prev);
- //while (temp & NR_SRC) {
+ /* while (temp & NR_SRC) { */
while (temp & 0x10) {
prev = VORTEX_SRC_RTBASE + ((temp & 0xf) << 2); /*esp12 */
- //prev = VORTEX_SRC_RTBASE + ((temp & (NR_SRC-1)) << 2); /*esp12*/
+ /* prev = VORTEX_SRC_RTBASE + ((temp & (NR_SRC-1)) << 2); esp12 */
temp = hwread(vortex->mmio, prev);
- //printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp);
+ /* printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp); */
if ((++lifeboat) > 0xf) {
printk(KERN_ERR
"vortex_src_addWTD: lifeboat overflow\n");
@@ -690,7 +690,7 @@ vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
}
}
hwwrite(vortex->mmio, VORTEX_SRC_RTBASE + ((temp & 0xf) << 2), src);
- //hwwrite(vortex->mmio, prev, (temp & (NR_SRC-1)) | NR_SRC);
+ /* hwwrite(vortex->mmio, prev, (temp & (NR_SRC-1)) | NR_SRC); */
hwwrite(vortex->mmio, prev, (temp & 0xf) | 0x10);
return 1;
}
@@ -699,7 +699,7 @@ static int
vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
{
int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0;
- //int esp1f=edi(while)=src, esp10=ch;
+ /* int esp1f=edi(while)=src, esp10=ch; */
eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR);
if (((1 << ch) & eax) == 0) {
@@ -713,15 +713,15 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
if (src == ebx) {
ebx = VORTEX_SRC_RTBASE + (src << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio, ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
} else {
- //7ad3
+ /* 7ad3 */
edx =
hwread(vortex->mmio,
VORTEX_SRC_RTBASE + (ebx << 2));
- //printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src);
+ /* printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); */
while ((edx & 0xf) != src) {
if ((esi) > 0xf) {
printk
@@ -734,21 +734,21 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
edx =
hwread(vortex->mmio,
VORTEX_SRC_RTBASE + ebp);
- //printk(KERN_INFO "vortex: srcdelWTD: while addr=%x, val=%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex: srcdelWTD: while addr=%x, val=%x\n", ebp, edx); */
esi++;
}
- //7b30
+ /* 7b30 */
ebp = ebx << 2;
if (edx & 0x10) { /* Delete entry in between others */
ebx = VORTEX_SRC_RTBASE + ((edx & 0xf) << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio,
VORTEX_SRC_RTBASE + ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
- //printk(KERN_INFO "vortex srcdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex srcdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx); */
} else { /* Delete last entry */
- //7b83
+ /* 7b83 */
if (esp14 == -1)
hwwrite(vortex->mmio,
VORTEX_SRC_CHNBASE +
@@ -758,7 +758,7 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
hwwrite(vortex->mmio,
VORTEX_SRC_RTBASE +
(esp14 << 2), ebx);
- //printk(KERN_INFO"vortex srcdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx);
+ /* printk(KERN_INFO"vortex srcdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx); */
}
hwwrite(vortex->mmio,
VORTEX_SRC_RTBASE + ebp, 0);
@@ -766,14 +766,14 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
}
}
} else {
- //7be0
+ /* 7be0 */
vortex_src_dis_sr(vortex, ch);
hwwrite(vortex->mmio, ebp, 0);
}
return 1;
}
- /*FIFO*/
+ /*FIFO*/
static void
vortex_fifo_clearadbdata(vortex_t * vortex, int fifo, int x)
@@ -809,7 +809,7 @@ vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority,
int empty, int valid, int f)
{
int temp, lifeboat = 0;
- //int this_8[NR_ADB] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* position */
+ /* int this_8[NR_ADB] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; position */
int this_4 = 0x2;
/* f seems priority related.
* CAsp4AdbDma::SetPriority is the only place that calls SetAdbCtrl with f set to 1
@@ -826,12 +826,12 @@ vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority,
}
while (temp & FIFO_RDONLY);
- // AU8830 semes to take some special care about fifo content (data).
- // But i'm just to lazy to translate that :)
+ /* AU8830 semes to take some special care about fifo content (data). */
+ /* But i'm just to lazy to translate that :) */
if (valid) {
if ((temp & FIFO_VALID) == 0) {
- //this_8[fifo] = 0;
- vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE); // this_4
+ /* this_8[fifo] = 0; */
+ vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE); /* this_4 */
#ifdef CHIP_AU8820
temp = (this_4 & 0x1f) << 0xb;
#else
@@ -923,7 +923,7 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
if (valid) {
if ((temp & FIFO_VALID) == 0) {
- vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); // this_4
+ vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); /* this_4 */
#ifdef CHIP_AU8820
temp = (this_4 & 0x1f) << 0xb;
#else
@@ -966,7 +966,7 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp);
hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
-/*
+/*
do {
temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
if (lifeboat++ > 0xbb8) {
@@ -974,8 +974,8 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
break;
}
} while ((temp & FIFO_RDONLY)&&(temp & FIFO_VALID)&&(temp != 0xFFFFFFFF));
-
-
+
+
if (valid) {
if (temp & FIFO_VALID) {
temp = 0x40000;
@@ -1001,8 +1001,8 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
temp |= 0x00400000;
hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp);
temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
- //((temp >> 6) & 0x3f)
-
+ //((temp >> 6) & 0x3f)
+
priority = 0;
if (((temp & 0x0fc0) ^ ((temp >> 6) & 0x0fc0)) & 0FFFFFFC0)
vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE);
@@ -1014,7 +1014,7 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
temp = (temp & 0xffffffdf) | ((empty & 1) << 5);
hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp);
}
-
+
*/
/*
@@ -1062,7 +1062,7 @@ static void vortex_fifo_init(vortex_t * vortex)
#endif
/* trigger... */
#ifdef CHIP_AU8820
- hwwrite(vortex->mmio, 0xf8c0, 0xd03); //0x0843 0xd6b
+ hwwrite(vortex->mmio, 0xf8c0, 0xd03); /* 0x0843 0xd6b */
#else
#ifdef CHIP_AU8830
hwwrite(vortex->mmio, 0x17000, 0x61); /* wt a */
@@ -1089,7 +1089,7 @@ static void vortex_adbdma_setfirstbuffer(vortex_t * vortex, int adbdma)
static void vortex_adbdma_setstartbuffer(vortex_t * vortex, int adbdma, int sb)
{
stream_t *dma = &vortex->dma_adb[adbdma];
- //hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), sb << (((NR_ADB-1)-((adbdma&0xf)*2))));
+ /* hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), sb << (((NR_ADB-1)-((adbdma&0xf)*2)))); */
hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2),
sb << ((0xf - (adbdma & 0xf)) * 2));
dma->period_real = dma->period_virt = sb;
@@ -1135,7 +1135,7 @@ vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma,
snd_pcm_sgbuf_get_addr(dma->substream, 0));
break;
}
- //printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1);
+ /* printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1); */
hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0);
hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1);
@@ -1195,7 +1195,7 @@ static int vortex_adbdma_bufshift(vortex_t * vortex, int adbdma)
pp = dma->period_real + i;
if (pp >= 4)
pp -= 4;
- //hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr);
+ /* hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr); */
hwwrite(vortex->mmio,
VORTEX_ADBDMA_BUFBASE + (((adbdma << 2) + pp) << 2),
snd_pcm_sgbuf_get_addr(dma->substream,
@@ -1222,7 +1222,7 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) {
int p, pp, i;
/* refresh hw page table */
- for (i=0 ; i < 4 && i < dma->nr_periods; i++) {
+ for (i = 0; i < 4 && i < dma->nr_periods; i++) {
/* p: audio buffer page index */
p = dma->period_virt + i;
if (p >= dma->nr_periods)
@@ -1258,7 +1258,7 @@ static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma)
{
- int this_8 = 0 /*empty */ , this_4 = 0 /*priority */ ;
+ int this_8 = 0, /*empty */ this_4 = 0; /*priority */
stream_t *dma = &vortex->dma_adb[adbdma];
switch (dma->fifo_status) {
@@ -1325,7 +1325,7 @@ static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma)
dma->fifo_status = FIFO_PAUSE;
}
-#if 0 // Using pause instead
+#if 0 /* Using pause instead */
static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma)
{
stream_t *dma = &vortex->dma_adb[adbdma];
@@ -1346,7 +1346,7 @@ static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma)
#ifndef CHIP_AU8810
static void vortex_wtdma_setfirstbuffer(vortex_t * vortex, int wtdma)
{
- //int this_7c=dma_ctrl;
+ /* int this_7c=dma_ctrl; */
stream_t *dma = &vortex->dma_wt[wtdma];
hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl);
@@ -1355,7 +1355,7 @@ static void vortex_wtdma_setfirstbuffer(vortex_t * vortex, int wtdma)
static void vortex_wtdma_setstartbuffer(vortex_t * vortex, int wtdma, int sb)
{
stream_t *dma = &vortex->dma_wt[wtdma];
- //hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), sb << ((0x1f-(wtdma&0xf)*2)));
+ /* hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), sb << ((0x1f-(wtdma&0xf)*2))); */
hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2),
sb << ((0xf - (wtdma & 0xf)) * 2));
dma->period_real = dma->period_virt = sb;
@@ -1410,7 +1410,7 @@ vortex_wtdma_setmode(vortex_t * vortex, int wtdma, int ie, int fmt, int d,
{
stream_t *dma = &vortex->dma_wt[wtdma];
- //dma->this_08 = e;
+ /* dma->this_08 = e; */
dma->dma_unknown = d;
dma->dma_ctrl = 0;
dma->dma_ctrl =
@@ -1501,7 +1501,7 @@ static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
int temp;
temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2));
- //temp = (temp & POS_MASK) + (((temp>>WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK)*(dma->cfg0&POS_MASK));
+ /* temp = (temp & POS_MASK) + (((temp>>WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK)*(dma->cfg0&POS_MASK)); */
temp = (temp & POS_MASK) + ((dma->period_virt) * (dma->period_bytes));
return temp;
}
@@ -1846,7 +1846,7 @@ vortex_connection_mixin_mix(vortex_t * vortex, int en, unsigned char mixin,
{
if (en) {
vortex_mix_enableinput(vortex, mix, mixin);
- vortex_mix_setinputvolumebyte(vortex, mix, mixin, MIX_DEFIGAIN); // added to original code.
+ vortex_mix_setinputvolumebyte(vortex, mix, mixin, MIX_DEFIGAIN); /* added to original code. */
} else
vortex_mix_disableinput(vortex, mix, mixin, a);
}
@@ -1883,7 +1883,7 @@ vortex_connection_mix_adb(vortex_t * vortex, int en, unsigned char ch,
unsigned char mix, unsigned char dest)
{
vortex_route(vortex, en, ch, ADB_MIXOUT(mix), dest);
- vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); // added to original code.
+ vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); /* added to original code. */
}
// mixer to src.
@@ -1892,7 +1892,7 @@ vortex_connection_mix_src(vortex_t * vortex, int en, unsigned char ch,
unsigned char mix, unsigned char src)
{
vortex_route(vortex, en, ch, ADB_MIXOUT(mix), ADB_SRCIN(src));
- vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); // added to original code.
+ vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); /* added to original code. */
}
#if 0
@@ -1943,7 +1943,7 @@ vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[])
vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_CODECOUT(1));
#else
#if 1
- // Connect front channels through EQ.
+ /* Connect front channels through EQ. */
vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_EQIN(0));
vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_EQIN(1));
/* Lower volume, since EQ has some gain. */
@@ -1959,10 +1959,10 @@ vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[])
ADB_CODECOUT(0 + 4));
vortex_connection_mix_adb(vortex, en, 0x11, mixers[3],
ADB_CODECOUT(1 + 4));
- //printk("SDAC detected ");
+ /* printk("SDAC detected "); */
}
#else
- // Use plain direct output to codec.
+ /* Use plain direct output to codec. */
vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_CODECOUT(0));
vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_CODECOUT(1));
#endif
@@ -1989,7 +1989,7 @@ vortex_connect_codecrec(vortex_t * vortex, int en, unsigned char mixin0,
static int resnum[VORTEX_RESOURCE_LAST] =
{ NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D };
/*
- Checkout/Checkin resource of given type.
+ Checkout/Checkin resource of given type.
resmap: resource map to be used. If NULL means that we want to allocate
a DMA resource (root of all other resources of a dma channel).
out: Mean checkout if != 0. Else mean Checkin resource.
@@ -2013,7 +2013,7 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
resmap[restype] |= (1 << i);
else
vortex->dma_adb[i].resources[restype] |= (1 << i);
- //printk("vortex: ResManager: type %d out %d\n", restype, i);
+ /* printk("vortex: ResManager: type %d out %d\n", restype, i); */
return i;
}
}
@@ -2024,7 +2024,7 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
for (i = 0; i < qty; i++) {
if (resmap[restype] & (1 << i)) {
resmap[restype] &= ~(1 << i);
- //printk("vortex: ResManager: type %d in %d\n",restype, i);
+ /* printk("vortex: ResManager: type %d in %d\n",restype, i); */
return i;
}
}
@@ -2039,7 +2039,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type);
static void vortex_connect_default(vortex_t * vortex, int en)
{
- // Connect AC97 codec.
+ /* Connect AC97 codec. */
vortex->mixplayb[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
VORTEX_RESOURCE_MIXOUT);
vortex->mixplayb[1] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
@@ -2058,7 +2058,7 @@ static void vortex_connect_default(vortex_t * vortex, int en)
VORTEX_RESOURCE_MIXIN);
vortex_connect_codecrec(vortex, en, MIX_CAPT(0), MIX_CAPT(1));
- // Connect SPDIF
+ /* Connect SPDIF */
#ifndef CHIP_AU8820
vortex->mixspdif[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
VORTEX_RESOURCE_MIXOUT);
@@ -2069,20 +2069,20 @@ static void vortex_connect_default(vortex_t * vortex, int en)
vortex_connection_mix_adb(vortex, en, 0x14, vortex->mixspdif[1],
ADB_SPDIFOUT(1));
#endif
- // Connect WT
+ /* Connect WT */
#ifndef CHIP_AU8810
vortex_wt_connect(vortex, en);
#endif
- // A3D (crosstalk canceler and A3D slices). AU8810 disabled for now.
+ /* A3D (crosstalk canceler and A3D slices). AU8810 disabled for now. */
#ifndef CHIP_AU8820
vortex_Vort3D_connect(vortex, en);
#endif
- // Connect I2S
+ /* Connect I2S */
+
+ /* Connect DSP interface for SQ3500 turbo (not here i think...) */
- // Connect DSP interface for SQ3500 turbo (not here i think...)
+ /* Connect AC98 modem codec */
- // Connect AC98 modem codec
-
}
/*
@@ -2099,7 +2099,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
{
stream_t *stream;
int i, en;
-
+
if ((nr_ch == 3)
|| ((dir == SNDRV_PCM_STREAM_CAPTURE) && (nr_ch > 2)))
return -EBUSY;
@@ -2203,13 +2203,13 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
#ifndef CHIP_AU8820
if (stream->type == VORTEX_PCM_A3D) {
vortex_connection_adbdma_src(vortex, en,
- src[nr_ch - 1],
+ src[nr_ch - 1],
dma,
src[i]);
vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_A3DIN(a3d));
/* XTalk test. */
- //vortex_route(vortex, en, 0x11, dma, ADB_XTALKIN(i?9:4));
- //vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_XTALKIN(i?4:9));
+ /* vortex_route(vortex, en, 0x11, dma, ADB_XTALKIN(i?9:4)); */
+ /* vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_XTALKIN(i?4:9)); */
}
if (stream->type == VORTEX_PCM_SPDIF)
vortex_route(vortex, en, 0x14,
@@ -2331,7 +2331,7 @@ vortex_adb_setsrc(vortex_t * vortex, int adbdma, unsigned int rate, int dir)
stream_t *stream = &(vortex->dma_adb[adbdma]);
int i, cvrt;
- /* dir=1:play ; dir=0:rec */
+ /* dir=1:play; dir=0:rec */
if (dir)
cvrt = SRC_RATIO(rate, 48000);
else
@@ -2348,7 +2348,7 @@ vortex_adb_setsrc(vortex_t * vortex, int adbdma, unsigned int rate, int dir)
static void vortex_settimer(vortex_t * vortex, int period)
{
- //set the timer period to <period> 48000ths of a second.
+ /* set the timer period to <period> 48000ths of a second. */
hwwrite(vortex->mmio, VORTEX_IRQ_STAT, period);
}
@@ -2368,7 +2368,7 @@ static void vortex_disable_timer_int(vortex_t * card)
#endif
static void vortex_enable_int(vortex_t * card)
{
- // CAsp4ISR__EnableVortexInt_void_
+ /* CAsp4ISR__EnableVortexInt_void_ */
hwwrite(card->mmio, VORTEX_CTRL,
hwread(card->mmio, VORTEX_CTRL) | CTRL_IRQ_ENABLE);
hwwrite(card->mmio, VORTEX_IRQ_CTRL,
@@ -2387,26 +2387,26 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
int i, handled;
u32 source;
- //check if the interrupt is ours.
+ /* check if the interrupt is ours. */
if (!(hwread(vortex->mmio, VORTEX_STAT) & 0x1))
return IRQ_NONE;
- // This is the Interrupt Enable flag we set before (consistency check).
+ /* This is the Interrupt Enable flag we set before (consistency check). */
if (!(hwread(vortex->mmio, VORTEX_CTRL) & CTRL_IRQ_ENABLE))
return IRQ_NONE;
source = hwread(vortex->mmio, VORTEX_IRQ_SOURCE);
- // Reset IRQ flags.
+ /* Reset IRQ flags. */
hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, source);
hwread(vortex->mmio, VORTEX_IRQ_SOURCE);
- // Is at least one IRQ flag set?
+ /* Is at least one IRQ flag set? */
if (source == 0) {
printk(KERN_ERR "vortex: missing irq source\n");
return IRQ_NONE;
}
handled = 0;
- // Attend every interrupt source.
+ /* Attend every interrupt source. */
if (unlikely(source & IRQ_ERR_MASK)) {
if (source & IRQ_FATAL) {
printk(KERN_ERR "vortex: IRQ fatal error\n");
@@ -2430,7 +2430,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
spin_lock(&vortex->lock);
for (i = 0; i < NR_ADB; i++) {
if (vortex->dma_adb[i].fifo_status == FIFO_START) {
- if (vortex_adbdma_bufshift(vortex, i)) ;
+ if (vortex_adbdma_bufshift(vortex, i));
spin_unlock(&vortex->lock);
snd_pcm_period_elapsed(vortex->dma_adb[i].
substream);
@@ -2440,7 +2440,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
#ifndef CHIP_AU8810
for (i = 0; i < NR_WT; i++) {
if (vortex->dma_wt[i].fifo_status == FIFO_START) {
- if (vortex_wtdma_bufshift(vortex, i)) ;
+ if (vortex_wtdma_bufshift(vortex, i));
spin_unlock(&vortex->lock);
snd_pcm_period_elapsed(vortex->dma_wt[i].
substream);
@@ -2451,7 +2451,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
spin_unlock(&vortex->lock);
handled = 1;
}
- //Acknowledge the Timer interrupt
+ /* Acknowledge the Timer interrupt */
if (source & IRQ_TIMER) {
hwread(vortex->mmio, VORTEX_IRQ_STAT);
handled = 1;
@@ -2510,7 +2510,7 @@ static void vortex_codec_init(vortex_t * vortex)
}
static void
-vortex_codec_write(struct snd_ac97 * codec, unsigned short addr, unsigned short data)
+vortex_codec_write(struct snd_ac97 *codec, unsigned short addr, unsigned short data)
{
vortex_t *card = (vortex_t *) codec->private_data;
@@ -2529,13 +2529,13 @@ vortex_codec_write(struct snd_ac97 * codec, unsigned short addr, unsigned short
((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
((data << VORTEX_CODEC_DATSHIFT) & VORTEX_CODEC_DATMASK) |
VORTEX_CODEC_WRITE |
- (codec->num << VORTEX_CODEC_ID_SHIFT) );
+ (codec->num << VORTEX_CODEC_ID_SHIFT));
/* Flush Caches. */
hwread(card->mmio, VORTEX_CODEC_IO);
}
-static unsigned short vortex_codec_read(struct snd_ac97 * codec, unsigned short addr)
+static unsigned short vortex_codec_read(struct snd_ac97 *codec, unsigned short addr)
{
vortex_t *card = (vortex_t *) codec->private_data;
@@ -2552,7 +2552,7 @@ static unsigned short vortex_codec_read(struct snd_ac97 * codec, unsigned short
}
/* set up read address */
read_addr = ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
- (codec->num << VORTEX_CODEC_ID_SHIFT) ;
+ (codec->num << VORTEX_CODEC_ID_SHIFT);
hwwrite(card->mmio, VORTEX_CODEC_IO, read_addr);
/* wait for address */
@@ -2579,10 +2579,10 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
/* CAsp4Spdif::InitializeSpdifHardware(void) */
hwwrite(vortex->mmio, VORTEX_SPDIF_FLAGS,
hwread(vortex->mmio, VORTEX_SPDIF_FLAGS) & 0xfff3fffd);
- //for (i=0x291D4; i<0x29200; i+=4)
+ /* for (i = 0x291D4; i < 0x29200; i += 4) */
for (i = 0; i < 11; i++)
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1 + (i << 2), 0);
- //hwwrite(vortex->mmio, 0x29190, hwread(vortex->mmio, 0x29190) | 0xc0000);
+ /* hwwrite(vortex->mmio, 0x29190, hwread(vortex->mmio, 0x29190) | 0xc0000); */
hwwrite(vortex->mmio, VORTEX_CODEC_EN,
hwread(vortex->mmio, VORTEX_CODEC_EN) | EN_SPDIF);
@@ -2644,8 +2644,8 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
break;
}
- /* looks like the next 2 lines transfer a 16-bit value into 2 8-bit
- registers. seems to be for the standard IEC/SPDIF initialization
+ /* looks like the next 2 lines transfer a 16-bit value into 2 8-bit
+ registers. seems to be for the standard IEC/SPDIF initialization
stuff */
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG0, this_38 & 0xffff);
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1, this_38 >> 0x10);
@@ -2677,7 +2677,7 @@ static int __devinit vortex_core_init(vortex_t * vortex)
/* Init audio engine. */
vortex_adbdma_init(vortex);
- hwwrite(vortex->mmio, VORTEX_ENGINE_CTRL, 0x0); //, 0xc83c7e58, 0xc5f93e58
+ hwwrite(vortex->mmio, VORTEX_ENGINE_CTRL, 0x0); /*, 0xc83c7e58, 0xc5f93e58 */
vortex_adb_init(vortex);
/* Init processing blocks. */
vortex_fifo_init(vortex);
@@ -2691,16 +2691,16 @@ static int __devinit vortex_core_init(vortex_t * vortex)
#ifndef CHIP_AU8810
vortex_wt_init(vortex);
#endif
- // Moved to au88x0.c
- //vortex_connect_default(vortex, 1);
+ /* Moved to au88x0.c */
+ /* vortex_connect_default(vortex, 1); */
vortex_settimer(vortex, 0x90);
- // Enable Interrupts.
- // vortex_enable_int() must be first !!
- // hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0);
- // vortex_enable_int(vortex);
- //vortex_enable_timer_int(vortex);
- //vortex_disable_timer_int(vortex);
+ /* Enable Interrupts. */
+ /* vortex_enable_int() must be first !! */
+ /* hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0); */
+ /* vortex_enable_int(vortex); */
+ /* vortex_enable_timer_int(vortex); */
+ /* vortex_disable_timer_int(vortex); */
printk(KERN_INFO "done.\n");
spin_lock_init(&vortex->lock);
@@ -2716,7 +2716,7 @@ static int vortex_core_shutdown(vortex_t * vortex)
vortex_eq_free(vortex);
vortex_Vort3D_disable(vortex);
#endif
- //vortex_disable_timer_int(vortex);
+ /* vortex_disable_timer_int(vortex); */
vortex_disable_int(vortex);
vortex_connect_default(vortex, 0);
/* Reset all DMA fifos. */
@@ -2725,8 +2725,8 @@ static int vortex_core_shutdown(vortex_t * vortex)
vortex_adb_init(vortex);
/* Disable MPU401 */
- //hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) & ~IRQ_MIDI);
- //hwwrite(vortex->mmio, VORTEX_CTRL, hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_EN);
+ /* hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) & ~IRQ_MIDI); */
+ /* hwwrite(vortex->mmio, VORTEX_CTRL, hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_EN); */
hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0);
hwwrite(vortex->mmio, VORTEX_CTRL, 0);
@@ -2795,17 +2795,17 @@ vortex_translateformat(vortex_t * vortex, char bits, char nch, int encod)
switch (encod) {
case 0:
if (bits == 0x10)
- a = 8; // 16 bit
+ a = 8; /* 16 bit */
break;
case 1:
if (bits == 8)
- a = 1; // 8 bit
+ a = 1; /* 8 bit */
break;
case 2:
- a = 2; // U_LAW
+ a = 2; /* U_LAW */
break;
case 3:
- a = 3; // A_LAW
+ a = 3; /* A_LAW */
break;
}
switch (nch) {
diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c
index 38602b8..5b911b9 100644
--- a/sound/pci/au88x0/au88x0_eq.c
+++ b/sound/pci/au88x0/au88x0_eq.c
@@ -4,7 +4,7 @@
*
* Sun Jun 8 18:19:19 2003
* 2003 Manuel Jander (mjander(a)users.sourceforge.net)
- *
+ *
* 02 July 2003: First time something works :)
* November 2003: A3D Bypass code completed but untested.
*
@@ -32,7 +32,7 @@
/*
The Aureal Hardware EQ is found on AU8810 and AU8830 chips only.
- it has 4 inputs (2 for general mix, 2 for A3D) and 2 outputs (supposed
+ it has 4 inputs (2 for general mix, 2 for A3D) and 2 outputs (supposed
to be routed to the codec).
*/
@@ -444,9 +444,9 @@ static void vortex_EqHw_ZeroState(vortex_t * vortex)
vortex_EqHw_SetRightGainsTarget(vortex, eq_gains_zero);
vortex_EqHw_SetBypassGain(vortex, 0, 0);
- //vortex_EqHw_SetCurrBypassGain(vortex, 0, 0);
+ /* vortex_EqHw_SetCurrBypassGain(vortex, 0, 0); */
vortex_EqHw_SetA3DBypassGain(vortex, 0, 0);
- //vortex_EqHw_SetCurrA3DBypassGain(vortex, 0, 0);
+ /* vortex_EqHw_SetCurrA3DBypassGain(vortex, 0, 0); */
vortex_EqHw_SetLeftStates(vortex, eq_states_zero, asEqOutStateZeros);
vortex_EqHw_SetRightStates(vortex, eq_states_zero, asEqOutStateZeros);
vortex_EqHw_SetLevels(vortex, (u16 *) eq_levels);
@@ -570,7 +570,7 @@ vortex_Eqlzr_GetAllBands(vortex_t * vortex, u16 * gains, s32 *cnt)
return 1;
si++;
}
- while (eq->this10 > si) ;
+ while (eq->this10 > si);
*cnt = si * 2;
return 0;
}
@@ -597,7 +597,7 @@ vortex_Eqlzr_SetAllBands(vortex_t * vortex, u16 gains[], s32 count)
for (i = 0; i < count; i++) {
eq->this130[i] = gains[i];
}
-
+
if (eq->this54)
return 0;
return vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);
@@ -643,7 +643,7 @@ static void vortex_Eqlzr_ShutDownA3d(vortex_t * vortex)
static void vortex_Eqlzr_SetBypass(vortex_t * vortex, u32 bp)
{
eqlzr_t *eq = &(vortex->eq);
-
+
if ((eq->this28) && (bp == 0)) {
/* EQ enabled */
vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);
@@ -691,7 +691,7 @@ static void vortex_Eqlzr_init(vortex_t * vortex)
eqlzr_t *eq = &(vortex->eq);
/* Object constructor */
- //eq->this04 = 0;
+ /* eq->this04 = 0; */
eq->this08 = 0; /* Bypass gain with EQ in use. */
eq->this0a = 0x5999;
eq->this0c = 0x5999; /* Bypass gain with EQ disabled. */
@@ -736,7 +736,7 @@ snd_vortex_eqtoggle_get(struct snd_kcontrol *kcontrol,
{
vortex_t *vortex = snd_kcontrol_chip(kcontrol);
eqlzr_t *eq = &(vortex->eq);
- //int i = kcontrol->private_value;
+ /* int i = kcontrol->private_value; */
ucontrol->value.integer.value[0] = eq->this54 ? 0 : 1;
@@ -749,7 +749,7 @@ snd_vortex_eqtoggle_put(struct snd_kcontrol *kcontrol,
{
vortex_t *vortex = snd_kcontrol_chip(kcontrol);
eqlzr_t *eq = &(vortex->eq);
- //int i = kcontrol->private_value;
+ /* int i = kcontrol->private_value; */
eq->this54 = ucontrol->value.integer.value[0] ? 0 : 1;
vortex_Eqlzr_SetBypass(vortex, eq->this54);
@@ -900,7 +900,7 @@ static int __devinit vortex_eq_init(vortex_t * vortex)
kcontrol->private_value = i;
if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0)
return err;
- //vortex->eqctrl[i] = kcontrol;
+ /* vortex->eqctrl[i] = kcontrol; */
}
/* EQ band levels */
if ((kcontrol = snd_ctl_new1(&vortex_levels_kcontrol, vortex)) == NULL)
@@ -916,7 +916,7 @@ static int vortex_eq_free(vortex_t * vortex)
/*
//FIXME: segfault because vortex->eqctrl[i] == 4
int i;
- for (i=0; i<10; i++) {
+ for (i = 0; i < 10; i++) {
if (vortex->eqctrl[i])
snd_ctl_remove(vortex->card, vortex->eqctrl[i]);
}
diff --git a/sound/pci/au88x0/au88x0_mixer.c b/sound/pci/au88x0/au88x0_mixer.c
index c92f493..cd3daf8 100644
--- a/sound/pci/au88x0/au88x0_mixer.c
+++ b/sound/pci/au88x0/au88x0_mixer.c
@@ -23,7 +23,7 @@ static int __devinit snd_vortex_mixer(vortex_t * vortex)
if ((err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus)) < 0)
return err;
memset(&ac97, 0, sizeof(ac97));
- // Intialize AC97 codec stuff.
+ /* Intialize AC97 codec stuff. */
ac97.private_data = vortex;
ac97.scaps = AC97_SCAP_NO_SPDIF;
err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
diff --git a/sound/pci/au88x0/au88x0_mpu401.c b/sound/pci/au88x0/au88x0_mpu401.c
index 0dc8d25..4d9154f 100644
--- a/sound/pci/au88x0/au88x0_mpu401.c
+++ b/sound/pci/au88x0/au88x0_mpu401.c
@@ -72,7 +72,7 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
/* Check if anything is OK. */
temp = hwread(vortex->mmio, VORTEX_MIDI_DATA);
- if (temp != MPU401_ACK /*0xfe */ ) {
+ if (temp != MPU401_ACK /*0xfe */) {
printk(KERN_ERR "midi port doesn't acknowledge!\n");
return -ENODEV;
}
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index b9d2f20..149769f 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -13,12 +13,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/*
* Vortex PCM ALSA driver.
*
* Supports ADB and WT DMA. Unfortunately, WT channels do not run yet.
- * It remains stuck,and DMA transfers do not happen.
+ * It remains stuck,and DMA transfers do not happen.
*/
#include <sound/asoundef.h>
#include <linux/time.h>
@@ -103,7 +103,7 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
- .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_CONTINUOUS, // SNDRV_PCM_RATE_48000,
+ .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_CONTINUOUS, /* SNDRV_PCM_RATE_48000, */
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
@@ -121,7 +121,7 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
vortex_t *vortex = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
-
+
/* Force equal size periods */
if ((err =
snd_pcm_hw_constraint_integer(runtime,
@@ -170,10 +170,10 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
/* close callback */
static int snd_vortex_pcm_close(struct snd_pcm_substream *substream)
{
- //vortex_t *chip = snd_pcm_substream_chip(substream);
+ /* vortex_t *chip = snd_pcm_substream_chip(substream); */
stream_t *stream = (stream_t *) substream->runtime->private_data;
- // the hardware-specific codes will be here
+ /* the hardware-specific codes will be here */
if (stream != NULL) {
stream->substream = NULL;
stream->nr_ch = 0;
@@ -191,7 +191,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
stream_t *stream = (stream_t *) (substream->runtime->private_data);
int err;
- // Alloc buffer memory.
+ /* Alloc buffer memory. */
err =
snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
if (err < 0) {
@@ -203,7 +203,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
params_period_bytes(hw_params), params_channels(hw_params));
*/
spin_lock_irq(&chip->lock);
- // Make audio routes and config buffer DMA.
+ /* Make audio routes and config buffer DMA. */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
int dma, type = VORTEX_PCM_TYPE(substream->pcm);
/* Dealloc any routes. */
@@ -253,7 +253,7 @@ static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream)
stream_t *stream = (stream_t *) (substream->runtime->private_data);
spin_lock_irq(&chip->lock);
- // Delete audio routes.
+ /* Delete audio routes. */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
if (stream != NULL)
vortex_adb_allocroute(chip, stream->dma,
@@ -280,7 +280,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
stream_t *stream = (stream_t *) substream->runtime->private_data;
int dma = stream->dma, fmt, dir;
- // set up the hardware with the current configuration.
+ /* set up the hardware with the current configuration. */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dir = 1;
else
@@ -297,7 +297,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
#ifndef CHIP_AU8810
else {
vortex_wtdma_setmode(chip, dma, 1, fmt, 0, 0);
- // FIXME: Set rate (i guess using vortex_wt_writereg() somehow).
+ /* FIXME: Set rate (i guess using vortex_wt_writereg() somehow). */
vortex_wtdma_setstartbuffer(chip, dma, 0);
}
#endif
@@ -315,8 +315,8 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
spin_lock(&chip->lock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- // do something to start the PCM engine
- //printk(KERN_INFO "vortex: start %d\n", dma);
+ /* do something to start the PCM engine */
+ /* printk(KERN_INFO "vortex: start %d\n", dma); */
stream->fifo_enabled = 1;
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
vortex_adbdma_resetup(chip, dma);
@@ -330,12 +330,12 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
#endif
break;
case SNDRV_PCM_TRIGGER_STOP:
- // do something to stop the PCM engine
- //printk(KERN_INFO "vortex: stop %d\n", dma);
+ /* do something to stop the PCM engine */
+ /* printk(KERN_INFO "vortex: stop %d\n", dma); */
stream->fifo_enabled = 0;
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
vortex_adbdma_pausefifo(chip, dma);
- //vortex_adbdma_stopfifo(chip, dma);
+ /* vortex_adbdma_stopfifo(chip, dma); */
#ifndef CHIP_AU8810
else {
printk(KERN_INFO "vortex: wt stop %d\n", dma);
@@ -344,7 +344,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
#endif
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- //printk(KERN_INFO "vortex: pause %d\n", dma);
+ /* printk(KERN_INFO "vortex: pause %d\n", dma); */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
vortex_adbdma_pausefifo(chip, dma);
#ifndef CHIP_AU8810
@@ -353,7 +353,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
#endif
break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- //printk(KERN_INFO "vortex: resume %d\n", dma);
+ /* printk(KERN_INFO "vortex: resume %d\n", dma); */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
vortex_adbdma_resumefifo(chip, dma);
#ifndef CHIP_AU8810
@@ -384,7 +384,7 @@ static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substr
else
current_ptr = vortex_wtdma_getlinearpos(chip, dma);
#endif
- //printk(KERN_INFO "vortex: pointer = 0x%x\n", current_ptr);
+ /* printk(KERN_INFO "vortex: pointer = 0x%x\n", current_ptr); */
spin_unlock(&chip->lock);
return (bytes_to_frames(substream->runtime, current_ptr));
}
@@ -498,7 +498,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
if (!chip || idx < 0 || idx >= VORTEX_PCM_LAST)
return -ENODEV;
- /* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the
+ /* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the
* same dma engine. WT uses it own separate dma engine whcih cant capture. */
if (idx == VORTEX_PCM_ADB)
nr_capt = nr;
@@ -510,7 +510,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
return err;
strcpy(pcm->name, vortex_pcm_name[idx]);
chip->pcm[idx] = pcm;
- // This is an evil hack, but it saves a lot of duplicated code.
+ /* This is an evil hack, but it saves a lot of duplicated code. */
VORTEX_PCM_TYPE(pcm) = idx;
pcm->private_data = chip;
/* set operators */
@@ -519,9 +519,9 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
if (idx == VORTEX_PCM_ADB)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_vortex_playback_ops);
-
+
/* pre-allocation of Scatter-Gather buffers */
-
+
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
snd_dma_pci_data(chip->pci_dev),
0x10000, 0x10000);
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index 978b856..1fcd430 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -41,10 +41,10 @@ static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo)
{
int temp;
- //temp = hwread(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2));
+ /* temp = hwread(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2)); */
temp = hwread(vortex->mmio, WT_STEREO(wt));
temp = (temp & 0xfe) | (stereo & 1);
- //hwwrite(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2), temp);
+ /* hwwrite(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2), temp); */
hwwrite(vortex->mmio, WT_STEREO(wt), temp);
}
@@ -68,22 +68,22 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
wt_voice_t *voice = &(vortex->wt_voice[wt]);
int temp;
- //FIXME: WT audio routing.
+ /* FIXME: WT audio routing. */
if (nr_ch) {
vortex_fifo_wtinitialize(vortex, wt, 1);
vortex_fifo_setwtvalid(vortex, wt, 1);
vortex_wt_setstereo(vortex, wt, nr_ch - 1);
} else
vortex_fifo_setwtvalid(vortex, wt, 0);
-
+
/* Set mixdown mode. */
vortex_wt_setdsout(vortex, wt, 1);
/* Set other parameter registers. */
hwwrite(vortex->mmio, WT_SRAMP(0), 0x880000);
- //hwwrite(vortex->mmio, WT_GMODE(0), 0xffffffff);
+ /* hwwrite(vortex->mmio, WT_GMODE(0), 0xffffffff); */
#ifdef CHIP_AU8830
hwwrite(vortex->mmio, WT_SRAMP(1), 0x880000);
- //hwwrite(vortex->mmio, WT_GMODE(1), 0xffffffff);
+ /* hwwrite(vortex->mmio, WT_GMODE(1), 0xffffffff); */
#endif
hwwrite(vortex->mmio, WT_PARM(wt, 0), 0);
hwwrite(vortex->mmio, WT_PARM(wt, 1), 0);
@@ -91,7 +91,7 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
temp = hwread(vortex->mmio, WT_PARM(wt, 3));
printk(KERN_DEBUG "vortex: WT PARM3: %x\n", temp);
- //hwwrite(vortex->mmio, WT_PARM(wt, 3), temp);
+ /* hwwrite(vortex->mmio, WT_PARM(wt, 3), temp); */
hwwrite(vortex->mmio, WT_DELAY(wt, 0), 0);
hwwrite(vortex->mmio, WT_DELAY(wt, 1), 0);
@@ -151,7 +151,7 @@ static void vortex_wt_connect(vortex_t * vortex, int en)
#if 0
static int vortex_wt_GetReg(vortex_t * vortex, char reg, int wt)
{
- //int eax, esi;
+ /* int eax, esi; */
if (reg == 4) {
return hwread(vortex->mmio, WT_PARM(wt, 3));
@@ -175,7 +175,7 @@ vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt,
return 0;
if ((reg - 0x20) > 0) {
- if ((reg - 0x21) != 0)
+ if ((reg - 0x21) != 0)
return 0;
eax = ((((b & 0xff) << 0xb) + (edx & 0xff)) << 4) + 0x208; // param 2
} else {
@@ -186,7 +186,7 @@ vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt,
return 1;
}
-/*public: static void __thiscall CWTHal::SetReg(unsigned char,int,unsigned long) */
+/*public: static void __thiscall CWTHal::SetReg(unsigned char, int, unsigned long) */
#endif
static int
vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
@@ -213,38 +213,38 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
switch (reg) {
/* Voice specific parameters */
case 0: /* running */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_RUN(wt), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_RUN(wt), (int)val); */
hwwrite(vortex->mmio, WT_RUN(wt), val);
return 0xc;
break;
case 1: /* param 0 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,0), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,0), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 0), val);
return 0xc;
break;
case 2: /* param 1 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,1), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,1), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 1), val);
return 0xc;
break;
case 3: /* param 2 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,2), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,2), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 2), val);
return 0xc;
break;
case 4: /* param 3 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,3), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,3), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 3), val);
return 0xc;
break;
case 6: /* mute */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_MUTE(wt), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_MUTE(wt), (int)val); */
hwwrite(vortex->mmio, WT_MUTE(wt), val);
return 0xc;
break;
case 0xb:
{ /* delay */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_DELAY(wt,0), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_DELAY(wt,0), (int)val); */
hwwrite(vortex->mmio, WT_DELAY(wt, 3), val);
hwwrite(vortex->mmio, WT_DELAY(wt, 2), val);
hwwrite(vortex->mmio, WT_DELAY(wt, 1), val);
@@ -272,7 +272,7 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
return 0;
break;
}
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", ecx, (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", ecx, (int)val); */
hwwrite(vortex->mmio, ecx, val);
return 1;
}
@@ -289,7 +289,7 @@ static void vortex_wt_init(vortex_t * vortex)
var10 &= 0xfffffffe;
var10 &= 0xfffffbff;
var10 |= 0x1800;
- // var10 = 0x1AA2
+ /* var10 = 0x1AA2 */
var4 = 0x10000000;
varc = 0x00830000;
var8 = 0x00830000;
@@ -355,7 +355,7 @@ static void vortex_wt_SetFrequency(vortex_t * vortex, int wt, unsigned int sr)
wt_voice_t *voice = &(vortex->wt_voice[wt]);
u32 eax, edx;
- //FIXME: 64 bit operation.
+ /* FIXME: 64 bit operation. */
eax = ((sr << 0xf) * 0x57619F1) & 0xffffffff;
edx = (((sr << 0xf) * 0x57619F1)) >> 0x20;
@@ -384,9 +384,9 @@ static void vortex_wt_SetFrequency(vortex_t * vortex, int wt, unsigned int sr)
voice->parm0 &= 0xffff0001;
voice->parm0 |= (eax & 0x7fff) << 1;
voice->parm1 = voice->parm0 | 1;
- // Wt: this_1D4
- //AuWt::WriteReg((ulong)(this_1DC<<4)+0x200, (ulong)this_1E4);
- //AuWt::WriteReg((ulong)(this_1DC<<4)+0x204, (ulong)this_1E8);
+ /* Wt: this_1D4 */
+ /* AuWt::WriteReg((ulong)(this_1DC<<4)+0x200, (ulong)this_1E4); */
+ /* AuWt::WriteReg((ulong)(this_1DC<<4)+0x204, (ulong)this_1E8); */
hwwrite(vortex->mmio, WT_PARM(wt, 0), voice->parm0);
hwwrite(vortex->mmio, WT_PARM(wt, 1), voice->parm1);
}
diff --git a/sound/pci/au88x0/au88x0_xtalk.c b/sound/pci/au88x0/au88x0_xtalk.c
index b4151e2..c8acf62 100644
--- a/sound/pci/au88x0/au88x0_xtalk.c
+++ b/sound/pci/au88x0/au88x0_xtalk.c
@@ -64,7 +64,7 @@ static xtalk_gains_t const asXtalkGains1Chan = {
static xtalk_gains_t const asXtalkGainsAllChan = {
0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF,
0
- //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff
+ /* 0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff */
};
static xtalk_gains_t const asXtalkGainsZeros;
@@ -672,7 +672,7 @@ static void vortex_XtalkHw_ZeroIO(vortex_t * vortex)
static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
{
- vortex_XtalkHw_ZeroIO(vortex); // inlined
+ vortex_XtalkHw_ZeroIO(vortex); /* inlined */
vortex_XtalkHw_SetLeftEQ(vortex, 0, 0, asXtalkCoefsZeros);
vortex_XtalkHw_SetRightEQ(vortex, 0, 0, asXtalkCoefsZeros);
@@ -680,14 +680,14 @@ static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
- vortex_XtalkHw_SetGains(vortex, asXtalkGainsZeros); // inlined
+ vortex_XtalkHw_SetGains(vortex, asXtalkGainsZeros); /* inlined */
- vortex_XtalkHw_SetDelay(vortex, 0, 0); // inlined
+ vortex_XtalkHw_SetDelay(vortex, 0, 0); /* inlined */
- vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); // inlined
- vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); // inlined
- vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); // inlined
- vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); // inlined
+ vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); /* inlined */
+ vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); /* inlined */
+ vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); /* inlined */
+ vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); /* inlined */
vortex_XtalkHw_SetLeftEQStates(vortex, asXtalkInStateZeros,
asXtalkOutStateZeros);
@@ -707,7 +707,7 @@ static void vortex_XtalkHw_ProgramPipe(vortex_t * vortex)
vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
- vortex_XtalkHw_SetDelay(vortex, 0, 0); // inlined
+ vortex_XtalkHw_SetDelay(vortex, 0, 0); /* inlined */
}
static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
@@ -724,7 +724,7 @@ static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
sXtalkWideShiftLeftXt,
asXtalkWideCoefsLeftXt);
- vortex_XtalkHw_SetDelay(vortex, wXtalkWideRightDelay, wXtalkWideLeftDelay); // inlined
+ vortex_XtalkHw_SetDelay(vortex, wXtalkWideRightDelay, wXtalkWideLeftDelay); /* inlined */
}
static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
@@ -743,13 +743,13 @@ static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
sXtalkNarrowShiftLeftXt,
asXtalkNarrowCoefsLeftXt);
- vortex_XtalkHw_SetDelay(vortex, wXtalkNarrowRightDelay, wXtalkNarrowLeftDelay); // inlined
+ vortex_XtalkHw_SetDelay(vortex, wXtalkNarrowRightDelay, wXtalkNarrowLeftDelay); /* inlined */
}
static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
{
- //sDiamondKLeftEq,sDiamondKRightXt,asDiamondCoefsLeftEq
+ /* sDiamondKLeftEq,sDiamondKRightXt,asDiamondCoefsLeftEq */
vortex_XtalkHw_SetLeftEQ(vortex, sDiamondKLeftEq,
sDiamondShiftLeftEq, asDiamondCoefsLeftEq);
vortex_XtalkHw_SetRightEQ(vortex, sDiamondKRightEq,
@@ -759,7 +759,7 @@ static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
vortex_XtalkHw_SetRightXT(vortex, sDiamondKLeftXt,
sDiamondShiftLeftXt, asDiamondCoefsLeftXt);
- vortex_XtalkHw_SetDelay(vortex, wDiamondRightDelay, wDiamondLeftDelay); // inlined
+ vortex_XtalkHw_SetDelay(vortex, wDiamondRightDelay, wDiamondLeftDelay); /* inlined */
}
static void vortex_XtalkHw_init(vortex_t * vortex)
diff --git a/sound/pci/au88x0/au88x0_xtalk.h b/sound/pci/au88x0/au88x0_xtalk.h
index 7f4534b..ead8453 100644
--- a/sound/pci/au88x0/au88x0_xtalk.h
+++ b/sound/pci/au88x0/au88x0_xtalk.h
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* The crosstalk canceler supports 5 stereo input channels. The result is
+/* The crosstalk canceler supports 5 stereo input channels. The result is
available at one single output route pair (stereo). */
#ifndef _AU88X0_CXTALK_H
1
0

[alsa-devel] [PATCH 0/5] ARM: OMAP2: Add support for GUmstix Overo (rev 3)
by sakoman@gmail.com 09 Sep '08
by sakoman@gmail.com 09 Sep '08
09 Sep '08
This patch series adds support for the Gumstix Overo board.
This is the third submission and incorporates all previous feedback from both linux-omap and alsa-devel. Careful readers will also notice that this version includes nand support rather than onenand.
4
8

09 Sep '08
I started with Takashi's sound-unstable tree as a base:
Fixed:
* ice1724 compilation error (one { too much)
* checkpatch errors along the files
sound/pci/ice1712/ak4xxx.c total: 1 errors, 3 warnings, 0 checks, 196
lines checked
sound/pci/ice1712/amp.h total: 0 errors, 0 warnings, 1 checks, 51 lines checked
sound/pci/ice1712/aureon.c total: 0 errors, 121 warnings, 3 checks,
2284 lines checked
sound/pci/ice1712/aureon.h total: 0 errors, 1 warnings, 0 checks, 65
lines checked
sound/pci/ice1712/delta.c total: 17 errors, 44 warnings, 1 checks, 817
lines checked
sound/pci/ice1712/delta.h total: 0 errors, 8 warnings, 0 checks, 153
lines checked
sound/pci/ice1712/envy24ht.h total: 0 errors, 21 warnings, 0 checks,
221 lines checked
sound/pci/ice1712/ews.c total: 27 errors, 64 warnings, 2 checks, 1087
lines checked
sound/pci/ice1712/ews.h total: 0 errors, 7 warnings, 0 checks, 86 lines checked
sound/pci/ice1712/hoontech.c total: 13 errors, 10 warnings, 1 checks,
360 lines checked
sound/pci/ice1712/hoontech.h total: 2 errors, 7 warnings, 0 checks, 77
lines checked
sound/pci/ice1712/ice1712.c total: 14 errors, 162 warnings, 3 checks,
2799 lines checked
sound/pci/ice1712/ice1712.h total: 0 errors, 22 warnings, 3 checks,
511 lines checked
sound/pci/ice1712/ice1724.c total: 11 errors, 62 warnings, 8 checks,
2657 lines checked
sound/pci/ice1712/juli.c total: 0 errors, 0 warnings, 1 checks, 687
lines checked
sound/pci/ice1712/maya44.c total: 6 errors, 0 warnings, 16 checks, 761
lines checked
sound/pci/ice1712/pontis.c total: 0 errors, 40 warnings, 3 checks, 836
lines checked
sound/pci/ice1712/prodigy192.c total: 12 errors, 21 warnings, 0
checks, 817 lines checked
sound/pci/ice1712/prodigy_hifi.c total: 0 errors, 0 warnings, 1
checks, 1215 lines checked
sound/pci/ice1712/snd-ice1712.mod.c total: 0 errors, 1 warnings, 0
checks, 113 lines checked
sound/pci/ice1712/snd-ice1724.mod.c total: 0 errors, 1 warnings, 0
checks, 126 lines checked
sound/pci/ice1712/vt1732.c total: 51 errors, 3 warnings, 5 checks,
2759 lines checked
sound/pci/ice1712/vt1732.h total: 9 errors, 0 warnings, 2 checks, 452
lines checked
It compiles. At first run ice1724 complained about something
info-related (it's likely that it's not related to this patch at all)
and generated like 20 or 30 lines of warnings and errors along the
lines 890 - 900. On second run there was no errors or warnings
anymore.
--
Vedran Miletić
2
3

Re: [alsa-devel] [PATCH 3/5] ALSA: ASoC: Add support for TWL4030 audio codec (rev 4)
by Steve Sakoman 09 Sep '08
by Steve Sakoman 09 Sep '08
09 Sep '08
From: Steve Sakoman <steve(a)sakoman.com>
Signed-off-by: Steve Sakoman <steve(a)sakoman.com>
Acked-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/Kconfig | 5 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/twl4030.c | 653 ++++++++++++++++++++++++++++++++++++++++++++
sound/soc/codecs/twl4030.h | 197 +++++++++++++
4 files changed, 857 insertions(+), 0 deletions(-)
create mode 100644 sound/soc/codecs/twl4030.c
create mode 100644 sound/soc/codecs/twl4030.h
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 1db04a2..2f00e1e 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -50,3 +50,8 @@ config SND_SOC_CS4270_VD33_ERRATA
config SND_SOC_TLV320AIC3X
tristate
depends on I2C
+
+config SND_SOC_TWL4030
+ tristate
+ depends on SND_SOC && TWL4030_CORE
+
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index d7b97ab..a519ced 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -10,6 +10,7 @@ snd-soc-wm9712-objs := wm9712.o
snd-soc-wm9713-objs := wm9713.o
snd-soc-cs4270-objs := cs4270.o
snd-soc-tlv320aic3x-objs := tlv320aic3x.o
+snd-soc-twl4030-objs := twl4030.o
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o
@@ -23,3 +24,4 @@ obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o
obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
+obj-$(CONFIG_SND_SOC_TWL4030) += snd-soc-twl4030.o
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
new file mode 100644
index 0000000..ee2f0d3
--- /dev/null
+++ b/sound/soc/codecs/twl4030.c
@@ -0,0 +1,653 @@
+/*
+ * ALSA SoC TWL4030 codec driver
+ *
+ * Author: Steve Sakoman, <steve(a)sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/platform_device.h>
+#include <linux/i2c/twl4030.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+
+#include "twl4030.h"
+
+/*
+ * twl4030 register cache & default register settings
+ */
+static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
+ 0x00, /* this register not used */
+ 0x93, /* REG_CODEC_MODE (0x1) */
+ 0xc3, /* REG_OPTION (0x2) */
+ 0x00, /* REG_UNKNOWN (0x3) */
+ 0x00, /* REG_MICBIAS_CTL (0x4) */
+ 0x24, /* REG_ANAMICL (0x5) */
+ 0x04, /* REG_ANAMICR (0x6) */
+ 0x0a, /* REG_AVADC_CTL (0x7) */
+ 0x00, /* REG_ADCMICSEL (0x8) */
+ 0x00, /* REG_DIGMIXING (0x9) */
+ 0x0c, /* REG_ATXL1PGA (0xA) */
+ 0x0c, /* REG_ATXR1PGA (0xB) */
+ 0x00, /* REG_AVTXL2PGA (0xC) */
+ 0x00, /* REG_AVTXR2PGA (0xD) */
+ 0x01, /* REG_AUDIO_IF (0xE) */
+ 0x00, /* REG_VOICE_IF (0xF) */
+ 0x00, /* REG_ARXR1PGA (0x10) */
+ 0x00, /* REG_ARXL1PGA (0x11) */
+ 0x6c, /* REG_ARXR2PGA (0x12) */
+ 0x6c, /* REG_ARXL2PGA (0x13) */
+ 0x00, /* REG_VRXPGA (0x14) */
+ 0x00, /* REG_VSTPGA (0x15) */
+ 0x00, /* REG_VRX2ARXPGA (0x16) */
+ 0x0c, /* REG_AVDAC_CTL (0x17) */
+ 0x00, /* REG_ARX2VTXPGA (0x18) */
+ 0x00, /* REG_ARXL1_APGA_CTL (0x19) */
+ 0x00, /* REG_ARXR1_APGA_CTL (0x1A) */
+ 0x4b, /* REG_ARXL2_APGA_CTL (0x1B) */
+ 0x4b, /* REG_ARXR2_APGA_CTL (0x1C) */
+ 0x00, /* REG_ATX2ARXPGA (0x1D) */
+ 0x00, /* REG_BT_IF (0x1E) */
+ 0x00, /* REG_BTPGA (0x1F) */
+ 0x00, /* REG_BTSTPGA (0x20) */
+ 0x00, /* REG_EAR_CTL (0x21) */
+ 0x24, /* REG_HS_SEL (0x22) */
+ 0x0a, /* REG_HS_GAIN_SET (0x23) */
+ 0x00, /* REG_HS_POPN_SET (0x24) */
+ 0x00, /* REG_PREDL_CTL (0x25) */
+ 0x00, /* REG_PREDR_CTL (0x26) */
+ 0x00, /* REG_PRECKL_CTL (0x27) */
+ 0x00, /* REG_PRECKR_CTL (0x28) */
+ 0x00, /* REG_HFL_CTL (0x29) */
+ 0x00, /* REG_HFR_CTL (0x2A) */
+ 0x00, /* REG_ALC_CTL (0x2B) */
+ 0x00, /* REG_ALC_SET1 (0x2C) */
+ 0x00, /* REG_ALC_SET2 (0x2D) */
+ 0x00, /* REG_BOOST_CTL (0x2E) */
+ 0x01, /* REG_SOFTVOL_CTL (0x2F) */
+ 0x00, /* REG_DTMF_FREQSEL (0x30) */
+ 0x00, /* REG_DTMF_TONEXT1H (0x31) */
+ 0x00, /* REG_DTMF_TONEXT1L (0x32) */
+ 0x00, /* REG_DTMF_TONEXT2H (0x33) */
+ 0x00, /* REG_DTMF_TONEXT2L (0x34) */
+ 0x00, /* REG_DTMF_TONOFF (0x35) */
+ 0x00, /* REG_DTMF_WANONOFF (0x36) */
+ 0x00, /* REG_I2S_RX_SCRAMBLE_H (0x37) */
+ 0x00, /* REG_I2S_RX_SCRAMBLE_M (0x38) */
+ 0x00, /* REG_I2S_RX_SCRAMBLE_L (0x39) */
+ 0x16, /* REG_APLL_CTL (0x3A) */
+ 0x00, /* REG_DTMF_CTL (0x3B) */
+ 0x00, /* REG_DTMF_PGA_CTL2 (0x3C) */
+ 0x00, /* REG_DTMF_PGA_CTL1 (0x3D) */
+ 0x00, /* REG_MISC_SET_1 (0x3E) */
+ 0x00, /* REG_PCMBTMUX (0x3F) */
+ 0x00, /* not used (0x40) */
+ 0x00, /* not used (0x41) */
+ 0x00, /* not used (0x42) */
+ 0x00, /* REG_RX_PATH_SEL (0x43) */
+ 0x00, /* REG_VDL_APGA_CTL (0x44) */
+ 0x00, /* REG_VIBRA_CTL (0x45) */
+ 0x00, /* REG_VIBRA_SET (0x46) */
+ 0x00, /* REG_VIBRA_PWM_SET (0x47) */
+ 0x00, /* REG_ANAMIC_GAIN (0x48) */
+ 0x00, /* REG_MISC_SET_2 (0x49) */
+};
+
+/*
+ * read twl4030 register cache
+ */
+static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec,
+ unsigned int reg)
+{
+ u8 *cache = codec->reg_cache;
+
+ return cache[reg];
+}
+
+/*
+ * write twl4030 register cache
+ */
+static inline void twl4030_write_reg_cache(struct snd_soc_codec *codec,
+ u8 reg, u8 value)
+{
+ u8 *cache = codec->reg_cache;
+
+ if (reg >= TWL4030_CACHEREGNUM)
+ return;
+ cache[reg] = value;
+}
+
+/*
+ * write to the twl4030 register space
+ */
+static int twl4030_write(struct snd_soc_codec *codec,
+ unsigned int reg, unsigned int value)
+{
+ twl4030_write_reg_cache(codec, reg, value);
+ return twl4030_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, value, reg);
+}
+
+static void twl4030_clear_codecpdz(struct snd_soc_codec *codec)
+{
+ u8 mode;
+
+ mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE);
+ twl4030_write(codec, TWL4030_REG_CODEC_MODE,
+ mode & ~TWL4030_CODECPDZ);
+
+ /* REVISIT: this delay is present in TI sample drivers */
+ /* but there seems to be no TRM requirement for it */
+ udelay(10);
+}
+
+static void twl4030_set_codecpdz(struct snd_soc_codec *codec)
+{
+ u8 mode;
+
+ mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE);
+ twl4030_write(codec, TWL4030_REG_CODEC_MODE,
+ mode | TWL4030_CODECPDZ);
+
+ /* REVISIT: this delay is present in TI sample drivers */
+ /* but there seems to be no TRM requirement for it */
+ udelay(10);
+}
+
+static void twl4030_init_chip(struct snd_soc_codec *codec)
+{
+ int i;
+
+ /* clear CODECPDZ prior to setting register defaults */
+ twl4030_clear_codecpdz(codec);
+
+ /* set all audio section registers to reasonable defaults */
+ for (i = TWL4030_REG_OPTION; i <= TWL4030_REG_MISC_SET_2; i++)
+ twl4030_write(codec, i, twl4030_reg[i]);
+
+}
+
+static const struct snd_kcontrol_new twl4030_snd_controls[] = {
+ SOC_DOUBLE_R("Master Playback Volume",
+ TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+ 0, 127, 0),
+ SOC_DOUBLE_R("Capture Volume",
+ TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
+ 0, 127, 0),
+};
+
+/* add non dapm controls */
+static int twl4030_add_controls(struct snd_soc_codec *codec)
+{
+ int err, i;
+
+ for (i = 0; i < ARRAY_SIZE(twl4030_snd_controls); i++) {
+ err = snd_ctl_add(codec->card,
+ snd_soc_cnew(&twl4030_snd_controls[i],
+ codec, NULL));
+ if (err < 0)
+ return err;
+ }
+
+ return 0;
+}
+
+static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
+ SND_SOC_DAPM_INPUT("INL"),
+ SND_SOC_DAPM_INPUT("INR"),
+
+ SND_SOC_DAPM_OUTPUT("OUTL"),
+ SND_SOC_DAPM_OUTPUT("OUTR"),
+
+ SND_SOC_DAPM_DAC("DACL", "Left Playback", SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_DAC("DACR", "Right Playback", SND_SOC_NOPM, 0, 0),
+
+ SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+ /* outputs */
+ {"OUTL", NULL, "DACL"},
+ {"OUTR", NULL, "DACR"},
+
+ /* inputs */
+ {"ADCL", NULL, "INL"},
+ {"ADCR", NULL, "INR"},
+};
+
+static int twl4030_add_widgets(struct snd_soc_codec *codec)
+{
+ snd_soc_dapm_new_controls(codec, twl4030_dapm_widgets,
+ ARRAY_SIZE(twl4030_dapm_widgets));
+
+ snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+
+ snd_soc_dapm_new_widgets(codec);
+ return 0;
+}
+
+static void twl4030_power_up(struct snd_soc_codec *codec)
+{
+ u8 anamicl, regmisc1, byte, popn, hsgain;
+ int i = 0;
+
+ /* set CODECPDZ to turn on codec */
+ twl4030_set_codecpdz(codec);
+
+ /* initiate offset cancellation */
+ anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
+ twl4030_write(codec, TWL4030_REG_ANAMICL,
+ anamicl | TWL4030_CNCL_OFFSET_START);
+
+ /* wait for offset cancellation to complete */
+ do {
+ /* this takes a little while, so don't slam i2c */
+ udelay(2000);
+ twl4030_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &byte,
+ TWL4030_REG_ANAMICL);
+ } while ((i++ < 100) &&
+ ((byte & TWL4030_CNCL_OFFSET_START) ==
+ TWL4030_CNCL_OFFSET_START));
+
+ /* anti-pop when changing analog gain */
+ regmisc1 = twl4030_read_reg_cache(codec, TWL4030_REG_MISC_SET_1);
+ twl4030_write(codec, TWL4030_REG_MISC_SET_1,
+ regmisc1 | TWL4030_SMOOTH_ANAVOL_EN);
+
+ /* toggle CODECPDZ as per TRM */
+ twl4030_clear_codecpdz(codec);
+ twl4030_set_codecpdz(codec);
+
+ /* program anti-pop with bias ramp delay */
+ popn = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
+ popn &= TWL4030_RAMP_DELAY;
+ popn |= TWL4030_RAMP_DELAY_645MS;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+ popn |= TWL4030_VMID_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+ /* enable output stage and gain setting */
+ hsgain = TWL4030_HSR_GAIN_0DB | TWL4030_HSL_GAIN_0DB;
+ twl4030_write(codec, TWL4030_REG_HS_GAIN_SET, hsgain);
+
+ /* enable anti-pop ramp */
+ popn |= TWL4030_RAMP_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+}
+
+static void twl4030_power_down(struct snd_soc_codec *codec)
+{
+ u8 popn, hsgain;
+
+ /* disable anti-pop ramp */
+ popn = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
+ popn &= ~TWL4030_RAMP_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+ /* disable output stage and gain setting */
+ hsgain = TWL4030_HSR_GAIN_PWR_DOWN | TWL4030_HSL_GAIN_PWR_DOWN;
+ twl4030_write(codec, TWL4030_REG_HS_GAIN_SET, hsgain);
+
+ /* disable bias out */
+ popn &= ~TWL4030_VMID_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+ /* power down */
+ twl4030_clear_codecpdz(codec);
+}
+
+static int twl4030_set_bias_level(struct snd_soc_codec *codec,
+ enum snd_soc_bias_level level)
+{
+ switch (level) {
+ case SND_SOC_BIAS_ON:
+ twl4030_power_up(codec);
+ break;
+ case SND_SOC_BIAS_PREPARE:
+ /* TODO: develop a twl4030_prepare function */
+ break;
+ case SND_SOC_BIAS_STANDBY:
+ /* TODO: develop a twl4030_standby function */
+ twl4030_power_down(codec);
+ break;
+ case SND_SOC_BIAS_OFF:
+ twl4030_power_down(codec);
+ break;
+ }
+ codec->bias_level = level;
+
+ return 0;
+}
+
+static int twl4030_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ u8 mode, old_mode, format, old_format;
+
+
+ /* bit rate */
+ old_mode = twl4030_read_reg_cache(codec,
+ TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ;
+ mode = old_mode & ~TWL4030_APLL_RATE;
+
+ switch (params_rate(params)) {
+ case 8000:
+ mode |= TWL4030_APLL_RATE_8000;
+ break;
+ case 11025:
+ mode |= TWL4030_APLL_RATE_11025;
+ break;
+ case 12000:
+ mode |= TWL4030_APLL_RATE_12000;
+ break;
+ case 16000:
+ mode |= TWL4030_APLL_RATE_16000;
+ break;
+ case 22050:
+ mode |= TWL4030_APLL_RATE_22050;
+ break;
+ case 24000:
+ mode |= TWL4030_APLL_RATE_24000;
+ break;
+ case 32000:
+ mode |= TWL4030_APLL_RATE_32000;
+ break;
+ case 44100:
+ mode |= TWL4030_APLL_RATE_44100;
+ break;
+ case 48000:
+ mode |= TWL4030_APLL_RATE_48000;
+ break;
+ default:
+ printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n",
+ params_rate(params));
+ return -EINVAL;
+ }
+
+ if (mode != old_mode) {
+ /* change rate and set CODECPDZ */
+ twl4030_write(codec, TWL4030_REG_CODEC_MODE, mode);
+ twl4030_set_codecpdz(codec);
+ }
+
+ /* sample size */
+ old_format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF);
+ format = old_format;
+ format &= ~TWL4030_DATA_WIDTH;
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ format |= TWL4030_DATA_WIDTH_16S_16W;
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ format |= TWL4030_DATA_WIDTH_32S_24W;
+ break;
+ default:
+ printk(KERN_ERR "TWL4030 hw params: unknown format %d\n",
+ params_format(params));
+ return -EINVAL;
+ }
+
+ if (format != old_format) {
+
+ /* clear CODECPDZ before changing format (codec requirement) */
+ twl4030_clear_codecpdz(codec);
+
+ /* change format */
+ twl4030_write(codec, TWL4030_REG_AUDIO_IF, format);
+
+ /* set CODECPDZ afterwards */
+ twl4030_set_codecpdz(codec);
+ }
+ return 0;
+}
+
+static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+ int clk_id, unsigned int freq, int dir)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ u8 infreq;
+
+ switch (freq) {
+ case 19200000:
+ infreq = TWL4030_APLL_INFREQ_19200KHZ;
+ break;
+ case 26000000:
+ infreq = TWL4030_APLL_INFREQ_26000KHZ;
+ break;
+ case 38400000:
+ infreq = TWL4030_APLL_INFREQ_38400KHZ;
+ break;
+ default:
+ printk(KERN_ERR "TWL4030 set sysclk: unknown rate %d\n",
+ freq);
+ return -EINVAL;
+ }
+
+ infreq |= TWL4030_APLL_EN;
+ twl4030_write(codec, TWL4030_REG_APLL_CTL, infreq);
+
+ return 0;
+}
+
+static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai,
+ unsigned int fmt)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ u8 old_format, format;
+
+ /* get format */
+ old_format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF);
+ format = old_format;
+
+ /* set master/slave audio interface */
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBM_CFM:
+ format &= ~(TWL4030_AIF_SLAVE_EN);
+ format |= TWL4030_CLK256FS_EN;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
+ format &= ~(TWL4030_CLK256FS_EN);
+ format |= TWL4030_AIF_SLAVE_EN;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* interface format */
+ format &= ~TWL4030_AIF_FORMAT;
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+ case SND_SOC_DAIFMT_I2S:
+ format |= TWL4030_AIF_FORMAT_CODEC;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if (format != old_format) {
+
+ /* clear CODECPDZ before changing format (codec requirement) */
+ twl4030_clear_codecpdz(codec);
+
+ /* change format */
+ twl4030_write(codec, TWL4030_REG_AUDIO_IF, format);
+
+ /* set CODECPDZ afterwards */
+ twl4030_set_codecpdz(codec);
+ }
+
+ return 0;
+}
+
+#define TWL4030_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
+#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE)
+
+struct snd_soc_dai twl4030_dai = {
+ .name = "twl4030",
+ .playback = {
+ .stream_name = "Playback",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = TWL4030_RATES,
+ .formats = TWL4030_FORMATS,},
+ .capture = {
+ .stream_name = "Capture",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = TWL4030_RATES,
+ .formats = TWL4030_FORMATS,},
+ .ops = {
+ .hw_params = twl4030_hw_params,
+ },
+ .dai_ops = {
+ .set_sysclk = twl4030_set_dai_sysclk,
+ .set_fmt = twl4030_set_dai_fmt,
+ }
+};
+EXPORT_SYMBOL_GPL(twl4030_dai);
+
+static int twl4030_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+ return 0;
+}
+
+static int twl4030_resume(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ twl4030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ twl4030_set_bias_level(codec, codec->suspend_bias_level);
+ return 0;
+}
+
+/*
+ * initialize the driver
+ * register the mixer and dsp interfaces with the kernel
+ */
+
+static int twl4030_init(struct snd_soc_device *socdev)
+{
+ struct snd_soc_codec *codec = socdev->codec;
+ int ret = 0;
+
+ printk(KERN_INFO "TWL4030 Audio Codec init \n");
+
+ codec->name = "twl4030";
+ codec->owner = THIS_MODULE;
+ codec->read = twl4030_read_reg_cache;
+ codec->write = twl4030_write;
+ codec->set_bias_level = twl4030_set_bias_level;
+ codec->dai = &twl4030_dai;
+ codec->num_dai = 1;
+ codec->reg_cache_size = sizeof(twl4030_reg);
+ codec->reg_cache = kmemdup(twl4030_reg, sizeof(twl4030_reg),
+ GFP_KERNEL);
+ if (codec->reg_cache == NULL)
+ return -ENOMEM;
+
+ /* register pcms */
+ ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+ if (ret < 0) {
+ printk(KERN_ERR "twl4030: failed to create pcms\n");
+ goto pcm_err;
+ }
+
+ twl4030_init_chip(codec);
+
+ /* power on device */
+ twl4030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+ twl4030_add_controls(codec);
+ twl4030_add_widgets(codec);
+
+ ret = snd_soc_register_card(socdev);
+ if (ret < 0) {
+ printk(KERN_ERR "twl4030: failed to register card\n");
+ goto card_err;
+ }
+
+ return ret;
+
+card_err:
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+pcm_err:
+ kfree(codec->reg_cache);
+ return ret;
+}
+
+static struct snd_soc_device *twl4030_socdev;
+
+static int twl4030_probe(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec;
+
+ codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+ if (codec == NULL)
+ return -ENOMEM;
+
+ socdev->codec = codec;
+ mutex_init(&codec->mutex);
+ INIT_LIST_HEAD(&codec->dapm_widgets);
+ INIT_LIST_HEAD(&codec->dapm_paths);
+
+ twl4030_socdev = socdev;
+ twl4030_init(socdev);
+
+ return 0;
+}
+
+static int twl4030_remove(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ printk(KERN_INFO "TWL4030 Audio Codec remove\n");
+ kfree(codec);
+
+ return 0;
+}
+
+struct snd_soc_codec_device soc_codec_dev_twl4030 = {
+ .probe = twl4030_probe,
+ .remove = twl4030_remove,
+ .suspend = twl4030_suspend,
+ .resume = twl4030_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_twl4030);
+
+MODULE_DESCRIPTION("ASoC TWL4030 codec driver");
+MODULE_AUTHOR("Steve Sakoman");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
new file mode 100644
index 0000000..09865d9
--- /dev/null
+++ b/sound/soc/codecs/twl4030.h
@@ -0,0 +1,197 @@
+/*
+ * ALSA SoC TWL4030 codec driver
+ *
+ * Author: Steve Sakoman <steve(a)sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __TWL4030_AUDIO_H__
+#define __TWL4030_AUDIO_H__
+
+#define TWL4030_REG_CODEC_MODE 0x1
+#define TWL4030_REG_OPTION 0x2
+#define TWL4030_REG_UNKNOWN 0x3
+#define TWL4030_REG_MICBIAS_CTL 0x4
+#define TWL4030_REG_ANAMICL 0x5
+#define TWL4030_REG_ANAMICR 0x6
+#define TWL4030_REG_AVADC_CTL 0x7
+#define TWL4030_REG_ADCMICSEL 0x8
+#define TWL4030_REG_DIGMIXING 0x9
+#define TWL4030_REG_ATXL1PGA 0xA
+#define TWL4030_REG_ATXR1PGA 0xB
+#define TWL4030_REG_AVTXL2PGA 0xC
+#define TWL4030_REG_AVTXR2PGA 0xD
+#define TWL4030_REG_AUDIO_IF 0xE
+#define TWL4030_REG_VOICE_IF 0xF
+#define TWL4030_REG_ARXR1PGA 0x10
+#define TWL4030_REG_ARXL1PGA 0x11
+#define TWL4030_REG_ARXR2PGA 0x12
+#define TWL4030_REG_ARXL2PGA 0x13
+#define TWL4030_REG_VRXPGA 0x14
+#define TWL4030_REG_VSTPGA 0x15
+#define TWL4030_REG_VRX2ARXPGA 0x16
+#define TWL4030_REG_AVDAC_CTL 0x17
+#define TWL4030_REG_ARX2VTXPGA 0x18
+#define TWL4030_REG_ARXL1_APGA_CTL 0x19
+#define TWL4030_REG_ARXR1_APGA_CTL 0x1A
+#define TWL4030_REG_ARXL2_APGA_CTL 0x1B
+#define TWL4030_REG_ARXR2_APGA_CTL 0x1C
+#define TWL4030_REG_ATX2ARXPGA 0x1D
+#define TWL4030_REG_BT_IF 0x1E
+#define TWL4030_REG_BTPGA 0x1F
+#define TWL4030_REG_BTSTPGA 0x20
+#define TWL4030_REG_EAR_CTL 0x21
+#define TWL4030_REG_HS_SEL 0x22
+#define TWL4030_REG_HS_GAIN_SET 0x23
+#define TWL4030_REG_HS_POPN_SET 0x24
+#define TWL4030_REG_PREDL_CTL 0x25
+#define TWL4030_REG_PREDR_CTL 0x26
+#define TWL4030_REG_PRECKL_CTL 0x27
+#define TWL4030_REG_PRECKR_CTL 0x28
+#define TWL4030_REG_HFL_CTL 0x29
+#define TWL4030_REG_HFR_CTL 0x2A
+#define TWL4030_REG_ALC_CTL 0x2B
+#define TWL4030_REG_ALC_SET1 0x2C
+#define TWL4030_REG_ALC_SET2 0x2D
+#define TWL4030_REG_BOOST_CTL 0x2E
+#define TWL4030_REG_SOFTVOL_CTL 0x2F
+#define TWL4030_REG_DTMF_FREQSEL 0x30
+#define TWL4030_REG_DTMF_TONEXT1H 0x31
+#define TWL4030_REG_DTMF_TONEXT1L 0x32
+#define TWL4030_REG_DTMF_TONEXT2H 0x33
+#define TWL4030_REG_DTMF_TONEXT2L 0x34
+#define TWL4030_REG_DTMF_TONOFF 0x35
+#define TWL4030_REG_DTMF_WANONOFF 0x36
+#define TWL4030_REG_I2S_RX_SCRAMBLE_H 0x37
+#define TWL4030_REG_I2S_RX_SCRAMBLE_M 0x38
+#define TWL4030_REG_I2S_RX_SCRAMBLE_L 0x39
+#define TWL4030_REG_APLL_CTL 0x3A
+#define TWL4030_REG_DTMF_CTL 0x3B
+#define TWL4030_REG_DTMF_PGA_CTL2 0x3C
+#define TWL4030_REG_DTMF_PGA_CTL1 0x3D
+#define TWL4030_REG_MISC_SET_1 0x3E
+#define TWL4030_REG_PCMBTMUX 0x3F
+#define TWL4030_REG_RX_PATH_SEL 0x43
+#define TWL4030_REG_VDL_APGA_CTL 0x44
+#define TWL4030_REG_VIBRA_CTL 0x45
+#define TWL4030_REG_VIBRA_SET 0x46
+#define TWL4030_REG_VIBRA_PWM_SET 0x47
+#define TWL4030_REG_ANAMIC_GAIN 0x48
+#define TWL4030_REG_MISC_SET_2 0x49
+
+#define TWL4030_CACHEREGNUM (TWL4030_REG_MISC_SET_2 + 1)
+
+/* Bitfield Definitions */
+
+/* TWL4030_CODEC_MODE (0x01) Fields */
+
+#define TWL4030_APLL_RATE 0xF0
+#define TWL4030_APLL_RATE_8000 0x00
+#define TWL4030_APLL_RATE_11025 0x10
+#define TWL4030_APLL_RATE_12000 0x20
+#define TWL4030_APLL_RATE_16000 0x40
+#define TWL4030_APLL_RATE_22050 0x50
+#define TWL4030_APLL_RATE_24000 0x60
+#define TWL4030_APLL_RATE_32000 0x80
+#define TWL4030_APLL_RATE_44100 0x90
+#define TWL4030_APLL_RATE_48000 0xA0
+#define TWL4030_SEL_16K 0x04
+#define TWL4030_CODECPDZ 0x02
+#define TWL4030_OPT_MODE 0x01
+
+/* ANAMICL (0x05) Fields */
+#define TWL4030_CNCL_OFFSET_START 0x80
+#define TWL4030_OFFSET_CNCL_SEL 0x60
+#define TWL4030_OFFSET_CNCL_SEL_ARX1 0x00
+#define TWL4030_OFFSET_CNCL_SEL_ARX2 0x20
+#define TWL4030_OFFSET_CNCL_SEL_VRX 0x40
+#define TWL4030_OFFSET_CNCL_SEL_ALL 0x60
+#define TWL4030_MICAMPL_EN 0x10
+#define TWL4030_CKMIC_EN 0x08
+#define TWL4030_AUXL_EN 0x04
+#define TWL4030_HSMIC_EN 0x02
+#define TWL4030_MAINMIC_EN 0x01
+
+/* ANAMICR (0x06) Fields */
+#define TWL4030_MICAMPR_EN 0x10
+#define TWL4030_AUXR_EN 0x04
+#define TWL4030_SUBMIC_EN 0x01
+
+/* AUDIO_IF (0x0E) Fields */
+
+#define TWL4030_AIF_SLAVE_EN 0x80
+#define TWL4030_DATA_WIDTH 0x60
+#define TWL4030_DATA_WIDTH_16S_16W 0x00
+#define TWL4030_DATA_WIDTH_32S_16W 0x40
+#define TWL4030_DATA_WIDTH_32S_24W 0x60
+#define TWL4030_AIF_FORMAT 0x18
+#define TWL4030_AIF_FORMAT_CODEC 0x00
+#define TWL4030_AIF_FORMAT_LEFT 0x08
+#define TWL4030_AIF_FORMAT_RIGHT 0x10
+#define TWL4030_AIF_FORMAT_TDM 0x18
+#define TWL4030_AIF_TRI_EN 0x04
+#define TWL4030_CLK256FS_EN 0x02
+#define TWL4030_AIF_EN 0x01
+
+/* HS_GAIN_SET (0x23) Fields */
+
+#define TWL4030_HSR_GAIN 0x0C
+#define TWL4030_HSR_GAIN_PWR_DOWN 0x00
+#define TWL4030_HSR_GAIN_PLUS_6DB 0x04
+#define TWL4030_HSR_GAIN_0DB 0x08
+#define TWL4030_HSR_GAIN_MINUS_6DB 0x0C
+#define TWL4030_HSL_GAIN 0x03
+#define TWL4030_HSL_GAIN_PWR_DOWN 0x00
+#define TWL4030_HSL_GAIN_PLUS_6DB 0x01
+#define TWL4030_HSL_GAIN_0DB 0x02
+#define TWL4030_HSL_GAIN_MINUS_6DB 0x03
+
+/* HS_POPN_SET (0x24) Fields */
+
+#define TWL4030_VMID_EN 0x40
+#define TWL4030_EXTMUTE 0x20
+#define TWL4030_RAMP_DELAY 0x1C
+#define TWL4030_RAMP_DELAY_20MS 0x00
+#define TWL4030_RAMP_DELAY_40MS 0x04
+#define TWL4030_RAMP_DELAY_81MS 0x08
+#define TWL4030_RAMP_DELAY_161MS 0x0C
+#define TWL4030_RAMP_DELAY_323MS 0x10
+#define TWL4030_RAMP_DELAY_645MS 0x14
+#define TWL4030_RAMP_DELAY_1291MS 0x18
+#define TWL4030_RAMP_DELAY_2581MS 0x1C
+#define TWL4030_RAMP_EN 0x02
+
+/* APLL_CTL (0x3A) Fields */
+
+#define TWL4030_APLL_EN 0x10
+#define TWL4030_APLL_INFREQ 0x0F
+#define TWL4030_APLL_INFREQ_19200KHZ 0x05
+#define TWL4030_APLL_INFREQ_26000KHZ 0x06
+#define TWL4030_APLL_INFREQ_38400KHZ 0x0F
+
+/* REG_MISC_SET_1 (0x3E) Fields */
+
+#define TWL4030_CLK64_EN 0x80
+#define TWL4030_SCRAMBLE_EN 0x40
+#define TWL4030_FMLOOP_EN 0x20
+#define TWL4030_SMOOTH_ANAVOL_EN 0x02
+#define TWL4030_DIGMIC_LR_SWAP_EN 0x01
+
+extern struct snd_soc_dai twl4030_dai;
+extern struct snd_soc_codec_device soc_codec_dev_twl4030;
+
+#endif /* End of __TWL4030_AUDIO_H__ */
--
1.5.4.5
1
0

[alsa-devel] [RESEND, PATCH] Fix section for sa11xx-uda1341 platform driver
by Uwe Kleine-König 08 Sep '08
by Uwe Kleine-König 08 Sep '08
08 Sep '08
Don't use __init but __devinit to define probe function. A pointer to
sa11xx_uda1341_probe is passed to the core via platform_driver_register and
so the function must not disappear after the module is loaded. Using __init
and having HOTPLUG=y and SND_SA11XX_UDA1341=m the following probably oopses:
echo -n sa11xx_uda1341.1 > /sys/bus/platform/driver/sa11xx_uda1341/unbind
echo -n sa11xx_uda1341.1 > /sys/bus/platform/driver/sa11xx_uda1341/bind
Signed-off-by: Uwe Kleine-König <ukleinek(a)informatik.uni-freiburg.de>
Cc: Russell King <rmk+kernel(a)arm.linux.org.uk>
Cc: Jaroslav Kysela <perex(a)perex.cz>
Cc: Brian Avery <b.avery(a)hp.com>
Cc: alsa-devel(a)alsa-project.org
Cc: Andrew Morton <akpm(a)linux-foundation.org>
---
Hello,
uups, I forgot to add the right cc:. Sorry.
@Andrew, I have a few more patches of this type pending. Is it OK for
you if they go via you? This would ease the process a bit for me.
Uwe
sound/arm/sa11xx-uda1341.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index b9c51bf..da25b41 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -879,7 +879,7 @@ void snd_sa11xx_uda1341_free(struct snd_card *card)
audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]);
}
-static int __init sa11xx_uda1341_probe(struct platform_device *devptr)
+static int __devinit sa11xx_uda1341_probe(struct platform_device *devptr)
{
int err;
struct snd_card *card;
--
tg: (7686ad5..) t/sectionfixes/sa11xx_uda1341 (depends on: t/sectionfixes/sa11xx_uda1341)
--
Uwe Kleine-König
http://www.google.com/search?q=1+electron+mass%3D
1
0
Hi group,
What API call fo I use to wait for a callback to end? Right now I use
a select() and wait
for stdin input or a system interrupt. Is there another way?
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0

Re: [alsa-devel] [PATCH1/1] hda: digital slave support for IDT codecs
by Matthew Ranostay 08 Sep '08
by Matthew Ranostay 08 Sep '08
08 Sep '08
Added slave_dig_outs entries for several IDT codecs that have multiple
SPDIF outs, and enabled these SPDIF outs in several pin configs.
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
---
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ee24a0d..5280eff 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -235,6 +235,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -284,6 +288,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -317,6 +325,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -418,9 +430,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1492,22 +1505,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3846,6 +3859,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
spec->pin_nids = stac92hd73xx_pin_nids;
spec->board_config = snd_hda_check_board_config(codec,
@@ -3984,6 +3998,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4134,6 +4149,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4166,6 +4182,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
1
0

08 Sep '08
Added slave_dig_outs entries for several IDT codecs that have multiple
SPDIF outs, and enabled these SPDIF outs in several pin configs.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index 9968ee4..52b3579 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -229,6 +229,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -274,6 +278,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -303,6 +311,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -396,9 +408,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1424,22 +1437,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3841,8 +3854,9 @@ again:
spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
spec->pwr_nids = stac92hd73xx_pwr_nids;
+ codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
- err = stac92xx_parse_auto_config(codec, 0x22, 0x24);
+ err = stac92xx_parse_auto_config(codec, 0x22, 0x25);
if (!err) {
if (spec->board_config < 0) {
@@ -3883,6 +3897,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4033,6 +4048,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4065,6 +4081,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
3
8

08 Sep '08
Added slave_dig_outs entries for several IDT codecs that have multiple
SPDIF outs, and enabled these SPDIF outs in several pin configs.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ee24a0d..655a87c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -235,6 +235,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -284,6 +288,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -317,6 +325,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -418,9 +430,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1492,22 +1505,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3984,6 +3997,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4134,6 +4148,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4166,6 +4181,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
2
1
Changed the mux naming scheme from "IEC9258 Mux" to "IEC958 Playback Source" to match
the coding style.
---
Signed-by-off: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ee24a0d..173515d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1047,7 +1047,7 @@ static struct snd_kcontrol_new stac_dmux_mixer = {
static struct snd_kcontrol_new stac_smux_mixer = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "IEC958 Mux",
+ .name = "IEC958 Playback Source",
/* count set later */
.info = stac92xx_smux_enum_info,
.get = stac92xx_smux_enum_get,
1
0
From: Krzysztof Helt <krzysztof.h1(a)wp.pl>
The __exit cleanup_oss_soundcore() is called from
the __init init_soundcore(). This causes section mismatch
and breaks kernel's linking on sparc64.
Remove the __exit attribute from the cleanup_oss_soundcore().
Signed-off-by: Krzysztof Helt <krzysztof.h1(a)wp.pl>
---
Patch against 2.6.27-rc5-mm1.
diff -urp linux-ref/sound/sound_core.c linux-2.6.26/sound/sound_core.c
--- linux-ref/sound/sound_core.c 2008-09-07 18:54:22.800008536 -0400
+++ linux-2.6.26/sound/sound_core.c 2008-09-07 18:55:56.805521447 -0400
@@ -13,7 +13,7 @@
#ifdef CONFIG_SOUND_OSS_CORE
static int __init init_oss_soundcore(void);
-static void __exit cleanup_oss_soundcore(void);
+static void cleanup_oss_soundcore(void);
#else
static inline int init_oss_soundcore(void) { return 0; }
static inline void cleanup_oss_soundcore(void) { }
@@ -573,7 +573,7 @@ int soundcore_open(struct inode *inode,
MODULE_ALIAS_CHARDEV_MAJOR(SOUND_MAJOR);
-static void __exit cleanup_oss_soundcore(void)
+static void cleanup_oss_soundcore(void)
{
/* We have nothing to really do here - we know the lists must be
empty */
----------------------------------------------------------------------
Tanie polaczenia z Polska i ze swiatem
Sprawdz >> http://link.interia.pl/f1f00
2
1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dynamically create mux controls for SPDIF outs on certain IDT/Sigmatel codecs.
- ---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index 9968ee4..4637d76 100644
- --- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -173,6 +173,9 @@ struct sigmatel_spec {
unsigned int num_dmics;
hda_nid_t *dmux_nids;
unsigned int num_dmuxes;
+ hda_nid_t *smux_nids;
+ unsigned int num_smuxes;
+
hda_nid_t dig_in_nid;
hda_nid_t mono_nid;
hda_nid_t anabeep_nid;
@@ -193,6 +196,8 @@ struct sigmatel_spec {
unsigned int cur_dmux[2];
struct hda_input_mux *input_mux;
unsigned int cur_mux[3];
+ struct hda_input_mux *sinput_mux;
+ unsigned int cur_smux[2];
unsigned int powerdown_adcs;
/* i/o switches */
@@ -209,6 +214,7 @@ struct sigmatel_spec {
struct snd_kcontrol_new *kctl_alloc;
struct hda_input_mux private_dimux;
struct hda_input_mux private_imux;
+ struct hda_input_mux private_smux;
struct hda_input_mux private_mono_mux;
};
@@ -251,6 +257,10 @@ static hda_nid_t stac92hd73xx_dmux_nids[2] = {
0x20, 0x21,
};
+static hda_nid_t stac92hd73xx_smux_nids[2] = {
+ 0x22, 0x23,
+};
+
#define STAC92HD83XXX_NUM_DMICS 2
static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = {
0x11, 0x12, 0
@@ -294,6 +304,10 @@ static hda_nid_t stac92hd71bxx_dmux_nids[1] = {
0x1c,
};
+static hda_nid_t stac92hd71bxx_smux_nids[2] = {
+ 0x24, 0x25,
+};
+
static hda_nid_t stac92hd71bxx_dac_nids[1] = {
0x10, /*0x11, */
};
@@ -340,6 +354,10 @@ static hda_nid_t stac927x_mux_nids[3] = {
0x15, 0x16, 0x17
};
+static hda_nid_t stac927x_smux_nids[1] = {
+ 0x21,
+};
+
static hda_nid_t stac927x_dac_nids[6] = {
0x02, 0x03, 0x04, 0x05, 0x06, 0
};
@@ -365,6 +383,10 @@ static hda_nid_t stac9205_dmux_nids[1] = {
0x1d,
};
+static hda_nid_t stac9205_smux_nids[1] = {
+ 0x21,
+};
+
#define STAC9205_NUM_DMICS 2
static hda_nid_t stac9205_dmic_nids[STAC9205_NUM_DMICS + 1] = {
0x17, 0x18, 0
@@ -388,7 +410,7 @@ static hda_nid_t stac922x_pin_nids[10] = {
static hda_nid_t stac92hd73xx_pin_nids[13] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12, 0x13,
- - 0x14, 0x1e, 0x22
+ 0x14, 0x22, 0x23
};
static hda_nid_t stac92hd83xxx_pin_nids[14] = {
@@ -443,6 +465,36 @@ static int stac92xx_dmux_enum_put(struct snd_kcontrol *kcontrol,
spec->dmux_nids[dmux_idx], &spec->cur_dmux[dmux_idx]);
}
+static int stac92xx_smux_enum_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ return snd_hda_input_mux_info(spec->sinput_mux, uinfo);
+}
+
+static int stac92xx_smux_enum_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+ ucontrol->value.enumerated.item[0] = spec->cur_smux[smux_idx];
+ return 0;
+}
+
+static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct sigmatel_spec *spec = codec->spec;
+ unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+ return snd_hda_input_mux_put(codec, spec->sinput_mux, ucontrol,
+ spec->smux_nids[smux_idx], &spec->cur_smux[smux_idx]);
+}
+
static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
@@ -993,6 +1045,15 @@ static struct snd_kcontrol_new stac_dmux_mixer = {
.put = stac92xx_dmux_enum_put,
};
+static struct snd_kcontrol_new stac_smux_mixer = {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "IEC958 Mux",
+ /* count set later */
+ .info = stac92xx_smux_enum_info,
+ .get = stac92xx_smux_enum_get,
+ .put = stac92xx_smux_enum_put,
+};
+
static const char *slave_vols[] = {
"Front Playback Volume",
"Surround Playback Volume",
@@ -1044,6 +1105,13 @@ static int stac92xx_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
}
+ if (spec->num_smuxes > 0) {
+ stac_smux_mixer.count = spec->num_smuxes;
+ err = snd_ctl_add(codec->bus->card,
+ snd_ctl_new1(&stac_smux_mixer, codec));
+ if (err < 0)
+ return err;
+ }
if (spec->multiout.dig_out_nid) {
err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
@@ -2811,6 +2879,34 @@ static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
return 0;
};
+static const char *stac92xx_spdif_labels[3] = {
+ "Digital Playback", "Analog Mux 1", "Analog Mux 2"
+};
+
+static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
+{
+ struct sigmatel_spec *spec = codec->spec;
+ struct hda_input_mux *spdif_mux = &spec->private_smux;
+ int i, num_cons;
+ hda_nid_t con_lst[ARRAY_SIZE(stac92xx_spdif_labels)];
+
+ num_cons = snd_hda_get_connections(codec,
+ spec->smux_nids[0],
+ con_lst,
+ HDA_MAX_NUM_INPUTS);
+ if (!num_cons || num_cons > ARRAY_SIZE(stac92xx_spdif_labels))
+ return -EINVAL;
+
+ for (i = 0; i < num_cons; i++) {
+ spdif_mux->items[spdif_mux->num_items].label =
+ stac92xx_spdif_labels[i];
+ spdif_mux->items[spdif_mux->num_items].index = i;
+ spdif_mux->num_items++;
+ }
+
+ return 0;
+}
+
/* labels for dmic mux inputs */
static const char *stac92xx_dmic_labels[5] = {
"Analog Inputs", "Digital Mic 1", "Digital Mic 2",
@@ -3114,6 +3210,11 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
if (err < 0)
return err;
}
+ if (spec->num_smuxes > 0) {
+ err = stac92xx_auto_create_spdif_mux_ctls(codec);
+ if (err < 0)
+ return err;
+ }
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
if (spec->multiout.max_channels > 2)
@@ -3130,6 +3231,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
spec->input_mux = &spec->private_imux;
if (!spec->dinput_mux)
spec->dinput_mux = &spec->private_dimux;
+ spec->sinput_mux = &spec->private_smux;
spec->mono_mux = &spec->private_mono_mux;
return 1;
@@ -3800,10 +3902,12 @@ again:
spec->adc_nids = stac92hd73xx_adc_nids;
spec->dmic_nids = stac92hd73xx_dmic_nids;
spec->dmux_nids = stac92hd73xx_dmux_nids;
+ spec->smux_nids = stac92hd73xx_smux_nids;
spec->num_muxes = ARRAY_SIZE(stac92hd73xx_mux_nids);
spec->num_adcs = ARRAY_SIZE(stac92hd73xx_adc_nids);
spec->num_dmuxes = ARRAY_SIZE(stac92hd73xx_dmux_nids);
+ spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids);
spec->dinput_mux = &stac92hd73xx_dmux;
/* GPIO0 High = Enable EAPD */
spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
@@ -3842,7 +3946,7 @@ again:
spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
spec->pwr_nids = stac92hd73xx_pwr_nids;
- - err = stac92xx_parse_auto_config(codec, 0x22, 0x24);
+ err = stac92xx_parse_auto_config(codec, 0x25, 0x27);
if (!err) {
if (spec->board_config < 0) {
@@ -4081,11 +4185,13 @@ again:
spec->adc_nids = stac92hd71bxx_adc_nids;
spec->dmic_nids = stac92hd71bxx_dmic_nids;
spec->dmux_nids = stac92hd71bxx_dmux_nids;
+ spec->smux_nids = stac92hd71bxx_smux_nids;
spec->pwr_nids = stac92hd71bxx_pwr_nids;
spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids);
spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);
spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
+ spec->num_smuxes = ARRAY_SIZE(stac92hd71bxx_smux_nids);
spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);
spec->multiout.num_dacs = 1;
@@ -4254,6 +4360,8 @@ static int patch_stac927x(struct hda_codec *codec)
spec->num_adcs = ARRAY_SIZE(stac927x_adc_nids);
spec->mux_nids = stac927x_mux_nids;
spec->num_muxes = ARRAY_SIZE(stac927x_mux_nids);
+ spec->smux_nids = stac927x_smux_nids;
+ spec->num_smuxes = ARRAY_SIZE(stac927x_smux_nids);
spec->dac_list = stac927x_dac_nids;
spec->multiout.dac_nids = spec->dac_nids;
@@ -4375,6 +4483,8 @@ static int patch_stac9205(struct hda_codec *codec)
spec->num_adcs = ARRAY_SIZE(stac9205_adc_nids);
spec->mux_nids = stac9205_mux_nids;
spec->num_muxes = ARRAY_SIZE(stac9205_mux_nids);
+ spec->smux_nids = stac9205_smux_nids;
+ spec->num_smuxes = ARRAY_SIZE(stac9205_smux_nids);
spec->dmic_nids = stac9205_dmic_nids;
spec->num_dmics = STAC9205_NUM_DMICS;
spec->dmux_nids = stac9205_dmux_nids;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkjBgIYACgkQ7s2wy7nhBHWxowCgiQ5j+n6XCtwsqiIuEoJgONJW
x5kAoKtAa9JjHRADbOyjsxDat20Orpf7
=UxWy
-----END PGP SIGNATURE-----
2
3
Added support for playing a stream on multiple digital outs. This is done
by defining codec->slave_dig_outs as array of hda_nid_t with a null-terminated entry to set the
slave SPDIF outs, in which the slave outs have cloned settings of the master out (e.g. dig_out_nid).
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/hda_codec.c b/pci/hda/hda_codec.c
index 4f32911..696d77e 100644
--- a/pci/hda/hda_codec.c
+++ b/pci/hda/hda_codec.c
@@ -1454,12 +1454,22 @@ static int snd_hda_spdif_default_put(struct snd_kcontrol *kcontrol,
codec->spdif_ctls = val;
if (change) {
+ hda_nid_t *d;
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_2,
val >> 8);
+
+ for (d = codec->slave_dig_outs; *d; d++) {
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
+ val & 0xff);
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_2,
+ val >> 8);
+ }
}
mutex_unlock(&codec->spdif_mutex);
@@ -1491,10 +1501,16 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,
val |= AC_DIG1_ENABLE;
change = codec->spdif_ctls != val;
if (change) {
+ hda_nid_t *d;
codec->spdif_ctls = val;
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
+ val & 0xff);
/* unmute amp switch (if any) */
if ((get_wcaps(codec, nid) & AC_WCAP_OUT_AMP) &&
(val & AC_DIG1_ENABLE))
@@ -1643,9 +1659,14 @@ static int snd_hda_spdif_in_switch_put(struct snd_kcontrol *kcontrol,
mutex_lock(&codec->spdif_mutex);
change = codec->spdif_in_enable != val;
if (change) {
+ hda_nid_t *d;
codec->spdif_in_enable = val;
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1, val);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1, val);
}
mutex_unlock(&codec->spdif_mutex);
return change;
@@ -2589,15 +2610,30 @@ int snd_hda_input_mux_put(struct hda_codec *codec,
static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
unsigned int stream_tag, unsigned int format)
{
+ hda_nid_t *d;
+
/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
- if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
+ if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
+ codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
+ }
snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
/* turn on again (if needed) */
- if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
+ if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & 0xff);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
+ codec->spdif_ctls & 0xff);
+ }
+
}
/*
@@ -2621,8 +2657,12 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
unsigned int format,
struct snd_pcm_substream *substream)
{
+ hda_nid_t *nid;
mutex_lock(&codec->spdif_mutex);
setup_dig_out_stream(codec, mout->dig_out_nid, stream_tag, format);
+ if (codec->slave_dig_outs)
+ for (nid = codec->slave_dig_outs; *nid; nid++)
+ setup_dig_out_stream(codec, *nid, stream_tag, format);
mutex_unlock(&codec->spdif_mutex);
return 0;
}
@@ -2689,6 +2729,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
hda_nid_t *nids = mout->dac_nids;
+ hda_nid_t *d;
int chs = substream->runtime->channels;
int i;
@@ -2702,9 +2743,16 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
mout->dig_out_used = HDA_DIG_ANALOG_DUP;
setup_dig_out_stream(codec, mout->dig_out_nid,
stream_tag, format);
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ setup_dig_out_stream(codec, *d,
+ stream_tag, format);
} else {
mout->dig_out_used = 0;
snd_hda_codec_cleanup_stream(codec, mout->dig_out_nid);
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_cleanup_stream(codec, *d);
}
}
mutex_unlock(&codec->spdif_mutex);
diff --git a/pci/hda/hda_codec.h b/pci/hda/hda_codec.h
index 780e2ff..60468f5 100644
--- a/pci/hda/hda_codec.h
+++ b/pci/hda/hda_codec.h
@@ -725,6 +725,7 @@ struct hda_codec {
unsigned int spdif_status; /* IEC958 status bits */
unsigned short spdif_ctls; /* SPDIF control bits */
unsigned int spdif_in_enable; /* SPDIF input enable? */
+ hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
struct snd_hwdep *hwdep; /* assigned hwdep device */
2
1
Hi,
Please consider this changeset. It was partially tested, but additional
testing will be appreciated. pxa3xx was only compile tested.
The following changes since commit 6a55617ed5d1aa62b850de2cf66f5ede2eef4825:
Linus Torvalds (1):
Linux v2.6.27-rc4
are available in the git repository at:
git://git.infradead.org/users/dbaryshkov/zaurus-2.6.git pxa2xx-asoc-cleanup
Dmitry Baryshkov (4):
Permit simultaneous compilation of both PXA AC97 drivers
Separate common pxa2xx-ac97 code
Make pxa-ac97-lib separate module
Separate common pxa2xx-pcm code
Russ Dill (1):
pxa2xx-lib: support building for several pxa's
arch/arm/mach-pxa/include/mach/pxa-regs.h | 4 +-
include/sound/pxa2xx-lib.h | 45 +++++
sound/arm/Kconfig | 9 +-
sound/arm/Makefile | 4 +
sound/arm/pxa2xx-ac97-lib.c | 297 +++++++++++++++++++++++++++++
sound/arm/pxa2xx-ac97.c | 247 ++----------------------
sound/arm/pxa2xx-pcm-lib.c | 277 +++++++++++++++++++++++++++
sound/arm/pxa2xx-pcm.c | 252 +-----------------------
sound/arm/pxa2xx-pcm.h | 13 +-
sound/soc/pxa/Kconfig | 3 +
sound/soc/pxa/pxa2xx-ac97.c | 272 +-------------------------
sound/soc/pxa/pxa2xx-i2s.c | 26 ++-
sound/soc/pxa/pxa2xx-pcm.c | 265 +-------------------------
sound/soc/pxa/pxa2xx-pcm.h | 15 --
14 files changed, 707 insertions(+), 1022 deletions(-)
create mode 100644 include/sound/pxa2xx-lib.h
create mode 100644 sound/arm/pxa2xx-ac97-lib.c
create mode 100644 sound/arm/pxa2xx-pcm-lib.c
--
With best wishes
Dmitry
5
16
On Mon, 2008-09-08 at 15:02 +0530, umeshyv wrote:
> Hi Sir,
> Thanks for your reply.I downloaded asoc patch for au1x but some files
> are missing like board setup files and exm32.h,exm1200.h.
au1x is in mainline now. There is probably no need for a patch. Please
use an up to date kernel.
> And where did you define the frequency controller details.Can I get
> the complete patch of au1x.I dont have a exact patch recently I used
> another patch there psc-i2s.c is modified a bit little.I am working on
> Au1200 to it tsc2301 is interfaced and Au1200 acts as master and MCLK
> is generated using Au1200 frequency controller,my question is where I
> am supposed define it.
You will need to write a small machine driver to define all your
board/machine specific details. There are quite a few examples under
sound/soc/
> One more query is that for example consider the following code,
>
> SOC_ENUM_SINGLE(CS4251X_VOLTRANSCTL, 4, 4,cs_vol_transition)
>
> SOC_DOUBLE_R("Channel 4 Playback Volume", CS4251X_L4VOL, CS4251X_R4VOL, 0, 255, 1).
>
>
> It tries to control volume transition and secondly volume
> adjustment .Generally register access to codec is done using SPI or
> I2C .So special functions like cs4251x_write(codec,<reg>,<value>) been
> developed for register access.When using SOC_DOUBLE_R or SOC_SINGLE
> etc how it access special functions to write to those specific codec
> registers can get explanation.
They ultimately call either i2C_write or spi_write. Please read the
documentation in Documentation/sound/alsa/soc/
> Can you provide me Asoc driver for DbAu1200 board.And following is the
> way i compiled libs and utils and I use buildroot to compile the libs
> and utils
>
> Libs compilation
> -------------------------------
> $PATH to buildroot
> $./configure --host=mipsel-linux --prefix=/home/audio
> --enable-shared=no --enable-static=yes
> $make
> $make install
>
> Utils Compilation
> ---------------------------------
> $export ALSA_CFLAGS=-I/home/audio/include
> $export ALSA_LIBS="-L/home/audio/lib -lasound -lm -ldl -lpthread"
> $./configure --host=mipsel-linux --prefix=/home/audio
> --with-alsa-prefix=/home/audio/lib
> --with-alsa-inc-prefix=/home/audio/include
> $make
> $make install
>
> All my installed libs and utils goes to /home/audio .Is there anything
> missing in configurtion and after compilation I copy /bin,/sbin,/lib
> to rootfs and then /share to /usr/share.I am going wrong
> anywhere.Waiting for your valuable reply.
This looks like it may be either a buildroot problem or you are missing
some other buildroot alsa packages containing the conf files.
Liam
1
0
Hi,
I am trying to write a DAI.
I am working with a wolfson wm8731 and an atmel at91sam9g20. Basically I
had a look at the file eti_b1_wm8731.c, but I would like to use another
ssc archi(atmel_ssc instead of at91_ssc).
So I would like to know where should I find some info concerning the DAI.
Regards,
Sedji
3
4
Hi,
While unifying pxa2xx-pcm drivers (ASoC and plain one) I've encountered the
following differences in snd_pcm_open:
1. ASoC one uses snd_soc_set_runtime_hardware() function instead of
just copying runtime->hw = pxa2xx_pcm_hardware;
However the major difference is that snd_soc_set_runtime_hardware() doesn't
initialise few fields which are set later in generic soc_pcm_open().
Can I drop this call and use the same assignment as in non-asoc driver.
2. To enforce some constraints ASoC driver uses generic
snd_pcm_hw_constraint_step() instead of hand-written rule functions.
Can this be also unified or there are some hidden differencies?
--
With best wishes
Dmitry
2
1
Hi to all,
Currently working on Asoc for Au1200.I need to know whether the framework is
completed since I see some of the files missing in the all versions of the
kernel and moreover I am trying to compile alsa libs and utils ,it compiled
successfully but when I run at the target
sh-3.2# aplay -c1 -r8000 -fs8 Infected.wav
ALSA lib conf.c:3009:(snd_config_update_r) Cannot
access file /home/alsa/install/share/alsa/alsa.conf
ALSA lib pcm.c:2184:(snd_pcm_open_noupdate) Unknown
PCM default
aplay: main:583: audio open error: No such file or
directory
Do I need to export any PATH at the target.Can anyone guide me.
Thanks & Regards
Umesh
2
1
Hi to all,
Currently working on Asoc for Au1200.I need to know whether the framework is
completed since I see some of the files missing in the all versions of the
kernel and moreover I am trying to compile alsa libs and utils ,it compiled
successfully but when I run at the target
sh-3.2# aplay -c1 -r8000 -fs8 Infected.wav
ALSA lib conf.c:3009:(snd_config_update_r) Cannot
access file /home/alsa/install/share/alsa/alsa.conf
ALSA lib pcm.c:2184:(snd_pcm_open_noupdate) Unknown
PCM default
aplay: main:583: audio open error: No such file or
directory
Do I need to export any PATH at the target.Can anyone guide me.
Thanks & Regards
Umesh
1
0
before:
total: 113 errors, 169 warnings, 2786 lines checked
total: 26 errors, 24 warnings, 504 lines checked
after:
total: 14 errors, 163 warnings, 2799 lines checked
total: 0 errors, 24 warnings, 504 lines checked
Compile tested only.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ice1712/ice1712.c | 237 +++++++++++++++++++++++--------------------
sound/pci/ice1712/ice1712.h | 52 +++++-----
2 files changed, 151 insertions(+), 138 deletions(-)
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 05ffab6..5b44238 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
/*
NOTES:
@@ -35,7 +35,7 @@
*
* 2002.11.26 James Stafford <jstafford(a)ampltd.com>
* Added support for VT1724 (Envy24HT)
- * I have left out support for 176.4 and 192 KHz for the moment.
+ * I have left out support for 176.4 and 192 KHz for the moment.
* I also haven't done anything with the internal S/PDIF transmitter or the MPU-401
*
* 2003.02.20 Taksahi Iwai <tiwai(a)suse.de>
@@ -47,7 +47,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -123,7 +123,7 @@ static unsigned int PRO_RATE_DEFAULT = 44100;
/*
* Basic I/O
*/
-
+
/* check whether the clock mode is spdif-in */
static inline int is_spdif_master(struct snd_ice1712 *ice)
{
@@ -135,13 +135,13 @@ static inline int is_pro_rate_locked(struct snd_ice1712 *ice)
return is_spdif_master(ice) || PRO_RATE_LOCKED;
}
-static inline void snd_ice1712_ds_write(struct snd_ice1712 * ice, u8 channel, u8 addr, u32 data)
+static inline void snd_ice1712_ds_write(struct snd_ice1712 *ice, u8 channel, u8 addr, u32 data)
{
outb((channel << 4) | addr, ICEDS(ice, INDEX));
outl(data, ICEDS(ice, DATA));
}
-static inline u32 snd_ice1712_ds_read(struct snd_ice1712 * ice, u8 channel, u8 addr)
+static inline u32 snd_ice1712_ds_read(struct snd_ice1712 *ice, u8 channel, u8 addr)
{
outb((channel << 4) | addr, ICEDS(ice, INDEX));
return inl(ICEDS(ice, DATA));
@@ -260,7 +260,7 @@ static unsigned short snd_ice1712_pro_ac97_read(struct snd_ac97 *ac97,
static int snd_ice1712_digmix_route_ac97_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_ROUTECTRL)) & ICE1712_ROUTE_AC97 ? 1 : 0;
return 0;
}
@@ -269,11 +269,12 @@ static int snd_ice1712_digmix_route_ac97_put(struct snd_kcontrol *kcontrol, stru
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val, nval;
-
+
spin_lock_irq(&ice->reg_lock);
val = inb(ICEMT(ice, MONITOR_ROUTECTRL));
nval = val & ~ICE1712_ROUTE_AC97;
- if (ucontrol->value.integer.value[0]) nval |= ICE1712_ROUTE_AC97;
+ if (ucontrol->value.integer.value[0])
+ nval |= ICE1712_ROUTE_AC97;
outb(nval, ICEMT(ice, MONITOR_ROUTECTRL));
spin_unlock_irq(&ice->reg_lock);
return val != nval;
@@ -329,7 +330,7 @@ static int snd_ice1712_cs8427_set_input_clock(struct snd_ice1712 *ice, int spdif
unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */
unsigned char val, nval;
int res = 0;
-
+
snd_i2c_lock(ice->i2c);
if (snd_i2c_sendbytes(ice->cs8427, reg, 1) != 1) {
snd_i2c_unlock(ice->i2c);
@@ -381,9 +382,9 @@ int __devinit snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
{
int err;
- if ((err = snd_cs8427_create(ice->i2c, addr,
- (ice->cs8427_timeout * HZ) / 1000,
- &ice->cs8427)) < 0) {
+ err = snd_cs8427_create(ice->i2c, addr,
+ (ice->cs8427_timeout * HZ) / 1000, &ice->cs8427);
+ if (err < 0) {
snd_printk(KERN_ERR "CS8427 initialization failed\n");
return err;
}
@@ -395,9 +396,9 @@ int __devinit snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
static void snd_ice1712_set_input_clock_source(struct snd_ice1712 *ice, int spdif_is_master)
{
- /* change CS8427 clock source too */
- if (ice->cs8427)
- snd_ice1712_cs8427_set_input_clock(ice, spdif_is_master);
+ /* change CS8427 clock source too */
+ if (ice->cs8427)
+ snd_ice1712_cs8427_set_input_clock(ice, spdif_is_master);
/* notify ak4524 chip as well */
if (spdif_is_master) {
unsigned int i;
@@ -457,11 +458,12 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id)
u16 pbkstatus;
struct snd_pcm_substream *substream;
pbkstatus = inw(ICEDS(ice, INTSTAT));
- //printk("pbkstatus = 0x%x\n", pbkstatus);
+ /* printk("pbkstatus = 0x%x\n", pbkstatus); */
for (idx = 0; idx < 6; idx++) {
if ((pbkstatus & (3 << (idx * 2))) == 0)
continue;
- if ((substream = ice->playback_con_substream_ds[idx]) != NULL)
+ substream = ice->playback_con_substream_ds[idx];
+ if (substream != NULL)
snd_pcm_period_elapsed(substream);
outw(3 << (idx * 2), ICEDS(ice, INTSTAT));
}
@@ -507,7 +509,7 @@ static int snd_ice1712_playback_trigger(struct snd_pcm_substream *substream,
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
int result = 0;
u32 tmp;
-
+
spin_lock(&ice->reg_lock);
tmp = snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL);
if (cmd == SNDRV_PCM_TRIGGER_START) {
@@ -532,7 +534,7 @@ static int snd_ice1712_playback_ds_trigger(struct snd_pcm_substream *substream,
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
int result = 0;
u32 tmp;
-
+
spin_lock(&ice->reg_lock);
tmp = snd_ice1712_ds_read(ice, substream->number * 2, ICE1712_DSC_CONTROL);
if (cmd == SNDRV_PCM_TRIGGER_START) {
@@ -557,7 +559,7 @@ static int snd_ice1712_capture_trigger(struct snd_pcm_substream *substream,
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
int result = 0;
u8 tmp;
-
+
spin_lock(&ice->reg_lock);
tmp = snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL);
if (cmd == SNDRV_PCM_TRIGGER_START) {
@@ -711,8 +713,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *s
return bytes_to_frames(substream->runtime, ptr);
}
-static const struct snd_pcm_hardware snd_ice1712_playback =
-{
+static const struct snd_pcm_hardware snd_ice1712_playback = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -731,8 +732,7 @@ static const struct snd_pcm_hardware snd_ice1712_playback =
.fifo_size = 0,
};
-static const struct snd_pcm_hardware snd_ice1712_playback_ds =
-{
+static const struct snd_pcm_hardware snd_ice1712_playback_ds = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -751,8 +751,7 @@ static const struct snd_pcm_hardware snd_ice1712_playback_ds =
.fifo_size = 0,
};
-static const struct snd_pcm_hardware snd_ice1712_capture =
-{
+static const struct snd_pcm_hardware snd_ice1712_capture = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -788,7 +787,7 @@ static int snd_ice1712_playback_ds_open(struct snd_pcm_substream *substream)
ice->playback_con_substream_ds[substream->number] = substream;
runtime->hw = snd_ice1712_playback_ds;
- spin_lock_irq(&ice->reg_lock);
+ spin_lock_irq(&ice->reg_lock);
tmp = inw(ICEDS(ice, INTMASK)) & ~(1 << (substream->number * 2));
outw(tmp, ICEDS(ice, INTMASK));
spin_unlock_irq(&ice->reg_lock);
@@ -821,7 +820,7 @@ static int snd_ice1712_playback_ds_close(struct snd_pcm_substream *substream)
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
u32 tmp;
- spin_lock_irq(&ice->reg_lock);
+ spin_lock_irq(&ice->reg_lock);
tmp = inw(ICEDS(ice, INTMASK)) | (3 << (substream->number * 2));
outw(tmp, ICEDS(ice, INTMASK));
spin_unlock_irq(&ice->reg_lock);
@@ -870,7 +869,7 @@ static struct snd_pcm_ops snd_ice1712_capture_ops = {
.pointer = snd_ice1712_capture_pointer,
};
-static int __devinit snd_ice1712_pcm(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
+static int __devinit snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm)
{
struct snd_pcm *pcm;
int err;
@@ -900,7 +899,7 @@ static int __devinit snd_ice1712_pcm(struct snd_ice1712 * ice, int device, struc
return 0;
}
-static int __devinit snd_ice1712_pcm_ds(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
+static int __devinit snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm)
{
struct snd_pcm *pcm;
int err;
@@ -1029,14 +1028,14 @@ static void snd_ice1712_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate,
if (inb(ICEMT(ice, PLAYBACK_CONTROL)) & (ICE1712_CAPTURE_START_SHADOW|
ICE1712_PLAYBACK_PAUSE|
ICE1712_PLAYBACK_START)) {
- __out:
+__out:
spin_unlock_irqrestore(&ice->reg_lock, flags);
return;
}
if (!force && is_pro_rate_locked(ice))
goto __out;
- old = inb(ICEMT(ice, RATE));
+ old = inb(ICEMT(ice, RATE));
if (!force && old == val)
goto __out;
outb(val, ICEMT(ice, RATE));
@@ -1123,8 +1122,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substrea
return bytes_to_frames(substream->runtime, ptr);
}
-static const struct snd_pcm_hardware snd_ice1712_playback_pro =
-{
+static const struct snd_pcm_hardware snd_ice1712_playback_pro = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -1143,8 +1141,7 @@ static const struct snd_pcm_hardware snd_ice1712_playback_pro =
.fifo_size = 0,
};
-static const struct snd_pcm_hardware snd_ice1712_capture_pro =
-{
+static const struct snd_pcm_hardware snd_ice1712_capture_pro = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -1238,7 +1235,7 @@ static struct snd_pcm_ops snd_ice1712_capture_pro_ops = {
.pointer = snd_ice1712_capture_pro_pointer,
};
-static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 * ice, int device, struct snd_pcm ** rpcm)
+static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm)
{
struct snd_pcm *pcm;
int err;
@@ -1262,7 +1259,7 @@ static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 * ice, int device,
ice->pcm_pro = pcm;
if (rpcm)
*rpcm = pcm;
-
+
if (ice->cs8427) {
/* assign channels to iec958 */
err = snd_cs8427_iec958_build(ice->cs8427,
@@ -1272,7 +1269,8 @@ static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 * ice, int device,
return err;
}
- if ((err = snd_ice1712_build_pro_mixer(ice)) < 0)
+ err = snd_ice1712_build_pro_mixer(ice);
+ if (err < 0)
return err;
return 0;
}
@@ -1299,7 +1297,7 @@ static int snd_ice1712_pro_mixer_switch_get(struct snd_kcontrol *kcontrol, struc
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
kcontrol->private_value;
-
+
spin_lock_irq(&ice->reg_lock);
ucontrol->value.integer.value[0] =
!((ice->pro_volumes[priv_idx] >> 15) & 1);
@@ -1341,7 +1339,7 @@ static int snd_ice1712_pro_mixer_volume_get(struct snd_kcontrol *kcontrol, struc
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int priv_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id) +
kcontrol->private_value;
-
+
spin_lock_irq(&ice->reg_lock);
ucontrol->value.integer.value[0] =
(ice->pro_volumes[priv_idx] >> 0) & 127;
@@ -1406,7 +1404,7 @@ static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_switch __devinit
static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_switch __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,SWITCH),
+ .name = SNDRV_CTL_NAME_IEC958("Multi ", CAPTURE, SWITCH),
.info = snd_ice1712_pro_mixer_switch_info,
.get = snd_ice1712_pro_mixer_switch_get,
.put = snd_ice1712_pro_mixer_switch_put,
@@ -1428,7 +1426,7 @@ static struct snd_kcontrol_new snd_ice1712_multi_capture_analog_volume __devinit
static struct snd_kcontrol_new snd_ice1712_multi_capture_spdif_volume __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = SNDRV_CTL_NAME_IEC958("Multi ",CAPTURE,VOLUME),
+ .name = SNDRV_CTL_NAME_IEC958("Multi ", CAPTURE, VOLUME),
.info = snd_ice1712_pro_mixer_volume_info,
.get = snd_ice1712_pro_mixer_volume_get,
.put = snd_ice1712_pro_mixer_volume_put,
@@ -1448,7 +1446,7 @@ static int __devinit snd_ice1712_build_pro_mixer(struct snd_ice1712 *ice)
if (err < 0)
return err;
}
-
+
if (ice->num_total_adcs > 0) {
struct snd_kcontrol_new tmp = snd_ice1712_multi_capture_analog_switch;
tmp.count = ice->num_total_adcs;
@@ -1495,7 +1493,7 @@ static void snd_ice1712_mixer_free_ac97(struct snd_ac97 *ac97)
ice->ac97 = NULL;
}
-static int __devinit snd_ice1712_ac97_mixer(struct snd_ice1712 * ice)
+static int __devinit snd_ice1712_ac97_mixer(struct snd_ice1712 *ice)
{
int err, bus_num = 0;
struct snd_ac97_template ac97;
@@ -1510,27 +1508,32 @@ static int __devinit snd_ice1712_ac97_mixer(struct snd_ice1712 * ice)
};
if (ice_has_con_ac97(ice)) {
- if ((err = snd_ac97_bus(ice->card, bus_num++, &con_ops, NULL, &pbus)) < 0)
+ err = snd_ac97_bus(ice->card, bus_num++, &con_ops, NULL, &pbus);
+ if (err < 0)
return err;
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = ice;
ac97.private_free = snd_ice1712_mixer_free_ac97;
- if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
+ err = snd_ac97_mixer(pbus, &ac97, &ice->ac97);
+ if (err < 0)
printk(KERN_WARNING "ice1712: cannot initialize ac97 for consumer, skipped\n");
else {
- if ((err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice))) < 0)
+ err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice));
+ if (err < 0)
return err;
return 0;
}
}
- if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) {
- if ((err = snd_ac97_bus(ice->card, bus_num, &pro_ops, NULL, &pbus)) < 0)
+ if (!(ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) {
+ err = snd_ac97_bus(ice->card, bus_num, &pro_ops, NULL, &pbus);
+ if (err < 0)
return err;
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = ice;
ac97.private_free = snd_ice1712_mixer_free_ac97;
- if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
+ err = snd_ac97_mixer(pbus, &ac97, &ice->ac97);
+ if (err < 0)
printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n");
else
return 0;
@@ -1549,7 +1552,7 @@ static inline unsigned int eeprom_double(struct snd_ice1712 *ice, int idx)
return (unsigned int)ice->eeprom.data[idx] | ((unsigned int)ice->eeprom.data[idx + 1] << 8);
}
-static void snd_ice1712_proc_read(struct snd_info_entry *entry,
+static void snd_ice1712_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ice1712 *ice = entry->private_data;
@@ -1585,15 +1588,15 @@ static void snd_ice1712_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " SPDOUT : 0x%04x\n", (unsigned)inw(ICEMT(ice, ROUTE_SPDOUT)));
snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE)));
snd_iprintf(buffer, " GPIO_DATA : 0x%02x\n", (unsigned)snd_ice1712_get_gpio_data(ice));
- snd_iprintf(buffer, " GPIO_WRITE_MASK : 0x%02x\n", (unsigned)snd_ice1712_read(ice, ICE1712_IREG_GPIO_WRITE_MASK));
+ snd_iprintf(buffer, " GPIO_WRITE_MASK : 0x%02x\n", (unsigned)snd_ice1712_read(ice, ICE1712_IREG_GPIO_WRITE_MASK));
snd_iprintf(buffer, " GPIO_DIRECTION : 0x%02x\n", (unsigned)snd_ice1712_read(ice, ICE1712_IREG_GPIO_DIRECTION));
}
-static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice)
+static void __devinit snd_ice1712_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ice->card, "ice1712", &entry))
+ if (!snd_card_proc_new(ice->card, "ice1712", &entry))
snd_info_set_text_ops(entry, ice, snd_ice1712_proc_read);
}
@@ -1613,7 +1616,7 @@ static int snd_ice1712_eeprom_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
-
+
memcpy(ucontrol->value.bytes.data, &ice->eeprom, sizeof(ice->eeprom));
return 0;
}
@@ -1641,7 +1644,7 @@ static int snd_ice1712_spdif_default_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (ice->spdif.ops.default_get)
- ice->spdif.ops.default_get(ice, ucontrol);
+ ice->spdif.ops.default_get(ice, ucontrol);
return 0;
}
@@ -1657,7 +1660,7 @@ static int snd_ice1712_spdif_default_put(struct snd_kcontrol *kcontrol,
static struct snd_kcontrol_new snd_ice1712_spdif_default __devinitdata =
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
.info = snd_ice1712_spdif_info,
.get = snd_ice1712_spdif_default_get,
.put = snd_ice1712_spdif_default_put
@@ -1709,7 +1712,7 @@ static struct snd_kcontrol_new snd_ice1712_spdif_maskc __devinitdata =
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, CON_MASK),
.info = snd_ice1712_spdif_info,
.get = snd_ice1712_spdif_maskc_get,
};
@@ -1718,7 +1721,7 @@ static struct snd_kcontrol_new snd_ice1712_spdif_maskp __devinitdata =
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, PRO_MASK),
.info = snd_ice1712_spdif_info,
.get = snd_ice1712_spdif_maskp_get,
};
@@ -1746,7 +1749,7 @@ static struct snd_kcontrol_new snd_ice1712_spdif_stream __devinitdata =
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_INACTIVE),
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, PCM_STREAM),
.info = snd_ice1712_spdif_info,
.get = snd_ice1712_spdif_stream_get,
.put = snd_ice1712_spdif_stream_put
@@ -1758,7 +1761,7 @@ int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol,
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0;
-
+
snd_ice1712_save_gpio_status(ice);
ucontrol->value.integer.value[0] =
(snd_ice1712_gpio_read(ice) & mask ? 1 : 0) ^ invert;
@@ -1825,7 +1828,7 @@ static int snd_ice1712_pro_internal_clock_get(struct snd_kcontrol *kcontrol,
9, 6, 3, 1, 7, 4, 0, 12, 8, 5, 2, 11, 255, 255, 255, 10
};
unsigned char val;
-
+
spin_lock_irq(&ice->reg_lock);
if (is_spdif_master(ice)) {
ucontrol->value.enumerated.item[0] = 13;
@@ -1867,7 +1870,7 @@ static int snd_ice1712_pro_internal_clock_put(struct snd_kcontrol *kcontrol,
if ((oval & ICE1712_SPDIF_MASTER) !=
(inb(ICEMT(ice, RATE)) & ICE1712_SPDIF_MASTER))
- snd_ice1712_set_input_clock_source(ice, is_spdif_master(ice));
+ snd_ice1712_set_input_clock_source(ice, is_spdif_master(ice));
return change;
}
@@ -1897,7 +1900,7 @@ static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcon
"64000", /* 10: 15 */
"88200", /* 11: 11 */
"96000", /* 12: 7 */
- // "IEC958 Input", /* 13: -- */
+ /* "IEC958 Input", 13: -- */
};
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
@@ -2026,7 +2029,7 @@ static int snd_ice1712_pro_route_info(struct snd_kcontrol *kcontrol,
"IEC958 In L", "IEC958 In R", /* 9-10 */
"Digital Mixer", /* 11 - optional */
};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items =
@@ -2070,7 +2073,7 @@ static int snd_ice1712_pro_route_analog_put(struct snd_kcontrol *kcontrol,
int change, shift;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned int val, old_val, nval;
-
+
/* update PSDOUT */
if (ucontrol->value.enumerated.item[0] >= 11)
nval = idx < 2 ? 1 : 0; /* dig mixer (or pcm) */
@@ -2140,7 +2143,7 @@ static int snd_ice1712_pro_route_spdif_put(struct snd_kcontrol *kcontrol,
int change, shift;
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
unsigned int val, old_val, nval;
-
+
/* update SPDOUT */
spin_lock_irq(&ice->reg_lock);
val = old_val = inw(ICEMT(ice, ROUTE_SPDOUT));
@@ -2182,7 +2185,7 @@ static struct snd_kcontrol_new snd_ice1712_mixer_pro_analog_route __devinitdata
static struct snd_kcontrol_new snd_ice1712_mixer_pro_spdif_route __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route",
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, NONE) "Route",
.info = snd_ice1712_pro_route_info,
.get = snd_ice1712_pro_route_spdif_get,
.put = snd_ice1712_pro_route_spdif_put,
@@ -2204,7 +2207,7 @@ static int snd_ice1712_pro_volume_rate_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = inb(ICEMT(ice, MONITOR_RATE));
return 0;
}
@@ -2245,7 +2248,7 @@ static int snd_ice1712_pro_peak_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx;
-
+
spin_lock_irq(&ice->reg_lock);
for (idx = 0; idx < 22; idx++) {
outb(idx, ICEMT(ice, MONITOR_PEAKINDEX));
@@ -2296,12 +2299,12 @@ static int __devinit snd_ice1712_read_eeprom(struct snd_ice1712 *ice,
unsigned int i, size;
struct snd_ice1712_card_info * const *tbl, *c;
- if (! modelname || ! *modelname) {
+ if (!modelname || !*modelname) {
ice->eeprom.subvendor = 0;
if ((inb(ICEREG(ice, I2C_CTRL)) & ICE1712_I2C_EEPROM) != 0)
ice->eeprom.subvendor = (snd_ice1712_read_i2c(ice, dev, 0x00) << 0) |
- (snd_ice1712_read_i2c(ice, dev, 0x01) << 8) |
- (snd_ice1712_read_i2c(ice, dev, 0x02) << 16) |
+ (snd_ice1712_read_i2c(ice, dev, 0x01) << 8) |
+ (snd_ice1712_read_i2c(ice, dev, 0x02) << 16) |
(snd_ice1712_read_i2c(ice, dev, 0x03) << 24);
if (ice->eeprom.subvendor == 0 ||
ice->eeprom.subvendor == (unsigned int)-1) {
@@ -2318,12 +2321,12 @@ static int __devinit snd_ice1712_read_eeprom(struct snd_ice1712 *ice,
}
for (tbl = card_tables; *tbl; tbl++) {
for (c = *tbl; c->subvendor; c++) {
- if (modelname && c->model && ! strcmp(modelname, c->model)) {
+ if (modelname && c->model && !strcmp(modelname, c->model)) {
printk(KERN_INFO "ice1712: Using board model %s\n", c->name);
ice->eeprom.subvendor = c->subvendor;
} else if (c->subvendor != ice->eeprom.subvendor)
continue;
- if (! c->eeprom_size || ! c->eeprom_data)
+ if (!c->eeprom_size || !c->eeprom_data)
goto found;
/* if the EEPROM is given by the driver, use it */
snd_printdd("using the defined eeprom..\n");
@@ -2484,13 +2487,13 @@ static int __devinit snd_ice1712_build_controls(struct snd_ice1712 *ice)
static int snd_ice1712_free(struct snd_ice1712 *ice)
{
- if (! ice->port)
+ if (!ice->port)
goto __hw_end;
/* mask all interrupts */
outb(0xc0, ICEMT(ice, IRQ));
outb(0xff, ICEREG(ice, IRQMASK));
/* --- */
- __hw_end:
+__hw_end:
if (ice->irq >= 0)
free_irq(ice->irq, ice);
@@ -2515,7 +2518,7 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
int omni,
int cs8427_timeout,
int dxr_enable,
- struct snd_ice1712 ** r_ice1712)
+ struct snd_ice1712 **r_ice1712)
{
struct snd_ice1712 *ice;
int err;
@@ -2525,8 +2528,9 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
*r_ice1712 = NULL;
- /* enable PCI device */
- if ((err = pci_enable_device(pci)) < 0)
+ /* enable PCI device */
+ err = pci_enable_device(pci);
+ if (err < 0)
return err;
/* check, if we can restrict PCI DMA transfers to 28 bits */
if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
@@ -2570,7 +2574,8 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
snd_ice1712_proc_init(ice);
synchronize_irq(pci->irq);
- if ((err = pci_request_regions(pci, "ICE1712")) < 0) {
+ err = pci_request_regions(pci, "ICE1712");
+ if (err < 0) {
kfree(ice);
pci_disable_device(pci);
return err;
@@ -2586,7 +2591,7 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
snd_ice1712_free(ice);
return -EIO;
}
-
+
ice->irq = pci->irq;
if (snd_ice1712_read_eeprom(ice, modelname) < 0) {
@@ -2606,9 +2611,10 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
ICEREG(ice, IRQMASK));
outb(0x00, ICEMT(ice, IRQ));
- if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops)) < 0) {
+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops);
+ if (err < 0) {
snd_ice1712_free(ice);
- return err;
+ return err;
}
snd_card_set_dev(card, &pci->dev);
@@ -2648,10 +2654,10 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
strcpy(card->driver, "ICE1712");
strcpy(card->shortname, "ICEnsemble ICE1712");
-
- if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev],
- cs8427_timeout[dev], dxr_enable[dev],
- &ice)) < 0) {
+
+ err = snd_ice1712_create(card, pci, model[dev], omni[dev],
+ cs8427_timeout[dev], dxr_enable[dev], &ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
@@ -2663,7 +2669,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
if (c->driver) /* specific driver? */
strcpy(card->driver, c->driver);
if (c->chip_init) {
- if ((err = c->chip_init(ice)) < 0) {
+ err = c->chip_init(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
@@ -2675,47 +2682,52 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
c = &no_matched;
__found:
- if ((err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL)) < 0) {
+ err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL);
+ if (err < 0) {
snd_card_free(card);
return err;
}
-
+
if (ice_has_con_ac97(ice))
- if ((err = snd_ice1712_pcm(ice, pcm_dev++, NULL)) < 0) {
+ err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
+ if (err < 0) {
snd_card_free(card);
return err;
}
- if ((err = snd_ice1712_ac97_mixer(ice)) < 0) {
+ err = snd_ice1712_ac97_mixer(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
- if ((err = snd_ice1712_build_controls(ice)) < 0) {
+ err = snd_ice1712_build_controls(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
if (c->build_controls) {
- if ((err = c->build_controls(ice)) < 0) {
+ err = c->build_controls(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
}
if (ice_has_con_ac97(ice))
- if ((err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL)) < 0) {
+ err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
+ if (err < 0) {
snd_card_free(card);
return err;
}
- if (! c->no_mpu401) {
- if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
- ICEREG(ice, MPU1_CTRL),
- (c->mpu401_1_info_flags |
- MPU401_INFO_INTEGRATED),
- ice->irq, 0,
- &ice->rmidi[0])) < 0) {
+ if (!c->no_mpu401) {
+ err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
+ ICEREG(ice, MPU1_CTRL),
+ (c->mpu401_1_info_flags | MPU401_INFO_INTEGRATED),
+ ice->irq, 0, &ice->rmidi[0]);
+ if (err < 0) {
snd_card_free(card);
return err;
}
@@ -2727,12 +2739,12 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
if (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) {
/* 2nd port used */
- if ((err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712,
- ICEREG(ice, MPU2_CTRL),
- (c->mpu401_2_info_flags |
- MPU401_INFO_INTEGRATED),
- ice->irq, 0,
- &ice->rmidi[1])) < 0) {
+ err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712,
+ ICEREG(ice, MPU2_CTRL),
+ (c->mpu401_2_info_flags | MPU401_INFO_INTEGRATED),
+ ice->irq, 0, &ice->rmidi[1]);
+
+ if (err < 0) {
snd_card_free(card);
return err;
}
@@ -2750,7 +2762,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
sprintf(card->longname, "%s at 0x%lx, irq %i",
card->shortname, ice->port, ice->irq);
- if ((err = snd_card_register(card)) < 0) {
+ err = snd_card_register(card);
+ if (err < 0) {
snd_card_free(card);
return err;
}
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 762fbd7..fdae6de 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#include <sound/control.h>
#include <sound/ac97_codec.h>
@@ -112,7 +112,7 @@
*/
#define ICEDS(ice, x) ((ice)->dmapath_port + ICE1712_DS_##x)
-
+
#define ICE1712_DS_INTMASK 0x00 /* word - interrupt mask */
#define ICE1712_DS_INTSTAT 0x02 /* word - interrupt status */
#define ICE1712_DS_DATA 0x04 /* dword - channel data */
@@ -121,7 +121,7 @@
/*
* Consumer section channel registers
*/
-
+
#define ICE1712_DSC_ADDR0 0x00 /* dword - base address 0 */
#define ICE1712_DSC_COUNT0 0x01 /* word - count 0 */
#define ICE1712_DSC_ADDR1 0x02 /* dword - base address 1 */
@@ -138,7 +138,7 @@
#define ICE1712_DSC_RATE 0x05 /* dword - rate */
#define ICE1712_DSC_VOLUME 0x06 /* word - volume control */
-/*
+/*
* Professional multi-track direct control registers
*/
@@ -214,7 +214,7 @@
/*
- *
+ *
*/
struct snd_ice1712;
@@ -253,12 +253,12 @@ enum {
ICE_EEP1_ADC_ID2,
ICE_EEP1_ADC_ID3
};
-
+
#define ice_has_con_ac97(ice) (!((ice)->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_NO_CON_AC97))
struct snd_ak4xxx_private {
- unsigned int cif: 1; /* CIF mode */
+ unsigned int cif:1; /* CIF mode */
unsigned char caddr; /* C0 and C1 bits */
unsigned int data_mask; /* DATA gpio bit */
unsigned int clk_mask; /* CLK gpio bit */
@@ -306,11 +306,11 @@ struct snd_ice1712 {
struct snd_pcm *pcm;
struct snd_pcm *pcm_ds;
struct snd_pcm *pcm_pro;
- struct snd_pcm_substream *playback_con_substream;
- struct snd_pcm_substream *playback_con_substream_ds[6];
- struct snd_pcm_substream *capture_con_substream;
- struct snd_pcm_substream *playback_pro_substream;
- struct snd_pcm_substream *capture_pro_substream;
+ struct snd_pcm_substream *playback_con_substream;
+ struct snd_pcm_substream *playback_con_substream_ds[6];
+ struct snd_pcm_substream *capture_con_substream;
+ struct snd_pcm_substream *playback_pro_substream;
+ struct snd_pcm_substream *capture_pro_substream;
unsigned int playback_pro_size;
unsigned int capture_pro_size;
unsigned int playback_con_virt_addr[6];
@@ -326,15 +326,15 @@ struct snd_ice1712 {
struct snd_ice1712_eeprom eeprom;
unsigned int pro_volumes[20];
- unsigned int omni: 1; /* Delta Omni I/O */
- unsigned int dxr_enable: 1; /* Terratec DXR enable for DMX6FIRE */
- unsigned int vt1724: 1;
- unsigned int vt1720: 1;
- unsigned int has_spdif: 1; /* VT1720/4 - has SPDIF I/O */
- unsigned int force_pdma4: 1; /* VT1720/4 - PDMA4 as non-spdif */
- unsigned int force_rdma1: 1; /* VT1720/4 - RDMA1 as non-spdif */
- unsigned int midi_output: 1; /* VT1720/4: MIDI output triggered */
- unsigned int midi_input: 1; /* VT1720/4: MIDI input triggered */
+ unsigned int omni:1; /* Delta Omni I/O */
+ unsigned int dxr_enable:1; /* Terratec DXR enable for DMX6FIRE */
+ unsigned int vt1724:1;
+ unsigned int vt1720:1;
+ unsigned int has_spdif:1; /* VT1720/4 - has SPDIF I/O */
+ unsigned int force_pdma4:1; /* VT1720/4 - PDMA4 as non-spdif */
+ unsigned int force_rdma1:1; /* VT1720/4 - RDMA1 as non-spdif */
+ unsigned int midi_output:1; /* VT1720/4: MIDI output triggered */
+ unsigned int midi_input:1; /* VT1720/4: MIDI input triggered */
unsigned int num_total_dacs; /* total DACs */
unsigned int num_total_adcs; /* total ADCs */
unsigned int cur_rate; /* current rate */
@@ -351,7 +351,7 @@ struct snd_ice1712 {
struct snd_i2c_bus *i2c; /* I2C bus */
struct snd_i2c_device *cs8427; /* CS8427 I2C device */
unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */
-
+
struct ice1712_gpio {
unsigned int direction; /* current direction bits */
unsigned int write_mask; /* current mask bits */
@@ -455,7 +455,7 @@ static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,
{
ice->gpio.direction &= ~mask;
snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
- return (snd_ice1712_gpio_read(ice) & mask);
+ return snd_ice1712_gpio_read(ice) & mask;
}
int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice);
@@ -467,13 +467,13 @@ int snd_ice1712_akm4xxx_build_controls(struct snd_ice1712 *ice);
int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr);
-static inline void snd_ice1712_write(struct snd_ice1712 * ice, u8 addr, u8 data)
+static inline void snd_ice1712_write(struct snd_ice1712 *ice, u8 addr, u8 data)
{
outb(addr, ICEREG(ice, INDEX));
outb(data, ICEREG(ice, DATA));
}
-static inline u8 snd_ice1712_read(struct snd_ice1712 * ice, u8 addr)
+static inline u8 snd_ice1712_read(struct snd_ice1712 *ice, u8 addr)
{
outb(addr, ICEREG(ice, INDEX));
return inb(ICEREG(ice, DATA));
@@ -491,7 +491,7 @@ struct snd_ice1712_card_info {
char *driver;
int (*chip_init)(struct snd_ice1712 *);
int (*build_controls)(struct snd_ice1712 *);
- unsigned int no_mpu401: 1;
+ unsigned int no_mpu401:1;
unsigned int mpu401_1_info_flags;
unsigned int mpu401_2_info_flags;
const char *mpu401_1_name;
2
3

[alsa-devel] [PATCH] phase and juli coding style fixes (more coming up)
by Vedran Miletić 07 Sep '08
by Vedran Miletić 07 Sep '08
07 Sep '08
From my signoff:
From b4a282ae0d54087bc152571c250afcd57fa9fa38 Mon Sep 17 00:00:00 2001
From: Vedran Miletic <rivanvx(a)gmail.com>
Date: Sun, 7 Sep 2008 11:22:35 +0200
Subject: [PATCH] ALSA: ice1712/ice1724: Coding style fixes part 1
(more coming up)
Inspired by Alexander Beregalov's patches for wtm and aureon.c,
I decided to run checkpatch on some more files. After some work
checkpatch.pl-0.23 --no-tree --file --strict <file> reports
0 errors, 0 warnings, 0 checks, n lines checked for:
phase.c
phase.h
juli.c (1 check about unused code, maybe we should comment it)
juli.h (no changes necessary)
In other files I have just fixed // comments and long lines along the
way (but not all of them), more coming up.
Signed-off-by: Vedran Miletic <rivanvx(a)gmail.com>
Patch is attached.
--
Vedran Miletić
2
3

07 Sep '08
Removed unneeded hp_nid references for 92hd73xx codec family.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index 6ad6ef3..5b715a7 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -3775,17 +3775,14 @@ again:
switch (spec->multiout.num_dacs) {
case 0x3: /* 6 Channel */
- spec->multiout.hp_nid = 0x17;
spec->mixer = stac92hd73xx_6ch_mixer;
spec->init = stac92hd73xx_6ch_core_init;
break;
case 0x4: /* 8 Channel */
- spec->multiout.hp_nid = 0x18;
spec->mixer = stac92hd73xx_8ch_mixer;
spec->init = stac92hd73xx_8ch_core_init;
break;
case 0x5: /* 10 Channel */
- spec->multiout.hp_nid = 0x19;
spec->mixer = stac92hd73xx_10ch_mixer;
spec->init = stac92hd73xx_10ch_core_init;
};
2
1
before:
total: 96 errors, 66 warnings, 2612 lines checked
after:
total: 11 errors, 64 warnings, 2624 lines checked
Compile tested only.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ice1712/ice1724.c | 180 +++++++++++++++++++++++--------------------
1 files changed, 96 insertions(+), 84 deletions(-)
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 7bb99df..1b3f117 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -105,7 +105,7 @@ static unsigned int PRO_RATE_DEFAULT = 44100;
/*
* Basic I/O
*/
-
+
/*
* default rates, default clock routines
*/
@@ -198,7 +198,7 @@ static void snd_vt1724_set_gpio_dir(struct snd_ice1712 *ice, unsigned int data)
static void snd_vt1724_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data)
{
outw(data, ICEREG1724(ice, GPIO_WRITE_MASK));
- if (! ice->vt1720) /* VT1720 supports only 16 GPIO bits */
+ if (!ice->vt1720) /* VT1720 supports only 16 GPIO bits */
outb((data >> 16) & 0xff, ICEREG1724(ice, GPIO_WRITE_MASK_22));
inw(ICEREG1724(ice, GPIO_WRITE_MASK)); /* dummy read for pci-posting */
}
@@ -206,7 +206,7 @@ static void snd_vt1724_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data)
static void snd_vt1724_set_gpio_data(struct snd_ice1712 *ice, unsigned int data)
{
outw(data, ICEREG1724(ice, GPIO_DATA));
- if (! ice->vt1720)
+ if (!ice->vt1720)
outb(data >> 16, ICEREG1724(ice, GPIO_DATA_22));
inw(ICEREG1724(ice, GPIO_DATA)); /* dummy read for pci-posting */
}
@@ -214,7 +214,7 @@ static void snd_vt1724_set_gpio_data(struct snd_ice1712 *ice, unsigned int data)
static unsigned int snd_vt1724_get_gpio_data(struct snd_ice1712 *ice)
{
unsigned int data;
- if (! ice->vt1720)
+ if (!ice->vt1720)
data = (unsigned int)inb(ICEREG1724(ice, GPIO_DATA_22));
else
data = 0;
@@ -399,7 +399,7 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id)
break;
}
#endif
- handled = 1;
+ handled = 1;
if (status & VT1724_IRQ_MPU_TX) {
spin_lock(&ice->reg_lock);
if (ice->midi_output)
@@ -468,8 +468,8 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id)
/* ought to really handle this properly */
if (mtstat & VT1724_MULTI_FIFO_ERR) {
unsigned char fstat = inb(ICEMT1724(ice, DMA_FIFO_ERR));
- outb(fstat, ICEMT1724(ice, DMA_FIFO_ERR));
- outb(VT1724_MULTI_FIFO_ERR | inb(ICEMT1724(ice, DMA_INT_MASK)), ICEMT1724(ice, DMA_INT_MASK));
+ outb(fstat, ICEMT1724(ice, DMA_FIFO_ERR));
+ outb(VT1724_MULTI_FIFO_ERR | inb(ICEMT1724(ice, DMA_INT_MASK)), ICEMT1724(ice, DMA_INT_MASK));
/* If I don't do this, I get machine lockup due to continual interrupts */
}
@@ -733,17 +733,17 @@ static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream)
outl(substream->runtime->dma_addr, ICEMT1724(ice, PLAYBACK_ADDR));
size = (snd_pcm_lib_buffer_bytes(substream) >> 2) - 1;
- // outl(size, ICEMT1724(ice, PLAYBACK_SIZE));
+ /* outl(size, ICEMT1724(ice, PLAYBACK_SIZE)); */
outw(size, ICEMT1724(ice, PLAYBACK_SIZE));
outb(size >> 16, ICEMT1724(ice, PLAYBACK_SIZE) + 2);
size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1;
- // outl(size, ICEMT1724(ice, PLAYBACK_COUNT));
+ /* outl(size, ICEMT1724(ice, PLAYBACK_COUNT)); */
outw(size, ICEMT1724(ice, PLAYBACK_COUNT));
outb(size >> 16, ICEMT1724(ice, PLAYBACK_COUNT) + 2);
spin_unlock_irq(&ice->reg_lock);
- // printk("pro prepare: ch = %d, addr = 0x%x, buffer = 0x%x, period = 0x%x\n", substream->runtime->channels, (unsigned int)substream->runtime->dma_addr, snd_pcm_lib_buffer_bytes(substream), snd_pcm_lib_period_bytes(substream));
+ /* printk("pro prepare: ch = %d, addr = 0x%x, buffer = 0x%x, period = 0x%x\n", substream->runtime->channels, (unsigned int)substream->runtime->dma_addr, snd_pcm_lib_buffer_bytes(substream), snd_pcm_lib_period_bytes(substream)); */
return 0;
}
@@ -771,7 +771,7 @@ static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substrea
ptr = inl(ICEMT1724(ice, PLAYBACK_SIZE)) & 0xffffff;
ptr = (ptr + 1) << 2;
ptr = bytes_to_frames(substream->runtime, ptr);
- if (! ptr)
+ if (!ptr)
;
else if (ptr <= substream->runtime->buffer_size)
ptr = substream->runtime->buffer_size - ptr;
@@ -815,7 +815,7 @@ static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substr
ptr = inw(ice->profi_port + reg->size);
ptr = (ptr + 1) << 2;
ptr = bytes_to_frames(substream->runtime, ptr);
- if (! ptr)
+ if (!ptr)
;
else if (ptr <= substream->runtime->buffer_size)
ptr = substream->runtime->buffer_size - ptr;
@@ -842,8 +842,7 @@ static const struct vt1724_pcm_reg vt1724_capture_pro_reg = {
.start = VT1724_RDMA0_START,
};
-static const struct snd_pcm_hardware snd_vt1724_playback_pro =
-{
+static const struct snd_pcm_hardware snd_vt1724_playback_pro = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -861,8 +860,7 @@ static const struct snd_pcm_hardware snd_vt1724_playback_pro =
.periods_max = 1024,
};
-static const struct snd_pcm_hardware snd_vt1724_spdif =
-{
+static const struct snd_pcm_hardware snd_vt1724_spdif = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -883,8 +881,7 @@ static const struct snd_pcm_hardware snd_vt1724_spdif =
.periods_max = 1024,
};
-static const struct snd_pcm_hardware snd_vt1724_2ch_stereo =
-{
+static const struct snd_pcm_hardware snd_vt1724_2ch_stereo = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -1030,7 +1027,7 @@ static struct snd_pcm_ops snd_vt1724_capture_pro_ops = {
.pointer = snd_vt1724_pcm_pointer,
};
-static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 * ice, int device)
+static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device)
{
struct snd_pcm *pcm;
int err;
@@ -1115,7 +1112,7 @@ static void update_spdif_rate(struct snd_ice1712 *ice, unsigned int rate)
static int snd_vt1724_playback_spdif_prepare(struct snd_pcm_substream *substream)
{
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
- if (! ice->force_pdma4)
+ if (!ice->force_pdma4)
update_spdif_rate(ice, substream->runtime->rate);
return snd_vt1724_pcm_prepare(substream);
}
@@ -1215,7 +1212,7 @@ static struct snd_pcm_ops snd_vt1724_capture_spdif_ops = {
};
-static int __devinit snd_vt1724_pcm_spdif(struct snd_ice1712 * ice, int device)
+static int __devinit snd_vt1724_pcm_spdif(struct snd_ice1712 *ice, int device)
{
char *name;
struct snd_pcm *pcm;
@@ -1234,7 +1231,7 @@ static int __devinit snd_vt1724_pcm_spdif(struct snd_ice1712 * ice, int device)
ice->has_spdif = 1;
} else
capt = 0;
- if (! play && ! capt)
+ if (!play && !capt)
return 0; /* no spdif device */
if (ice->force_pdma4 || ice->force_rdma1)
@@ -1349,7 +1346,7 @@ static struct snd_pcm_ops snd_vt1724_playback_indep_ops = {
};
-static int __devinit snd_vt1724_pcm_indep(struct snd_ice1712 * ice, int device)
+static int __devinit snd_vt1724_pcm_indep(struct snd_ice1712 *ice, int device)
{
struct snd_pcm *pcm;
int play;
@@ -1384,11 +1381,11 @@ static int __devinit snd_vt1724_pcm_indep(struct snd_ice1712 * ice, int device)
* Mixer section
*/
-static int __devinit snd_vt1724_ac97_mixer(struct snd_ice1712 * ice)
+static int __devinit snd_vt1724_ac97_mixer(struct snd_ice1712 *ice)
{
int err;
- if (! (ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S)) {
+ if (!(ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S)) {
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
static struct snd_ac97_bus_ops ops = {
@@ -1401,11 +1398,13 @@ static int __devinit snd_vt1724_ac97_mixer(struct snd_ice1712 * ice)
mdelay(5); /* FIXME */
outb(inb(ICEMT1724(ice, AC97_CMD)) & ~0x80, ICEMT1724(ice, AC97_CMD));
- if ((err = snd_ac97_bus(ice->card, 0, &ops, NULL, &pbus)) < 0)
+ err = snd_ac97_bus(ice->card, 0, &ops, NULL, &pbus);
+ if (err < 0)
return err;
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = ice;
- if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
+ err = snd_ac97_mixer(pbus, &ac97, &ice->ac97);
+ if (err < 0)
printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n");
else
return 0;
@@ -1426,7 +1425,7 @@ static inline unsigned int eeprom_triple(struct snd_ice1712 *ice, int idx)
((unsigned int)ice->eeprom.data[idx + 2] << 16);
}
-static void snd_vt1724_proc_read(struct snd_info_entry *entry,
+static void snd_vt1724_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ice1712 *ice = entry->private_data;
@@ -1468,11 +1467,11 @@ static void snd_vt1724_proc_read(struct snd_info_entry *entry,
idx, inb(ice->profi_port+idx));
}
-static void __devinit snd_vt1724_proc_init(struct snd_ice1712 * ice)
+static void __devinit snd_vt1724_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ice->card, "ice1724", &entry))
+ if (!snd_card_proc_new(ice->card, "ice1724", &entry))
snd_info_set_text_ops(entry, ice, snd_vt1724_proc_read);
}
@@ -1492,7 +1491,7 @@ static int snd_vt1724_eeprom_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
-
+
memcpy(ucontrol->value.bytes.data, &ice->eeprom, sizeof(ice->eeprom));
return 0;
}
@@ -1607,13 +1606,13 @@ static int snd_vt1724_spdif_default_put(struct snd_kcontrol *kcontrol,
if (val != old)
update_spdif_bits(ice, val);
spin_unlock_irq(&ice->reg_lock);
- return (val != old);
+ return val != old;
}
static struct snd_kcontrol_new snd_vt1724_spdif_default __devinitdata =
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
.info = snd_vt1724_spdif_info,
.get = snd_vt1724_spdif_default_get,
.put = snd_vt1724_spdif_default_put
@@ -1646,7 +1645,7 @@ static struct snd_kcontrol_new snd_vt1724_spdif_maskc __devinitdata =
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, CON_MASK),
.info = snd_vt1724_spdif_info,
.get = snd_vt1724_spdif_maskc_get,
};
@@ -1655,7 +1654,7 @@ static struct snd_kcontrol_new snd_vt1724_spdif_maskp __devinitdata =
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, PRO_MASK),
.info = snd_vt1724_spdif_info,
.get = snd_vt1724_spdif_maskp_get,
};
@@ -1692,8 +1691,8 @@ static struct snd_kcontrol_new snd_vt1724_spdif_switch __devinitdata =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
/* FIXME: the following conflict with IEC958 Playback Route */
- // .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH),
- .name = SNDRV_CTL_NAME_IEC958("Output ",NONE,SWITCH),
+ /* .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH), */
+ .name = SNDRV_CTL_NAME_IEC958("Output ", NONE, SWITCH),
.info = snd_vt1724_spdif_sw_info,
.get = snd_vt1724_spdif_sw_get,
.put = snd_vt1724_spdif_sw_put
@@ -1713,7 +1712,7 @@ int snd_vt1724_gpio_get(struct snd_kcontrol *kcontrol,
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value & (1<<24)) ? 1 : 0;
-
+
snd_ice1712_save_gpio_status(ice);
ucontrol->value.integer.value[0] =
(snd_ice1712_gpio_read(ice) & (1 << shift) ? 1 : 0) ^ invert;
@@ -1768,7 +1767,7 @@ static int snd_vt1724_pro_internal_clock_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned int i, rate;
-
+
spin_lock_irq(&ice->reg_lock);
if (ice->is_spdif_master(ice)) {
ucontrol->value.enumerated.item[0] = ice->hw_rates->count;
@@ -1924,7 +1923,7 @@ static int snd_vt1724_pro_route_info(struct snd_kcontrol *kcontrol,
"H/W In 0", "H/W In 1", /* 1-2 */
"IEC958 In L", "IEC958 In R", /* 3-4 */
};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 5;
@@ -1954,7 +1953,7 @@ static int get_route_val(struct snd_ice1712 *ice, int shift)
val = inl(ICEMT1724(ice, ROUTE_PLAYBACK));
val >>= shift;
- val &= 7; //we now have 3 bits per output
+ val &= 7; /* we now have 3 bits per output */
eitem = xlate[val];
if (eitem == 255) {
snd_BUG();
@@ -2033,7 +2032,7 @@ static struct snd_kcontrol_new snd_vt1724_mixer_pro_analog_route __devinitdata =
static struct snd_kcontrol_new snd_vt1724_mixer_pro_spdif_route __devinitdata = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route",
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, NONE) "Route",
.info = snd_vt1724_pro_route_info,
.get = snd_vt1724_pro_route_spdif_get,
.put = snd_vt1724_pro_route_spdif_put,
@@ -2056,7 +2055,7 @@ static int snd_vt1724_pro_peak_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx;
-
+
spin_lock_irq(&ice->reg_lock);
for (idx = 0; idx < 22; idx++) {
outb(idx, ICEMT1724(ice, MONITOR_PEAKINDEX));
@@ -2083,7 +2082,7 @@ static struct snd_ice1712_card_info no_matched __devinitdata;
static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
snd_vt1724_revo_cards,
- snd_vt1724_amp_cards,
+ snd_vt1724_amp_cards,
snd_vt1724_aureon_cards,
snd_vt1720_mobo_cards,
snd_vt1720_pontis_cards,
@@ -2121,7 +2120,7 @@ unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice,
wait_i2c_busy(ice);
val = inb(ICEREG1724(ice, I2C_DATA));
mutex_unlock(&ice->i2c_mutex);
- //printk("i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val);
+ /* printk("i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); */
return val;
}
@@ -2130,7 +2129,7 @@ void snd_vt1724_write_i2c(struct snd_ice1712 *ice,
{
mutex_lock(&ice->i2c_mutex);
wait_i2c_busy(ice);
- //printk("i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data);
+ /* printk("i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); */
outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR));
outb(data, ICEREG1724(ice, I2C_DATA));
outb(dev | VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR));
@@ -2145,13 +2144,13 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice,
unsigned int i, size;
struct snd_ice1712_card_info * const *tbl, *c;
- if (! modelname || ! *modelname) {
+ if (!modelname || !*modelname) {
ice->eeprom.subvendor = 0;
if ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_EEPROM) != 0)
ice->eeprom.subvendor =
(snd_vt1724_read_i2c(ice, dev, 0x00) << 0) |
- (snd_vt1724_read_i2c(ice, dev, 0x01) << 8) |
- (snd_vt1724_read_i2c(ice, dev, 0x02) << 16) |
+ (snd_vt1724_read_i2c(ice, dev, 0x01) << 8) |
+ (snd_vt1724_read_i2c(ice, dev, 0x02) << 16) |
(snd_vt1724_read_i2c(ice, dev, 0x03) << 24);
if (ice->eeprom.subvendor == 0 ||
ice->eeprom.subvendor == (unsigned int)-1) {
@@ -2174,13 +2173,13 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice,
for (tbl = card_tables; *tbl; tbl++) {
for (c = *tbl; c->subvendor; c++) {
if (modelname && c->model &&
- ! strcmp(modelname, c->model)) {
+ !strcmp(modelname, c->model)) {
printk(KERN_INFO "ice1724: Using board model %s\n",
c->name);
ice->eeprom.subvendor = c->subvendor;
} else if (c->subvendor != ice->eeprom.subvendor)
continue;
- if (! c->eeprom_size || ! c->eeprom_data)
+ if (!c->eeprom_size || !c->eeprom_data)
goto found;
/* if the EEPROM is given by the driver, use it */
snd_printdd("using the defined eeprom..\n");
@@ -2322,13 +2321,13 @@ static int __devinit snd_vt1724_build_controls(struct snd_ice1712 *ice)
static int snd_vt1724_free(struct snd_ice1712 *ice)
{
- if (! ice->port)
+ if (!ice->port)
goto __hw_end;
/* mask all interrupts */
outb(0xff, ICEMT1724(ice, DMA_INT_MASK));
outb(0xff, ICEREG1724(ice, IRQMASK));
/* --- */
- __hw_end:
+__hw_end:
if (ice->irq >= 0)
free_irq(ice->irq, ice);
pci_release_regions(ice->pci);
@@ -2348,7 +2347,7 @@ static int snd_vt1724_dev_free(struct snd_device *device)
static int __devinit snd_vt1724_create(struct snd_card *card,
struct pci_dev *pci,
const char *modelname,
- struct snd_ice1712 ** r_ice1712)
+ struct snd_ice1712 **r_ice1712)
{
struct snd_ice1712 *ice;
int err;
@@ -2359,8 +2358,9 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
*r_ice1712 = NULL;
- /* enable PCI device */
- if ((err = pci_enable_device(pci)) < 0)
+ /* enable PCI device */
+ err = pci_enable_device(pci);
+ if (err < 0)
return err;
ice = kzalloc(sizeof(*ice), GFP_KERNEL);
@@ -2384,7 +2384,8 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
snd_vt1724_proc_init(ice);
synchronize_irq(pci->irq);
- if ((err = pci_request_regions(pci, "ICE1724")) < 0) {
+ err = pci_request_regions(pci, "ICE1724");
+ if (err < 0) {
kfree(ice);
pci_disable_device(pci);
return err;
@@ -2419,9 +2420,10 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
*/
outb(VT1724_MULTI_FIFO_ERR, ICEMT1724(ice, DMA_INT_MASK));
- if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops)) < 0) {
+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops);
+ if (err < 0) {
snd_vt1724_free(ice);
- return err;
+ return err;
}
snd_card_set_dev(card, &pci->dev);
@@ -2459,8 +2461,9 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
strcpy(card->driver, "ICE1724");
strcpy(card->shortname, "ICEnsemble ICE1724");
-
- if ((err = snd_vt1724_create(card, pci, model[dev], &ice)) < 0) {
+
+ err = snd_vt1724_create(card, pci, model[dev], &ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
@@ -2472,7 +2475,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
if (c->driver) /* specific driver? */
strcpy(card->driver, c->driver);
if (c->chip_init) {
- if ((err = c->chip_init(ice)) < 0) {
+ err = c->chip_init(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
@@ -2482,15 +2486,15 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
}
}
c = &no_matched;
- __found:
- /*
- * VT1724 has separate DMAs for the analog and the SPDIF streams while
- * ICE1712 has only one for both (mixed up).
- *
- * Confusingly the analog PCM is named "professional" here because it
- * was called so in ice1712 driver, and vt1724 driver is derived from
- * ice1712 driver.
- */
+__found:
+ /*
+ * VT1724 has separate DMAs for the analog and the SPDIF streams while
+ * ICE1712 has only one for both (mixed up).
+ *
+ * Confusingly the analog PCM is named "professional" here because it
+ * was called so in ice1712 driver, and vt1724 driver is derived from
+ * ice1712 driver.
+ */
ice->pro_rate_default = PRO_RATE_DEFAULT;
if (!ice->is_spdif_master)
ice->is_spdif_master = stdclock_is_spdif_master;
@@ -2505,46 +2509,53 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
if (!ice->hw_rates)
set_std_hw_rates(ice);
- if ((err = snd_vt1724_pcm_profi(ice, pcm_dev++)) < 0) {
+ err = snd_vt1724_pcm_profi(ice, pcm_dev++);
+ if (err < 0) {
snd_card_free(card);
return err;
}
-
- if ((err = snd_vt1724_pcm_spdif(ice, pcm_dev++)) < 0) {
+
+ err = snd_vt1724_pcm_spdif(ice, pcm_dev++);
+ if (err < 0) {
snd_card_free(card);
return err;
}
-
- if ((err = snd_vt1724_pcm_indep(ice, pcm_dev++)) < 0) {
+
+ err = snd_vt1724_pcm_indep(ice, pcm_dev++);
+ if (err < 0) {
snd_card_free(card);
return err;
}
- if ((err = snd_vt1724_ac97_mixer(ice)) < 0) {
+ err = snd_vt1724_ac97_mixer(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
- if ((err = snd_vt1724_build_controls(ice)) < 0) {
+ err = snd_vt1724_build_controls(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
if (ice->pcm && ice->has_spdif) { /* has SPDIF I/O */
- if ((err = snd_vt1724_spdif_build_controls(ice)) < 0) {
+ err = snd_vt1724_spdif_build_controls(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
}
if (c->build_controls) {
- if ((err = c->build_controls(ice)) < 0) {
+ err = c->build_controls(ice);
+ if (err < 0) {
snd_card_free(card);
return err;
}
}
- if (! c->no_mpu401) {
+ if (!c->no_mpu401) {
if (ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_MPU401) {
struct snd_rawmidi *rmidi;
@@ -2576,7 +2587,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
sprintf(card->longname, "%s at 0x%lx, irq %i",
card->shortname, ice->port, ice->irq);
- if ((err = snd_card_register(card)) < 0) {
+ err = snd_card_register(card);
+ if (err < 0) {
snd_card_free(card);
return err;
}
2
1
before:
total: 2 errors, 0 warnings, 20 lines checked
total: 49 errors, 2 warnings, 518 lines checked
after:
total: 0 errors, 0 warnings, 20 lines checked
total: 0 errors, 0 warnings, 518 lines checked
Compile tested, size and code are equal.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ice1712/wtm.c | 104 +++++++++++++++++++++++-----------------------
sound/pci/ice1712/wtm.h | 4 +-
2 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c
index a08d17c..5af9e84 100644
--- a/sound/pci/ice1712/wtm.c
+++ b/sound/pci/ice1712/wtm.c
@@ -1,12 +1,12 @@
/*
* ALSA driver for ICEnsemble VT1724 (Envy24HT)
- *
+ *
* Lowlevel functions for Ego Sys Waveterminal 192M
*
* Copyright (c) 2006 Guedez Clement <klem.dev(a)gmail.com>
* Some functions are taken from the Prodigy192 driver
* source
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -20,12 +20,12 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
+ *
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -39,9 +39,9 @@
/*
- * 2*ADC 6*DAC no1 ringbuffer r/w on i2c bus
+ * 2*ADC 6*DAC no1 ringbuffer r/w on i2c bus
*/
-static inline void stac9460_put(struct snd_ice1712 *ice, int reg,
+static inline void stac9460_put(struct snd_ice1712 *ice, int reg,
unsigned char val)
{
snd_vt1724_write_i2c(ice, STAC9460_I2C_ADDR, reg, val);
@@ -73,7 +73,7 @@ static inline unsigned char stac9460_2_get(struct snd_ice1712 *ice, int reg)
#define stac9460_dac_mute_info snd_ctl_boolean_mono_info
static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
@@ -88,14 +88,14 @@ static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol,
}
if (id < 6)
val = stac9460_get(ice, idx);
- else
- val = stac9460_2_get(ice,idx - 6);
+ else
+ val = stac9460_2_get(ice, idx - 6);
ucontrol->value.integer.value[0] = (~val >> 7) & 0x1;
return 0;
}
static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char new, old;
@@ -105,8 +105,8 @@ static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
if (kcontrol->private_value) {
idx = STAC946X_MASTER_VOLUME;
old = stac9460_get(ice, idx);
- new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) |
- (old & ~0x80);
+ new = (~ucontrol->value.integer.value[0] << 7 & 0x80) |
+ (old & ~0x80);
change = (new != old);
if (change) {
stac9460_put(ice, idx, new);
@@ -117,16 +117,16 @@ static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
idx = id + STAC946X_LF_VOLUME;
if (id < 6)
old = stac9460_get(ice, idx);
- else
+ else
old = stac9460_2_get(ice, idx - 6);
- new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) |
+ new = (~ucontrol->value.integer.value[0] << 7 & 0x80) |
(old & ~0x80);
change = (new != old);
if (change) {
if (id < 6)
- stac9460_put(ice, idx, new);
+ stac9460_put(ice, idx, new);
else
- stac9460_2_put(ice, idx - 6, new);
+ stac9460_2_put(ice, idx - 6, new);
}
}
return change;
@@ -136,7 +136,7 @@ static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
* DAC volume attenuation mixer control
*/
static int stac9460_dac_vol_info(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_info *uinfo)
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
@@ -146,7 +146,7 @@ static int stac9460_dac_vol_info(struct snd_kcontrol *kcontrol,
}
static int stac9460_dac_vol_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx, id;
@@ -161,14 +161,14 @@ static int stac9460_dac_vol_get(struct snd_kcontrol *kcontrol,
}
if (id < 6)
vol = stac9460_get(ice, idx) & 0x7f;
- else
+ else
vol = stac9460_2_get(ice, idx - 6) & 0x7f;
ucontrol->value.integer.value[0] = 0x7f - vol;
return 0;
}
static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int idx, id;
@@ -182,8 +182,8 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
ovol = 0x7f - (tmp & 0x7f);
change = (ovol != nvol);
if (change) {
- stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
- stac9460_2_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
+ stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
+ stac9460_2_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
}
} else {
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
@@ -191,17 +191,17 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
nvol = ucontrol->value.integer.value[0] & 0x7f;
if (id < 6)
tmp = stac9460_get(ice, idx);
- else
+ else
tmp = stac9460_2_get(ice, idx - 6);
ovol = 0x7f - (tmp & 0x7f);
change = (ovol != nvol);
if (change) {
if (id < 6)
stac9460_put(ice, idx, (0x7f - nvol) |
- (tmp & 0x80));
- else
+ (tmp & 0x80));
+ else
stac9460_2_put(ice, idx-6, (0x7f - nvol) |
- (tmp & 0x80));
+ (tmp & 0x80));
}
}
return change;
@@ -213,12 +213,12 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
#define stac9460_adc_mute_info snd_ctl_boolean_stereo_info
static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
int i, id;
-
+
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
if (id == 0) {
for (i = 0; i < 2; ++i) {
@@ -235,20 +235,20 @@ static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol,
}
static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char new, old;
int i, reg, id;
int change;
-
+
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
if (id == 0) {
for (i = 0; i < 2; ++i) {
reg = STAC946X_MIC_L_VOLUME + i;
old = stac9460_get(ice, reg);
new = (~ucontrol->value.integer.value[i]<<7&0x80) |
- (old&~0x80);
+ (old&~0x80);
change = (new != old);
if (change)
stac9460_put(ice, reg, new);
@@ -258,7 +258,7 @@ static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
reg = STAC946X_MIC_L_VOLUME + i;
old = stac9460_2_get(ice, reg);
new = (~ucontrol->value.integer.value[i]<<7&0x80) |
- (old&~0x80);
+ (old&~0x80);
change = (new != old);
if (change)
stac9460_2_put(ice, reg, new);
@@ -271,7 +271,7 @@ static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
*ADC gain mixer control
*/
static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_info *uinfo)
+ struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
@@ -281,12 +281,12 @@ static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol,
}
static int stac9460_adc_vol_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int i, reg, id;
unsigned char vol;
-
+
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
if (id == 0) {
for (i = 0; i < 2; ++i) {
@@ -305,13 +305,13 @@ static int stac9460_adc_vol_get(struct snd_kcontrol *kcontrol,
}
static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int i, reg, id;
unsigned char ovol, nvol;
int change;
-
+
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
if (id == 0) {
for (i = 0; i < 2; ++i) {
@@ -321,7 +321,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
change = ((ovol & 0x0f) != nvol);
if (change)
stac9460_put(ice, reg, (0x0f - nvol) |
- (ovol & ~0x0f));
+ (ovol & ~0x0f));
}
} else {
for (i = 0; i < 2; ++i) {
@@ -331,7 +331,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
change = ((ovol & 0x0f) != nvol);
if (change)
stac9460_2_put(ice, reg, (0x0f - nvol) |
- (ovol & ~0x0f));
+ (ovol & ~0x0f));
}
}
return change;
@@ -344,23 +344,23 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
#define stac9460_mic_sw_info snd_ctl_boolean_mono_info
static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
int id;
-
+
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
if (id == 0)
- val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
+ val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
else
- val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
+ val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
ucontrol->value.integer.value[0] = ~val>>7 & 0x1;
return 0;
}
static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char new, old;
@@ -368,16 +368,16 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
if (id == 0)
- old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
+ old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
else
- old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
- new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) | (old & ~0x80);
+ old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
+ new = (~ucontrol->value.integer.value[0] << 7 & 0x80) | (old & ~0x80);
change = (new != old);
if (change) {
if (id == 0)
- stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
+ stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
else
- stac9460_2_put(ice, STAC946X_GENERAL_PURPOSE, new);
+ stac9460_2_put(ice, STAC946X_GENERAL_PURPOSE, new);
}
return change;
}
@@ -443,7 +443,7 @@ static struct snd_kcontrol_new stac9640_controls[] __devinitdata = {
.get = stac9460_adc_vol_get,
.put = stac9460_adc_vol_put,
- }
+ }
};
@@ -470,7 +470,7 @@ static int __devinit wtm_init(struct snd_ice1712 *ice)
(unsigned short)-1
};
unsigned short *p;
-
+
/*WTM 192M*/
ice->num_total_dacs = 8;
ice->num_total_adcs = 4;
diff --git a/sound/pci/ice1712/wtm.h b/sound/pci/ice1712/wtm.h
index 03a394e..423c1a2 100644
--- a/sound/pci/ice1712/wtm.h
+++ b/sound/pci/ice1712/wtm.h
@@ -10,8 +10,8 @@
*/
#define AK4114_ADDR 0x20 /*S/PDIF receiver*/
-#define STAC9460_I2C_ADDR 0x54 /* ADC*2 | DAC*6 */
-#define STAC9460_2_I2C_ADDR 0x56 /* ADC|DAC *2 */
+#define STAC9460_I2C_ADDR 0x54 /* ADC*2 | DAC*6 */
+#define STAC9460_2_I2C_ADDR 0x56 /* ADC|DAC *2 */
extern struct snd_ice1712_card_info snd_vt1724_wtm_cards[];
2
1

07 Sep '08
before:
total: 304 errors, 137 warnings, 2259 lines checked
after:
total: 0 errors, 121 warnings, 2284 lines checked
Compile tested, size is different because of include was changed,
but without that change md5sum is different because of cmp cx,dx/cmp
dx,cx swap and __LINE__ was changed in printk function.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ice1712/aureon.c | 677 +++++++++++++++++++++++---------------------
1 files changed, 351 insertions(+), 326 deletions(-)
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index a137fc1..110d16e 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -44,10 +44,9 @@
* not working: prety much everything else, at least i could verify that
* we have no digital output, no capture, pretty bad clicks and poops
* on mixer switch and other coll stuff.
- *
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -131,7 +130,7 @@ static void aureon_pca9554_write(struct snd_ice1712 *ice, unsigned char reg,
snd_ice1712_gpio_write(ice, tmp);
udelay(50);
- /*
+ /*
* send i2c stop condition and start condition
* to obtain sane state
*/
@@ -152,10 +151,16 @@ static void aureon_pca9554_write(struct snd_ice1712 *ice, unsigned char reg,
* skipping ack cycles inbetween
*/
for (j = 0; j < 3; j++) {
- switch(j) {
- case 0: val = dev; break;
- case 1: val = reg; break;
- case 2: val = data; break;
+ switch (j) {
+ case 0:
+ val = dev;
+ break;
+ case 1:
+ val = reg;
+ break;
+ case 2:
+ val = data;
+ break;
}
for (i = 7; i >= 0; i--) {
tmp &= ~AUREON_SPI_CLK;
@@ -171,7 +176,7 @@ static void aureon_pca9554_write(struct snd_ice1712 *ice, unsigned char reg,
snd_ice1712_gpio_write(ice, tmp);
udelay(40);
}
- tmp &= ~AUREON_SPI_CLK;
+ tmp &= ~AUREON_SPI_CLK;
snd_ice1712_gpio_write(ice, tmp);
udelay(40);
tmp |= AUREON_SPI_CLK;
@@ -203,7 +208,7 @@ static int aureon_universe_inmux_info(struct snd_kcontrol *kcontrol,
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
- if(uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
+ if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
@@ -231,12 +236,12 @@ static int aureon_universe_inmux_put(struct snd_kcontrol *kcontrol,
return -EINVAL;
snd_ice1712_save_gpio_status(ice);
oval = spec->pca9554_out;
- if ((change = (oval != nval))) {
+ change = (oval != nval);
+ if (change) {
aureon_pca9554_write(ice, PCA9554_OUT, nval);
spec->pca9554_out = nval;
}
snd_ice1712_restore_gpio_status(ice);
-
return change;
}
@@ -256,7 +261,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
udelay(10);
tmp &= ~AUREON_AC97_ADDR;
snd_ice1712_gpio_write(ice, tmp);
- udelay(10);
+ udelay(10);
/* Send low-order byte to XILINX chip */
tmp &= ~AUREON_AC97_DATA_MASK;
@@ -269,7 +274,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
tmp &= ~AUREON_AC97_DATA_LOW;
snd_ice1712_gpio_write(ice, tmp);
udelay(10);
-
+
/* Send high-order byte to XILINX chip */
tmp &= ~AUREON_AC97_DATA_MASK;
tmp |= (val >> 8) & AUREON_AC97_DATA_MASK;
@@ -282,7 +287,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
tmp &= ~AUREON_AC97_DATA_HIGH;
snd_ice1712_gpio_write(ice, tmp);
udelay(10);
-
+
/* Instruct XILINX chip to parse the data to the STAC9744 chip */
tmp |= AUREON_AC97_COMMIT;
snd_ice1712_gpio_write(ice, tmp);
@@ -290,7 +295,7 @@ static void aureon_ac97_write(struct snd_ice1712 *ice, unsigned short reg,
tmp &= ~AUREON_AC97_COMMIT;
snd_ice1712_gpio_write(ice, tmp);
udelay(10);
-
+
/* Store the data in out private buffer */
spec->stac9744[(reg & 0x7F) >> 1] = val;
}
@@ -304,7 +309,7 @@ static unsigned short aureon_ac97_read(struct snd_ice1712 *ice, unsigned short r
/*
* Initialize STAC9744 chip
*/
-static int aureon_ac97_init (struct snd_ice1712 *ice)
+static int aureon_ac97_init(struct snd_ice1712 *ice)
{
struct aureon_spec *spec = ice->spec;
int i;
@@ -335,20 +340,21 @@ static int aureon_ac97_init (struct snd_ice1712 *ice)
tmp = (snd_ice1712_gpio_read(ice) | AUREON_AC97_RESET) & ~AUREON_AC97_DATA_MASK;
snd_ice1712_gpio_write(ice, tmp);
udelay(3);
-
+
tmp &= ~AUREON_AC97_RESET;
snd_ice1712_gpio_write(ice, tmp);
udelay(3);
-
+
tmp |= AUREON_AC97_RESET;
snd_ice1712_gpio_write(ice, tmp);
udelay(3);
-
+
memset(&spec->stac9744, 0, sizeof(spec->stac9744));
- for (i=0; ac97_defaults[i] != (unsigned short)-1; i+=2)
+ for (i = 0; ac97_defaults[i] != (unsigned short)-1; i += 2)
spec->stac9744[(ac97_defaults[i]) >> 1] = ac97_defaults[i+1];
-
- aureon_ac97_write(ice, AC97_MASTER, 0x0000); // Unmute AC'97 master volume permanently - muting is done by WM8770
+
+ /* Unmute AC'97 master volume permanently - muting is done by WM8770 */
+ aureon_ac97_write(ice, AC97_MASTER, 0x0000);
return 0;
}
@@ -388,7 +394,7 @@ static int aureon_ac97_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short ovol, nvol;
int change;
-
+
snd_ice1712_save_gpio_status(ice);
ovol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F);
@@ -396,13 +402,14 @@ static int aureon_ac97_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
if (kcontrol->private_value & AUREON_AC97_STEREO)
nvol |= ((0x1F - ucontrol->value.integer.value[1]) << 8) & 0x1F00;
nvol |= ovol & ~0x1F1F;
-
- if ((change = (ovol != nvol)))
+
+ change = (ovol != nvol);
+ if (change)
aureon_ac97_write(ice, kcontrol->private_value & 0x7F, nvol);
snd_ice1712_restore_gpio_status(ice);
- return change;
+ return change;
}
/*
@@ -416,7 +423,8 @@ static int aureon_ac97_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el
mutex_lock(&ice->gpio_mutex);
- ucontrol->value.integer.value[0] = aureon_ac97_read(ice, kcontrol->private_value & 0x7F) & 0x8000 ? 0 : 1;
+ ucontrol->value.integer.value[0] = aureon_ac97_read(ice,
+ kcontrol->private_value & 0x7F) & 0x8000 ? 0 : 1;
mutex_unlock(&ice->gpio_mutex);
return 0;
@@ -429,13 +437,14 @@ static int aureon_ac97_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
int change;
snd_ice1712_save_gpio_status(ice);
-
+
ovol = aureon_ac97_read(ice, kcontrol->private_value & 0x7F);
- nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x8000) | (ovol & ~ 0x8000);
-
- if ((change = (ovol != nvol)))
+ nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x8000) | (ovol & ~0x8000);
+
+ change = (ovol != nvol);
+ if (change)
aureon_ac97_write(ice, kcontrol->private_value & 0x7F, nvol);
-
+
snd_ice1712_restore_gpio_status(ice);
return change;
@@ -465,13 +474,14 @@ static int aureon_ac97_micboost_put(struct snd_kcontrol *kcontrol, struct snd_ct
int change;
snd_ice1712_save_gpio_status(ice);
-
+
ovol = aureon_ac97_read(ice, AC97_MIC);
nvol = (ucontrol->value.integer.value[0] ? 0x0000 : 0x0020) | (ovol & ~0x0020);
-
- if ((change = (ovol != nvol)))
+
+ change = (ovol != nvol);
+ if (change)
aureon_ac97_write(ice, AC97_MIC, nvol);
-
+
snd_ice1712_restore_gpio_status(ice);
return change;
@@ -493,16 +503,15 @@ static void aureon_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned
snd_ice1712_gpio_set_mask(ice, ~(PRODIGY_SPI_MOSI|PRODIGY_SPI_CLK|PRODIGY_WM_CS));
mosi = PRODIGY_SPI_MOSI;
clk = PRODIGY_SPI_CLK;
- }
- else {
+ } else {
snd_ice1712_gpio_set_mask(ice, ~(AUREON_WM_RW|AUREON_SPI_MOSI|AUREON_SPI_CLK|
AUREON_WM_CS|AUREON_CS8415_CS));
mosi = AUREON_SPI_MOSI;
clk = AUREON_SPI_CLK;
-
+
tmp |= AUREON_WM_RW;
}
-
+
tmp &= ~cs;
snd_ice1712_gpio_write(ice, tmp);
udelay(1);
@@ -534,7 +543,9 @@ static void aureon_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned
/*
* Read data in SPI mode
*/
-static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned int data, int bits, unsigned char *buffer, int size) {
+static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs,
+ unsigned int data, int bits, unsigned char *buffer, int size)
+{
int i, j;
unsigned int tmp;
@@ -544,7 +555,7 @@ static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned i
snd_ice1712_gpio_write(ice, tmp);
udelay(1);
- for (i=bits-1; i>=0; i--) {
+ for (i = bits-1; i >= 0; i--) {
if (data & (1 << i))
tmp |= AUREON_SPI_MOSI;
else
@@ -561,9 +572,9 @@ static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned i
udelay(1);
}
- for (j=0; j<size; j++) {
+ for (j = 0; j < size; j++) {
unsigned char outdata = 0;
- for (i=7; i>=0; i--) {
+ for (i = 7; i >= 0; i--) {
tmp = snd_ice1712_gpio_read(ice);
outdata <<= 1;
outdata |= (tmp & AUREON_SPI_MISO) ? 1 : 0;
@@ -584,19 +595,24 @@ static void aureon_spi_read(struct snd_ice1712 *ice, unsigned int cs, unsigned i
snd_ice1712_gpio_write(ice, tmp);
}
-static unsigned char aureon_cs8415_get(struct snd_ice1712 *ice, int reg) {
+static unsigned char aureon_cs8415_get(struct snd_ice1712 *ice, int reg)
+{
unsigned char val;
aureon_spi_write(ice, AUREON_CS8415_CS, 0x2000 | reg, 16);
aureon_spi_read(ice, AUREON_CS8415_CS, 0x21, 8, &val, 1);
return val;
}
-static void aureon_cs8415_read(struct snd_ice1712 *ice, int reg, unsigned char *buffer, int size) {
+static void aureon_cs8415_read(struct snd_ice1712 *ice, int reg,
+ unsigned char *buffer, int size)
+{
aureon_spi_write(ice, AUREON_CS8415_CS, 0x2000 | reg, 16);
aureon_spi_read(ice, AUREON_CS8415_CS, 0x21, 8, buffer, size);
}
-static void aureon_cs8415_put(struct snd_ice1712 *ice, int reg, unsigned char val) {
+static void aureon_cs8415_put(struct snd_ice1712 *ice, int reg,
+ unsigned char val)
+{
aureon_spi_write(ice, AUREON_CS8415_CS, 0x200000 | (reg << 8) | val, 24);
}
@@ -654,18 +670,20 @@ static int aureon_ac97_mmute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e
return 0;
}
-static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
+static int aureon_ac97_mmute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned short ovol, nvol;
int change;
-
+
snd_ice1712_save_gpio_status(ice);
-
+
ovol = wm_get(ice, WM_OUT_MUX1);
nvol = (ovol & ~0x02) | (ucontrol->value.integer.value[0] ? 0x02 : 0x00);
- if ((change = (ovol != nvol)))
+ change = (ovol != nvol);
+ if (change)
wm_put(ice, WM_OUT_MUX1, nvol);
-
+
snd_ice1712_restore_gpio_status(ice);
return change;
@@ -702,12 +720,12 @@ static const unsigned char wm_vol[256] = {
static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master)
{
unsigned char nvol;
-
+
if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
nvol = 0;
else
nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX];
-
+
wm_put(ice, index, nvol);
wm_put_nocache(ice, index, 0x180 | nvol);
}
@@ -736,7 +754,8 @@ static int wm_pcm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va
snd_ice1712_save_gpio_status(ice);
oval = wm_get(ice, WM_MUTE);
nval = (oval & ~0x10) | (ucontrol->value.integer.value[0] ? 0 : 0x10);
- if ((change = (nval != oval)))
+ change = (oval != nval);
+ if (change)
wm_put(ice, WM_MUTE, nval);
snd_ice1712_restore_gpio_status(ice);
@@ -760,7 +779,7 @@ static int wm_master_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct aureon_spec *spec = ice->spec;
int i;
- for (i=0; i<2; i++)
+ for (i = 0; i < 2; i++)
ucontrol->value.integer.value[i] =
spec->master[i] & ~WM_VOL_MUTE;
return 0;
@@ -849,7 +868,8 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *
/*
* WM8770 mute control
*/
-static int wm_mute_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) {
+static int wm_mute_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
+{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
uinfo->count = kcontrol->private_value >> 8;
uinfo->value.integer.min = 0;
@@ -862,7 +882,7 @@ static int wm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct aureon_spec *spec = ice->spec;
int voices, ofs, i;
-
+
voices = kcontrol->private_value >> 8;
ofs = kcontrol->private_value & 0xFF;
@@ -907,7 +927,7 @@ static int wm_master_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct aureon_spec *spec = ice->spec;
-
+
ucontrol->value.integer.value[0] =
(spec->master[0] & WM_VOL_MUTE) ? 0 : 1;
ucontrol->value.integer.value[1] =
@@ -1083,21 +1103,21 @@ static int wm_adc_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val
static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static const char * const texts[] = {
- "CD", //AIN1
- "Aux", //AIN2
- "Line", //AIN3
- "Mic", //AIN4
- "AC97" //AIN5
+ "CD", /* AIN1 */
+ "Aux", /* AIN2 */
+ "Line", /* AIN3 */
+ "Mic", /* AIN4 */
+ "AC97" /* AIN5 */
};
static const char * const universe_texts[] = {
- "Aux1", //AIN1
- "CD", //AIN2
- "Phono", //AIN3
- "Line", //AIN4
- "Aux2", //AIN5
- "Mic", //AIN6
- "Aux3", //AIN7
- "AC97" //AIN8
+ "Aux1", /* AIN1 */
+ "CD", /* AIN2 */
+ "Phono", /* AIN3 */
+ "Line", /* AIN4 */
+ "Aux2", /* AIN5 */
+ "Mic", /* AIN6 */
+ "Aux3", /* AIN7 */
+ "AC97" /* AIN8 */
};
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
@@ -1108,8 +1128,7 @@ static int wm_adc_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_in
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, universe_texts[uinfo->value.enumerated.item]);
- }
- else {
+ } else {
uinfo->value.enumerated.items = 5;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
@@ -1156,8 +1175,8 @@ static int aureon_cs8415_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
static const char * const aureon_texts[] = {
- "CD", //RXP0
- "Optical" //RXP1
+ "CD", /* RXP0 */
+ "Optical" /* RXP1 */
};
static const char * const prodigy_texts[] = {
"CD",
@@ -1180,10 +1199,10 @@ static int aureon_cs8415_mux_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct aureon_spec *spec = ice->spec;
- //snd_ice1712_save_gpio_status(ice);
- //val = aureon_cs8415_get(ice, CS8415_CTRL2);
+ /* snd_ice1712_save_gpio_status(ice); */
+ /* val = aureon_cs8415_get(ice, CS8415_CTRL2); */
ucontrol->value.enumerated.item[0] = spec->cs8415_mux;
- //snd_ice1712_restore_gpio_status(ice);
+ /* snd_ice1712_restore_gpio_status(ice); */
return 0;
}
@@ -1206,7 +1225,7 @@ static int aureon_cs8415_mux_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e
return change;
}
-static int aureon_cs8415_rate_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
+static int aureon_cs8415_rate_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
@@ -1215,7 +1234,7 @@ static int aureon_cs8415_rate_info (struct snd_kcontrol *kcontrol, struct snd_ct
return 0;
}
-static int aureon_cs8415_rate_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+static int aureon_cs8415_rate_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char ratio;
@@ -1229,7 +1248,7 @@ static int aureon_cs8415_rate_get (struct snd_kcontrol *kcontrol, struct snd_ctl
*/
#define aureon_cs8415_mute_info snd_ctl_boolean_mono_info
-static int aureon_cs8415_mute_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+static int aureon_cs8415_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
snd_ice1712_save_gpio_status(ice);
@@ -1238,7 +1257,7 @@ static int aureon_cs8415_mute_get (struct snd_kcontrol *kcontrol, struct snd_ctl
return 0;
}
-static int aureon_cs8415_mute_put (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+static int aureon_cs8415_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char oval, nval;
@@ -1249,7 +1268,8 @@ static int aureon_cs8415_mute_put (struct snd_kcontrol *kcontrol, struct snd_ctl
nval = oval & ~0x20;
else
nval = oval | 0x20;
- if ((change = (oval != nval)))
+ change = (oval != nval);
+ if (change)
aureon_cs8415_put(ice, CS8415_CTRL1, nval);
snd_ice1712_restore_gpio_status(ice);
return change;
@@ -1258,15 +1278,17 @@ static int aureon_cs8415_mute_put (struct snd_kcontrol *kcontrol, struct snd_ctl
/*
* CS8415A Q-Sub info
*/
-static int aureon_cs8415_qsub_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) {
+static int aureon_cs8415_qsub_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
+{
uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
uinfo->count = 10;
return 0;
}
-static int aureon_cs8415_qsub_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
+static int aureon_cs8415_qsub_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
-
+
snd_ice1712_save_gpio_status(ice);
aureon_cs8415_read(ice, CS8415_QSUB, ucontrol->value.bytes.data, 10);
snd_ice1712_restore_gpio_status(ice);
@@ -1274,18 +1296,21 @@ static int aureon_cs8415_qsub_get (struct snd_kcontrol *kcontrol, struct snd_ctl
return 0;
}
-static int aureon_cs8415_spdif_info (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) {
+static int aureon_cs8415_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
+{
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
return 0;
}
-static int aureon_cs8415_mask_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
+static int aureon_cs8415_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
memset(ucontrol->value.iec958.status, 0xFF, 24);
return 0;
}
-static int aureon_cs8415_spdif_get (struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
+static int aureon_cs8415_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
+{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
snd_ice1712_save_gpio_status(ice);
@@ -1311,9 +1336,9 @@ static int aureon_set_headphone_amp(struct snd_ice1712 *ice, int enable)
else
if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT &&
ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT)
- tmp &= ~ AUREON_HP_SEL;
+ tmp &= ~AUREON_HP_SEL;
else
- tmp &= ~ PRODIGY_HP_SEL;
+ tmp &= ~PRODIGY_HP_SEL;
if (tmp != tmp2) {
snd_ice1712_gpio_write(ice, tmp);
return 1;
@@ -1325,7 +1350,7 @@ static int aureon_get_headphone_amp(struct snd_ice1712 *ice)
{
unsigned int tmp = snd_ice1712_gpio_read(ice);
- return ( tmp & AUREON_HP_SEL )!= 0;
+ return (tmp & AUREON_HP_SEL) != 0;
}
#define aureon_hpamp_info snd_ctl_boolean_mono_info
@@ -1343,7 +1368,7 @@ static int aureon_hpamp_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
- return aureon_set_headphone_amp(ice,ucontrol->value.integer.value[0]);
+ return aureon_set_headphone_amp(ice, ucontrol->value.integer.value[0]);
}
/*
@@ -1390,7 +1415,7 @@ static int aureon_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem_
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
- return 0;
+ return 0;
}
static int aureon_oversampling_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
@@ -1434,7 +1459,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Master Playback Volume",
.info = wm_master_vol_info,
.get = wm_master_vol_get,
@@ -1452,7 +1477,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Front Playback Volume",
.info = wm_vol_info,
.get = wm_vol_get,
@@ -1471,7 +1496,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Rear Playback Volume",
.info = wm_vol_info,
.get = wm_vol_get,
@@ -1490,7 +1515,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Center Playback Volume",
.info = wm_vol_info,
.get = wm_vol_get,
@@ -1509,7 +1534,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "LFE Playback Volume",
.info = wm_vol_info,
.get = wm_vol_get,
@@ -1528,7 +1553,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Side Playback Volume",
.info = wm_vol_info,
.get = wm_vol_get,
@@ -1539,23 +1564,23 @@ static struct snd_kcontrol_new aureon_dac_controls[] __devinitdata = {
};
static struct snd_kcontrol_new wm_controls[] __devinitdata = {
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Switch",
.info = wm_pcm_mute_info,
.get = wm_pcm_mute_get,
.put = wm_pcm_mute_put
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "PCM Playback Volume",
.info = wm_pcm_vol_info,
.get = wm_pcm_vol_get,
.put = wm_pcm_vol_put,
.tlv = { .p = db_scale_wm_pcm }
- },
+ },
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Switch",
@@ -1566,7 +1591,7 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
.name = "Capture Volume",
.info = wm_adc_vol_info,
.get = wm_adc_vol_get,
@@ -1605,232 +1630,232 @@ static struct snd_kcontrol_new wm_controls[] __devinitdata = {
};
static struct snd_kcontrol_new ac97_controls[] __devinitdata = {
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "AC97 Playback Switch",
.info = aureon_ac97_mmute_info,
.get = aureon_ac97_mmute_get,
.put = aureon_ac97_mmute_put,
.private_value = AC97_MASTER
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "AC97 Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_MASTER|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "AC97 Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_MASTER|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_master }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "CD Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_CD
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "CD Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_CD
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "CD Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_CD|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "CD Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_CD|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Aux Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_AUX,
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_AUX,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Aux Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_AUX|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Aux Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_AUX|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Line Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_LINE
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_LINE
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Line Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_LINE|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Line Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_LINE|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Mic Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_MIC
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_MIC
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Mic Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_MIC,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Mic Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_MIC,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Mic Boost (+20dB)",
- .info = aureon_ac97_micboost_info,
- .get = aureon_ac97_micboost_get,
- .put = aureon_ac97_micboost_put
- }
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic Boost (+20dB)",
+ .info = aureon_ac97_micboost_info,
+ .get = aureon_ac97_micboost_get,
+ .put = aureon_ac97_micboost_put
+ }
};
static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "AC97 Playback Switch",
.info = aureon_ac97_mmute_info,
.get = aureon_ac97_mmute_get,
.put = aureon_ac97_mmute_put,
.private_value = AC97_MASTER
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "AC97 Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_MASTER|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "AC97 Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_MASTER|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_master }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "CD Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_AUX
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "CD Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_AUX
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "CD Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_AUX|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "CD Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_AUX|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Phono Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_CD
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Phono Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_CD
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Phono Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_CD|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Phono Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_CD|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Line Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_LINE
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_LINE
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Line Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_LINE|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Line Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_LINE|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Mic Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_MIC
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_MIC
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Mic Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_MIC,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Mic Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_MIC,
.tlv = { .p = db_scale_ac97_gain }
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Mic Boost (+20dB)",
- .info = aureon_ac97_micboost_info,
- .get = aureon_ac97_micboost_get,
- .put = aureon_ac97_micboost_put
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "Aux Playback Switch",
- .info = aureon_ac97_mute_info,
- .get = aureon_ac97_mute_get,
- .put = aureon_ac97_mute_put,
- .private_value = AC97_VIDEO,
- },
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic Boost (+20dB)",
+ .info = aureon_ac97_micboost_info,
+ .get = aureon_ac97_micboost_get,
+ .put = aureon_ac97_micboost_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux Playback Switch",
+ .info = aureon_ac97_mute_info,
+ .get = aureon_ac97_mute_get,
+ .put = aureon_ac97_mute_put,
+ .private_value = AC97_VIDEO,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
- SNDRV_CTL_ELEM_ACCESS_TLV_READ),
- .name = "Aux Playback Volume",
- .info = aureon_ac97_vol_info,
- .get = aureon_ac97_vol_get,
- .put = aureon_ac97_vol_put,
- .private_value = AC97_VIDEO|AUREON_AC97_STEREO,
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ),
+ .name = "Aux Playback Volume",
+ .info = aureon_ac97_vol_info,
+ .get = aureon_ac97_vol_get,
+ .put = aureon_ac97_vol_put,
+ .private_value = AC97_VIDEO|AUREON_AC97_STEREO,
.tlv = { .p = db_scale_ac97_gain }
- },
+ },
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Aux Source",
@@ -1844,43 +1869,43 @@ static struct snd_kcontrol_new universe_ac97_controls[] __devinitdata = {
static struct snd_kcontrol_new cs8415_controls[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH),
+ .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH),
.info = aureon_cs8415_mute_info,
.get = aureon_cs8415_mute_get,
.put = aureon_cs8415_mute_put
},
- {
- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Source",
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, NONE) "Source",
.info = aureon_cs8415_mux_info,
.get = aureon_cs8415_mux_get,
.put = aureon_cs8415_mux_put,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("Q-subcode ",CAPTURE,DEFAULT),
+ .name = SNDRV_CTL_NAME_IEC958("Q-subcode ", CAPTURE, DEFAULT),
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
.info = aureon_cs8415_qsub_info,
.get = aureon_cs8415_qsub_get,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,MASK),
+ .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, MASK),
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.info = aureon_cs8415_spdif_info,
.get = aureon_cs8415_mask_get
},
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,DEFAULT),
+ .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, DEFAULT),
.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
.info = aureon_cs8415_spdif_info,
.get = aureon_cs8415_spdif_get
},
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
- .name = SNDRV_CTL_NAME_IEC958("",CAPTURE,NONE) "Rate",
- .access =SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+ .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, NONE) "Rate",
+ .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
.info = aureon_cs8415_rate_info,
.get = aureon_cs8415_rate_get
}
@@ -1905,15 +1930,14 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice)
if (err < 0)
return err;
}
-
+
if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON71_UNIVERSE) {
for (i = 0; i < ARRAY_SIZE(universe_ac97_controls); i++) {
err = snd_ctl_add(ice->card, snd_ctl_new1(&universe_ac97_controls[i], ice));
if (err < 0)
return err;
}
- }
- else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT &&
+ } else if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT &&
ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71XT) {
for (i = 0; i < ARRAY_SIZE(ac97_controls); i++) {
err = snd_ctl_add(ice->card, snd_ctl_new1(&ac97_controls[i], ice));
@@ -1932,7 +1956,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice)
else if ((id & 0x0F) != 0x01)
snd_printk(KERN_INFO "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1));
else {
- for (i = 0; i< ARRAY_SIZE(cs8415_controls); i++) {
+ for (i = 0; i < ARRAY_SIZE(cs8415_controls); i++) {
struct snd_kcontrol *kctl;
err = snd_ctl_add(ice->card, (kctl = snd_ctl_new1(&cs8415_controls[i], ice)));
if (err < 0)
@@ -1943,7 +1967,7 @@ static int __devinit aureon_add_controls(struct snd_ice1712 *ice)
}
snd_ice1712_restore_gpio_status(ice);
}
-
+
return 0;
}
@@ -2059,11 +2083,12 @@ static int __devinit aureon_init(struct snd_ice1712 *ice)
/* to remeber the register values of CS8415 */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
-
- if ((err = aureon_ac97_init(ice)) != 0)
+
+ err = aureon_ac97_init(ice);
+ if (err != 0)
return err;
snd_ice1712_gpio_set_dir(ice, 0x5fffff); /* fix this for the time being */
@@ -2086,7 +2111,7 @@ static int __devinit aureon_init(struct snd_ice1712 *ice)
/* initialize WM8770 codec */
if (ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71 ||
ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71LT ||
- ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT)
+ ice->eeprom.subvendor == VT1724_SUBDEVICE_PRODIGY71XT)
p = wm_inits_prodigy;
else
p = wm_inits_aureon;
@@ -2105,10 +2130,10 @@ static int __devinit aureon_init(struct snd_ice1712 *ice)
snd_ice1712_restore_gpio_status(ice);
- /* initialize PCA9554 pin directions & set default input*/
+ /* initialize PCA9554 pin directions & set default input */
aureon_pca9554_write(ice, PCA9554_DIR, 0x00);
aureon_pca9554_write(ice, PCA9554_OUT, 0x00); /* internal AUX */
-
+
spec->master[0] = WM_VOL_MUTE;
spec->master[1] = WM_VOL_MUTE;
for (i = 0; i < ice->num_total_dacs; i++) {
@@ -2215,12 +2240,12 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = {
.eeprom_data = aureon71_eeprom,
.driver = "Aureon71",
},
- {
- .subvendor = VT1724_SUBDEVICE_AUREON71_UNIVERSE,
- .name = "Terratec Aureon 7.1-Universe",
+ {
+ .subvendor = VT1724_SUBDEVICE_AUREON71_UNIVERSE,
+ .name = "Terratec Aureon 7.1-Universe",
.model = "universe",
- .chip_init = aureon_init,
- .build_controls = aureon_add_controls,
+ .chip_init = aureon_init,
+ .build_controls = aureon_add_controls,
.eeprom_size = sizeof(aureon71_universe_eeprom),
.eeprom_data = aureon71_universe_eeprom,
.driver = "Aureon71Univ", /* keep in 15 letters */
3
2
Added support for outputting a stream to multiple SPDIF outs on supporting codecs.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/hda_codec.c b/pci/hda/hda_codec.c
index 4f32911..696d77e 100644
--- a/pci/hda/hda_codec.c
+++ b/pci/hda/hda_codec.c
@@ -1454,12 +1454,22 @@ static int snd_hda_spdif_default_put(struct snd_kcontrol *kcontrol,
codec->spdif_ctls = val;
if (change) {
+ hda_nid_t *d;
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_2,
val >> 8);
+
+ for (d = codec->slave_dig_outs; *d; d++) {
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
+ val & 0xff);
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_2,
+ val >> 8);
+ }
}
mutex_unlock(&codec->spdif_mutex);
@@ -1491,10 +1501,16 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,
val |= AC_DIG1_ENABLE;
change = codec->spdif_ctls != val;
if (change) {
+ hda_nid_t *d;
codec->spdif_ctls = val;
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
+ val & 0xff);
/* unmute amp switch (if any) */
if ((get_wcaps(codec, nid) & AC_WCAP_OUT_AMP) &&
(val & AC_DIG1_ENABLE))
@@ -1643,9 +1659,14 @@ static int snd_hda_spdif_in_switch_put(struct snd_kcontrol *kcontrol,
mutex_lock(&codec->spdif_mutex);
change = codec->spdif_in_enable != val;
if (change) {
+ hda_nid_t *d;
codec->spdif_in_enable = val;
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1, val);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1, val);
}
mutex_unlock(&codec->spdif_mutex);
return change;
@@ -2589,15 +2610,30 @@ int snd_hda_input_mux_put(struct hda_codec *codec,
static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
unsigned int stream_tag, unsigned int format)
{
+ hda_nid_t *d;
+
/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
- if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
+ if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
+ codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
+ }
snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
/* turn on again (if needed) */
- if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
+ if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & 0xff);
+
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
+ codec->spdif_ctls & 0xff);
+ }
+
}
/*
@@ -2621,8 +2657,12 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
unsigned int format,
struct snd_pcm_substream *substream)
{
+ hda_nid_t *nid;
mutex_lock(&codec->spdif_mutex);
setup_dig_out_stream(codec, mout->dig_out_nid, stream_tag, format);
+ if (codec->slave_dig_outs)
+ for (nid = codec->slave_dig_outs; *nid; nid++)
+ setup_dig_out_stream(codec, *nid, stream_tag, format);
mutex_unlock(&codec->spdif_mutex);
return 0;
}
@@ -2689,6 +2729,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
hda_nid_t *nids = mout->dac_nids;
+ hda_nid_t *d;
int chs = substream->runtime->channels;
int i;
@@ -2702,9 +2743,16 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
mout->dig_out_used = HDA_DIG_ANALOG_DUP;
setup_dig_out_stream(codec, mout->dig_out_nid,
stream_tag, format);
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ setup_dig_out_stream(codec, *d,
+ stream_tag, format);
} else {
mout->dig_out_used = 0;
snd_hda_codec_cleanup_stream(codec, mout->dig_out_nid);
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_cleanup_stream(codec, *d);
}
}
mutex_unlock(&codec->spdif_mutex);
diff --git a/pci/hda/hda_codec.h b/pci/hda/hda_codec.h
index 780e2ff..60468f5 100644
--- a/pci/hda/hda_codec.h
+++ b/pci/hda/hda_codec.h
@@ -725,6 +725,7 @@ struct hda_codec {
unsigned int spdif_status; /* IEC958 status bits */
unsigned short spdif_ctls; /* SPDIF control bits */
unsigned int spdif_in_enable; /* SPDIF input enable? */
+ hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
struct snd_hwdep *hwdep; /* assigned hwdep device */
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index 9968ee4..52b3579 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -229,6 +229,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -274,6 +278,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -303,6 +311,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -396,9 +408,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1424,22 +1437,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3841,8 +3854,9 @@ again:
spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
spec->pwr_nids = stac92hd73xx_pwr_nids;
+ codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
- err = stac92xx_parse_auto_config(codec, 0x22, 0x24);
+ err = stac92xx_parse_auto_config(codec, 0x22, 0x25);
if (!err) {
if (spec->board_config < 0) {
@@ -3883,6 +3897,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4033,6 +4048,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4065,6 +4081,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
2
1
Note:
The other message did not go through because it was too big.
I can email the schematics I mentioned if anyone is interested
**************************************************************
Hello,
I have an HP Pavillion TX2000z.
This laptop has uses the snd-hda-intel and has the ALC861VD realtek
codec.
The existing configuration for the codec does not support the tx2000
series laptops fully.
There are several configurations that have various levels of support.
If you specify for the model to use the existing hp model (made for the
tx1000 series) then:
1.Headphones Work
2.Speakers Work
3.Front Mic Works (the jack mic by the headphone jack)
4.The External Mics do not work (There are two mics at the top of the
laptop... I am guessing left and right for a stereo Mic)
5.It seems like there is something mapped to an input that does not
belong there. The simplest way to explain this is when I open audacity
and set it to monitor input that there is significant white noise coming
in. The Ext. Mics are not working so it can't come from there (as far as
I know) and I have nothing plugged into the front Mic. I cannot find any
way to mute this noise.
When using the 3-stack model (with the option position_fix):
1. Headphones do not work (in either ports)
2. Speakers Work
3. Front Mic Works
4. The external mics work
5. Same problem as expressed above
All other models do not work in any significant way.
Also one of the Headphone ports (there are two on the front)
has Digital Out (optical) that I have no way of confirming if it works.
Now, that being said, I have tried working on the driver. I have
virtually no programing experience. I was able to have the driver
autodetect the soundcard and apply a certain model (before it had to be
applied with a module config file.)
And was able to interpret some of how the driver worked. But I am so
lost. I am not sure how hard it would be for a programmer to modify the
driver to support the tx2000.
So I want to put out a call to anyone who could help.
I am fully available for testing and some debugging if someone could try
and help.
I am uploading the codec file and the codec schematic ( I don't think
this is actually accurate, but It may help...)
Also here is the lspci -nn for the soundcard and other info I found
00:10.1 Audio device [0403]: nVidia Corporation MCP51 High Definition
Audio [10de:026c] (rev a2)
lshw
*-multimedia
description: Audio device
product: MCP51 High Definition Audio
vendor: nVidia Corporation
physical id: 10.1
bus info: pci@0000:00:10.1
version: a2
width: 32 bits
clock: 66MHz
capabilities: pm msi ht bus_master cap_list
configuration: driver=HDA Intel latency=0 maxlatency=5
mingnt=2 module=snd_hda_intel
If anyone could help or use additional information I would appreciate
it.
Thanks,
Kory
p.s. if this is the wrong place to post, please redirect me.
1
0
Hello
I'm a newbie to ALSA, in fact to sound programming at all. I tried a simple
program for a beginner. When I got to this line:
err = snd_pcm_writei (playback_handle, buf, bufsize);
printf("Playing Error: %d %s\n", err, snd_strerror(err));
the first time it played the sound that I wanted then I Ctrl-C the app. From
then on, every time I run the program it gives me: Playing Error: 128 Key
has been revoked
I tried to google around but no luck.
Hope someone can help.
Thanks
Paulos Siahu
1
0

06 Sep '08
Hi group,
I have found the documentation about ALSA very confusing. Where can I
find the definitions
about the fields in the structure_snd_pcm? Specifically Buffer, Rate,
Period, Buffer Size,
Period size, etc. Basically all of these:
> Device: 8c297b8
> PCM Device name = 'default' PCM state = RUNNING
> access type = MMAP_NONINTERLEAV format = 'U8' (Unsigned
> 8 bit)
> subformat = 'STD' (Standard) channels = 1
> rate = 8000 bps period time = 10000 us
> period size = 80 frame buffer time = 0 us
> buffer size = 65536 frames periods/buffer = 0 frames
> exact rate = 8000/1 bps significant bits = 8000
> is batch = 0 is block transfer = 1
> is double = 0 is half duplex = 0
> is joint duplex = 0 can overrange = 0
> can mmap = 1 can pause = 0
> can resume = 1 can sync start = 1
My program is not honoring the 'packet size'.
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0
Hi group,
I'm using snd_pcm_hw_param_any to retrieve the parameters from an
opened device
and I'm getting garbage back in the structures. My code is here:
http://64.124.13.3/_ALSA_/
This is a simple test to show the problem. The output is shown in
show.txt. as you can see the
before ( within the open function ) is much different than the after.
I am assuming that it is my code that has the problem, any ideas???
Thanks for your time.
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0

[alsa-devel] [PATCH] ALSA: ASoC V2: optimize init sequence of Freescale MPC8610 sound drivers
by Timur Tabi 06 Sep '08
by Timur Tabi 06 Sep '08
06 Sep '08
In the Freescale MPC8610 sound drivers, relocate all code from the _prepare
functions into the corresponding _hw_params functions. These drivers assumed
that the sample size is known in the _prepare function and not in the
_hw_params function, but this is not true.
Move the code in fsl_dma_prepare() into fsl_dma_hw_param(). Create
fsl_ssi_hw_params() and move the code from fsl_ssi_prepare() into it.
Turn off snooping for DMA operations to/from I/O registers, since that's not
necessary.
Some comment blocks were not near the code they reference, so they were moved.
Signed-off-by: Timur Tabi <timur(a)freescale.com>
---
This patch is for ASoC V2 only.
sound/soc/fsl/fsl_dma.c | 283 ++++++++++++++++++++++-------------------------
sound/soc/fsl/fsl_ssi.c | 20 ++--
2 files changed, 141 insertions(+), 162 deletions(-)
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 5da0069..8821289 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -319,9 +319,66 @@ error:
}
/**
- * fsl_dma_open: open a new substream.
+ * fsl_dma_open: open a new substream and allocate DMA resources for it
*
* Each substream has its own DMA buffer.
+ *
+ * ALSA divides the DMA buffer into N periods. We create NUM_DMA_LINKS link
+ * descriptors that cycle from one period to the next. For example, if
+ * there are six periods and two link descriptors, this is how they look
+ * before playback starts:
+ *
+ * The last link descriptor
+ * ____________ points back to the first
+ * | |
+ * V |
+ * ___ ___ |
+ * | |->| |->|
+ * |___| |___|
+ * | |
+ * | |
+ * V V
+ * _________________________________________
+ * | | | | | | | The DMA buffer is
+ * | | | | | | | divided into 6 parts
+ * |______|______|______|______|______|______|
+ *
+ * and here's how they look after the first period is finished playing:
+ *
+ * ____________
+ * | |
+ * V |
+ * ___ ___ |
+ * | |->| |->|
+ * |___| |___|
+ * | |
+ * |______________
+ * | |
+ * V V
+ * _________________________________________
+ * | | | | | | |
+ * | | | | | | |
+ * |______|______|______|______|______|______|
+ *
+ * The first link descriptor now points to the third period. The DMA
+ * controller is currently playing the second period. When it finishes, it
+ * will jump back to the first descriptor and play the third period.
+ *
+ * There are four reasons we do this:
+ *
+ * 1. The only way to get the DMA controller to automatically restart the
+ * transfer when it gets to the end of the buffer is to use chaining
+ * mode. Basic direct mode doesn't offer that feature.
+ * 2. We need to receive an interrupt at the end of every period. The DMA
+ * controller can generate an interrupt at the end of every link transfer
+ * (aka segment). Making each period into a DMA segment will give us the
+ * interrupts we need.
+ * 3. By creating only two link descriptors, regardless of the number of
+ * periods, we do not need to reallocate the link descriptors if the
+ * number of periods changes.
+ * 4. All of the audio data is still stored in a single, contiguous DMA
+ * buffer, which is what ALSA expects. We're just dividing it into
+ * contiguous parts, and creating a link descriptor for each one.
*/
static int fsl_dma_open(struct snd_pcm_substream *substream)
{
@@ -370,8 +427,8 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
dma_private->ld_buf_phys = ld_buf_phys;
dma_private->dma_buf_phys = substream->dma_buffer.addr;
- ret = request_irq(dma_private->dma_info->irq,
- fsl_dma_isr, 0, "DMA", dma_private);
+ ret = request_irq(dma_private->dma_info->irq, fsl_dma_isr, 0,
+ "fsl-audio-dma", dma_private);
if (ret) {
dev_err(substream->pcm->card->dev,
"can't register ISR for IRQ %u (ret=%i)\n",
@@ -393,17 +450,14 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
temp_link = dma_private->ld_buf_phys +
sizeof(struct fsl_dma_link_descriptor);
- for (i = 0; i < NUM_DMA_LINKS; i++) {
- struct fsl_dma_link_descriptor *link = &dma_private->link[i];
-
- link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
- link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
- link->next = cpu_to_be64(temp_link);
+ for (i = 0; i < NUM_DMA_LINKS - 1; i++) {
+ dma_private->link[i].next = cpu_to_be64(temp_link);
temp_link += sizeof(struct fsl_dma_link_descriptor);
}
/* The last link descriptor points to the first */
- dma_private->link[i - 1].next = cpu_to_be64(dma_private->ld_buf_phys);
+ dma_private->link[NUM_DMA_LINKS - 1].next =
+ cpu_to_be64(dma_private->ld_buf_phys);
/* Tell the DMA controller where the first link descriptor is */
out_be32(&dma_channel->clndar,
@@ -417,11 +471,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
/*
* Program the mode register for interrupts, external master control,
* and source/destination hold. Also clear the Channel Abort bit.
- */
- mr = in_be32(&dma_channel->mr) &
- ~(CCSR_DMA_MR_CA | CCSR_DMA_MR_DAHE | CCSR_DMA_MR_SAHE);
-
- /*
+ *
* We want External Master Start and External Master Pause enabled,
* because the SSI is controlling the DMA controller. We want the DMA
* controller to be set up in advance, and then we signal only the SSI
@@ -436,7 +486,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
* We want Error Interrupt enabled, so that we can get an error if
* the DMA controller is mis-programmed somehow.
*/
- mr |= CCSR_DMA_MR_EOSIE | CCSR_DMA_MR_EIE | CCSR_DMA_MR_EMP_EN |
+ mr = CCSR_DMA_MR_EOSIE | CCSR_DMA_MR_EIE | CCSR_DMA_MR_EMP_EN |
CCSR_DMA_MR_EMS_EN;
/* For playback, we want the destination address to be held. For
@@ -450,78 +500,47 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
}
/**
- * fsl_dma_hw_params: allocate the DMA buffer and the DMA link descriptors.
- *
- * ALSA divides the DMA buffer into N periods. We create NUM_DMA_LINKS link
- * descriptors that ping-pong from one period to the next. For example, if
- * there are six periods and two link descriptors, this is how they look
- * before playback starts:
- *
- * The last link descriptor
- * ____________ points back to the first
- * | |
- * V |
- * ___ ___ |
- * | |->| |->|
- * |___| |___|
- * | |
- * | |
- * V V
- * _________________________________________
- * | | | | | | | The DMA buffer is
- * | | | | | | | divided into 6 parts
- * |______|______|______|______|______|______|
+ * fsl_dma_hw_params: program the audio paramters into the DMA controller
*
- * and here's how they look after the first period is finished playing:
+ * This function takes the audio parameters (period size, sample size, etc)
+ * and finishes programming the DMA controller accordingly.
*
- * ____________
- * | |
- * V |
- * ___ ___ |
- * | |->| |->|
- * |___| |___|
- * | |
- * |______________
- * | |
- * V V
- * _________________________________________
- * | | | | | | |
- * | | | | | | |
- * |______|______|______|______|______|______|
+ * The actual address in STX0 (destination for playback, source for capture)
+ * is based on the sample size.
*
- * The first link descriptor now points to the third period. The DMA
- * controller is currently playing the second period. When it finishes, it
- * will jump back to the first descriptor and play the third period.
+ * One of the drawbacks with big-endian is that when copying integers of
+ * different sizes to a fixed-sized register, the address to which the
+ * integer must be copied is dependent on the size of the integer.
*
- * There are four reasons we do this:
+ * For example, if P is the address of a 32-bit register, and X is a 32-bit
+ * integer, then X should be copied to address P. However, if X is a 16-bit
+ * integer, then it should be copied to P+2. If X is an 8-bit register,
+ * then it should be copied to P+3.
*
- * 1. The only way to get the DMA controller to automatically restart the
- * transfer when it gets to the end of the buffer is to use chaining
- * mode. Basic direct mode doesn't offer that feature.
- * 2. We need to receive an interrupt at the end of every period. The DMA
- * controller can generate an interrupt at the end of every link transfer
- * (aka segment). Making each period into a DMA segment will give us the
- * interrupts we need.
- * 3. By creating only two link descriptors, regardless of the number of
- * periods, we do not need to reallocate the link descriptors if the
- * number of periods changes.
- * 4. All of the audio data is still stored in a single, contiguous DMA
- * buffer, which is what ALSA expects. We're just dividing it into
- * contiguous parts, and creating a link descriptor for each one.
+ * So for playback of 8-bit samples, the DMA controller must transfer single
+ * bytes from the DMA buffer to the last byte of the STX0 register, i.e.
+ * offset by 3 bytes. For 16-bit samples, the offset is two bytes.
*
- * Note that due to a quirk of the SSI's STX register, the target address
- * for the DMA operations depends on the sample size. So we don't program
- * the dest_addr (for playback -- source_addr for capture) fields in the
- * link descriptors here. We do that in fsl_dma_prepare()
+ * For 24-bit samples, the offset is 1 byte. However, the DMA controller
+ * does not support 3-byte copies (the DAHTS register supports only 1, 2, 4,
+ * and 8 bytes at a time). So we do not support packed 24-bit samples.
+ * 24-bit data must be padded to 32 bits.
*/
static int fsl_dma_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct fsl_dma_private *dma_private = runtime->private_data;
+ struct ccsr_dma_channel __iomem *dma_channel =
+ dma_private->dma_info->channel;
+
+ dma_addr_t ssi_sxx_phys; /* Bus address of SSI STX register */
dma_addr_t temp_addr; /* Pointer to next period */
+ uint32_t mr;
+ unsigned int sample_size; /* Number of bits per sample */
+ unsigned int frame_size; /* Number of bytes per frame */
unsigned int i;
/* Get all the parameters we need */
@@ -537,83 +556,16 @@ static int fsl_dma_hw_params(struct snd_pcm_substream *substream,
if (dma_private->dma_buf_next >= dma_private->dma_buf_end)
dma_private->dma_buf_next = dma_private->dma_buf_phys;
- /*
- * The actual address in STX0 (destination for playback, source for
- * capture) is based on the sample size, but we don't know the sample
- * size in this function, so we'll have to adjust that later. See
- * comments in fsl_dma_prepare().
- *
- * The DMA controller does not have a cache, so the CPU does not
- * need to tell it to flush its cache. However, the DMA
- * controller does need to tell the CPU to flush its cache.
- * That's what the SNOOP bit does.
- *
- * Also, even though the DMA controller supports 36-bit addressing, for
- * simplicity we currently support only 32-bit addresses for the audio
- * buffer itself.
- */
- temp_addr = substream->dma_buffer.addr;
-
- for (i = 0; i < NUM_DMA_LINKS; i++) {
- struct fsl_dma_link_descriptor *link = &dma_private->link[i];
-
- link->count = cpu_to_be32(period_size);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- link->source_addr = cpu_to_be32(temp_addr);
- else
- link->dest_addr = cpu_to_be32(temp_addr);
-
- temp_addr += period_size;
- }
-
- return 0;
-}
-
-/**
- * fsl_dma_prepare - prepare the DMA registers for playback.
- *
- * This function is called after the specifics of the audio data are known,
- * i.e. snd_pcm_runtime is initialized.
- *
- * In this function, we finish programming the registers of the DMA
- * controller that are dependent on the sample size.
- *
- * One of the drawbacks with big-endian is that when copying integers of
- * different sizes to a fixed-sized register, the address to which the
- * integer must be copied is dependent on the size of the integer.
- *
- * For example, if P is the address of a 32-bit register, and X is a 32-bit
- * integer, then X should be copied to address P. However, if X is a 16-bit
- * integer, then it should be copied to P+2. If X is an 8-bit register,
- * then it should be copied to P+3.
- *
- * So for playback of 8-bit samples, the DMA controller must transfer single
- * bytes from the DMA buffer to the last byte of the STX0 register, i.e.
- * offset by 3 bytes. For 16-bit samples, the offset is two bytes.
- *
- * For 24-bit samples, the offset is 1 byte. However, the DMA controller
- * does not support 3-byte copies (the DAHTS register supports only 1, 2, 4,
- * and 8 bytes at a time). So we do not support packed 24-bit samples.
- * 24-bit data must be padded to 32 bits.
- */
-static int fsl_dma_prepare(struct snd_pcm_substream *substream)
-{
- struct snd_pcm_runtime *runtime = substream->runtime;
- struct fsl_dma_private *dma_private = runtime->private_data;
- struct ccsr_dma_channel __iomem *dma_channel =
- dma_private->dma_info->channel;
- uint32_t mr;
- unsigned int i;
- dma_addr_t ssi_sxx_phys; /* Bus address of SSI STX register */
- unsigned int frame_size; /* Number of bytes per frame */
+ /* Program the sample size and I/O address into the DMA controller */
ssi_sxx_phys = dma_private->dma_info->ssi_sxx_phys;
mr = in_be32(&dma_channel->mr) & ~(CCSR_DMA_MR_BWC_MASK |
CCSR_DMA_MR_SAHTS_MASK | CCSR_DMA_MR_DAHTS_MASK);
- switch (runtime->sample_bits) {
+ sample_size = snd_pcm_format_physical_width(params_format(hw_params));
+
+ switch (sample_size) {
case 8:
mr |= CCSR_DMA_MR_DAHTS_1 | CCSR_DMA_MR_SAHTS_1;
ssi_sxx_phys += 3;
@@ -631,7 +583,8 @@ static int fsl_dma_prepare(struct snd_pcm_substream *substream)
return -EINVAL;
}
- frame_size = runtime->frame_bits / 8;
+ frame_size = 2 * (sample_size / 8);
+
/*
* BWC should always be a multiple of the frame size. BWC determines
* how many bytes are sent/received before the DMA controller checks the
@@ -648,16 +601,45 @@ static int fsl_dma_prepare(struct snd_pcm_substream *substream)
out_be32(&dma_channel->mr, mr);
- /*
- * Program the address of the DMA transfer to/from the SSI.
- */
+ temp_addr = substream->dma_buffer.addr;
+
for (i = 0; i < NUM_DMA_LINKS; i++) {
struct fsl_dma_link_descriptor *link = &dma_private->link[i];
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ link->count = cpu_to_be32(period_size);
+
+ /* Even though the DMA controller supports 36-bit addressing,
+ * for simplicity we allow only 32-bit addresses for the audio
+ * buffer itself. This was enforced in fsl_dma_new() with the
+ * DMA mask.
+ *
+ * The snoop bit tells the DMA controller whether it should tell
+ * the ECM to snoop during a read or write to an address. For
+ * audio, we use DMA to transfer data between memory and an I/O
+ * device (the SSI's STX0 or SRX0 register). Snooping is only
+ * needed if there is a cache, so we need to snoop memory
+ * addresses only. For playback, that means we snoop the source
+ * but not the destination. For capture, we snoop the
+ * destination but not the source.
+ *
+ * Note that this is unlikely to cause cache incoherency unless
+ * the DMA buffer is smaller than the size of L1 cache.
+ */
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ link->source_addr = cpu_to_be32(temp_addr);
+ link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
+
link->dest_addr = cpu_to_be32(ssi_sxx_phys);
- else
+ link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_NOSNOOP);
+ } else {
link->source_addr = cpu_to_be32(ssi_sxx_phys);
+ link->source_attr = cpu_to_be32(CCSR_DMA_ATR_NOSNOOP);
+
+ link->dest_addr = cpu_to_be32(temp_addr);
+ link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
+ }
+
+ temp_addr += period_size;
}
return 0;
@@ -800,7 +782,6 @@ static struct snd_pcm_ops fsl_dma_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = fsl_dma_hw_params,
.hw_free = fsl_dma_hw_free,
- .prepare = fsl_dma_prepare,
.pointer = fsl_dma_pointer,
};
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 319cc97..fc52d30 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -344,30 +344,28 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
}
/**
- * fsl_ssi_prepare: prepare the SSI.
+ * fsl_ssi_hw_params: program the sample size
*
* Most of the SSI registers have been programmed in the startup function,
- * but the word length must be programmed here. Unfortunately, programming
- * the SxCCR.WL bits requires the SSI to be temporarily disabled. This can
- * cause a problem with supporting simultaneous playback and capture. If
- * the SSI is already playing a stream, then that stream may be temporarily
- * stopped when you start capture.
+ * but the word length must be programmed here. Since we support
+ * synchronous mode only, only the master stream can program STCRR[WL].
*
* Note: The SxCCR.DC and SxCCR.PM bits are only used if the SSI is the
* clock master.
*/
-static int fsl_ssi_prepare(struct snd_pcm_substream *substream,
- struct snd_soc_dai *cpu_dai)
+static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *cpu_dai)
{
struct fsl_ssi_info *ssi_info = cpu_dai->private_data;
if (substream == ssi_info->master_stream) {
- struct snd_pcm_runtime *runtime = substream->runtime;
struct ccsr_ssi __iomem *ssi = ssi_info->ssi;
+ unsigned int sample_size =
+ snd_pcm_format_width(params_format(hw_params));
u32 wl;
/* The SSI should always be disabled at this points (SSIEN=0) */
- wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format));
+ wl = CCSR_SSI_SxCCR_WL(sample_size);
/* In synchronous mode, the SSI uses STCCR for capture */
clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl);
@@ -588,7 +586,7 @@ static struct snd_soc_dai_caps capture = {
static struct snd_soc_dai_ops ops = {
.startup = fsl_ssi_startup,
- .prepare = fsl_ssi_prepare,
+ .hw_params = fsl_ssi_hw_params,
.shutdown = fsl_ssi_shutdown,
.trigger = fsl_ssi_trigger,
--
1.5.5
2
1
Hello,
I have an HP Pavillion TX2000z.
This laptop has uses the snd-hda-intel and has the ALC861VD realtek
codec.
The existing configuration for the codec does not support the tx2000
series laptops fully.
There are several configurations that have various levels of support.
If you specify for the model to use the existing hp model (made for the
tx1000 series) then:
1.Headphones Work
2.Speakers Work
3.Front Mic Works (the jack mic by the headphone jack)
4.The External Mics do not work (There are two mics at the top of the
laptop... I am guessing left and right for a stereo Mic)
5.It seems like there is something mapped to an input that does not
belong there. The simplest way to explain this is when I open audacity
and set it to monitor input that there is significant white noise coming
in. The Ext. Mics are not working so it can't come from there (as far as
I know) and I have nothing plugged into the front Mic. I cannot find any
way to mute this noise.
When using the 3-stack model (with the option position_fix):
1. Headphones do not work (in either ports)
2. Speakers Work
3. Front Mic Works
4. The external mics work
5. Same problem as expressed above
All other models do not work in any significant way.
Also one of the Headphone ports (there are two on the front)
has Digital Out (optical) that I have no way of confirming if it works.
Now, that being said, I have tried working on the driver. I have
virtually no programing experience. I was able to have the driver
autodetect the soundcard and apply a certain model (before it had to be
applied with a module config file.)
And was able to interpret some of how the driver worked. But I am so
lost. I am not sure how hard it would be for a programmer to modify the
driver to support the tx2000.
So I want to put out a call to anyone who could help.
I am fully available for testing and some debugging if someone could try
and help.
I am uploading the codec file and the codec schematic ( I don't think
this is actually accurate, but It may help...)
Also here is the lspci -nn for the soundcard and other info I found
00:10.1 Audio device [0403]: nVidia Corporation MCP51 High Definition
Audio [10de:026c] (rev a2)
lshw
*-multimedia
description: Audio device
product: MCP51 High Definition Audio
vendor: nVidia Corporation
physical id: 10.1
bus info: pci@0000:00:10.1
version: a2
width: 32 bits
clock: 66MHz
capabilities: pm msi ht bus_master cap_list
configuration: driver=HDA Intel latency=0 maxlatency=5
mingnt=2 module=snd_hda_intel
If anyone could help or use additional information I would appreciate
it.
Thanks,
Kory
p.s. if this is the wrong place to post, please redirect me.
1
0
Hi,
Actually i am stuck with a problem i have two register 2 channels of my
SOC device as 2 different pcm devices on same card.
But my driver uses ALSA V1 api's and i am not able to find out any
example code for this using v1 api's. (SIMILAR TO MPC5200_PSC.C)
If anyone can help me please.
Thanks,
Dinesh
2
1
The following changes since commit 44e2c3045f77c69d18ba4afda888a4cdec4a33fd:
Cliff Cai (1):
ALSA: ASoC codec: fix compiling error in ad1980 driver after ASoC API changed
are available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asoc for-tiwai
Cliff Cai (10):
ASoC codec: SSM2602 audio codec driver
ASoC: Blackfin: SPORT peripheral interface driver
ASoC: Blackfin: DMA Driver for AC97 sound chip
ASoC: Blackfin: AC97 Blackfin CPU DAI driver
ASoC: Blackfin: DMA Driver for I2S sound chip
ASoC: Blackfin: I2S CPU DAI driver
ASoC: Blackfin: board driver for AD1980/1 audio codec
ASoC: Blackfin: board driver for SSM2602 sound chip
ASoC: Blackfin: add Blackfin arch ASoC Kconfig and Makefile
ASoC: Blackfin: Include Blackfin architecture support in build
Jean Delvare (4):
ASoC: Fix an error path in neo1973_wm8753
ASoC: Convert wm8753 to a new-style i2c driver
ASoC: Convert neo1973/lm4857 to a new-style i2c driver
ASoC: Convert wm8510 to a new-style i2c driver
sound/soc/Kconfig | 1 +
sound/soc/Makefile | 2 +-
sound/soc/at32/playpaq_wm8510.c | 1 +
sound/soc/blackfin/Kconfig | 85 +++
sound/soc/blackfin/Makefile | 20 +
sound/soc/blackfin/bf5xx-ac97-pcm.c | 429 +++++++++++++++
sound/soc/blackfin/bf5xx-ac97-pcm.h | 29 +
sound/soc/blackfin/bf5xx-ac97.c | 407 ++++++++++++++
sound/soc/blackfin/bf5xx-ac97.h | 36 ++
sound/soc/blackfin/bf5xx-ad1980.c | 113 ++++
sound/soc/blackfin/bf5xx-i2s-pcm.c | 288 ++++++++++
sound/soc/blackfin/bf5xx-i2s-pcm.h | 29 +
sound/soc/blackfin/bf5xx-i2s.c | 292 ++++++++++
sound/soc/blackfin/bf5xx-i2s.h | 14 +
sound/soc/blackfin/bf5xx-sport.c | 1032 +++++++++++++++++++++++++++++++++++
sound/soc/blackfin/bf5xx-sport.h | 192 +++++++
sound/soc/blackfin/bf5xx-ssm2602.c | 186 +++++++
sound/soc/codecs/Kconfig | 4 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/ssm2602.c | 776 ++++++++++++++++++++++++++
sound/soc/codecs/ssm2602.h | 130 +++++
sound/soc/codecs/wm8510.c | 110 ++--
sound/soc/codecs/wm8510.h | 1 +
sound/soc/codecs/wm8753.c | 106 ++--
sound/soc/codecs/wm8753.h | 1 +
sound/soc/s3c24xx/neo1973_wm8753.c | 113 +++--
26 files changed, 4237 insertions(+), 162 deletions(-)
create mode 100644 sound/soc/blackfin/Kconfig
create mode 100644 sound/soc/blackfin/Makefile
create mode 100644 sound/soc/blackfin/bf5xx-ac97-pcm.c
create mode 100644 sound/soc/blackfin/bf5xx-ac97-pcm.h
create mode 100644 sound/soc/blackfin/bf5xx-ac97.c
create mode 100644 sound/soc/blackfin/bf5xx-ac97.h
create mode 100644 sound/soc/blackfin/bf5xx-ad1980.c
create mode 100644 sound/soc/blackfin/bf5xx-i2s-pcm.c
create mode 100644 sound/soc/blackfin/bf5xx-i2s-pcm.h
create mode 100644 sound/soc/blackfin/bf5xx-i2s.c
create mode 100644 sound/soc/blackfin/bf5xx-i2s.h
create mode 100644 sound/soc/blackfin/bf5xx-sport.c
create mode 100644 sound/soc/blackfin/bf5xx-sport.h
create mode 100644 sound/soc/blackfin/bf5xx-ssm2602.c
create mode 100644 sound/soc/codecs/ssm2602.c
create mode 100644 sound/soc/codecs/ssm2602.h
2
15

05 Sep '08
does anyone have a good example or walkthrough how to change capture
sources? I'm having a heck of a time.
my calls go like this:
/* setup */
snd_mixer_selem_id_alloca
snd_mixer_open
snd_mixer_attach
snd_mixer_selem_register
snd_mixer_load
/* set up PCM element, unused in this example */
snd_mixer_selem_id_set_index
snd_mixer_selem_id_set_name
snd_mixer_find_selem
/* set up Line element (linecapture) */
snd_mixer_selem_id_set_index
snd_mixer_selem_id_set_name
snd_mixer_find_selem
/* set up Mic element (miccapture) */
snd_mixer_selem_id_set_index
snd_mixer_selem_id_set_name
snd_mixer_find_selem
/* here's that part that throws me... I'm trying to sit in a loop and
* trade capture back and forth between Line and Mic. code reproduced
* here verbatim... */
do
{
snd_mixer_selem_channel_id_t chn;
for (chn = 0; chn <= SND_MIXER_SCHN_LAST; chn++)
{
int junk;
if (snd_mixer_selem_has_capture_channel(linecapture, chn))
{
status = snd_mixer_selem_get_capture_switch(linecapture,
chn, &junk);
assert(0 == status);
printf("line, chn %d, junk %d, ", chn, junk);
status = snd_mixer_selem_set_capture_switch(linecapture,
chn, lineflag);
printf("set %d\n", lineflag);
assert(0 == status);
}
if (snd_mixer_selem_has_capture_channel(miccapture, chn))
{
status = snd_mixer_selem_get_capture_switch(miccapture,
chn, &junk);
printf("mic, chn %d, junk %d, ", chn, junk);
assert(0 == status);
status = snd_mixer_selem_set_capture_switch(miccapture,
chn, micflag);
printf("set %d\n", micflag);
assert(0 == status);
}
}
for (chn = 0; chn <= SND_MIXER_SCHN_LAST; chn++)
{
if (snd_mixer_selem_has_capture_channel(linecapture, chn))
{
status = snd_mixer_selem_get_capture_switch(linecapture,
chn, &lineflag);
printf("read line, chn %d: %d\n", chn, lineflag);
assert(0 == status);
}
if (snd_mixer_selem_has_capture_channel(miccapture, chn))
{
status = snd_mixer_selem_get_capture_switch(miccapture,
chn, &micflag);
printf("read mic, chn %d: %d\n", chn, micflag);
assert(0 == status);
}
}
if (lineflag)
{
lineflag = 0;
micflag = 1;
}
else
{
lineflag = 1;
micflag = 0;
}
getchar();
} while (1);
I get output like this:
line, chn 0, junk 0, set 1
mic, chn 0, junk 1, set 0
line, chn 1, junk 1, set 1
mic, chn 1, junk 0, set 0
read line, chn 0: 1
read mic, chn 0: 0
read line, chn 1: 1
read mic, chn 1: 0
[all is well, alsamixer shows LR capture on Line input, smash
return and go for another loop]
line, chn 0, junk 1, set 0
mic, chn 0, junk 0, set 1
line, chn 1, junk 1, set 0
mic, chn 1, junk 0, set 1
read line, chn 0: 1
read mic, chn 0: 1
read line, chn 1: 1
read mic, chn 1: 1
[here's where it goes funny. the "junk" is what I set last
time, as expected, but the readbacks after the
set_capture_switch indicate both line and mic are being
captured? that's not right. alsamixer shows LR capture on Mic
input. smack return again to see what happens.]
line, chn 0, junk 1, set 0
mic, chn 0, junk 1, set 1
line, chn 1, junk 1, set 0
mic, chn 1, junk 1, set 1
read line, chn 0: 0
read mic, chn 0: 1
read line, chn 1: 1
read mic, chn 1: 1
[this gets really weird. we make the same write calls we did
last time, and now we get back something different? alsamixer
shows R Line and L Capture. screwey.]
I feel I must be missing something obvious, like a flush operation, or
something very simple. who knew changing a mux could be such an
involved procedure? (=
--
Aaron J. Grier | "Not your ordinary poofy goof." | agrier(a)poofygoof.com
2
2

[alsa-devel] [PATCH 0/4] ARM: OMAP2: Add support for Gumstix Overo (resubmission)
by sakoman@gmail.com 05 Sep '08
by sakoman@gmail.com 05 Sep '08
05 Sep '08
This patch series adds support for the Gumstix Overo board. Since it includes an ASoC driver I am copying both linux-omap and alsa-devel
This version incorporates feedback from both linux-omap and alsa-devel
5
21

05 Sep '08
From: Cliff Cai <cliff.cai(a)analog.com>
v2-v3:
- add the codec to SND_SOC_ALL_CODECS
- coding style fixing
- rename registers' name
- fix an issue with DAPM and the bias configuration.
v1-v2:
- coding style fixing
- use pr_xxx macros to replace printk(KERN_XXX...)
- use new-style i2c interface
- update to use latest ASoC API
Signed-off-by: Cliff Cai <cliff.cai(a)analog.com>
Signed-off-by: Bryan Wu <cooloney(a)kernel.org>
---
sound/soc/codecs/Kconfig | 4 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/ssm2602.c | 775 ++++++++++++++++++++++++++++++++++++++++++++
sound/soc/codecs/ssm2602.h | 130 ++++++++
4 files changed, 911 insertions(+), 0 deletions(-)
create mode 100644 sound/soc/codecs/ssm2602.c
create mode 100644 sound/soc/codecs/ssm2602.h
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 5d77dc3..2223993 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -15,6 +15,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_CS4270
select SND_SOC_TLV320AIC26
select SND_SOC_TLV320AIC3X
+ select SND_SOC_SSM2602
help
Normally ASoC codec drivers are only built if a machine driver which
uses them is also built since they are only usable with a machine
@@ -92,3 +93,6 @@ config SND_SOC_TLV320AIC26
config SND_SOC_TLV320AIC3X
tristate
depends on I2C
+
+config SND_SOC_SSM2602
+ tristate
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 35daaa9..0cd55ee 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -15,6 +15,7 @@ snd-soc-wm9713-objs := wm9713.o
snd-soc-cs4270-objs := cs4270.o
snd-soc-tlv320aic26-objs := tlv320aic26.o
snd-soc-tlv320aic3x-objs := tlv320aic3x.o
+snd-soc-ssm2602-objs := ssm2602.o
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o
@@ -33,3 +34,4 @@ obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
+obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
new file mode 100644
index 0000000..d43459f
--- /dev/null
+++ b/sound/soc/codecs/ssm2602.c
@@ -0,0 +1,775 @@
+/*
+ * File: sound/soc/codecs/ssm2602.c
+ * Author: Cliff Cai <Cliff.Cai(a)analog.com>
+ *
+ * Created: Tue June 06 2008
+ * Description: Driver for ssm2602 sound chip
+ *
+ * Modified:
+ * Copyright 2008 Analog Devices Inc.
+ *
+ * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/platform_device.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+
+#include "ssm2602.h"
+
+#define AUDIO_NAME "ssm2602"
+#define SSM2602_VERSION "0.1"
+
+struct snd_soc_codec_device soc_codec_dev_ssm2602;
+
+/* codec private data */
+struct ssm2602_priv {
+ unsigned int sysclk;
+ struct snd_pcm_substream *master_substream;
+ struct snd_pcm_substream *slave_substream;
+};
+
+/*
+ * ssm2602 register cache
+ * We can't read the ssm2602 register space when we are
+ * using 2 wire for device control, so we cache them instead.
+ * There is no point in caching the reset register
+ */
+static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
+ 0x0017, 0x0017, 0x0079, 0x0079,
+ 0x0000, 0x0000, 0x0000, 0x000a,
+ 0x0000, 0x0000
+};
+
+/*
+ * read ssm2602 register cache
+ */
+static inline unsigned int ssm2602_read_reg_cache(struct snd_soc_codec *codec,
+ unsigned int reg)
+{
+ u16 *cache = codec->reg_cache;
+ if (reg == SSM2602_RESET)
+ return 0;
+ if (reg >= SSM2602_CACHEREGNUM)
+ return -1;
+ return cache[reg];
+}
+
+/*
+ * write ssm2602 register cache
+ */
+static inline void ssm2602_write_reg_cache(struct snd_soc_codec *codec,
+ u16 reg, unsigned int value)
+{
+ u16 *cache = codec->reg_cache;
+ if (reg >= SSM2602_CACHEREGNUM)
+ return;
+ cache[reg] = value;
+}
+
+/*
+ * write to the ssm2602 register space
+ */
+static int ssm2602_write(struct snd_soc_codec *codec, unsigned int reg,
+ unsigned int value)
+{
+ u8 data[2];
+
+ /* data is
+ * D15..D9 ssm2602 register offset
+ * D8...D0 register data
+ */
+ data[0] = (reg << 1) | ((value >> 8) & 0x0001);
+ data[1] = value & 0x00ff;
+
+ ssm2602_write_reg_cache(codec, reg, value);
+ if (codec->hw_write(codec->control_data, data, 2) == 2)
+ return 0;
+ else
+ return -EIO;
+}
+
+#define ssm2602_reset(c) ssm2602_write(c, SSM2602_RESET, 0)
+
+/*Appending several "None"s just for OSS mixer use*/
+static const char *ssm2602_input_select[] = {
+ "Line", "Mic", "None", "None", "None",
+ "None", "None", "None",
+};
+
+static const char *ssm2602_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
+
+static const struct soc_enum ssm2602_enum[] = {
+ SOC_ENUM_SINGLE(SSM2602_APANA, 2, 2, ssm2602_input_select),
+ SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, 4, ssm2602_deemph),
+};
+
+static const struct snd_kcontrol_new ssm2602_snd_controls[] = {
+
+SOC_DOUBLE_R("Master Playback Volume", SSM2602_LOUT1V, SSM2602_ROUT1V,
+ 0, 127, 0),
+SOC_DOUBLE_R("Master Playback ZC Switch", SSM2602_LOUT1V, SSM2602_ROUT1V,
+ 7, 1, 0),
+
+SOC_DOUBLE_R("Capture Volume", SSM2602_LINVOL, SSM2602_RINVOL, 0, 31, 0),
+SOC_DOUBLE_R("Capture Switch", SSM2602_LINVOL, SSM2602_RINVOL, 7, 1, 1),
+
+SOC_SINGLE("Mic Boost (+20dB)", SSM2602_APANA, 0, 1, 0),
+SOC_SINGLE("Mic Switch", SSM2602_APANA, 1, 1, 1),
+
+SOC_SINGLE("Sidetone Playback Volume", SSM2602_APANA, 6, 3, 1),
+
+SOC_SINGLE("ADC High Pass Filter Switch", SSM2602_APDIGI, 0, 1, 1),
+SOC_SINGLE("Store DC Offset Switch", SSM2602_APDIGI, 4, 1, 0),
+
+SOC_ENUM("Capture Source", ssm2602_enum[0]),
+
+SOC_ENUM("Playback De-emphasis", ssm2602_enum[1]),
+};
+
+/* add non dapm controls */
+static int ssm2602_add_controls(struct snd_soc_codec *codec)
+{
+ int err, i;
+
+ for (i = 0; i < ARRAY_SIZE(ssm2602_snd_controls); i++) {
+ err = snd_ctl_add(codec->card,
+ snd_soc_cnew(&ssm2602_snd_controls[i], codec, NULL));
+ if (err < 0)
+ return err;
+ }
+
+ return 0;
+}
+
+/* Output Mixer */
+static const struct snd_kcontrol_new ssm2602_output_mixer_controls[] = {
+SOC_DAPM_SINGLE("Line Bypass Switch", SSM2602_APANA, 3, 1, 0),
+SOC_DAPM_SINGLE("Mic Sidetone Switch", SSM2602_APANA, 5, 1, 0),
+SOC_DAPM_SINGLE("HiFi Playback Switch", SSM2602_APANA, 4, 1, 0),
+};
+
+/* Input mux */
+static const struct snd_kcontrol_new ssm2602_input_mux_controls =
+SOC_DAPM_ENUM("Input Select", ssm2602_enum[0]);
+
+static const struct snd_soc_dapm_widget ssm2602_dapm_widgets[] = {
+SND_SOC_DAPM_MIXER("Output Mixer", SSM2602_PWR, 4, 1,
+ &ssm2602_output_mixer_controls[0],
+ ARRAY_SIZE(ssm2602_output_mixer_controls)),
+SND_SOC_DAPM_DAC("DAC", "HiFi Playback", SSM2602_PWR, 3, 1),
+SND_SOC_DAPM_OUTPUT("LOUT"),
+SND_SOC_DAPM_OUTPUT("LHPOUT"),
+SND_SOC_DAPM_OUTPUT("ROUT"),
+SND_SOC_DAPM_OUTPUT("RHPOUT"),
+SND_SOC_DAPM_ADC("ADC", "HiFi Capture", SSM2602_PWR, 2, 1),
+SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM, 0, 0, &ssm2602_input_mux_controls),
+SND_SOC_DAPM_PGA("Line Input", SSM2602_PWR, 0, 1, NULL, 0),
+SND_SOC_DAPM_MICBIAS("Mic Bias", SSM2602_PWR, 1, 1),
+SND_SOC_DAPM_INPUT("MICIN"),
+SND_SOC_DAPM_INPUT("RLINEIN"),
+SND_SOC_DAPM_INPUT("LLINEIN"),
+};
+
+static const struct snd_soc_dapm_route audio_conn[] = {
+ /* output mixer */
+ {"Output Mixer", "Line Bypass Switch", "Line Input"},
+ {"Output Mixer", "HiFi Playback Switch", "DAC"},
+ {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
+
+ /* outputs */
+ {"RHPOUT", NULL, "Output Mixer"},
+ {"ROUT", NULL, "Output Mixer"},
+ {"LHPOUT", NULL, "Output Mixer"},
+ {"LOUT", NULL, "Output Mixer"},
+
+ /* input mux */
+ {"Input Mux", "Line", "Line Input"},
+ {"Input Mux", "Mic", "Mic Bias"},
+ {"ADC", NULL, "Input Mux"},
+
+ /* inputs */
+ {"Line Input", NULL, "LLINEIN"},
+ {"Line Input", NULL, "RLINEIN"},
+ {"Mic Bias", NULL, "MICIN"},
+};
+
+static int ssm2602_add_widgets(struct snd_soc_codec *codec)
+{
+ snd_soc_dapm_new_controls(codec, ssm2602_dapm_widgets,
+ ARRAY_SIZE(ssm2602_dapm_widgets));
+
+ snd_soc_dapm_add_routes(codec, audio_conn, ARRAY_SIZE(audio_conn));
+
+ snd_soc_dapm_new_widgets(codec);
+ return 0;
+}
+
+struct _coeff_div {
+ u32 mclk;
+ u32 rate;
+ u16 fs;
+ u8 sr:4;
+ u8 bosr:1;
+ u8 usb:1;
+};
+
+/* codec mclk clock divider coefficients */
+static const struct _coeff_div coeff_div[] = {
+ /* 48k */
+ {12288000, 48000, 256, 0x0, 0x0, 0x0},
+ {18432000, 48000, 384, 0x0, 0x1, 0x0},
+ {12000000, 48000, 250, 0x0, 0x0, 0x1},
+
+ /* 32k */
+ {12288000, 32000, 384, 0x6, 0x0, 0x0},
+ {18432000, 32000, 576, 0x6, 0x1, 0x0},
+ {12000000, 32000, 375, 0x6, 0x0, 0x1},
+
+ /* 8k */
+ {12288000, 8000, 1536, 0x3, 0x0, 0x0},
+ {18432000, 8000, 2304, 0x3, 0x1, 0x0},
+ {11289600, 8000, 1408, 0xb, 0x0, 0x0},
+ {16934400, 8000, 2112, 0xb, 0x1, 0x0},
+ {12000000, 8000, 1500, 0x3, 0x0, 0x1},
+
+ /* 96k */
+ {12288000, 96000, 128, 0x7, 0x0, 0x0},
+ {18432000, 96000, 192, 0x7, 0x1, 0x0},
+ {12000000, 96000, 125, 0x7, 0x0, 0x1},
+
+ /* 44.1k */
+ {11289600, 44100, 256, 0x8, 0x0, 0x0},
+ {16934400, 44100, 384, 0x8, 0x1, 0x0},
+ {12000000, 44100, 272, 0x8, 0x1, 0x1},
+
+ /* 88.2k */
+ {11289600, 88200, 128, 0xf, 0x0, 0x0},
+ {16934400, 88200, 192, 0xf, 0x1, 0x0},
+ {12000000, 88200, 136, 0xf, 0x1, 0x1},
+};
+
+static inline int get_coeff(int mclk, int rate)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(coeff_div); i++) {
+ if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk)
+ return i;
+ }
+ return i;
+}
+
+static int ssm2602_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ u16 srate;
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ u16 iface = ssm2602_read_reg_cache(codec, SSM2602_IFACE) & 0xfff3;
+ int i = get_coeff(ssm2602->sysclk, params_rate(params));
+
+ /*no match is found*/
+ if (i == ARRAY_SIZE(coeff_div))
+ return -EINVAL;
+
+ srate = (coeff_div[i].sr << 2) |
+ (coeff_div[i].bosr << 1) | coeff_div[i].usb;
+
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ ssm2602_write(codec, SSM2602_SRATE, srate);
+
+ /* bit size */
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ break;
+ case SNDRV_PCM_FORMAT_S20_3LE:
+ iface |= 0x0004;
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ iface |= 0x0008;
+ break;
+ case SNDRV_PCM_FORMAT_S32_LE:
+ iface |= 0x000c;
+ break;
+ }
+ ssm2602_write(codec, SSM2602_IFACE, iface);
+ ssm2602_write(codec, SSM2602_ACTIVE, ACTIVE_ACTIVATE_CODEC);
+ return 0;
+}
+
+static int ssm2602_startup(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ struct snd_pcm_runtime *master_runtime;
+
+ /* The DAI has shared clocks so if we already have a playback or
+ * capture going then constrain this substream to match it.
+ */
+ if (ssm2602->master_substream) {
+ master_runtime = ssm2602->master_substream->runtime;
+ snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_RATE,
+ master_runtime->rate,
+ master_runtime->rate);
+
+ snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+ master_runtime->sample_bits,
+ master_runtime->sample_bits);
+
+ ssm2602->slave_substream = substream;
+ } else
+ ssm2602->master_substream = substream;
+
+ return 0;
+}
+
+static int ssm2602_pcm_prepare(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ /* set active */
+ ssm2602_write(codec, SSM2602_ACTIVE, ACTIVE_ACTIVATE_CODEC);
+
+ return 0;
+}
+
+static void ssm2602_shutdown(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ /* deactivate */
+ if (!codec->active)
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+}
+
+static int ssm2602_mute(struct snd_soc_dai *dai, int mute)
+{
+ struct snd_soc_codec *codec = dai->codec;
+ u16 mute_reg = ssm2602_read_reg_cache(codec, SSM2602_APDIGI) & ~APDIGI_ENABLE_DAC_MUTE;
+ if (mute)
+ ssm2602_write(codec, SSM2602_APDIGI,
+ mute_reg | APDIGI_ENABLE_DAC_MUTE);
+ else
+ ssm2602_write(codec, SSM2602_APDIGI, mute_reg);
+ return 0;
+}
+
+static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+ int clk_id, unsigned int freq, int dir)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ switch (freq) {
+ case 11289600:
+ case 12000000:
+ case 12288000:
+ case 16934400:
+ case 18432000:
+ ssm2602->sysclk = freq;
+ return 0;
+ }
+ return -EINVAL;
+}
+
+static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
+ unsigned int fmt)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ u16 iface = 0;
+
+ /* set master/slave audio interface */
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBM_CFM:
+ iface |= 0x0040;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* interface format */
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+ case SND_SOC_DAIFMT_I2S:
+ iface |= 0x0002;
+ break;
+ case SND_SOC_DAIFMT_RIGHT_J:
+ break;
+ case SND_SOC_DAIFMT_LEFT_J:
+ iface |= 0x0001;
+ break;
+ case SND_SOC_DAIFMT_DSP_A:
+ iface |= 0x0003;
+ break;
+ case SND_SOC_DAIFMT_DSP_B:
+ iface |= 0x0013;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* clock inversion */
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_NF:
+ break;
+ case SND_SOC_DAIFMT_IB_IF:
+ iface |= 0x0090;
+ break;
+ case SND_SOC_DAIFMT_IB_NF:
+ iface |= 0x0080;
+ break;
+ case SND_SOC_DAIFMT_NB_IF:
+ iface |= 0x0010;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* set iface */
+ ssm2602_write(codec, SSM2602_IFACE, iface);
+ return 0;
+}
+
+static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
+ enum snd_soc_bias_level level)
+{
+ u16 reg = ssm2602_read_reg_cache(codec, SSM2602_PWR) & 0xff7f;
+
+ switch (level) {
+ case SND_SOC_BIAS_ON:
+ /* vref/mid, osc on, dac unmute */
+ ssm2602_write(codec, SSM2602_PWR, reg);
+ break;
+ case SND_SOC_BIAS_PREPARE:
+ break;
+ case SND_SOC_BIAS_STANDBY:
+ /* everything off except vref/vmid, */
+ ssm2602_write(codec, SSM2602_PWR, reg | PWR_CLK_OUT_PDN);
+ break;
+ case SND_SOC_BIAS_OFF:
+ /* everything off, dac mute, inactive */
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ ssm2602_write(codec, SSM2602_PWR, 0xffff);
+ break;
+
+ }
+ codec->bias_level = level;
+ return 0;
+}
+
+#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
+ SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
+ SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
+ SNDRV_PCM_RATE_96000)
+
+struct snd_soc_dai ssm2602_dai = {
+ .name = "SSM2602",
+ .playback = {
+ .stream_name = "Playback",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = SSM2602_RATES,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,},
+ .capture = {
+ .stream_name = "Capture",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = SSM2602_RATES,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,},
+ .ops = {
+ .startup = ssm2602_startup,
+ .prepare = ssm2602_pcm_prepare,
+ .hw_params = ssm2602_hw_params,
+ .shutdown = ssm2602_shutdown,
+ },
+ .dai_ops = {
+ .digital_mute = ssm2602_mute,
+ .set_sysclk = ssm2602_set_dai_sysclk,
+ .set_fmt = ssm2602_set_dai_fmt,
+ }
+};
+EXPORT_SYMBOL_GPL(ssm2602_dai);
+
+static int ssm2602_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
+ return 0;
+}
+
+static int ssm2602_resume(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+ int i;
+ u8 data[2];
+ u16 *cache = codec->reg_cache;
+
+ /* Sync reg_cache with the hardware */
+ for (i = 0; i < ARRAY_SIZE(ssm2602_reg); i++) {
+ data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001);
+ data[1] = cache[i] & 0x00ff;
+ codec->hw_write(codec->control_data, data, 2);
+ }
+ ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ ssm2602_set_bias_level(codec, codec->suspend_bias_level);
+ return 0;
+}
+
+/*
+ * initialise the ssm2602 driver
+ * register the mixer and dsp interfaces with the kernel
+ */
+static int ssm2602_init(struct snd_soc_device *socdev)
+{
+ struct snd_soc_codec *codec = socdev->codec;
+ int reg, ret = 0;
+
+ codec->name = "SSM2602";
+ codec->owner = THIS_MODULE;
+ codec->read = ssm2602_read_reg_cache;
+ codec->write = ssm2602_write;
+ codec->set_bias_level = ssm2602_set_bias_level;
+ codec->dai = &ssm2602_dai;
+ codec->num_dai = 1;
+ codec->reg_cache_size = sizeof(ssm2602_reg);
+ codec->reg_cache = kmemdup(ssm2602_reg, sizeof(ssm2602_reg),
+ GFP_KERNEL);
+ if (codec->reg_cache == NULL)
+ return -ENOMEM;
+
+ ssm2602_reset(codec);
+
+ /* register pcms */
+ ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+ if (ret < 0) {
+ pr_err("ssm2602: failed to create pcms\n");
+ goto pcm_err;
+ }
+ /*power on device*/
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ /* set the update bits */
+ reg = ssm2602_read_reg_cache(codec, SSM2602_LINVOL);
+ ssm2602_write(codec, SSM2602_LINVOL, reg | LINVOL_LRIN_BOTH);
+ reg = ssm2602_read_reg_cache(codec, SSM2602_RINVOL);
+ ssm2602_write(codec, SSM2602_RINVOL, reg | RINVOL_RLIN_BOTH);
+ reg = ssm2602_read_reg_cache(codec, SSM2602_LOUT1V);
+ ssm2602_write(codec, SSM2602_LOUT1V, reg | LOUT1V_LRHP_BOTH);
+ reg = ssm2602_read_reg_cache(codec, SSM2602_ROUT1V);
+ ssm2602_write(codec, SSM2602_ROUT1V, reg | ROUT1V_RLHP_BOTH);
+ /*select Line in as default input*/
+ ssm2602_write(codec, SSM2602_APANA,
+ APANA_ENABLE_MIC_BOOST2 | APANA_SELECT_DAC | APANA_ENABLE_MIC_BOOST);
+ ssm2602_write(codec, SSM2602_PWR, 0);
+
+ ssm2602_add_controls(codec);
+ ssm2602_add_widgets(codec);
+ ret = snd_soc_register_card(socdev);
+ if (ret < 0) {
+ pr_err("ssm2602: failed to register card\n");
+ goto card_err;
+ }
+
+ return ret;
+
+card_err:
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+pcm_err:
+ kfree(codec->reg_cache);
+ return ret;
+}
+
+static struct snd_soc_device *ssm2602_socdev;
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+/*
+ * ssm2602 2 wire address is determined by GPIO5
+ * state during powerup.
+ * low = 0x1a
+ * high = 0x1b
+ */
+static int ssm2602_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
+{
+ struct snd_soc_device *socdev = ssm2602_socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ int ret;
+
+ i2c_set_clientdata(i2c, codec);
+ codec->control_data = i2c;
+
+ ret = ssm2602_init(socdev);
+ if (ret < 0)
+ pr_err("failed to initialise SSM2602\n");
+
+ return ret;
+}
+
+static int ssm2602_i2c_remove(struct i2c_client *client)
+{
+ struct snd_soc_codec *codec = i2c_get_clientdata(client);
+ kfree(codec->reg_cache);
+ return 0;
+}
+
+static const struct i2c_device_id ssm2602_i2c_id[] = {
+ { "ssm2602", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id);
+/* corgi i2c codec control layer */
+static struct i2c_driver ssm2602_i2c_driver = {
+ .driver = {
+ .name = "SSM2602 I2C Codec",
+ .owner = THIS_MODULE,
+ },
+ .probe = ssm2602_i2c_probe,
+ .remove = ssm2602_i2c_remove,
+ .id_table = ssm2602_i2c_id,
+};
+
+static int ssm2602_add_i2c_device(struct platform_device *pdev,
+ const struct ssm2602_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&ssm2602_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "ssm2602", I2C_NAME_SIZE);
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+ return 0;
+err_driver:
+ i2c_del_driver(&ssm2602_i2c_driver);
+ return -ENODEV;
+}
+
+#endif
+
+static int ssm2602_probe(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct ssm2602_setup_data *setup;
+ struct snd_soc_codec *codec;
+ struct ssm2602_priv *ssm2602;
+ int ret = 0;
+
+ pr_info("ssm2602 Audio Codec %s", SSM2602_VERSION);
+
+ setup = socdev->codec_data;
+ codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+ if (codec == NULL)
+ return -ENOMEM;
+
+ ssm2602 = kzalloc(sizeof(struct ssm2602_priv), GFP_KERNEL);
+ if (ssm2602 == NULL) {
+ kfree(codec);
+ return -ENOMEM;
+ }
+
+ codec->private_data = ssm2602;
+ socdev->codec = codec;
+ mutex_init(&codec->mutex);
+ INIT_LIST_HEAD(&codec->dapm_widgets);
+ INIT_LIST_HEAD(&codec->dapm_paths);
+
+ ssm2602_socdev = socdev;
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ if (setup->i2c_address) {
+ codec->hw_write = (hw_write_t)i2c_master_send;
+ ret = ssm2602_add_i2c_device(pdev, setup);
+ }
+#else
+ /* other interfaces */
+#endif
+ return ret;
+}
+
+/* remove everything here */
+static int ssm2602_remove(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ if (codec->control_data)
+ ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
+ i2c_del_driver(&ssm2602_i2c_driver);
+#endif
+ kfree(codec->private_data);
+ kfree(codec);
+
+ return 0;
+}
+
+struct snd_soc_codec_device soc_codec_dev_ssm2602 = {
+ .probe = ssm2602_probe,
+ .remove = ssm2602_remove,
+ .suspend = ssm2602_suspend,
+ .resume = ssm2602_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_ssm2602);
+
+MODULE_DESCRIPTION("ASoC ssm2602 driver");
+MODULE_AUTHOR("Cliff Cai");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/ssm2602.h b/sound/soc/codecs/ssm2602.h
new file mode 100644
index 0000000..f344e6d
--- /dev/null
+++ b/sound/soc/codecs/ssm2602.h
@@ -0,0 +1,130 @@
+/*
+ * File: sound/soc/codecs/ssm2602.h
+ * Author: Cliff Cai <Cliff.Cai(a)analog.com>
+ *
+ * Created: Tue June 06 2008
+ *
+ * Modified:
+ * Copyright 2008 Analog Devices Inc.
+ *
+ * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SSM2602_H
+#define _SSM2602_H
+
+/* SSM2602 Codec Register definitions */
+
+#define SSM2602_LINVOL 0x00
+#define SSM2602_RINVOL 0x01
+#define SSM2602_LOUT1V 0x02
+#define SSM2602_ROUT1V 0x03
+#define SSM2602_APANA 0x04
+#define SSM2602_APDIGI 0x05
+#define SSM2602_PWR 0x06
+#define SSM2602_IFACE 0x07
+#define SSM2602_SRATE 0x08
+#define SSM2602_ACTIVE 0x09
+#define SSM2602_RESET 0x0f
+
+/*SSM2602 Codec Register Field definitions
+ *(Mask value to extract the corresponding Register field)
+ */
+
+/*Left ADC Volume Control (SSM2602_REG_LEFT_ADC_VOL)*/
+#define LINVOL_LIN_VOL 0x01F /* Left Channel PGA Volume control */
+#define LINVOL_LIN_ENABLE_MUTE 0x080 /* Left Channel Input Mute */
+#define LINVOL_LRIN_BOTH 0x100 /* Left Channel Line Input Volume update */
+
+/*Right ADC Volume Control (SSM2602_REG_RIGHT_ADC_VOL)*/
+#define RINVOL_RIN_VOL 0x01F /* Right Channel PGA Volume control */
+#define RINVOL_RIN_ENABLE_MUTE 0x080 /* Right Channel Input Mute */
+#define RINVOL_RLIN_BOTH 0x100 /* Right Channel Line Input Volume update */
+
+/*Left DAC Volume Control (SSM2602_REG_LEFT_DAC_VOL)*/
+#define LOUT1V_LHP_VOL 0x07F /* Left Channel Headphone volume control */
+#define LOUT1V_ENABLE_LZC 0x080 /* Left Channel Zero cross detect enable */
+#define LOUT1V_LRHP_BOTH 0x100 /* Left Channel Headphone volume update */
+
+/*Right DAC Volume Control (SSM2602_REG_RIGHT_DAC_VOL)*/
+#define ROUT1V_RHP_VOL 0x07F /* Right Channel Headphone volume control */
+#define ROUT1V_ENABLE_RZC 0x080 /* Right Channel Zero cross detect enable */
+#define ROUT1V_RLHP_BOTH 0x100 /* Right Channel Headphone volume update */
+
+/*Analogue Audio Path Control (SSM2602_REG_ANALOGUE_PATH)*/
+#define APANA_ENABLE_MIC_BOOST 0x001 /* Primary Microphone Amplifier gain booster control */
+#define APANA_ENABLE_MIC_MUTE 0x002 /* Microphone Mute Control */
+#define APANA_ADC_IN_SELECT 0x004 /* Microphone/Line IN select to ADC (1=MIC, 0=Line In) */
+#define APANA_ENABLE_BYPASS 0x008 /* Line input bypass to line output */
+#define APANA_SELECT_DAC 0x010 /* Select DAC (1=Select DAC, 0=Don't Select DAC) */
+#define APANA_ENABLE_SIDETONE 0x020 /* Enable/Disable Side Tone */
+#define APANA_SIDETONE_ATTN 0x0C0 /* Side Tone Attenuation */
+#define APANA_ENABLE_MIC_BOOST2 0x100 /* Secondary Microphone Amplifier gain booster control */
+
+/*Digital Audio Path Control (SSM2602_REG_DIGITAL_PATH)*/
+#define APDIGI_ENABLE_ADC_HPF 0x001 /* Enable/Disable ADC Highpass Filter */
+#define APDIGI_DE_EMPHASIS 0x006 /* De-Emphasis Control */
+#define APDIGI_ENABLE_DAC_MUTE 0x008 /* DAC Mute Control */
+#define APDIGI_STORE_OFFSET 0x010 /* Store/Clear DC offset when HPF is disabled */
+
+/*Power Down Control (SSM2602_REG_POWER)
+ *(1=Enable PowerDown, 0=Disable PowerDown)
+ */
+#define PWR_LINE_IN_PDN 0x001 /* Line Input Power Down */
+#define PWR_MIC_PDN 0x002 /* Microphone Input & Bias Power Down */
+#define PWR_ADC_PDN 0x004 /* ADC Power Down */
+#define PWR_DAC_PDN 0x008 /* DAC Power Down */
+#define PWR_OUT_PDN 0x010 /* Outputs Power Down */
+#define PWR_OSC_PDN 0x020 /* Oscillator Power Down */
+#define PWR_CLK_OUT_PDN 0x040 /* CLKOUT Power Down */
+#define PWR_POWER_OFF 0x080 /* POWEROFF Mode */
+
+/*Digital Audio Interface Format (SSM2602_REG_DIGITAL_IFACE)*/
+#define IFACE_IFACE_FORMAT 0x003 /* Digital Audio input format control */
+#define IFACE_AUDIO_DATA_LEN 0x00C /* Audio Data word length control */
+#define IFACE_DAC_LR_POLARITY 0x010 /* Polarity Control for clocks in RJ,LJ and I2S modes */
+#define IFACE_DAC_LR_SWAP 0x020 /* Swap DAC data control */
+#define IFACE_ENABLE_MASTER 0x040 /* Enable/Disable Master Mode */
+#define IFACE_BCLK_INVERT 0x080 /* Bit Clock Inversion control */
+
+/*Sampling Control (SSM2602_REG_SAMPLING_CTRL)*/
+#define SRATE_ENABLE_USB_MODE 0x001 /* Enable/Disable USB Mode */
+#define SRATE_BOS_RATE 0x002 /* Base Over-Sampling rate */
+#define SRATE_SAMPLE_RATE 0x03C /* Clock setting condition (Sampling rate control) */
+#define SRATE_CORECLK_DIV2 0x040 /* Core Clock divider select */
+#define SRATE_CLKOUT_DIV2 0x080 /* Clock Out divider select */
+
+/*Active Control (SSM2602_REG_ACTIVE_CTRL)*/
+#define ACTIVE_ACTIVATE_CODEC 0x001 /* Activate Codec Digital Audio Interface */
+
+/*********************************************************************/
+
+#define SSM2602_CACHEREGNUM 10
+
+#define SSM2602_SYSCLK 0
+#define SSM2602_DAI 0
+
+struct ssm2602_setup_data {
+ int i2c_bus;
+ unsigned short i2c_address;
+};
+
+extern struct snd_soc_dai ssm2602_dai;
+extern struct snd_soc_codec_device soc_codec_dev_ssm2602;
+
+#endif
--
1.5.6
2
1

05 Sep '08
The CS4270 ASoC driver was not cleaning up resources completely during an
I2C unbind. The same problem could occur if the bind failed.
Rearranged a couple functions to eliminate an unnecessary function declaration.
Signed-off-by: Timur Tabi <timur(a)freescale.com>
---
This patch is a fix for 2.6.27. It applies only to the ASoC V1 version of the
driver. A similar fix for the V2 version will be posted later.
sound/soc/codecs/cs4270.c | 94 ++++++++++++++++++++++++++++++--------------
1 files changed, 64 insertions(+), 30 deletions(-)
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 82d94f0..eb38e92 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -490,29 +490,6 @@ static int cs4270_mute(struct snd_soc_dai *dai, int mute)
#endif
-static int cs4270_i2c_probe(struct i2c_client *, const struct i2c_device_id *);
-
-/* A list of non-DAPM controls that the CS4270 supports */
-static const struct snd_kcontrol_new cs4270_snd_controls[] = {
- SOC_DOUBLE_R("Master Playback Volume",
- CS4270_VOLA, CS4270_VOLB, 0, 0xFF, 1)
-};
-
-static const struct i2c_device_id cs4270_id[] = {
- {"cs4270", 0},
- {}
-};
-MODULE_DEVICE_TABLE(i2c, cs4270_id);
-
-static struct i2c_driver cs4270_i2c_driver = {
- .driver = {
- .name = "CS4270 I2C",
- .owner = THIS_MODULE,
- },
- .id_table = cs4270_id,
- .probe = cs4270_i2c_probe,
-};
-
/*
* Global variable to store socdev for i2c probe function.
*
@@ -530,6 +507,12 @@ static struct i2c_driver cs4270_i2c_driver = {
*/
static struct snd_soc_device *cs4270_socdev;
+/* A list of non-DAPM controls that the CS4270 supports */
+static const struct snd_kcontrol_new cs4270_snd_controls[] = {
+ SOC_DOUBLE_R("Master Playback Volume",
+ CS4270_VOLA, CS4270_VOLB, 0, 0xFF, 1)
+};
+
/*
* Initialize the I2C interface of the CS4270
*
@@ -559,8 +542,7 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
codec->reg_cache = kzalloc(CS4270_NUMREGS, GFP_KERNEL);
if (!codec->reg_cache) {
printk(KERN_ERR "cs4270: could not allocate register cache\n");
- ret = -ENOMEM;
- goto error;
+ return -ENOMEM;
}
/* Verify that we have a CS4270 */
@@ -610,20 +592,72 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
return 0;
error:
- if (codec->control_data) {
- i2c_detach_client(i2c_client);
- codec->control_data = NULL;
+ for (i = 1; i <= ARRAY_SIZE(cs4270_snd_controls); i++) {
+ struct snd_kcontrol *kctrl =
+ snd_ctl_find_numid(codec->card, i);
+
+ if (kctrl)
+ snd_ctl_remove(codec->card, kctrl);
}
+ codec->control_data = NULL;
+
kfree(codec->reg_cache);
codec->reg_cache = NULL;
codec->reg_cache_size = 0;
- kfree(i2c_client);
-
return ret;
}
+/*
+ * Remove I2C interface of the CS4270
+ *
+ * Since this driver cannot be compiled as a module, the only way this
+ * function can be called is if the I2C subsystem unbinds it. This can be
+ * triggered, for instance, by writing the device ID to this drivers
+ * 'unbind' file in /sys.
+ */
+static int cs4270_i2c_remove(struct i2c_client *i2c_client)
+{
+ struct snd_soc_codec *codec = i2c_get_clientdata(i2c_client);
+
+ if (codec) {
+ unsigned int i;
+
+ for (i = 1; i <= ARRAY_SIZE(cs4270_snd_controls); i++) {
+ struct snd_kcontrol *kctrl =
+ snd_ctl_find_numid(codec->card, i);
+
+ if (kctrl)
+ snd_ctl_remove(codec->card, kctrl);
+ }
+
+ codec->control_data = NULL;
+
+ kfree(codec->reg_cache);
+ codec->reg_cache = NULL;
+ codec->reg_cache_size = 0;
+ }
+
+ return 0;
+}
+
+static const struct i2c_device_id cs4270_id[] = {
+ {"cs4270", 0},
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, cs4270_id);
+
+static struct i2c_driver cs4270_i2c_driver = {
+ .driver = {
+ .name = "cs4270",
+ .owner = THIS_MODULE,
+ },
+ .id_table = cs4270_id,
+ .probe = cs4270_i2c_probe,
+ .remove = cs4270_i2c_remove,
+};
+
#endif /* USE_I2C*/
struct snd_soc_dai cs4270_dai = {
--
1.5.5
2
9
Hi Mark,
With Cliff's effort, we update this patch series quickly according to
your review.
v1-v2:
- move ASoC Blackfin Kconfig and Makefile patch to be the last one
in the series
- fix coding style issues
- The SND_SOC_DAFIMT_LEFT_J: ought to be default
- fix other minor issues
v0-v1:
- fix coding style issues
- use latest ASoC API
- split the whole patch into this 9 patches in a patchset
Thanks a lot
-Bryan
2
14
Hello everyone,
Im Travis (wishie) once of the many helpers who man the unofficial #alsa on
freenode irc network.. I usually spend my time fixing other peoples sound
issues, but now i have my own.
I have a HP DV2839TX laptop, and i get ALOT of static when recording via the
inbuilt mic. Also, the mic controls are very strange.. I have (in the Capture
section of alsamixer).. Digital, Docking Mic, External Mic, Internal Mic..
only the "Digital" control seems to effect my recording volume at all.
Strangely, though, the '* Mic' controls in the PLAYBACK section of alsamixer
do change the recording properties somewhat (volume being the main factor).
In any event, i get a rather large amount of static, no matter what mixer
settings i try. This isnt a problem in the 'other' OS.
My alsa-info.sh output for alsa-driver 1.0.16 is at :
http://www.alsa-project.org/db/?f=0d1df6446ff1c71ad305e7b7b367f0a6b22b80c8
My alsa-info.sh output for alsa-driver 1.0.18rc1 is at :
http://www.alsa-project.org/db/?f=9e5cd99f4822e0d671866fa630698bd1b0cd954b
2
2
Hi there!
I noticed that using "alsamixer" several controls that are connected to sound
input (ALC) are listed in the "playback" tab as well as in "capture", as well
as certain playback controls as "bass" "trebel" also can be found under
"capture". However, changing those controls' values only seem to take effect in
the "playback" tab.
I was wondering if this is intentional or unintentional done by the WM8750
codec driver or an alsamixer "feature".
Thx
Greez,
Harry
2
1

05 Sep '08
At Wed, 3 Sep 2008 15:58:17 +0800,
peerchen wrote:
>
> Add the nvidia HDMI codec driver for MCP77/79.
> The patch based on kernel 2.6.27-rc5.
>
> Signed-off-by: Wei Ni <wni(a)nvidia.com>
> Signed-off-by: Peer Chen <peerchen(a)gmail.com>
Thanks for the patch. Some comments below.
> diff -uprN -X linux-2.6.26-Orig/Documentation/dontdiff linux-2.6.26-Orig/sound/pci/hda/hda_intel.c linux-2.6.26-New/sound/pci/hda/hda_intel.c
> --- linux-2.6.26-Orig/sound/pci/hda/hda_intel.c 2008-08-28 13:47:20.000000000 +0800
> +++ linux-2.6.26-New/sound/pci/hda/hda_intel.c 2008-08-28 15:33:51.000000000 +0800
> @@ -223,8 +223,8 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO
> #define RIRB_INT_MASK 0x05
>
> /* STATESTS int mask: SD2,SD1,SD0 */
> -#define AZX_MAX_CODECS 3
> -#define STATESTS_INT_MASK 0x07
> +#define AZX_MAX_CODECS 4
> +#define STATESTS_INT_MASK 0x0f
This may break other platforms. Expanding STATESTS_INT_MASK is OK and
would be harmless, but AZX_MAX_CODECS is not.
AZX_MAX_CODECS is the default number of max codecs. The chipset
specific max number of codecs is defined in azx_max_codecs[].
If Nvidia chipsets supports properly more than 3, change
azx_max_codecs[AZX_DRIVER_NVIDIA] to 4.
> +static unsigned short convert_from_spdif_status_nv(unsigned int sbits)
> +{
> + unsigned short val = 0;
> +
> + if (sbits & IEC958_AES0_PROFESSIONAL)
> + val |= AC_DIG1_PROFESSIONAL;
> + if (sbits & IEC958_AES0_NONAUDIO)
> + val |= AC_DIG1_NONAUDIO;
> + if (sbits & IEC958_AES0_PROFESSIONAL) {
> + if ((sbits & IEC958_AES0_PRO_EMPHASIS) ==
> + IEC958_AES0_PRO_EMPHASIS_5015)
> + val |= AC_DIG1_EMPHASIS;
> + } else {
> + if ((sbits & IEC958_AES0_CON_EMPHASIS) ==
> + IEC958_AES0_CON_EMPHASIS_5015)
> + val |= AC_DIG1_EMPHASIS;
> + if (!(sbits & IEC958_AES0_CON_NOT_COPYRIGHT))
> + val |= AC_DIG1_COPYRIGHT;
> + if (sbits & (IEC958_AES1_CON_ORIGINAL << 8))
> + val |= AC_DIG1_LEVEL;
> + val |= sbits & (IEC958_AES1_CON_CATEGORY << 8);
> + }
> + return val;
> +}
> +
> +static unsigned int convert_to_spdif_status_nv(unsigned short val)
> +{
> + unsigned int sbits = 0;
> +
> + if (val & AC_DIG1_NONAUDIO)
> + sbits |= IEC958_AES0_NONAUDIO;
> + if (val & AC_DIG1_PROFESSIONAL)
> + sbits |= IEC958_AES0_PROFESSIONAL;
> + if (sbits & IEC958_AES0_PROFESSIONAL) {
> + if (sbits & AC_DIG1_EMPHASIS)
> + sbits |= IEC958_AES0_PRO_EMPHASIS_5015;
> + } else {
> + if (val & AC_DIG1_EMPHASIS)
> + sbits |= IEC958_AES0_CON_EMPHASIS_5015;
> + if (!(val & AC_DIG1_COPYRIGHT))
> + sbits |= IEC958_AES0_CON_NOT_COPYRIGHT;
> + if (val & AC_DIG1_LEVEL)
> + sbits |= (IEC958_AES1_CON_ORIGINAL << 8);
> + sbits |= val & (0x7f << 8);
> + }
> + return sbits;
> +}
> +
> +static int snd_hda_hdmi_cmask_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
> + IEC958_AES0_NONAUDIO |
> + IEC958_AES0_CON_EMPHASIS_5015 |
> + IEC958_AES0_CON_NOT_COPYRIGHT;
> + ucontrol->value.iec958.status[1] = IEC958_AES1_CON_CATEGORY |
> + IEC958_AES1_CON_ORIGINAL;
> + return 0;
> +}
> +
> +static int snd_hda_hdmi_pmask_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + ucontrol->value.iec958.status[0] = IEC958_AES0_PROFESSIONAL |
> + IEC958_AES0_NONAUDIO |
> + IEC958_AES0_PRO_EMPHASIS_5015;
> + return 0;
> +}
> +
> +static int snd_hda_hdmi_mask_info(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_info *uinfo)
> +{
> + uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
> + uinfo->count = 1;
> + return 0;
> +}
> +
> +static int snd_hda_hdmi_default_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> +
> + ucontrol->value.iec958.status[0] = codec->spdif_status & 0xff;
> + ucontrol->value.iec958.status[1] = (codec->spdif_status >> 8) & 0xff;
> + ucontrol->value.iec958.status[2] = (codec->spdif_status >> 16) & 0xff;
> + ucontrol->value.iec958.status[3] = (codec->spdif_status >> 24) & 0xff;
> +
> + return 0;
> +}
> +
> +static int snd_hda_hdmi_default_put(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> + hda_nid_t nid = kcontrol->private_value;
> + unsigned short val;
> + int change;
> +
> + mutex_lock(&codec->spdif_mutex);
> + codec->spdif_status = ucontrol->value.iec958.status[0] |
> + ((unsigned int)ucontrol->value.iec958.status[1] << 8) |
> + ((unsigned int)ucontrol->value.iec958.status[2] << 16) |
> + ((unsigned int)ucontrol->value.iec958.status[3] << 24);
> + val = convert_from_spdif_status_nv(codec->spdif_status);
> + val |= codec->spdif_ctls & 1;
> + change = codec->spdif_ctls != val;
> + codec->spdif_ctls = val;
> +
> + if (change) {
> + snd_hda_codec_write_cache(codec, nid, 0,
> + AC_VERB_SET_DIGI_CONVERT_1,
> + val & 0xff);
> + snd_hda_codec_write_cache(codec, nid, 0,
> + AC_VERB_SET_DIGI_CONVERT_2,
> + val >> 8);
> + }
> +
> + mutex_unlock(&codec->spdif_mutex);
> + return change;
> +}
> +
> +#define snd_hda_hdmi_out_switch_info snd_ctl_boolean_mono_info
> +
> +static int snd_hda_hdmi_out_switch_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> +
> + ucontrol->value.integer.value[0] = codec->spdif_ctls & AC_DIG1_ENABLE;
> + return 0;
> +}
> +
> +static int snd_hda_hdmi_out_switch_put(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
> + hda_nid_t nid = kcontrol->private_value;
> + unsigned short val;
> + int change;
> +
> + mutex_lock(&codec->spdif_mutex);
> + val = codec->spdif_ctls & ~AC_DIG1_ENABLE;
> + if (ucontrol->value.integer.value[0])
> + val |= AC_DIG1_ENABLE;
> + change = codec->spdif_ctls != val;
> + if (change) {
> + codec->spdif_ctls = val;
> + snd_hda_codec_write_cache(codec, nid, 0,
> + AC_VERB_SET_DIGI_CONVERT_1,
> + val & 0xff);
> + /* unmute amp switch (if any) */
> + if ((get_wcaps(codec, nid) & AC_WCAP_OUT_AMP) &&
> + (val & AC_DIG1_ENABLE))
> + snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
> + HDA_AMP_MUTE, 0);
> + }
> + mutex_unlock(&codec->spdif_mutex);
> + return change;
> +}
These are almost identical with the functions in hda_codec.c.
Is your intention to allow a different set of IEC958 status bits
controls for HDMI *in addition* to SPDIF? If so, we should change
the codes in hda_codec.c to allow other control names.
> +struct snd_kcontrol_new hdmi_mixes[] = {
> + {
> + .access = SNDRV_CTL_ELEM_ACCESS_READ,
> + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
> + .name = "IEC958 Playback Con Mask HDMI",
> + .info = snd_hda_hdmi_mask_info,
> + .get = snd_hda_hdmi_cmask_get,
> + },
These have also different names from the standard ones.
Any reason?
> +static struct hda_pcm_stream nvhdmi_pcm_digital_playback = {
> + .substreams = 1,
> + .channels_min = 2,
> + .channels_max = 2,
> + .nid = 0x4, /* NID to query formats and rates and setup streams */
> + .rates = SNDRV_PCM_RATE_48000,
> + .maxbps = 16,
> + .formats = SNDRV_PCM_FMTBIT_S16_LE,
Use tabs please.
> +static int nvhdmi_build_pcms(struct hda_codec *codec)
> +{
> + struct nvhdmi_spec *spec = codec->spec;
> + struct hda_pcm *info = &spec->pcm_rec;
> +
> + codec->num_pcms = 1;
> + codec->pcm_info = info;
> +
> + info->name = "NVIDIA HDMI";
> + info->pcm_type = HDA_PCM_TYPE_HDMI
Ditto.
thanks,
Takashi
3
5
It is strange that there is no noise in the first several seconds. It seems
like a buffer overflow with too much data accumulated. However, there should
not be overflow in playback, right?
2008/9/5 Nie Jun <niej0001(a)gmail.com>
> I do not know how these two params will be modified by ALSA lib. It does
> not directly accept specified value.
> With this cmd:
> ./aplay 48k_stero.wav -F5120 -B106400
> I get the nearest setting as following, but still has noise.
>
> channels: 2
> rate: 48000 (48000/1)
> period_size: 248
> buffer_size: 5208
>
>
>
> 2008/9/5 Takashi Iwai <tiwai(a)suse.de>
>
> At Fri, 5 Sep 2008 14:34:51 +0800,
>> Nie Jun wrote:
>> >
>> > I can not figure out the reason of noise and faster consumption from
>> these
>> > different. Do you have any idea about these different? Or any other data
>> may
>> > contain clue?
>>
>> So, do you mean that the problem persists even if you use the exactly
>> same period_size and buffer_size as OSS (i.e. 256 and 5120)?
>>
>>
>> Takashi
>>
>
>
1
0

05 Sep '08
Hi,
any ideas if it would be possible to make envy24control or kenvy24
work on HT/HT-S cards? I'm referring to VU-meters / mixer / settings /
profiles part, not the routing since those chipsets don't support it,
according to VIA.
--
Vedran Miletić
1
0
At Fri, 5 Sep 2008 14:34:51 +0800,
Nie Jun wrote:
>
> I can not figure out the reason of noise and faster consumption from these
> different. Do you have any idea about these different? Or any other data may
> contain clue?
So, do you mean that the problem persists even if you use the exactly
same period_size and buffer_size as OSS (i.e. 256 and 5120)?
Takashi
1
0
If I understand it correctly, when ALSA detects an underrun during playback, it
throttles the driver by sending pause and resume commands.
It turns out that our hardware doesn't really like this. We're looking at
various solutions, but one proposal would be to keep the hardware running during
a pause, but just have it play silence instead. That is, ALSA keeps feeding
silence data during an underrun recovery.
Is there an easy way to do this in ALSA? Is there another driver that does this?
--
Timur Tabi
Linux kernel developer at Freescale
3
3
Thank Takashi for your advice.
I check /proc/asound/card0/pcm0p/sub0/* files, buffer_sizes of both ALSA and
OSS have integer period_size. Maybe other setting causes this issue, but I
can not find it. Would you guys please help have a look at these file?
Thank you very much!
=========== ALSA hw_params ===========
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 480
buffer_size: 9600
----------------- OSS hw_params ---------------------
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 256
buffer_size: 5120
OSS format: S16_LE
OSS channels: 2
OSS rate: 48000
OSS period bytes: 1024
OSS periods: 20
OSS period frames: 256
=========== ALSA sw_params ===========
tstamp_mode: NONE
period_step: 1
avail_min: 480
start_threshold: 9600
stop_threshold: 9600
silence_threshold: 0
silence_size: 0
boundary: 1258291200
----------------- OSS sw_params ---------------------
tstamp_mode: NONE
period_step: 1
avail_min: 1
start_threshold: 1
stop_threshold: 5120
silence_threshold: 272
silence_size: 272
boundary: 1342177280
=========== ALSA status ==========
state: RUNNING
trigger_time: 946744218.914947510
tstamp : 946744304.440704346
delay : 8924
avail : 676
avail_max : 1940
-----
hw_ptr : 4105180
appl_ptr : 4114104
---------------------- OSS status --------------------------
state: RUNNING
trigger_time: 946744382.661376953
tstamp : 946744410.868988037
delay : 4908
avail : 212
avail_max : 4876
-----
hw_ptr : 1353952
appl_ptr : 1358860
============= ALSA OSS has same info -----------------------------
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: I2S HiFi I2S HiFi-PCM-0
name:
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
2008/9/3 Takashi Iwai <tiwai(a)suse.de>:- 显示引用文字 -
2
1

Re: [alsa-devel] are freebob firewire cards likely to be supported by alsa in the future?
by Jonathan Woithe 05 Sep '08
by Jonathan Woithe 05 Sep '08
05 Sep '08
Hi Andy
> Just wondering if there are any plans to develop alsa support for
> firewire freebob cards like the M-Audio firewire solo (which I have). I
> have this working fine under jackd using the freebob driver, but as far
> as I know there isn't an alsa driver for it. I assume that since there
> is already open source code to drive the chip, it should be possible to
> write an alsa driver?
Yes, it would be possible. However, doing so would require that almost
everything freebob/ffado currently does (which is a lot) would have to be
ported and/or reimplemented. This doesn't seem like the best use of
anyone's time.
Instead, there are plans to write an alsa driver interface to libffado and
some preliminary work has been done, but there's no ETA on this at present.
Currently our (ffado's) focus is on getting things working well under JACK
because users of firewire devices will also tend to be JACK users due to the
nature of the firewire devices and the kind of work one normally does with
them.
> This isn't an urgent thing for me - for the moment I'm quite happy to use
> my onboard card for playing music / movies etc, and keep the firewire card
> for recording music etc, but it might be useful sometimes to have an alsa
> driver for this card as well.
Many media players are capable of connecting to JACK. xine, ecasound and
mplayer are a few which come to mind off the top of my head. If your chosen
applications don't do JACK, then you might have some success with oss2jack
assuming your applications can use OSS devices (I haven't personally tried
it so I don't know how well it works). There might even be an equivalent
"alsa2jack" bridge but I haven't seen it if there is. Obviously your best
bet would be to find media players which support JACK natively.
Regards
jonathan
1
0
Hi,
I have a problem using dmix on my embedded system (manual installation of
alsa-lib 1.0.15)
When I play a sound with aplay, it works well.
When I try -D dmix or -D plug:dmix parameter, it doesn't work.
The output is:
aplay: main:547: audio open error: Operation not permitted
I located my problem in alsa-lib, around line 2154 of alsa-lib/src/pcm/pcm.c:
err = snd_pcm_open_conf(pcmp, name, root, pcm_conf, stream, mode); (in
snd_pcm_open_noupdate function)
err result is -1 when it's used with dmix...
I don't know how works alsa-lib. I suppose snd_pcm_open_conf has something
related with configuration files... Since I have all default configuration
files... Maybe I must tweak some to be able to use dmix...
2
3
Hi group,
I am trying to use GDB with my ALSA program. I wish to display (print)
a handle for
an snd_pcm_t pointer. I am getting the following error:
> (gdb) p Device
> $9 = (snd_pcm_t *) 0x92be458
> (gdb) p *Device
> $10 = <incomplete type>
How do I display the snd_pcm_t structure?
Thanks for your time.
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
2
5

[alsa-devel] are freebob firewire cards likely to be supported by alsa in the future?
by andy baxter 05 Sep '08
by andy baxter 05 Sep '08
05 Sep '08
Hello,
Just wondering if there are any plans to develop alsa support for
firewire freebob cards like the M-Audio firewire solo (which I have). I
have this working fine under jackd using the freebob driver, but as far
as I know there isn't an alsa driver for it. I assume that since there
is already open source code to drive the chip, it should be possible to
write an alsa driver? This isn't an urgent thing for me - for the moment
I'm quite happy to use my onboard card for playing music / movies etc,
and keep the firewire card for recording music etc, but it might be
useful sometimes to have an alsa driver for this card as well.
andy
1
0
Hi all,
We would like to ask you a few questions about your use of the Git
version control system. This survey is mainly to understand who is
using Git, how and why.
The results will be published on the Git Wiki
http://git.or.cz/gitwiki/GitSurvey2008
and discussed on the git mailing list.
The survey would be open from 1 September till 10 October.
Please devote a bit of your time to fill this simple questionnaire;
it will help a lot the Git community to understand your needs,
what you like of Git, and of course what you don't like of it.
The survey can be found here:
http://www.survs.com/survey?id=M3PIVU72&channel=2WXE4BVTW8
http://tinyurl.com/GitSurvey2008
--
Git Development Community
1
0

Re: [alsa-devel] snd-soc-cs4270: Convert to a new-style i2c driver (work in progress)
by Jean Delvare 04 Sep '08
by Jean Delvare 04 Sep '08
04 Sep '08
Hi Timur,
On Sun, 31 Aug 2008 11:28:08 -0500, Timur Tabi wrote:
> On Sun, Aug 31, 2008 at 9:18 AM, Jean Delvare <khali(a)linux-fr.org> wrote:
> > Hi Tibur,
>
> It's "Timur"
Oops, apparently I mixed your first name and last name. Sorry about
that.
> > I am in the process of converting your cs4270 codec driver from the
> > legacy i2c model to the new (standard) one.
>
> It has already been converted.
>
> http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=commit;h=0d…
Ah, excellent. One less thing for me to do :) Thanks!
Two comments about your patch:
* Your driver now lacks a remove method. Unless I miss something, if
the snd-soc-cs4270 driver is unloaded, you will leave dangling
resources behind (codec->reg_cache in particular.)
* I2C_DRIVERID_CS4270 must be removed from i2c-id.h.
> I don't know why this commit hasn't been pushed upstream, though.
As I understand it, without that patch the mpc8610_hpcd doesn't work,
as the I2C address of the sound codec will be made busy by the platform
code and thus the snd-soc-cs4270 driver won't be able to attach to it.
If I am correct then I suggest that you ask Takashi to push the patch
to Linus now to fix that.
> > This is work in progress.
> > The patch below converts the cs4270 driver itself. However we also need
> > to convert its users. As far as I can see there's only one user at this
> > point: mpc8610_hpcd.
>
> That's correct. I've never seen any interest in the CS4270 outside of
> Freescale.
>
> > The problem is that this driver doesn't look like the other codec
> > drivers I have already converted. So, we need to add code to
> > instantiate the cs4270 i2c device, but I don't know where this should
> > happen. Given that the mpc8610_hpcd is apparently based on Open
> > Firmware, I guess that the i2c device should be instantiated directly
> > by the platform code. I see that the device is declared in
> > mpc8610_hpcd.dts, so maybe it's already done and my patch should work
> > already? What do you think?
>
> I think you need to use the right git repository for your development. :-)
Very good point indeed. I'll make sure to check Takashi's sound-2.6
tree before attempting to convert any other SoC codec driver. Do you
know off the top of your head if other drivers have already been
converted?
Thanks,
--
Jean Delvare
4
9
Takashi, Jaroslav,
please pull and merge a series of 26 patches for alsa-plugins'
PulseAudio driver which I prepared in this repository of mine:
git://git.0pointer.de/alsa-plugins.git
gitweb is here:
http://git.0pointer.de/?p=alsa-plugins.git
There are quite a few bug fixes and feature enhancements among those
patches. It also includes some clean-ups in the coding
style. i.e. previously the indenting of the PA driver was pure chaos,
every single patch seemed to introduce a new indentation width. The
first patch in this series simply reindents the driver to Linux
style. All other patches are on top of that one.
Here's the shortlog:
Lennart Poettering (26):
Reindent to Linux kernel style
Add Emacs-style /*-*- linux-c -*-*/ header comment
Make pulse_new() a proper C function
Don't modify the SIGPIPE handler
Call pa_context_disconnect() explicitly
use SNDERR instead of fprintf to print error messages
Support S32 sample types
Add trailing NUL character to snprintf output
Get rid of pulse_poll_revents()
Add more error checking
Remove fix for bug 0003470
Rework hardware parameter selection
A bag of minor clean ups for ctl_pulse.c
Make pulse_ext_callback const
Drop our own implementation of the poll() callbacks
A bag of minor clean-ups for pulse.c
Split out O_NONBLOCK setting into seperate function
Save a byte of memory
Adjust buffering metrics to match what PA internally uses
Make sure we always have a sensible channel mapping
Use PA_STREAM_EARLY_REQUESTS if available
Use S32/FLOAT32 only where available in the PA libs
Add const to our snd_pcm_ioplug_callback_t instances
Don't implement our own poll handlers, we can use the default
ones
Remove our own poll handler implementation entirely
A bag of clean-ups for pcm_ctl.c
Those patches only touch the pulse/ subdir.
The tree is freshly rebased against current alsa-plugins master.
May I ask you to make me the "semi-official" maintainer of this
driver? I.e. I'd like to be consulted (as in 'Signed-Off-by') before
any patches for it are merged?
If requested I can also mail this as series of 26 seperate patches.
Thank you,
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
3
3
I've been using the DaVinci ASoC for a few months and have recently
upgraded to the 2.6.26 based DaVinci git kernel. Now my audio DMA
stalls more readily after stopping an active stream. I can manually
trigger the event by poking the ESR to reactivate the stalled stream,
suggesting the problem is in the ASP-to-DMA XEVT interface. This
problem is less prevalent in the 2.6.25 based kernel. Any help?
Regards,
Mark Lokowich
Advanced Communication Design
1
0

[alsa-devel] how to convert stereo capture to mono stream (hardware incompatibility)
by brunal 04 Sep '08
by brunal 04 Sep '08
04 Sep '08
Hi all,
I've already asked my question in the alsa-user list, but as nobody
was able to answer, I'm trying here if I have more chance.
I'm using a USB M-Audio fasttrack pro sound card under linux
2.6.24.rt, and I want to plug it into a voice recognition software
named Julius.
There is an implementation of alsa in Julius, but I can't make it
working with my USB sound card, because when alsa tries to set
channel capture to 1, I get an error from alsa. Here is the code :
/* set number of channels */
if ((err = snd_pcm_hw_params_set_channels(handle, hwparams, 1)) <
0) {
jlog("Error: adin_alsa: cannot set PCM channel to %d (%s)\n", 1,
snd_strerror(err));
return(FALSE);
}
Which always return FALSE.
The thing is that when I change this line to set stereo channels,
Julius recognition engine complains when it runs, and strip lots of
audio packets, which seems to broke recognition.
So my question is : how can I by-pass this problem?
I've tried to do it with the .asoundrc file, but it seems that plugin
or dmix stuff only works with playback, not recording.
Does someone have an idea how to make a recording plugin that accept
stereo stream from hardware and output only the left channel?
I didn't understand how stereo stream are written in the audio buffer
gave by alsa. Can someone explain me how to separate the two stream
once it is written in the buffer?
I really thanks all who would take little attention to my questions,
it's been 5 days I'm digging on the web but I only get code working
for setreo applications, which doesn't help me so much.
And I know I might have an answer if I look into the audacity code,
but it seems to me it's like using a bazooka for fishing redfish....
Best Regards,
Bruno.
2
1

04 Sep '08
From: Cliff Cai <cliff.cai(a)analog.com>
v1-v2:
- coding style fixing
- use pr_xxx macros to replace printk(KERN_XXX...)
- use new-style i2c interface
- update to use latest ASoC API
Signed-off-by: Cliff Cai <cliff.cai(a)analog.com>
Signed-off-by: Bryan Wu <cooloney(a)kernel.org>
---
sound/soc/codecs/Kconfig | 3 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/ssm2602.c | 773 ++++++++++++++++++++++++++++++++++++++++++++
sound/soc/codecs/ssm2602.h | 131 ++++++++
4 files changed, 909 insertions(+), 0 deletions(-)
create mode 100644 sound/soc/codecs/ssm2602.c
create mode 100644 sound/soc/codecs/ssm2602.h
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 5d77dc3..8ef5ce6 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -92,3 +92,6 @@ config SND_SOC_TLV320AIC26
config SND_SOC_TLV320AIC3X
tristate
depends on I2C
+
+config SND_SOC_SSM2602
+ tristate
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index 35daaa9..0cd55ee 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -15,6 +15,7 @@ snd-soc-wm9713-objs := wm9713.o
snd-soc-cs4270-objs := cs4270.o
snd-soc-tlv320aic26-objs := tlv320aic26.o
snd-soc-tlv320aic3x-objs := tlv320aic3x.o
+snd-soc-ssm2602-objs := ssm2602.o
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o
@@ -33,3 +34,4 @@ obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
+obj-$(CONFIG_SND_SOC_SSM2602) += snd-soc-ssm2602.o
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
new file mode 100644
index 0000000..feb462e
--- /dev/null
+++ b/sound/soc/codecs/ssm2602.c
@@ -0,0 +1,773 @@
+/*
+ * File: sound/soc/codecs/ssm2602.c
+ * Author: Cliff Cai <Cliff.Cai(a)analog.com>
+ *
+ * Created: Tue June 06 2008
+ * Description: Driver for ssm2602 sound chip built in ADSP-BF52xC
+ *
+ * Modified:
+ * Copyright 2008 Analog Devices Inc.
+ *
+ * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/platform_device.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+
+#include "ssm2602.h"
+
+#define AUDIO_NAME "ssm2602"
+#define SSM2602_VERSION "0.1"
+
+struct snd_soc_codec_device soc_codec_dev_ssm2602;
+
+/* codec private data */
+struct ssm2602_priv {
+ unsigned int sysclk;
+ struct snd_pcm_substream *master_substream;
+ struct snd_pcm_substream *slave_substream;
+};
+
+/*
+ * ssm2602 register cache
+ * We can't read the ssm2602 register space when we are
+ * using 2 wire for device control, so we cache them instead.
+ * There is no point in caching the reset register
+ */
+static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
+ 0x0017, 0x0017, 0x0079, 0x0079,
+ 0x0000, 0x0000, 0x0000, 0x000a,
+ 0x0000, 0x0000
+};
+
+/*
+ * read ssm2602 register cache
+ */
+static inline unsigned int ssm2602_read_reg_cache(struct snd_soc_codec *codec,
+ unsigned int reg)
+{
+ u16 *cache = codec->reg_cache;
+ if (reg == SSM2602_RESET)
+ return 0;
+ if (reg >= SSM2602_CACHEREGNUM)
+ return -1;
+ return cache[reg];
+}
+
+/*
+ * write ssm2602 register cache
+ */
+static inline void ssm2602_write_reg_cache(struct snd_soc_codec *codec,
+ u16 reg, unsigned int value)
+{
+ u16 *cache = codec->reg_cache;
+ if (reg >= SSM2602_CACHEREGNUM)
+ return;
+ cache[reg] = value;
+}
+
+/*
+ * write to the ssm2602 register space
+ */
+static int ssm2602_write(struct snd_soc_codec *codec, unsigned int reg,
+ unsigned int value)
+{
+ u8 data[2];
+
+ /* data is
+ * D15..D9 ssm2602 register offset
+ * D8...D0 register data
+ */
+ data[0] = (reg << 1) | ((value >> 8) & 0x0001);
+ data[1] = value & 0x00ff;
+
+ ssm2602_write_reg_cache(codec, reg, value);
+ if (codec->hw_write(codec->control_data, data, 2) == 2)
+ return 0;
+ else
+ return -EIO;
+}
+
+#define ssm2602_reset(c) ssm2602_write(c, SSM2602_RESET, 0)
+/*Appending several "None"s just for OSS mixer use*/
+static const char *ssm2602_input_select[] = {
+ "Line", "Mic", "None", "None", "None",
+ "None", "None", "None",
+};
+
+static const char *ssm2602_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
+
+static const struct soc_enum ssm2602_enum[] = {
+ SOC_ENUM_SINGLE(SSM2602_APANA, 2, 2, ssm2602_input_select),
+ SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, 4, ssm2602_deemph),
+};
+
+static const struct snd_kcontrol_new ssm2602_snd_controls[] = {
+
+SOC_DOUBLE_R("Master Playback Volume", SSM2602_LOUT1V, SSM2602_ROUT1V,
+ 0, 127, 0),
+SOC_DOUBLE_R("Master Playback ZC Switch", SSM2602_LOUT1V, SSM2602_ROUT1V,
+ 7, 1, 0),
+
+SOC_DOUBLE_R("Capture Volume", SSM2602_LINVOL, SSM2602_RINVOL, 0, 31, 0),
+SOC_DOUBLE_R("Capture Switch", SSM2602_LINVOL, SSM2602_RINVOL, 7, 1, 1),
+
+SOC_SINGLE("Mic Boost (+20dB)", SSM2602_APANA, 0, 1, 0),
+SOC_SINGLE("Mic Switch", SSM2602_APANA, 1, 1, 1),
+
+SOC_SINGLE("Sidetone Playback Volume", SSM2602_APANA, 6, 3, 1),
+
+SOC_SINGLE("ADC High Pass Filter Switch", SSM2602_APDIGI, 0, 1, 1),
+SOC_SINGLE("Store DC Offset Switch", SSM2602_APDIGI, 4, 1, 0),
+
+SOC_ENUM("Capture Source", ssm2602_enum[0]),
+
+SOC_ENUM("Playback De-emphasis", ssm2602_enum[1]),
+};
+
+/* add non dapm controls */
+static int ssm2602_add_controls(struct snd_soc_codec *codec)
+{
+ int err, i;
+
+ for (i = 0; i < ARRAY_SIZE(ssm2602_snd_controls); i++) {
+ err = snd_ctl_add(codec->card,
+ snd_soc_cnew(&ssm2602_snd_controls[i], codec, NULL));
+ if (err < 0)
+ return err;
+ }
+
+ return 0;
+}
+
+/* Output Mixer */
+static const struct snd_kcontrol_new ssm2602_output_mixer_controls[] = {
+SOC_DAPM_SINGLE("Line Bypass Switch", SSM2602_APANA, 3, 1, 0),
+SOC_DAPM_SINGLE("Mic Sidetone Switch", SSM2602_APANA, 5, 1, 0),
+SOC_DAPM_SINGLE("HiFi Playback Switch", SSM2602_APANA, 4, 1, 0),
+};
+
+/* Input mux */
+static const struct snd_kcontrol_new ssm2602_input_mux_controls =
+SOC_DAPM_ENUM("Input Select", ssm2602_enum[0]);
+
+static const struct snd_soc_dapm_widget ssm2602_dapm_widgets[] = {
+SND_SOC_DAPM_MIXER("Output Mixer", SSM2602_PWR, 4, 1,
+ &ssm2602_output_mixer_controls[0],
+ ARRAY_SIZE(ssm2602_output_mixer_controls)),
+SND_SOC_DAPM_DAC("DAC", "HiFi Playback", SSM2602_PWR, 3, 1),
+SND_SOC_DAPM_OUTPUT("LOUT"),
+SND_SOC_DAPM_OUTPUT("LHPOUT"),
+SND_SOC_DAPM_OUTPUT("ROUT"),
+SND_SOC_DAPM_OUTPUT("RHPOUT"),
+SND_SOC_DAPM_ADC("ADC", "HiFi Capture", SSM2602_PWR, 2, 1),
+SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM, 0, 0, &ssm2602_input_mux_controls),
+SND_SOC_DAPM_PGA("Line Input", SSM2602_PWR, 0, 1, NULL, 0),
+SND_SOC_DAPM_MICBIAS("Mic Bias", SSM2602_PWR, 1, 1),
+SND_SOC_DAPM_INPUT("MICIN"),
+SND_SOC_DAPM_INPUT("RLINEIN"),
+SND_SOC_DAPM_INPUT("LLINEIN"),
+};
+
+static const struct snd_soc_dapm_route audio_conn[] = {
+ /* output mixer */
+ {"Output Mixer", "Line Bypass Switch", "Line Input"},
+ {"Output Mixer", "HiFi Playback Switch", "DAC"},
+ {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
+
+ /* outputs */
+ {"RHPOUT", NULL, "Output Mixer"},
+ {"ROUT", NULL, "Output Mixer"},
+ {"LHPOUT", NULL, "Output Mixer"},
+ {"LOUT", NULL, "Output Mixer"},
+
+ /* input mux */
+ {"Input Mux", "Line", "Line Input"},
+ {"Input Mux", "Mic", "Mic Bias"},
+ {"ADC", NULL, "Input Mux"},
+
+ /* inputs */
+ {"Line Input", NULL, "LLINEIN"},
+ {"Line Input", NULL, "RLINEIN"},
+ {"Mic Bias", NULL, "MICIN"},
+
+ /* terminator */
+ {NULL, NULL, NULL},
+};
+
+static int ssm2602_add_widgets(struct snd_soc_codec *codec)
+{
+ snd_soc_dapm_new_controls(codec, ssm2602_dapm_widgets,
+ ARRAY_SIZE(ssm2602_dapm_widgets));
+
+ snd_soc_dapm_add_routes(codec, audio_conn, ARRAY_SIZE(audio_conn));
+
+ snd_soc_dapm_new_widgets(codec);
+ return 0;
+}
+
+struct _coeff_div {
+ u32 mclk;
+ u32 rate;
+ u16 fs;
+ u8 sr:4;
+ u8 bosr:1;
+ u8 usb:1;
+};
+
+/* codec mclk clock divider coefficients */
+static const struct _coeff_div coeff_div[] = {
+ /* 48k */
+ {12288000, 48000, 256, 0x0, 0x0, 0x0},
+ {18432000, 48000, 384, 0x0, 0x1, 0x0},
+ {12000000, 48000, 250, 0x0, 0x0, 0x1},
+
+ /* 32k */
+ {12288000, 32000, 384, 0x6, 0x0, 0x0},
+ {18432000, 32000, 576, 0x6, 0x1, 0x0},
+ {12000000, 32000, 375, 0x6, 0x0, 0x1},
+
+ /* 8k */
+ {12288000, 8000, 1536, 0x3, 0x0, 0x0},
+ {18432000, 8000, 2304, 0x3, 0x1, 0x0},
+ {11289600, 8000, 1408, 0xb, 0x0, 0x0},
+ {16934400, 8000, 2112, 0xb, 0x1, 0x0},
+ {12000000, 8000, 1500, 0x3, 0x0, 0x1},
+
+ /* 96k */
+ {12288000, 96000, 128, 0x7, 0x0, 0x0},
+ {18432000, 96000, 192, 0x7, 0x1, 0x0},
+ {12000000, 96000, 125, 0x7, 0x0, 0x1},
+
+ /* 44.1k */
+ {11289600, 44100, 256, 0x8, 0x0, 0x0},
+ {16934400, 44100, 384, 0x8, 0x1, 0x0},
+ {12000000, 44100, 272, 0x8, 0x1, 0x1},
+
+ /* 88.2k */
+ {11289600, 88200, 128, 0xf, 0x0, 0x0},
+ {16934400, 88200, 192, 0xf, 0x1, 0x0},
+ {12000000, 88200, 136, 0xf, 0x1, 0x1},
+};
+
+static inline int get_coeff(int mclk, int rate)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(coeff_div); i++) {
+ if (coeff_div[i].rate == rate && coeff_div[i].mclk == mclk)
+ return i;
+ }
+ return 0;
+}
+
+static int ssm2602_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ u16 iface = ssm2602_read_reg_cache(codec, SSM2602_IFACE) & 0xfff3;
+ int i = get_coeff(ssm2602->sysclk, params_rate(params));
+ u16 srate = (coeff_div[i].sr << 2) |
+ (coeff_div[i].bosr << 1) | coeff_div[i].usb;
+
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ ssm2602_write(codec, SSM2602_SRATE, srate);
+
+ /* bit size */
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ break;
+ case SNDRV_PCM_FORMAT_S20_3LE:
+ iface |= 0x0004;
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ iface |= 0x0008;
+ break;
+ case SNDRV_PCM_FORMAT_S32_LE:
+ iface |= 0x000c;
+ break;
+ }
+ ssm2602_write(codec, SSM2602_IFACE, iface);
+ ssm2602_write(codec, SSM2602_ACTIVE, ACTIVATE_CODEC);
+ return 0;
+}
+
+static int ssm2602_startup(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ struct snd_pcm_runtime *master_runtime;
+
+ /* The DAI has shared clocks so if we already have a playback or
+ * capture going then constrain this substream to match it.
+ */
+ if (ssm2602->master_substream) {
+ master_runtime = ssm2602->master_substream->runtime;
+ snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_RATE,
+ master_runtime->rate,
+ master_runtime->rate);
+
+ snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+ master_runtime->sample_bits,
+ master_runtime->sample_bits);
+
+ ssm2602->slave_substream = substream;
+ } else
+ ssm2602->master_substream = substream;
+
+ return 0;
+}
+
+static int ssm2602_pcm_prepare(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ /* set active */
+ ssm2602_write(codec, SSM2602_ACTIVE, ACTIVATE_CODEC);
+
+ return 0;
+}
+
+static void ssm2602_shutdown(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ /* deactivate */
+ if (!codec->active) {
+ udelay(50);
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ }
+}
+
+static int ssm2602_mute(struct snd_soc_dai *dai, int mute)
+{
+ struct snd_soc_codec *codec = dai->codec;
+ u16 mute_reg = ssm2602_read_reg_cache(codec, SSM2602_APDIGI) & 0xfff7;
+ if (mute)
+ ssm2602_write(codec, SSM2602_APDIGI,
+ mute_reg | ENABLE_DAC_MUTE);
+ else
+ ssm2602_write(codec, SSM2602_APDIGI, mute_reg);
+ return 0;
+}
+
+static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+ int clk_id, unsigned int freq, int dir)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ struct ssm2602_priv *ssm2602 = codec->private_data;
+ switch (freq) {
+ case 11289600:
+ case 12000000:
+ case 12288000:
+ case 16934400:
+ case 18432000:
+ ssm2602->sysclk = freq;
+ return 0;
+ }
+ return -EINVAL;
+}
+
+static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
+ unsigned int fmt)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ u16 iface = 0;
+
+ /* set master/slave audio interface */
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBM_CFM:
+ iface |= 0x0040;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* interface format */
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+ case SND_SOC_DAIFMT_I2S:
+ iface |= 0x0002;
+ break;
+ case SND_SOC_DAIFMT_RIGHT_J:
+ break;
+ case SND_SOC_DAIFMT_LEFT_J:
+ iface |= 0x0001;
+ break;
+ case SND_SOC_DAIFMT_DSP_A:
+ iface |= 0x0003;
+ break;
+ case SND_SOC_DAIFMT_DSP_B:
+ iface |= 0x0013;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* clock inversion */
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_NF:
+ break;
+ case SND_SOC_DAIFMT_IB_IF:
+ iface |= 0x0090;
+ break;
+ case SND_SOC_DAIFMT_IB_NF:
+ iface |= 0x0080;
+ break;
+ case SND_SOC_DAIFMT_NB_IF:
+ iface |= 0x0010;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* set iface */
+ ssm2602_write(codec, SSM2602_IFACE, iface);
+ return 0;
+}
+
+static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
+ enum snd_soc_bias_level level)
+{
+ u16 reg = ssm2602_read_reg_cache(codec, SSM2602_PWR) & 0xff7f;
+
+ switch (level) {
+ case SND_SOC_BIAS_ON:
+ /* vref/mid, osc on, dac unmute */
+ ssm2602_write(codec, SSM2602_PWR, 0);
+ break;
+ case SND_SOC_BIAS_PREPARE:
+ break;
+ case SND_SOC_BIAS_STANDBY:
+ /* everything off except vref/vmid, */
+ ssm2602_write(codec, SSM2602_PWR, reg | CLK_OUT_PDN);
+ break;
+ case SND_SOC_BIAS_OFF:
+ /* everything off, dac mute, inactive */
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ ssm2602_write(codec, SSM2602_PWR, 0xffff);
+ break;
+
+ }
+ codec->bias_level = level;
+ return 0;
+}
+
+#define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
+ SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
+ SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
+ SNDRV_PCM_RATE_96000)
+
+struct snd_soc_dai ssm2602_dai = {
+ .name = "SSM2602",
+ .playback = {
+ .stream_name = "Playback",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = SSM2602_RATES,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,},
+ .capture = {
+ .stream_name = "Capture",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = SSM2602_RATES,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,},
+ .ops = {
+ .startup = ssm2602_startup,
+ .prepare = ssm2602_pcm_prepare,
+ .hw_params = ssm2602_hw_params,
+ .shutdown = ssm2602_shutdown,
+ },
+ .dai_ops = {
+ .digital_mute = ssm2602_mute,
+ .set_sysclk = ssm2602_set_dai_sysclk,
+ .set_fmt = ssm2602_set_dai_fmt,
+ }
+};
+EXPORT_SYMBOL_GPL(ssm2602_dai);
+
+static int ssm2602_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
+ return 0;
+}
+
+static int ssm2602_resume(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+ int i;
+ u8 data[2];
+ u16 *cache = codec->reg_cache;
+
+ /* Sync reg_cache with the hardware */
+ for (i = 0; i < ARRAY_SIZE(ssm2602_reg); i++) {
+ data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001);
+ data[1] = cache[i] & 0x00ff;
+ codec->hw_write(codec->control_data, data, 2);
+ }
+ ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ ssm2602_set_bias_level(codec, codec->suspend_bias_level);
+ return 0;
+}
+
+/*
+ * initialise the ssm2602 driver
+ * register the mixer and dsp interfaces with the kernel
+ */
+static int ssm2602_init(struct snd_soc_device *socdev)
+{
+ struct snd_soc_codec *codec = socdev->codec;
+ int reg, ret = 0;
+
+ codec->name = "SSM2602";
+ codec->owner = THIS_MODULE;
+ codec->read = ssm2602_read_reg_cache;
+ codec->write = ssm2602_write;
+ codec->set_bias_level = ssm2602_set_bias_level;
+ codec->dai = &ssm2602_dai;
+ codec->num_dai = 1;
+ codec->reg_cache_size = sizeof(ssm2602_reg);
+ codec->reg_cache = kmemdup(ssm2602_reg, sizeof(ssm2602_reg),
+ GFP_KERNEL);
+ if (codec->reg_cache == NULL)
+ return -ENOMEM;
+
+ ssm2602_reset(codec);
+
+ /* register pcms */
+ ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+ if (ret < 0) {
+ pr_err("ssm2602: failed to create pcms\n");
+ goto pcm_err;
+ }
+ /*power on device*/
+ ssm2602_write(codec, SSM2602_ACTIVE, 0);
+ /* set the update bits */
+ reg = ssm2602_read_reg_cache(codec, SSM2602_LINVOL);
+ ssm2602_write(codec, SSM2602_LINVOL, reg | LRIN_BOTH);
+ reg = ssm2602_read_reg_cache(codec, SSM2602_RINVOL);
+ ssm2602_write(codec, SSM2602_RINVOL, reg | RLIN_BOTH);
+ reg = ssm2602_read_reg_cache(codec, SSM2602_LOUT1V);
+ ssm2602_write(codec, SSM2602_LOUT1V, reg | LRHP_BOTH);
+ reg = ssm2602_read_reg_cache(codec, SSM2602_ROUT1V);
+ ssm2602_write(codec, SSM2602_ROUT1V, reg | RLHP_BOTH);
+ /*select Line in as default input*/
+ ssm2602_write(codec, SSM2602_APANA,
+ ENABLE_MIC_BOOST2 | SELECT_DAC | ENABLE_MIC_BOOST);
+ ssm2602_write(codec, SSM2602_PWR, 0);
+
+ ssm2602_add_controls(codec);
+ ssm2602_add_widgets(codec);
+ ret = snd_soc_register_card(socdev);
+ if (ret < 0) {
+ pr_err("ssm2602: failed to register card\n");
+ goto card_err;
+ }
+
+ return ret;
+
+card_err:
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+pcm_err:
+ kfree(codec->reg_cache);
+ return ret;
+}
+
+static struct snd_soc_device *ssm2602_socdev;
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+/*
+ * ssm2602 2 wire address is determined by GPIO5
+ * state during powerup.
+ * low = 0x1a
+ * high = 0x1b
+ */
+static int ssm2602_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
+{
+ struct snd_soc_device *socdev = ssm2602_socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ int ret;
+
+ i2c_set_clientdata(i2c, codec);
+ codec->control_data = i2c;
+
+ ret = ssm2602_init(socdev);
+ if (ret < 0)
+ pr_err("failed to initialise SSM2602\n");
+
+ return ret;
+}
+
+static int ssm2602_i2c_remove(struct i2c_client *client)
+{
+ struct snd_soc_codec *codec = i2c_get_clientdata(client);
+ kfree(codec->reg_cache);
+ return 0;
+}
+
+static const struct i2c_device_id ssm2602_i2c_id[] = {
+ { "ssm2602", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id);
+/* corgi i2c codec control layer */
+static struct i2c_driver ssm2602_i2c_driver = {
+ .driver = {
+ .name = "SSM2602 I2C Codec",
+ .owner = THIS_MODULE,
+ },
+ .probe = ssm2602_i2c_probe,
+ .remove = ssm2602_i2c_remove,
+ .id_table = ssm2602_i2c_id,
+};
+
+static int ssm2602_add_i2c_device(struct platform_device *pdev,
+ const struct ssm2602_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&ssm2602_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "ssm2602", I2C_NAME_SIZE);
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+ return 0;
+err_driver:
+ i2c_del_driver(&ssm2602_i2c_driver);
+ return -ENODEV;
+}
+
+#endif
+
+static int ssm2602_probe(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct ssm2602_setup_data *setup;
+ struct snd_soc_codec *codec;
+ struct ssm2602_priv *ssm2602;
+ int ret = 0;
+
+ pr_info("ssm2602 Audio Codec %s", SSM2602_VERSION);
+
+ setup = socdev->codec_data;
+ codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+ if (codec == NULL)
+ return -ENOMEM;
+
+ ssm2602 = kzalloc(sizeof(struct ssm2602_priv), GFP_KERNEL);
+ if (ssm2602 == NULL) {
+ kfree(codec);
+ return -ENOMEM;
+ }
+
+ codec->private_data = ssm2602;
+ socdev->codec = codec;
+ mutex_init(&codec->mutex);
+ INIT_LIST_HEAD(&codec->dapm_widgets);
+ INIT_LIST_HEAD(&codec->dapm_paths);
+
+ ssm2602_socdev = socdev;
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ if (setup->i2c_address) {
+ codec->hw_write = (hw_write_t)i2c_master_send;
+ ret = ssm2602_add_i2c_device(pdev, setup);
+ }
+#else
+ /* other interfaces */
+#endif
+ return ret;
+}
+
+/* remove everything here */
+static int ssm2602_remove(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ if (codec->control_data)
+ ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
+ i2c_del_driver(&ssm2602_i2c_driver);
+#endif
+ kfree(codec->private_data);
+ kfree(codec);
+
+ return 0;
+}
+
+struct snd_soc_codec_device soc_codec_dev_ssm2602 = {
+ .probe = ssm2602_probe,
+ .remove = ssm2602_remove,
+ .suspend = ssm2602_suspend,
+ .resume = ssm2602_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_ssm2602);
+
+MODULE_DESCRIPTION("ASoC ssm2602 driver");
+MODULE_AUTHOR("Cliff Cai");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/ssm2602.h b/sound/soc/codecs/ssm2602.h
new file mode 100644
index 0000000..ec5e604
--- /dev/null
+++ b/sound/soc/codecs/ssm2602.h
@@ -0,0 +1,131 @@
+/*
+ * File: sound/soc/codecs/ssm2602.h
+ * Author: Cliff Cai <Cliff.Cai(a)analog.com>
+ *
+ * Created: Tue June 06 2008
+ * Description: Driver for SSM2602 sound chip built in ADSP-BF52xC
+ *
+ * Modified:
+ * Copyright 2008 Analog Devices Inc.
+ *
+ * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SSM2602_H
+#define _SSM2602_H
+
+/* SSM2602 Codec Register definitions */
+
+#define SSM2602_LINVOL 0x00
+#define SSM2602_RINVOL 0x01
+#define SSM2602_LOUT1V 0x02
+#define SSM2602_ROUT1V 0x03
+#define SSM2602_APANA 0x04
+#define SSM2602_APDIGI 0x05
+#define SSM2602_PWR 0x06
+#define SSM2602_IFACE 0x07
+#define SSM2602_SRATE 0x08
+#define SSM2602_ACTIVE 0x09
+#define SSM2602_RESET 0x0f
+
+/*SSM2602 Codec Register Field definitions
+ *(Mask value to extract the corresponding Register field)
+ */
+
+/*Left ADC Volume Control (SSM2602_REG_LEFT_ADC_VOL)*/
+#define LIN_VOL 0x01F /* Left Channel PGA Volume control */
+#define LIN_ENABLE_MUTE 0x080 /* Left Channel Input Mute */
+#define LRIN_BOTH 0x100 /* Left Channel Line Input Volume update */
+
+/*Right ADC Volume Control (SSM2602_REG_RIGHT_ADC_VOL)*/
+#define RIN_VOL 0x01F /* Right Channel PGA Volume control */
+#define RIN_ENABLE_MUTE 0x080 /* Right Channel Input Mute */
+#define RLIN_BOTH 0x100 /* Right Channel Line Input Volume update */
+
+/*Left DAC Volume Control (SSM2602_REG_LEFT_DAC_VOL)*/
+#define LHP_VOL 0x07F /* Left Channel Headphone volume control */
+#define ENABLE_LZC 0x080 /* Left Channel Zero cross detect enable */
+#define LRHP_BOTH 0x100 /* Left Channel Headphone volume update */
+
+/*Right DAC Volume Control (SSM2602_REG_RIGHT_DAC_VOL)*/
+#define RHP_VOL 0x07F /* Right Channel Headphone volume control */
+#define ENABLE_RZC 0x080 /* Right Channel Zero cross detect enable */
+#define RLHP_BOTH 0x100 /* Right Channel Headphone volume update */
+
+/*Analogue Audio Path Control (SSM2602_REG_ANALOGUE_PATH)*/
+#define ENABLE_MIC_BOOST 0x001 /* Primary Microphone Amplifier gain booster control */
+#define ENABLE_MIC_MUTE 0x002 /* Microphone Mute Control */
+#define ADC_IN_SELECT 0x004 /* Microphone/Line IN select to ADC (1=MIC, 0=Line In) */
+#define ENABLE_BYPASS 0x008 /* Line input bypass to line output */
+#define SELECT_DAC 0x010 /* Select DAC (1=Select DAC, 0=Don't Select DAC) */
+#define ENABLE_SIDETONE 0x020 /* Enable/Disable Side Tone */
+#define SIDETONE_ATTN 0x0C0 /* Side Tone Attenuation */
+#define ENABLE_MIC_BOOST2 0x100 /* Secondary Microphone Amplifier gain booster control */
+
+/*Digital Audio Path Control (SSM2602_REG_DIGITAL_PATH)*/
+#define ENABLE_ADC_HPF 0x001 /* Enable/Disable ADC Highpass Filter */
+#define DE_EMPHASIS 0x006 /* De-Emphasis Control */
+#define ENABLE_DAC_MUTE 0x008 /* DAC Mute Control */
+#define STORE_OFFSET 0x010 /* Store/Clear DC offset when HPF is disabled */
+
+/*Power Down Control (SSM2602_REG_POWER)
+ *(1=Enable PowerDown, 0=Disable PowerDown)
+ */
+#define LINE_IN_PDN 0x001 /* Line Input Power Down */
+#define MIC_PDN 0x002 /* Microphone Input & Bias Power Down */
+#define ADC_PDN 0x004 /* ADC Power Down */
+#define DAC_PDN 0x008 /* DAC Power Down */
+#define OUT_PDN 0x010 /* Outputs Power Down */
+#define OSC_PDN 0x020 /* Oscillator Power Down */
+#define CLK_OUT_PDN 0x040 /* CLKOUT Power Down */
+#define POWER_OFF 0x080 /* POWEROFF Mode */
+
+/*Digital Audio Interface Format (SSM2602_REG_DIGITAL_IFACE)*/
+#define IFACE_FORMAT 0x003 /* Digital Audio input format control */
+#define AUDIO_DATA_LEN 0x00C /* Audio Data word length control */
+#define DAC_LR_POLARITY 0x010 /* Polarity Control for clocks in RJ,LJ and I2S modes */
+#define DAC_LR_SWAP 0x020 /* Swap DAC data control */
+#define ENABLE_MASTER 0x040 /* Enable/Disable Master Mode */
+#define BCLK_INVERT 0x080 /* Bit Clock Inversion control */
+
+/*Sampling Control (SSM2602_REG_SAMPLING_CTRL)*/
+#define ENABLE_USB_MODE 0x001 /* Enable/Disable USB Mode */
+#define BOS_RATE 0x002 /* Base Over-Sampling rate */
+#define SAMPLE_RATE 0x03C /* Clock setting condition (Sampling rate control) */
+#define CORECLK_DIV2 0x040 /* Core Clock divider select */
+#define CLKOUT_DIV2 0x080 /* Clock Out divider select */
+
+/*Active Control (SSM2602_REG_ACTIVE_CTRL)*/
+#define ACTIVATE_CODEC 0x001 /* Activate Codec Digital Audio Interface */
+
+/*********************************************************************/
+
+#define SSM2602_CACHEREGNUM 10
+
+#define SSM2602_SYSCLK 0
+#define SSM2602_DAI 0
+
+struct ssm2602_setup_data {
+ int i2c_bus;
+ unsigned short i2c_address;
+};
+
+extern struct snd_soc_dai ssm2602_dai;
+extern struct snd_soc_codec_device soc_codec_dev_ssm2602;
+
+#endif
--
1.5.6
2
1

[alsa-devel] [PATCH 1/1] ASoC codec: fix compiling error in ad1980 driver after ASoC API changed
by Bryan Wu 04 Sep '08
by Bryan Wu 04 Sep '08
04 Sep '08
From: Cliff Cai <cliff.cai(a)analog.com>
Signed-off-by: Cliff Cai <cliff.cai(a)analog.com>
Signed-off-by: Bryan Wu <cooloney(a)kernel.org>
---
sound/soc/codecs/ad1980.c | 2 +-
sound/soc/codecs/ad1980.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index bfbab3d..4e09c1f 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -141,7 +141,7 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
return 0;
}
-struct snd_soc_codec_dai ad1980_dai = {
+struct snd_soc_dai ad1980_dai = {
.name = "AC97",
.playback = {
.stream_name = "Playback",
diff --git a/sound/soc/codecs/ad1980.h b/sound/soc/codecs/ad1980.h
index 5d4710d..db6c850 100644
--- a/sound/soc/codecs/ad1980.h
+++ b/sound/soc/codecs/ad1980.h
@@ -17,7 +17,7 @@
#define PR5 0x2000
#define PR6 0x4000
-extern struct snd_soc_codec_dai ad1980_dai;
+extern struct snd_soc_dai ad1980_dai;
extern struct snd_soc_codec_device soc_codec_dev_ad1980;
#endif
--
1.5.6
2
1
Hi,
I have acquired an unknown clone of the GF1 classic card.
I load the snd-gusclassic driver with
modprobe snd-gusclassic port=0x220
and the /proc/asound/cards says
0 [G37 ]: GUS - Gravis UltraSound Classic (3.7)
Gravis UltraSound Classic (3.7) at 0x220, irq 5, dma 5&5
The alsamixer works. I set maximum volume for the PCM and master controls.
The aplay -l says:
**** List of PLAYBACK Hardware Devices ****
card 0: G37 [Gravis UltraSound Classic (3.7)], device 0: GF1 [GF1 (synth)]
Subdevices: 1/1
Subdevice #0: subdevice #0
but the aplay -L says nothing.
the aplay with the .wav file does not play.
aplay /usr/share/sounds/alsa/Front_Center.wav
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:545: audio open error: No such file or directory
I have tried to follow the alsa wiki but it has not helped (btw, there is no
driver the "gusclassic" listed, only the "gus"). Could you point me to
any piece of information how to set up the card?
The card works with DOS game with Miles (?) drivers.
Regards,
Krzysztof
----------------------------------------------------------------------
Teraz taniej na zagraniczne komorki!
Sprawdz >> http://link.interia.pl/f1ef7
2
1
Hi,
I found a strange issue that ALSA consume pcm data faster than
normal. Does any one had come across it?
When I sychronize video frame against audio, the video thread will
check how much pcm data has been written to ALSA API but has not been
fetched by DMA. This query causes ALSA consume pcm data faster than
normal, noise appears too. A stream that is 131 seconds will playback
just 112 seconds. It only appears when audio is stereo and sampling
rate is directly supported by hardware.
This bug can be reproduced with aplay. To reproduce it with aplay, you
just need to add a thread and query the ALSA latency 20~30times every
second.
My system: XSCALE PXA300/zylonite, Linux2.6.25, alsa-lib-1.0.13(I
tried alsa-lib-1.0.17, bugs too), codec: wm9713. Linux2.6.14 has this
issue too, but I did not find it in 2.6.21 and 2.6.24.
Does anyone has idea about it? Thanks!
Jun Nie
2
2

03 Sep '08
On Wed, Aug 27, 2008 at 05:39:25PM +0800, Bryan Wu wrote:
> From: Cliff Cai <cliff.cai(a)analog.com>
>
> Signed-off-by: Cliff Cai <cliff.cai(a)analog.com>
> Signed-off-by: Bryan Wu <cooloney(a)kernel.org>
As with the other patches in the series this looks good but it has been
affected by changes in the ASoC APIs and needs to be updated to reflect
current ALSA. The topic/asoc branch of Takashi's tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
is what's currently queued for 2.6.28.
Other than that, checkpatch-style things and a few more minor issues the
main things are the register write interface in /proc and the hardware
parameters for the I2S driver. I've not flagged all the checkpatch
stuff here.
Can I also suggest splitting this up into a series of patches for easier
review - for example, adding the SPORT support first, followed by the
AC97 and I2S drivers and then the machine drivers? I'd certainly have
appreciated having seen the SPORT support (which appears at the end of
the patch) before looking at the AC97 and I2S stuff.
> + depends on BLACKFIN && SND_SOC
> + help
> + Say Y or M if you want to add support for codecs attached to
> + the Blackfin SPORT (synchronous serial ports) interface in slot 16
> + mode (pseudo AC97 interface).
> + You will also need to select the audio interfaces to support below.
> +
> + Note:
> + AC'97 codecs which do not implment the slot-16 mode will not function
> + properly with this driver. This driver is known to work with the
> + Analog Devices line of AC97 codecs.
Your spelling of AC97 isn't consistent here. The kernel seems to prefer
AC97, as do you.
> + * File: sound/soc/blackfin/bf5xx-ac97-pcm.c
> + * Author: Cliff Cai <Cliff.Cai(a)analog.com>
> + *
> + * Created: Tue June 06 2008
> + * Description: Driver for SSM2602 sound chip built in ADSP-BF52xC
Hopefully the driver is more generic than that?
> +static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params)
> +{
> + size_t size = bf5xx_pcm_hardware.buffer_bytes_max * sizeof(struct ac97_frame)/4;
Checkpatch picks up on this and quite a few other places being over 80
columns.
> +static int bf5xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
> +{
> + struct snd_pcm_runtime *runtime = substream->runtime;
> + struct sport_device *sport = runtime->private_data;
> + int ret = 0;
> +
> + pr_debug("%s %s\n", substream->stream?"Capture":"Playback", \
> + cmd?" start":" stop");
This looks wrong - there's rather more options for cmd, for example, and
you're making assumptions about the value of SNDRV_PMC_STREAM_PLAYBACK.
> +/*Need to allocate local buffer when enable MMAP for SPORT working in TMD mode(include AC97).*/
Indentation?
> diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.h b/sound/soc/blackfin/bf5xx-ac97-pcm.h
> new file mode 100644
> index 0000000..5831300
> --- /dev/null
> +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.h
> +struct bf5xx_gpio {
> + u32 sys;
> + u32 rx;
> + u32 tx;
> + u32 clk;
> + u32 frm;
> +};
That should be a space before rx, not a tab.
> diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c
> new file mode 100644
> index 0000000..685a494
> --- /dev/null
> +++ b/sound/soc/blackfin/bf5xx-ac97.c
> +#include <sound/driver.h>
This header is obsolte and should be removed.
> +static unsigned short bf5xx_ac97_read(struct snd_ac97 *ac97,
> + unsigned short reg)
> +{
> + struct ac97_frame out_frame[2], in_frame[2];
> +
> + pr_debug("%s enter 0x%x\n", __func__, reg);
> +
> + /* When dma descriptor is enabled, the register should not be read */
> + if (sport_handle->tx_run || sport_handle->rx_run) {
> + printk(KERN_ERR "Could you send a mail to author "
> + "to report this?\n");
> + return -EFAULT;
> + }
Might be nice to say what to report and who the author is - by itself
the printout is going to be rather obscure :)
> +static int bf5xx_ac97_resume(struct platform_device *pdev,
> + struct snd_soc_cpu_dai *dai)
struct snd_soc_cpu_dai and struct snd_soc_codec_dai have been merged
into a single struct snd_soc_dai in current versions.
> + ret = sport_config_rx(sport_handle, IRFS, 0xF, 0, (16*16-1));
> +
> + if (ret) {
> + printk(KERN_ERR "SPORT is busy!\n");
> + return -EBUSY;
> + }
> + ret = sport_config_tx(sport_handle, ITFS, 0xF, 0, (16*16-1));
> +
> + if (ret) {
> + printk(KERN_ERR "SPORT is busy!\n");
> + return -EBUSY;
> + }
Shouldn't this undo the previous sport_confix_rx() on error?
Also, the use of blank lines is a bit funny here - I'd expect the blank
before rather than after the function calls.
> +static struct proc_dir_entry *ac_entry;
> +
> +/* For test purpose, read a register from codec */
> +static int proc_write(struct file *file, const char __user *buffer,
> + unsigned long count, void *data)
> +{
I think it's probably better to drop this from mainline - it doesn't
seem like something that we should be supporting long term and obviously
it could do damage if used.
If you do want to put it in mainline then it ought to go in debugfs
rather than proc.
> + /*SPORT works in TDM mode to simulate AC97 transfers*/
> + ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
> +
> + if (ret) {
> + printk(KERN_ERR "SPORT is busy!\n");
> + return -EBUSY;
> + }
> + ret = sport_config_rx(sport_handle, IRFS, 0xF, 0, (16*16-1));
> +
> + if (ret) {
> + printk(KERN_ERR "SPORT is busy!\n");
> + return -EBUSY;
> + }
Again, odd blank lines and presumably there needs to be something to
undo things on error?
> + * File: sound/soc/blackfin/bf5xx-ad1980.c
> + * Author: Cliff Cai <Cliff.Cai(a)analog.com>
> + *
> + * Created: Tue June 06 2008
o> + * Description: Driver for SSM2602 sound chip built in ADSP-BF52xC
This comment is wrong - it's for the AD1980.
> +static int bf5xx_board_startup(struct snd_pcm_substream *substream)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai;
> +
> + pr_debug("%s enter\n", __func__);
> + cpu_dai->private_data = sport_handle;
> + return 0;
> +}
> --- /dev/null
> +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
> @@ -0,0 +1,293 @@
> +/*
> + * File: sound/soc/blackfin/bf5xx-i2s-pcm.c
> + * Author: Cliff Cai <Cliff.Cai(a)analog.com>
> + *
> + * Created: Tue June 06 2008
> + * Description: Driver for SSM2602 sound chip built in ADSP-BF52xC
This comment is wrong too :)
> +#include <sound/driver.h>
Obsolete.
> + pr_debug("%s %s\n", substream->stream?"Capture":"Playback", \
> + cmd?" start":" stop");
Same comment as for AC97. Shouldn't more of this code be shared with
the AC97 DMA driver?
> +static int bf5xx_pcm_close(struct snd_pcm_substream *substream)
> +{
> + pr_debug("%s enter\n", __func__);
> + /*Nothing need to be cleared here*/
> +
> + return 0;
> +}
You should just be able to remove this if it's empty.
> +#include <sound/driver.h>
Obsolete.
> + /* TX and RX are not independent,they are enabled at the same time,
> + * even if only one side is running.So,we need to configure both of them in advance.
> + * CPU DAI format:I2S,word length:32 bit,slave mode.
> + */
Are the RX and TX clocks independant? If not you should probably tell
user space about the constraint in startup(), forcing the second stream
that's opened to use the same configuration as the first - take a look
at the fsl_ssi driver or the wm8903 driver for examples of how to do
this.
I'm also not seeing the code that configures the sample rate anywhere -
but then it looks like the driver only support slave mode ATM? That's
what the machine driver is using. There should still be a set_fmt() to
document what's supported if nothing else.
> +void decfrag(struct sport_device *sport, int *frag, int tx)
> +{
> + --(*frag);
> + if (tx == 1 && *frag == 0)
> + *frag = sport->tx_frags;
> +
> + if (tx == 0 && *frag == 0)
> + *frag = sport->rx_frags;
> +}
> +EXPORT_SYMBOL(decfrag);
This symbol should be namespaced.
> diff --git a/sound/soc/blackfin/bf5xx-ssm2602.c b/sound/soc/blackfin/bf5xx-ssm2602.c
> new file mode 100644
> index 0000000..41e161f
> --- /dev/null
> +++ b/sound/soc/blackfin/bf5xx-ssm2602.c
This driver needs to follow the ssm2602 codec driver so either the
series needs reordering or at least this bit needs to be split out into
another patch.
> +#include <sound/driver.h>
Obsolete.
> + * WARNING - TODO
> + *
> + * This code assumes there is a variable clocksource for the SSM2602.
> + * i.e. it supplies MCLK depending on rate.
> + *
> + * If you are using a crystal source then modify the below case
> + * statement with a static frequency.
> + *
> + * If you are using the SPORT to generate clocking then this is
> + * where to do it.
> + */
> +
> + switch (params_rate(params)) {
> + case 8000:
> + case 16000:
> + case 48000:
> + case 96000:
> + case 11025:
> + case 22050:
> + case 44100:
> + clk = 12000000;
> + break;
> + }
I'm not sure that comment quite agrees with the code here...
2
2

[alsa-devel] [PATCH 1/1] ALSA: add dummy function to support shared mmap in nommu Blackfin arch (v3)
by Bryan Wu 03 Sep '08
by Bryan Wu 03 Sep '08
03 Sep '08
From: Cliff Cai <cliff.cai(a)analog.com>
v2-v3:
- when it is mmu arch, we define the dummy function to NULL
v1-v2:
- only adding this dummy function in nommu arch
Cc: Mike Frysinger <vapier.adi(a)gmail.com>
Signed-off-by: Cliff Cai <cliff.cai(a)analog.com>
Signed-off-by: Bryan Wu <cooloney(a)kernel.org>
---
sound/core/pcm_native.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index c49b9d9..e2068a4 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3391,6 +3391,16 @@ out:
}
#endif /* CONFIG_SND_SUPPORT_OLD_API */
+#ifndef CONFIG_MMU
+unsigned long dummy_get_unmapped_area(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+ return 0;
+}
+#else
+# define dummy_get_unmapped_area NULL
+#endif
+
/*
* Register section
*/
@@ -3407,6 +3417,7 @@ const struct file_operations snd_pcm_f_ops[2] = {
.compat_ioctl = snd_pcm_ioctl_compat,
.mmap = snd_pcm_mmap,
.fasync = snd_pcm_fasync,
+ .get_unmapped_area = dummy_get_unmapped_area,
},
{
.owner = THIS_MODULE,
@@ -3419,5 +3430,6 @@ const struct file_operations snd_pcm_f_ops[2] = {
.compat_ioctl = snd_pcm_ioctl_compat,
.mmap = snd_pcm_mmap,
.fasync = snd_pcm_fasync,
+ .get_unmapped_area = dummy_get_unmapped_area,
}
};
--
1.5.6
2
3

[alsa-devel] [PATCH 1/1] ALSA: add dummy function to support shared mmap in nommu Blackfin arch (v2)
by Bryan Wu 03 Sep '08
by Bryan Wu 03 Sep '08
03 Sep '08
From: Cliff Cai <cliff.cai(a)analog.com>
v1-v2:
- only adding this dummy function in nommu arch
Signed-off-by: Cliff Cai <cliff.cai(a)analog.com>
Signed-off-by: Bryan Wu <cooloney(a)kernel.org>
---
sound/core/pcm_native.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index c49b9d9..1e88cde 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3391,6 +3391,14 @@ out:
}
#endif /* CONFIG_SND_SUPPORT_OLD_API */
+#ifndef CONFIG_MMU
+unsigned long dummy_get_unmapped_area(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+ return 0;
+}
+#endif
+
/*
* Register section
*/
@@ -3407,6 +3415,9 @@ const struct file_operations snd_pcm_f_ops[2] = {
.compat_ioctl = snd_pcm_ioctl_compat,
.mmap = snd_pcm_mmap,
.fasync = snd_pcm_fasync,
+#ifndef CONFIG_MMU
+ .get_unmapped_area = dummy_get_unmapped_area,
+#endif
},
{
.owner = THIS_MODULE,
@@ -3419,5 +3430,8 @@ const struct file_operations snd_pcm_f_ops[2] = {
.compat_ioctl = snd_pcm_ioctl_compat,
.mmap = snd_pcm_mmap,
.fasync = snd_pcm_fasync,
+#ifndef CONFIG_MMU
+ .get_unmapped_area = dummy_get_unmapped_area,
+#endif
}
};
--
1.5.6
2
2

02 Sep '08
Convert the wm8510 codec driver to the new (standard) device
driver binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Geoffrey Wossum <gwossum(a)acm.org>
Acked-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
As noticed by Mark, my 1st patch didn't apply properly. Here's a fixed
version which should apply fine. Sorry for the noise.
Warning: this assumes that the playpaq has its codec chip on I2C bus
0, which may or may not be the case. Someone with this machine please
test and report.
sound/soc/at32/playpaq_wm8510.c | 1
sound/soc/codecs/wm8510.c | 110 ++++++++++++++++++---------------------
sound/soc/codecs/wm8510.h | 1
3 files changed, 55 insertions(+), 57 deletions(-)
--- linux-2.6.27-rc5.orig/sound/soc/at32/playpaq_wm8510.c 2008-09-02 16:42:48.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/at32/playpaq_wm8510.c 2008-09-02 16:43:28.000000000 +0200
@@ -377,6 +377,7 @@ static struct snd_soc_machine snd_soc_ma
static struct wm8510_setup_data playpaq_wm8510_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1a,
};
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8510.c 2008-09-02 16:42:48.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8510.c 2008-09-02 16:43:28.000000000 +0200
@@ -665,88 +665,86 @@ static struct snd_soc_device *wm8510_soc
/*
* WM8510 2 wire address is 0x1a
*/
-#define I2C_DRIVERID_WM8510 0xfefe /* liam - need a proper id */
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8510_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
- around */
-
-static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8510_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8510_socdev;
- struct wm8510_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = wm8510_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8510\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8510_i2c_detach(struct i2c_client *client)
+static int wm8510_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8510_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8510_codec_probe);
-}
+static const struct i2c_device_id wm8510_i2c_id[] = {
+ { "wm8510", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8510_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8510_i2c_driver = {
.driver = {
.name = "WM8510 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_WM8510,
- .attach_adapter = wm8510_i2c_attach,
- .detach_client = wm8510_i2c_detach,
- .command = NULL,
+ .probe = wm8510_i2c_probe,
+ .remove = wm8510_i2c_remove,
+ .id_table = wm8510_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8510",
- .driver = &wm8510_i2c_driver,
-};
+static int wm8510_add_i2c_device(struct platform_device *pdev,
+ const struct wm8510_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8510_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8510", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8510_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8510_probe(struct platform_device *pdev)
@@ -771,11 +769,8 @@ static int wm8510_probe(struct platform_
wm8510_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8510_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8510_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -798,6 +793,7 @@ static int wm8510_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8510_i2c_driver);
#endif
kfree(codec);
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8510.h 2008-09-02 16:42:48.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8510.h 2008-09-02 16:43:28.000000000 +0200
@@ -94,6 +94,7 @@
#define WM8510_MCLKDIV_12 (7 << 5)
struct wm8510_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--
Jean Delvare
2
2

02 Sep '08
This patch series adds support for the Gumstix Overo board. Since it includes an ASoC driver I am copying both linux-omap and alsa-devel
The first patch adds the basic board files, the second adds an ASoC driver for the TWL4030 codec, the third an ASoC machine driver for the Overo, and the final patch is the Overo defconfig
9
20

02 Sep '08
Convert the wm8510 codec driver to the new (standard) device
driver binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Geoffrey Wossum <gwossum(a)acm.org>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
Warning: this assumes that the playpaq has its codec chip on I2C bus
0, which may or may not be the case. Someone with this machine please
test and report.
sound/soc/at32/playpaq_wm8510.c | 1
sound/soc/codecs/wm8510.c | 108 +++++++++++++++++++--------------------
sound/soc/codecs/wm8510.h | 1
3 files changed, 55 insertions(+), 55 deletions(-)
--- linux-2.6.27-rc5.orig/sound/soc/at32/playpaq_wm8510.c 2008-09-01 09:59:13.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/at32/playpaq_wm8510.c 2008-09-01 09:59:21.000000000 +0200
@@ -377,6 +377,7 @@ static struct snd_soc_machine snd_soc_ma
static struct wm8510_setup_data playpaq_wm8510_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1a,
};
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8510.c 2008-09-01 09:59:13.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8510.c 2008-09-01 09:59:21.000000000 +0200
@@ -665,85 +665,85 @@ static struct snd_soc_device *wm8510_soc
/*
* WM8510 2 wire address is 0x1a
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8510_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
- around */
-
-static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8510_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8510_socdev;
- struct wm8510_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = wm8510_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8510\n");
- goto err;
- }
- return ret;
-
-err:
- kfree(i2c);
return ret;
}
-static int wm8510_i2c_detach(struct i2c_client *client)
+static int wm8510_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8510_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8510_codec_probe);
-}
+static const struct i2c_device_id wm8510_i2c_id[] = {
+ { "wm8510", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8510_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8510_i2c_driver = {
.driver = {
.name = "WM8510 I2C Codec",
.owner = THIS_MODULE,
},
- .attach_adapter = wm8510_i2c_attach,
- .detach_client = wm8510_i2c_detach,
- .command = NULL,
+ .probe = wm8510_i2c_probe,
+ .remove = wm8510_i2c_remove,
+ .id_table = wm8510_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8510",
- .driver = &wm8510_i2c_driver,
-};
+static int wm8510_add_i2c_device(struct platform_device *pdev,
+ const struct wm8510_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8510_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8510", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8510_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8510_probe(struct platform_device *pdev)
@@ -768,11 +768,8 @@ static int wm8510_probe(struct platform_
wm8510_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8510_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8510_add_i2c_device(pdev, setup);;
}
#else
/* Add other interfaces here */
@@ -795,6 +792,7 @@ static int wm8510_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8510_i2c_driver);
#endif
kfree(codec);
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8510.h 2008-09-01 09:59:13.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8510.h 2008-09-01 09:59:21.000000000 +0200
@@ -94,6 +94,7 @@
#define WM8510_MCLKDIV_12 (7 << 5)
struct wm8510_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--
Jean Delvare
3
4
Hi folks,
It's very happy to release this ASOC Blackfin ports. Please review our drivers
and feel free to ask us update it.
In this patchset, we post ASOC Blackfin supports, SSM2602 audio codec driver
and other 2 ALSA/ASOC patches.
Thanks a lot
-Bryan
8
21
Hi there!
Please be patient with me, I am quite inexperienced with alsa programming, so
this might be a dumb question:
We have a WM8750 working in our PDA, the codec is working so far but I want to
remove some of the control since they aren't needed.
Instead of copying the wm8750.c file and adjusting it, I want to write another
module which basically get rid of those controls, something like:
[...]
static const char* unused_controls[] = {"AAAA", "BBBB,"CCCC"};
struct snd_kcontrol *ctl;
list_for_each_entry(ctl, &card->controls, list)
for(i=0; i < ARRAY_SIZE(unused_controls); i++)
if (!strcmp(unused_controls[i],ctl->id.name)) {
down_write(&card->controls_rwsem);
snd_ctl_remove(card,ctl);
up_write(&card->controls_rwsem);
break;
}
unfortunatly this doesn't work (module segfaults...."of course" you will say
*g*)
My question: is it possible at all and I am just not deep nuff in understanding
the sound system or do I have to adjust the original code?
Thx
Harry
4
14

01 Sep '08
Convert the wm8753 codec driver to the new (standard) i2c device
driver binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Ville Syrjala <syrjala(a)sci.fi>
Cc: Frank Mandarino <fmandarino(a)endrelia.com>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
Warning: this assumes that the neo1973 has its codec chip on I2C bus
0, which may or may not be the case. Someone with this machine please
test and report.
include/linux/i2c-id.h | 1
sound/soc/codecs/wm8753.c | 106 ++++++++++++++++++------------------
sound/soc/codecs/wm8753.h | 1
sound/soc/s3c24xx/neo1973_wm8753.c | 1
4 files changed, 55 insertions(+), 54 deletions(-)
--- linux-2.6.27-rc5.orig/include/linux/i2c-id.h 2008-09-01 11:06:04.000000000 +0200
+++ linux-2.6.27-rc5/include/linux/i2c-id.h 2008-09-01 12:46:57.000000000 +0200
@@ -64,7 +64,6 @@
#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */
#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
-#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
#define I2C_DRIVERID_CS4270 94 /* Cirrus Logic 4270 audio codec */
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8753.c 2008-08-29 09:32:25.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8753.c 2008-09-01 12:49:46.000000000 +0200
@@ -1637,84 +1637,86 @@ static struct snd_soc_device *wm8753_soc
* low = 0x1a
* high = 0x1b
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8753_i2c_driver;
-static struct i2c_client client_template;
-
-static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8753_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8753_socdev;
- struct wm8753_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (!i2c)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = wm8753_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8753\n");
- goto err;
- }
-
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8753_i2c_detach(struct i2c_client *client)
+static int wm8753_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8753_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8753_codec_probe);
-}
+static const struct i2c_device_id wm8753_i2c_id[] = {
+ { "wm8753", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8753_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8753_i2c_driver = {
.driver = {
.name = "WM8753 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_WM8753,
- .attach_adapter = wm8753_i2c_attach,
- .detach_client = wm8753_i2c_detach,
- .command = NULL,
+ .probe = wm8753_i2c_probe,
+ .remove = wm8753_i2c_remove,
+ .id_table = wm8753_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8753",
- .driver = &wm8753_i2c_driver,
-};
+static int wm8753_add_i2c_device(struct platform_device *pdev,
+ const struct wm8753_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8753_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8753", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8753_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8753_probe(struct platform_device *pdev)
@@ -1748,11 +1750,8 @@ static int wm8753_probe(struct platform_
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8753_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8753_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -1796,6 +1795,7 @@ static int wm8753_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8753_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8753.h 2008-08-05 18:18:18.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8753.h 2008-09-01 12:44:52.000000000 +0200
@@ -79,6 +79,7 @@
#define WM8753_ADCTL2 0x3f
struct wm8753_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--- linux-2.6.27-rc5.orig/sound/soc/s3c24xx/neo1973_wm8753.c 2008-08-23 22:18:36.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/s3c24xx/neo1973_wm8753.c 2008-09-01 12:45:10.000000000 +0200
@@ -586,6 +586,7 @@ static struct snd_soc_machine neo1973 =
};
static struct wm8753_setup_data neo1973_wm8753_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1a,
};
--
Jean Delvare
2
1

[alsa-devel] [PATCH 3/3] ASoC: Convert neo1973/lm4857 to a new-style i2c driver
by Jean Delvare 01 Sep '08
by Jean Delvare 01 Sep '08
01 Sep '08
Convert the lm4857 driver in neo1973_wm8753 to the new (standard)
i2c device driver binding model. I assumed that the LM4857 was always
on the same I2C bus as the WM8753 codec.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Tim Niemeyer <reddog(a)mastersword.de>
Cc: Graeme Gregory <graeme(a)openmoko.org>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
I couldn't even test-build that one. Tim, Graeme, can any of you
please review and test this patch? Thanks.
include/linux/i2c-id.h | 1
sound/soc/s3c24xx/neo1973_wm8753.c | 110 ++++++++++++++++++------------------
2 files changed, 58 insertions(+), 53 deletions(-)
--- linux-2.6.27-rc5.orig/include/linux/i2c-id.h 2008-09-01 14:31:28.000000000 +0200
+++ linux-2.6.27-rc5/include/linux/i2c-id.h 2008-09-01 14:46:19.000000000 +0200
@@ -64,7 +64,6 @@
#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */
#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
-#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
#define I2C_DRIVERID_CS4270 94 /* Cirrus Logic 4270 audio codec */
#define I2C_DRIVERID_M52790 95 /* Mitsubishi M52790SP/FP AV switch */
--- linux-2.6.27-rc5.orig/sound/soc/s3c24xx/neo1973_wm8753.c 2008-09-01 14:31:30.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/s3c24xx/neo1973_wm8753.c 2008-09-01 15:02:39.000000000 +0200
@@ -597,54 +597,20 @@ static struct snd_soc_device neo1973_snd
.codec_data = &neo1973_wm8753_setup,
};
-static struct i2c_client client_template;
-
-static const unsigned short normal_i2c[] = { 0x7C, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static int lm4857_amp_probe(struct i2c_adapter *adap, int addr, int kind)
+static int lm4857_i2c_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
{
- int ret;
-
DBG("Entered %s\n", __func__);
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- printk(KERN_ERR "LM4857 failed to attach at addr %x\n", addr);
- goto exit_err;
- }
-
lm4857_write_regs();
- return ret;
-
-exit_err:
- kfree(i2c);
- return ret;
-}
-
-static int lm4857_i2c_detach(struct i2c_client *client)
-{
- DBG("Entered %s\n", __func__);
-
- i2c_detach_client(client);
- kfree(client);
return 0;
}
-static int lm4857_i2c_attach(struct i2c_adapter *adap)
+static int lm4857_i2c_remove(struct i2c_client *client)
{
DBG("Entered %s\n", __func__);
- return i2c_probe(adap, &addr_data, lm4857_amp_probe);
+ return 0;
}
static u8 lm4857_state;
@@ -682,27 +648,67 @@ static void lm4857_shutdown(struct i2c_c
lm4857_write_regs();
}
-/* corgi i2c codec control layer */
+static const struct i2c_device_id lm4857_i2c_id[] = {
+ { "neo1973_lm4857", 0 }
+ { }
+};
+
static struct i2c_driver lm4857_i2c_driver = {
.driver = {
.name = "LM4857 I2C Amp",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_LM4857,
.suspend = lm4857_suspend,
.resume = lm4857_resume,
.shutdown = lm4857_shutdown,
- .attach_adapter = lm4857_i2c_attach,
- .detach_client = lm4857_i2c_detach,
- .command = NULL,
-};
-
-static struct i2c_client client_template = {
- .name = "LM4857",
- .driver = &lm4857_i2c_driver,
+ .probe = lm4857_i2c_probe,
+ .remove = lm4857_i2c_remove,
+ .id_table = lm4857_i2c_id,
};
static struct platform_device *neo1973_snd_device;
+static struct i2c_client *lm4857_client;
+
+static int __init neo1973_add_lm4857_device(struct platform_device *pdev,
+ int i2c_bus,
+ unsigned short i2c_address)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&lm4857_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add lm4857 driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = i2c_address;
+ strlcpy(info.type, "neo1973_lm4857", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n", i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add lm4857 device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ lm4857_client = client;
+ return 0;
+
+err_driver:
+ i2c_del_driver(&lm4857_i2c_driver);
+ return -ENODEV;
+}
static int __init neo1973_init(void)
{
@@ -723,11 +729,10 @@ static int __init neo1973_init(void)
return ret;
}
- ret = i2c_add_driver(&lm4857_i2c_driver);
- if (ret != 0) {
- printk(KERN_ERR "can't add i2c driver");
+ ret = neo1973_add_lm4857_device(neo1973_snd_device,
+ neo1973_wm8753_setup, 0x7C);
+ if (ret != 0)
platform_device_unregister(neo1973_snd_device);
- }
return ret;
}
@@ -736,6 +741,7 @@ static void __exit neo1973_exit(void)
{
DBG("Entered %s\n", __func__);
+ i2c_unregister_device(lm4857_client);
i2c_del_driver(&lm4857_i2c_driver);
platform_device_unregister(neo1973_snd_device);
}
--
Jean Delvare
1
0

01 Sep '08
The error handling in neo1973_init is incorrect:
* If platform_device_add fails, we go on with the rest of the
initialization instead of bailing out. Things will break when the
module is removed (platform_device_unregister called on a device
that wasn't registered.)
* If i2c_add_driver fails, we return an error so the module will not
load, but we don't unregister neo1973_snd_device, so we are leaking
resources.
Add the missing error handling.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Tim Niemeyer <reddog(a)mastersword.de>
Cc: Graeme Gregory <graeme(a)openmoko.org>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
I couldn't even test-build that one. Tim, Graeme, can any of you
please review and test this patch? Thanks.
sound/soc/s3c24xx/neo1973_wm8753.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- linux-2.6.27-rc5.orig/sound/soc/s3c24xx/neo1973_wm8753.c 2008-09-01 15:13:17.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/s3c24xx/neo1973_wm8753.c 2008-09-01 15:22:42.000000000 +0200
@@ -717,12 +717,16 @@ static int __init neo1973_init(void)
neo1973_snd_devdata.dev = &neo1973_snd_device->dev;
ret = platform_device_add(neo1973_snd_device);
- if (ret)
+ if (ret) {
platform_device_put(neo1973_snd_device);
+ return ret;
+ }
ret = i2c_add_driver(&lm4857_i2c_driver);
- if (ret != 0)
+ if (ret != 0) {
printk(KERN_ERR "can't add i2c driver");
+ platform_device_unregister(neo1973_snd_device);
+ }
return ret;
}
--
Jean Delvare
1
0

[alsa-devel] [PATCH] ASoC: Convert wm8731 to a new-style i2c driver (testers wanted)
by Jean Delvare 01 Sep '08
by Jean Delvare 01 Sep '08
01 Sep '08
Convert the wm8731 codec driver to the new (standard) device driver
binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
Warning: this assumes that the corgi, poodle and eti_b1 have their
codec chips on I2C bus 0, which may or may not be the case. Someone
with these machines please test and report.
Note that you can safely ignore patch failures in i2c-id.h.
include/linux/i2c-id.h | 1
sound/soc/at91/eti_b1_wm8731.c | 1
sound/soc/codecs/wm8731.c | 111 +++++++++++++++++++---------------------
sound/soc/codecs/wm8731.h | 1
sound/soc/pxa/corgi.c | 1
sound/soc/pxa/poodle.c | 1
6 files changed, 59 insertions(+), 57 deletions(-)
--- linux-2.6.27-rc4.orig/include/linux/i2c-id.h 2008-08-26 16:41:12.000000000 +0200
+++ linux-2.6.27-rc4/include/linux/i2c-id.h 2008-08-26 17:02:29.000000000 +0200
@@ -64,7 +64,6 @@
#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */
#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
-#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
--- linux-2.6.27-rc4.orig/sound/soc/at91/eti_b1_wm8731.c 2008-08-26 16:40:44.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/at91/eti_b1_wm8731.c 2008-08-26 17:02:20.000000000 +0200
@@ -243,6 +243,7 @@ static struct snd_soc_machine snd_soc_ma
};
static struct wm8731_setup_data eti_b1_wm8731_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1a,
};
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8731.c 2008-08-26 16:40:44.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8731.c 2008-08-26 17:11:50.000000000 +0200
@@ -570,86 +570,87 @@ static struct snd_soc_device *wm8731_soc
* low = 0x1a
* high = 0x1b
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8731_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
- around */
-
-static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8731_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8731_socdev;
- struct wm8731_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
- codec->control_data = i2c;
-
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
ret = wm8731_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8731\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8731_i2c_detach(struct i2c_client *client)
+static int wm8731_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8731_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8731_codec_probe);
-}
+static const struct i2c_device_id wm8731_i2c_id[] = {
+ { "wm8731", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8731_i2c_driver = {
.driver = {
.name = "WM8731 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_WM8731,
- .attach_adapter = wm8731_i2c_attach,
- .detach_client = wm8731_i2c_detach,
- .command = NULL,
+ .probe = wm8731_i2c_probe,
+ .remove = wm8731_i2c_remove,
+ .id_table = wm8731_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8731",
- .driver = &wm8731_i2c_driver,
-};
+static int wm8731_add_i2c_device(struct platform_device *pdev,
+ const struct wm8731_setup_data *setup)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8731_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8731", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+ socdev->codec->control_data = client;
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8731_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8731_probe(struct platform_device *pdev)
@@ -682,11 +683,8 @@ static int wm8731_probe(struct platform_
wm8731_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8731_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8731_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -711,6 +709,7 @@ static int wm8731_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8731_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8731.h 2008-08-26 16:40:44.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8731.h 2008-08-26 17:02:20.000000000 +0200
@@ -35,6 +35,7 @@
#define WM8731_DAI 0
struct wm8731_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--- linux-2.6.27-rc4.orig/sound/soc/pxa/corgi.c 2008-08-26 16:40:44.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/pxa/corgi.c 2008-08-26 17:02:20.000000000 +0200
@@ -330,6 +330,7 @@ static struct snd_soc_machine snd_soc_ma
/* corgi audio private data */
static struct wm8731_setup_data corgi_wm8731_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--- linux-2.6.27-rc4.orig/sound/soc/pxa/poodle.c 2008-08-26 16:40:44.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/pxa/poodle.c 2008-08-26 17:02:20.000000000 +0200
@@ -284,6 +284,7 @@ static struct snd_soc_machine snd_soc_ma
/* poodle audio private data */
static struct wm8731_setup_data poodle_wm8731_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--
Jean Delvare
5
9

01 Sep '08
Added the EQ distortion fix to the dell_m6_core_init.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index 6ad6ef3..9968ee4 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -606,8 +606,9 @@ static struct hda_verb dell_eq_core_init[] = {
};
static struct hda_verb dell_m6_core_init[] = {
- /* set master volume and direct control */
- { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
+ /* set master volume to max value without distortion
+ * and direct control */
+ { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec},
/* setup audio connections */
{ 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
{ 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01},
2
2

01 Sep '08
Convert the wm8990 codec driver to the new (standard) device driver
binding model. After this change, WM8990 devices are no longer
discovered automatically and must instead be instantiated explicitly.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm8990.c | 103 +++++++++++++++++++++++----------------------
sound/soc/codecs/wm8990.h | 1
2 files changed, 54 insertions(+), 50 deletions(-)
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8990.c 2008-08-29 09:32:25.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8990.c 2008-09-01 12:21:20.000000000 +0200
@@ -1477,81 +1477,86 @@ static struct snd_soc_device *wm8990_soc
* low = 0x34
* high = 0x36
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8990_i2c_driver;
-static struct i2c_client client_template;
-
-static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8990_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8990_socdev;
- struct wm8990_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = wm8990_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8990\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8990_i2c_detach(struct i2c_client *client)
+static int wm8990_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8990_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8990_codec_probe);
-}
+static const struct i2c_device_id wm8990_i2c_id[] = {
+ { "wm8990", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8990_i2c_id);
static struct i2c_driver wm8990_i2c_driver = {
.driver = {
.name = "WM8990 I2C Codec",
.owner = THIS_MODULE,
},
- .attach_adapter = wm8990_i2c_attach,
- .detach_client = wm8990_i2c_detach,
- .command = NULL,
+ .probe = wm8990_i2c_probe,
+ .remove = wm8990_i2c_remove,
+ .id_table = wm8990_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8990",
- .driver = &wm8990_i2c_driver,
-};
+static int wm8990_add_i2c_device(struct platform_device *pdev,
+ const struct wm8990_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8990_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8990", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8990_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8990_probe(struct platform_device *pdev)
@@ -1584,11 +1589,8 @@ static int wm8990_probe(struct platform_
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8990_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8990_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -1612,6 +1614,7 @@ static int wm8990_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8990_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc5.orig/sound/soc/codecs/wm8990.h 2008-08-21 09:10:47.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/wm8990.h 2008-09-01 12:05:05.000000000 +0200
@@ -827,6 +827,7 @@
#define WM8990_AINRMUX_PWR_BIT 3
struct wm8990_setup_data {
+ unsigned i2c_bus;
unsigned short i2c_address;
};
--
Jean Delvare
2
1

01 Sep '08
Convert the tlv320aic3x codec driver to the new (standard) device
driver binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Vladimir Barinov <vbarinov(a)ru.mvista.com>
Cc: Jarkko Nikula <jarkko.nikula(a)nokia.com>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
Warning: this assumes that the davinci-evm and n810 have their codec
chips on I2C bus 0, which may or may not be the case. Someone with
these machines please test and report.
sound/soc/codecs/tlv320aic3x.c | 106 +++++++++++++++++++--------------------
sound/soc/codecs/tlv320aic3x.h | 1
sound/soc/davinci/davinci-evm.c | 1
sound/soc/omap/n810.c | 1
4 files changed, 57 insertions(+), 52 deletions(-)
--- linux-2.6.27-rc5.orig/sound/soc/codecs/tlv320aic3x.c 2008-08-29 09:32:24.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/tlv320aic3x.c 2008-09-01 09:55:44.000000000 +0200
@@ -1172,71 +1172,39 @@ static struct snd_soc_device *aic3x_socd
* AIC3X 2 wire address can be up to 4 devices with device addresses
* 0x18, 0x19, 0x1A, 0x1B
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver aic3x_i2c_driver;
-static struct i2c_client client_template;
/*
* If the i2c layer weren't so broken, we could pass this kind of data
* around
*/
-static int aic3x_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int aic3x_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = aic3x_socdev;
- struct aic3x_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- printk(KERN_ERR "aic3x: failed to attach codec at addr %x\n",
- addr);
- goto err;
- }
-
ret = aic3x_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
printk(KERN_ERR "aic3x: failed to initialise AIC3X\n");
- goto err;
- }
- return ret;
-
-err:
- kfree(i2c);
return ret;
}
-static int aic3x_i2c_detach(struct i2c_client *client)
+static int aic3x_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int aic3x_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, aic3x_codec_probe);
-}
+static const struct i2c_device_id aic3x_i2c_id[] = {
+ { "tlv320aic3x", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, aic3x_i2c_id);
/* machine i2c codec control layer */
static struct i2c_driver aic3x_i2c_driver = {
@@ -1244,13 +1212,9 @@ static struct i2c_driver aic3x_i2c_drive
.name = "aic3x I2C Codec",
.owner = THIS_MODULE,
},
- .attach_adapter = aic3x_i2c_attach,
- .detach_client = aic3x_i2c_detach,
-};
-
-static struct i2c_client client_template = {
- .name = "AIC3X",
- .driver = &aic3x_i2c_driver,
+ .probe = aic3x_i2c_probe,
+ .remove = aic3x_i2c_remove,
+ .id_table = aic3x_i2c_id,
};
static int aic3x_i2c_read(struct i2c_client *client, u8 *value, int len)
@@ -1258,6 +1222,46 @@ static int aic3x_i2c_read(struct i2c_cli
value[0] = i2c_smbus_read_byte_data(client, value[0]);
return (len == 1);
}
+
+static int aic3x_add_i2c_device(struct platform_device *pdev,
+ const struct aic3x_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&aic3x_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "tlv320aic3x", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&aic3x_i2c_driver);
+ return -ENODEV;
+}
#endif
static int aic3x_probe(struct platform_device *pdev)
@@ -1290,12 +1294,9 @@ static int aic3x_probe(struct platform_d
aic3x_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t) i2c_master_send;
codec->hw_read = (hw_read_t) aic3x_i2c_read;
- ret = i2c_add_driver(&aic3x_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = aic3x_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -1320,6 +1321,7 @@ static int aic3x_remove(struct platform_
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&aic3x_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc5.orig/sound/soc/codecs/tlv320aic3x.h 2008-08-05 18:18:18.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/tlv320aic3x.h 2008-09-01 08:29:55.000000000 +0200
@@ -224,6 +224,7 @@ int aic3x_get_gpio(struct snd_soc_codec
int aic3x_headset_detected(struct snd_soc_codec *codec);
struct aic3x_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
unsigned int gpio_func[2];
};
--- linux-2.6.27-rc5.orig/sound/soc/davinci/davinci-evm.c 2008-08-13 09:51:02.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/davinci/davinci-evm.c 2008-09-01 08:30:20.000000000 +0200
@@ -136,6 +136,7 @@ static struct snd_soc_machine snd_soc_ma
/* evm audio private data */
static struct aic3x_setup_data evm_aic3x_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--- linux-2.6.27-rc5.orig/sound/soc/omap/n810.c 2008-08-29 09:32:25.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/omap/n810.c 2008-09-01 08:30:10.000000000 +0200
@@ -290,6 +290,7 @@ static struct snd_soc_machine snd_soc_ma
/* Audio private data */
static struct aic3x_setup_data n810_aic33_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x18,
.gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED,
.gpio_func[1] = AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT,
--
Jean Delvare
3
4
Hi,
FYI, I rebuilt the master branch on sound-2.6.git tree now because of
the conflict with sparc tree. Basically only topic/remove-assert is
changed and topic/sgbuf-large-pages branch is rebased. Other topic
branches are kept as is. The master is the straight merge results of
all topics now.
The old master branch before rebase is saved as old/master on
sound-2.6.git. It'll be removed sometime later.
If you've developed patches based on the master branch, try to rebase
like the following:
- mark your current branch
% git branch my-master
To be sure, keep it also as a backup branch in case you broke via
rebase:
% git branch backup-master
- mark the old origin/master
% git branch old-master origin/master
- fetch the sound-2.6.git
% git fetch origin
(or whatever)
- rebase via --onto option
% git rebase --onto origin/master old-master my-master
This will move the changes done on local branch onto origin/master,
and make the result as the current branch (i.e. the new
my-master).
- remove temporary branches if needed
% git branch -D old-master
% git branch -D backup-master
Takashi
1
0
pxa2xx-isa: probe actual device and use it for clk_get call
thus fixing error during startup hook
Signed-off-by: Dmitry Baryshkov <dbaryshkov(a)gmail.com>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/pxa/pxa2xx-i2s.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 8548818..c796b18 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -16,6 +16,7 @@
#include <linux/device.h>
#include <linux/delay.h>
#include <linux/clk.h>
+#include <linux/platform_device.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/initval.h>
@@ -81,7 +82,6 @@ static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream)
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
- clk_i2s = clk_get(NULL, "I2SCLK");
if (IS_ERR(clk_i2s))
return PTR_ERR(clk_i2s);
@@ -152,6 +152,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx);
pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm);
pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk);
+ BUG_ON(IS_ERR(clk_i2s));
clk_enable(clk_i2s);
pxa_i2s_wait();
@@ -317,6 +318,43 @@ struct snd_soc_dai pxa_i2s_dai = {
EXPORT_SYMBOL_GPL(pxa_i2s_dai);
+static int pxa2xx_i2s_probe(struct platform_device *dev)
+{
+ clk_i2s = clk_get(&dev->dev, "I2SCLK");
+ return IS_ERR(clk_i2s) ? PTR_ERR(clk_i2s) : 0;
+}
+
+static int __devexit pxa2xx_i2s_remove(struct platform_device *dev)
+{
+ clk_put(clk_i2s);
+ clk_i2s = ERR_PTR(-ENOENT);
+ return 0;
+}
+
+static struct platform_driver pxa2xx_i2s_driver = {
+ .probe = pxa2xx_i2s_probe,
+ .remove = __devexit_p(pxa2xx_i2s_remove),
+
+ .driver = {
+ .name = "pxa2xx-i2s",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init pxa2xx_i2s_init(void)
+{
+ clk_i2s = ERR_PTR(-ENOENT);
+ return platform_driver_register(&pxa2xx_i2s_driver);
+}
+
+static void __exit pxa2xx_i2s_exit(void)
+{
+ platform_driver_unregister(&pxa2xx_i2s_driver);
+}
+
+module_init(pxa2xx_i2s_init);
+module_exit(pxa2xx_i2s_exit);
+
/* Module information */
MODULE_AUTHOR("Liam Girdwood, liam.girdwood(a)wolfsonmicro.com, www.wolfsonmicro.com");
MODULE_DESCRIPTION("pxa2xx I2S SoC Interface");
--
1.5.6.3
5
6

01 Sep '08
Convert the uda1380 codec driver to the new (standard) device driver
binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
---
sound/soc/codecs/uda1380.c | 109 +++++++++++++++++++++-----------------------
sound/soc/codecs/uda1380.h | 1
2 files changed, 54 insertions(+), 56 deletions(-)
--- linux-2.6.27-rc4.orig/sound/soc/codecs/uda1380.c 2008-08-26 16:12:35.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/uda1380.c 2008-08-27 22:53:04.000000000 +0200
@@ -701,87 +701,86 @@ static struct snd_soc_device *uda1380_so
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-#define I2C_DRIVERID_UDA1380 0xfefe /* liam - need a proper id */
-
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver uda1380_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
- around */
-
-static int uda1380_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int uda1380_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = uda1380_socdev;
struct uda1380_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("uda1380: failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = uda1380_init(socdev, setup->dac_clk);
- if (ret < 0) {
+ if (ret < 0)
pr_err("uda1380: failed to initialise UDA1380\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int uda1380_i2c_detach(struct i2c_client *client)
+static int uda1380_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int uda1380_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, uda1380_codec_probe);
-}
+static const struct i2c_device_id uda1380_i2c_id[] = {
+ { "uda1380", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, uda1380_i2c_id);
static struct i2c_driver uda1380_i2c_driver = {
.driver = {
.name = "UDA1380 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_UDA1380,
- .attach_adapter = uda1380_i2c_attach,
- .detach_client = uda1380_i2c_detach,
- .command = NULL,
+ .probe = uda1380_i2c_probe,
+ .remove = uda1380_i2c_remove,
+ .id_table = uda1380_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "UDA1380",
- .driver = &uda1380_i2c_driver,
-};
+static int uda1380_add_i2c_device(struct platform_device *pdev,
+ const struct uda1380_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&uda1380_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "uda1380", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&uda1380_i2c_driver);
+ return -ENODEV;
+}
#endif
static int uda1380_probe(struct platform_device *pdev)
@@ -806,11 +805,8 @@ static int uda1380_probe(struct platform
uda1380_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&uda1380_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = uda1380_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -833,6 +829,7 @@ static int uda1380_remove(struct platfor
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&uda1380_i2c_driver);
#endif
kfree(codec);
--- linux-2.6.27-rc4.orig/sound/soc/codecs/uda1380.h 2008-08-26 16:12:35.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/uda1380.h 2008-08-27 22:52:32.000000000 +0200
@@ -73,6 +73,7 @@
#define R23_AGC_EN 0x0001
struct uda1380_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
int dac_clk;
#define UDA1380_DAC_CLK_SYSCLK 0
--
Jean Delvare
2
1

01 Sep '08
Convert the ak4535 codec driver to the new (standard) device driver
binding model. After this change, AK4535 devices are no longer
discovered automatically and must instead be instantiated explicitly.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
---
sound/soc/codecs/ak4535.c | 110 +++++++++++++++++++++------------------------
sound/soc/codecs/ak4535.h | 1
2 files changed, 54 insertions(+), 57 deletions(-)
--- linux-2.6.27-rc4.orig/sound/soc/codecs/ak4535.c 2008-08-26 16:12:35.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/ak4535.c 2008-08-27 23:01:26.000000000 +0200
@@ -535,87 +535,85 @@ static struct snd_soc_device *ak4535_soc
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-#define I2C_DRIVERID_AK4535 0xfefe /* liam - need a proper id */
-
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver ak4535_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
- around */
-static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int ak4535_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = ak4535_socdev;
- struct ak4535_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- printk(KERN_ERR "failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = ak4535_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
printk(KERN_ERR "failed to initialise AK4535\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int ak4535_i2c_detach(struct i2c_client *client)
+static int ak4535_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int ak4535_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, ak4535_codec_probe);
-}
+static const struct i2c_device_id ak4535_i2c_id[] = {
+ { "ak4535", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, ak4535_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver ak4535_i2c_driver = {
.driver = {
.name = "AK4535 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_AK4535,
- .attach_adapter = ak4535_i2c_attach,
- .detach_client = ak4535_i2c_detach,
- .command = NULL,
+ .probe = ak4535_i2c_probe,
+ .remove = ak4535_i2c_remove,
+ .id_table = ak4535_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "AK4535",
- .driver = &ak4535_i2c_driver,
-};
+static int ak4535_add_i2c_device(struct platform_device *pdev,
+ const struct ak4535_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&ak4535_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "ak4535", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&ak4535_i2c_driver);
+ return -ENODEV;
+}
#endif
static int ak4535_probe(struct platform_device *pdev)
@@ -648,12 +646,9 @@ static int ak4535_probe(struct platform_
ak4535_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
codec->hw_read = (hw_read_t)i2c_master_recv;
- ret = i2c_add_driver(&ak4535_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = ak4535_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -678,6 +673,7 @@ static int ak4535_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&ak4535_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc4.orig/sound/soc/codecs/ak4535.h 2008-08-26 16:12:35.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/ak4535.h 2008-08-27 23:01:04.000000000 +0200
@@ -37,6 +37,7 @@
#define AK4535_CACHEREGNUM 0x10
struct ak4535_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--
Jean Delvare
2
1

[alsa-devel] [PATCH] Automatically use ALC268_TOSHIBA for Toshiba L305 Laptop
by Travis Place 01 Sep '08
by Travis Place 01 Sep '08
01 Sep '08
Changelog: Added Subsystem IDs (0x1179, 0xff64) for the Toshiba Satellite L305
laptop, so it automatically uses the ALC268_TOSHIBA quirk.
Signed-off-by: Travis Place <wishie(a)wishie.net>
Patch Attached.
Thanks,
Travis Place (wishie)
2
1

[alsa-devel] snd_pcm_avail_update does not return until I have 32768 bytes ready
by William Estrada 01 Sep '08
by William Estrada 01 Sep '08
01 Sep '08
Hi group,
I am having a little problem with ALSA. My problem is that
snd_pcm_readi does not return
until i have 32768 bytes available. I want to get an interrupt back when
I have 80 bytes
( 1/100 of a second ). This delay is about 4.09 seconds which is much
too long to want.
My question is how do I tell ALSA to return from snd_pcm_avail_update
when I have
80 bytes ready to read?
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0

[alsa-devel] snd-soc-cs4270: Convert to a new-style i2c driver (work in progress)
by Jean Delvare 31 Aug '08
by Jean Delvare 31 Aug '08
31 Aug '08
Hi Tibur,
I am in the process of converting your cs4270 codec driver from the
legacy i2c model to the new (standard) one. This is work in progress.
The patch below converts the cs4270 driver itself. However we also need
to convert its users. As far as I can see there's only one user at this
point: mpc8610_hpcd.
The problem is that this driver doesn't look like the other codec
drivers I have already converted. So, we need to add code to
instantiate the cs4270 i2c device, but I don't know where this should
happen. Given that the mpc8610_hpcd is apparently based on Open
Firmware, I guess that the i2c device should be instantiated directly
by the platform code. I see that the device is declared in
mpc8610_hpcd.dts, so maybe it's already done and my patch should work
already? What do you think?
Thanks.
* * * * *
Convert the cs4270 codec driver to the new (standard) device driver
binding model. After this change, CS4720 devices are no longer
discovered automatically and must instead be instantiated explicitly.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Timur Tabi <timur(a)freescale.com>
---
sound/soc/codecs/cs4270.c | 79 +++++++++------------------------------------
1 file changed, 16 insertions(+), 63 deletions(-)
--- linux-2.6.27-rc5.orig/sound/soc/codecs/cs4270.c 2008-08-31 14:23:34.000000000 +0200
+++ linux-2.6.27-rc5/sound/soc/codecs/cs4270.c 2008-08-31 15:16:43.000000000 +0200
@@ -272,17 +272,6 @@ static int cs4270_set_dai_fmt(struct snd
}
/*
- * A list of addresses on which this CS4270 could use. I2C addresses are
- * 7 bits. For the CS4270, the upper four bits are always 1001, and the
- * lower three bits are determined via the AD2, AD1, and AD0 pins
- * (respectively).
- */
-static const unsigned short normal_i2c[] = {
- 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, I2C_CLIENT_END
-};
-I2C_CLIENT_INSMOD;
-
-/*
* Pre-fill the CS4270 register cache.
*
* We use the auto-increment feature of the CS4270 to read all registers in
@@ -490,32 +479,18 @@ static int cs4270_mute(struct snd_soc_da
#endif
-static int cs4270_i2c_probe(struct i2c_adapter *adap, int addr, int kind);
+static int cs4270_i2c_probe(struct i2c_client *i2c_client,
+ const struct i2c_device_id *id);
-/*
- * Notify the driver that a new I2C bus has been found.
- *
- * This function is called for each I2C bus in the system. The function
- * then asks the I2C subsystem to probe that bus at the addresses on which
- * our device (the CS4270) could exist. If a device is found at one of
- * those addresses, then our probe function (cs4270_i2c_probe) is called.
- */
-static int cs4270_i2c_attach(struct i2c_adapter *adapter)
-{
- return i2c_probe(adapter, &addr_data, cs4270_i2c_probe);
-}
-
-static int cs4270_i2c_detach(struct i2c_client *client)
+static int cs4270_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
codec->control_data = NULL;
kfree(codec->reg_cache);
codec->reg_cache = NULL;
- kfree(client);
return 0;
}
@@ -525,14 +500,19 @@ static const struct snd_kcontrol_new cs4
CS4270_VOLA, CS4270_VOLB, 0, 0xFF, 1)
};
+static const struct i2c_device_id cs4270_i2c_id[] = {
+ { "cs4270", 0 },
+ { }
+};
+
static struct i2c_driver cs4270_i2c_driver = {
.driver = {
.name = "CS4270 I2C",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_CS4270,
- .attach_adapter = cs4270_i2c_attach,
- .detach_client = cs4270_i2c_detach,
+ .probe = cs4270_i2c_probe,
+ .remove = cs4270_i2c_remove,
+ .id_table = cs4270_i2c_id,
};
/*
@@ -555,17 +535,14 @@ static struct snd_soc_device *cs4270_soc
/*
* Initialize the I2C interface of the CS4270
*
- * This function is called for whenever the I2C subsystem finds a device
- * at a particular address.
- *
* Note: snd_soc_new_pcms() must be called before this function can be called,
* because of snd_ctl_add().
*/
-static int cs4270_i2c_probe(struct i2c_adapter *adapter, int addr, int kind)
+static int cs4270_i2c_probe(struct i2c_client *i2c_client,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = cs4270_socdev;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c_client = NULL;
int i;
int ret = 0;
@@ -578,12 +555,6 @@ static int cs4270_i2c_probe(struct i2c_a
/* Note: codec_dai->codec is NULL here */
- i2c_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (!i2c_client) {
- printk(KERN_ERR "cs4270: could not allocate I2C client\n");
- return -ENOMEM;
- }
-
codec->reg_cache = kzalloc(CS4270_NUMREGS, GFP_KERNEL);
if (!codec->reg_cache) {
printk(KERN_ERR "cs4270: could not allocate register cache\n");
@@ -592,11 +563,6 @@ static int cs4270_i2c_probe(struct i2c_a
}
i2c_set_clientdata(i2c_client, codec);
- strcpy(i2c_client->name, "CS4270");
-
- i2c_client->driver = &cs4270_i2c_driver;
- i2c_client->adapter = adapter;
- i2c_client->addr = addr;
/* Verify that we have a CS4270 */
@@ -612,18 +578,10 @@ static int cs4270_i2c_probe(struct i2c_a
goto error;
}
- printk(KERN_INFO "cs4270: found device at I2C address %X\n", addr);
+ printk(KERN_INFO "cs4270: found device at I2C address %X\n",
+ i2c_client->addr);
printk(KERN_INFO "cs4270: hardware revision %X\n", ret & 0xF);
- /* Tell the I2C layer a new client has arrived */
-
- ret = i2c_attach_client(i2c_client);
- if (ret) {
- printk(KERN_ERR "cs4270: could not attach codec, "
- "I2C address %x, error code %i\n", addr, ret);
- goto error;
- }
-
codec->control_data = i2c_client;
codec->read = cs4270_read_reg_cache;
codec->write = cs4270_i2c_write;
@@ -651,17 +609,12 @@ static int cs4270_i2c_probe(struct i2c_a
return 0;
error:
- if (codec->control_data) {
- i2c_detach_client(i2c_client);
- codec->control_data = NULL;
- }
+ codec->control_data = NULL;
kfree(codec->reg_cache);
codec->reg_cache = NULL;
codec->reg_cache_size = 0;
- kfree(i2c_client);
-
return ret;
}
--
Jean Delvare
3
2

[alsa-devel] [PATCH] alsa-lib: Don't call the simple mixer interface "legacy"
by Lennart Poettering 31 Aug '08
by Lennart Poettering 31 Aug '08
31 Aug '08
The simpler mixer interface is not legacy, so the header file shouldn't claim
otherwise.
Fixes bug 3569
Lennart
---
include/mixer.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/mixer.h b/include/mixer.h
index 59deb9f..df92164 100644
--- a/include/mixer.h
+++ b/include/mixer.h
@@ -88,7 +88,7 @@ typedef int (*snd_mixer_event_t)(snd_mixer_class_t *class_, unsigned int mask,
/** Mixer element type */
typedef enum _snd_mixer_elem_type {
- /* Simple (legacy) mixer elements */
+ /* Simple mixer elements */
SND_MIXER_ELEM_SIMPLE,
SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE
} snd_mixer_elem_type_t;
@@ -166,7 +166,7 @@ int snd_mixer_class_set_compare(snd_mixer_class_t *class_, snd_mixer_compare_t c
* \{
*/
-/* Simple (legacy) mixer elements API */
+/* Simple mixer elements API */
/** Mixer simple element channel identifier */
typedef enum _snd_mixer_selem_channel_id {
--
1.6.0.1
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
2
1

[alsa-devel] [PATCH] alsa-lib: Reword doxygen doc for snd_pcm_delay()
by Lennart Poettering 31 Aug '08
by Lennart Poettering 31 Aug '08
31 Aug '08
snd_pcm_delay() is for synchronization purposes, it returns the overall latency
of the stream, not just the latency induced by the hardware playback buffer.
The documentation is a bit misleading about this fact, and some people already
misunderstood it. So let's reword this to make the explanation clearer and
explicit.
This is a result of the discussions of the thread this mail belongs to:
http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008456.html
Lennart
---
src/pcm/pcm.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index ee2300e..ae89795 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -939,11 +939,23 @@ int snd_pcm_hwsync(snd_pcm_t *pcm)
* \param delayp Returned delay in frames
* \return 0 on success otherwise a negative error code
*
- * Delay is distance between current application frame position and
- * sound frame position.
- * It's positive and less than buffer size in normal situation,
- * negative on playback underrun and greater than buffer size on
- * capture overrun.
+ * For playback the delay is defined as the time that a frame that is written
+ * to the PCM stream shortly after this call will take to be actually
+ * audible. It is as such the overall latency from the write call to the final
+ * DAC.
+ *
+ * For capture the delay is defined as the time that a frame that was
+ * digitized by the audio device takes until it can be read from the PCM
+ * stream shortly after this call returns. It is as such the overall latency
+ * from the initial ADC to the read call.
+ *
+ * Please note that hence in case of a playback underrun this value will not
+ * necessarily got down to 0.
+ *
+ * If the application is interested in the fill level of the playback buffer
+ * of the device, it should use snd_pcm_avail_update(). The
+ * value returned by that call is not directly related to the delay, since the
+ * latter might include some additional, fixed latencies the former does not.
*
* Note this function does not update the actual r/w pointer
* for applications. The function #snd_pcm_avail_update()
--
1.6.0.1
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
1
0

[alsa-devel] [PATCH] alsa-lib: Make sure SND_PCM_NO_xxx flags don't get lost when nonblocking mode is enabled
by Lennart Poettering 31 Aug '08
by Lennart Poettering 31 Aug '08
31 Aug '08
The plug PCM copies the 'mode' field from the slave PCM. If blocking mode is
enabled for the plug PCM the mode is subsequently overwritten with the original
requested 'mode'. If non-blocking mode is requested this does not happen.
Because the hw PCM synthesizes the 'mode' from the actual file descriptor flags
no SND_PCM_NO_xxx will ever be set for it. This has the effect that the 'mode'
of the plug PCM will also not include those flags anymore -- unless they are
overwritten as mentioned above. This basically means SND_PCM_NO_xxx is ignored
for plug:hw:4711 style device strings opened in non-blocking mode.
You can easily test this with "aplay --channels 7 --disable-channels -f S16_LE
-r 44100 -D plug:hw:0" on a device that cannot do 7 channels. Normally this
call should fail, however if you add "-N" to the command line this call will
succeed.
This patch simply copies the SND_PCM_NO_xxx flags back into the 'mode' field in
case we don't overwrite it with the original anyway.
Probably closes bug 3571 for good.
Lennart
---
src/pcm/pcm_hw.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 1e1889c..c8d9a62 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1507,7 +1507,13 @@ int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
/* revert to blocking mode for read/write access */
snd_pcm_hw_nonblock(*pcmp, 0);
(*pcmp)->mode = mode;
- }
+ } else
+ /* make sure the SND_PCM_NO_xxx flags don't get lost on the
+ * way */
+ (*pcmp)->mode |= mode & (SND_PCM_NO_AUTO_RESAMPLE|
+ SND_PCM_NO_AUTO_CHANNELS|
+ SND_PCM_NO_AUTO_FORMAT|
+ SND_PCM_NO_SOFTVOL);
hw = (*pcmp)->private_data;
if (format != SND_PCM_FORMAT_UNKNOWN)
--
1.6.0.1
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
1
0
Jaroslav,
I got you Email address from
http://www.mail-archive.com/alsa-devel@lists.sourceforge.net/msg09605.html.
<http://www.mail-archive.com/alsa-devel@lists.sourceforge.net/msg09605.html>
I am trying to write a C program that simply reads from a ALSA device
and then writes back to it.
The program work with one major problem, there is a 4.1 second delay
between the read and the write.
This delay is caused by the select() not returning at the right time. In
you post you said to use:
> Yes, but you have to create revents for snd_seq_poll_descriptors_revents()
> to get the right event then. Don't use values from select() directly.
>
> Jaroslav
>
Do you have some sample code that I could look at so that I could fix
my problem?
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0

[alsa-devel] Issues with alsa-info.sh - Trying to track down the problem.
by Travis Place 29 Aug '08
by Travis Place 29 Aug '08
29 Aug '08
Since the move to use alsa-project.org as the main place for uploads, some
users have reported that no URL is being printed at the end of the script. I
am trying to track down the problem, but would appreciate some help if
possible.
Thanks in advance,
Travis Place (wishie)
2
4

[alsa-devel] [PATCH] ice1724 MIDI on PHASE 22 and PHASE 28 and a few minor fixes
by Vedran Miletić 29 Aug '08
by Vedran Miletić 29 Aug '08
29 Aug '08
Changelog:
* added info about PHASE 28 (as far as I could collect, I don't have a card)
* added info about TS22PCI and new revisions of PHASE 22
* disable 192k on PHASE 22 as AK4524 I2S doesn't support it
* enable midi for both PHASE 22 and PHASE 28
* enable SPDIF reciever on PHASE 22
MIDI works for me, I have tried loopback and it plays good. Thanks for
help Pavel and Takashi.
diff --git a/pci/ice1712/phase.c b/pci/ice1712/phase.c
index f5acdee..6e596e9 100644
--- a/pci/ice1712/phase.c
+++ b/pci/ice1712/phase.c
@@ -24,7 +24,8 @@
/* PHASE 22 overview:
* Audio controller: VIA Envy24HT-S (slightly trimmed down version
of Envy24HT)
* Analog chip: AK4524 (partially via Philip's 74HCT125)
- * Digital receiver: CS8414-CS (not supported in this release)
+ * Digital receiver: CS8414-CS (supported in this release)
+ * PHASE 22 revision 2.0 and Terrasoniq/Musonik TS22PCI have CS8416
(support status unknown, please test and report)
*
* Envy connects to AK4524
* - CS directly from GPIO 10
@@ -33,6 +34,12 @@
* CDTI may be completely blocked by 74HCT125's gate #1 controlled by GPIO 3
*/
+/* PHASE 28 overview:
+ * Audio controller: VIA Envy24HT (full untrimmed version, 8 ins 8 outs)
+ * Analog chip: WM8770 (8 channel DAC, 2 channel ADC)
+ * Digital receiver: CS8414-CS (supported in this release)
+ */
+
#include <asm/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
@@ -161,9 +168,9 @@ static int __devinit phase22_add_controls(struct
snd_ice1712 *ice)
}
static unsigned char phase22_eeprom[] __devinitdata = {
- [ICE_EEP2_SYSCONF] = 0x00, /* 1xADC, 1xDACs */
+ [ICE_EEP2_SYSCONF] = 0x28, /* clock 512, mpu 401,
spdif-in/1xADC, 1xDACs */
[ICE_EEP2_ACLINK] = 0x80, /* I2S */
- [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit */
+ [ICE_EEP2_I2S] = 0xf0, /* vol, 96k, 24bit */
[ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */
[ICE_EEP2_GPIO_DIR] = 0xff,
[ICE_EEP2_GPIO_DIR1] = 0xff,
@@ -177,7 +184,7 @@ static unsigned char phase22_eeprom[] __devinitdata = {
};
static unsigned char phase28_eeprom[] __devinitdata = {
- [ICE_EEP2_SYSCONF] = 0x0b, /* clock 512, spdif-in/ADC, 4DACs */
+ [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, spdif-in/1xADC, 4xDACs */
[ICE_EEP2_ACLINK] = 0x80, /* I2S */
[ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */
[ICE_EEP2_SPDIF] = 0xc3, /* out-en, out-int, spdif-in */
--
Vedran Miletić
2
9

[alsa-devel] [PATCH] ice1724: enable MIDI on Terratec Aureon 7.1 Universe
by Maximilian Rehkopf 29 Aug '08
by Maximilian Rehkopf 29 Aug '08
29 Aug '08
This enables MIDI on Terratec Aureon 7.1 Universe cards specifically.
Apparently the other envy24ht-based Aureon cards do not have MIDI ports,
hence I added a Universe specific eeprom array.
The newer cards (Aureon 7.1 PCI / 5.1 PCI/Fun) have MIDI but use a CMI
DSP so this driver does not concern them at all.
I am new to git, do I have to perform any git operations regarding the
patch myself?
Signed-off-by: Maximilian Rehkopf <otakon(a)gmx.net>
--
Maximilian Rehkopf <otakon(a)gmx.net>
3
3
1. Implement 7.1 Output for vt1618 codec.
2. Fix typos in comments from my previous 1617a patch.
Signed-off-by: John L. Utz III <john.utz(a)dmx.com>
diff --git a/pci/ac97/ac97_codec.c b/pci/ac97/ac97_codec.c
index d0023e9..89f3050 100644
--- a/pci/ac97/ac97_codec.c
+++ b/pci/ac97/ac97_codec.c
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[]
= {
{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232
with S/PDIF
{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified
VT1616 with S/PDIF
-{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL },
+{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL },
{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03,
NULL},
@@ -609,7 +609,6 @@ AC97_SINGLE("PC Speaker Playback Volume",
AC97_PC_BEEP, 1, 15, 1)
static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
-
static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line",
"Mix", "Mix Mono", "Phone"};
static const char* std_3d_path[] = {"pre 3D", "post 3D"};
static const char* std_mix[] = {"Mix", "Mic"};
diff --git a/pci/ac97/ac97_patch.c b/pci/ac97/ac97_patch.c
index bb028f8..7d5abf5 100644
--- a/pci/ac97/ac97_patch.c
+++ b/pci/ac97/ac97_patch.c
@@ -3465,7 +3465,7 @@ static int patch_vt1616(struct snd_ac97 * ac97)
/*
* unfortunately, the vt1617a stashes the twiddlers required for
- * nooding the i/o jacks on 2 different regs. * thameans that we cant
+ * noodling the i/o jacks on 2 different regs. that means that we cant
* use the easy way provided by AC97_ENUM_DOUBLE() we have to write
* are own funcs.
*
@@ -3498,7 +3498,7 @@ static int snd_ac97_vt1617a_smart51_get(struct
snd_kcontrol *kcontrol,
pac97 = snd_kcontrol_chip(kcontrol); /* grab codec handle */
- /* grab our desirec bits, then mash them together in a manner
+ /* grab our desired bits, then mash them together in a manner
* consistent with Table 6 on page 17 in the 1617a docs */
usSM51 = snd_ac97_read(pac97, 0x7a) >> 14;
@@ -3576,6 +3576,201 @@ int patch_vt1617a(struct snd_ac97 * ac97)
return err;
}
+/* VIA VT1618 8 CHANNEL AC97 CODEC
+ *
+ * VIA implements 'Smart 5.1' completely differently on the 1618 than
+ * it does on the 1617a. awesome! They seem to have sourced this
+ * particular revision of the technology from somebody else, it's
+ * called Universal Audio Jack and it shows up on some other folk's chips
+ * as well.
+ *
+ * ordering in this list reflects vt1618 docs for Reg 60h and
+ * the block diagram, DACs are as follows:
+ *
+ * OUT_O -> Front,
+ * OUT_1 -> Surround,
+ * OUT_2 -> C/LFE
+ *
+ * Unlike the 1617a, each OUT has a consistent set of mappings
+ * for all bitpatterns other than 00:
+ *
+ * 01 Unmixed Output
+ * 10 Line In
+ * 11 Mic In
+ *
+ * Special Case of 00:
+ *
+ * OUT_0 Mixed Output
+ * OUT_1 Reserved
+ * OUT_2 Reserved
+ *
+ * I have no idea what the hell Reserved does, but on an MSI
+ * CN700T, i have to set it to get 5.1 output - YMMV, bad
+ * shit may happen.
+ *
+ * If other chips use Universal Audio Jack, then this code might be
applicable
+ * to them.
+ */
+
+struct vt1618_uaj_item {
+ unsigned short mask;
+ unsigned short shift;
+ const char *items[4];
+};
+
+/* This list reflects the vt1618 docs for Vendor Defined Register 0x60. */
+
+static struct vt1618_uaj_item vt1618_uaj[3] = {
+ {
+ /* speaker jack */
+ .mask = 0x03,
+ .shift = 0,
+ .items = {
+ "Speaker Out", "DAC Unmixed Out", "Line In", "Mic In"
+ }
+ },
+ {
+ /* line jack */
+ .mask = 0x0c,
+ .shift = 2,
+ .items = {
+ "Surround Out", "DAC Unmixed Out", "Line In", "Mic In"
+ }
+ },
+ {
+ /* mic jack */
+ .mask = 0x30,
+ .shift = 4,
+ .items = {
+ "Center LFE Out", "DAC Unmixed Out", "Line In", "Mic In"
+ },
+ },
+};
+
+static int snd_ac97_vt1618_UAJ_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo,
+ vt1618_uaj[kcontrol->private_value].items,
+ 4);
+}
+
+/* All of the vt1618 Universal Audio Jack twiddlers are on
+ Vendor Defined Register 0x60, page 0. The bits, and thus
+ the mask, are the only thing that changes */
+
+static int snd_ac97_vt1618_UAJ_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ unsigned short datpag, uaj;
+
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ mutex_lock(&pac97->page_mutex);
+
+ datpag = snd_ac97_read(pac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0);
+
+ uaj = snd_ac97_read(pac97, 0x60) &
+ vt1618_uaj[kcontrol->private_value].mask;
+
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, datpag);
+ mutex_unlock(&pac97->page_mutex);
+
+ ucontrol->value.enumerated.item[0] = uaj >>
+ vt1618_uaj[kcontrol->private_value].shift;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_UAJ_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return ac97_update_bits_page(snd_kcontrol_chip(kcontrol), 0x60,
+ vt1618_uaj[kcontrol->private_value].mask,
+ ucontrol->value.enumerated.item[0]<<
+ vt1618_uaj[kcontrol->private_value].shift,
+ 0);
+}
+
+/* config aux in jack - not found on 3 jack motherboards or soundcards */
+
+static int snd_ac97_vt1618_aux_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char *txt_aux[] = {"Aux In", "Back Surr Out"};
+
+ return ac97_enum_text_info(kcontrol, uinfo, txt_aux, 2);
+}
+
+static int snd_ac97_vt1618_aux_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.enumerated.item[0] =
+ (snd_ac97_read(snd_kcontrol_chip(kcontrol), 0x5c) & 0x0008)>>3;
+ return 0;
+}
+
+static int snd_ac97_vt1618_aux_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ /* toggle surround rear dac power */
+
+ snd_ac97_update_bits(snd_kcontrol_chip(kcontrol), 0x5c, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+
+ /* toggle aux in surround rear out jack */
+
+ return snd_ac97_update_bits(snd_kcontrol_chip(kcontrol), 0x76, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+static const struct snd_kcontrol_new snd_ac97_controls_vt1618[] = {
+ AC97_SINGLE("Exchange Center/LFE", 0x5a, 8, 1, 0),
+ AC97_SINGLE("DC Offset", 0x5a, 10, 1, 0),
+ AC97_SINGLE("Soft Mute", 0x5c, 0, 1, 1),
+ AC97_SINGLE("Headphone Amp", 0x5c, 5, 1, 1),
+ AC97_DOUBLE("Back Surr Volume", 0x5e, 8, 0, 31, 1),
+ AC97_SINGLE("Back Surr Switch", 0x5e, 15, 1, 1),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Speaker Jack Mode",
+ .info = snd_ac97_vt1618_UAJ_info,
+ .get = snd_ac97_vt1618_UAJ_get,
+ .put = snd_ac97_vt1618_UAJ_put,
+ .private_value = 0
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line Jack Mode",
+ .info = snd_ac97_vt1618_UAJ_info,
+ .get = snd_ac97_vt1618_UAJ_get,
+ .put = snd_ac97_vt1618_UAJ_put,
+ .private_value = 1
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic Jack Mode",
+ .info = snd_ac97_vt1618_UAJ_info,
+ .get = snd_ac97_vt1618_UAJ_get,
+ .put = snd_ac97_vt1618_UAJ_put,
+ .private_value = 2
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux Jack Mode",
+ .info = snd_ac97_vt1618_aux_info,
+ .get = snd_ac97_vt1618_aux_get,
+ .put = snd_ac97_vt1618_aux_put,
+ }
+};
+
+int patch_vt1618(struct snd_ac97 *ac97)
+{
+ return patch_build_controls(ac97, snd_ac97_controls_vt1618,
+ ARRAY_SIZE(snd_ac97_controls_vt1618));
+}
+
/*
*/
static void it2646_update_jacks(struct snd_ac97 *ac97)
2
3

Re: [alsa-devel] [alsa-cvslog] alsa-kernel: Official ALSA project GIT repository for Linux 2.6 branch, master now at v2.6.27-rc5-122-g1328f04
by Takashi Iwai 29 Aug '08
by Takashi Iwai 29 Aug '08
29 Aug '08
At Fri, 29 Aug 2008 11:35:25 +0200 (CEST),
noreply-git(a)alsa-project.org wrote:
>
> commit 1328f04260822e45a2717b65a0e2bc0c9c1255be
> Author: Jaroslav Kysela <perex(a)perex.cz>
> AuthorDate: Fri Aug 29 11:29:39 2008 +0200
> Commit: Jaroslav Kysela <perex(a)perex.cz>
> CommitDate: Fri Aug 29 11:29:39 2008 +0200
>
> ALSA: intel8x0: implement ac97_clock whitelist
>
> The AC97 clock detection is not accurate in some cases. This patch adds
> an initial whitelist for audio devices gathered from RedHat's bugzilla:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=441087
>
> As a side effect, white-listing might speedup kernel booting (AC97 clock
> measuring code is not activated).
>
> Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
(snip)
> +struct intel8x0_clock_list {
> + unsigned short subvendor;
> + unsigned short subdevice;
> + unsigned int rate;
> +};
> +
> +static struct intel8x0_clock_list intel8x0_clock_list[] __devinitdata = {
> + { 0x1028, 0x00be, 44100 }, /* Analog Devices AD1885 */
> + { 0x1028, 0x0177, 48000 }, /* Analog Devices AD1980 */
> + { 0x1043, 0x80f3, 48000 }, /* Analog Devices AD1985 */
> + { 0x0000, 0x0000, 00000 } /* terminator */
> +};
> +
> +static int __devinit intel8x0_in_clock_list(struct intel8x0 *chip)
> +{
> + struct pci_dev *pci = chip->pci;
> + struct intel8x0_clock_list *wl;
> +
> + for (wl = intel8x0_clock_list; wl->subvendor; wl++) {
> + if (wl->subvendor == pci->subsystem_vendor &&
> + wl->subdevice == pci->subsystem_device) {
> + printk(KERN_INFO "intel8x0: white list rate for %04x:%04x is %i\n",
> + pci->subsystem_vendor,
> + pci->subsystem_device, wl->rate);
> + chip->ac97_bus->clock = wl->rate;
> + return 1;
> + }
> + }
> + return 0;
> +}
Use snd_pci_quirk_lookup() please.
But, a better fix would be to fix the clock measurement.
AFAIK, this seems to happen when the driver is built-in. Thus I guess
it's rather a problem of time-keeping core side.
Takashi
1
0

Re: [alsa-devel] [PATCH] HDA: patch-realtek: toshiba dynabook SS RX1 which use ALC262
by Takashi Iwai 28 Aug '08
by Takashi Iwai 28 Aug '08
28 Aug '08
At Thu, 28 Aug 2008 13:40:23 +0000,
Hiroshi Miura wrote:
>
> Recent patch for toshiba dynabook SS RX1 against recent snapshot;
Thanks. Now applied and pushed to my tree.
Takashi
> Hiroshi
>
> 2008/8/26 Takashi Iwai <tiwai(a)suse.de>:
> > Hi Miura-san,
> >
> > At Tue, 26 Aug 2008 17:39:17 +0900,
> > 三浦 SPS wrote:
> >>
> >> Hi Takashi,
> >>
> >> When I test with recent tree on the Toshiba laptop, Toshiba dynabook SS RX1,
> >> some mixer items are not controlled by ALSA.
> >> Some mixer items appears as an OSS mixer control.
> >> Chipset is HDA intel with Realtek ALC262.
> >>
> >> I make this patch by using as many datas and functions in existent model.
> >>
> >> Toshiba hda-intel ALC262 should be controlled as same model as fujitsu.
> >> There is an only difference in nid of head phone jack.
> >>
> >> A related bugtrack id is #3386 and I also post it there.
> >> https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3386
> >
> > Thanks. The changes look OK, but your MUA broke the embedded patch.
> >
> > BTW, I merged other patches to add more support in patch_realtek.c,
> > and one of them is the support for Toshiba S06.
> > Could you check whether it's compatible with yours?
> > It seems S06 uses the digital mic instead of analog mic, and this
> > can be a difference.
> >
>
> Signed-off-by: Hiroshi Miura <miurahr(a)acm.org>
> ---
> --- alsa-driver-unstable/alsa-kernel/pci/hda/patch_realtek.c.orig 2008-08-27
> 06:05:19.000000000 +0000
> +++ alsa-driver-unstable/alsa-kernel/pci/hda/patch_realtek.c 2008-08-27
> 11:28:04.000000000 +0000
> @@ -103,6 +103,7 @@ enum {
> ALC262_LENOVO_3000,
> ALC262_NEC,
> ALC262_TOSHIBA_S06,
> + ALC262_TOSHIBA_RX1,
> ALC262_AUTO,
> ALC262_MODEL_LAST /* last tag */
> };
> @@ -9705,6 +9706,25 @@ static struct snd_kcontrol_new alc262_le
> { } /* end */
> };
>
> +static struct snd_kcontrol_new alc262_toshiba_rx1_mixer[] = {
> + HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol),
> + {
> + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
> + .name = "Master Playback Switch",
> + .info = snd_hda_mixer_amp_switch_info,
> + .get = snd_hda_mixer_amp_switch_get,
> + .put = alc262_sony_master_sw_put,
> + .private_value = HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
> + },
> + HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
> + HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
> + HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
> + HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
> + HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
> + HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
> + { } /* end */
> +};
> +
> /* additional init verbs for Benq laptops */
> static struct hda_verb alc262_EAPD_verbs[] = {
> {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
> @@ -10169,6 +10189,24 @@ static struct hda_verb alc262_HP_BPC_Wil
> { }
> };
>
> +static struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
> +
> + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* Front Speaker */
> + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
> + {0x14, AC_VERB_SET_CONNECT_SEL, 0x01},
> +
> + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* MIC jack */
> + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Front MIC */
> + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) },
> + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) },
> +
> + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, /* HP jack */
> + {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
> + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
> + {}
> +};
> +
> +
> #ifdef CONFIG_SND_HDA_POWER_SAVE
> #define alc262_loopbacks alc880_loopbacks
> #endif
> @@ -10258,6 +10296,8 @@ static const char *alc262_models[ALC262_
> [ALC262_ULTRA] = "ultra",
> [ALC262_LENOVO_3000] = "lenovo-3000",
> [ALC262_NEC] = "nec",
> + [ALC262_TOSHIBA_S06] = "toshiba-s06",
> + [ALC262_TOSHIBA_RX1] = "toshiba-rx1",
> [ALC262_AUTO] = "auto",
> };
>
> @@ -10292,7 +10332,7 @@ static struct snd_pci_quirk alc262_cfg_t
> SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD),
> SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD),
> SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
> - ALC262_SONY_ASSAMD),
> + ALC262_TOSHIBA_RX1),
> SND_PCI_QUIRK(0x1179, 0x0268, "Toshiba S06", ALC262_TOSHIBA_S06),
> SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
> SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
> @@ -10500,6 +10540,18 @@ static struct alc_config_preset alc262_p
> .unsol_event = alc262_toshiba_s06_unsol_event,
> .init_hook = alc262_toshiba_s06_init_hook,
> },
> + [ALC262_TOSHIBA_RX1] = {
> + .mixers = { alc262_toshiba_rx1_mixer },
> + .init_verbs = { alc262_init_verbs, alc262_toshiba_rx1_unsol_verbs },
> + .num_dacs = ARRAY_SIZE(alc262_dac_nids),
> + .dac_nids = alc262_dac_nids,
> + .hp_nid = 0x03,
> + .num_channel_mode = ARRAY_SIZE(alc262_modes),
> + .channel_mode = alc262_modes,
> + .input_mux = &alc262_capture_source,
> + .unsol_event = alc262_hippo_unsol_event,
> + .init_hook = alc262_hippo_automute,
> + },
> };
>
> static int patch_alc262(struct hda_codec *codec)
>
> --
> HIroshi Miura
> NTT DATA Corp. and IPA OSS center
> (株)NTTデータ /(独)情報処理推進機構
> 三浦広志
>
1
0

28 Aug '08
Pop time configuration is a debugging feature which shouldn't be used in
normal operation so move it to debugfs where it is clearer. This also
simplifies the code since debugfs provides standard facilities for
exposing simple integer values to user space.
Signed-off-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
It would be nice to apply this to 2.6.27 since the sysfs file was only
added in the 2.6.27 cycle but it's not critical either way.
sound/soc/soc-dapm.c | 53 ++++++++++++++++++-------------------------------
1 files changed, 20 insertions(+), 33 deletions(-)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7a88f76..c016426 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -38,6 +38,7 @@
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
+#include <linux/debugfs.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -67,7 +68,9 @@ static int dapm_status = 1;
module_param(dapm_status, int, 0);
MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries");
-static unsigned int pop_time;
+static struct dentry *asoc_debugfs;
+
+static u32 pop_time;
static void pop_wait(void)
{
@@ -817,51 +820,35 @@ static ssize_t dapm_widget_show(struct device *dev,
static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL);
-/* pop/click delay times */
-static ssize_t dapm_pop_time_show(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- return sprintf(buf, "%d\n", pop_time);
-}
-
-static ssize_t dapm_pop_time_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-
-{
- unsigned long val;
-
- if (strict_strtoul(buf, 10, &val) >= 0)
- pop_time = val;
- else
- printk(KERN_ERR "Unable to parse pop_time setting\n");
-
- return count;
-}
-
-static DEVICE_ATTR(dapm_pop_time, 0744, dapm_pop_time_show,
- dapm_pop_time_store);
-
int snd_soc_dapm_sys_add(struct device *dev)
{
int ret = 0;
- if (dapm_status) {
- ret = device_create_file(dev, &dev_attr_dapm_widget);
+ if (!dapm_status)
+ return 0;
- if (ret == 0)
- ret = device_create_file(dev, &dev_attr_dapm_pop_time);
- }
+ ret = device_create_file(dev, &dev_attr_dapm_widget);
+ if (ret != 0)
+ return ret;
- return ret;
+ asoc_debugfs = debugfs_create_dir("asoc", NULL);
+ if (!IS_ERR(asoc_debugfs))
+ debugfs_create_u32("dapm_pop_time", 0744, asoc_debugfs,
+ &pop_time);
+ else
+ asoc_debugfs = NULL;
+
+ return 0;
}
static void snd_soc_dapm_sys_remove(struct device *dev)
{
if (dapm_status) {
- device_remove_file(dev, &dev_attr_dapm_pop_time);
device_remove_file(dev, &dev_attr_dapm_widget);
}
+
+ if (asoc_debugfs)
+ debugfs_remove_recursive(asoc_debugfs);
}
/* free all dapm widgets and resources */
--
1.5.6.5
3
3

[alsa-devel] modifying VIA8237.conf - does it currently work correctly for somebody?
by John L. Utz III 28 Aug '08
by John L. Utz III 28 Aug '08
28 Aug '08
Hi;
I am sorry for the vagueness of the questions, but now that i have some
understanding of how these files are supposed to work i want to get this
right!
to support 4.0/5.1/7.1 for the vt1618 codec i have to change a different
set of twiddlers than what is called out in the current version of the
conf file.
worse yet, the twiddlers called out in the current file dont even *exist*
on the vt1618:
{
name "Surround Down Mix"
preserve true
value off
lock true
optional true
}
{
name "Center/LFE Down Mix"
preserve true
value off
lock true
optional true
}
How do i add new stuff without breaking old stuff? is there a sub-identity
that i could use?
tnx!
johnu
2
1

[alsa-devel] Report of partially supported STAC92HD73* onboard a DELL Studio/Inspiron 1535
by Travis Place 28 Aug '08
by Travis Place 28 Aug '08
28 Aug '08
Current status:
Internal speakers: Working
Internal microphone: Not working
External microphone: Not working
Headphones: Not working
Card Information (alsa-info):
http://www.alsa-project.org/db/?f=166dedf1effd5c5ba0ee91075a0f0ca4da65f3b4
Notes: i had the user upgrade to 1.0.17 of alsa-driver, but didnt suggest git
code, as i couldnt find any immediate difference for his card in the later
code.
Thanks,
Travis Place (wishie)
2
2

28 Aug '08
ac97_patch.c provides two helper functions that wrap the channel_mode
variable, but they only take you out to 5.1 Audio:
static inline int is_surround_on(struct snd_ac97 *ac97)
{
return ac97->channel_mode >= 1;
}
static inline int is_clfe_on(struct snd_ac97 *ac97)
{
return ac97->channel_mode >= 2;
}
For 7.1 Audio, i think there needs to be a test for 'Surround Back' or
'Back Surround'
static inline int is_surback_on(struct snd_ac97 *ac97)
{
return ac97->channel_mode >= 4;
}
Am i correct? or am i mistaken? agreement or corrections appreciated!
I think that i need this function for implementing vt1618_update_jacks()
because vt1618 is 7.1 Audio:
static void vt1618_update_jacks(struct snd_ac97 *ac97)
{
unsigned short usSft = 0, usMsk = 0x0003;
if(is_surround_on(ac97))
ac97_update_bits_page(ac97, 0x60, 0x000C,
ucontrol->value.enumerated.item[0]<<2,
0);
if(is_clfe_on(ac97))
ac97_update_bits_page(ac97, 0x60, 0x0030,
ucontrol->value.enumerated.item[0]<<4,
0);
if(is_surback_on(ac97)) {
/* toggle surround rear dac power */
snd_ac97_update_bits(ac97, 0x5c, 0x0008,
ucontrol->value.enumerated.item[0] << 3);
/* toggle aux in surround rear out jack */
snd_ac97_update_bits(ac97, 0x76, 0x0008,
ucontrol->value.enumerated.item[0] << 3);
}
}
2
2

[alsa-devel] [PATCH] ASoC: Convert wm8731 to a new-style i2c driver (v2, testers wanted)
by Jean Delvare 27 Aug '08
by Jean Delvare 27 Aug '08
27 Aug '08
Convert the wm8731 codec driver to the new (standard) device driver
binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Acked-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
Tested-by: Manuel Lauss <mano(a)roarinelk.homelinux.net>
---
This second version fixes a bug reported by Manuel Lauss where
codec->control_data was used before being initialized.
Warning: this assumes that the corgi, poodle and eti_b1 have their
codec chips on I2C bus 0, which may or may not be the case. Someone
with these machines please test and report.
include/linux/i2c-id.h | 1
sound/soc/at91/eti_b1_wm8731.c | 1
sound/soc/codecs/wm8731.c | 108 +++++++++++++++++++---------------------
sound/soc/codecs/wm8731.h | 1
sound/soc/pxa/corgi.c | 1
sound/soc/pxa/poodle.c | 1
6 files changed, 57 insertions(+), 56 deletions(-)
--- linux-2.6.27-rc4.orig/include/linux/i2c-id.h 2008-08-27 22:27:01.000000000 +0200
+++ linux-2.6.27-rc4/include/linux/i2c-id.h 2008-08-27 22:38:47.000000000 +0200
@@ -64,7 +64,6 @@
#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */
#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
-#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
--- linux-2.6.27-rc4.orig/sound/soc/at91/eti_b1_wm8731.c 2008-08-27 22:27:01.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/at91/eti_b1_wm8731.c 2008-08-27 22:38:47.000000000 +0200
@@ -243,6 +243,7 @@ static struct snd_soc_machine snd_soc_ma
};
static struct wm8731_setup_data eti_b1_wm8731_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1a,
};
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8731.c 2008-08-27 22:27:01.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8731.c 2008-08-27 22:45:15.000000000 +0200
@@ -570,86 +570,86 @@ static struct snd_soc_device *wm8731_soc
* low = 0x1a
* high = 0x1b
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8731_i2c_driver;
-static struct i2c_client client_template;
-
-/* If the i2c layer weren't so broken, we could pass this kind of data
- around */
-
-static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8731_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8731_socdev;
- struct wm8731_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = wm8731_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8731\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8731_i2c_detach(struct i2c_client *client)
+static int wm8731_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8731_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8731_codec_probe);
-}
+static const struct i2c_device_id wm8731_i2c_id[] = {
+ { "wm8731", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8731_i2c_driver = {
.driver = {
.name = "WM8731 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_WM8731,
- .attach_adapter = wm8731_i2c_attach,
- .detach_client = wm8731_i2c_detach,
- .command = NULL,
+ .probe = wm8731_i2c_probe,
+ .remove = wm8731_i2c_remove,
+ .id_table = wm8731_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8731",
- .driver = &wm8731_i2c_driver,
-};
+static int wm8731_add_i2c_device(struct platform_device *pdev,
+ const struct wm8731_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8731_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8731", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8731_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8731_probe(struct platform_device *pdev)
@@ -682,11 +682,8 @@ static int wm8731_probe(struct platform_
wm8731_socdev = socdev;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8731_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8731_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -711,6 +708,7 @@ static int wm8731_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8731_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8731.h 2008-08-27 22:27:01.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8731.h 2008-08-27 22:38:47.000000000 +0200
@@ -35,6 +35,7 @@
#define WM8731_DAI 0
struct wm8731_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--- linux-2.6.27-rc4.orig/sound/soc/pxa/corgi.c 2008-08-27 22:27:01.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/pxa/corgi.c 2008-08-27 22:38:47.000000000 +0200
@@ -330,6 +330,7 @@ static struct snd_soc_machine snd_soc_ma
/* corgi audio private data */
static struct wm8731_setup_data corgi_wm8731_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--- linux-2.6.27-rc4.orig/sound/soc/pxa/poodle.c 2008-08-27 22:27:01.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/pxa/poodle.c 2008-08-27 22:38:47.000000000 +0200
@@ -284,6 +284,7 @@ static struct snd_soc_machine snd_soc_ma
/* poodle audio private data */
static struct wm8731_setup_data poodle_wm8731_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--
Jean Delvare
1
0

[alsa-devel] [PATCH] ASoC: Convert wm8750 to a new-style i2c driver (v2, testers wanted)
by Jean Delvare 27 Aug '08
by Jean Delvare 27 Aug '08
27 Aug '08
Convert the wm8750 codec driver to the new (standard) device driver
binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Acked-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
This second version fixes a bug reported by Manuel Lauss where
codec->control_data was used before being initialized.
Warning: this assumes that the spitz has its codec chip on I2C bus 0,
which may or may not be the case. Someone with this machine please
test and report.
include/linux/i2c-id.h | 1
sound/soc/codecs/wm8750.c | 105 ++++++++++++++++++++++-----------------------
sound/soc/codecs/wm8750.h | 1
sound/soc/pxa/spitz.c | 1
4 files changed, 55 insertions(+), 53 deletions(-)
--- linux-2.6.27-rc4.orig/include/linux/i2c-id.h 2008-08-26 19:56:18.000000000 +0200
+++ linux-2.6.27-rc4/include/linux/i2c-id.h 2008-08-27 22:46:24.000000000 +0200
@@ -65,7 +65,6 @@
#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
-#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8750.c 2008-08-26 19:56:18.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8750.c 2008-08-27 22:45:24.000000000 +0200
@@ -846,83 +846,86 @@ static struct snd_soc_device *wm8750_soc
* low = 0x1a
* high = 0x1b
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8750_i2c_driver;
-static struct i2c_client client_template;
-
-static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8750_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8750_socdev;
- struct wm8750_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
-
ret = wm8750_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8750\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8750_i2c_detach(struct i2c_client *client)
+static int wm8750_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8750_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8750_codec_probe);
-}
+static const struct i2c_device_id wm8750_i2c_id[] = {
+ { "wm8750", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8750_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8750_i2c_driver = {
.driver = {
.name = "WM8750 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_WM8750,
- .attach_adapter = wm8750_i2c_attach,
- .detach_client = wm8750_i2c_detach,
- .command = NULL,
+ .probe = wm8750_i2c_probe,
+ .remove = wm8750_i2c_remove,
+ .id_table = wm8750_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8750",
- .driver = &wm8750_i2c_driver,
-};
+static int wm8750_add_i2c_device(struct platform_device *pdev,
+ const struct wm8750_setup_data *setup)
+{
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8750_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8750", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8750_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8750_probe(struct platform_device *pdev)
@@ -954,11 +957,8 @@ static int wm8750_probe(struct platform_
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8750_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8750_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -1002,6 +1002,7 @@ static int wm8750_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8750_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8750.h 2008-08-26 19:56:18.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8750.h 2008-08-26 21:33:59.000000000 +0200
@@ -58,6 +58,7 @@
#define WM8750_SYSCLK 0
struct wm8750_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--- linux-2.6.27-rc4.orig/sound/soc/pxa/spitz.c 2008-08-26 19:56:18.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/pxa/spitz.c 2008-08-26 21:33:59.000000000 +0200
@@ -337,6 +337,7 @@ static struct snd_soc_machine snd_soc_ma
/* spitz audio private data */
static struct wm8750_setup_data spitz_wm8750_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--
Jean Delvare
1
0

Re: [alsa-devel] Swissonic TS22PCI / Teratec Phase 22 / driver problems with ice1724
by Takashi Iwai 27 Aug '08
by Takashi Iwai 27 Aug '08
27 Aug '08
At Thu, 14 Aug 2008 16:07:13 +0200,
Manuel Schneider wrote:
>
> Takashi Iwai schrieb, Am 14.08.2008 16:03:
>
> > At Thu, 14 Aug 2008 15:59:06 +0200,
> > Manuel Schneider wrote:
> >> Takashi Iwai schrieb, Am 14.08.2008 15:47:
> >>
> >>> Pass model=phase22 module option to snd-ice1724 driver. Then it
> >>> handles the card as if it's phase22.
> >> Thanks for this hin. Unfortunately it changes nothing - still kernel
> >> error message, still no usable sound device.
> >
> > Are you sure? With the proper model name, at least you won't get
> > EEPROM version error any more.
>
>
> yes, pretty sure. I just reverted my patch and recompiled the driver to
> check it out:
>
> ice1712: cannot initialize pro ac97, skipped
> ice1724: No matching model found for ID 0x3b157b11
This means that you didn't pass the model option properly.
> ice1724: Invalid EEPROM version 0
> AC'97 0 does not respond - RESET
> AC'97 0 access is not valid [0xffffffff], removing mixer.
> ice1712: cannot initialize pro ac97, skipped
>
>
> >> I also tried the following kernel patch, which gives me an accessible
> >> sound device and usable mixer (and no kernel error), but recording does
> >> not work (just noise).
> >
> > Likely an incompatible hardware design for the recording...
>
> I guess it's another firmware...
The board has no firmware to load.
> I can't test playback as I only have
> remote access to the server and it is only used for recording
> (streaming) but I assume it does also not work.
> I admit that this patch was just a hack to try it out.
First you should check whether the exactly same codec chip, AK4524, on
it.
Takashi
2
5

27 Aug '08
At Wed, 27 Aug 2008 11:57:06 +0200,
Tejun Heo wrote:
>
> Takashi Iwai wrote:
> >> SOUND_OSS_CORE should be turned on if ALSA OSS emul is turned on or
> >> arch-um hostsound is turned on, both of which can be enabled regardless
> >> of SOUND_PRIME, no?
> >
> > Yes, sorry, I didn't cite clearly. I meant only the last line.
> > sound/oss/dmasound/Kconfig is included and evaluated outside the block
> > "if SOUND_PRIME". Thus, CONFIG_SOUND_OSS_CORE won't be enabled for
> > drivers in sound/oss/dmasound.
>
> Ah.. okay, dmasound also requires SOUND_OSS_CORE but not in
> SOUND_PRIME. I see.
>
> > My suggestion is to move that line source sound/oss/dmasound/Kconfig
> > into the "if SOUND_PRIME" block first, then apply your patch.
>
> That would pull in sound_firmware. Most likely no big deal but
> still...
Ouch, another pain.
sound_firmware.c should be removed and the relevant code should use
request_firmware()...
> How about just adding select SOUND_OSS_CORE to DMASOUND for
> now?
Looks good to me.
Acked-by: Takashi Iwai <tiwai(a)suse.de>
If no objection comes up, I'll merge it to sound tree later.
thanks,
Takashi
> Thanks.
>
> Subject: [PATCH] sound: make OSS sound core optional
>
> sound/sound_core.c implements soundcore.ko and contains two parts -
> sound_class which is shared by both ALSA and OSS and device
> redirection support for OSS. It's always compiled when any sound
> support is enabled although it's necessary only when OSS (the actual
> one or emulation) is enabled. This is slightly wasteful and as device
> redirection always registers character device region for major 14, it
> prevents alternative implementation.
>
> This patch introduces a new config SOUND_OSS_CORE which is selected
> iff OSS support is actually necessary and build the OSS core part
> conditionally.
>
> If OSS is disabled, soundcore merely contains sound_class but leaving
> it that way seems to be the simplest approach as otherwise sound_class
> should be in ALSA core file if OSS is disabled but should be in
> soundcore if OSS is enabled. Also, there's also the user confusion
> factor.
>
> Signed-off-by: Tejun Heo <tj(a)kernel.org>
> ---
> arch/um/Kconfig.char | 4 ++
> sound/Kconfig | 5 ++
> sound/core/Kconfig | 1
> sound/oss/dmasound/Kconfig | 1
> sound/sound_core.c | 79 ++++++++++++++++++++++++++++++++++-----------
> 5 files changed, 71 insertions(+), 19 deletions(-)
>
> Index: work/sound/Kconfig
> ===================================================================
> --- work.orig/sound/Kconfig
> +++ work/sound/Kconfig
> @@ -28,6 +28,10 @@ menuconfig SOUND
>
> if SOUND
>
> +config SOUND_OSS_CORE
> + bool
> + default n
> +
> source "sound/oss/dmasound/Kconfig"
>
> if !M68K
> @@ -80,6 +84,7 @@ endif # SND
>
> menuconfig SOUND_PRIME
> tristate "Open Sound System (DEPRECATED)"
> + select SOUND_OSS_CORE
> help
> Say 'Y' or 'M' to enable Open Sound System drivers.
>
> Index: work/sound/core/Kconfig
> ===================================================================
> --- work.orig/sound/core/Kconfig
> +++ work/sound/core/Kconfig
> @@ -38,6 +38,7 @@ config SND_SEQ_DUMMY
> will be called snd-seq-dummy.
>
> config SND_OSSEMUL
> + select SOUND_OSS_CORE
> bool
>
> config SND_MIXER_OSS
> Index: work/sound/sound_core.c
> ===================================================================
> --- work.orig/sound/sound_core.c
> +++ work/sound/sound_core.c
> @@ -1,5 +1,61 @@
> /*
> - * Sound core handling. Breaks out sound functions to submodules
> + * Sound core. This file is composed of two parts. sound_class
> + * which is common to both OSS and ALSA and OSS sound core which
> + * is used OSS or emulation of it.
> + */
> +
> +/*
> + * First, the common part.
> + */
> +#include <linux/module.h>
> +#include <linux/device.h>
> +#include <linux/err.h>
> +
> +#ifdef CONFIG_SOUND_OSS_CORE
> +static int __init init_oss_soundcore(void);
> +static void __exit cleanup_oss_soundcore(void);
> +#else
> +static inline int init_oss_soundcore(void) { return 0; }
> +static inline void cleanup_oss_soundcore(void) { }
> +#endif
> +
> +struct class *sound_class;
> +EXPORT_SYMBOL(sound_class);
> +
> +MODULE_DESCRIPTION("Core sound module");
> +MODULE_AUTHOR("Alan Cox");
> +MODULE_LICENSE("GPL");
> +
> +static int __init init_soundcore(void)
> +{
> + int rc;
> +
> + rc = init_oss_soundcore();
> + if (rc)
> + return rc;
> +
> + sound_class = class_create(THIS_MODULE, "sound");
> + if (IS_ERR(sound_class)) {
> + cleanup_oss_soundcore();
> + return PTR_ERR(sound_class);
> + }
> +
> + return 0;
> +}
> +
> +static void __exit cleanup_soundcore(void)
> +{
> + cleanup_oss_soundcore();
> + class_destroy(sound_class);
> +}
> +
> +module_init(init_soundcore);
> +module_exit(cleanup_soundcore);
> +
> +
> +#ifdef CONFIG_SOUND_OSS_CORE
> +/*
> + * OSS sound core handling. Breaks out sound functions to submodules
> *
> * Author: Alan Cox <alan.cox(a)linux.org>
> *
> @@ -34,21 +90,17 @@
> * locking at some point in 2.3.x.
> */
>
> -#include <linux/module.h>
> #include <linux/init.h>
> #include <linux/slab.h>
> #include <linux/smp_lock.h>
> #include <linux/types.h>
> #include <linux/kernel.h>
> -#include <linux/fs.h>
> #include <linux/sound.h>
> #include <linux/major.h>
> #include <linux/kmod.h>
> -#include <linux/device.h>
>
> #define SOUND_STEP 16
>
> -
> struct sound_unit
> {
> int unit_minor;
> @@ -64,9 +116,6 @@ extern int msnd_classic_init(void);
> extern int msnd_pinnacle_init(void);
> #endif
>
> -struct class *sound_class;
> -EXPORT_SYMBOL(sound_class);
> -
> /*
> * Low level list operator. Scan the ordered list, find a hole and
> * join into it. Called with the lock asserted
> @@ -523,31 +572,23 @@ int soundcore_open(struct inode *inode,
> return -ENODEV;
> }
>
> -MODULE_DESCRIPTION("Core sound module");
> -MODULE_AUTHOR("Alan Cox");
> -MODULE_LICENSE("GPL");
> MODULE_ALIAS_CHARDEV_MAJOR(SOUND_MAJOR);
>
> -static void __exit cleanup_soundcore(void)
> +static void __exit cleanup_oss_soundcore(void)
> {
> /* We have nothing to really do here - we know the lists must be
> empty */
> unregister_chrdev(SOUND_MAJOR, "sound");
> - class_destroy(sound_class);
> }
>
> -static int __init init_soundcore(void)
> +static int __init init_oss_soundcore(void)
> {
> if (register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1) {
> printk(KERN_ERR "soundcore: sound device already in use.\n");
> return -EBUSY;
> }
> - sound_class = class_create(THIS_MODULE, "sound");
> - if (IS_ERR(sound_class))
> - return PTR_ERR(sound_class);
>
> return 0;
> }
>
> -module_init(init_soundcore);
> -module_exit(cleanup_soundcore);
> +#endif /* CONFIG_SOUND_OSS_CORE */
> Index: work/arch/um/Kconfig.char
> ===================================================================
> --- work.orig/arch/um/Kconfig.char
> +++ work/arch/um/Kconfig.char
> @@ -203,6 +203,10 @@ config SOUND
> tristate
> default UML_SOUND
>
> +config SOUND_OSS_CORE
> + bool
> + default UML_SOUND
> +
> config HOSTAUDIO
> tristate
> default UML_SOUND
> Index: work/sound/oss/dmasound/Kconfig
> ===================================================================
> --- work.orig/sound/oss/dmasound/Kconfig
> +++ work/sound/oss/dmasound/Kconfig
> @@ -42,3 +42,4 @@ config DMASOUND_Q40
>
> config DMASOUND
> tristate
> + select SOUND_OSS_CORE
>
1
0

27 Aug '08
At Wed, 27 Aug 2008 11:37:44 +0200,
Tejun Heo wrote:
>
> Hello,
>
> Takashi Iwai wrote:
> >> +config SOUND_OSS_CORE
> >> + bool
> >> + default n
> >> +
> >> source "sound/oss/dmasound/Kconfig"
> >
> > This seems missing from the scope.
> > But, I think this should be rather in the block "if SOUND_PRIME" below.
>
> SOUND_OSS_CORE should be turned on if ALSA OSS emul is turned on or
> arch-um hostsound is turned on, both of which can be enabled regardless
> of SOUND_PRIME, no?
Yes, sorry, I didn't cite clearly. I meant only the last line.
sound/oss/dmasound/Kconfig is included and evaluated outside the block
"if SOUND_PRIME". Thus, CONFIG_SOUND_OSS_CORE won't be enabled for
drivers in sound/oss/dmasound.
My suggestion is to move that line source sound/oss/dmasound/Kconfig
into the "if SOUND_PRIME" block first, then apply your patch.
Anyway, there are some other minor issues in sound/Kconfig, for
example, why "if !M68K" is there. We can clean up a bit more.
thanks,
Takashi
1
0

27 Aug '08
At Wed, 27 Aug 2008 10:19:35 +0200,
Tejun Heo wrote:
>
> sound/sound_core.c implements soundcore.ko contains two parts -
> sound_class which is shared by both ALSA and OSS and device
> redirection support for OSS. It's always compiled when any sound
> support is enabled although it's necessary only when OSS (the actual
> one or emulation) is enabled. This is slightly wasteful and as device
> redirection always registers character device region for major 14, it
> prevents alternative implementation.
>
> This patch introduces a new config SOUND_OSS_CORE which is selected
> iff OSS support is actually necessary and build the OSS core part
> conditionally.
>
> If OSS is disabled, soundcore merely contains sound_class but leaving
> it that way seems to be the simplest approach as otherwise sound_class
> should be in ALSA core file if OSS is disabled but should be in
> soundcore if OSS is enabled and there's also the user confusion
> factor.
>
> Signed-off-by: Tejun Heo <tj(a)kernel.org>
Thanks for the patch. I like the idea.
> +config SOUND_OSS_CORE
> + bool
> + default n
> +
> source "sound/oss/dmasound/Kconfig"
This seems missing from the scope.
But, I think this should be rather in the block "if SOUND_PRIME" below.
> --- work.orig/sound/sound_core.c
> +++ work/sound/sound_core.c
(snip)
> +MODULE_ALIAS_CHARDEV_MAJOR(SOUND_MAJOR);
This alias should be in #ifdef CONFIG_SOUND_OSS_CORE.
The module doesn't provide that major without CONFIG_SOUND_OSS_CORE.
Takashi
1
0
At Tue, 26 Aug 2008 23:10:55 +0200,
Guillaume Chazarain wrote:
>
> On Tue, Aug 26, 2008 at 7:59 AM, Takashi Iwai <tiwai(a)suse.de> wrote:
> > Are you sure both are the same kernel but just one commit reverted?
>
> I retested, yes.
Thanks for confirmation!
> With or without the revert, model=auto disables sound completely, and
> I get this in dmesg:
>
> HDA Intel 0000:00:1b.0: PCI INT A disabled
> HDA Intel 0000:00:1b.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
> HDA Intel 0000:00:1b.0: setting latency timer to 64
> ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:2325: hda_codec:
> model 'auto' is selected
> ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3021: autoconfig:
> line_outs=1 (0x14/0x0/0x0/0x0/0x0)
> ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3025:
> speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
> ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3029: hp_outs=1
> (0x15/0x0/0x0/0x0/0x0)
> ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3030: mono: mono_out=0x0
> ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3038: inputs:
> mic=0x18, fmic=0x0, line=0x1a, fline=0x0, cd=0x0, aux=0x0
>
> I played with model=intel-mac-auto and model=intel-mac-v3 but it had
> no effect, i.e. same as without the model= parameter.
>
> So, without model=auto the problem is that I get the output on both
> the internal speakers and the headphones, and this is fixed by
> reverting the commit.
Then this is really a PCI SSID conflict, and reverting the patch is
the right fix (and possibly addition of check of codec SID).
I fixed it now on my tree, and will include it in the next pull
request.
thanks,
Takashi
1
0

[alsa-devel] [PATCH] ASoC: Convert wm8750 to a new-style i2c driver (testers wanted)
by Jean Delvare 26 Aug '08
by Jean Delvare 26 Aug '08
26 Aug '08
Convert the wm8750 codec driver to the new (standard) device driver
binding model.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Cc: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
Warning: this assumes that the spitz has its codec chip on I2C bus 0,
which may or may not be the case. Someone with this machine please
test and report.
Note that you can safely ignore patch failures in i2c-id.h.
include/linux/i2c-id.h | 1
sound/soc/codecs/wm8750.c | 108 ++++++++++++++++++++++-----------------------
sound/soc/codecs/wm8750.h | 1
sound/soc/pxa/spitz.c | 1
4 files changed, 57 insertions(+), 54 deletions(-)
--- linux-2.6.27-rc4.orig/include/linux/i2c-id.h 2008-08-26 16:40:44.000000000 +0200
+++ linux-2.6.27-rc4/include/linux/i2c-id.h 2008-08-26 16:41:12.000000000 +0200
@@ -65,7 +65,6 @@
#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */
#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
-#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8750.c 2008-08-26 15:39:54.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8750.c 2008-08-26 16:01:06.000000000 +0200
@@ -846,83 +846,87 @@ static struct snd_soc_device *wm8750_soc
* low = 0x1a
* high = 0x1b
*/
-static unsigned short normal_i2c[] = { 0, I2C_CLIENT_END };
-/* Magic definition of all other variables and things */
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver wm8750_i2c_driver;
-static struct i2c_client client_template;
-
-static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind)
+static int wm8750_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
{
struct snd_soc_device *socdev = wm8750_socdev;
- struct wm8750_setup_data *setup = socdev->codec_data;
struct snd_soc_codec *codec = socdev->codec;
- struct i2c_client *i2c;
int ret;
- if (addr != setup->i2c_address)
- return -ENODEV;
-
- client_template.adapter = adap;
- client_template.addr = addr;
-
- i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL)
- return -ENOMEM;
-
i2c_set_clientdata(i2c, codec);
- codec->control_data = i2c;
-
- ret = i2c_attach_client(i2c);
- if (ret < 0) {
- pr_err("failed to attach codec at addr %x\n", addr);
- goto err;
- }
ret = wm8750_init(socdev);
- if (ret < 0) {
+ if (ret < 0)
pr_err("failed to initialise WM8750\n");
- goto err;
- }
- return ret;
-err:
- kfree(i2c);
return ret;
}
-static int wm8750_i2c_detach(struct i2c_client *client)
+static int wm8750_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- i2c_detach_client(client);
kfree(codec->reg_cache);
- kfree(client);
return 0;
}
-static int wm8750_i2c_attach(struct i2c_adapter *adap)
-{
- return i2c_probe(adap, &addr_data, wm8750_codec_probe);
-}
+static const struct i2c_device_id wm8750_i2c_id[] = {
+ { "wm8750", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, wm8750_i2c_id);
-/* corgi i2c codec control layer */
static struct i2c_driver wm8750_i2c_driver = {
.driver = {
.name = "WM8750 I2C Codec",
.owner = THIS_MODULE,
},
- .id = I2C_DRIVERID_WM8750,
- .attach_adapter = wm8750_i2c_attach,
- .detach_client = wm8750_i2c_detach,
- .command = NULL,
+ .probe = wm8750_i2c_probe,
+ .remove = wm8750_i2c_remove,
+ .id_table = wm8750_i2c_id,
};
-static struct i2c_client client_template = {
- .name = "WM8750",
- .driver = &wm8750_i2c_driver,
-};
+static int wm8750_add_i2c_device(struct platform_device *pdev,
+ const struct wm8750_setup_data *setup)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct i2c_board_info info;
+ struct i2c_adapter *adapter;
+ struct i2c_client *client;
+ int ret;
+
+ ret = i2c_add_driver(&wm8750_i2c_driver);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "can't add i2c driver\n");
+ return ret;
+ }
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ info.addr = setup->i2c_address;
+ strlcpy(info.type, "wm8750", I2C_NAME_SIZE);
+
+ adapter = i2c_get_adapter(setup->i2c_bus);
+ if (!adapter) {
+ dev_err(&pdev->dev, "can't get i2c adapter %d\n",
+ setup->i2c_bus);
+ goto err_driver;
+ }
+
+ client = i2c_new_device(adapter, &info);
+ i2c_put_adapter(adapter);
+ if (!client) {
+ dev_err(&pdev->dev, "can't add i2c device at 0x%x\n",
+ (unsigned int)info.addr);
+ goto err_driver;
+ }
+ socdev->codec->control_data = client;
+
+ return 0;
+
+err_driver:
+ i2c_del_driver(&wm8750_i2c_driver);
+ return -ENODEV;
+}
#endif
static int wm8750_probe(struct platform_device *pdev)
@@ -954,11 +958,8 @@ static int wm8750_probe(struct platform_
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
- normal_i2c[0] = setup->i2c_address;
codec->hw_write = (hw_write_t)i2c_master_send;
- ret = i2c_add_driver(&wm8750_i2c_driver);
- if (ret != 0)
- printk(KERN_ERR "can't add i2c driver");
+ ret = wm8750_add_i2c_device(pdev, setup);
}
#else
/* Add other interfaces here */
@@ -1002,6 +1003,7 @@ static int wm8750_remove(struct platform
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8750_i2c_driver);
#endif
kfree(codec->private_data);
--- linux-2.6.27-rc4.orig/sound/soc/codecs/wm8750.h 2008-08-26 15:39:54.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/codecs/wm8750.h 2008-08-26 15:48:15.000000000 +0200
@@ -58,6 +58,7 @@
#define WM8750_SYSCLK 0
struct wm8750_setup_data {
+ int i2c_bus;
unsigned short i2c_address;
};
--- linux-2.6.27-rc4.orig/sound/soc/pxa/spitz.c 2008-08-26 15:39:54.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/pxa/spitz.c 2008-08-26 15:48:15.000000000 +0200
@@ -337,6 +337,7 @@ static struct snd_soc_machine snd_soc_ma
/* spitz audio private data */
static struct wm8750_setup_data spitz_wm8750_setup = {
+ .i2c_bus = 0,
.i2c_address = 0x1b,
};
--
Jean Delvare
2
2

[alsa-devel] alsa regression: snd_bt87x mute (not mixer related)
by Jorge Peixoto de Morais Neto 26 Aug '08
by Jorge Peixoto de Morais Neto 26 Aug '08
26 Aug '08
Hi. Under kernel 2.6.23, I could get sound from the alsa device
created by the module snd_bt87x.
In kernel 2.6.24, there is no sound. And yes, I have checked in
alsamixer that the device is not muted.
Also, in kernel 2.6.23 the
device would only appear if I modprobed the module with the option
load_all=1. In kernel 2.6.24, the option load_all=1 is unnecessary for
the device to appear. This is probably because I have in 2007 sent an
email to this list
(http://mailman.alsa-project.org/pipermail/alsa-devel/2007-August/002617.html)
with information about my board, and it was responded by Takashi.
I have tried the latest linux-2.6.27-rc4 hoping the problem could have
been fixed. No improvement.
Could you please look at this? It is an important regression.
I have included extensive information about my system (under
both linux-2.6.23, where my card works, and linux-2.6.27-rc4) in the tarball attached. If you need any
other information please ask me.
Regards,
Jorge Peixoto de Morais Neto
1
0

26 Aug '08
Hi guys,
There was "MIDI on ice1724" thread not-so-recently, and it had a patch
attached. Changelog says that the patch was added to ALSA in 1.0.17.
So I took out my dusty TerraTec PHASE 22 out of the closet (and
removed the dust, of course :-) ), but I can't get MIDI to work there.
Regardless of ALSA version (1.0.15 - 1.0.17, even 1.0.18rc1), I get no
MIDI ports at all:
vedran@kalopsia:~$ amidi -l
Dir Device Name
vedran@kalopsia:~$
Why don't MIDI ports get created? I tried looking at the source, but I
couldn't figure out how this "creation of midi ports" happens (or
doesn't happen, as in this case).
--
Vedran Miletić
3
5

26 Aug '08
Hi,
I am working on an ALSA audio driver for my device which is very similar to
BT878. It will have at least 8 audio devices in a single card. Now, the
audio driver is working correctly. I can use aplay to play the audio file
which is created by arecord. To identify audio devices, I am using hw:1 ~
hw:8 dvice description for my audio devices, because hw:0 is the sound card.
In order to make the old application work, I know that ALSA emulates all my
devices to have OSS nodes respectively. I guess that It should have /dev/dsp
to /dev/dsp8, and /dev/dsp is for sound card, and /dev/dsp1 to /dev/dsp8 are
for my audio devices. However, I can not find /dev/dsp8 in my system. I
guess ALSA can only emulate 8 audio device totally. That the reason I can
not see the 8th audio device. Am I right? How can I create the /dev/dsp8
manually?
By the way, if someting is wrong above, please correct me. Thank you.
2
1
Fix a few issues identified by Jean Delvare:
- Add missing newline to error display.
- Return an error when we fail to locate the I2C adaptor.
- Remove the static wm8903_i2c_device Jean suggested, it's redundant.
Cc: Jean Delvare <khali(a)linux-fr.org>
Signed-off-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm8903.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 73dfd5b..a3f54ec 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1706,8 +1706,6 @@ static struct i2c_driver wm8903_i2c_driver = {
.id_table = wm8903_i2c_id,
};
-static struct i2c_client *wm8903_i2c_device;
-
static int wm8903_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
@@ -1716,6 +1714,7 @@ static int wm8903_probe(struct platform_device *pdev)
struct wm8903_priv *wm8903;
struct i2c_board_info board_info;
struct i2c_adapter *adapter;
+ struct i2c_client *i2c_client;
int ret = 0;
setup = socdev->codec_data;
@@ -1746,7 +1745,7 @@ static int wm8903_probe(struct platform_device *pdev)
codec->hw_write = (hw_write_t)i2c_master_send;
ret = i2c_add_driver(&wm8903_i2c_driver);
if (ret != 0) {
- dev_err(&pdev->dev, "can't add i2c driver");
+ dev_err(&pdev->dev, "can't add i2c driver\n");
goto err_priv;
} else {
memset(&board_info, 0, sizeof(board_info));
@@ -1757,12 +1756,13 @@ static int wm8903_probe(struct platform_device *pdev)
if (!adapter) {
dev_err(&pdev->dev, "Can't get I2C bus %d\n",
setup->i2c_bus);
+ ret = -ENODEV;
goto err_adapter;
}
- wm8903_i2c_device = i2c_new_device(adapter, &board_info);
+ i2c_client = i2c_new_device(adapter, &board_info);
i2c_put_adapter(adapter);
- if (wm8903_i2c_device == NULL) {
+ if (i2c_client == NULL) {
dev_err(&pdev->dev,
"I2C driver registration failed\n");
ret = -ENODEV;
@@ -1792,7 +1792,7 @@ static int wm8903_remove(struct platform_device *pdev)
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
- i2c_unregister_device(wm8903_i2c_device);
+ i2c_unregister_device(socdev->codec->control_data);
i2c_del_driver(&wm8903_i2c_driver);
kfree(codec->private_data);
kfree(codec);
--
1.5.6.5
3
2

26 Aug '08
Two warning messages lack their trailing new-line, add it.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
---
sound/soc/at91/at91-ssc.c | 2 +-
sound/soc/davinci/davinci-i2s.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- linux-2.6.27-rc4.orig/sound/soc/at91/at91-ssc.c 2008-08-13 09:51:02.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/at91/at91-ssc.c 2008-08-26 15:45:11.000000000 +0200
@@ -408,7 +408,7 @@ static int at91_ssc_hw_params(struct snd
dma_params->pdc_xfer_size = 4;
break;
default:
- printk(KERN_WARNING "at91-ssc: unsupported PCM format");
+ printk(KERN_WARNING "at91-ssc: unsupported PCM format\n");
return -EINVAL;
}
--- linux-2.6.27-rc4.orig/sound/soc/davinci/davinci-i2s.c 2008-08-05 18:18:18.000000000 +0200
+++ linux-2.6.27-rc4/sound/soc/davinci/davinci-i2s.c 2008-08-26 15:45:04.000000000 +0200
@@ -256,7 +256,7 @@ static int davinci_i2s_hw_params(struct
mcbsp_word_length = DAVINCI_MCBSP_WORD_32;
break;
default:
- printk(KERN_WARNING "davinci-i2s: unsupported PCM format");
+ printk(KERN_WARNING "davinci-i2s: unsupported PCM format\n");
return -EINVAL;
}
--
Jean Delvare
2
1
Hi Mark,
On Tue, 26 Aug 2008 13:05:27 +0100, Mark Brown wrote:
> The WM8903 is a high performance ultra-low power stereo CODEC optimised
> for portable audio applications. Features include:
>
> * 5mW power consumption for DAC to headphone playback
> * Stereo DAC SNR 96dB typical, THD -86dB typical
> * Stereo ADC SNR 93dB typical, THD -80dB typical
> * Up to 3 single ended inputs per stereo channel
> * Up to 2 pseudo differential inputs per stereo channel
> * Up to 1 fully differential mic input per stereo channel
> * Digital Dynamic Range Controller (compressor/limiter)
> * Digital sidetone mixing
>
> Signed-off-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
> ---
> sound/soc/codecs/Kconfig | 4 +
> sound/soc/codecs/Makefile | 2 +
> sound/soc/codecs/wm8903.c | 1813 +++++++++++++++++++++++++++++++++++++++++++++
> sound/soc/codecs/wm8903.h | 1463 ++++++++++++++++++++++++++++++++++++
> 4 files changed, 3282 insertions(+), 0 deletions(-)
> create mode 100644 sound/soc/codecs/wm8903.c
> create mode 100644 sound/soc/codecs/wm8903.h
Here are minor issues I spotted in the i2c part of your driver:
> (...)
> +static int wm8903_i2c_probe(struct i2c_client *i2c,
> + const struct i2c_device_id *id)
> +{
> + struct snd_soc_device *socdev = wm8903_socdev;
> + struct snd_soc_codec *codec = socdev->codec;
> + int ret;
> +
> + i2c_set_clientdata(i2c, codec);
> + codec->control_data = i2c;
> +
> + ret = wm8903_init(socdev);
> + if (ret < 0)
> + dev_err(&i2c->dev, "Device initialisation failed\n");
> +
> + return ret;
> +}
> +
> +static int wm8903_i2c_remove(struct i2c_client *client)
> +{
> + struct snd_soc_codec *codec = i2c_get_clientdata(client);
> + kfree(codec->reg_cache);
> + return 0;
> +}
> +
> +/* i2c codec control layer */
> +static const struct i2c_device_id wm8903_i2c_id[] = {
> + { "wm8903", 0 },
> + { }
> +};
> +MODULE_DEVICE_TABLE(i2c, wm8903_i2c_id);
> +
> +static struct i2c_driver wm8903_i2c_driver = {
> + .driver = {
> + .name = "WM8903",
> + .owner = THIS_MODULE,
> + },
> + .probe = wm8903_i2c_probe,
> + .remove = wm8903_i2c_remove,
> + .id_table = wm8903_i2c_id,
> +};
> +
> +static struct i2c_client *wm8903_i2c_device;
I know that I am the one who came up with this idea, but on second
thought, wm8903_i2c_device will always be equal to
wm8903_socdev->codec->control_data, so we can easily do without it.
> +
> +static int wm8903_probe(struct platform_device *pdev)
> +{
> + struct snd_soc_device *socdev = platform_get_drvdata(pdev);
> + struct wm8903_setup_data *setup;
> + struct snd_soc_codec *codec;
> + struct wm8903_priv *wm8903;
> + struct i2c_board_info board_info;
> + struct i2c_adapter *adapter;
> + int ret = 0;
> +
> + setup = socdev->codec_data;
> +
> + if (!setup->i2c_address) {
> + dev_err(&pdev->dev, "No codec address provided\n");
> + return -ENODEV;
> + }
> +
> + codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
> + if (codec == NULL)
> + return -ENOMEM;
> +
> + wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL);
> + if (wm8903 == NULL) {
> + ret = -ENOMEM;
> + goto err_codec;
> + }
> +
> + codec->private_data = wm8903;
> + socdev->codec = codec;
> + mutex_init(&codec->mutex);
> + INIT_LIST_HEAD(&codec->dapm_widgets);
> + INIT_LIST_HEAD(&codec->dapm_paths);
> +
> + wm8903_socdev = socdev;
> +
> + codec->hw_write = (hw_write_t)i2c_master_send;
> + ret = i2c_add_driver(&wm8903_i2c_driver);
> + if (ret != 0) {
> + dev_err(&pdev->dev, "can't add i2c driver");
Missing \n at end of string (looks like many other drivers have this
problem - I found 11 other cases under sound/soc, I can send a patch
fixing these if you want.)
> + goto err_priv;
> + } else {
> + memset(&board_info, 0, sizeof(board_info));
> + strlcpy(board_info.type, "wm8903", I2C_NAME_SIZE);
> + board_info.addr = setup->i2c_address;
> +
> + adapter = i2c_get_adapter(setup->i2c_bus);
> + if (!adapter) {
> + dev_err(&pdev->dev, "Can't get I2C bus %d\n",
> + setup->i2c_bus);
> + goto err_adapter;
You are jumping to the error path but ret has value 0. This means that
the function returns success when you really mean failure, and trouble
is likely to arise after that.
> + }
> +
> + wm8903_i2c_device = i2c_new_device(adapter, &board_info);
> + i2c_put_adapter(adapter);
> + if (wm8903_i2c_device == NULL) {
> + dev_err(&pdev->dev,
> + "I2C driver registration failed\n");
> + ret = -ENODEV;
> + goto err_adapter;
> + }
> + }
> +
> + return ret;
> +
> +err_adapter:
> + i2c_del_driver(&wm8903_i2c_driver);
> +err_priv:
> + kfree(codec->private_data);
> +err_codec:
> + kfree(codec);
> + return ret;
> +}
--
Jean Delvare
3
3

[alsa-devel] [PATCH] ASoC: Fix error paths in N810 machine driver init and release clocks at exit
by Jarkko Nikula 26 Aug '08
by Jarkko Nikula 26 Aug '08
26 Aug '08
Thanks to Felipe Balbi <felipe.balbi(a)nokia.com> by noticing that if clk_get
to sys_clkout2_src fails, then n810_snd_device is never released.
Add also sys_clkout2_src release into error path, error code return and
release the clocks at exit.
Signed-off-by: Jarkko Nikula <jarkko.nikula(a)nokia.com>
---
sound/soc/omap/n810.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 7694621..87d0ed0 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -329,12 +329,14 @@ static int __init n810_soc_init(void)
sys_clkout2_src = clk_get(dev, "sys_clkout2_src");
if (IS_ERR(sys_clkout2_src)) {
dev_err(dev, "Could not get sys_clkout2_src clock\n");
- return -ENODEV;
+ err = PTR_ERR(sys_clkout2_src);
+ goto err2;
}
sys_clkout2 = clk_get(dev, "sys_clkout2");
if (IS_ERR(sys_clkout2)) {
dev_err(dev, "Could not get sys_clkout2\n");
- goto err1;
+ err = PTR_ERR(sys_clkout2);
+ goto err3;
}
/*
* Configure 12 MHz output on SYS_CLKOUT2. Therefore we must use
@@ -343,7 +345,8 @@ static int __init n810_soc_init(void)
func96m_clk = clk_get(dev, "func_96m_ck");
if (IS_ERR(func96m_clk)) {
dev_err(dev, "Could not get func 96M clock\n");
- goto err2;
+ err = PTR_ERR(func96m_clk);
+ goto err4;
}
clk_set_parent(sys_clkout2_src, func96m_clk);
clk_set_rate(sys_clkout2, 12000000);
@@ -356,20 +359,25 @@ static int __init n810_soc_init(void)
gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0);
return 0;
-err2:
+err4:
clk_put(sys_clkout2);
+err3:
+ clk_put(sys_clkout2_src);
+err2:
platform_device_del(n810_snd_device);
err1:
platform_device_put(n810_snd_device);
return err;
-
}
static void __exit n810_soc_exit(void)
{
gpio_free(N810_SPEAKER_AMP_GPIO);
gpio_free(N810_HEADSET_AMP_GPIO);
+ clk_put(sys_clkout2_src);
+ clk_put(sys_clkout2);
+ clk_put(func96m_clk);
platform_device_unregister(n810_snd_device);
}
--
1.5.6.3
3
2

[alsa-devel] [PATCH] ASoC: Fix double free and memory leak in many codec drivers
by Mark Brown 26 Aug '08
by Mark Brown 26 Aug '08
26 Aug '08
From: Jean Delvare <khali(a)linux-fr.org>
Many SoC audio codec drivers have improper freeing of memory in error
paths.
* codec is allocated in the platform device probe function, but is not
freed there in case of error. Instead it is freed in the i2c device
probe function's error path. However the success or failure of both
functions is not linked, so this could result in a double free (if
the platform device is successfully probed, the i2c device probing
fails and then the platform driver is unregistered.)
* codec->private_data is allocated in many platform device probe
functions but not freed in their error paths.
This patch hopefully solves all these problems.
Signed-off-by: Jean Delvare <khali(a)linux-fr.org>
Signed-off-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/ak4535.c | 11 +++++++----
sound/soc/codecs/tlv320aic3x.c | 11 +++++++----
sound/soc/codecs/uda1380.c | 9 +++++----
sound/soc/codecs/wm8510.c | 9 +++++----
sound/soc/codecs/wm8731.c | 11 +++++++----
sound/soc/codecs/wm8750.c | 10 ++++++----
sound/soc/codecs/wm8753.c | 11 +++++++----
sound/soc/codecs/wm8990.c | 11 +++++++----
8 files changed, 51 insertions(+), 32 deletions(-)
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index b26003c..7da9f46 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -562,10 +562,9 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -583,7 +582,6 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -660,6 +658,11 @@ static int ak4535_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index b1dce5f..5f9abb1 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1199,10 +1199,9 @@ static int aic3x_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -1221,7 +1220,6 @@ static int aic3x_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -1302,6 +1300,11 @@ static int aic3x_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index a52d6d9..807318f 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -729,10 +729,9 @@ static int uda1380_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -750,7 +749,6 @@ static int uda1380_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -817,6 +815,9 @@ static int uda1380_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0)
+ kfree(codec);
return ret;
}
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c
index 67325fd..3d998e6 100644
--- a/sound/soc/codecs/wm8510.c
+++ b/sound/soc/codecs/wm8510.c
@@ -693,10 +693,9 @@ static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -714,7 +713,6 @@ static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -782,6 +780,9 @@ static int wm8510_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0)
+ kfree(codec);
return ret;
}
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 369d39c..9402fca 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -596,10 +596,9 @@ static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -617,7 +616,6 @@ static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -693,6 +691,11 @@ static int wm8731_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index c6a8edf..dd1f554 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -869,10 +869,9 @@ static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -890,7 +889,6 @@ static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -966,6 +964,10 @@ static int wm8750_probe(struct platform_device *pdev)
/* Add other interfaces here */
#endif
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index dc7b18f..5761164 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1660,10 +1660,9 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (!i2c) {
- kfree(codec);
+ if (!i2c)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -1682,7 +1681,6 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -1759,6 +1757,11 @@ static int wm8753_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index e44153f..dd995ef 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1500,10 +1500,9 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -1521,7 +1520,6 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -1595,6 +1593,11 @@ static int wm8990_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}
--
1.5.6.3
4
4

Re: [alsa-devel] [Alsa-user] Sound card recording support @ 96kHz or above
by Vedran Miletić 26 Aug '08
by Vedran Miletić 26 Aug '08
26 Aug '08
Terrasoniq TS22 (newer revision of TerraTec PHASE 22) might do it for
you. Almost anything Envy24-series based will offer what you want.
Not sure how you would check that it actually works, though.
2008/8/26 Ben Gould <ben.gould(a)gmail.com>:
> These cards don't seem to be in production any more.
>
> Any suggestions for more recent off-the-shelf hardware that will capture
> a single stereo input at 96kHz (using ALSA)?
>
> -- ben
>
> Sergei Steshenko wrote:
>>
>> -----Original Message-----
>> From: Ben Gould <ben.gould(a)gmail.com>
>> To: alsa-user(a)lists.sourceforge.net
>> Date: Thu, 21 Aug 2008 16:57:43 +0059
>> Subject: [Alsa-user] Sound card recording support @ 96kHz or above
>>
>>> Hi all,
>>>
>>> A project I'm working on using linux & alsa requires a higher than
>>> normal sampling rate, not just up-sampling from 48kHz.
>>>
>>> I wonder whether anyone here can recommend a sound card that's capable
>>> of recording a single stereo input at 96kHz sample rate (16 bits would
>>> be sufficient).
>>>
>>> Obviously it needs to be properly supported by alsa...
>>>
>>> Thanks in advance
>>>
>>> -- ben
>>>
>>
>> M-Audio Revolution 7.1, 5.1.
>>
>> Regards,
>> Sergei.
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Alsa-user mailing list
> Alsa-user(a)lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>
--
Vedran Miletić
2
1

[alsa-devel] Commit 2a3fdf2e7bbeae557b4a1ee64c071ae4c3c561e5 makes unable to compile ca106 module
by Vedran Miletić 26 Aug '08
by Vedran Miletić 26 Aug '08
26 Aug '08
Here's a proper patch:
--- a/pci/ca0106/ca0106_main.c
+++ b/pci/ca0106/ca0106_main.c
@@ -249,11 +249,12 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
.name = "MSI K8N Diamond MB [SB0438]",
.gpio_type = 2,
.i2c_adc = 1 } ,
- /* Another MSI K8N Diamond MB, which has apprently a different SSID */
+ /* MSI K8N Diamond PLUS MB */
{ .serial = 0x10091102,
.name = "MSI K8N Diamond MB",
.gpio_type = 2,
- .i2c_adc = 1 } ,
+ .i2c_adc = 1,
+ .spi_dac = 2 } ,
/* Shuttle XPC SD31P which has an onboard Creative Labs
* Sound Blaster Live! 24-bit EAX
* high-definition 7.1 audio processor".
The comma was missing after .spi_dac line.
--
Vedran Miletić
2
1
Takashi,
Now I can build and install driver for ca0106 sb Audigy but I got another
issue when play an example file.
>> aplay -vv child.wav
Playing WAVE '/root/child.wav' : Unsigned 8 bit, Rate 22050 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=U8)
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : U8
subformat : STD
channels : 1
rate : 22050
exact rate : 22050 (22050/1)
msbits : 8
buffer_size : 3763
period_size : 470
period_time : 21333
tstamp_mode : NONE
period_step : 1
avail_min : 470
period_event : 0
start_threshold : 3763
stop_threshold : 3763
silence_threshold: 0
silence_size : 0
boundary : 493223936
Slave: Route conversion PCM (sformat=S32_LE)
Transformation table:
0 <- 0
1 <- 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : U8
subformat : STD
channels : 1
rate : 48000
exact rate : 48000 (48000/1)
msbits : 8
buffer_size : 8192
period_size : 1024
period_time : 21333
tstamp_mode : NONE
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 8192
stop_threshold : 8192
silence_threshold: 0
silence_size : 0
boundary : 1073741824
Slave: Direct Stream Mixing PCM
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S32_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 32
buffer_size : 8192
period_size : 1024
period_time : 21333
tstamp_mode : NONE
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 8192
stop_threshold : 8192
silence_threshold: 0
silence_size : 0
boundary : 1073741824
Hardware PCM card 0 'CA0106' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S32_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 32
buffer_size : 8192
period_size : 1024
period_time : 21333
tstamp_mode : ENABLE
period_step : 1
avail_min : 1024
period_event : 0
start_threshold : 1
stop_threshold : 1073741824
silence_threshold: 0
silence_size : 1073741824
boundary : 1073741824
######### + | 35%Segmentation fault
Kernel dump message
>> dmesg
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc0033fd4
Oops: Kernel access of bad area, sig: 11 [#7]
Canyonlands
Modules linked in: snd_seq_midi snd_ca0106 snd_rawmidi snd_seq_oss
snd_seq_midi_event snd_seq snd_seq_device snd_ac97_codec snd_pcm_oss
snd_mixer_oss snd_pcm snd_timer snd_page_alloc snd ac97_bus
NIP: c0033fd4 LR: c004ac94 CTR: e901a6c8
REGS: dfbf3d40 TRAP: 0300 Tainted: G D
(2.6.26-00015-gc0b03c1-dirty)
MSR: 00029000 <EE,ME> CR: 48022444 XER: 20000000
DEAR: 00000000, ESR: 00000000
TASK = dfa57000[15245] 'aplay' THREAD: dfbf2000
GPR00: c004ac94 dfbf3df0 dfa57000 00000000 c0b2c180 00000000 3f10c149
00000000
GPR08: 00000000 00000000 9e370001 c030b10c 00000149 10025478 1000bd14
bff7ab68
GPR16: c0320000 c030ae74 c0320000 00000000 00000000 00000000 00000000
de14c340
GPR24: 4814b000 00000000 dfbf2000 de00c2c0 c0b2c180 00000000 00000000
c0b2c180
NIP [c0033fd4] __wake_up_bit+0x10/0x40
LR [c004ac94] unlock_page+0x48/0x5c
Call Trace:
[dfbf3e10] [c004ac94] unlock_page+0x48/0x5c
[dfbf3e20] [c005a2d8] __do_fault+0x254/0x618
[dfbf3e80] [c000faf0] do_page_fault+0x2d8/0x518
[dfbf3f40] [c000d134] handle_page_fault+0xc/0x80
Instruction dump:
7d6b4a14 800b0280 812b0278 20000020 7c630430 54631838 7c634a14 4e800020
7c0802a6 9421ffe0 90810008 90010024 <80030000> 90a1000c 7f801800 419e0014
---[ end trace a0b9d3bfbd44991b ]---
I tried with another example file.wav but the problem is the same.
The issue seems from accessing memory.
I'm using AMCC 460EX board with distribution Ubuntu-7.04
Feel free to help me.
Thanks,
TaiNguyen.
I tried with another wav
On Mon, Aug 18, 2008 at 9:52 AM, nguyen tritai <nguyentritai(a)gmail.com>wrote:
> Hi Takashi,
>
> Thank for your help. I checked in the config.log as you told me and see
> that the issue is from the linux-header .
> I'm now working on it.
>
> Thanks,
>
> TaiNguyen
>
>
> On Thu, Aug 14, 2008 at 8:49 PM, Takashi Iwai <tiwai(a)suse.de> wrote:
>
>> At Thu, 14 Aug 2008 16:25:24 +0700,
>> nguyen tritai wrote:
>> >
>> > Hi all,
>> >
>> > I'm trying to bring up audio on powerpc AMCC 440EPX board with the
>> soundcard
>> > Sound Blaster Audigy CA0106.
>> > The board is runing Ubuntu 7.04.
>> > I configured: ./configure --with-cards=ca0106 --with-sequencer=yes
>> > --with-kernel=/usr/src/linux
>> > Then I make and get issue:
>> >
>> > make[2]: Leaving directory `/root/alsa-driver-1.0.17/usb'
>> > make[2]: Entering directory `/root/alsa-driver-1.0.17/misc'
>> > make[2]: Leaving directory `/root/alsa-driver-1.0.17/misc'
>> > make[1]: Leaving directory `/root/alsa-driver-1.0.17'
>> > make -C /usr/src/linux SUBDIRS=/root/alsa-driver-1.0.17 CPP="gcc -E"
>> > CC="gcc" modules
>> > make[1]: Entering directory `/usr/src/linux'
>> > CC [M] /root/alsa-driver-1.0.17/acore/memory_wrapper.o
>> > make[1]: Leaving directory `/usr/src/linux'
>> > root@sequoia:~/alsa-driver-1.0.17# vim log
>> > In file included from
>> /root/alsa-driver-1.0.17/acore/memory_wrapper.c:25:
>> > /root/alsa-driver-1.0.17/include/adriver.h:278:1: warning: "GFP_DMA32"
>> > redefined
>> > In file included from include/linux/slab.h:14,
>> > from include/linux/percpu.h:5,
>> > from include/linux/rcupdate.h:41,
>> > from include/linux/pid.h:4,
>> > from include/linux/sched.h:76,
>> > from /root/alsa-driver-1.0.17/include/asm/elf.h:5,
>> > from include/linux/elf.h:7,
>> > from include/linux/module.h:14,
>> > from /root/alsa-driver-1.0.17/include/adriver.h:26,
>> > from
>> /root/alsa-driver-1.0.17/acore/memory_wrapper.c:25:
>> > include/linux/gfp.h:105:1: warning: this is the location of the previous
>> > definition
>>
>> This means that configure script didn't detect the things correctly.
>> Doesn't the snapshot version work, too?
>> If no, check config.log about the relevant part checking DMA32.
>>
>>
>> Takashi
>>
>
>
2
7
On Mon, 25 Aug 2008, Sean McNamara wrote:
> Glad to hear it, Jaroslav! That's much easier than checking out from GIT.
>
> If these are automatically updated, any idea how frequently the
> packages will be regenerated? Is it after every commit, or only at
> particular time intervals?
You can grab the latest code immediately after commit to GIT repository
(but generation of new package takes awhile as mentioned on page when it's
not built on server already). The package generation is triggered from the
web server by users requesting latest package immediately.
Jaroslav
-----
Jaroslav Kysela <perex(a)perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
1
0
At Fri, 22 Aug 2008 19:08:29 +0200 (CEST),
Vaclav Peroutka wrote:
>
> Hello Mr. Takashi,
>
> I tried to compile alsa-driver-snapshot from the page you advised me. But the problem was the same. I am sending you configure.log and make.log files. Hopefully they will clarify the problem.
>
> I still have problem with mts64.c.
OK, I see the problem, too.
As a temporary workaround, you can change alsa-driver/kconfig-vers.
This is a list of the least kernel version for some drivers, and mts64
is there, too. Change the version to 2.6.26 or such, so that it won't
be built for your kernel.
Meanwhile, I'll try to fix the problem in the upstream.
thanks,
Takashi
>
> Can you help me please ?
>
> Thank you in advance,
> Vaclav
>
> > ------------ Původní zpráva ------------
> > Od: Takashi Iwai <tiwai(a)suse.de>
> > Předmět: Re: [alsa-devel] Compilation of Alsa 1.0.17 on Suse10 crashes
> > Datum: 22.8.2008 08:27:13
> > ----------------------------------------
> > At Thu, 21 Aug 2008 23:59:14 +0200 (CEST),
> > Vaclav Peroutka wrote:
> > >
> > > Hello all,
> > >
> > > I downloaded alsa-driver-1.0.17 and tried to compile it. I started with
> > "./configure --with-suse=auto --with-oss=yes --with-cards=all,mts64=n" and then
> > "make".
> > >
> > > But I always get following:
> > > ...
> > > CC [M] /tmp/alsa-driver-1.0.17/drivers/mts64.o
> > > /tmp/alsa-driver-1.0.17/drivers/mts64.c: In function ‘snd_mts64_attach’:
> > > /tmp/alsa-driver-1.0.17/drivers/mts64.c:896: error: implicit declaration of
> > function ‘platform_device_alloc’
> > > /tmp/alsa-driver-1.0.17/drivers/mts64.c:896: warning: assignment makes pointer
> > from integer without a cast
> > > /tmp/alsa-driver-1.0.17/drivers/mts64.c:903: error: implicit declaration of
> > function ‘platform_device_add’
> > > /tmp/alsa-driver-1.0.17/drivers/mts64.c:904: error: implicit declaration of
> > function ‘platform_device_put’
> > > make[4]: *** [/tmp/alsa-driver-1.0.17/drivers/mts64.o] Error 1
> > > make[3]: *** [/tmp/alsa-driver-1.0.17/drivers] Error 2
> > > make[2]: *** [_module_/tmp/alsa-driver-1.0.17] Error 2
> > > make[1]: *** [modules] Error 2
> > > make[1]: Leaving directory `/usr/src/linux-2.6.13-15'
> > >
> > > My GCC:
> > > > gcc --version
> > > gcc (GCC) 4.0.2 20050901 (prerelease) (SUSE Linux)
> > >
> > > Is there something missing ? What should I do now ?
> >
> > Use the later version, at best, the daily snapshot tarball
> > http://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/
> >
> > Or, you can try alsa-driver-kmp on standard SUSE systems.
> > http://download.opensuse.org/repositories/multimedia:/audio:/KMP/
> >
> > Check openSUSE Wiki SDB:AudioTroubleshooting for details.
> >
> >
> > Takashi
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel(a)alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> >
> >
> >
1
0
At Tue, 26 Aug 2008 00:43:59 +0200,
Guillaume Chazarain wrote:
>
> On Mon, Aug 25, 2008 at 11:36 PM, Guillaume Chazarain <guichaz(a)gmail.com> wrote:
> > On Mon, Aug 25, 2008 at 7:50 AM, Takashi Iwai <tiwai(a)suse.de> wrote:
> >> I guess it's fixed as well by passing model=auto?
> >
> > Indeed that works too.
>
> I spoke too soon, with model=auto I get back the "Front" mixer that I
> used during the git bisection to find the culprit, but I get no sound
> at all in the plugged in headphones or the internal speakers.
This is odd.
Are you sure both are the same kernel but just one commit reverted?
Takashi
1
0
What is the state of audio in Linux?
How does it compare against other operating systems?
Is the Linux audio functionality good or bad?
What could be better?
What is planned for the future?
3
2

[alsa-devel] Sound Blaster Audigy (snd_ca0106 Creative Labs|SB Audigy LS): How to use the mixer?
by Colin Guthrie 25 Aug '08
by Colin Guthrie 25 Aug '08
25 Aug '08
Hi,
Just trying to help a user with a problem and it seems to be down to the
fact that his SB Audigy LS does not have a "Master" or "PCM" mixer control.
I asked Lennart about this and he told that Takashi said he wanted to
make sure that all devices have at least a Master vol control.
This one doesn't!
Please let me know what you need in order to fix this.
This is with 1.0.17... I can't see anything in the changelog that would
suggest this is fixed in the 1.0.18rc1.
Please let me know if you need e.g. PCI ids etc. as I can ask the user
to provide these.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
Simple mixer control 'Line in',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 255
Front Left: Capture 255 [100%] [24.00dB]
Front Right: Capture 255 [100%] [24.00dB]
Simple mixer control 'Mic',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 255
Front Left: Capture 255 [100%] [24.00dB]
Front Right: Capture 255 [100%] [24.00dB]
Simple mixer control 'Phone',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 255
Front Left: Capture 207 [81%] [0.00dB]
Front Right: Capture 207 [81%] [0.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Center/LFE',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB]
Front Right: Playback 255 [100%] [12.00dB]
Simple mixer control 'IEC958 Front',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB]
Front Right: Playback 255 [100%] [12.00dB]
Simple mixer control 'IEC958 Rear',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB]
Front Right: Playback 255 [100%] [12.00dB]
Simple mixer control 'IEC958 Unknown',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB]
Front Right: Playback 255 [100%] [12.00dB]
Simple mixer control 'Aux',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 255
Front Left: Capture 207 [81%] [0.00dB]
Front Right: Capture 207 [81%] [0.00dB]
Simple mixer control 'Analog Center/LFE',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB] [on]
Front Right: Playback 255 [100%] [12.00dB] [on]
Simple mixer control 'Analog Front',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB] [on]
Front Right: Playback 255 [100%] [12.00dB] [on]
Simple mixer control 'Analog Rear',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB] [on]
Front Right: Playback 255 [100%] [12.00dB] [on]
Simple mixer control 'Analog Side',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB] [on]
Front Right: Playback 255 [100%] [12.00dB] [on]
Simple mixer control 'Analog Source',0
Capabilities: cenum
Items: 'Phone' 'Mic' 'Line in' 'Aux'
Item0: 'Line in'
Simple mixer control 'CAPTURE feedback',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [12.00dB]
Front Right: Playback 255 [100%] [12.00dB]
Simple mixer control 'Digital Source',0
Capabilities: cenum
Items: 'IEC958 out' 'i2s mixer out' 'IEC958 in' 'i2s in' 'AC97 in' 'SRC out'
Item0: 'i2s in'
Simple mixer control 'Shared Mic/Line in',0
Capabilities: cenum
Items: 'Line in' 'Mic in'
Item0: 'Line in'
2
3
Hi all,
finally, I made possible to download a very fresh ALSA code in
tarballs from our repository - http://www.alsa-project.org/snapshot/ .
Users can get the recent code immediately now. There is no reason to wait
a day or so after commit to the GIT repository now.
Jaroslav
-----
Jaroslav Kysela <perex(a)perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
1
0
Makes Audio > 2.0 work on the VIA vt1618 7.1 Channel AC97 Codec
Patched against ALSA-GIT Fri Aug 22 16:24:52 PDT 2008
Authored-by: John L. Utz III john.utz(a)dmx.com
Signed-off-by: John L. Utz III john.utz(a)dmx.com
diff --git a/pci/ac97/ac97_codec.c b/pci/ac97/ac97_codec.c
index d0023e9..89f3050 100644
--- a/pci/ac97/ac97_codec.c
+++ b/pci/ac97/ac97_codec.c
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[]
= {
{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232
with S/PDIF
{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified
VT1616 with S/PDIF
-{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL },
+{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL },
{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03,
NULL},
@@ -609,7 +609,6 @@ AC97_SINGLE("PC Speaker Playback Volume",
AC97_PC_BEEP, 1, 15, 1)
static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
-
static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line",
"Mix", "Mix Mono", "Phone"};
static const char* std_3d_path[] = {"pre 3D", "post 3D"};
static const char* std_mix[] = {"Mix", "Mic"};
diff --git a/pci/ac97/ac97_patch.c b/pci/ac97/ac97_patch.c
index bb028f8..24f1e98 100644
--- a/pci/ac97/ac97_patch.c
+++ b/pci/ac97/ac97_patch.c
@@ -3465,7 +3465,7 @@ static int patch_vt1616(struct snd_ac97 * ac97)
/*
* unfortunately, the vt1617a stashes the twiddlers required for
- * nooding the i/o jacks on 2 different regs. * thameans that we cant
+ * noodling the i/o jacks on 2 different regs. that means that we cant
* use the easy way provided by AC97_ENUM_DOUBLE() we have to write
* are own funcs.
*
@@ -3498,7 +3498,7 @@ static int snd_ac97_vt1617a_smart51_get(struct
snd_kcontrol *kcontrol,
pac97 = snd_kcontrol_chip(kcontrol); /* grab codec handle */
- /* grab our desirec bits, then mash them together in a manner
+ /* grab our desired bits, then mash them together in a manner
* consistent with Table 6 on page 17 in the 1617a docs */
usSM51 = snd_ac97_read(pac97, 0x7a) >> 14;
@@ -3576,6 +3576,200 @@ int patch_vt1617a(struct snd_ac97 * ac97)
return err;
}
+/* VIA VT1618 8 CHANNEL AC97 CODEC */
+
+/* config aux in jack - not found on 3 jack motherboards or soundcards */
+
+static int snd_ac97_vt1618_aux_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char *acTxtAux[] = {"Aux In", "Back Surr Out"};
+
+ return ac97_enum_text_info(kcontrol, uinfo, acTxtAux, 2);
+}
+
+static int snd_ac97_vt1618_aux_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.enumerated.item[0] =
+ (snd_ac97_read(snd_kcontrol_chip(kcontrol), 0x5c) & 0x0008)>>3;
+ return 0;
+}
+
+static int snd_ac97_vt1618_aux_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ /* toggle surround rear dac power */
+
+ snd_ac97_update_bits(snd_kcontrol_chip(kcontrol), 0x5c, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+
+ /* toggle aux in surround rear out jack */
+
+ return snd_ac97_update_bits(snd_kcontrol_chip(kcontrol), 0x76, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/*
+ * VIA implements 'Smart 5.1' completely differently on the 1618 than
+ * it does on the 1617a. awesome! They seem to have sourced this
+ * particular revision of the technology from somebody else, it's
+ * called Universal Audio Jack and it shows up on some other folk's chips
+ * as well.
+ *
+ * ordering in this list reflects vt1618 docs for Reg 60h and
+ * the block diagram, DACs are as follows:
+ *
+ * OUT_O -> Front,
+ * OUT_1 -> Surround,
+ * OUT_2 -> C/LFE
+ *
+ * Unlike the 1617a, each OUT has a consistent set of mappings
+ * for all bitpatterns other than 00:
+ *
+ * 01 Unmixed Output
+ * 10 Line In
+ * 11 Mic In
+ *
+ * Special Case of 00:
+ *
+ * OUT_0 Mixed Output
+ * OUT_1 Reserved
+ * OUT_2 Reserved
+ *
+ * I have no idea what the hell Reserved does, but on an MSI
+ * CN700T, i have to set it to get surround output - YMMV, bad
+ * shit may happen.
+ *
+ * If other chips use Universal Audio Jack, then this code might be
+ * applicable to them.
+ */
+
+static int snd_ac97_vt1618_UAJ_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ /* cribbed from ac97_surround_jack_mode_info() ordering in these lists
+ * reflects vt1618 docs for Vendor Defined Register 0x60 */
+
+ static const char *acTxtUAJ0[] =
+ { "Speaker Out", "DAC Unmixed Out", "Line In", "Mic In"};
+
+ static const char *acTxtUAJ1[] =
+ { "Surround Out", "DAC Unmixed Out", "Line In", "Mic In"};
+
+ static const char *acTxtUAJ2[] =
+ { "Center LFE Out", "DAC Unmixed Out", "Line In", "Mic In"};
+
+ const char **ppacTxt = acTxtUAJ0;
+
+ if (0x000C == kcontrol->private_value)
+ ppacTxt = acTxtUAJ1;
+
+ if (0x0030 == kcontrol->private_value)
+ ppacTxt = acTxtUAJ2;
+
+ return ac97_enum_text_info(kcontrol, uinfo, ppacTxt, 4);
+}
+
+/* All of the vt1618 Universal Audio Jack twiddlers are on
+ Vendor Defined Register 0x60, page 0. The bits, and thus
+ the mask, are the only thing that changes */
+
+static int snd_ac97_vt1618_UAJ_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ unsigned short usDatPag, usUAJ, usShift = 0;
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ if (0x000C == kcontrol->private_value)
+ usShift = 2;
+
+ if (0x0030 == kcontrol->private_value)
+ usShift = 4;
+
+ mutex_lock(&pac97->page_mutex);
+
+ usDatPag = snd_ac97_read(pac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0);
+
+ usUAJ = snd_ac97_read(pac97, 0x60) & kcontrol->private_value;
+
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, usDatPag);
+ mutex_unlock(&pac97->page_mutex);
+
+ ucontrol->value.enumerated.item[0] = usUAJ >> usShift;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_UAJ_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ unsigned short usSft = 0;
+
+ if (0x000C == kcontrol->private_value)
+ usSft = 2;
+
+ if (0x0030 == kcontrol->private_value)
+ usSft = 4;
+
+ /* UAJ1 and UAJ2 are not supposed to have 00 written to them?? i
+ * dunno, because thats something that i have to do to get 5.1 out to
+ * work. */
+
+ return ac97_update_bits_page(snd_kcontrol_chip(kcontrol),
+ 0x60, kcontrol->private_value,
+ ucontrol->value.enumerated.item[0]<<usSft,
+ 0);
+}
+
+static const struct snd_kcontrol_new snd_ac97_controls_vt1618[] = {
+ AC97_SINGLE("Exchange Center/LFE", 0x5a, 8, 1, 0),
+ AC97_SINGLE("DC Offset", 0x5a, 10, 1, 0),
+ AC97_SINGLE("Soft Mute", 0x5c, 0, 1, 1),
+ AC97_SINGLE("Headphone Amp", 0x5c, 5, 1, 1),
+ AC97_DOUBLE("Back Surr Volume", 0x5e, 8, 0, 31, 1),
+ AC97_SINGLE("Back Surr Switch", 0x5e, 15, 1, 1),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux Jack",
+ .info = snd_ac97_vt1618_aux_info,
+ .get = snd_ac97_vt1618_aux_get,
+ .put = snd_ac97_vt1618_aux_put,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Speaker Jack",
+ .info = snd_ac97_vt1618_UAJ_info,
+ .get = snd_ac97_vt1618_UAJ_get,
+ .put = snd_ac97_vt1618_UAJ_put,
+ .private_value = 0x0003
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line Jack",
+ .info = snd_ac97_vt1618_UAJ_info,
+ .get = snd_ac97_vt1618_UAJ_get,
+ .put = snd_ac97_vt1618_UAJ_put,
+ .private_value = 0x000C
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic Jack",
+ .info = snd_ac97_vt1618_UAJ_info,
+ .get = snd_ac97_vt1618_UAJ_get,
+ .put = snd_ac97_vt1618_UAJ_put,
+ .private_value = 0x0030
+ },
+};
+
+int patch_vt1618(struct snd_ac97 *ac97)
+{
+ return patch_build_controls(ac97, snd_ac97_controls_vt1618,
+ ARRAY_SIZE(snd_ac97_controls_vt1618));
+}
+
/*
*/
static void it2646_update_jacks(struct snd_ac97 *ac97)
2
1
When attempting to leverage existing ALSA AC97 infrastructure, i realized
that the existing infrastructure does not account for the 'prosumer-y'
concept of repurposing ALL of the jacks as input, including the speaker.
The vt1618 can use any of it's jacks as mic in or line in. if all of them
are set to be inputs, then ac97_channel_mode_info() needs to return "Och"
because there would be no output channels.
that would imply that ac97->channel_mode would equal 0, yes?
tnx for any input you can provide.
2
1

25 Aug '08
Previously i posted a patch for a new ssid for the onboard ca0106 on the K8N
Diamond motherboard. Now, it is apparently really called a 'K8N Diamond
PLUS', and also requires the gpio_type to be changed too.
Attached is a patch for this.
Changelog: Correct a previous patch for the ca0106 onboard the MSI K8N Diamond
PLUS motherboard. Confirmed to have Line/Mic/Aux working for input, and sound
output working as expected.
Signed-off-by: Travis Place <wishie(a)wishie.net>
2
2

25 Aug '08
2
1

25 Aug '08
From: Krzysztof Helt <krzysztof.h1(a)wp.pl>
Use the wss_dout function which does not mess
shadowed register values during chip probing.
Otherwise, user ends up with stupid mixer settings
after driver loading.
Signed-off-by: Krzysztof Helt <krzysztof.h1(a)wp.pl>
---
Especially, the recording settings are messed up like
left channel recording from different source than
right channel.
diff -urp linux-ref/sound/isa/wss/wss_lib.c linux-2.6/sound/isa/wss/wss_lib.c
--- linux-ref/sound/isa/wss/wss_lib.c 2008-08-14 00:05:30.000000000 +0200
+++ linux-2.6/sound/isa/wss/wss_lib.c 2008-08-25 21:13:14.000000000 +0200
@@ -1162,9 +1162,9 @@ static int snd_ad1848_probe(struct snd_w
spin_lock_irqsave(&chip->reg_lock, flags);
/* set CS423x MODE 1 */
- snd_wss_out(chip, CS4231_MISC_INFO, 0);
+ snd_wss_dout(chip, CS4231_MISC_INFO, 0);
- snd_wss_out(chip, CS4231_RIGHT_INPUT, 0x45); /* 0x55 & ~0x10 */
+ snd_wss_dout(chip, CS4231_RIGHT_INPUT, 0x45); /* 0x55 & ~0x10 */
r = snd_wss_in(chip, CS4231_RIGHT_INPUT);
if (r != 0x45) {
/* RMGE always high on AD1847 */
@@ -1174,7 +1174,7 @@ static int snd_ad1848_probe(struct snd_w
}
hardware = WSS_HW_AD1847;
} else {
- snd_wss_out(chip, CS4231_LEFT_INPUT, 0xaa);
+ snd_wss_dout(chip, CS4231_LEFT_INPUT, 0xaa);
r = snd_wss_in(chip, CS4231_LEFT_INPUT);
/* L/RMGE always low on AT2320 */
if ((r | CS4231_ENABLE_MIC_GAIN) != 0xaa) {
@@ -1199,7 +1199,7 @@ static int snd_ad1848_probe(struct snd_w
r = snd_wss_in(chip, CS4231_MISC_INFO);
/* set CS423x MODE 2 */
- snd_wss_out(chip, CS4231_MISC_INFO, CS4231_MODE2);
+ snd_wss_dout(chip, CS4231_MISC_INFO, CS4231_MODE2);
for (i = 0; i < 16; i++) {
if (snd_wss_in(chip, i) != snd_wss_in(chip, 16 + i)) {
/* we have more than 16 registers: check ID */
@@ -1221,7 +1221,7 @@ static int snd_ad1848_probe(struct snd_w
else
chip->hardware = WSS_HW_AD1848;
out_mode:
- snd_wss_out(chip, CS4231_MISC_INFO, 0);
+ snd_wss_dout(chip, CS4231_MISC_INFO, 0);
out:
spin_unlock_irqrestore(&chip->reg_lock, flags);
return err;
----------------------------------------------------------------------
Zobacz galerie - tak wygladaja wampiry!
>> link http://link.interia.pl/f1eee
3
6
The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
sound/mips/au1x00.c
sound/soc/at32/playpaq_wm8510.c
sound/soc/at91/eti_b1_wm8731.c
This patch removes the said #include <version.h>.
Signed-off-by: Huang Weiyi <weiyi.huang(a)gmail.com>
diff --git a/sound/mips/au1x00.c b/sound/mips/au1x00.c
index ee0741f..fbef38a 100644
--- a/sound/mips/au1x00.c
+++ b/sound/mips/au1x00.c
@@ -38,7 +38,6 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/slab.h>
-#include <linux/version.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
diff --git a/sound/soc/at32/playpaq_wm8510.c b/sound/soc/at32/playpaq_wm8510.c
index 3f32621..fd2b2f3 100644
--- a/sound/soc/at32/playpaq_wm8510.c
+++ b/sound/soc/at32/playpaq_wm8510.c
@@ -22,7 +22,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/clk.h>
diff --git a/sound/soc/at91/eti_b1_wm8731.c b/sound/soc/at91/eti_b1_wm8731.c
index b081e83..b81d6b2 100644
--- a/sound/soc/at91/eti_b1_wm8731.c
+++ b/sound/soc/at91/eti_b1_wm8731.c
@@ -22,7 +22,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/timer.h>
2
1
Hello all,
I released alsa-utils and alsa-plugins v1.0.18rc2 packages. The
changelog is available here:
http://www.alsa-project.org/main/index.php/Changes_v1.0.18rc1_v1.0.18rc2
Jaroslav
-----
Jaroslav Kysela <perex(a)perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
3
3
Linus, please pull from:
git pull git://git.alsa-project.org/alsa-kernel.git for-linus
gitweb interface:
http://git.alsa-project.org/?p=alsa-kernel.git;a=shortlog;h=for-linus
The GNU patch is available at:
ftp://ftp.alsa-project.org/pub/kernel-patches/alsa-git-for-linus-2008-07-14…
The following files will be updated:
Documentation/sound/alsa/ALSA-Configuration.txt | 17 +-
.../sound/alsa/DocBook/writing-an-alsa-driver.tmpl | 4 +-
include/asm-mips/mach-au1x00/au1xxx_psc.h | 8 +
include/sound/ad1843.h | 46 +
include/sound/control.h | 3 -
include/sound/core.h | 8 +-
include/sound/cs4231-regs.h | 8 +
include/sound/cs4231.h | 3 +
include/sound/emu10k1.h | 1 +
include/sound/seq_kernel.h | 2 +-
include/sound/soc-dapm.h | 42 +-
include/sound/soc.h | 175 ++-
include/sound/uda1341.h | 2 -
include/sound/version.h | 4 +-
sound/Kconfig | 34 +-
sound/aoa/Kconfig | 11 +-
sound/aoa/codecs/Kconfig | 4 -
sound/aoa/fabrics/Kconfig | 1 -
sound/aoa/soundbus/Kconfig | 1 -
sound/arm/Kconfig | 21 +-
sound/arm/sa11xx-uda1341.c | 2 -
sound/core/Kconfig | 29 +-
sound/core/control.c | 7 +-
sound/core/init.c | 67 +-
sound/core/memalloc.c | 62 -
sound/core/seq/seq_clientmgr.c | 2 +-
sound/core/seq/seq_device.c | 6 +-
sound/core/sound.c | 8 +-
sound/core/timer.c | 6 +-
sound/drivers/Kconfig | 91 +-
sound/drivers/vx/vx_hwdep.c | 2 +-
sound/i2c/cs8427.c | 6 +-
sound/i2c/l3/uda1341.c | 2 -
sound/isa/Kconfig | 61 +-
sound/isa/cs423x/cs4231_lib.c | 118 ++-
sound/isa/opti9xx/opti92x-ad1848.c | 1126 +-------------
sound/isa/sb/Makefile | 2 -
sound/isa/wavefront/wavefront_synth.c | 2 +-
sound/mips/Kconfig | 27 +-
sound/mips/Makefile | 4 +
sound/mips/ad1843.c | 561 +++++++
sound/mips/hal2.c | 947 ++++++++++++
sound/mips/hal2.h | 245 +++
sound/mips/sgio2audio.c | 1006 ++++++++++++
sound/oss/Kconfig | 49 +-
sound/oss/dmasound/dmasound_core.c | 7 +-
sound/oss/dmasound/dmasound_paula.c | 2 +-
sound/oss/dmasound/dmasound_q40.c | 2 +-
sound/oss/msnd.c | 2 -
sound/oss/msnd.h | 2 -
sound/oss/msnd_classic.h | 2 -
sound/oss/msnd_pinnacle.c | 5 -
sound/oss/msnd_pinnacle.h | 2 -
sound/parisc/Kconfig | 13 +-
sound/pci/Kconfig | 104 +--
sound/pci/Makefile | 2 +-
sound/pci/ac97/Makefile | 12 +-
sound/pci/ac97/ac97_codec.c | 11 +-
sound/pci/ac97/ac97_patch.c | 81 +-
sound/pci/{ac97 => }/ak4531_codec.c | 34 +-
sound/pci/au88x0/au88x0_game.c | 2 -
sound/pci/azt3328.c | 1235 ++++++++++-----
sound/pci/azt3328.h | 207 +++-
sound/pci/ca0106/ca0106_main.c | 5 +
sound/pci/emu10k1/emu10k1_main.c | 1 +
sound/pci/emu10k1/emumixer.c | 13 +-
sound/pci/emu10k1/memory.c | 69 +-
sound/pci/hda/hda_codec.c | 2 +-
sound/pci/hda/hda_codec.h | 2 +-
sound/pci/hda/hda_hwdep.c | 2 +-
sound/pci/hda/hda_intel.c | 306 +++-
sound/pci/hda/hda_proc.c | 5 +-
sound/pci/hda/patch_analog.c | 38 +-
sound/pci/hda/patch_conexant.c | 33 +-
sound/pci/hda/patch_realtek.c | 548 +++++++-
sound/pci/hda/patch_sigmatel.c | 71 +-
sound/pci/ice1712/envy24ht.h | 10 +-
sound/pci/ice1712/ice1712.h | 2 +
sound/pci/ice1712/ice1724.c | 213 ++-
sound/pci/maestro3.c | 42 +-
sound/pci/nm256/nm256.c | 4 +-
sound/pci/oxygen/hifier.c | 33 +-
sound/pci/oxygen/oxygen.c | 76 +-
sound/pci/oxygen/oxygen.h | 14 +
sound/pci/oxygen/oxygen_io.c | 22 +-
sound/pci/oxygen/oxygen_lib.c | 106 ++-
sound/pci/oxygen/oxygen_pcm.c | 53 +-
sound/pci/oxygen/virtuoso.c | 252 ++--
sound/pci/pcxhr/pcxhr.c | 4 +-
sound/pci/pcxhr/pcxhr_core.c | 18 +-
sound/pci/trident/trident_main.c | 5 +-
sound/pci/trident/trident_memory.c | 178 ---
sound/pci/via82xx.c | 6 +
sound/pci/ymfpci/ymfpci_main.c | 2 +
sound/pcmcia/Kconfig | 15 +-
sound/pcmcia/vx/vxp_ops.c | 2 +-
sound/ppc/Kconfig | 26 +-
sound/ppc/daca.c | 2 -
sound/ppc/tumbler.c | 2 -
sound/sh/Kconfig | 16 +-
sound/soc/Kconfig | 19 +-
sound/soc/Makefile | 3 +-
sound/soc/at32/Kconfig | 34 +
sound/soc/at32/Makefile | 11 +
sound/soc/at32/at32-pcm.c | 491 ++++++
sound/soc/at32/at32-pcm.h | 79 +
sound/soc/at32/at32-ssc.c | 849 ++++++++++
sound/soc/at32/at32-ssc.h | 59 +
sound/soc/at32/playpaq_wm8510.c | 522 +++++++
sound/soc/at91/Kconfig | 2 +-
sound/soc/at91/at91-pcm.c | 6 +-
sound/soc/at91/at91-ssc.c | 12 +-
sound/soc/at91/at91-ssc.h | 2 +-
sound/soc/at91/eti_b1_wm8731.c | 53 +-
sound/soc/au1x/Kconfig | 32 +
sound/soc/au1x/Makefile | 13 +
sound/soc/au1x/dbdma2.c | 421 +++++
sound/soc/au1x/psc-ac97.c | 387 +++++
sound/soc/au1x/psc-i2s.c | 414 +++++
sound/soc/au1x/psc.h | 53 +
sound/soc/au1x/sample-ac97.c | 144 ++
sound/soc/codecs/Kconfig | 22 +-
sound/soc/codecs/Makefile | 8 +
sound/soc/codecs/ac97.c | 31 +-
sound/soc/codecs/ac97.h | 2 +-
sound/soc/codecs/ak4535.c | 696 +++++++++
sound/soc/codecs/ak4535.h | 46 +
sound/soc/codecs/cs4270.c | 8 +-
sound/soc/codecs/cs4270.h | 2 +-
sound/soc/codecs/tlv320aic3x.c | 384 +++--
sound/soc/codecs/tlv320aic3x.h | 55 +-
sound/soc/codecs/uda1380.c | 852 ++++++++++
sound/soc/codecs/uda1380.h | 89 ++
sound/soc/codecs/wm8510.c | 817 ++++++++++
sound/soc/codecs/wm8510.h | 103 ++
sound/soc/codecs/wm8731.c | 79 +-
sound/soc/codecs/wm8731.h | 2 +-
sound/soc/codecs/wm8750.c | 87 +-
sound/soc/codecs/wm8750.h | 2 +-
sound/soc/codecs/wm8753.c | 183 ++--
sound/soc/codecs/wm8753.h | 2 +-
sound/soc/codecs/wm8990.c | 1626 ++++++++++++++++++++
sound/soc/codecs/wm8990.h | 832 ++++++++++
sound/soc/codecs/wm9712.c | 53 +-
sound/soc/codecs/wm9712.h | 2 +-
sound/soc/codecs/wm9713.c | 79 +-
sound/soc/codecs/wm9713.h | 2 +-
sound/soc/davinci/Kconfig | 2 +-
sound/soc/davinci/davinci-evm.c | 40 +-
sound/soc/davinci/davinci-i2s.c | 16 +-
sound/soc/davinci/davinci-i2s.h | 2 +-
sound/soc/davinci/davinci-pcm.c | 2 +-
sound/soc/fsl/Kconfig | 6 +-
sound/soc/fsl/fsl_dma.c | 2 +-
sound/soc/fsl/fsl_dma.h | 2 +-
sound/soc/fsl/fsl_ssi.c | 24 +-
sound/soc/fsl/fsl_ssi.h | 4 +-
sound/soc/fsl/mpc8610_hpcd.c | 72 +-
sound/soc/omap/Kconfig | 4 -
sound/soc/omap/n810.c | 106 +-
sound/soc/omap/omap-mcbsp.c | 16 +-
sound/soc/omap/omap-mcbsp.h | 2 +-
sound/soc/omap/omap-pcm.c | 2 +-
sound/soc/pxa/Kconfig | 11 +-
sound/soc/pxa/Makefile | 3 +-
sound/soc/pxa/corgi.c | 70 +-
sound/soc/pxa/em-x270.c | 102 ++
sound/soc/pxa/poodle.c | 50 +-
sound/soc/pxa/pxa2xx-ac97.c | 18 +-
sound/soc/pxa/pxa2xx-ac97.h | 2 +-
sound/soc/pxa/pxa2xx-i2s.c | 17 +-
sound/soc/pxa/pxa2xx-i2s.h | 2 +-
sound/soc/pxa/pxa2xx-pcm.c | 2 +-
sound/soc/pxa/spitz.c | 91 +-
sound/soc/pxa/tosa.c | 47 +-
sound/soc/s3c24xx/Kconfig | 4 +-
sound/soc/s3c24xx/neo1973_wm8753.c | 237 ++--
sound/soc/s3c24xx/s3c2412-i2s.c | 15 +-
sound/soc/s3c24xx/s3c2412-i2s.h | 2 +-
sound/soc/s3c24xx/s3c2443-ac97.c | 15 +-
sound/soc/s3c24xx/s3c24xx-ac97.h | 2 +-
sound/soc/s3c24xx/s3c24xx-i2s.c | 25 +-
sound/soc/s3c24xx/s3c24xx-i2s.h | 2 +-
sound/soc/s3c24xx/s3c24xx-pcm.c | 6 +-
sound/soc/s3c24xx/smdk2443_wm9710.c | 3 -
sound/soc/sh/Kconfig | 5 +-
sound/soc/sh/dma-sh7760.c | 2 +-
sound/soc/sh/hac.c | 2 +-
sound/soc/sh/sh7760-ac97.c | 4 +-
sound/soc/sh/ssi.c | 8 +-
sound/soc/soc-core.c | 443 ++++--
sound/soc/soc-dapm.c | 344 ++++-
sound/sparc/Kconfig | 17 +-
sound/sparc/dbri.c | 2 +-
sound/spi/Kconfig | 13 +-
sound/usb/Kconfig | 16 +-
sound/usb/caiaq/caiaq-audio.c | 1 +
sound/usb/caiaq/caiaq-device.c | 12 +-
sound/usb/caiaq/caiaq-device.h | 1 +
sound/usb/usbaudio.c | 4 -
sound/usb/usbquirks.h | 38 +
201 files changed, 16473 insertions(+), 3893 deletions(-)
rename sound/pci/{ac97 => }/ak4531_codec.c (96%)
Adrian Bunk (6):
[ALSA] remove CVS keywords
sound: sound/oss/: remove CVS keywords
[ALSA] remove SND_GUS_SYNTH
[ALSA] usbaudio.c: remove #ifndef CONFIG_USB_EHCI_SPLIT_ISO code
ALSA: make sparc/dbri.c:snd_dbri_proc() static
sound: sound/oss/dmasound/: cleanups
Akio Idehara (1):
[ALSA] hda - Add Toshiba dynabook SS RX1 support
Andreas Mohr (2):
[ALSA] PCI168 snd-azt3328 Linux driver: another huge update
ALSA: PCI168 snd-azt3328: some more fixups
Andy Green (1):
ALSA: ASoC: Don't block system resume
Chris Mennie (1):
[ALSA] usb-audio - Support for Roland SonicCell sound module
Clemens Ladisch (12):
[ALSA] oxygen: fix version in MODULE_LICENSE
[ALSA] oxygen: add symbol for I/O space size
[ALSA] oxygen: save register writes
[ALSA] oxygen: simplify DAC volume initialization
[ALSA] oxygen: separate out hardware initialization code
[ALSA] virtuoso: add xonar_enable_output()
[ALSA] oxygen: add PM support
[ALSA] oxygen: add symbols for buffer/period size constraints
[ALSA] virtuoso: restrict period time to less than 10 s
[ALSA] ice1724: fix MIDI
ALSA: usb-audio: fix Yamaha KX quirk
ALSA: usb-audio: add some Yamaha USB MIDI quirks
Daniel Jacobowitz (1):
[ALSA] ac97 - Add virtual master control to VT1616/VT1617A codec.
Daniel Mack (3):
[ALSA] soc - tlv320aic3x - revisit clock setup
[ALSA] soc - tlv320aic3x - add GPIO support
[ALSA] snd_usb_caiaq: add support for 'Session I/O' interface
David Howells (2):
ALSA: Fix a const pointer usage warning in the Digigram VX soundcard driver
ALSA: Fix a const to non-const assignment in the Digigram VXpocket sound driver
Dmitry Baryshkov (2):
ALSA: tosa: fix compilation with new DAPM API
ALSA: ASoC: pxa2xx-ac97: fix warning due to missing argument in fuction declaration
Geoffrey Wossum (1):
[ALSA] Revised AT32 ASoC Patch
Graeme Gregory (1):
[ALSA] soc - DAPM - add hook to read state of DAPM widget
Harvey Harrison (2):
[ALSA] i2c: cs8427.c use put_unaligned helper
alsa: add annotations to bitwise type snd_pcm_hw_param_t
Jarkko Nikula (8):
[ALSA] ASoC: Convert N810 machine driver to use gpiolib
ALSA: ASoC: Cover also Nokia N810 WiMAX Edition in N810 machine driver
ALSA: ASoC: Add support for generic DAPM register modifier widget
ALSA: ASoC: TLV320AIC3X: Use register modifier widget for mic bias
ALSA: ASoC: TLV320AIC3X: Modify only interface related bits in aic3x_set_dai_fmt
ALSA: ASoC: TLV320AIC3X: Add support for digital microphone input
ALSA: ASoC: Add digital mic configuration to N810 machine driver
ALSA: ASoC: TLV320AIC3X: Add mixer control for ADC highpass filter
Jaroslav Kysela (8):
ALSA: Release v1.0.17rc1
ALSA: Release 1.0.17rc2
ALSA: Remove duplicate MODULE_AUTHOR/DESCRIPTION/LICENCE from snd-ens1370.ko
ALSA: emu10k1 - fix possible memory leak in memory allocation routines
[ALSA] Revert "alsa: add annotations to bitwise type snd_pcm_hw_param_t"
ALSA: Release v1.0.17rc3
ALSA: HDA - HP dc7600 with pci sub IDs 0x103c/0x3011 belongs to hp-3013 model
ALSA: Release v1.0.17
Jiang zhe (1):
[ALSA] hda - support intel DG33 motherboards
Johannes Berg (1):
ALSA: remove CONFIG_KMOD from sound
Juergen Beisert (1):
[ALSA] ac97: add support for wm9711 master left inv switch
Kailang Yang (6):
[ALSA] hda - Add support of Teradici controller
[ALSA] hda - Add ICH9 controller support (8086:2911)
[ALSA] hda - Add ALC663 support
[ALSA] hda - Fix vref pincap check in alc882 auto-detection
[ALSA] hda - show correct codec chip in PCM stream names
[ALSA] hda - Fix EAPD and COEF setups for realtek codecs
Krzysztof Helt (3):
[ALSA] opti93x: fix sound ouput for Opti930
ALSA: opti93x: add support for Opti93x codec in cs4231-lib
ALSA: opti93x: use cs4231 lib
Liam Girdwood (16):
ALSA: asoc: core - refactored DAPM pin control API.
ALSA: asoc: core - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: at32 - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: at91 - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: davinci - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: codecs - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: fsl - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: omap - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: pxa - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: s3c24xx - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: sh - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.
ALSA: asoc: machines - add Digital Audio Interface (DAI) control functions.
ALSA: asoc: n810 - fix build error.
ALSA: asoc: at32 - DAI struct merge and enable_pin() change.
ALSA: asoc: kbuild - only show menus for the current ASoC CPU platform.
Manuel Lauss (2):
ALSA: ASoC: AC97 codec PM
ALSA: ASoC: Au12x0/Au1550 PSC Audio support
Mark Brown (30):
[ALSA] soc - DAPM - Add bulk control registration
[ALSA] soc - DAPM - Bulk route registration
[ALSA] soc - tlv320aic3x - Convert to use bulk registration APIs
[ALSA] soc - Zaurus - Convert to bulk DAPM registration APIs
[ALSA] soc - eti_b1_wm8731 - Convert to use bulk DAPM control registration
[ALSA] soc - neo1973_wm8753 - Convert to bulk DAPM registration APIs
[ALSA] soc - davinci-evm - Update for bulk DAPM registration APIs
[ALSA] soc - n810 - Update for bulk DAPM registration APIs
[ALSA] ASoC: Remove in-code changelogs
[ALSA] ASoC: Make CPU and codec DAI operations have same type
[ALSA] ASoC: Clarify API for bias configuration
[ALSA] ASoC: core checkpatch cleanups
[ALSA] soc - Convert Wolfson codec drivers to use bulk DAPM registration
[ALSA] ASoC: Add SOC_DOUBLE_S8_TLV control type
[ALSA] ASoC: Add WM8510 driver
[ALSA] ASoC: Add WM8990 driver
[ALSA] ASoC: Fix default mono mixer configuration for WM8510
ALSA: ASoC: Fix register cache sizes for Wolfson codecs
ALSA: ASoC: Fix register cache size for UDA1380
ALSA: ASoC: Tweak tlv320aicx reg_cache_size
ALSA: ASoC: Add missing includes
ALSA: ASoC: Pass the DAI being configured into CPU DAI probe and remove
ALSA: ASoC: Fix WM9713 voice PCM slave mode configuration
ALSA: ASoC: Check for exact register match in wm97xx_reset()
ALSA: ASoC: Replace custom debug macros with pr_ equivalents
ALSA: ASoC: Advertise 16000Hz rate for WM9713 PCM interface
ALSA: ASoC: Make pop/click debug wait times dynamically configurable
ALSA: ASoC: Fix warning from strict_strtoul()
ALSA: ASoC: Switch DAPM to use of standard DEBUG macro
ALSA: ASoC: Dump DAPM state for non-stream changes
Matthew Ranostay (3):
ALSA: hda: Add support for 92HD73xxx codecs
ALSA: hda - removed redundant gpio_mask
ALSA: hda: 92hd71bxx PC Beep
Mike Montour (3):
ALSA: ASoC: Add TLV information to remaining WM8753 controls
ALSA: ASoC: Add SOC_SINGLE_EXT_TLV control type
ALSA: ASoC: Add TLV information to the LM4857 controls on the GTA01
Mike Rapoport (2):
[ALSA] Add EM-X270 ASoC driver
ALSA: ac97 - fix patch_ucb1400 for proper resume
Milton Miller (1):
ALSA: correct kcalloc usage
Philipp Zabel (1):
[ALSA] ASoC: Add UDA1380 driver
Pierre Ossman (1):
ALSA: trident - pause s/pdif output
Randy Dunlap (1):
ALSA: ASoC: fix PM=n build
Richard Chan (1):
ALSA: Add Yamaha KX49 (USB MIDI controller) to usbquirks.h
Richard Purdie (1):
ALSA: ASoC: Add AK4535 driver
Stephen Rothwell (1):
[ALSA] sound: fix export symbol typo
Takashi Iwai (44):
[ALSA] Remove unneeded ugly hack for i386 in memalloc.c
[ALSA] hda - Fix DMA position inaccuracy
sound: Convert to menuconfig
[ALSA] Fix AC97 kconfig items
[ALSA] Replace CONFIG_SND_DEBUG_DETECT with CONFIG_SND_DEBUG_VERBOSE
[ALSA] Improve the slots option handling
[ALSA] Clean up sound/pci/ac97/Makefile
[ALSA] Make ak4531 local to ens1370 driver
[ALSA] trident - clean up obsolete synth codes
sound: Clean up sound/oss/Kconfig
[ALSA] trivial clean up of sound/isa/sb/Makefile
[ALSA] emu10k1 - simplify page allocation for synth
[ALSA] emu10k1 - Fix inverted Analog/Digital mixer switch on Audigy2
[ALSA] hda - Fix PLL gating control on Realtek codecs
[ALSA] hda - increase max_codecs of ICH to 4
[ALSA] ac97 - Fix power_save option value as time-out
ALSA: emu10k1 - Fix page allocation with GFP_DMA
ALSA: hda - Add bdl_pos_adj option
ALSA: hda - remove position_fix=3
ALSA: hda - bdl_pos_adj option to each instance
ALSA: hda - Fix bdl_pos_adj value for ATI SB chipsets
ALSA: hda - Add description of bdl_pos_adj option
ALSA: hda - Add a warning if pending IRQ is found
ALSA: hda - Fix stac9205_cfg_tbl
ALSA: hda - Remove unused mutex
ALSA: make snd_ctl_elem_read() and snd_ctl_elem_write() static
ALSA: hda - bdl_pos_adj=32 as default
ALSA: hda - use upper_32_bits()
ALSA: emu10k1 - simplify the last fix
ALSA: hda - Fix wrong volumes in AD1988 auto-probe mode
ALSA: ca0106 - Add entry for another MSI K8N Diamond MB
ALSA: hda - Fix digital converter proc output
ALSA: hda - Add MacBook 3.1 support
ALSA: ymfpci - fix initial volume for 44.1kHz output
ALSA: hda - disable amp override on non-HP machines
ALSA: Fix AC97 power down
ALSA: ALSA: hda - Fix ALC883 medion model
ALSA: hda - Add missing Thinkpad Z60m support
ALSA: ALSA: hda - Fix speaker output on Toshiba P105
ALSA: hda - Add support for Lenovo 3000 N200
ALSA: wavefront - add const
ALSA: hda - Fix internal mic vref pin setup
ALSA: hda - Fix missing init for unsol events on micsense model
ALSA: hda - Fix FSC V5505 model
Thomas Bogendoerfer (2):
ALSA: ALSA driver for SGI HAL2 audio device
ALSA: ALSA driver for SGI O2 audio board
Tim Niemeyer (1):
[ALSA] soc - Patch to add debug messages to the neo1973_wm8753 (GTA01) sound driver
Timur Tabi (1):
ALSA: Fix register programming in Freescale MPC8610 HPCD sound driver
Travis Place (2):
ALSA: hda - Added model selection for iMac 24"
ALSA: hda - Added SSID for 'Fujitsu Siemens Amilo M1451G' laptop
Ville Syrjälä (1):
[ALSA] maestro3: Fix hw volume on HP OmniBook
Walter Sheets (1):
ALSA: via82xx - Add VIA audio device #1841 to ac97_quirk list
Werner Almesberger (1):
[ALSA] soc - Fix s3c24xx-i2s LR sync while timer ticks are disabled
-----
Jaroslav Kysela <perex(a)perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
6
12
thank you for your answer. Finally I found, that backporting is not so
necessary for me as I needed just three drivers - bt87x, via82xx and ice1724.
Those drivers do not use newer functions I mentioned before, so the compilation
has successfully ended.
But I noticed that even with the newset driver the alc655 line-in inputs do
not work well. Before ( alsa 1.0.9 ) I had the right channel always connected to
the Mic input. Now (Alsa 2008-08-22 ) in the right channel there is a copy of
the left channel. Thus I have monophonic input instead of stereo.
I just downloaded the datasheet of ALC655 codec. I will read it hopefully
tomorrow. But can you just advice me where to look to try to fix the problem ?
It should be somewhere in snd_via82xx module ? Or somewhere else ? Inputs in
snd_ice1724 (my second sound card) work properly. But I have never worked with
kernel modules or kernel programming. I am just interested how to fix the
problem I have.
Thank you in advance,
Vaclav
1
0

[alsa-devel] [PATCH 002/002] snd-powermac: HP detection for 1st iMac G3 SL
by Risto Suominen 23 Aug '08
by Risto Suominen 23 Aug '08
23 Aug '08
1
0

[PATCH] ca0106 playback 44100Hz support to SPDIF and playback format & rate constraints
by Ben Stanley 23 Aug '08
by Ben Stanley 23 Aug '08
23 Aug '08
Squashed commit of the following:
commit 8bfbd000b4b602b517b5ab1edc5610ef39dced1e
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Sat Aug 23 23:19:57 2008 +1000
Correct style and log messages according to Takashi's review comments.
commit eb973ebecfac64b6f0e60df90eef8885ccc64aaf
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Wed Aug 20 23:56:15 2008 +1000
Annotate bug in comments.
commit df725ab6af87e1c94d1d41e31e3865437b1999e0
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Wed Aug 20 23:44:12 2008 +1000
Checkpatch.pl round 4.
commit c277bfa1773595b98c5447a7a085f21ccead110f
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Wed Aug 20 23:39:39 2008 +1000
Checkpatch.pl changes round 3.
commit a3f9b1faae250aa0786ef68c3c53c3915e42972b
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Wed Aug 20 23:18:36 2008 +1000
Second round of checkpatch.pl changes.
commit 3f45e4895fc8419a4a90eddf29af4f8547aa105d
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Sun Aug 17 00:06:47 2008 +1000
Satisfy checkpatch.pl pass 1
commit 88424052a25359aa7ffa840e0515a7a93278f931
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Sat Aug 16 22:32:25 2008 +1000
44100Hz playback support to SPDIF and playback format & rate constraints
commit e0795c3bc756f07986eaae7c4ab54a78d3fecc80
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Sat Aug 16 22:25:38 2008 +1000
Remove use of snd_assert.
commit 097b03e9ff07432c45a9865bd02208b20b09beb3
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Thu Jul 24 02:59:38 2008 +1000
* fix cosmetic bug
commit 75769f154ea53b4215de37d314351c4e45bd2543
Author: Ben Stanley <Ben.Stanley(a)exemail.com.au>
Date: Thu Jul 3 20:47:31 2008 +1000
44100Hz playback support to SPDIF and playback format & rate constraints
---
pci/ca0106/ca0106.h | 7 +-
pci/ca0106/ca0106_main.c | 265 ++++++++++++++++++++++++++++++++++++++--------
2 files changed, 228 insertions(+), 44 deletions(-)
diff --git a/pci/ca0106/ca0106.h b/pci/ca0106/ca0106.h
index 74175fc..376fa9c 100644
--- a/pci/ca0106/ca0106.h
+++ b/pci/ca0106/ca0106.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2004 James Courtier-Dutton <James(a)superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
- * Version: 0.0.22
+ * Version: 0.0.23
*
* FEATURES currently supported:
* See ca0106_main.c for features.
@@ -49,6 +49,8 @@
* Implement support for Line-in capture on SB Live 24bit.
* 0.0.22
* Add support for mute control on SB Live 24bit (cards w/ SPI DAC)
+ * 0.0.23
+ * Add support for playback sampling rate and format constraints.
*
*
* This code was initally based on code from ALSA's emu10k1x.c which is:
@@ -644,6 +646,8 @@
#include "ca_midi.h"
+#define DRVNAME "snd-ca0106"
+
struct snd_ca0106;
struct snd_ca0106_channel {
@@ -659,6 +663,7 @@ struct snd_ca0106_pcm {
struct snd_pcm_substream *substream;
int channel_id;
unsigned short running;
+ unsigned short hw_reserved;
};
struct snd_ca0106_details {
diff --git a/pci/ca0106/ca0106_main.c b/pci/ca0106/ca0106_main.c
index 2f8b28a..b06f7a9 100644
--- a/pci/ca0106/ca0106_main.c
+++ b/pci/ca0106/ca0106_main.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2004 James Courtier-Dutton <James(a)superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
- * Version: 0.0.25
+ * Version: 0.0.26
*
* FEATURES currently supported:
* Front, Rear and Center/LFE.
@@ -83,9 +83,14 @@
* Add support for mute control on SB Live 24bit (cards w/ SPI DAC)
* 0.0.25
* Powerdown SPI DAC channels when not in use
+ * 0.0.26 Ben Stanley
+ * Added support for output at 44100Hz rate (SPDIF only).
+ * Implemented constraints system for output rate and format.
*
* BUGS:
* Some stability problems when unloading the snd-ca0106 kernel module.
+ * Some programs fail to produce sound output (tested on SPDIF). See
+ * http://thread.gmane.org/gmane.linux.alsa.devel/55384/focus=55410
* --
*
* TODO:
@@ -145,6 +150,7 @@
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
+#include <sound/pcm_params.h>
#include <sound/ac97_codec.h>
#include <sound/info.h>
@@ -284,9 +290,9 @@ static struct snd_pcm_hardware snd_ca0106_playback_hw = {
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_SYNC_START,
.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
- .rates = (SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |
- SNDRV_PCM_RATE_192000),
- .rate_min = 48000,
+ .rates = (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000),
+ .rate_min = 44100,
.rate_max = 192000,
.channels_min = 2, //1,
.channels_max = 2, //6,
@@ -318,6 +324,110 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
.fifo_size = 0,
};
+static unsigned int all_spdif_playback_rates[] =
+ {44100, 48000, 96000, 192000};
+
+static int hw_rule_playback_rate(struct snd_pcm_hw_params *params,
+ struct snd_pcm_hw_rule *rule)
+{
+ struct snd_ca0106 *chip = rule->private;
+ int chi, any_44100 = 0, any_non_44100 = 0, mask;
+ struct snd_ca0106_channel *chp;
+ struct snd_pcm_runtime *runtime;
+ if (snd_BUG_ON(!chip))
+ return -EINVAL;
+
+ if (chip->spdif_enable) {
+ for (chi = 0; chi < 4; ++chi) {
+ chp = &(chip->playback_channels[chi]);
+ if (!chp->use)
+ continue;
+ if (snd_BUG_ON(!chp->epcm))
+ return -EINVAL;
+ if (!chp->epcm->hw_reserved)
+ continue;
+ if (snd_BUG_ON(!chp->epcm->substream))
+ return -EINVAL;
+ if (snd_BUG_ON(!chp->epcm->substream->runtime))
+ return -EINVAL;
+ runtime = chp->epcm->substream->runtime;
+ snd_printdd("snd_hw_rule_playback_rate: ch=%d, "
+ "rate=%d.\n", chi, runtime->rate);
+ any_44100 += runtime->rate == 44100;
+ any_non_44100 += runtime->rate != 44100;
+ }
+ if (snd_BUG_ON(any_44100 && any_non_44100))
+ return -EINVAL;
+ /* Compute the mask applied to all_spdif_playback_rates */
+ if (any_44100)
+ mask = 0x1;
+ else if (any_non_44100)
+ mask = 0xE;
+ else
+ mask = 0xF;
+ } else {
+ /* 44100Hz is not supported for DAC (FIXME Why?) */
+ mask = 0xE;
+ }
+ snd_printdd("snd_hw_rule_playback_rate: any_44100=%d, "
+ "any_non_44100=%d, mask=0x%X, spdif=%d\n",
+ any_44100, any_non_44100, mask, chip->spdif_enable);
+ return snd_interval_list(hw_param_interval(params,
+ SNDRV_PCM_HW_PARAM_RATE),
+ ARRAY_SIZE(all_spdif_playback_rates),
+ all_spdif_playback_rates, mask);
+}
+
+static int hw_rule_playback_format(struct snd_pcm_hw_params *params,
+ struct snd_pcm_hw_rule *rule)
+{
+ struct snd_ca0106 *chip = rule->private;
+ int chi, any_S16 = 0, any_S32 = 0;
+ struct snd_ca0106_channel *chp;
+ struct snd_pcm_runtime *runtime;
+ struct snd_mask fmt, *f = hw_param_mask(
+ params, SNDRV_PCM_HW_PARAM_FORMAT);
+ int result;
+ if (snd_BUG_ON(!chip))
+ return -EINVAL;
+ snd_mask_none(&fmt);
+
+ for (chi = 0; chi < 4; ++chi) {
+ chp = &(chip->playback_channels[chi]);
+ if (!chp->use)
+ continue;
+ if (snd_BUG_ON(!chp->epcm))
+ return -EINVAL;
+ if (!chp->epcm->hw_reserved)
+ continue;
+ if (snd_BUG_ON(!chp->epcm->substream))
+ return -EINVAL;
+ if (snd_BUG_ON(!chp->epcm->substream->runtime))
+ return -EINVAL;
+ runtime = chp->epcm->substream->runtime;
+ snd_printdd("snd_hw_rule_playback_format: ch=%d, format=%d.\n",
+ chi, runtime->format);
+ any_S16 += runtime->format == SNDRV_PCM_FORMAT_S16_LE;
+ any_S32 += runtime->format == SNDRV_PCM_FORMAT_S32_LE;
+ }
+ if (snd_BUG_ON(any_S16 && any_S32))
+ return -EINVAL;
+ if (any_S16)
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S16_LE);
+ else if (any_S32)
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S32_LE);
+ else {
+ /* No format yet chosen, so both formats are available. */
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S16_LE);
+ snd_mask_set(&fmt, SNDRV_PCM_FORMAT_S32_LE);
+ }
+ result = snd_mask_refine(f, &fmt);
+ snd_printdd("snd_hw_rule_playback_format: any_S16=%d, any_S32=%d, "
+ "refined_fmt=0x%X, avail_fmt=0x%X, changed=%d\n",
+ any_S16, any_S32, f->bits[0], fmt.bits[0], result);
+ return result;
+}
+
unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
unsigned int reg,
unsigned int chn)
@@ -508,10 +618,24 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
//printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
//channel->interrupt = snd_ca0106_pcm_channel_interrupt;
channel->epcm = epcm;
- if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
+ err = snd_pcm_hw_constraint_integer(
+ runtime, SNDRV_PCM_HW_PARAM_PERIODS);
+ if (err < 0)
return err;
- if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
+ err = snd_pcm_hw_constraint_step(
+ runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
+ if (err < 0)
return err;
+ err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ hw_rule_playback_rate, (void *)chip,
+ SNDRV_PCM_HW_PARAM_RATE, -1);
+ if (err < 0)
+ return err;
+ err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
+ hw_rule_playback_format, (void *)chip,
+ SNDRV_PCM_HW_PARAM_FORMAT, -1);
+ if (err < 0)
+ return err;
snd_pcm_set_sync(substream);
if (chip->details->spi_dac && channel_id != PCM_FRONT_CHANNEL) {
@@ -646,6 +770,9 @@ static int snd_ca0106_pcm_hw_params_playback(struct snd_pcm_substream *substream
/* hw_free callback */
static int snd_ca0106_pcm_hw_free_playback(struct snd_pcm_substream *substream)
{
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_ca0106_pcm *epcm = runtime->private_data;
+ epcm->hw_reserved = 0;
return snd_pcm_lib_free_pages(substream);
}
@@ -667,53 +794,103 @@ static int snd_ca0106_pcm_hw_free_capture(struct snd_pcm_substream *substream)
static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
{
struct snd_ca0106 *emu = snd_pcm_substream_chip(substream);
- struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_pcm_runtime *runtime = substream->runtime, *runtimei;
struct snd_ca0106_pcm *epcm = runtime->private_data;
- int channel = epcm->channel_id;
+ struct snd_ca0106_channel *chp;
+ int channel = epcm->channel_id, chi, any_44100 = 0, any_non_44100 = 0;
u32 *table_base = (u32 *)(emu->buffer.area+(8*16*channel));
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
u32 hcfg_mask = HCFG_PLAYBACK_S32_LE;
u32 hcfg_set = 0x00000000;
u32 hcfg;
- u32 reg40_mask = 0x30000 << (channel<<1);
+ u32 reg40_mask = 0xFF0000;
u32 reg40_set = 0;
u32 reg40;
- /* FIXME: Depending on mixer selection of SPDIF out or not, select the spdif rate or the DAC rate. */
- u32 reg71_mask = 0x03030000 ; /* Global. Set SPDIF rate. We only support 44100 to spdif, not to DAC. */
+ u32 reg71_mask;
+ u32 reg71_shift;
u32 reg71_set = 0;
u32 reg71;
int i;
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
- /* Rate can be set per channel. */
- /* reg40 control host to fifo */
- /* reg71 controls DAC rate. */
- switch (runtime->rate) {
- case 44100:
- reg40_set = 0x10000 << (channel<<1);
- reg71_set = 0x01010000;
- break;
- case 48000:
- reg40_set = 0;
- reg71_set = 0;
- break;
- case 96000:
- reg40_set = 0x20000 << (channel<<1);
- reg71_set = 0x02020000;
- break;
- case 192000:
- reg40_set = 0x30000 << (channel<<1);
- reg71_set = 0x03030000;
- break;
- default:
- reg40_set = 0;
- reg71_set = 0;
- break;
+ epcm->hw_reserved = 1;
+ /* FIXME CLEAN UP IF spdif_enable IS CHANGED WHILE CHANNELS ARE OPENED
+ * OR PREVENT THIS FROM HAPPENING. */
+ if (emu->spdif_enable)
+ reg71_shift = 24; /* SPDIF Output Rate */
+ else
+ reg71_shift = 16; /* I2S Output Rate */
+ reg71_mask = 0x3 << reg71_shift;
+
+ /*printk(KERN_DEBUG DRVNAME ": prepare_playback: "
+ "channel_number=%d, rate=%d, format=0x%x, channels=%d, "
+ "buffer_size=%ld,period_size=%ld, periods=%u, "
+ "frames_to_bytes=%d\n",
+ channel, runtime->rate, runtime->format, runtime->channels,
+ runtime->buffer_size, runtime->period_size, runtime->periods,
+ frames_to_bytes(runtime, 1));*/
+ /*printk("dma_addr=%x, dma_area=%p, table_base=%p\n",
+ runtime->dma_addr,runtime->dma_area, table_base);*/
+ /*printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
+ emu->buffer.addr,emu->buffer.area, emu->buffer.bytes);*/
+ /* We are forced to build the settings for all the channels. */
+ for (chi = 0; chi < 4; ++chi) {
+ chp = &(emu->playback_channels[chi]);
+ if (!chp->use)
+ continue;
+ if (snd_BUG_ON(!chp->epcm))
+ return -EINVAL;
+ if (chi != channel && !chp->epcm->hw_reserved)
+ continue;
+ if (snd_BUG_ON(!chp->epcm->substream))
+ return -EINVAL;
+ if (snd_BUG_ON(!chp->epcm->substream->runtime))
+ return -EINVAL;
+ runtimei = chp->epcm->substream->runtime;
+ any_44100 += runtimei->rate == 44100;
+ any_non_44100 += runtimei->rate != 44100;
+ /* Rate can be set per channel. */
+ /* reg40 control host to fifo */
+ /* reg71 controls DAC rate. */
+ switch (runtimei->rate) {
+ case 44100:
+ /* We only support 44100 to spdif, not to DAC.
+ (FIXME WHY?)*/
+ if (emu->spdif_enable) {
+ /* When using 44100, *all* channels
+ must be set to that rate. */
+ reg40_set |= 0x550000;
+ reg71_set |= 0x1 << reg71_shift;
+ break;
+ } else {
+ printk(KERN_ERR DRVNAME
+ "prepare_playback: "
+ "44100Hz is invalid for DAC.\n");
+ }
+ case 48000:
+ /* reg40_set &= !(0x1 << (chi<<1)); */
+ /* reg71_set &= !(0x1 << reg71_shift); */
+ break;
+ case 96000:
+ reg40_set |= 0x20000 << (chi<<1);
+ reg71_set |= 0x2 << reg71_shift;
+ break;
+ case 192000:
+ reg40_set |= 0x30000 << (chi<<1);
+ reg71_set |= 0x3 << reg71_shift;
+ break;
+ default:
+ printk(KERN_ERR DRVNAME
+ ": prepare_playback: "
+ "Bad sampling frequency %d.\n",
+ runtimei->rate);
+ }
}
- /* Format is a global setting */
- /* FIXME: Only let the first channel accessed set this. */
+ snd_printdd(KERN_DEBUG DRVNAME ": prepare_playback: any_44100=%d, "
+ "any_non_44100=%d, spdif=%d.\n",
+ any_44100, any_non_44100, emu->spdif_enable);
+ /* Format is a global setting. */
+ /* Only the first channel accessed can set this
+ (enforced by constraints). */
switch (runtime->format) {
case SNDRV_PCM_FORMAT_S16_LE:
hcfg_set = 0;
@@ -1363,8 +1540,8 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
#if 1
- printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model,
- pci->revision, chip->serial);
+ printk(KERN_INFO DRVNAME ": Model %04x Rev %08x Serial %08x\n",
+ chip->model, pci->revision, chip->serial);
#endif
strcpy(card->driver, "CA0106");
strcpy(card->shortname, "CA0106");
@@ -1378,7 +1555,9 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
}
chip->details = c;
if (subsystem[dev]) {
- printk(KERN_INFO "snd-ca0106: Sound card name=%s, subsystem=0x%x. Forced to subsystem=0x%x\n",
+ printk(KERN_INFO DRVNAME
+ ": Sound card name=%s, subsystem=0x%x. "
+ "Forced to subsystem=0x%x\n",
c->name, chip->serial, subsystem[dev]);
}
--
1.5.4.3
--=-lsMZJ4IxY7skpnVaSzUT--
1
0

[alsa-devel] [PATCH] ALSA: ASoC V2: report error if DMA doesn't start in FSL MPC8610 sound drivers
by Timur Tabi 23 Aug '08
by Timur Tabi 23 Aug '08
23 Aug '08
Return an error if the DMA's current pointer is not within the bounds of the
DMA buffer. This can happen if the DMA controller is not programmed correctly,
or if the SSI doesn't communicate with the DMA controller correctly.
Signed-off-by: Timur Tabi <timur(a)freescale.com>
---
This patch is for ASoC V2.
sound/soc/fsl/fsl_dma.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index cb1e5ae..b4ae486 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -689,6 +689,15 @@ static snd_pcm_uframes_t fsl_dma_pointer(struct snd_pcm_substream *substream)
else
position = in_be32(&dma_channel->dar);
+ if ((position < dma_private->dma_buf_phys) ||
+ (position > dma_private->dma_buf_end)) {
+ dev_err(substream->pcm->card->dev,
+ "DMA(%u,%u) pointer is out of range, halting stream\n",
+ dma_private->dma_info->controller_id,
+ dma_private->dma_info->channel_id);
+ return SNDRV_PCM_POS_XRUN;
+ }
+
frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys);
/*
--
1.5.5
2
6
Hello all,
I downloaded alsa-driver-1.0.17 and tried to compile it. I started with "./configure --with-suse=auto --with-oss=yes --with-cards=all,mts64=n" and then "make".
But I always get following:
...
CC [M] /tmp/alsa-driver-1.0.17/drivers/mts64.o
/tmp/alsa-driver-1.0.17/drivers/mts64.c: In function ‘snd_mts64_attach’:
/tmp/alsa-driver-1.0.17/drivers/mts64.c:896: error: implicit declaration of function ‘platform_device_alloc’
/tmp/alsa-driver-1.0.17/drivers/mts64.c:896: warning: assignment makes pointer from integer without a cast
/tmp/alsa-driver-1.0.17/drivers/mts64.c:903: error: implicit declaration of function ‘platform_device_add’
/tmp/alsa-driver-1.0.17/drivers/mts64.c:904: error: implicit declaration of function ‘platform_device_put’
make[4]: *** [/tmp/alsa-driver-1.0.17/drivers/mts64.o] Error 1
make[3]: *** [/tmp/alsa-driver-1.0.17/drivers] Error 2
make[2]: *** [_module_/tmp/alsa-driver-1.0.17] Error 2
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.13-15'
My GCC:
> gcc --version
gcc (GCC) 4.0.2 20050901 (prerelease) (SUSE Linux)
Is there something missing ? What should I do now ?
Thank you in advance,
Vaclav
3
3

[alsa-devel] Does anybody reading this list have an MB with a vt1618 with all four jacks?
by John L. Utz III 23 Aug '08
by John L. Utz III 23 Aug '08
23 Aug '08
Our vt1618 motherboards for our product only has 3 of the 4 possible
jacks, so i cant test my changes to support the Aux In/Surround Back Out
Jack.
I have reason to think that i have done it correctly, but it would be nice
to get a blessing from somebody that actually has them.
tnx!
johnu
1
0

22 Aug '08
Changelog:
1) Show if the script was run as root, or as a user.
2) Check the group permissions of the ALSA device nodes, and check to see if
the user is in that group, and display a warning if they are not.
3) Bumped version to 0.4.52
Signed-off-by: Travis Place <wishie(a)wishie.net>
Notes: Im sure this code is far from perfect, and welcome any changes to it.
1
0

[alsa-devel] [PATCH 2/2] ca0106 playback 44100Hz support to SPDIF and playback format & rate constraints
by Ben Stanley 22 Aug '08
by Ben Stanley 22 Aug '08
22 Aug '08
Signed-off-by: Ben Stanley Ben.Stanley(a)exemail.com.au
This is the patch against alsa-driver.
---
pci/ca0106/ca0106_main.patch | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pci/ca0106/ca0106_main.patch b/pci/ca0106/ca0106_main.patch
index 03820b3..d661011 100644
--- a/pci/ca0106/ca0106_main.patch
+++ b/pci/ca0106/ca0106_main.patch
@@ -14,12 +14,12 @@
static struct snd_ca0106_details ca0106_chip_details[] = {
/* Sound Blaster X-Fi Extreme Audio. This does not have an AC97. 53SB079000000 */
-@@ -1352,7 +1353,7 @@
+@@ -1542,7 +1543,7 @@
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
#if 1
- printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model,
-- pci->revision, chip->serial);
-+ snd_pci_revision(pci), chip->serial);
+ printk(KERN_INFO DRVNAME ": Model %04x Rev %08x Serial %08x\n",
+- chip->model, pci->revision, chip->serial);
++ chip->model, snd_pci_revision(pci), chip->serial);
#endif
strcpy(card->driver, "CA0106");
strcpy(card->shortname, "CA0106");
--
1.5.4.3
1
0

[alsa-devel] [PATCH - asihpi 4/6] Mem buffer alloc inside adapter mutex.
by linux@audioscience.com 22 Aug '08
by linux@audioscience.com 22 Aug '08
22 Aug '08
From: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
Signed-off-by: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
diff --git a/pci/asihpi/hpioctl.c b/pci/asihpi/hpioctl.c
index 8222178..cf7c702 100644
--- a/pci/asihpi/hpioctl.c
+++ b/pci/asihpi/hpioctl.c
@@ -139,7 +139,20 @@ long asihpi_hpi_ioctl(
pa = &adapters[hm.wAdapterIndex];
hr.wSize = 0;
if (hm.wObject == HPI_OBJ_SUBSYSTEM) {
- HPI_MessageF(&hm, &hr, file);
+ switch (hm.wFunction) {
+ case HPI_SUBSYS_CREATE_ADAPTER:
+ case HPI_SUBSYS_DELETE_ADAPTER:
+ /* Application must not use these functions! */
+ hr.wSize = sizeof(struct hpi_response_header);
+ hr.wError = HPI_ERROR_INVALID_OPERATION;
+ hr.wFunction = hm.wFunction;
+ uncopied_bytes = copy_to_user(phr, &hr, hr.wSize);
+ if (uncopied_bytes)
+ return -EFAULT;
+ return 0;
+ default:
+ HPI_MessageF(&hm, &hr, file);
+ }
} else {
u16 __user *ptr = NULL;
u32 size = 0;
@@ -164,16 +177,6 @@ long asihpi_hpi_ioctl(
/* Dig out any pointers embedded in the message. */
switch (hm.wFunction) {
- case HPI_SUBSYS_CREATE_ADAPTER:
- case HPI_SUBSYS_DELETE_ADAPTER:
- /* Application must not use these functions! */
- hr.wSize = sizeof(struct hpi_response_header);
- hr.wError = HPI_ERROR_INVALID_OPERATION;
- hr.wFunction = hm.wFunction;
- uncopied_bytes = copy_to_user(phr, &hr, hr.wSize);
- if (uncopied_bytes)
- return -EFAULT;
- return 0;
case HPI_OSTREAM_WRITE:
case HPI_ISTREAM_READ:
/* Yes, sparse, this is correct. */
@@ -202,6 +205,9 @@ long asihpi_hpi_ioctl(
"HPI could not allocate "
"stream buffer size %d\n",
size);
+
+ mutex_unlock(&adapters[nAdapter].
+ mutex);
return -EINVAL;
}
@@ -216,10 +222,11 @@ long asihpi_hpi_ioctl(
break;
default:
+ size = 0;
break;
}
- if (wrflag == 0) {
+ if (size && (wrflag == 0)) {
uncopied_bytes =
copy_from_user(pa->pBuffer, ptr, size);
if (uncopied_bytes)
@@ -231,7 +238,7 @@ long asihpi_hpi_ioctl(
HPI_MessageF(&hm, &hr, file);
- if (wrflag == 1) {
+ if (size && (wrflag == 1)) {
uncopied_bytes = copy_to_user(ptr, pa->pBuffer, size);
if (uncopied_bytes)
HPI_DEBUG_LOG(WARNING,
--
1.5.4.3
2
3
Hi,
- more register naming work
- finally figured out that weird CR register stuff
(and did I mention that I hate _really_ undecipherable open-coded values?)
- fix handling of IRQ sharing in interrupt handler
(hopefully properly, otherwise I'd be grateful to hear your
pedantic comments ;)
- add handy SPECS_PAGE references wherever useful
- comments, cleanup
- add me as module author
Patch created on 2.6.27-rc1-git4 (diffed against my earlier submission),
pushed through checkpatch.pl, verified on my ALS4000 card (listening to
it right now of course).
Thanks!
(especially for your very fast handling)
Next patch _will_ contain more useful things, I promise ;)
Oh, and apologies to several people for my previous asbestos-requiring
comments!
Seems Bart's mail address is still valid, hopefully
(and found that he's also a Winchip freak, heh).
Signed-off-by: Andreas Mohr <andi(a)lisas.de>
--- sound/pci/als4000.c.sent 2008-08-18 22:12:27.000000000 +0200
+++ sound/pci/als4000.c 2008-08-21 21:30:10.000000000 +0200
@@ -2,7 +2,7 @@
* card-als4000.c - driver for Avance Logic ALS4000 based soundcards.
* Copyright (C) 2000 by Bart Hartgers <bart(a)etpmod.phys.tue.nl>,
* Jaroslav Kysela <perex(a)perex.cz>
- * Copyright (C) 2002 by Andreas Mohr <hw7oshyuv3001(a)sneakemail.com>
+ * Copyright (C) 2002, 2008 by Andreas Mohr <hw7oshyuv3001(a)sneakemail.com>
*
* Framework borrowed from Massimo Piccioni's card-als100.c.
*
@@ -27,8 +27,10 @@
* bought an ALS4000 based soundcard, I was forced to base this driver
* on reverse engineering.
*
- * Note: this is no longer true. Pretty verbose chip docu (ALS4000a.PDF)
- * can be found on the ALSA web site.
+ * Note: this is no longer true (thank you!):
+ * pretty verbose chip docu (ALS4000a.PDF) can be found on the ALSA web site.
+ * Page numbers stated anywhere below with the "SPECS_PAGE:" tag
+ * refer to: ALS4000a.PDF specs Ver 1.0, May 28th, 1998.
*
* The ALS4000 seems to be the PCI-cousin of the ALS100. It contains an
* ALS100-like SB DSP/mixer, an OPL3 synth, a MPU401 and a gameport
@@ -59,7 +61,6 @@
* - value -> some port 0x0c0d
*
* ToDo:
- * - Proper shared IRQ handling?
* - by default, don't enable legacy game and use PCI game I/O
* - power management? (card can do voice wakeup according to datasheet!!)
*/
@@ -79,7 +80,7 @@
#include <sound/sb.h>
#include <sound/initval.h>
-MODULE_AUTHOR("Bart Hartgers <bart(a)etpmod.phys.tue.nl>");
+MODULE_AUTHOR("Bart Hartgers <bart(a)etpmod.phys.tue.nl>, Andreas Mohr");
MODULE_DESCRIPTION("Avance Logic ALS4000");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS4000}}");
@@ -124,22 +125,22 @@
MODULE_DEVICE_TABLE(pci, snd_als4000_ids);
enum als4k_iobase_t {
- /* IOx: B == Byte, W = Word, D = DWord */
+ /* IOx: B == Byte, W = Word, D = DWord; SPECS_PAGE: 37 */
ALS4K_IOD_00_AC97_ACCESS = 0x00,
ALS4K_IOW_04_AC97_READ = 0x04,
ALS4K_IOB_06_AC97_STATUS = 0x06,
ALS4K_IOB_07_IRQSTATUS = 0x07,
ALS4K_IOD_08_GCR_DATA = 0x08,
ALS4K_IOB_0C_GCR_INDEX = 0x0c,
- ALS4K_IOB_0E_SB_MPU_IRQ = 0x0e,
+ ALS4K_IOB_0E_IRQTYPE_SB_CR1E_MPU = 0x0e,
ALS4K_IOB_10_ADLIB_ADDR0 = 0x10,
ALS4K_IOB_11_ADLIB_ADDR1 = 0x11,
ALS4K_IOB_12_ADLIB_ADDR2 = 0x12,
ALS4K_IOB_13_ADLIB_ADDR3 = 0x13,
ALS4K_IOB_14_MIXER_INDEX = 0x14,
ALS4K_IOB_15_MIXER_DATA = 0x15,
- ALS4K_IOB_16_ESP_RST_PORT = 0x16,
- ALS4K_IOB_16_CR1E_ACK_PORT = 0x16, /* 2nd function */
+ ALS4K_IOB_16_ESP_RESET = 0x16,
+ ALS4K_IOB_16_ACK_FOR_CR1E = 0x16, /* 2nd function */
ALS4K_IOB_18_OPL_ADDR0 = 0x18,
ALS4K_IOB_19_OPL_ADDR1 = 0x19,
ALS4K_IOB_1A_ESP_RD_DATA = 0x1a,
@@ -154,62 +155,137 @@
ALS4K_IOB_31_MIDI_COMMAND = 0x31, /* 2nd function */
};
-enum als4k_gcr_t {
- /* all registers 32bit wide */
- ALS4K_GCR_8C_MISC_CTRL = 0x8c,
- ALS4K_GCR_90_TEST_MODE_REG = 0x90,
- ALS4K_GCR_91_DMA0_ADDR = 0x91,
- ALS4K_GCR_92_DMA0_MODE_COUNT = 0x92,
- ALS4K_GCR_93_DMA1_ADDR = 0x93,
- ALS4K_GCR_94_DMA1_MODE_COUNT = 0x94,
- ALS4K_GCR_95_DMA3_ADDR = 0x95,
- ALS4K_GCR_96_DMA3_MODE_COUNT = 0x96,
- ALS4K_GCR_99_DMA_EMULATION_CTRL = 0x99,
- ALS4K_GCR_A0_FIFO1_CURRENT_ADDR = 0xa0,
- ALS4K_GCR_A1_FIFO1_STATUS_BYTECOUNT = 0xa1,
- ALS4K_GCR_A2_FIFO2_PCIADDR = 0xa2,
- ALS4K_GCR_A3_FIFO2_COUNT = 0xa3,
- ALS4K_GCR_A4_FIFO2_CURRENT_ADDR = 0xa4,
- ALS4K_GCR_A5_FIFO1_STATUS_BYTECOUNT = 0xa5,
- ALS4K_GCR_A6_PM_CTRL = 0xa6,
- ALS4K_GCR_A7_PCI_ACCESS_STORAGE = 0xa7,
- ALS4K_GCR_A8_LEGACY_CFG1 = 0xa8,
- ALS4K_GCR_A9_LEGACY_CFG2 = 0xa9,
- ALS4K_GCR_FF_DUMMY_SCRATCH = 0xff,
-};
-
-enum als4k_gcr_8c_t {
- ALS4K_GCR_8C_IRQ_MASK_CTRL_ENABLE = 0x8000,
- ALS4K_GCR_8C_CHIP_REV_MASK = 0xf0000
+enum als4k_iobase_0e_t {
+ ALS4K_IOB_0E_MPU_IRQ = 0x10,
+ ALS4K_IOB_0E_CR1E_IRQ = 0x40,
+ ALS4K_IOB_0E_SB_DMA_IRQ = 0x80,
};
-static inline void snd_als4000_gcr_write_addr(unsigned long iobase,
- enum als4k_gcr_t reg,
- u32 val)
+enum als4k_gcr_t { /* all registers 32bit wide; SPECS_PAGE: 38 to 42 */
+ ALS4K_GCR8C_MISC_CTRL = 0x8c,
+ ALS4K_GCR90_TEST_MODE_REG = 0x90,
+ ALS4K_GCR91_DMA0_ADDR = 0x91,
+ ALS4K_GCR92_DMA0_MODE_COUNT = 0x92,
+ ALS4K_GCR93_DMA1_ADDR = 0x93,
+ ALS4K_GCR94_DMA1_MODE_COUNT = 0x94,
+ ALS4K_GCR95_DMA3_ADDR = 0x95,
+ ALS4K_GCR96_DMA3_MODE_COUNT = 0x96,
+ ALS4K_GCR99_DMA_EMULATION_CTRL = 0x99,
+ ALS4K_GCRA0_FIFO1_CURRENT_ADDR = 0xa0,
+ ALS4K_GCRA1_FIFO1_STATUS_BYTECOUNT = 0xa1,
+ ALS4K_GCRA2_FIFO2_PCIADDR = 0xa2,
+ ALS4K_GCRA3_FIFO2_COUNT = 0xa3,
+ ALS4K_GCRA4_FIFO2_CURRENT_ADDR = 0xa4,
+ ALS4K_GCRA5_FIFO1_STATUS_BYTECOUNT = 0xa5,
+ ALS4K_GCRA6_PM_CTRL = 0xa6,
+ ALS4K_GCRA7_PCI_ACCESS_STORAGE = 0xa7,
+ ALS4K_GCRA8_LEGACY_CFG1 = 0xa8,
+ ALS4K_GCRA9_LEGACY_CFG2 = 0xa9,
+ ALS4K_GCRFF_DUMMY_SCRATCH = 0xff,
+};
+
+enum als4k_gcr8c_t {
+ ALS4K_GCR8C_IRQ_MASK_CTRL_ENABLE = 0x8000,
+ ALS4K_GCR8C_CHIP_REV_MASK = 0xf0000
+};
+
+static inline void snd_als4k_iobase_writeb(unsigned long iobase,
+ enum als4k_iobase_t reg,
+ u8 val)
+{
+ outb(val, iobase + reg);
+}
+
+static inline void snd_als4k_iobase_writel(unsigned long iobase,
+ enum als4k_iobase_t reg,
+ u32 val)
+{
+ outl(val, iobase + reg);
+}
+
+static inline u8 snd_als4k_iobase_readb(unsigned long iobase,
+ enum als4k_iobase_t reg)
+{
+ return inb(iobase + reg);
+}
+
+static inline u32 snd_als4k_iobase_readl(unsigned long iobase,
+ enum als4k_iobase_t reg)
{
- outb(reg, iobase + ALS4K_IOB_0C_GCR_INDEX);
- outl(val, iobase + ALS4K_IOD_08_GCR_DATA);
+ return inl(iobase + reg);
}
-static inline void snd_als4000_gcr_write(struct snd_sb *sb,
+static inline void snd_als4k_gcr_write_addr(unsigned long iobase,
enum als4k_gcr_t reg,
u32 val)
{
- snd_als4000_gcr_write_addr(sb->alt_port, reg, val);
+ snd_als4k_iobase_writeb(iobase, ALS4K_IOB_0C_GCR_INDEX, reg);
+ snd_als4k_iobase_writel(iobase, ALS4K_IOD_08_GCR_DATA, val);
+}
+
+static inline void snd_als4k_gcr_write(struct snd_sb *sb,
+ enum als4k_gcr_t reg,
+ u32 val)
+{
+ snd_als4k_gcr_write_addr(sb->alt_port, reg, val);
}
-static inline u32 snd_als4000_gcr_read_addr(unsigned long iobase,
+static inline u32 snd_als4k_gcr_read_addr(unsigned long iobase,
enum als4k_gcr_t reg)
{
- outb(reg, iobase + ALS4K_IOB_0C_GCR_INDEX);
- return inl(iobase + ALS4K_IOD_08_GCR_DATA);
+ /* SPECS_PAGE: 37/38 */
+ snd_als4k_iobase_writeb(iobase, ALS4K_IOB_0C_GCR_INDEX, reg);
+ return snd_als4k_iobase_readl(iobase, ALS4K_IOD_08_GCR_DATA);
+}
+
+static inline u32 snd_als4k_gcr_read(struct snd_sb *sb, enum als4k_gcr_t reg)
+{
+ return snd_als4k_gcr_read_addr(sb->alt_port, reg);
+}
+
+enum als4k_cr_t { /* all registers 8bit wide; SPECS_PAGE: 20 to 23 */
+ ALS4K_CR0_SB_CONFIG = 0x00,
+ ALS4K_CR2_MISC_CONTROL = 0x02,
+ ALS4K_CR3_CONFIGURATION = 0x03,
+ ALS4K_CR17_FIFO_STATUS = 0x17,
+ ALS4K_CR18_ESP_MAJOR_VERSION = 0x18,
+ ALS4K_CR19_ESP_MINOR_VERSION = 0x19,
+ ALS4K_CR1A_MPU401_UART_MODE_CONTROL = 0x1a,
+ ALS4K_CR1C_FIFO2_BLOCK_LENGTH_LO = 0x1c,
+ ALS4K_CR1D_FIFO2_BLOCK_LENGTH_HI = 0x1d,
+ ALS4K_CR1E_FIFO2_CONTROL = 0x1e, /* secondary PCM FIFO (recording) */
+ ALS4K_CR3A_MISC_CONTROL = 0x3a,
+ ALS4K_CR3B_CRC32_BYTE0 = 0x3b, /* for testing, activate via CR3A */
+ ALS4K_CR3C_CRC32_BYTE1 = 0x3c,
+ ALS4K_CR3D_CRC32_BYTE2 = 0x3d,
+ ALS4K_CR3E_CRC32_BYTE3 = 0x3e,
+};
+
+enum als4k_cr0_t {
+ ALS4K_CR0_DMA_CONTIN_MODE_CTRL = 0x02, /* IRQ/FIFO controlled for 0/1 */
+ ALS4K_CR0_DMA_90H_MODE_CTRL = 0x04, /* IRQ/FIFO controlled for 0/1 */
+ ALS4K_CR0_MX80_81_REG_WRITE_ENABLE = 0x80,
+};
+
+static inline void snd_als4_cr_write(struct snd_sb *chip,
+ enum als4k_cr_t reg,
+ u8 data)
+{
+ /* Control Register is reg | 0xc0 (bit 7, 6 set) on sbmixer_index
+ * NOTE: assumes chip->mixer_lock to be locked externally already!
+ * SPECS_PAGE: 6 */
+ snd_sbmixer_write(chip, reg | 0xc0, data);
}
-static inline u32 snd_als4000_gcr_read(struct snd_sb *sb, enum als4k_gcr_t reg)
+static inline u8 snd_als4_cr_read(struct snd_sb *chip,
+ enum als4k_cr_t reg)
{
- return snd_als4000_gcr_read_addr(sb->alt_port, reg);
+ /* NOTE: assumes chip->mixer_lock to be locked externally already! */
+ return snd_sbmixer_read(chip, reg | 0xc0);
}
+
+
static void snd_als4000_set_rate(struct snd_sb *chip, unsigned int rate)
{
if (!(chip->mode & SB_RATE_LOCK)) {
@@ -222,16 +298,18 @@
static inline void snd_als4000_set_capture_dma(struct snd_sb *chip,
dma_addr_t addr, unsigned size)
{
- snd_als4000_gcr_write(chip, ALS4K_GCR_A2_FIFO2_PCIADDR, addr);
- snd_als4000_gcr_write(chip, ALS4K_GCR_A3_FIFO2_COUNT, (size-1));
+ /* SPECS_PAGE: 40 */
+ snd_als4k_gcr_write(chip, ALS4K_GCRA2_FIFO2_PCIADDR, addr);
+ snd_als4k_gcr_write(chip, ALS4K_GCRA3_FIFO2_COUNT, (size-1));
}
static inline void snd_als4000_set_playback_dma(struct snd_sb *chip,
dma_addr_t addr,
unsigned size)
{
- snd_als4000_gcr_write(chip, ALS4K_GCR_91_DMA0_ADDR, addr);
- snd_als4000_gcr_write(chip, ALS4K_GCR_92_DMA0_MODE_COUNT,
+ /* SPECS_PAGE: 38 */
+ snd_als4k_gcr_write(chip, ALS4K_GCR91_DMA0_ADDR, addr);
+ snd_als4k_gcr_write(chip, ALS4K_GCR92_DMA0_MODE_COUNT,
(size-1)|0x180000);
}
@@ -316,7 +394,7 @@
count = snd_pcm_lib_period_bytes(substream);
if (chip->capture_format & ALS4000_FORMAT_16BIT)
- count >>=1;
+ count >>= 1;
count--;
spin_lock_irq(&chip->reg_lock);
@@ -324,8 +402,8 @@
snd_als4000_set_capture_dma(chip, runtime->dma_addr, size);
spin_unlock_irq(&chip->reg_lock);
spin_lock_irq(&chip->mixer_lock);
- snd_sbmixer_write(chip, 0xdc, count);
- snd_sbmixer_write(chip, 0xdd, count>>8);
+ snd_als4_cr_write(chip, ALS4K_CR1C_FIFO2_BLOCK_LENGTH_LO, count & 0xff);
+ snd_als4_cr_write(chip, ALS4K_CR1D_FIFO2_BLOCK_LENGTH_HI, count >> 8);
spin_unlock_irq(&chip->mixer_lock);
return 0;
}
@@ -343,7 +421,7 @@
count = snd_pcm_lib_period_bytes(substream);
if (chip->playback_format & ALS4000_FORMAT_16BIT)
- count >>=1;
+ count >>= 1;
count--;
/* FIXME: from second playback on, there's a lot more clicks and pops
@@ -360,8 +438,8 @@
/* snd_sbdsp_command(chip, SB_DSP_SPEAKER_ON); */
snd_sbdsp_command(chip, playback_cmd(chip).dsp_cmd);
snd_sbdsp_command(chip, playback_cmd(chip).format);
- snd_sbdsp_command(chip, count);
- snd_sbdsp_command(chip, count>>8);
+ snd_sbdsp_command(chip, count & 0xff);
+ snd_sbdsp_command(chip, count >> 8);
snd_sbdsp_command(chip, playback_cmd(chip).dma_off);
spin_unlock_irq(&chip->reg_lock);
@@ -384,12 +462,14 @@
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
chip->mode |= SB_RATE_LOCK_CAPTURE;
- snd_sbmixer_write(chip, 0xde, capture_cmd(chip));
+ snd_als4_cr_write(chip, ALS4K_CR1E_FIFO2_CONTROL,
+ capture_cmd(chip));
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
chip->mode &= ~SB_RATE_LOCK_CAPTURE;
- snd_sbmixer_write(chip, 0xde, 0);
+ snd_als4_cr_write(chip, ALS4K_CR1E_FIFO2_CONTROL,
+ capture_cmd(chip));
break;
default:
result = -EINVAL;
@@ -430,9 +510,9 @@
unsigned int result;
spin_lock(&chip->reg_lock);
- result = snd_als4000_gcr_read(chip, ALS4K_GCR_A4_FIFO2_CURRENT_ADDR);
- result &= 0xffff;
+ result = snd_als4k_gcr_read(chip, ALS4K_GCRA4_FIFO2_CURRENT_ADDR);
spin_unlock(&chip->reg_lock);
+ result &= 0xffff;
return bytes_to_frames( substream->runtime, result );
}
@@ -442,9 +522,9 @@
unsigned result;
spin_lock(&chip->reg_lock);
- result = snd_als4000_gcr_read(chip, ALS4K_GCR_A0_FIFO1_CURRENT_ADDR);
- result &= 0xffff;
+ result = snd_als4k_gcr_read(chip, ALS4K_GCRA0_FIFO1_CURRENT_ADDR);
spin_unlock(&chip->reg_lock);
+ result &= 0xffff;
return bytes_to_frames( substream->runtime, result );
}
@@ -452,46 +532,63 @@
* return IRQ_HANDLED no matter whether we actually had an IRQ flag or not).
* ALS4000a.PDF writes that while ACKing IRQ in PCI block will *not* ACK
* the IRQ in the SB core, ACKing IRQ in SB block *will* ACK the PCI IRQ
- * register (alt_port + ALS4K_IOB_0E_SB_MPU_IRQ). Probably something
+ * register (alt_port + ALS4K_IOB_0E_IRQTYPE_SB_CR1E_MPU). Probably something
* could be optimized here to query/write one register only...
* And even if both registers need to be queried, then there's still the
* question of whether it's actually correct to ACK PCI IRQ before reading
* SB IRQ like we do now, since ALS4000a.PDF mentions that PCI IRQ will *clear*
* SB IRQ status.
- * (hmm, page 38 mentions it the other way around!)
+ * (hmm, SPECS_PAGE: 38 mentions it the other way around!)
* And do we *really* need the lock here for *reading* SB_DSP4_IRQSTATUS??
* */
static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id)
{
struct snd_sb *chip = dev_id;
- unsigned gcr_status;
- unsigned sb_status;
-
- /* find out which bit of the ALS4000 produced the interrupt */
- gcr_status = inb(chip->alt_port + ALS4K_IOB_0E_SB_MPU_IRQ);
+ unsigned pci_irqstatus;
+ unsigned sb_irqstatus;
- if ((gcr_status & 0x80) && (chip->playback_substream)) /* playback */
+ /* find out which bit of the ALS4000 PCI block produced the interrupt,
+ SPECS_PAGE: 38, 5 */
+ pci_irqstatus = snd_als4k_iobase_readb(chip->alt_port,
+ ALS4K_IOB_0E_IRQTYPE_SB_CR1E_MPU);
+ if ((pci_irqstatus & ALS4K_IOB_0E_SB_DMA_IRQ)
+ && (chip->playback_substream)) /* playback */
snd_pcm_period_elapsed(chip->playback_substream);
- if ((gcr_status & 0x40) && (chip->capture_substream)) /* capturing */
+ if ((pci_irqstatus & ALS4K_IOB_0E_CR1E_IRQ)
+ && (chip->capture_substream)) /* capturing */
snd_pcm_period_elapsed(chip->capture_substream);
- if ((gcr_status & 0x10) && (chip->rmidi)) /* MPU401 interrupt */
+ if ((pci_irqstatus & ALS4K_IOB_0E_MPU_IRQ)
+ && (chip->rmidi)) /* MPU401 interrupt */
snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data);
- /* release the gcr */
- outb(gcr_status, chip->alt_port + ALS4K_IOB_0E_SB_MPU_IRQ);
+ /* ACK the PCI block IRQ */
+ snd_als4k_iobase_writeb(chip->alt_port,
+ ALS4K_IOB_0E_IRQTYPE_SB_CR1E_MPU, pci_irqstatus);
spin_lock(&chip->mixer_lock);
- sb_status = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
+ /* SPECS_PAGE: 20 */
+ sb_irqstatus = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
spin_unlock(&chip->mixer_lock);
- if (sb_status & SB_IRQTYPE_8BIT)
+ if (sb_irqstatus & SB_IRQTYPE_8BIT)
snd_sb_ack_8bit(chip);
- if (sb_status & SB_IRQTYPE_16BIT)
+ if (sb_irqstatus & SB_IRQTYPE_16BIT)
snd_sb_ack_16bit(chip);
- if (sb_status & SB_IRQTYPE_MPUIN)
+ if (sb_irqstatus & SB_IRQTYPE_MPUIN)
inb(chip->mpu_port);
- if (sb_status & 0x20)
- inb(SBP(chip, RESET));
- return IRQ_HANDLED;
+ if (sb_irqstatus & ALS4K_IRQTYPE_CR1E_DMA)
+ snd_als4k_iobase_readb(chip->alt_port,
+ ALS4K_IOB_16_ACK_FOR_CR1E);
+
+ /* printk(KERN_INFO "als4000: irq 0x%04x 0x%04x\n",
+ pci_irqstatus, sb_irqstatus); */
+
+ /* only ack the things we actually handled above */
+ return IRQ_RETVAL(
+ (pci_irqstatus & (ALS4K_IOB_0E_SB_DMA_IRQ|ALS4K_IOB_0E_CR1E_IRQ|
+ ALS4K_IOB_0E_MPU_IRQ))
+ || (sb_irqstatus & (SB_IRQTYPE_8BIT|SB_IRQTYPE_16BIT|
+ SB_IRQTYPE_MPUIN|ALS4K_IRQTYPE_CR1E_DMA))
+ );
}
/*****************************************************************/
@@ -603,7 +700,8 @@
struct snd_pcm *pcm;
int err;
- if ((err = snd_pcm_new(chip->card, "ALS4000 DSP", device, 1, 1, &pcm)) < 0)
+ err = snd_pcm_new(chip->card, "ALS4000 DSP", device, 1, 1, &pcm);
+ if (err < 0)
return err;
pcm->private_data = chip;
pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
@@ -637,34 +735,38 @@
cfg1 |= (game_io | 1) << 16;
if (opl_io > 0)
cfg1 |= (opl_io | 1);
- snd_als4000_gcr_write_addr(iobase, ALS4K_GCR_A8_LEGACY_CFG1, cfg1);
- snd_als4000_gcr_write_addr(iobase, ALS4K_GCR_A9_LEGACY_CFG2, cfg2);
+ snd_als4k_gcr_write_addr(iobase, ALS4K_GCRA8_LEGACY_CFG1, cfg1);
+ snd_als4k_gcr_write_addr(iobase, ALS4K_GCRA9_LEGACY_CFG2, cfg2);
}
static void snd_als4000_configure(struct snd_sb *chip)
{
- unsigned tmp;
+ u8 tmp;
int i;
/* do some more configuration */
spin_lock_irq(&chip->mixer_lock);
- tmp = snd_sbmixer_read(chip, 0xc0);
- snd_sbmixer_write(chip, 0xc0, tmp|0x80);
- /* always select DMA channel 0, since we do not actually use DMA */
+ tmp = snd_als4_cr_read(chip, ALS4K_CR0_SB_CONFIG);
+ snd_als4_cr_write(chip, ALS4K_CR0_SB_CONFIG,
+ tmp|ALS4K_CR0_MX80_81_REG_WRITE_ENABLE);
+ /* always select DMA channel 0, since we do not actually use DMA
+ * SPECS_PAGE: 19/20 */
snd_sbmixer_write(chip, SB_DSP4_DMASETUP, SB_DMASETUP_DMA0);
- snd_sbmixer_write(chip, 0xc0, tmp&0x7f);
+ snd_als4_cr_write(chip, ALS4K_CR0_SB_CONFIG,
+ tmp & ~ALS4K_CR0_MX80_81_REG_WRITE_ENABLE);
spin_unlock_irq(&chip->mixer_lock);
spin_lock_irq(&chip->reg_lock);
/* enable interrupts */
- snd_als4000_gcr_write(chip, ALS4K_GCR_8C_MISC_CTRL,
- ALS4K_GCR_8C_IRQ_MASK_CTRL_ENABLE);
+ snd_als4k_gcr_write(chip, ALS4K_GCR8C_MISC_CTRL,
+ ALS4K_GCR8C_IRQ_MASK_CTRL_ENABLE);
- for (i = ALS4K_GCR_91_DMA0_ADDR; i <= ALS4K_GCR_96_DMA3_MODE_COUNT; ++i)
- snd_als4000_gcr_write(chip, i, 0);
+ /* SPECS_PAGE: 39 */
+ for (i = ALS4K_GCR91_DMA0_ADDR; i <= ALS4K_GCR96_DMA3_MODE_COUNT; ++i)
+ snd_als4k_gcr_write(chip, i, 0);
- snd_als4000_gcr_write(chip, ALS4K_GCR_99_DMA_EMULATION_CTRL,
- snd_als4000_gcr_read(chip, ALS4K_GCR_99_DMA_EMULATION_CTRL));
+ snd_als4k_gcr_write(chip, ALS4K_GCR99_DMA_EMULATION_CTRL,
+ snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL));
spin_unlock_irq(&chip->reg_lock);
}
@@ -739,7 +841,7 @@
struct snd_card_als4000 *acard = card->private_data;
/* make sure that interrupts are disabled */
- snd_als4000_gcr_write_addr(acard->iobase, ALS4K_GCR_8C_MISC_CTRL, 0);
+ snd_als4k_gcr_write_addr(acard->iobase, ALS4K_GCR8C_MISC_CTRL, 0);
/* free resources */
snd_als4000_free_gameport(acard);
pci_release_regions(acard->pci);
@@ -788,7 +890,7 @@
pci_set_master(pci);
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
- sizeof( struct snd_card_als4000 ) );
+ sizeof(*acard) /* private_data: acard */);
if (card == NULL) {
pci_release_regions(pci);
pci_disable_device(pci);
@@ -806,6 +908,7 @@
if ((err = snd_sbdsp_create(card,
iobase + ALS4K_IOB_10_ADLIB_ADDR0,
pci->irq,
+ /* internally registered as IRQF_SHARED in case of ALS4000 SB */
snd_als4000_interrupt,
-1,
-1,
@@ -835,8 +938,10 @@
goto out_err;
}
/* FIXME: ALS4000 has interesting MPU401 configuration features
- * at CR 0x1A (pass-thru / UART switching, fast MIDI clock, etc.),
- * however there doesn't seem to be an ALSA API for this... */
+ * at ALS4K_CR1A_MPU401_UART_MODE_CONTROL
+ * (pass-thru / UART switching, fast MIDI clock, etc.),
+ * however there doesn't seem to be an ALSA API for this...
+ * SPECS_PAGE: 21 */
if ((err = snd_als4000_pcm(chip, 0)) < 0) {
goto out_err;
--- include/sound/sb.h.orig 2008-08-21 21:33:01.000000000 +0200
+++ include/sound/sb.h 2008-08-20 20:22:45.000000000 +0200
@@ -240,11 +240,15 @@
#define SB_DT019X_CAP_MAIN 0x07
#define SB_ALS4000_MONO_IO_CTRL 0x4b
+#define SB_ALS4000_OUT_MIXER_CTRL_2 0x4c
#define SB_ALS4000_MIC_IN_GAIN 0x4d
+#define SB_ALS4000_ANALOG_REFRNC_VOLT_CTRL 0x4e
#define SB_ALS4000_FMDAC 0x4f
#define SB_ALS4000_3D_SND_FX 0x50
#define SB_ALS4000_3D_TIME_DELAY 0x51
#define SB_ALS4000_3D_AUTO_MUTE 0x52
+#define SB_ALS4000_ANALOG_BLOCK_CTRL 0x53
+#define SB_ALS4000_3D_DELAYLINE_PATTERN 0x54
#define SB_ALS4000_QSOUND 0xdb
/* IRQ setting bitmap */
@@ -257,6 +261,7 @@
#define SB_IRQTYPE_8BIT 0x01
#define SB_IRQTYPE_16BIT 0x02
#define SB_IRQTYPE_MPUIN 0x04
+#define ALS4K_IRQTYPE_CR1E_DMA 0x20
/* DMA setting bitmap */
#define SB_DMASETUP_DMA0 0x01
2
1

[alsa-devel] [PATCH] ALSA: snd-ad1816a: add different TerraTec EWS64 S model.
by Rene Herman 22 Aug '08
by Rene Herman 22 Aug '08
22 Aug '08
2
1

22 Aug '08
From: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
Signed-off-by: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c
index fa0718f..0f49fbb 100644
--- a/pci/asihpi/asihpi.c
+++ b/pci/asihpi/asihpi.c
@@ -22,7 +22,7 @@
* for any purpose including commercial applications.
*/
/* >0: print Hw params, timer vars. >1: print stream write/copy sizes */
-#define REALLY_VERBOSE_LOGGING 2
+#define REALLY_VERBOSE_LOGGING 0
#if REALLY_VERBOSE_LOGGING
#define VPRINTK1 printk
--
1.5.4.3
1
0

22 Aug '08
Signed-off-by: Rene Herman <rene.herman(a)gmail.com>
---
sound/isa/ad1816a/ad1816a.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 68f1260..7752424 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -83,8 +83,10 @@ static struct pnp_card_device_id snd_ad1816a_pnpids[] = {
{ .id = "MDK1605", .devs = { { .id = "ADS7180" }, { .id = "ADS7181" } } },
/* Shark Predator ISA - added by Ken Arromdee */
{ .id = "SMM7180", .devs = { { .id = "ADS7180" }, { .id = "ADS7181" } } },
- /* Analog Devices AD1816A - Terratec AudioSystem EWS64S */
+ /* Analog Devices AD1816A - Terratec AudioSystem EWS64 S */
{ .id = "TER1112", .devs = { { .id = "ADS7180" }, { .id = "ADS7181" } } },
+ /* Analog Devices AD1816A - Terratec AudioSystem EWS64 S */
+ { .id = "TER1112", .devs = { { .id = "TER1100" }, { .id = "TER1101" } } },
/* Analog Devices AD1816A - Terratec Base 64 */
{ .id = "TER1411", .devs = { { .id = "ADS7180" }, { .id = "ADS7181" } } },
/* end */
--
1.5.5
1
0
Hi,
someone knows to what is related ipc_key, ipc_gid and ipc_perm settings
in /usr/share/alsa/alsa.conf file?
I ask that because even if I don't have an audio group created on my
embedded system, I can play a wave file with aplay.
But since I want to use -D plug:dmix option, I can't. It asks me to
create audio group.
But after that, I have a strange error I can't explain: audio open
error: Operation not permitted.
I think ipc_perm has something related to chmod 0660 file?
But what is ipc_key ? Does I have to set it somewhere since I installed
manually alsa on my system ?
Also, On SuSE, I see a + at the end of permission listing of each device
file. What does it mean? Like this:
crw-rw----+ 1 dax audio 116, 7 2008-08-13 14:06 controlC0
crw-rw----+ 1 dax audio 116, 3 2008-08-13 14:06 midiC0D0
crw-rw----+ 1 dax audio 116, 6 2008-08-13 14:06 pcmC0D0c
crw-rw----+ 1 dax audio 116, 5 2008-08-13 14:06 pcmC0D0p
crw-rw----+ 1 dax audio 116, 4 2008-08-13 14:06 pcmC0D1p
I don't have that on my embedded system, is it something related only to
SuSE ?
Thanks,
Simon
1
0
Additionally, I noticed that the results file from 'alsa-info.sh' the section about Module is does now show "macpro" under the model section.
Might I be doing something wrong?
< snippet >
....
!!Module: snd_hda_intel
bdl_pos_adj : 1,-1,-1,-1,-1,-1,-1,-1
enable : Y,Y,Y,Y,Y,Y,Y,Y
enable_msi : 0
id : <NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
index : -1,-1,-1,-1,-1,-1,-1,-1
model : <NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
position_fix : 0,0,0,0,0,0,0,0
power_save : 0
power_save_controller : Y
probe_mask : -1,-1,-1,-1,-1,-1,-1,-1
single_cmd : N
....
< snippet >
// Salvador
// Northwestern Univeristy
----- Original Message ----
From: Takashi Iwai <tiwai(a)suse.de>
To: S. Aguinaga <sa_jr(a)ieee.org>
Cc: alsa-devel(a)alsa-project.org
Sent: Tuesday, August 19, 2008 5:48:47 AM
Subject: Re: [alsa-devel] Alsa-devel Digest, Vol 18, Issue 45
At Mon, 18 Aug 2008 10:26:42 -0700 (PDT),
S. Aguinaga wrote:
>
> ==============================================
> Trying to figure out where to add this "model=macpro"
> and it looks like it should be in a file called modprobe.conf or an options file under /etc/modprobe.d/
>
> but I don't have (with my installation -- fedora {9} ) those files, do you have any input on this?
You can create any file, typically, /etc/modprobe.d/sound or so.
Put the following line there
options snd-hda-intel model=macpro
Then reload the module, check the sysfs file
/sys/modules/snd_hda_intel/parameters/macpro to see whether the
specified option was really passed properly.
Takashi
> below are the only files I have.
>
> /etc/modprobe.d/
>
> anaconda
> blacklist-visor
> i915modeset
> blacklist
> floppy-pnp
> modprobe.conf.dist
>
>
> ==============================================
> Subject: Re: [alsa-devel] Alsa-devel Digest, Vol 18, Issue 45
>
> At Sat, 16 Aug 2008 06:15:46 -0700 (PDT),
> S. Aguinaga wrote:
> >
> > S. Aguinaga wrote:
> > >
> > > Hello Stan,
> > >
> > > This is awesome I did find the problem it's listed in the /var/log/messages under ALSA.
> > >
> > > 1. When I bring up the "Pulse Volume Control" gui, the first tab "Playback" comes up empty, and grayed-out is "No Streams Available"
> > > 2. aplay does not produce sound, period!
> > > 3. Amrok's welcome sample does not produce sound out of the std tower speaker or the headphone jack.
> > >
> > > I didn't notice anything strange on the output of the alsa-info.sh file, but when I checked the var/log/messages, this is what I found:
> > >
> > > sudo cat /var/log/messages | grep ALSA
> > > Aug 11 07:52:10 macprolinx kernel: ALSA sound/pci/hda/hda_intel.c:1810: chipset global capabilities = 0x4401
> > > Aug 11 07:52:10 macprolinx kernel: ALSA sound/pci/hda/hda_intel.c:749: codec_mask = 0x1
> > > Aug 11 07:52:10 macprolinx kernel: ALSA sound/pci/hda/hda_codec.c:1073: Cannot find slave Surround Playback Volume, skipped
> (snip)
>
> These messages are harmless. It's just information from the driver,
> enabled only when you build it with CONFIG_SND_DEBUG_VERBOSE=y.
>
> > I think your problem is a misidentification of your sound chip. The
> > model being used for your 889A appears to be incompatible, thus all
> > the errors above. It appears that the macpro ALC885 is being selected
> > before it gets to the choice for the ALC889A. Perhaps a developer can
> > look into this.
>
> Well, ALC882, ALC885 and ALC889A are almost compatible. In the
> driver, they are all handled in the same routine.
>
> There are a few models for intel macs with ALC88x. Try to specify
> either model=macpro, model=mbp3 or model=imac24 as the module option
> of snd-hda-intel driver.
>
>
> Takashi
>
>
>
>
>
1
0

[alsa-devel] alsa drivers running under latest Mac Pro hw (MacPro 3, 1, quad core)
by S. Aguinaga 21 Aug '08
by S. Aguinaga 21 Aug '08
21 Aug '08
Stan & Takashi,
Still no luck when adding the mode=macpro option to the file:
cat /etc/modprobe.d/sound
options snd-hda-intel model=macpro
The sys module: /sys/module/snd_hda_intel/parameters/model shows:
cat model
macpro,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>,<NULL>
Attached are screen-captures of the volume meter showing no options and the Volume control showing no streams available.
// Salvador
----- Original Message ----
From: Takashi Iwai <tiwai(a)suse.de>
To: S. Aguinaga <sa_jr(a)ieee.org>
Cc: alsa-devel(a)alsa-project.org
Sent: Tuesday, August 19, 2008 5:48:47 AM
Subject: Re: [alsa-devel] Alsa-devel Digest, Vol 18, Issue 45
At Mon, 18 Aug 2008 10:26:42 -0700 (PDT),
S. Aguinaga wrote:
>
> ==============================================
> Trying to figure out where to add this "model=macpro"
> and it looks like it should be in a file called modprobe.conf or an options file under /etc/modprobe.d/
>
> but I don't have (with my installation -- fedora {9} ) those files, do you have any input on this?
You can create any file, typically, /etc/modprobe.d/sound or so.
Put the following line there
options snd-hda-intel model=macpro
Then reload the module, check the sysfs file
/sys/modules/snd_hda_intel/parameters/macpro to see whether the
specified option was really passed properly.
Takashi
> below are the only files I have.
>
> /etc/modprobe.d/
>
> anaconda
> blacklist-visor
> i915modeset
> blacklist
> floppy-pnp
> modprobe.conf.dist
>
>
> ==============================================
> Subject: Re: [alsa-devel] Alsa-devel Digest, Vol 18, Issue 45
>
> At Sat, 16 Aug 2008 06:15:46 -0700 (PDT),
> S. Aguinaga wrote:
> >
> > S. Aguinaga wrote:
> > >
> > > Hello Stan,
> > >
> > > This is awesome I did find the problem it's listed in the /var/log/messages under ALSA.
> > >
> > > 1. When I bring up the "Pulse Volume Control" gui, the first tab "Playback" comes up empty, and grayed-out is "No Streams Available"
> > > 2. aplay does not produce sound, period!
> > > 3. Amrok's welcome sample does not produce sound out of the std tower speaker or the headphone jack.
> > >
> > > I didn't notice anything strange on the output of the alsa-info.sh file, but when I checked the var/log/messages, this is what I found:
> > >
> > > sudo cat /var/log/messages | grep ALSA
> > > Aug 11 07:52:10 macprolinx kernel: ALSA sound/pci/hda/hda_intel.c:1810: chipset global capabilities = 0x4401
> > > Aug 11 07:52:10 macprolinx kernel: ALSA sound/pci/hda/hda_intel.c:749: codec_mask = 0x1
> > > Aug 11 07:52:10 macprolinx kernel: ALSA sound/pci/hda/hda_codec.c:1073: Cannot find slave Surround Playback Volume, skipped
> (snip)
>
> These messages are harmless. It's just information from the driver,
> enabled only when you build it with CONFIG_SND_DEBUG_VERBOSE=y.
>
> > I think your problem is a misidentification of your sound chip. The
> > model being used for your 889A appears to be incompatible, thus all
> > the errors above. It appears that the macpro ALC885 is being selected
> > before it gets to the choice for the ALC889A. Perhaps a developer can
> > look into this.
>
> Well, ALC882, ALC885 and ALC889A are almost compatible. In the
> driver, they are all handled in the same routine.
>
> There are a few models for intel macs with ALC88x. Try to specify
> either model=macpro, model=mbp3 or model=imac24 as the module option
> of snd-hda-intel driver.
>
>
> Takashi
>
>
>
>
>
1
0

21 Aug '08
Added Clemens and alsa-devel to Cc.
At Mon, 18 Aug 2008 19:22:20 +0400,
Dmitry Butskoy wrote:
>
> Hi,
>
> Recently snd-bt87x driver has started to use CTL_A_PWRDN bit, see
> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.26.y.git;a=commi…
>
> Unfortunately, it produces a regression, at least in my case.
>
> I have "AVerMedia TVPhone 98" card, lspci is:
> > 03:05.0 Multimedia video controller: Brooktree Corporation Bt878 Video
> > Capture (rev 11)
> > 03:05.1 Multimedia controller: Brooktree Corporation Bt878 Audio
> > Capture (rev 11)
> My card has no additional chip for digital sound, hence only analog is
> available.
>
> After upgrading from 2.6.23 to 2.6.25, I have discovered no more sound
> from my snd-bt87x device. Considering the code changes in the dirver,
> I've guessed that it could be some power issues.
>
> Compiling the newest driver without CTL_A_PWRDN (ie. with that changes
> reverted back) I got the sound back again.
>
> Note, that it is not enough to rmmod the old module and insmod the new.
> I have to reboot computer completely with the new driver to take changes
> in effect.
This is a nasty problem. Reloading the module doesn't fix means that
the PCI enable/disable process also doesn't suffice...
Do you see any difference in PCI register space between the fresh boot
and the silent state?
thanks,
Takashi
>
>
> I can perform any tests, debug etc. if needed.
>
>
> Regards,
> Dmitry Butskoy
> http://www.fedoraproject.org/wiki/DmitryButskoy
>
2
1
It is ALSA bug #1754.
D6 bit in 02 register is PW4.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/i2c/other/ak4xxx-adda.c | 4 ++--
sound/pci/ice1712/revo.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c
index 288926d..4c94458 100644
--- a/sound/i2c/other/ak4xxx-adda.c
+++ b/sound/i2c/other/ak4xxx-adda.c
@@ -233,8 +233,8 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
0x01, 0x02, /* 1: reset and soft-mute */
0x00, 0x06, /* 0: mode3(i2s), disable auto-clock detect,
* disable DZF, sharp roll-off, RSTN#=0 */
- 0x02, 0x0e, /* 2: DA's power up, normal speed, RSTN#=0 */
- // 0x02, 0x2e, /* quad speed */
+ 0x02, 0x4e, /* 2: DA's power up, normal speed, RSTN#=0 */
+ // 0x02, 0x6e, /* quad speed */
0x03, 0x01, /* 3: de-emphasis off */
0x04, 0x00, /* 4: LOUT1 volume muted */
0x05, 0x00, /* 5: ROUT1 volume muted */
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
index 4d26314..30b5e83 100644
--- a/sound/pci/ice1712/revo.c
+++ b/sound/pci/ice1712/revo.c
@@ -216,6 +216,7 @@ static const struct snd_akm4xxx_dac_channel revo51_dac[] = {
AK_DAC("PCM Center Playback Volume", 1),
AK_DAC("PCM LFE Playback Volume", 1),
AK_DAC("PCM Rear Playback Volume", 2),
+ AK_DAC("PCM Headphone Volume", 2),
};
static const char *revo51_adc_input_names[] = {
@@ -279,7 +280,7 @@ static struct snd_ak4xxx_private akm_revo_surround_priv __devinitdata = {
static struct snd_akm4xxx akm_revo51 __devinitdata = {
.type = SND_AK4358,
- .num_dacs = 6,
+ .num_dacs = 8,
.ops = {
.set_rate_val = revo_set_rate_val
},
@@ -508,7 +509,7 @@ static int __devinit revo_init(struct snd_ice1712 *ice)
ice->gpio.i2s_mclk_changed = revo_i2s_mclk_changed;
break;
case VT1724_SUBDEVICE_REVOLUTION51:
- ice->num_total_dacs = 6;
+ ice->num_total_dacs = 8;
ice->num_total_adcs = 2;
break;
case VT1724_SUBDEVICE_AUDIOPHILE192:
3
4

21 Aug '08
From: Eliot Blennerhassett <eliot(a)zaphod.(none)>
Signed-off-by: Eliot Blennerhassett <eblennerhassett(a)audioscience.com>
diff --git a/pci/asihpi/hpicmn.c b/pci/asihpi/hpicmn.c
index 12bc6ad..c56e60d 100644
--- a/pci/asihpi/hpicmn.c
+++ b/pci/asihpi/hpicmn.c
@@ -288,8 +288,8 @@ short HpiCheckBufferMapping(
sizeof(((struct hpi_control_cache_pad *)(NULL))->m) }
struct pad_ofs_size {
- size_t offset;
- size_t field_size;
+ unsigned int offset;
+ unsigned int field_size;
};
static struct pad_ofs_size aPadDesc[] = {
@@ -441,10 +441,10 @@ short HpiCheckControlCache(
else {
unsigned int index =
HPI_CTL_ATTR_INDEX(phm->u.c.wAttribute) - 1;
- size_t offset = phm->u.c.dwParam1;
- size_t pad_string_len, field_size;
+ unsigned int offset = phm->u.c.dwParam1;
+ unsigned int pad_string_len, field_size;
char *pad_string;
- size_t tocopy;
+ unsigned int tocopy;
HPI_DEBUG_LOG(VERBOSE,
"PADS HPI_PADS_ %d\n", phm->u.c.wAttribute);
@@ -472,7 +472,7 @@ short HpiCheckControlCache(
tocopy = sizeof(phr->u.cu.chars8.szData);
HPI_DEBUG_LOG(VERBOSE,
- "PADS memcpy(%zd), offset %zd \n", tocopy,
+ "PADS memcpy(%d), offset %d \n", tocopy,
offset);
memcpy(phr->u.cu.chars8.szData, &pad_string[offset],
tocopy);
--
1.5.4.3
2
3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
I posted a message at alsa-user list just yesterday about my problem
with the on-board ALC262 on my workstation, see mailings lists archive:
http://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg23236.html
Quote from my initial post:
| I just got a new workstation. It's an Fujitsu-Siemens Esprimo P5625
| with an on-board ALC262 sound chip. I'm running a Kubuntu 8.04.1 on
| that system.
|
| The sound I get from that chip is really horrible. There are
| cracks and some kind of a reverberation in there.
|
| I compiled the recent version of alsa (1.0.17) and I tried all the
| model-options for /etc/modprobe.d/alsa-base.
"stan" told me to use this script
http://www.alsa-project.org/alsa-info.sh to create more information
about my system. Here is the pastebin link of the output of that script:
http://pastebin.ca/1169153
Maybe I can help evolve the snd-hda-intel by being a tester.
Unfortunately my kernel-hacking skills are as rusty as my C skills -
because of being a Java developer for some years now.
Greets
Tobias
- --
Mit freundlichen Gruessen / with kind regards
Tobias S. Käfer
Tobias S. Kaefer * Portal-Development
ABAS Software AG, Suedendstrasse 42, 76135 Karlsruhe, GERMANY
Fon: +49 721 967 23 0, Fax: +49 721 967 23 100
Managing board / Vorstand: Werner Strub (CEO, Vorsitzender), Peter Walser
Chairman supervisory board / Aufsichtsratsvorsitzender: Thomas Frank
Company Register / Handelsregister: HRB 107644 Amtsgericht Mannheim
please visit our homepage / Bitte besuchen Sie unsere Homepage:
http://www.abas.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIonopdJJ1JNEzpd0RAhCIAJ4lvvOwzQAhV3vtA2u7ilwtlBQPlQCgupns
63R7vjvwbY6O3QUEeNwdEO0=
=Fxwe
-----END PGP SIGNATURE-----
2
2
Hello all,
I started experimenting with Software Defined Radio and currently using onboard sound VIA8237/ALC655 rev.0
I found funny behaviour of card inputs. Left channel is OK. But right channel is not routed to the connector and is very noisy. If I switch the input mixer to MIC input, both channels show me the same data - right channel is always connected to microphone input.. So it looks that there is a bug in mixer driver.
I must confess that I have a little bit older Alsa. But before upgrade, is there any change log or bugfix log for snd-via82xx module ? Or does anybody remember that such bug was solved ?
I am glad that sound works now. And I don't want to "destroy" the sound subsystem by upgrading Alsa...
Thank you in advance,
Vaclav
1
0
Signed-off-by: John L. Utz III john.utz(a)dmx.com
diff --git a/pci/ac97/ac97_codec.c b/pci/ac97/ac97_codec.c
index d0023e9..a34f1ea 100644
--- a/pci/ac97/ac97_codec.c
+++ b/pci/ac97/ac97_codec.c
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[]
= {
{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232
with S/PDIF
{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified
VT1616 with S/PDIF
-{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL },
+{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL }, // clean
sheet of crinkled paper
{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03,
NULL},
@@ -609,7 +609,6 @@ AC97_SINGLE("PC Speaker Playback Volume",
AC97_PC_BEEP, 1, 15, 1)
static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
-
static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line",
"Mix", "Mix Mono", "Phone"};
static const char* std_3d_path[] = {"pre 3D", "post 3D"};
static const char* std_mix[] = {"Mix", "Mic"};
diff --git a/pci/ac97/ac97_patch.c b/pci/ac97/ac97_patch.c
index bb028f8..2042415 100644
--- a/pci/ac97/ac97_patch.c
+++ b/pci/ac97/ac97_patch.c
@@ -3465,7 +3465,7 @@ static int patch_vt1616(struct snd_ac97 * ac97)
/*
* unfortunately, the vt1617a stashes the twiddlers required for
- * nooding the i/o jacks on 2 different regs. * thameans that we cant
+ * nooding the i/o jacks on 2 different regs. that means that we cant
* use the easy way provided by AC97_ENUM_DOUBLE() we have to write
* are own funcs.
*
@@ -3576,6 +3576,413 @@ int patch_vt1617a(struct snd_ac97 * ac97)
return err;
}
+
+/* use these alot in the 1618 code but i cant find a better place to put
them */
+
+static const char* std_enable[] = {"Enabled", "Disabled"};
+static const char* std_disable[] = {"Disabled","Enabled"};
+
+/* disable enable c/lfe exchange */
+
+static int snd_ac97_vt1618_clex_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_disable, 2);
+}
+
+static int snd_ac97_vt1618_clex_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5a) &
+ 0x0100) >> 8;
+ return 0;
+}
+
+static int snd_ac97_vt1618_clex_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5a, 0x0100,
+ ucontrol->value.enumerated.item[0] << 8);
+}
+
+
+/* disable enable dc offset */
+
+static int snd_ac97_vt1618_dcof_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_disable, 2);
+}
+
+static int snd_ac97_vt1618_dcof_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5a) &
+ 0x0400) >> 10;
+ return 0;
+}
+
+static int snd_ac97_vt1618_dcof_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5a, 0x0400,
+ ucontrol->value.enumerated.item[0] << 10);
+}
+
+
+/* enable disable headphone amp */
+
+static int snd_ac97_vt1618_hamp_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_hamp_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0020) >> 5;
+ return 0;
+}
+
+static int snd_ac97_vt1618_hamp_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0020,
+ ucontrol->value.enumerated.item[0] << 5);
+}
+
+
+/* enable disable surround back channel */
+
+static int snd_ac97_vt1618_srbk_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_srbk_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0008) >> 3;
+ return 0;
+}
+
+static int snd_ac97_vt1618_srbk_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/* enable disable soft mute */
+
+static int snd_ac97_vt1618_smute_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_smute_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0001);
+ return 0;
+}
+
+static int snd_ac97_vt1618_smute_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0001,
+ ucontrol->value.enumerated.item[0]);
+}
+
+
+/* config aux in jack - not found on 3 jack motherboards or soundcards */
+
+static int snd_ac97_vt1618_auxin_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = {"Aux In", "Surround Back Out"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 2);
+}
+
+static int snd_ac97_vt1618_auxin_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x76) &
+ 0x0008) >> 3;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_auxin_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x76, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/*
+ * VIA implements 'Smart 5.1' completely differently on the 1618 than
+ * it does on the 1617a. awesome! They seem to have sourced this
+ * particular revision of the technology from somebody else, it's
+ * called Universal Audio Jack, it shows up on some other folk's chips
+ * as well.
+ *
+ * ordering in this list reflects vt1618 docs for Reg 60h and
+ * the block diagram, DACs are as follows:
+ *
+ * OUT_O -> Front,
+ * OUT_1 -> Surround,
+ * OUT_2 -> C/LFE
+ *
+ * Unlike the 1617a, each OUT has a consistent set of mappings
+ * for all bitpatterns other than 00:
+ *
+ * 01 Unmixed Output
+ * 10 Line In
+ * 11 Mic In
+ *
+ * Special Case of 00:
+ *
+ * OUT_0 Mixed Output
+ * OUT_1 Reserved
+ * OUT_2 Reserved
+ *
+ * I have no idea what the hell Reserved does, but on an MSI
+ * CN700T, i have to set it to get surround output - YMMV, bad
+ * shit may happen.
+ *
+ * If other chips use Universal Audio Jack, then this code might be
+ * applicable to them.
+ */
+
+/* copied from ac97_surround_jack_mode_info() ordering in this list
+ * reflects vt1618 docs for Vendor Defined Register 0x60 */
+
+static int snd_ac97_vt1618_UAJ0_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Speaker Out", "DAC Unmixed Out", "Line
In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+/* UAJ1 and UAJ2 are not supposed to have 00 written to them?? i
+ * dunno, because thats something that i have to do to get 5.1 out to
+ * work. */
+
+static int snd_ac97_vt1618_UAJ1_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Surround Out", "DAC Unmixed Out",
"Line In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+static int snd_ac97_vt1618_UAJ2_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Center/LowFre Out", "DAC Unmixed
Out", "Line In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+/* All of the vt1618 Universal Audio Jack twiddlers are on
+ Vendor Defined Register 0x60, page 0. The bits, and thus
+ the mask, are the only thing that changes */
+
+static int snd_ac97_vt1618_UAJ_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol, unsigned short mask)
+{
+ struct snd_ac97 *pac97;
+ ushort usDatPag, usUAJ, usShift = 0; // 0 is a possible value
+
+ if(0x000C == mask) usShift = 2;
+ if(0x0030 == mask) usShift = 4;
+
+ pac97 = snd_kcontrol_chip(kcontrol);
+
+ mutex_lock(&pac97->page_mutex);
+
+ usDatPag = snd_ac97_read(pac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0);
+
+ usUAJ = snd_ac97_read(pac97, 0x60) & mask;
+
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, usDatPag);
+ mutex_unlock(&pac97->page_mutex); // unlock paging
+
+ ucontrol->value.enumerated.item[0] = usUAJ >> usShift;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_UAJ_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol,
+ unsigned short mask)
+{
+ struct snd_ac97 *pac97;
+ ushort usUAJ, usShift = 0; /* 0 is a possible value */
+
+ if(0x000C == mask) usShift = 2;
+ if(0x0030 == mask) usShift = 4;
+
+ pac97 = snd_kcontrol_chip(kcontrol);
+
+ usUAJ = ucontrol->value.enumerated.item[0] << usShift;
+
+ return ac97_update_bits_page(pac97, 0x60, mask, usUAJ, 0);
+}
+
+static int snd_ac97_vt1618_UAJ0_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x0003);
+}
+
+static int snd_ac97_vt1618_UAJ1_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x000C);
+}
+
+static int snd_ac97_vt1618_UAJ2_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x0030);
+}
+
+static int snd_ac97_vt1618_UAJ0_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x0003);
+}
+
+static int snd_ac97_vt1618_UAJ1_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x000C);
+}
+
+static int snd_ac97_vt1618_UAJ2_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x0030);
+}
+
+static const struct snd_kcontrol_new snd_ac97_controls_vt1618[] = {
+
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Center LFE Exchange",
+ .info = snd_ac97_vt1618_clex_info,
+ .get = snd_ac97_vt1618_clex_get,
+ .put = snd_ac97_vt1618_clex_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "DC Offset",
+ .info = snd_ac97_vt1618_dcof_info,
+ .get = snd_ac97_vt1618_dcof_get,
+ .put = snd_ac97_vt1618_dcof_put
+ },diff --git a/pci/ac97/ac97_codec.c b/pci/ac97/ac97_codec.c
index d0023e9..a34f1ea 100644
--- a/pci/ac97/ac97_codec.c
+++ b/pci/ac97/ac97_codec.c
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[]
= {
{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232
with S/PDIF
{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified
VT1616 with S/PDIF
-{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL },
+{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL }, // clean
sheet of crinkled paper
{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03,
NULL},
@@ -609,7 +609,6 @@ AC97_SINGLE("PC Speaker Playback Volume",
AC97_PC_BEEP, 1, 15, 1)
static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
-
static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line",
"Mix", "Mix Mono", "Phone"};
static const char* std_3d_path[] = {"pre 3D", "post 3D"};
static const char* std_mix[] = {"Mix", "Mic"};
diff --git a/pci/ac97/ac97_patch.c b/pci/ac97/ac97_patch.c
index bb028f8..2042415 100644
--- a/pci/ac97/ac97_patch.c
+++ b/pci/ac97/ac97_patch.c
@@ -3465,7 +3465,7 @@ static int patch_vt1616(struct snd_ac97 * ac97)
/*
* unfortunately, the vt1617a stashes the twiddlers required for
- * nooding the i/o jacks on 2 different regs. * thameans that we cant
+ * nooding the i/o jacks on 2 different regs. that means that we cant
* use the easy way provided by AC97_ENUM_DOUBLE() we have to write
* are own funcs.
*
@@ -3576,6 +3576,413 @@ int patch_vt1617a(struct snd_ac97 * ac97)
return err;
}
+
+/* use these alot in the 1618 code but i cant find a better place to put
them */
+
+static const char* std_enable[] = {"Enabled", "Disabled"};
+static const char* std_disable[] = {"Disabled","Enabled"};
+
+/* disable enable c/lfe exchange */
+
+static int snd_ac97_vt1618_clex_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_disable, 2);
+}
+
+static int snd_ac97_vt1618_clex_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5a) &
+ 0x0100) >> 8;
+ return 0;
+}
+
+static int snd_ac97_vt1618_clex_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5a, 0x0100,
+ ucontrol->value.enumerated.item[0] << 8);
+}
+
+
+/* disable enable dc offset */
+
+static int snd_ac97_vt1618_dcof_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_disable, 2);
+}
+
+static int snd_ac97_vt1618_dcof_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5a) &
+ 0x0400) >> 10;
+ return 0;
+}
+
+static int snd_ac97_vt1618_dcof_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5a, 0x0400,
+ ucontrol->value.enumerated.item[0] << 10);
+}
+
+
+/* enable disable headphone amp */
+
+static int snd_ac97_vt1618_hamp_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_hamp_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0020) >> 5;
+ return 0;
+}
+
+static int snd_ac97_vt1618_hamp_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0020,
+ ucontrol->value.enumerated.item[0] << 5);
+}
+
+
+/* enable disable surround back channel */
+
+static int snd_ac97_vt1618_srbk_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_srbk_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0008) >> 3;
+ return 0;
+}
+
+static int snd_ac97_vt1618_srbk_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/* enable disable soft mute */
+
+static int snd_ac97_vt1618_smute_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_smute_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0001);
+ return 0;
+}
+
+static int snd_ac97_vt1618_smute_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0001,
+ ucontrol->value.enumerated.item[0]);
+}
+
+
+/* config aux in jack - not found on 3 jack motherboards or soundcards */
+
+static int snd_ac97_vt1618_auxin_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = {"Aux In", "Surround Back Out"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 2);
+}
+
+static int snd_ac97_vt1618_auxin_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x76) &
+ 0x0008) >> 3;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_auxin_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x76, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/*
+ * VIA implements 'Smart 5.1' completely differently on the 1618 than
+ * it does on the 1617a. awesome! They seem to have sourced this
+ * particular revision of the technology from somebody else, it's
+ * called Universal Audio Jack, it shows up on some other folk's chips
+ * as well.
+ *
+ * ordering in this list reflects vt1618 docs for Reg 60h and
+ * the block diagram, DACs are as follows:
+ *
+ * OUT_O -> Front,
+ * OUT_1 -> Surround,
+ * OUT_2 -> C/LFE
+ *
+ * Unlike the 1617a, each OUT has a consistent set of mappings
+ * for all bitpatterns other than 00:
+ *
+ * 01 Unmixed Output
+ * 10 Line In
+ * 11 Mic In
+ *
+ * Special Case of 00:
+ *
+ * OUT_0 Mixed Output
+ * OUT_1 Reserved
+ * OUT_2 Reserved
+ *
+ * I have no idea what the hell Reserved does, but on an MSI
+ * CN700T, i have to set it to get surround output - YMMV, bad
+ * shit may happen.
+ *
+ * If other chips use Universal Audio Jack, then this code might be
+ * applicable to them.
+ */
+
+/* copied from ac97_surround_jack_mode_info() ordering in this list
+ * reflects vt1618 docs for Vendor Defined Register 0x60 */
+
+static int snd_ac97_vt1618_UAJ0_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Speaker Out", "DAC Unmixed Out", "Line
In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+/* UAJ1 and UAJ2 are not supposed to have 00 written to them?? i
+ * dunno, because thats something that i have to do to get 5.1 out to
+ * work. */
+
+static int snd_ac97_vt1618_UAJ1_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Surround Out", "DAC Unmixed Out",
"Line In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+static int snd_ac97_vt1618_UAJ2_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Center/LowFre Out", "DAC Unmixed
Out", "Line In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+/* All of the vt1618 Universal Audio Jack twiddlers are on
+ Vendor Defined Register 0x60, page 0. The bits, and thus
+ the mask, are the only thing that changes */
+
+static int snd_ac97_vt1618_UAJ_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol, unsigned short mask)
+{
+ struct snd_ac97 *pac97;
+ ushort usDatPag, usUAJ, usShift = 0; // 0 is a possible value
+
+ if(0x000C == mask) usShift = 2;
+ if(0x0030 == mask) usShift = 4;
+
+ pac97 = snd_kcontrol_chip(kcontrol);
+
+ mutex_lock(&pac97->page_mutex);
+
+ usDatPag = snd_ac97_read(pac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0);
+
+ usUAJ = snd_ac97_read(pac97, 0x60) & mask;
+
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, usDatPag);
+ mutex_unlock(&pac97->page_mutex); // unlock paging
+
+ ucontrol->value.enumerated.item[0] = usUAJ >> usShift;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_UAJ_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol,
+ unsigned short mask)
+{
+ struct snd_ac97 *pac97;
+ ushort usUAJ, usShift = 0; /* 0 is a possible value */
+
+ if(0x000C == mask) usShift = 2;
+ if(0x0030 == mask) usShift = 4;
+
+ pac97 = snd_kcontrol_chip(kcontrol);
+
+ usUAJ = ucontrol->value.enumerated.item[0] << usShift;
+
+ return ac97_update_bits_page(pac97, 0x60, mask, usUAJ, 0);
+}
+
+static int snd_ac97_vt1618_UAJ0_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x0003);
+}
+
+static int snd_ac97_vt1618_UAJ1_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x000C);
+}
+
+static int snd_ac97_vt1618_UAJ2_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x0030);
+}
+
+static int snd_ac97_vt1618_UAJ0_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x0003);
+}
+
+static int snd_ac97_vt1618_UAJ1_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x000C);
+}
+
+static int snd_ac97_vt1618_UAJ2_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x0030);
+}
+
+static const struct snd_kcontrol_new snd_ac97_controls_vt1618[] = {
+
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Center LFE Exchange",
+ .info = snd_ac97_vt1618_clex_info,
+ .get = snd_ac97_vt1618_clex_get,
+ .put = snd_ac97_vt1618_clex_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "DC Offset",
+ .info = snd_ac97_vt1618_dcof_info,
+ .get = snd_ac97_vt1618_dcof_get,
+ .put = snd_ac97_vt1618_dcof_diff --git a/pci/ac97/ac97_codec.c
b/pci/ac97/ac97_codec.c
index d0023e9..a34f1ea 100644
--- a/pci/ac97/ac97_codec.c
+++ b/pci/ac97/ac97_codec.c
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[]
= {
{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232
with S/PDIF
{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified
VT1616 with S/PDIF
-{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL },
+{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL }, // clean
sheet of crinkled paper
{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03,
NULL},
@@ -609,7 +609,6 @@ AC97_SINGLE("PC Speaker Playback Volume",
AC97_PC_BEEP, 1, 15, 1)
static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0);
-
static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line",
"Mix", "Mix Mono", "Phone"};
static const char* std_3d_path[] = {"pre 3D", "post 3D"};
static const char* std_mix[] = {"Mix", "Mic"};
diff --git a/pci/ac97/ac97_patch.c b/pci/ac97/ac97_patch.c
index bb028f8..2042415 100644
--- a/pci/ac97/ac97_patch.c
+++ b/pci/ac97/ac97_patch.c
@@ -3465,7 +3465,7 @@ static int patch_vt1616(struct snd_ac97 * ac97)
/*
* unfortunately, the vt1617a stashes the twiddlers required for
- * nooding the i/o jacks on 2 different regs. * thameans that we cant
+ * nooding the i/o jacks on 2 different regs. that means that we cant
* use the easy way provided by AC97_ENUM_DOUBLE() we have to write
* are own funcs.
*
@@ -3576,6 +3576,413 @@ int patch_vt1617a(struct snd_ac97 * ac97)
return err;
}
+
+/* use these alot in the 1618 code but i cant find a better place to put
them */
+
+static const char* std_enable[] = {"Enabled", "Disabled"};
+static const char* std_disable[] = {"Disabled","Enabled"};
+
+/* disable enable c/lfe exchange */
+
+static int snd_ac97_vt1618_clex_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_disable, 2);
+}
+
+static int snd_ac97_vt1618_clex_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5a) &
+ 0x0100) >> 8;
+ return 0;
+}
+
+static int snd_ac97_vt1618_clex_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5a, 0x0100,
+ ucontrol->value.enumerated.item[0] << 8);
+}
+
+
+/* disable enable dc offset */
+
+static int snd_ac97_vt1618_dcof_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_disable, 2);
+}
+
+static int snd_ac97_vt1618_dcof_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5a) &
+ 0x0400) >> 10;
+ return 0;
+}
+
+static int snd_ac97_vt1618_dcof_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5a, 0x0400,
+ ucontrol->value.enumerated.item[0] << 10);
+}
+
+
+/* enable disable headphone amp */
+
+static int snd_ac97_vt1618_hamp_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_hamp_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0020) >> 5;
+ return 0;
+}
+
+static int snd_ac97_vt1618_hamp_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0020,
+ ucontrol->value.enumerated.item[0] << 5);
+}
+
+
+/* enable disable surround back channel */
+
+static int snd_ac97_vt1618_srbk_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_srbk_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0008) >> 3;
+ return 0;
+}
+
+static int snd_ac97_vt1618_srbk_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/* enable disable soft mute */
+
+static int snd_ac97_vt1618_smute_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ return ac97_enum_text_info(kcontrol, uinfo, std_enable, 2);
+}
+
+static int snd_ac97_vt1618_smute_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x5c) &
+ 0x0001);
+ return 0;
+}
+
+static int snd_ac97_vt1618_smute_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x5c, 0x0001,
+ ucontrol->value.enumerated.item[0]);
+}
+
+
+/* config aux in jack - not found on 3 jack motherboards or soundcards */
+
+static int snd_ac97_vt1618_auxin_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = {"Aux In", "Surround Back Out"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 2);
+}
+
+static int snd_ac97_vt1618_auxin_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.enumerated.item[0] = (snd_ac97_read(pac97, 0x76) &
+ 0x0008) >> 3;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_auxin_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
+
+ /* notice relationship between mask and shift! */
+
+ return snd_ac97_update_bits(pac97, 0x76, 0x0008,
+ ucontrol->value.enumerated.item[0] << 3);
+}
+
+
+/*
+ * VIA implements 'Smart 5.1' completely differently on the 1618 than
+ * it does on the 1617a. awesome! They seem to have sourced this
+ * particular revision of the technology from somebody else, it's
+ * called Universal Audio Jack, it shows up on some other folk's chips
+ * as well.
+ *
+ * ordering in this list reflects vt1618 docs for Reg 60h and
+ * the block diagram, DACs are as follows:
+ *
+ * OUT_O -> Front,
+ * OUT_1 -> Surround,
+ * OUT_2 -> C/LFE
+ *
+ * Unlike the 1617a, each OUT has a consistent set of mappings
+ * for all bitpatterns other than 00:
+ *
+ * 01 Unmixed Output
+ * 10 Line In
+ * 11 Mic In
+ *
+ * Special Case of 00:
+ *
+ * OUT_0 Mixed Output
+ * OUT_1 Reserved
+ * OUT_2 Reserved
+ *
+ * I have no idea what the hell Reserved does, but on an MSI
+ * CN700T, i have to set it to get surround output - YMMV, bad
+ * shit may happen.
+ *
+ * If other chips use Universal Audio Jack, then this code might be
+ * applicable to them.
+ */
+
+/* copied from ac97_surround_jack_mode_info() ordering in this list
+ * reflects vt1618 docs for Vendor Defined Register 0x60 */
+
+static int snd_ac97_vt1618_UAJ0_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Speaker Out", "DAC Unmixed Out", "Line
In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+/* UAJ1 and UAJ2 are not supposed to have 00 written to them?? i
+ * dunno, because thats something that i have to do to get 5.1 out to
+ * work. */
+
+static int snd_ac97_vt1618_UAJ1_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Surround Out", "DAC Unmixed Out",
"Line In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+static int snd_ac97_vt1618_UAJ2_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
+{
+ static const char* texts[] = { "Center/LowFre Out", "DAC Unmixed
Out", "Line In", "Mic In"};
+ return ac97_enum_text_info(kcontrol, uinfo, texts, 4);
+}
+
+/* All of the vt1618 Universal Audio Jack twiddlers are on
+ Vendor Defined Register 0x60, page 0. The bits, and thus
+ the mask, are the only thing that changes */
+
+static int snd_ac97_vt1618_UAJ_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol, unsigned short mask)
+{
+ struct snd_ac97 *pac97;
+ ushort usDatPag, usUAJ, usShift = 0; // 0 is a possible value
+
+ if(0x000C == mask) usShift = 2;
+ if(0x0030 == mask) usShift = 4;
+
+ pac97 = snd_kcontrol_chip(kcontrol);
+
+ mutex_lock(&pac97->page_mutex);
+
+ usDatPag = snd_ac97_read(pac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0);
+
+ usUAJ = snd_ac97_read(pac97, 0x60) & mask;
+
+ snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, usDatPag);
+ mutex_unlock(&pac97->page_mutex); // unlock paging
+
+ ucontrol->value.enumerated.item[0] = usUAJ >> usShift;
+
+ return 0;
+}
+
+static int snd_ac97_vt1618_UAJ_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol,
+ unsigned short mask)
+{
+ struct snd_ac97 *pac97;
+ ushort usUAJ, usShift = 0; /* 0 is a possible value */
+
+ if(0x000C == mask) usShift = 2;
+ if(0x0030 == mask) usShift = 4;
+
+ pac97 = snd_kcontrol_chip(kcontrol);
+
+ usUAJ = ucontrol->value.enumerated.item[0] << usShift;
+
+ return ac97_update_bits_page(pac97, 0x60, mask, usUAJ, 0);
+}
+
+static int snd_ac97_vt1618_UAJ0_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x0003);
+}
+
+static int snd_ac97_vt1618_UAJ1_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x000C);
+}
+
+static int snd_ac97_vt1618_UAJ2_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_get(kcontrol, ucontrol, 0x0030);
+}
+
+static int snd_ac97_vt1618_UAJ0_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x0003);
+}
+
+static int snd_ac97_vt1618_UAJ1_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x000C);
+}
+
+static int snd_ac97_vt1618_UAJ2_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ return snd_ac97_vt1618_UAJ_put(kcontrol, ucontrol, 0x0030);
+}
+
+static const struct snd_kcontrol_new snd_ac97_controls_vt1618[] = {
+
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Center LFE Exchange",
+ .info = snd_ac97_vt1618_clex_info,
+ .get = snd_ac97_vt1618_clex_get,
+ .put = snd_ac97_vt1618_clex_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "DC Offset",
+ .info = snd_ac97_vt1618_dcof_info,
+ .get = snd_ac97_vt1618_dcof_get,
+ .put = snd_ac97_vt1618_dcof_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Headphone Amp",
+ .info = snd_ac97_vt1618_hamp_info,
+ .get = snd_ac97_vt1618_hamp_get,
+ .put = snd_ac97_vt1618_hamp_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Surround Back",
+ .info = snd_ac97_vt1618_srbk_info,
+ .get = snd_ac97_vt1618_srbk_get,
+ .put = snd_ac97_vt1618_srbk_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Soft Mute",
+ .info = snd_ac97_vt1618_smute_info,
+ .get = snd_ac97_vt1618_smute_get,
+ .put = snd_ac97_vt1618_smute_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux In Jack",
+ .info = snd_ac97_vt1618_auxin_info,
+ .get = snd_ac97_vt1618_auxin_get,
+ .put = snd_ac97_vt1618_auxin_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Speaker Jack",
+ .info = snd_ac97_vt1618_UAJ0_info,
+ .get = snd_ac97_vt1618_UAJ0_get,
+ .put = snd_ac97_vt1618_UAJ0_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line In Jack",
+ .info = snd_ac97_vt1618_UAJ1_info,
+ .get = snd_ac97_vt1618_UAJ1_get,
+ .put = snd_ac97_vt1618_UAJ1_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic In Jack",
+ .info = snd_ac97_vt1618_UAJ2_info,
+ .get = snd_ac97_vt1618_UAJ2_get,
+ .put = snd_ac97_vt1618_UAJ2_put
+ }
+};
+
+int patch_vt1618(struct snd_ac97 *ac97)
+{
+ return patch_build_controls(ac97, snd_ac97_controls_vt1618,
+ ARRAY_SIZE(snd_ac97_controls_vt1618));
+}
+
+
/*
*/
static void it2646_update_jacks(struct snd_ac97 *ac97)
put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Headphone Amp",
+ .info = snd_ac97_vt1618_hamp_info,
+ .get = snd_ac97_vt1618_hamp_get,
+ .put = snd_ac97_vt1618_hamp_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Surround Back",
+ .info = snd_ac97_vt1618_srbk_info,
+ .get = snd_ac97_vt1618_srbk_get,
+ .put = snd_ac97_vt1618_srbk_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Soft Mute",
+ .info = snd_ac97_vt1618_smute_info,
+ .get = snd_ac97_vt1618_smute_get,
+ .put = snd_ac97_vt1618_smute_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux In Jack",
+ .info = snd_ac97_vt1618_auxin_info,
+ .get = snd_ac97_vt1618_auxin_get,
+ .put = snd_ac97_vt1618_auxin_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Speaker Jack",
+ .info = snd_ac97_vt1618_UAJ0_info,
+ .get = snd_ac97_vt1618_UAJ0_get,
+ .put = snd_ac97_vt1618_UAJ0_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line In Jack",
+ .info = snd_ac97_vt1618_UAJ1_info,
+ .get = snd_ac97_vt1618_UAJ1_get,
+ .put = snd_ac97_vt1618_UAJ1_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic In Jack",
+ .info = snd_ac97_vt1618_UAJ2_info,
+ .get = snd_ac97_vt1618_UAJ2_get,
+ .put = snd_ac97_vt1618_UAJ2_put
+ }
+};
+
+int patch_vt1618(struct snd_ac97 *ac97)
+{
+ return patch_build_controls(ac97, snd_ac97_controls_vt1618,
+ ARRAY_SIZE(snd_ac97_controls_vt1618));
+}
+
+
/*
*/
static void it2646_update_jacks(struct snd_ac97 *ac97)
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Headphone Amp",
+ .info = snd_ac97_vt1618_hamp_info,
+ .get = snd_ac97_vt1618_hamp_get,
+ .put = snd_ac97_vt1618_hamp_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Surround Back",
+ .info = snd_ac97_vt1618_srbk_info,
+ .get = snd_ac97_vt1618_srbk_get,
+ .put = snd_ac97_vt1618_srbk_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Soft Mute",
+ .info = snd_ac97_vt1618_smute_info,
+ .get = snd_ac97_vt1618_smute_get,
+ .put = snd_ac97_vt1618_smute_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Aux In Jack",
+ .info = snd_ac97_vt1618_auxin_info,
+ .get = snd_ac97_vt1618_auxin_get,
+ .put = snd_ac97_vt1618_auxin_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Speaker Jack",
+ .info = snd_ac97_vt1618_UAJ0_info,
+ .get = snd_ac97_vt1618_UAJ0_get,
+ .put = snd_ac97_vt1618_UAJ0_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Line In Jack",
+ .info = snd_ac97_vt1618_UAJ1_info,
+ .get = snd_ac97_vt1618_UAJ1_get,
+ .put = snd_ac97_vt1618_UAJ1_put
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic In Jack",
+ .info = snd_ac97_vt1618_UAJ2_info,
+ .get = snd_ac97_vt1618_UAJ2_get,
+ .put = snd_ac97_vt1618_UAJ2_put
+ }
+};
+
+int patch_vt1618(struct snd_ac97 *ac97)
+{
+ return patch_build_controls(ac97, snd_ac97_controls_vt1618,
+ ARRAY_SIZE(snd_ac97_controls_vt1618));
+}
+
+
/*
*/
static void it2646_update_jacks(struct snd_ac97 *ac97)
4
8
At Mon, 18 Aug 2008 15:28:00 +0300,
Ilkka Tengvall wrote:
>
> >> the reasoning for the original patch sounds reasonable. The
> >> mic volume is tunable, only at the very low range. I recall the laptop
> >> came with Win98, and there was no problem then with the sound -> not a
> >> HW problem. I have never got this laptop mic working with linux, so
> >> this is not anything that broke recently. I see there is
> >> check_volume_resolution function which tries to guess some of the
> >> register ranges, but maybe it get's it wrong with this HW.
> >
> > Maybe, maybe not. You should check rather ac97 registers in
> > /proc/asound/card0/codec97#0/ac97#0-0+regs. If build with
> > CONFIG_SND_DEBUG=y, you can write to the register directly, too.
> > See Documentaiton[/sound/alsa]/Procfile.txt.
> >
>
> I checked this file. It seems it gets the regs right for the mic
> (range 0x1f). The capture range is 0xf. I don't have the specs to
> compare it against, so I assume there is nothing to do more here.
Which registers, exactly?
> It seems mic value decreases while going up to full, where as capture
> increases.
I guess the former one is the mic loopback volume (attenuation), so no
wonder it behaves so.
> Another difference is maybe stereo / mono related, the
> capture changes both bytes whereas mic only the other one. Also one
> thing, should the mic level be around 0x40 - 0x5f, not 0x0 - 0x1f.
The bit 0x40 indicates the mic boost +20dB.
Takashi
2
3

20 Aug '08
At Tue, 19 Aug 2008 11:53:54 -0400,
roel kluin wrote:
>
> Takashi Iwai wrote:
> > At Tue, 19 Aug 2008 08:15:05 +0200 (CEST),
> > Johannes Berg wrote:
> >> roel kluin wrote:
> >>> untested, is it correct?
> >> not a clue, do you know how long ago that was? :)
> >> does the driver check endianness anywhere?
> >
> > AFAIK snd-aoa supports only bit-endian formats (at least in
> > sound/aoa/soundbus/i2sbus-pcm.c), so this addition makes little
> > sense.
> >
> > Better to drop the duplicated words there.
>
> Thanks Johannes and Takashi,
>
> FWIW this removes the duplicates.
> ---
> Remove duplicate assignment of SNDRV_PCM_FMTBIT_S{16,24}_BE bits
>
> Signed-off-by: Roel Kluin <roel.kluin(a)gmail.com>
Thanks, applied this one now.
Takashi
> ---
> diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
> index 7a16a33..6c515b2 100644
> --- a/sound/aoa/codecs/snd-aoa-codec-tas.c
> +++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
> @@ -654,15 +654,13 @@ static struct snd_kcontrol_new bass_control = {
> static struct transfer_info tas_transfers[] = {
> {
> /* input */
> - .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S16_BE |
> - SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S24_BE,
> + .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S24_BE,
> .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
> .transfer_in = 1,
> },
> {
> /* output */
> - .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S16_BE |
> - SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S24_BE,
> + .formats = SNDRV_PCM_FMTBIT_S16_BE | SNDRV_PCM_FMTBIT_S24_BE,
> .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000,
> .transfer_in = 0,
> },
>
1
0

[alsa-devel] [PATCH] opl3sa2: replace nd_opl3sa2_info_xxx() with snd_wss_info_xxx()
by Krzysztof Helt 20 Aug '08
by Krzysztof Helt 20 Aug '08
20 Aug '08
From: Krzysztof Helt <krzysztof.h1(a)wp.pl>
Replace snd_opl3sa2_info_xxx() with snd_wss_info_xxx().
Drop check of card->private_data which cannot be NULL
if card is not NULL (spotted by Rene Herman).
Signed-off-by: Krzysztof Helt <krzysztof.h1(a)wp.pl>
---
diff -urp linux-ref/sound/isa/opl3sa2.c linux-2.6/sound/isa/opl3sa2.c
--- linux-ref/sound/isa/opl3sa2.c 2008-08-20 21:19:04.000000000 +0200
+++ linux-2.6/sound/isa/opl3sa2.c 2008-08-20 21:19:29.000000000 +0200
@@ -300,7 +300,7 @@ static irqreturn_t snd_opl3sa2_interrupt
struct snd_opl3sa2 *chip;
int handled = 0;
- if (card == NULL || card->private_data == NULL)
+ if (card == NULL)
return IRQ_NONE;
chip = card->private_data;
@@ -338,29 +338,18 @@ static irqreturn_t snd_opl3sa2_interrupt
#define OPL3SA2_SINGLE(xname, xindex, reg, shift, mask, invert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
- .info = snd_opl3sa2_info_single, \
+ .info = snd_wss_info_single, \
.get = snd_opl3sa2_get_single, .put = snd_opl3sa2_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
#define OPL3SA2_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
.name = xname, .index = xindex, \
- .info = snd_opl3sa2_info_single, \
+ .info = snd_wss_info_single, \
.get = snd_opl3sa2_get_single, .put = snd_opl3sa2_put_single, \
.private_value = reg | (shift << 8) | (mask << 16) | (invert << 24), \
.tlv = { .p = (xtlv) } }
-static int snd_opl3sa2_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
-{
- int mask = (kcontrol->private_value >> 16) & 0xff;
-
- uinfo->type = mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
- uinfo->count = 1;
- uinfo->value.integer.min = 0;
- uinfo->value.integer.max = mask;
- return 0;
-}
-
static int snd_opl3sa2_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_opl3sa2 *chip = snd_kcontrol_chip(kcontrol);
@@ -404,29 +393,18 @@ static int snd_opl3sa2_put_single(struct
#define OPL3SA2_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
- .info = snd_opl3sa2_info_double, \
+ .info = snd_wss_info_double, \
.get = snd_opl3sa2_get_double, .put = snd_opl3sa2_put_double, \
.private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
#define OPL3SA2_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
.name = xname, .index = xindex, \
- .info = snd_opl3sa2_info_double, \
+ .info = snd_wss_info_double, \
.get = snd_opl3sa2_get_double, .put = snd_opl3sa2_put_double, \
.private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22), \
.tlv = { .p = (xtlv) } }
-static int snd_opl3sa2_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
-{
- int mask = (kcontrol->private_value >> 24) & 0xff;
-
- uinfo->type = mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
- uinfo->count = 2;
- uinfo->value.integer.min = 0;
- uinfo->value.integer.max = mask;
- return 0;
-}
-
static int snd_opl3sa2_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_opl3sa2 *chip = snd_kcontrol_chip(kcontrol);
----------------------------------------------------------------------
Igrzyska na Dzikim Zachodzie!
Sprawdz >> http://link.interia.pl/f1edc
3
2

[alsa-devel] [PATCH] Try to make our poor little ALS4000 driver worthy of its copious public specs (first step)
by Andreas Mohr 20 Aug '08
by Andreas Mohr 20 Aug '08
20 Aug '08
[with not-quite-so-unintentional CCs added]
Hi,
there you have it: Linux developers are hypocrites ;)
Never omitting any opportunity to complain about missing vendor
cooperation, but what do they do once people actually do publish ample specs? -
yeah, you got that right: NOTHING!!
Let's try to change that, at least one bit at a time. ;)
ChangeLog:
- use specs-derived register name enums instead of open-coded numeric
values, for better understanding of things
- fix naming confusion ("gcr" was _NOT_ the GCR register stuff, but
instead the io _base_ which has multiplexed _access_ to GCR config
space, at _sub_ registers 0x08 and 0x0c)
- add FIXME comments about a race condition and MPU401 features
Oh, and I chose an abbreviated "ALS4K" prefix since I would have gotten
finger cramps otherwise.
Patch created on 2.6.27-rc1-git4 (no als4000.c changes up to -rc3, verified),
pushed through checkpatch.pl, verified on my ALS4000 card.
More work to follow... e.g. would be nice to get audio wakeup things to work,
since this would probably be the first (if admittedly crappy) sound card/driver
combo on Linux to support such features, thus a nice broadening of
Linux capabilities.
Thanks!
Signed-off-by: Andreas Mohr <andi(a)lisas.de>
--- sound/pci/als4000.c.org 2008-08-18 21:15:37.000000000 +0200
+++ sound/pci/als4000.c 2008-08-18 22:12:27.000000000 +0200
@@ -60,6 +60,7 @@
*
* ToDo:
* - Proper shared IRQ handling?
+ * - by default, don't enable legacy game and use PCI game I/O
* - power management? (card can do voice wakeup according to datasheet!!)
*/
@@ -107,7 +108,7 @@
struct snd_card_als4000 {
/* most frequent access first */
- unsigned long gcr;
+ unsigned long iobase;
struct pci_dev *pci;
struct snd_sb *chip;
#ifdef SUPPORT_JOYSTICK
@@ -122,24 +123,89 @@
MODULE_DEVICE_TABLE(pci, snd_als4000_ids);
-static inline void snd_als4000_gcr_write_addr(unsigned long port, u32 reg, u32 val)
+enum als4k_iobase_t {
+ /* IOx: B == Byte, W = Word, D = DWord */
+ ALS4K_IOD_00_AC97_ACCESS = 0x00,
+ ALS4K_IOW_04_AC97_READ = 0x04,
+ ALS4K_IOB_06_AC97_STATUS = 0x06,
+ ALS4K_IOB_07_IRQSTATUS = 0x07,
+ ALS4K_IOD_08_GCR_DATA = 0x08,
+ ALS4K_IOB_0C_GCR_INDEX = 0x0c,
+ ALS4K_IOB_0E_SB_MPU_IRQ = 0x0e,
+ ALS4K_IOB_10_ADLIB_ADDR0 = 0x10,
+ ALS4K_IOB_11_ADLIB_ADDR1 = 0x11,
+ ALS4K_IOB_12_ADLIB_ADDR2 = 0x12,
+ ALS4K_IOB_13_ADLIB_ADDR3 = 0x13,
+ ALS4K_IOB_14_MIXER_INDEX = 0x14,
+ ALS4K_IOB_15_MIXER_DATA = 0x15,
+ ALS4K_IOB_16_ESP_RST_PORT = 0x16,
+ ALS4K_IOB_16_CR1E_ACK_PORT = 0x16, /* 2nd function */
+ ALS4K_IOB_18_OPL_ADDR0 = 0x18,
+ ALS4K_IOB_19_OPL_ADDR1 = 0x19,
+ ALS4K_IOB_1A_ESP_RD_DATA = 0x1a,
+ ALS4K_IOB_1C_ESP_CMD_DATA = 0x1c,
+ ALS4K_IOB_1C_ESP_WR_STATUS = 0x1c, /* 2nd function */
+ ALS4K_IOB_1E_ESP_RD_STATUS8 = 0x1e,
+ ALS4K_IOB_1F_ESP_RD_STATUS16 = 0x1f,
+ ALS4K_IOB_20_ESP_GAMEPORT_200 = 0x20,
+ ALS4K_IOB_21_ESP_GAMEPORT_201 = 0x21,
+ ALS4K_IOB_30_MIDI_DATA = 0x30,
+ ALS4K_IOB_31_MIDI_STATUS = 0x31,
+ ALS4K_IOB_31_MIDI_COMMAND = 0x31, /* 2nd function */
+};
+
+enum als4k_gcr_t {
+ /* all registers 32bit wide */
+ ALS4K_GCR_8C_MISC_CTRL = 0x8c,
+ ALS4K_GCR_90_TEST_MODE_REG = 0x90,
+ ALS4K_GCR_91_DMA0_ADDR = 0x91,
+ ALS4K_GCR_92_DMA0_MODE_COUNT = 0x92,
+ ALS4K_GCR_93_DMA1_ADDR = 0x93,
+ ALS4K_GCR_94_DMA1_MODE_COUNT = 0x94,
+ ALS4K_GCR_95_DMA3_ADDR = 0x95,
+ ALS4K_GCR_96_DMA3_MODE_COUNT = 0x96,
+ ALS4K_GCR_99_DMA_EMULATION_CTRL = 0x99,
+ ALS4K_GCR_A0_FIFO1_CURRENT_ADDR = 0xa0,
+ ALS4K_GCR_A1_FIFO1_STATUS_BYTECOUNT = 0xa1,
+ ALS4K_GCR_A2_FIFO2_PCIADDR = 0xa2,
+ ALS4K_GCR_A3_FIFO2_COUNT = 0xa3,
+ ALS4K_GCR_A4_FIFO2_CURRENT_ADDR = 0xa4,
+ ALS4K_GCR_A5_FIFO1_STATUS_BYTECOUNT = 0xa5,
+ ALS4K_GCR_A6_PM_CTRL = 0xa6,
+ ALS4K_GCR_A7_PCI_ACCESS_STORAGE = 0xa7,
+ ALS4K_GCR_A8_LEGACY_CFG1 = 0xa8,
+ ALS4K_GCR_A9_LEGACY_CFG2 = 0xa9,
+ ALS4K_GCR_FF_DUMMY_SCRATCH = 0xff,
+};
+
+enum als4k_gcr_8c_t {
+ ALS4K_GCR_8C_IRQ_MASK_CTRL_ENABLE = 0x8000,
+ ALS4K_GCR_8C_CHIP_REV_MASK = 0xf0000
+};
+
+static inline void snd_als4000_gcr_write_addr(unsigned long iobase,
+ enum als4k_gcr_t reg,
+ u32 val)
{
- outb(reg, port+0x0c);
- outl(val, port+0x08);
+ outb(reg, iobase + ALS4K_IOB_0C_GCR_INDEX);
+ outl(val, iobase + ALS4K_IOD_08_GCR_DATA);
}
-static inline void snd_als4000_gcr_write(struct snd_sb *sb, u32 reg, u32 val)
+static inline void snd_als4000_gcr_write(struct snd_sb *sb,
+ enum als4k_gcr_t reg,
+ u32 val)
{
snd_als4000_gcr_write_addr(sb->alt_port, reg, val);
}
-static inline u32 snd_als4000_gcr_read_addr(unsigned long port, u32 reg)
+static inline u32 snd_als4000_gcr_read_addr(unsigned long iobase,
+ enum als4k_gcr_t reg)
{
- outb(reg, port+0x0c);
- return inl(port+0x08);
+ outb(reg, iobase + ALS4K_IOB_0C_GCR_INDEX);
+ return inl(iobase + ALS4K_IOD_08_GCR_DATA);
}
-static inline u32 snd_als4000_gcr_read(struct snd_sb *sb, u32 reg)
+static inline u32 snd_als4000_gcr_read(struct snd_sb *sb, enum als4k_gcr_t reg)
{
return snd_als4000_gcr_read_addr(sb->alt_port, reg);
}
@@ -156,15 +222,17 @@
static inline void snd_als4000_set_capture_dma(struct snd_sb *chip,
dma_addr_t addr, unsigned size)
{
- snd_als4000_gcr_write(chip, 0xa2, addr);
- snd_als4000_gcr_write(chip, 0xa3, (size-1));
+ snd_als4000_gcr_write(chip, ALS4K_GCR_A2_FIFO2_PCIADDR, addr);
+ snd_als4000_gcr_write(chip, ALS4K_GCR_A3_FIFO2_COUNT, (size-1));
}
static inline void snd_als4000_set_playback_dma(struct snd_sb *chip,
- dma_addr_t addr, unsigned size)
+ dma_addr_t addr,
+ unsigned size)
{
- snd_als4000_gcr_write(chip, 0x91, addr);
- snd_als4000_gcr_write(chip, 0x92, (size-1)|0x180000);
+ snd_als4000_gcr_write(chip, ALS4K_GCR_91_DMA0_ADDR, addr);
+ snd_als4000_gcr_write(chip, ALS4K_GCR_92_DMA0_MODE_COUNT,
+ (size-1)|0x180000);
}
#define ALS4000_FORMAT_SIGNED (1<<0)
@@ -305,6 +373,12 @@
struct snd_sb *chip = snd_pcm_substream_chip(substream);
int result = 0;
+ /* FIXME race condition in here!!!
+ chip->mode non-atomic update gets consistently protected
+ by reg_lock always, _except_ for this place!!
+ Probably need to take reg_lock as outer (or inner??) lock, too.
+ (or serialize both lock operations? probably not, though... - racy?)
+ */
spin_lock(&chip->mixer_lock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -356,7 +430,8 @@
unsigned int result;
spin_lock(&chip->reg_lock);
- result = snd_als4000_gcr_read(chip, 0xa4) & 0xffff;
+ result = snd_als4000_gcr_read(chip, ALS4K_GCR_A4_FIFO2_CURRENT_ADDR);
+ result &= 0xffff;
spin_unlock(&chip->reg_lock);
return bytes_to_frames( substream->runtime, result );
}
@@ -367,7 +442,8 @@
unsigned result;
spin_lock(&chip->reg_lock);
- result = snd_als4000_gcr_read(chip, 0xa0) & 0xffff;
+ result = snd_als4000_gcr_read(chip, ALS4K_GCR_A0_FIFO1_CURRENT_ADDR);
+ result &= 0xffff;
spin_unlock(&chip->reg_lock);
return bytes_to_frames( substream->runtime, result );
}
@@ -376,12 +452,13 @@
* return IRQ_HANDLED no matter whether we actually had an IRQ flag or not).
* ALS4000a.PDF writes that while ACKing IRQ in PCI block will *not* ACK
* the IRQ in the SB core, ACKing IRQ in SB block *will* ACK the PCI IRQ
- * register (alt_port + 0x0e). Probably something could be optimized here to
- * query/write one register only...
+ * register (alt_port + ALS4K_IOB_0E_SB_MPU_IRQ). Probably something
+ * could be optimized here to query/write one register only...
* And even if both registers need to be queried, then there's still the
* question of whether it's actually correct to ACK PCI IRQ before reading
* SB IRQ like we do now, since ALS4000a.PDF mentions that PCI IRQ will *clear*
* SB IRQ status.
+ * (hmm, page 38 mentions it the other way around!)
* And do we *really* need the lock here for *reading* SB_DSP4_IRQSTATUS??
* */
static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id)
@@ -391,7 +468,7 @@
unsigned sb_status;
/* find out which bit of the ALS4000 produced the interrupt */
- gcr_status = inb(chip->alt_port + 0xe);
+ gcr_status = inb(chip->alt_port + ALS4K_IOB_0E_SB_MPU_IRQ);
if ((gcr_status & 0x80) && (chip->playback_substream)) /* playback */
snd_pcm_period_elapsed(chip->playback_substream);
@@ -400,7 +477,7 @@
if ((gcr_status & 0x10) && (chip->rmidi)) /* MPU401 interrupt */
snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data);
/* release the gcr */
- outb(gcr_status, chip->alt_port + 0xe);
+ outb(gcr_status, chip->alt_port + ALS4K_IOB_0E_SB_MPU_IRQ);
spin_lock(&chip->mixer_lock);
sb_status = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
@@ -543,25 +620,25 @@
/******************************************************************/
-static void snd_als4000_set_addr(unsigned long gcr,
- unsigned int sb,
- unsigned int mpu,
- unsigned int opl,
- unsigned int game)
-{
- u32 confA = 0;
- u32 confB = 0;
-
- if (mpu > 0)
- confB |= (mpu | 1) << 16;
- if (sb > 0)
- confB |= (sb | 1);
- if (game > 0)
- confA |= (game | 1) << 16;
- if (opl > 0)
- confA |= (opl | 1);
- snd_als4000_gcr_write_addr(gcr, 0xa8, confA);
- snd_als4000_gcr_write_addr(gcr, 0xa9, confB);
+static void snd_als4000_set_addr(unsigned long iobase,
+ unsigned int sb_io,
+ unsigned int mpu_io,
+ unsigned int opl_io,
+ unsigned int game_io)
+{
+ u32 cfg1 = 0;
+ u32 cfg2 = 0;
+
+ if (mpu_io > 0)
+ cfg2 |= (mpu_io | 1) << 16;
+ if (sb_io > 0)
+ cfg2 |= (sb_io | 1);
+ if (game_io > 0)
+ cfg1 |= (game_io | 1) << 16;
+ if (opl_io > 0)
+ cfg1 |= (opl_io | 1);
+ snd_als4000_gcr_write_addr(iobase, ALS4K_GCR_A8_LEGACY_CFG1, cfg1);
+ snd_als4000_gcr_write_addr(iobase, ALS4K_GCR_A9_LEGACY_CFG2, cfg2);
}
static void snd_als4000_configure(struct snd_sb *chip)
@@ -579,12 +656,15 @@
spin_unlock_irq(&chip->mixer_lock);
spin_lock_irq(&chip->reg_lock);
- /* magic number. Enables interrupts(?) */
- snd_als4000_gcr_write(chip, 0x8c, 0x28000);
- for(i = 0x91; i <= 0x96; ++i)
+ /* enable interrupts */
+ snd_als4000_gcr_write(chip, ALS4K_GCR_8C_MISC_CTRL,
+ ALS4K_GCR_8C_IRQ_MASK_CTRL_ENABLE);
+
+ for (i = ALS4K_GCR_91_DMA0_ADDR; i <= ALS4K_GCR_96_DMA3_MODE_COUNT; ++i)
snd_als4000_gcr_write(chip, i, 0);
- snd_als4000_gcr_write(chip, 0x99, snd_als4000_gcr_read(chip, 0x99));
+ snd_als4000_gcr_write(chip, ALS4K_GCR_99_DMA_EMULATION_CTRL,
+ snd_als4000_gcr_read(chip, ALS4K_GCR_99_DMA_EMULATION_CTRL));
spin_unlock_irq(&chip->reg_lock);
}
@@ -628,7 +708,7 @@
gameport_set_port_data(gp, r);
/* Enable legacy joystick port */
- snd_als4000_set_addr(acard->gcr, 0, 0, 0, 1);
+ snd_als4000_set_addr(acard->iobase, 0, 0, 0, 1);
gameport_register_port(acard->gameport);
@@ -643,7 +723,9 @@
gameport_unregister_port(acard->gameport);
acard->gameport = NULL;
- snd_als4000_set_addr(acard->gcr, 0, 0, 0, 0); /* disable joystick */
+ /* disable joystick */
+ snd_als4000_set_addr(acard->iobase, 0, 0, 0, 0);
+
release_and_free_resource(r);
}
}
@@ -654,10 +736,10 @@
static void snd_card_als4000_free( struct snd_card *card )
{
- struct snd_card_als4000 * acard = (struct snd_card_als4000 *)card->private_data;
+ struct snd_card_als4000 *acard = card->private_data;
/* make sure that interrupts are disabled */
- snd_als4000_gcr_write_addr( acard->gcr, 0x8c, 0);
+ snd_als4000_gcr_write_addr(acard->iobase, ALS4K_GCR_8C_MISC_CTRL, 0);
/* free resources */
snd_als4000_free_gameport(acard);
pci_release_regions(acard->pci);
@@ -670,7 +752,7 @@
static int dev;
struct snd_card *card;
struct snd_card_als4000 *acard;
- unsigned long gcr;
+ unsigned long iobase;
struct snd_sb *chip;
struct snd_opl3 *opl3;
unsigned short word;
@@ -699,7 +781,7 @@
pci_disable_device(pci);
return err;
}
- gcr = pci_resource_start(pci, 0);
+ iobase = pci_resource_start(pci, 0);
pci_read_config_word(pci, PCI_COMMAND, &word);
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
@@ -713,16 +795,16 @@
return -ENOMEM;
}
- acard = (struct snd_card_als4000 *)card->private_data;
+ acard = card->private_data;
acard->pci = pci;
- acard->gcr = gcr;
+ acard->iobase = iobase;
card->private_free = snd_card_als4000_free;
/* disable all legacy ISA stuff */
- snd_als4000_set_addr(acard->gcr, 0, 0, 0, 0);
+ snd_als4000_set_addr(acard->iobase, 0, 0, 0, 0);
if ((err = snd_sbdsp_create(card,
- gcr + 0x10,
+ iobase + ALS4K_IOB_10_ADLIB_ADDR0,
pci->irq,
snd_als4000_interrupt,
-1,
@@ -734,7 +816,7 @@
acard->chip = chip;
chip->pci = pci;
- chip->alt_port = gcr;
+ chip->alt_port = iobase;
snd_card_set_dev(card, &pci->dev);
snd_als4000_configure(chip);
@@ -745,11 +827,16 @@
card->shortname, chip->alt_port, chip->irq);
if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_ALS4000,
- gcr+0x30, MPU401_INFO_INTEGRATED,
+ iobase + ALS4K_IOB_30_MIDI_DATA,
+ MPU401_INFO_INTEGRATED,
pci->irq, 0, &chip->rmidi)) < 0) {
- printk(KERN_ERR "als4000: no MPU-401 device at 0x%lx?\n", gcr+0x30);
+ printk(KERN_ERR "als4000: no MPU-401 device at 0x%lx?\n",
+ iobase + ALS4K_IOB_30_MIDI_DATA);
goto out_err;
}
+ /* FIXME: ALS4000 has interesting MPU401 configuration features
+ * at CR 0x1A (pass-thru / UART switching, fast MIDI clock, etc.),
+ * however there doesn't seem to be an ALSA API for this... */
if ((err = snd_als4000_pcm(chip, 0)) < 0) {
goto out_err;
@@ -758,10 +845,13 @@
goto out_err;
}
- if (snd_opl3_create(card, gcr+0x10, gcr+0x12,
+ if (snd_opl3_create(card,
+ iobase + ALS4K_IOB_10_ADLIB_ADDR0,
+ iobase + ALS4K_IOB_12_ADLIB_ADDR2,
OPL3_HW_AUTO, 1, &opl3) < 0) {
printk(KERN_ERR "als4000: no OPL device at 0x%lx-0x%lx?\n",
- gcr+0x10, gcr+0x12 );
+ iobase + ALS4K_IOB_10_ADLIB_ADDR0,
+ iobase + ALS4K_IOB_12_ADLIB_ADDR2);
} else {
if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
goto out_err;
@@ -831,13 +921,13 @@
#ifdef SUPPORT_JOYSTICK
if (acard->gameport)
- snd_als4000_set_addr(acard->gcr, 0, 0, 0, 1);
+ snd_als4000_set_addr(acard->iobase, 0, 0, 0, 1);
#endif
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
-#endif
+#endif /* CONFIG_PM */
static struct pci_driver driver = {
4
4
When calling snd_pcm_write* from a thread how do you safely cancel the
thread? I've tried masking the signals which are used in alsa lib, yet
I am getting a segfault on pthread_exit(). My thread is looping doing
the following.
testcancel
snd_pcm_wait
snd_pcm_avail
snd_pcm_writei
I am checking return values to handle those functions being woken up by
pthread cancel and attempting to exit. In testing the process it
performs fine until I start actually writing data. Once I write some
data, a pthread_exit will segfault. My cancellation routine is calling
snd_pcm_drop, then doing a cancel followed by join.
2
2