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