Commit b5b4a41b authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Takashi Iwai

ALSA: echoaudio: remove all snd_printk

removed all references of snd_printk with the standard dev_* macro.

[a few places degraded to dev_dbg(), too -- tiwai]
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e3690869
......@@ -33,12 +33,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Darla20\n"));
dev_dbg(chip->card->dev, "init_hw() - Darla20\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA20))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw: could not initialize DSP comm page\n");
return err;
}
......@@ -57,7 +58,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw: done\n");
return err;
}
......
......@@ -33,12 +33,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Darla24\n"));
dev_dbg(chip->card->dev, "init_hw() - Darla24\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != DARLA24))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw: could not initialize DSP comm page\n");
return err;
}
......@@ -56,7 +57,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw: done\n");
return err;
}
......@@ -128,15 +129,17 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
clock = GD24_8000;
break;
default:
DE_ACT(("set_sample_rate: Error, invalid sample rate %d\n",
rate));
dev_err(chip->card->dev,
"set_sample_rate: Error, invalid sample rate %d\n",
rate);
return -EINVAL;
}
if (wait_handshake(chip))
return -EIO;
DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock));
dev_dbg(chip->card->dev,
"set_sample_rate: %d clock %d\n", rate, clock);
chip->sample_rate = rate;
/* Override the sample rate if this card is set to Echo sync. */
......
......@@ -46,12 +46,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
int err;
local_irq_enable();
DE_INIT(("init_hw() - Echo3G\n"));
dev_dbg(chip->card->dev, "init_hw() - Echo3G\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != ECHO3G))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -98,7 +99,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL |
ECHOCAPS_HAS_DIGITAL_MODE_ADAT;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......
This diff is collapsed.
......@@ -295,34 +295,6 @@
#define PIPE_STATE_PENDING 3 /* Pipe has pending start */
/* Debug initialization */
#ifdef CONFIG_SND_DEBUG
#define DE_INIT(x) snd_printk x
#else
#define DE_INIT(x)
#endif
/* Debug hw_params callbacks */
#ifdef CONFIG_SND_DEBUG
#define DE_HWP(x) snd_printk x
#else
#define DE_HWP(x)
#endif
/* Debug normal activity (open, start, stop...) */
#ifdef CONFIG_SND_DEBUG
#define DE_ACT(x) snd_printk x
#else
#define DE_ACT(x)
#endif
/* Debug midi activity */
#ifdef CONFIG_SND_DEBUG
#define DE_MID(x) snd_printk x
#else
#define DE_MID(x)
#endif
struct audiopipe {
volatile u32 *dma_counter; /* Commpage register that contains
......
......@@ -51,7 +51,7 @@ static int check_asic_status(struct echoaudio *chip)
}
box_status = le32_to_cpu(chip->comm_page->ext_box_status);
DE_INIT(("box_status=%x\n", box_status));
dev_dbg(chip->card->dev, "box_status=%x\n", box_status);
if (box_status == E3G_ASIC_NOT_LOADED)
return -ENODEV;
......@@ -76,7 +76,8 @@ static int write_control_reg(struct echoaudio *chip, u32 ctl, u32 frq,
if (wait_handshake(chip))
return -EIO;
DE_ACT(("WriteControlReg: Setting 0x%x, 0x%x\n", ctl, frq));
dev_dbg(chip->card->dev,
"WriteControlReg: Setting 0x%x, 0x%x\n", ctl, frq);
ctl = cpu_to_le32(ctl);
frq = cpu_to_le32(frq);
......@@ -89,7 +90,7 @@ static int write_control_reg(struct echoaudio *chip, u32 ctl, u32 frq,
return send_vector(chip, DSP_VC_WRITE_CONTROL_REG);
}
DE_ACT(("WriteControlReg: not written, no change\n"));
dev_dbg(chip->card->dev, "WriteControlReg: not written, no change\n");
return 0;
}
......@@ -258,8 +259,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
/* Only set the clock for internal mode. */
if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
DE_ACT(("set_sample_rate: Cannot set sample rate - "
"clock not set to CLK_CLOCKININTERNAL\n"));
dev_warn(chip->card->dev,
"Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n");
/* Save the rate anyhow */
chip->comm_page->sample_rate = cpu_to_le32(rate);
chip->sample_rate = rate;
......@@ -313,7 +314,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */
chip->sample_rate = rate;
DE_ACT(("SetSampleRate: %d clock %x\n", rate, control_reg));
dev_dbg(chip->card->dev,
"SetSampleRate: %d clock %x\n", rate, control_reg);
/* Tell the DSP about it - DSP reads both control reg & freq reg */
return write_control_reg(chip, control_reg, frq_reg, 0);
......@@ -326,7 +328,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
{
u32 control_reg, clocks_from_dsp;
DE_ACT(("set_input_clock:\n"));
dev_dbg(chip->card->dev, "set_input_clock:\n");
/* Mask off the clock select bits */
control_reg = le32_to_cpu(chip->comm_page->control_register) &
......@@ -335,13 +337,13 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
switch (clock) {
case ECHO_CLOCK_INTERNAL:
DE_ACT(("Set Echo3G clock to INTERNAL\n"));
dev_dbg(chip->card->dev, "Set Echo3G clock to INTERNAL\n");
chip->input_clock = ECHO_CLOCK_INTERNAL;
return set_sample_rate(chip, chip->sample_rate);
case ECHO_CLOCK_SPDIF:
if (chip->digital_mode == DIGITAL_MODE_ADAT)
return -EAGAIN;
DE_ACT(("Set Echo3G clock to SPDIF\n"));
dev_dbg(chip->card->dev, "Set Echo3G clock to SPDIF\n");
control_reg |= E3G_SPDIF_CLOCK;
if (clocks_from_dsp & E3G_CLOCK_DETECT_BIT_SPDIF96)
control_reg |= E3G_DOUBLE_SPEED_MODE;
......@@ -351,12 +353,12 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
case ECHO_CLOCK_ADAT:
if (chip->digital_mode != DIGITAL_MODE_ADAT)
return -EAGAIN;
DE_ACT(("Set Echo3G clock to ADAT\n"));
dev_dbg(chip->card->dev, "Set Echo3G clock to ADAT\n");
control_reg |= E3G_ADAT_CLOCK;
control_reg &= ~E3G_DOUBLE_SPEED_MODE;
break;
case ECHO_CLOCK_WORD:
DE_ACT(("Set Echo3G clock to WORD\n"));
dev_dbg(chip->card->dev, "Set Echo3G clock to WORD\n");
control_reg |= E3G_WORD_CLOCK;
if (clocks_from_dsp & E3G_CLOCK_DETECT_BIT_WORD96)
control_reg |= E3G_DOUBLE_SPEED_MODE;
......@@ -364,7 +366,8 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
control_reg &= ~E3G_DOUBLE_SPEED_MODE;
break;
default:
DE_ACT(("Input clock 0x%x not supported for Echo3G\n", clock));
dev_err(chip->card->dev,
"Input clock 0x%x not supported for Echo3G\n", clock);
return -EINVAL;
}
......@@ -392,7 +395,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
incompatible_clock = TRUE;
break;
default:
DE_ACT(("Digital mode not supported: %d\n", mode));
dev_err(chip->card->dev,
"Digital mode not supported: %d\n", mode);
return -EINVAL;
}
......@@ -427,6 +431,6 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
return err;
chip->digital_mode = mode;
DE_ACT(("set_digital_mode(%d)\n", chip->digital_mode));
dev_dbg(chip->card->dev, "set_digital_mode(%d)\n", chip->digital_mode);
return incompatible_clock;
}
This diff is collapsed.
......@@ -46,7 +46,8 @@ static int check_asic_status(struct echoaudio *chip)
/* The DSP will return a value to indicate whether or not the
ASIC is currently loaded */
if (read_dsp(chip, &asic_status) < 0) {
DE_INIT(("check_asic_status: failed on read_dsp\n"));
dev_err(chip->card->dev,
"check_asic_status: failed on read_dsp\n");
chip->asic_loaded = FALSE;
return -EIO;
}
......@@ -68,7 +69,7 @@ static int write_control_reg(struct echoaudio *chip, u32 value, char force)
else
value &= ~GML_DIGITAL_IN_AUTO_MUTE;
DE_ACT(("write_control_reg: 0x%x\n", value));
dev_dbg(chip->card->dev, "write_control_reg: 0x%x\n", value);
/* Write the control register */
value = cpu_to_le32(value);
......@@ -91,7 +92,7 @@ If the auto-mute is disabled, the digital inputs are enabled regardless of
what the input clock is set or what is connected. */
static int set_input_auto_mute(struct echoaudio *chip, int automute)
{
DE_ACT(("set_input_auto_mute %d\n", automute));
dev_dbg(chip->card->dev, "set_input_auto_mute %d\n", automute);
chip->digital_in_automute = automute;
......@@ -194,7 +195,7 @@ static int set_professional_spdif(struct echoaudio *chip, char prof)
if ((err = write_control_reg(chip, control_reg, FALSE)))
return err;
chip->professional_spdif = prof;
DE_ACT(("set_professional_spdif to %s\n",
prof ? "Professional" : "Consumer"));
dev_dbg(chip->card->dev, "set_professional_spdif to %s\n",
prof ? "Professional" : "Consumer");
return 0;
}
......@@ -37,12 +37,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Gina20\n"));
dev_dbg(chip->card->dev, "init_hw() - Gina20\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != GINA20))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -62,7 +63,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -149,7 +150,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
static int set_input_clock(struct echoaudio *chip, u16 clock)
{
DE_ACT(("set_input_clock:\n"));
dev_dbg(chip->card->dev, "set_input_clock:\n");
switch (clock) {
case ECHO_CLOCK_INTERNAL:
......@@ -158,7 +159,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
chip->spdif_status = GD_SPDIF_STATUS_UNDEF;
set_sample_rate(chip, chip->sample_rate);
chip->input_clock = clock;
DE_ACT(("Set Gina clock to INTERNAL\n"));
dev_dbg(chip->card->dev, "Set Gina clock to INTERNAL\n");
break;
case ECHO_CLOCK_SPDIF:
chip->comm_page->gd_clock_state = GD_CLOCK_SPDIFIN;
......@@ -166,7 +167,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
clear_handshake(chip);
send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
chip->clock_state = GD_CLOCK_SPDIFIN;
DE_ACT(("Set Gina20 clock to SPDIF\n"));
dev_dbg(chip->card->dev, "Set Gina20 clock to SPDIF\n");
chip->input_clock = clock;
break;
default:
......@@ -208,7 +209,7 @@ static int update_flags(struct echoaudio *chip)
static int set_professional_spdif(struct echoaudio *chip, char prof)
{
DE_ACT(("set_professional_spdif %d\n", prof));
dev_dbg(chip->card->dev, "set_professional_spdif %d\n", prof);
if (prof)
chip->comm_page->flags |=
cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF);
......
......@@ -41,12 +41,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Gina24\n"));
dev_dbg(chip->card->dev, "init_hw() - Gina24\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != GINA24))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -78,7 +79,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -155,7 +156,7 @@ static int load_asic(struct echoaudio *chip)
control_reg = GML_CONVERTER_ENABLE | GML_48KHZ;
err = write_control_reg(chip, control_reg, TRUE);
}
DE_INIT(("load_asic() done\n"));
dev_dbg(chip->card->dev, "load_asic() done\n");
return err;
}
......@@ -171,8 +172,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
/* Only set the clock for internal mode. */
if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
DE_ACT(("set_sample_rate: Cannot set sample rate - "
"clock not set to CLK_CLOCKININTERNAL\n"));
dev_warn(chip->card->dev,
"Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n");
/* Save the rate anyhow */
chip->comm_page->sample_rate = cpu_to_le32(rate);
chip->sample_rate = rate;
......@@ -217,7 +218,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
clock = GML_8KHZ;
break;
default:
DE_ACT(("set_sample_rate: %d invalid!\n", rate));
dev_err(chip->card->dev,
"set_sample_rate: %d invalid!\n", rate);
return -EINVAL;
}
......@@ -225,7 +227,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */
chip->sample_rate = rate;
DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock));
dev_dbg(chip->card->dev, "set_sample_rate: %d clock %d\n", rate, clock);
return write_control_reg(chip, control_reg, FALSE);
}
......@@ -236,7 +238,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
{
u32 control_reg, clocks_from_dsp;
DE_ACT(("set_input_clock:\n"));
dev_dbg(chip->card->dev, "set_input_clock:\n");
/* Mask off the clock select bits */
control_reg = le32_to_cpu(chip->comm_page->control_register) &
......@@ -245,13 +247,13 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
switch (clock) {
case ECHO_CLOCK_INTERNAL:
DE_ACT(("Set Gina24 clock to INTERNAL\n"));
dev_dbg(chip->card->dev, "Set Gina24 clock to INTERNAL\n");
chip->input_clock = ECHO_CLOCK_INTERNAL;
return set_sample_rate(chip, chip->sample_rate);
case ECHO_CLOCK_SPDIF:
if (chip->digital_mode == DIGITAL_MODE_ADAT)
return -EAGAIN;
DE_ACT(("Set Gina24 clock to SPDIF\n"));
dev_dbg(chip->card->dev, "Set Gina24 clock to SPDIF\n");
control_reg |= GML_SPDIF_CLOCK;
if (clocks_from_dsp & GML_CLOCK_DETECT_BIT_SPDIF96)
control_reg |= GML_DOUBLE_SPEED_MODE;
......@@ -261,21 +263,22 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
case ECHO_CLOCK_ADAT:
if (chip->digital_mode != DIGITAL_MODE_ADAT)
return -EAGAIN;
DE_ACT(("Set Gina24 clock to ADAT\n"));
dev_dbg(chip->card->dev, "Set Gina24 clock to ADAT\n");
control_reg |= GML_ADAT_CLOCK;
control_reg &= ~GML_DOUBLE_SPEED_MODE;
break;
case ECHO_CLOCK_ESYNC:
DE_ACT(("Set Gina24 clock to ESYNC\n"));
dev_dbg(chip->card->dev, "Set Gina24 clock to ESYNC\n");
control_reg |= GML_ESYNC_CLOCK;
control_reg &= ~GML_DOUBLE_SPEED_MODE;
break;
case ECHO_CLOCK_ESYNC96:
DE_ACT(("Set Gina24 clock to ESYNC96\n"));
dev_dbg(chip->card->dev, "Set Gina24 clock to ESYNC96\n");
control_reg |= GML_ESYNC_CLOCK | GML_DOUBLE_SPEED_MODE;
break;
default:
DE_ACT(("Input clock 0x%x not supported for Gina24\n", clock));
dev_err(chip->card->dev,
"Input clock 0x%x not supported for Gina24\n", clock);
return -EINVAL;
}
......@@ -304,7 +307,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
incompatible_clock = TRUE;
break;
default:
DE_ACT(("Digital mode not supported: %d\n", mode));
dev_err(chip->card->dev,
"Digital mode not supported: %d\n", mode);
return -EINVAL;
}
......@@ -344,6 +348,7 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
return err;
chip->digital_mode = mode;
DE_ACT(("set_digital_mode to %d\n", chip->digital_mode));
dev_dbg(chip->card->dev,
"set_digital_mode to %d\n", chip->digital_mode);
return incompatible_clock;
}
......@@ -38,12 +38,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Indigo\n"));
dev_dbg(chip->card->dev, "init_hw() - Indigo\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -60,7 +61,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -109,7 +110,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
control_reg = MIA_32000;
break;
default:
DE_ACT(("set_sample_rate: %d invalid!\n", rate));
dev_err(chip->card->dev,
"set_sample_rate: %d invalid!\n", rate);
return -EINVAL;
}
......@@ -147,7 +149,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
index = output * num_pipes_out(chip) + pipe;
chip->comm_page->vmixer[index] = gain;
DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
dev_dbg(chip->card->dev,
"set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain);
return 0;
}
......
......@@ -61,7 +61,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
control_reg |= clock;
if (control_reg != old_control_reg) {
DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock));
dev_dbg(chip->card->dev,
"set_sample_rate: %d clock %d\n", rate, clock);
chip->comm_page->control_register = cpu_to_le32(control_reg);
chip->sample_rate = rate;
clear_handshake(chip);
......@@ -89,7 +90,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
index = output * num_pipes_out(chip) + pipe;
chip->comm_page->vmixer[index] = gain;
DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
dev_dbg(chip->card->dev,
"set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain);
return 0;
}
......
......@@ -38,12 +38,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Indigo DJ\n"));
dev_dbg(chip->card->dev, "init_hw() - Indigo DJ\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJ))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -60,7 +61,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -109,7 +110,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
control_reg = MIA_32000;
break;
default:
DE_ACT(("set_sample_rate: %d invalid!\n", rate));
dev_err(chip->card->dev,
"set_sample_rate: %d invalid!\n", rate);
return -EINVAL;
}
......@@ -147,7 +149,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
index = output * num_pipes_out(chip) + pipe;
chip->comm_page->vmixer[index] = gain;
DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
dev_dbg(chip->card->dev,
"set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain);
return 0;
}
......
......@@ -35,13 +35,14 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Indigo DJx\n"));
dev_dbg(chip->card->dev, "init_hw() - Indigo DJx\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJX))
return -ENODEV;
err = init_dsp_comm_page(chip);
if (err < 0) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -59,7 +60,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......
......@@ -38,12 +38,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Indigo IO\n"));
dev_dbg(chip->card->dev, "init_hw() - Indigo IO\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IO))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -60,7 +61,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -118,7 +119,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
index = output * num_pipes_out(chip) + pipe;
chip->comm_page->vmixer[index] = gain;
DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
dev_dbg(chip->card->dev,
"set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain);
return 0;
}
......
......@@ -35,13 +35,14 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Indigo IOx\n"));
dev_dbg(chip->card->dev, "init_hw() - Indigo IOx\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX))
return -ENODEV;
err = init_dsp_comm_page(chip);
if (err < 0) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -59,7 +60,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......
......@@ -40,12 +40,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Layla20\n"));
dev_dbg(chip->card->dev, "init_hw() - Layla20\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA20))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -64,7 +65,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -121,7 +122,8 @@ static int check_asic_status(struct echoaudio *chip)
/* The DSP will return a value to indicate whether or not
the ASIC is currently loaded */
if (read_dsp(chip, &asic_status) < 0) {
DE_ACT(("check_asic_status: failed on read_dsp\n"));
dev_err(chip->card->dev,
"check_asic_status: failed on read_dsp\n");
return -EIO;
}
......@@ -164,8 +166,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
/* Only set the clock for internal mode. Do not return failure,
simply treat it as a non-event. */
if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
DE_ACT(("set_sample_rate: Cannot set sample rate - "
"clock not set to CLK_CLOCKININTERNAL\n"));
dev_warn(chip->card->dev,
"Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n");
chip->comm_page->sample_rate = cpu_to_le32(rate);
chip->sample_rate = rate;
return 0;
......@@ -174,7 +176,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
if (wait_handshake(chip))
return -EIO;
DE_ACT(("set_sample_rate(%d)\n", rate));
dev_dbg(chip->card->dev, "set_sample_rate(%d)\n", rate);
chip->sample_rate = rate;
chip->comm_page->sample_rate = cpu_to_le32(rate);
clear_handshake(chip);
......@@ -188,29 +190,30 @@ static int set_input_clock(struct echoaudio *chip, u16 clock_source)
u16 clock;
u32 rate;
DE_ACT(("set_input_clock:\n"));
dev_dbg(chip->card->dev, "set_input_clock:\n");
rate = 0;
switch (clock_source) {
case ECHO_CLOCK_INTERNAL:
DE_ACT(("Set Layla20 clock to INTERNAL\n"));
dev_dbg(chip->card->dev, "Set Layla20 clock to INTERNAL\n");
rate = chip->sample_rate;
clock = LAYLA20_CLOCK_INTERNAL;
break;
case ECHO_CLOCK_SPDIF:
DE_ACT(("Set Layla20 clock to SPDIF\n"));
dev_dbg(chip->card->dev, "Set Layla20 clock to SPDIF\n");
clock = LAYLA20_CLOCK_SPDIF;
break;
case ECHO_CLOCK_WORD:
DE_ACT(("Set Layla20 clock to WORD\n"));
dev_dbg(chip->card->dev, "Set Layla20 clock to WORD\n");
clock = LAYLA20_CLOCK_WORD;
break;
case ECHO_CLOCK_SUPER:
DE_ACT(("Set Layla20 clock to SUPER\n"));
dev_dbg(chip->card->dev, "Set Layla20 clock to SUPER\n");
clock = LAYLA20_CLOCK_SUPER;
break;
default:
DE_ACT(("Input clock 0x%x not supported for Layla24\n",
clock_source));
dev_err(chip->card->dev,
"Input clock 0x%x not supported for Layla24\n",
clock_source);
return -EINVAL;
}
chip->input_clock = clock_source;
......@@ -229,7 +232,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock_source)
static int set_output_clock(struct echoaudio *chip, u16 clock)
{
DE_ACT(("set_output_clock: %d\n", clock));
dev_dbg(chip->card->dev, "set_output_clock: %d\n", clock);
switch (clock) {
case ECHO_CLOCK_SUPER:
clock = LAYLA20_OUTPUT_CLOCK_SUPER;
......@@ -238,7 +241,7 @@ static int set_output_clock(struct echoaudio *chip, u16 clock)
clock = LAYLA20_OUTPUT_CLOCK_WORD;
break;
default:
DE_ACT(("set_output_clock wrong clock\n"));
dev_err(chip->card->dev, "set_output_clock wrong clock\n");
return -EINVAL;
}
......@@ -283,7 +286,7 @@ static int update_flags(struct echoaudio *chip)
static int set_professional_spdif(struct echoaudio *chip, char prof)
{
DE_ACT(("set_professional_spdif %d\n", prof));
dev_dbg(chip->card->dev, "set_professional_spdif %d\n", prof);
if (prof)
chip->comm_page->flags |=
cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF);
......
......@@ -40,12 +40,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Layla24\n"));
dev_dbg(chip->card->dev, "init_hw() - Layla24\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA24))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -69,7 +70,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
if ((err = init_line_levels(chip)) < 0)
return err;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -117,7 +118,7 @@ static int load_asic(struct echoaudio *chip)
if (chip->asic_loaded)
return 1;
DE_INIT(("load_asic\n"));
dev_dbg(chip->card->dev, "load_asic\n");
/* Give the DSP a few milliseconds to settle down */
mdelay(10);
......@@ -151,7 +152,7 @@ static int load_asic(struct echoaudio *chip)
err = write_control_reg(chip, GML_CONVERTER_ENABLE | GML_48KHZ,
TRUE);
DE_INIT(("load_asic() done\n"));
dev_dbg(chip->card->dev, "load_asic() done\n");
return err;
}
......@@ -167,8 +168,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
/* Only set the clock for internal mode. */
if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
DE_ACT(("set_sample_rate: Cannot set sample rate - "
"clock not set to CLK_CLOCKININTERNAL\n"));
dev_warn(chip->card->dev,
"Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n");
/* Save the rate anyhow */
chip->comm_page->sample_rate = cpu_to_le32(rate);
chip->sample_rate = rate;
......@@ -241,7 +242,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP ? */
chip->sample_rate = rate;
DE_ACT(("set_sample_rate: %d clock %d\n", rate, control_reg));
dev_dbg(chip->card->dev,
"set_sample_rate: %d clock %d\n", rate, control_reg);
return write_control_reg(chip, control_reg, FALSE);
}
......@@ -260,7 +262,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
/* Pick the new clock */
switch (clock) {
case ECHO_CLOCK_INTERNAL:
DE_ACT(("Set Layla24 clock to INTERNAL\n"));
dev_dbg(chip->card->dev, "Set Layla24 clock to INTERNAL\n");
chip->input_clock = ECHO_CLOCK_INTERNAL;
return set_sample_rate(chip, chip->sample_rate);
case ECHO_CLOCK_SPDIF:
......@@ -269,7 +271,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
control_reg |= GML_SPDIF_CLOCK;
/* Layla24 doesn't support 96KHz S/PDIF */
control_reg &= ~GML_DOUBLE_SPEED_MODE;
DE_ACT(("Set Layla24 clock to SPDIF\n"));
dev_dbg(chip->card->dev, "Set Layla24 clock to SPDIF\n");
break;
case ECHO_CLOCK_WORD:
control_reg |= GML_WORD_CLOCK;
......@@ -277,17 +279,18 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
control_reg |= GML_DOUBLE_SPEED_MODE;
else
control_reg &= ~GML_DOUBLE_SPEED_MODE;
DE_ACT(("Set Layla24 clock to WORD\n"));
dev_dbg(chip->card->dev, "Set Layla24 clock to WORD\n");
break;
case ECHO_CLOCK_ADAT:
if (chip->digital_mode != DIGITAL_MODE_ADAT)
return -EAGAIN;
control_reg |= GML_ADAT_CLOCK;
control_reg &= ~GML_DOUBLE_SPEED_MODE;
DE_ACT(("Set Layla24 clock to ADAT\n"));
dev_dbg(chip->card->dev, "Set Layla24 clock to ADAT\n");
break;
default:
DE_ACT(("Input clock 0x%x not supported for Layla24\n", clock));
dev_err(chip->card->dev,
"Input clock 0x%x not supported for Layla24\n", clock);
return -EINVAL;
}
......@@ -353,7 +356,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
asic = FW_LAYLA24_2A_ASIC;
break;
default:
DE_ACT(("Digital mode not supported: %d\n", mode));
dev_err(chip->card->dev,
"Digital mode not supported: %d\n", mode);
return -EINVAL;
}
......@@ -393,6 +397,6 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
return err;
chip->digital_mode = mode;
DE_ACT(("set_digital_mode to %d\n", mode));
dev_dbg(chip->card->dev, "set_digital_mode to %d\n", mode);
return incompatible_clock;
}
......@@ -41,12 +41,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Mia\n"));
dev_dbg(chip->card->dev, "init_hw() - Mia\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != MIA))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -66,7 +67,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -126,7 +127,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
control_reg = MIA_32000;
break;
default:
DE_ACT(("set_sample_rate: %d invalid!\n", rate));
dev_err(chip->card->dev,
"set_sample_rate: %d invalid!\n", rate);
return -EINVAL;
}
......@@ -153,7 +155,7 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
static int set_input_clock(struct echoaudio *chip, u16 clock)
{
DE_ACT(("set_input_clock(%d)\n", clock));
dev_dbg(chip->card->dev, "set_input_clock(%d)\n", clock);
if (snd_BUG_ON(clock != ECHO_CLOCK_INTERNAL &&
clock != ECHO_CLOCK_SPDIF))
return -EINVAL;
......@@ -181,7 +183,8 @@ static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
index = output * num_pipes_out(chip) + pipe;
chip->comm_page->vmixer[index] = gain;
DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
dev_dbg(chip->card->dev,
"set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain);
return 0;
}
......@@ -211,7 +214,7 @@ static int update_flags(struct echoaudio *chip)
static int set_professional_spdif(struct echoaudio *chip, char prof)
{
DE_ACT(("set_professional_spdif %d\n", prof));
dev_dbg(chip->card->dev, "set_professional_spdif %d\n", prof);
if (prof)
chip->comm_page->flags |=
cpu_to_le32(DSP_FLAG_PROFESSIONAL_SPDIF);
......
......@@ -36,7 +36,7 @@
/* Start and stop Midi input */
static int enable_midi_input(struct echoaudio *chip, char enable)
{
DE_MID(("enable_midi_input(%d)\n", enable));
dev_dbg(chip->card->dev, "enable_midi_input(%d)\n", enable);
if (wait_handshake(chip))
return -EIO;
......@@ -74,7 +74,7 @@ static int write_midi(struct echoaudio *chip, u8 *data, int bytes)
chip->comm_page->midi_out_free_count = 0;
clear_handshake(chip);
send_vector(chip, DSP_VC_MIDI_WRITE);
DE_MID(("write_midi: %d\n", bytes));
dev_dbg(chip->card->dev, "write_midi: %d\n", bytes);
return bytes;
}
......@@ -157,7 +157,7 @@ static int snd_echo_midi_input_open(struct snd_rawmidi_substream *substream)
struct echoaudio *chip = substream->rmidi->private_data;
chip->midi_in = substream;
DE_MID(("rawmidi_iopen\n"));
dev_dbg(chip->card->dev, "rawmidi_iopen\n");
return 0;
}
......@@ -183,7 +183,7 @@ static int snd_echo_midi_input_close(struct snd_rawmidi_substream *substream)
struct echoaudio *chip = substream->rmidi->private_data;
chip->midi_in = NULL;
DE_MID(("rawmidi_iclose\n"));
dev_dbg(chip->card->dev, "rawmidi_iclose\n");
return 0;
}
......@@ -196,7 +196,7 @@ static int snd_echo_midi_output_open(struct snd_rawmidi_substream *substream)
chip->tinuse = 0;
chip->midi_full = 0;
chip->midi_out = substream;
DE_MID(("rawmidi_oopen\n"));
dev_dbg(chip->card->dev, "rawmidi_open\n");
return 0;
}
......@@ -209,7 +209,7 @@ static void snd_echo_midi_output_write(unsigned long data)
int bytes, sent, time;
unsigned char buf[MIDI_OUT_BUFFER_SIZE - 1];
DE_MID(("snd_echo_midi_output_write\n"));
dev_dbg(chip->card->dev, "snd_echo_midi_output_write\n");
/* No interrupts are involved: we have to check at regular intervals
if the card's output buffer has room for new data. */
sent = bytes = 0;
......@@ -218,7 +218,7 @@ static void snd_echo_midi_output_write(unsigned long data)
if (!snd_rawmidi_transmit_empty(chip->midi_out)) {
bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf,
MIDI_OUT_BUFFER_SIZE - 1);
DE_MID(("Try to send %d bytes...\n", bytes));
dev_dbg(chip->card->dev, "Try to send %d bytes...\n", bytes);
sent = write_midi(chip, buf, bytes);
if (sent < 0) {
dev_err(chip->card->dev,
......@@ -227,12 +227,12 @@ static void snd_echo_midi_output_write(unsigned long data)
sent = 9000;
chip->midi_full = 1;
} else if (sent > 0) {
DE_MID(("%d bytes sent\n", sent));
dev_dbg(chip->card->dev, "%d bytes sent\n", sent);
snd_rawmidi_transmit_ack(chip->midi_out, sent);
} else {
/* Buffer is full. DSP's internal buffer is 64 (128 ?)
bytes long. Let's wait until half of them are sent */
DE_MID(("Full\n"));
dev_dbg(chip->card->dev, "Full\n");
sent = 32;
chip->midi_full = 1;
}
......@@ -244,7 +244,8 @@ static void snd_echo_midi_output_write(unsigned long data)
sent */
time = (sent << 3) / 25 + 1; /* 8/25=0.32ms to send a byte */
mod_timer(&chip->timer, jiffies + (time * HZ + 999) / 1000);
DE_MID(("Timer armed(%d)\n", ((time * HZ + 999) / 1000)));
dev_dbg(chip->card->dev,
"Timer armed(%d)\n", ((time * HZ + 999) / 1000));
}
spin_unlock_irqrestore(&chip->lock, flags);
}
......@@ -256,7 +257,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream
{
struct echoaudio *chip = substream->rmidi->private_data;
DE_MID(("snd_echo_midi_output_trigger(%d)\n", up));
dev_dbg(chip->card->dev, "snd_echo_midi_output_trigger(%d)\n", up);
spin_lock_irq(&chip->lock);
if (up) {
if (!chip->tinuse) {
......@@ -270,7 +271,7 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream
chip->tinuse = 0;
spin_unlock_irq(&chip->lock);
del_timer_sync(&chip->timer);
DE_MID(("Timer removed\n"));
dev_dbg(chip->card->dev, "Timer removed\n");
return;
}
}
......@@ -287,7 +288,7 @@ static int snd_echo_midi_output_close(struct snd_rawmidi_substream *substream)
struct echoaudio *chip = substream->rmidi->private_data;
chip->midi_out = NULL;
DE_MID(("rawmidi_oclose\n"));
dev_dbg(chip->card->dev, "rawmidi_oclose\n");
return 0;
}
......@@ -327,6 +328,6 @@ static int snd_echo_midi_create(struct snd_card *card,
chip->rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT |
SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX;
DE_INIT(("MIDI ok\n"));
dev_dbg(chip->card->dev, "MIDI ok\n");
return 0;
}
......@@ -41,12 +41,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
{
int err;
DE_INIT(("init_hw() - Mona\n"));
dev_dbg(chip->card->dev, "init_hw() - Mona\n");
if (snd_BUG_ON((subdevice_id & 0xfff0) != MONA))
return -ENODEV;
if ((err = init_dsp_comm_page(chip))) {
DE_INIT(("init_hw - could not initialize DSP comm page\n"));
dev_err(chip->card->dev,
"init_hw - could not initialize DSP comm page\n");
return err;
}
......@@ -71,7 +72,7 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
return err;
chip->bad_board = FALSE;
DE_INIT(("init_hw done\n"));
dev_dbg(chip->card->dev, "init_hw done\n");
return err;
}
......@@ -202,8 +203,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
/* Only set the clock for internal mode. */
if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
DE_ACT(("set_sample_rate: Cannot set sample rate - "
"clock not set to CLK_CLOCKININTERNAL\n"));
dev_dbg(chip->card->dev,
"Cannot set sample rate - clock not set to CLK_CLOCKININTERNAL\n");
/* Save the rate anyhow */
chip->comm_page->sample_rate = cpu_to_le32(rate);
chip->sample_rate = rate;
......@@ -279,7 +280,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
clock = GML_8KHZ;
break;
default:
DE_ACT(("set_sample_rate: %d invalid!\n", rate));
dev_err(chip->card->dev,
"set_sample_rate: %d invalid!\n", rate);
return -EINVAL;
}
......@@ -287,7 +289,8 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate)
chip->comm_page->sample_rate = cpu_to_le32(rate); /* ignored by the DSP */
chip->sample_rate = rate;
DE_ACT(("set_sample_rate: %d clock %d\n", rate, clock));
dev_dbg(chip->card->dev,
"set_sample_rate: %d clock %d\n", rate, clock);
return write_control_reg(chip, control_reg, force_write);
}
......@@ -299,7 +302,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
u32 control_reg, clocks_from_dsp;
int err;
DE_ACT(("set_input_clock:\n"));
dev_dbg(chip->card->dev, "set_input_clock:\n");
/* Prevent two simultaneous calls to switch_asic() */
if (atomic_read(&chip->opencount))
......@@ -312,7 +315,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
switch (clock) {
case ECHO_CLOCK_INTERNAL:
DE_ACT(("Set Mona clock to INTERNAL\n"));
dev_dbg(chip->card->dev, "Set Mona clock to INTERNAL\n");
chip->input_clock = ECHO_CLOCK_INTERNAL;
return set_sample_rate(chip, chip->sample_rate);
case ECHO_CLOCK_SPDIF:
......@@ -324,7 +327,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
spin_lock_irq(&chip->lock);
if (err < 0)
return err;
DE_ACT(("Set Mona clock to SPDIF\n"));
dev_dbg(chip->card->dev, "Set Mona clock to SPDIF\n");
control_reg |= GML_SPDIF_CLOCK;
if (clocks_from_dsp & GML_CLOCK_DETECT_BIT_SPDIF96)
control_reg |= GML_DOUBLE_SPEED_MODE;
......@@ -332,7 +335,7 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
control_reg &= ~GML_DOUBLE_SPEED_MODE;
break;
case ECHO_CLOCK_WORD:
DE_ACT(("Set Mona clock to WORD\n"));
dev_dbg(chip->card->dev, "Set Mona clock to WORD\n");
spin_unlock_irq(&chip->lock);
err = switch_asic(chip, clocks_from_dsp &
GML_CLOCK_DETECT_BIT_WORD96);
......@@ -346,14 +349,15 @@ static int set_input_clock(struct echoaudio *chip, u16 clock)
control_reg &= ~GML_DOUBLE_SPEED_MODE;
break;
case ECHO_CLOCK_ADAT:
DE_ACT(("Set Mona clock to ADAT\n"));
dev_dbg(chip->card->dev, "Set Mona clock to ADAT\n");
if (chip->digital_mode != DIGITAL_MODE_ADAT)
return -EAGAIN;
control_reg |= GML_ADAT_CLOCK;
control_reg &= ~GML_DOUBLE_SPEED_MODE;
break;
default:
DE_ACT(("Input clock 0x%x not supported for Mona\n", clock));
dev_err(chip->card->dev,
"Input clock 0x%x not supported for Mona\n", clock);
return -EINVAL;
}
......@@ -381,7 +385,8 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
incompatible_clock = TRUE;
break;
default:
DE_ACT(("Digital mode not supported: %d\n", mode));
dev_err(chip->card->dev,
"Digital mode not supported: %d\n", mode);
return -EINVAL;
}
......@@ -422,6 +427,6 @@ static int dsp_set_digital_mode(struct echoaudio *chip, u8 mode)
return err;
chip->digital_mode = mode;
DE_ACT(("set_digital_mode to %d\n", mode));
dev_dbg(chip->card->dev, "set_digital_mode to %d\n", mode);
return incompatible_clock;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment