Alsa-devel
Threads by month
- ----- 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
September 2008
- 101 participants
- 247 discussions
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
08 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