Commit f58e2fce authored by Takashi Iwai's avatar Takashi Iwai

ALSA: lola: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6dfb5aff
...@@ -75,7 +75,7 @@ MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); ...@@ -75,7 +75,7 @@ MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
static int debug; static int debug;
module_param(debug, int, 0644); module_param(debug, int, 0644);
#define verbose_debug(fmt, args...) \ #define verbose_debug(fmt, args...) \
do { if (debug > 1) printk(KERN_DEBUG SFX fmt, ##args); } while (0) do { if (debug > 1) pr_debug(SFX fmt, ##args); } while (0)
#else #else
#define verbose_debug(fmt, args...) #define verbose_debug(fmt, args...)
#endif #endif
...@@ -168,7 +168,7 @@ static int rirb_get_response(struct lola *chip, unsigned int *val, ...@@ -168,7 +168,7 @@ static int rirb_get_response(struct lola *chip, unsigned int *val,
verbose_debug("get_response: %x, %x\n", verbose_debug("get_response: %x, %x\n",
chip->res, chip->res_ex); chip->res, chip->res_ex);
if (chip->res_ex & LOLA_RIRB_EX_ERROR) { if (chip->res_ex & LOLA_RIRB_EX_ERROR) {
printk(KERN_WARNING SFX "RIRB ERROR: " dev_warn(chip->card->dev, "RIRB ERROR: "
"NID=%x, verb=%x, data=%x, ext=%x\n", "NID=%x, verb=%x, data=%x, ext=%x\n",
chip->last_cmd_nid, chip->last_cmd_nid,
chip->last_verb, chip->last_data, chip->last_verb, chip->last_data,
...@@ -182,9 +182,9 @@ static int rirb_get_response(struct lola *chip, unsigned int *val, ...@@ -182,9 +182,9 @@ static int rirb_get_response(struct lola *chip, unsigned int *val,
udelay(20); udelay(20);
cond_resched(); cond_resched();
} }
printk(KERN_WARNING SFX "RIRB response error\n"); dev_warn(chip->card->dev, "RIRB response error\n");
if (!chip->polling_mode) { if (!chip->polling_mode) {
printk(KERN_WARNING SFX "switching to polling mode\n"); dev_warn(chip->card->dev, "switching to polling mode\n");
chip->polling_mode = 1; chip->polling_mode = 1;
goto again; goto again;
} }
...@@ -327,7 +327,7 @@ static int reset_controller(struct lola *chip) ...@@ -327,7 +327,7 @@ static int reset_controller(struct lola *chip)
break; break;
} while (time_before(jiffies, end_time)); } while (time_before(jiffies, end_time));
if (!gctl) { if (!gctl) {
printk(KERN_ERR SFX "cannot reset controller\n"); dev_err(chip->card->dev, "cannot reset controller\n");
return -EIO; return -EIO;
} }
return 0; return 0;
...@@ -452,40 +452,40 @@ static int lola_parse_tree(struct lola *chip) ...@@ -452,40 +452,40 @@ static int lola_parse_tree(struct lola *chip)
err = lola_read_param(chip, 0, LOLA_PAR_VENDOR_ID, &val); err = lola_read_param(chip, 0, LOLA_PAR_VENDOR_ID, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read VENDOR_ID\n"); dev_err(chip->card->dev, "Can't read VENDOR_ID\n");
return err; return err;
} }
val >>= 16; val >>= 16;
if (val != 0x1369) { if (val != 0x1369) {
printk(KERN_ERR SFX "Unknown codec vendor 0x%x\n", val); dev_err(chip->card->dev, "Unknown codec vendor 0x%x\n", val);
return -EINVAL; return -EINVAL;
} }
err = lola_read_param(chip, 1, LOLA_PAR_FUNCTION_TYPE, &val); err = lola_read_param(chip, 1, LOLA_PAR_FUNCTION_TYPE, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read FUNCTION_TYPE\n"); dev_err(chip->card->dev, "Can't read FUNCTION_TYPE\n");
return err; return err;
} }
if (val != 1) { if (val != 1) {
printk(KERN_ERR SFX "Unknown function type %d\n", val); dev_err(chip->card->dev, "Unknown function type %d\n", val);
return -EINVAL; return -EINVAL;
} }
err = lola_read_param(chip, 1, LOLA_PAR_SPECIFIC_CAPS, &val); err = lola_read_param(chip, 1, LOLA_PAR_SPECIFIC_CAPS, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read SPECCAPS\n"); dev_err(chip->card->dev, "Can't read SPECCAPS\n");
return err; return err;
} }
chip->lola_caps = val; chip->lola_caps = val;
chip->pin[CAPT].num_pins = LOLA_AFG_INPUT_PIN_COUNT(chip->lola_caps); chip->pin[CAPT].num_pins = LOLA_AFG_INPUT_PIN_COUNT(chip->lola_caps);
chip->pin[PLAY].num_pins = LOLA_AFG_OUTPUT_PIN_COUNT(chip->lola_caps); chip->pin[PLAY].num_pins = LOLA_AFG_OUTPUT_PIN_COUNT(chip->lola_caps);
snd_printdd(SFX "speccaps=0x%x, pins in=%d, out=%d\n", dev_dbg(chip->card->dev, "speccaps=0x%x, pins in=%d, out=%d\n",
chip->lola_caps, chip->lola_caps,
chip->pin[CAPT].num_pins, chip->pin[PLAY].num_pins); chip->pin[CAPT].num_pins, chip->pin[PLAY].num_pins);
if (chip->pin[CAPT].num_pins > MAX_AUDIO_INOUT_COUNT || if (chip->pin[CAPT].num_pins > MAX_AUDIO_INOUT_COUNT ||
chip->pin[PLAY].num_pins > MAX_AUDIO_INOUT_COUNT) { chip->pin[PLAY].num_pins > MAX_AUDIO_INOUT_COUNT) {
printk(KERN_ERR SFX "Invalid Lola-spec caps 0x%x\n", val); dev_err(chip->card->dev, "Invalid Lola-spec caps 0x%x\n", val);
return -EINVAL; return -EINVAL;
} }
...@@ -586,7 +586,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -586,7 +586,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
chip = kzalloc(sizeof(*chip), GFP_KERNEL); chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (!chip) { if (!chip) {
snd_printk(KERN_ERR SFX "cannot allocate chip\n"); dev_err(chip->card->dev, "cannot allocate chip\n");
pci_disable_device(pci); pci_disable_device(pci);
return -ENOMEM; return -ENOMEM;
} }
...@@ -609,7 +609,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -609,7 +609,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
chip->sample_rate_max = 192000; chip->sample_rate_max = 192000;
break; break;
default: default:
snd_printk(KERN_WARNING SFX dev_warn(chip->card->dev,
"Invalid granularity %d, reset to %d\n", "Invalid granularity %d, reset to %d\n",
chip->granularity, LOLA_GRANULARITY_MAX); chip->granularity, LOLA_GRANULARITY_MAX);
chip->granularity = LOLA_GRANULARITY_MAX; chip->granularity = LOLA_GRANULARITY_MAX;
...@@ -618,7 +618,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -618,7 +618,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
} }
chip->sample_rate_min = sample_rate_min[dev]; chip->sample_rate_min = sample_rate_min[dev];
if (chip->sample_rate_min > chip->sample_rate_max) { if (chip->sample_rate_min > chip->sample_rate_max) {
snd_printk(KERN_WARNING SFX dev_warn(chip->card->dev,
"Invalid sample_rate_min %d, reset to 16000\n", "Invalid sample_rate_min %d, reset to 16000\n",
chip->sample_rate_min); chip->sample_rate_min);
chip->sample_rate_min = 16000; chip->sample_rate_min = 16000;
...@@ -636,7 +636,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -636,7 +636,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
chip->bar[1].addr = pci_resource_start(pci, 2); chip->bar[1].addr = pci_resource_start(pci, 2);
chip->bar[1].remap_addr = pci_ioremap_bar(pci, 2); chip->bar[1].remap_addr = pci_ioremap_bar(pci, 2);
if (!chip->bar[0].remap_addr || !chip->bar[1].remap_addr) { if (!chip->bar[0].remap_addr || !chip->bar[1].remap_addr) {
snd_printk(KERN_ERR SFX "ioremap error\n"); dev_err(chip->card->dev, "ioremap error\n");
err = -ENXIO; err = -ENXIO;
goto errout; goto errout;
} }
...@@ -649,7 +649,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -649,7 +649,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
if (request_irq(pci->irq, lola_interrupt, IRQF_SHARED, if (request_irq(pci->irq, lola_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) { KBUILD_MODNAME, chip)) {
printk(KERN_ERR SFX "unable to grab IRQ %d\n", pci->irq); dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
err = -EBUSY; err = -EBUSY;
goto errout; goto errout;
} }
...@@ -660,7 +660,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -660,7 +660,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
chip->pcm[CAPT].num_streams = (dever >> 0) & 0x3ff; chip->pcm[CAPT].num_streams = (dever >> 0) & 0x3ff;
chip->pcm[PLAY].num_streams = (dever >> 10) & 0x3ff; chip->pcm[PLAY].num_streams = (dever >> 10) & 0x3ff;
chip->version = (dever >> 24) & 0xff; chip->version = (dever >> 24) & 0xff;
snd_printdd(SFX "streams in=%d, out=%d, version=0x%x\n", dev_dbg(chip->card->dev, "streams in=%d, out=%d, version=0x%x\n",
chip->pcm[CAPT].num_streams, chip->pcm[PLAY].num_streams, chip->pcm[CAPT].num_streams, chip->pcm[PLAY].num_streams,
chip->version); chip->version);
...@@ -669,7 +669,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -669,7 +669,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
chip->pcm[PLAY].num_streams > MAX_STREAM_OUT_COUNT || chip->pcm[PLAY].num_streams > MAX_STREAM_OUT_COUNT ||
(!chip->pcm[CAPT].num_streams && (!chip->pcm[CAPT].num_streams &&
!chip->pcm[PLAY].num_streams)) { !chip->pcm[PLAY].num_streams)) {
printk(KERN_ERR SFX "invalid DEVER = %x\n", dever); dev_err(chip->card->dev, "invalid DEVER = %x\n", dever);
err = -EINVAL; err = -EINVAL;
goto errout; goto errout;
} }
...@@ -680,7 +680,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -680,7 +680,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR SFX "Error creating device [card]!\n"); dev_err(chip->card->dev, "Error creating device [card]!\n");
goto errout; goto errout;
} }
...@@ -720,7 +720,7 @@ static int lola_probe(struct pci_dev *pci, ...@@ -720,7 +720,7 @@ static int lola_probe(struct pci_dev *pci,
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card); 0, &card);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR SFX "Error creating card!\n"); dev_err(card->dev, "Error creating card!\n");
return err; return err;
} }
......
...@@ -128,21 +128,21 @@ int lola_init_clock_widget(struct lola *chip, int nid) ...@@ -128,21 +128,21 @@ int lola_init_clock_widget(struct lola *chip, int nid)
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val); err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid); dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err; return err;
} }
if ((val & 0xfff00000) != 0x01f00000) { /* test SubType and Type */ if ((val & 0xfff00000) != 0x01f00000) { /* test SubType and Type */
snd_printdd("No valid clock widget\n"); dev_dbg(chip->card->dev, "No valid clock widget\n");
return 0; return 0;
} }
chip->clock.nid = nid; chip->clock.nid = nid;
chip->clock.items = val & 0xff; chip->clock.items = val & 0xff;
snd_printdd("clock_list nid=%x, entries=%d\n", nid, dev_dbg(chip->card->dev, "clock_list nid=%x, entries=%d\n", nid,
chip->clock.items); chip->clock.items);
if (chip->clock.items > MAX_SAMPLE_CLOCK_COUNT) { if (chip->clock.items > MAX_SAMPLE_CLOCK_COUNT) {
printk(KERN_ERR SFX "CLOCK_LIST too big: %d\n", dev_err(chip->card->dev, "CLOCK_LIST too big: %d\n",
chip->clock.items); chip->clock.items);
return -EINVAL; return -EINVAL;
} }
...@@ -158,7 +158,7 @@ int lola_init_clock_widget(struct lola *chip, int nid) ...@@ -158,7 +158,7 @@ int lola_init_clock_widget(struct lola *chip, int nid)
err = lola_codec_read(chip, nid, LOLA_VERB_GET_CLOCK_LIST, err = lola_codec_read(chip, nid, LOLA_VERB_GET_CLOCK_LIST,
idx, 0, &val, &res_ex); idx, 0, &val, &res_ex);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read CLOCK_LIST\n"); dev_err(chip->card->dev, "Can't read CLOCK_LIST\n");
return -EINVAL; return -EINVAL;
} }
...@@ -223,7 +223,7 @@ int lola_enable_clock_events(struct lola *chip) ...@@ -223,7 +223,7 @@ int lola_enable_clock_events(struct lola *chip)
if (err < 0) if (err < 0)
return err; return err;
if (res) { if (res) {
printk(KERN_WARNING SFX "error in enable_clock_events %d\n", dev_warn(chip->card->dev, "error in enable_clock_events %d\n",
res); res);
return -EINVAL; return -EINVAL;
} }
...@@ -242,7 +242,7 @@ int lola_set_clock_index(struct lola *chip, unsigned int idx) ...@@ -242,7 +242,7 @@ int lola_set_clock_index(struct lola *chip, unsigned int idx)
if (err < 0) if (err < 0)
return err; return err;
if (res) { if (res) {
printk(KERN_WARNING SFX "error in set_clock %d\n", res); dev_warn(chip->card->dev, "error in set_clock %d\n", res);
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
......
...@@ -37,7 +37,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin, ...@@ -37,7 +37,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin,
pin->nid = nid; pin->nid = nid;
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val); err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid); dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err; return err;
} }
val &= 0x00f00fff; /* test TYPE and bits 0..11 */ val &= 0x00f00fff; /* test TYPE and bits 0..11 */
...@@ -48,7 +48,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin, ...@@ -48,7 +48,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin,
else if (val == 0x0040000c && dir == PLAY) /* Dig=0, OutAmp/ovrd */ else if (val == 0x0040000c && dir == PLAY) /* Dig=0, OutAmp/ovrd */
pin->is_analog = true; pin->is_analog = true;
else { else {
printk(KERN_ERR SFX "Invalid wcaps 0x%x for 0x%x\n", val, nid); dev_err(chip->card->dev, "Invalid wcaps 0x%x for 0x%x\n", val, nid);
return -EINVAL; return -EINVAL;
} }
...@@ -62,7 +62,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin, ...@@ -62,7 +62,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin,
else else
err = lola_read_param(chip, nid, LOLA_PAR_AMP_IN_CAP, &val); err = lola_read_param(chip, nid, LOLA_PAR_AMP_IN_CAP, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read AMP-caps for 0x%x\n", nid); dev_err(chip->card->dev, "Can't read AMP-caps for 0x%x\n", nid);
return err; return err;
} }
...@@ -79,7 +79,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin, ...@@ -79,7 +79,7 @@ static int lola_init_pin(struct lola *chip, struct lola_pin *pin,
err = lola_codec_read(chip, nid, LOLA_VERB_GET_MAX_LEVEL, 0, 0, &val, err = lola_codec_read(chip, nid, LOLA_VERB_GET_MAX_LEVEL, 0, 0, &val,
NULL); NULL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't get MAX_LEVEL 0x%x\n", nid); dev_err(chip->card->dev, "Can't get MAX_LEVEL 0x%x\n", nid);
return err; return err;
} }
pin->max_level = val & 0x3ff; /* 10 bits */ pin->max_level = val & 0x3ff; /* 10 bits */
...@@ -119,12 +119,12 @@ int lola_init_mixer_widget(struct lola *chip, int nid) ...@@ -119,12 +119,12 @@ int lola_init_mixer_widget(struct lola *chip, int nid)
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val); err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid); dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err; return err;
} }
if ((val & 0xfff00000) != 0x02f00000) { /* test SubType and Type */ if ((val & 0xfff00000) != 0x02f00000) { /* test SubType and Type */
snd_printdd("No valid mixer widget\n"); dev_dbg(chip->card->dev, "No valid mixer widget\n");
return 0; return 0;
} }
...@@ -202,7 +202,7 @@ int lola_init_mixer_widget(struct lola *chip, int nid) ...@@ -202,7 +202,7 @@ int lola_init_mixer_widget(struct lola *chip, int nid)
*/ */
if (chip->mixer.src_stream_out_ofs > MAX_AUDIO_INOUT_COUNT || if (chip->mixer.src_stream_out_ofs > MAX_AUDIO_INOUT_COUNT ||
chip->mixer.dest_phys_out_ofs > MAX_STREAM_IN_COUNT) { chip->mixer.dest_phys_out_ofs > MAX_STREAM_IN_COUNT) {
printk(KERN_ERR SFX "Invalid mixer widget size\n"); dev_err(chip->card->dev, "Invalid mixer widget size\n");
return -EINVAL; return -EINVAL;
} }
...@@ -213,7 +213,7 @@ int lola_init_mixer_widget(struct lola *chip, int nid) ...@@ -213,7 +213,7 @@ int lola_init_mixer_widget(struct lola *chip, int nid)
(((1U << chip->mixer.dest_phys_outs) - 1) (((1U << chip->mixer.dest_phys_outs) - 1)
<< chip->mixer.dest_phys_out_ofs); << chip->mixer.dest_phys_out_ofs);
snd_printdd("Mixer src_mask=%x, dest_mask=%x\n", dev_dbg(chip->card->dev, "Mixer src_mask=%x, dest_mask=%x\n",
chip->mixer.src_mask, chip->mixer.dest_mask); chip->mixer.src_mask, chip->mixer.dest_mask);
return 0; return 0;
...@@ -236,7 +236,8 @@ static int lola_mixer_set_src_gain(struct lola *chip, unsigned int id, ...@@ -236,7 +236,8 @@ static int lola_mixer_set_src_gain(struct lola *chip, unsigned int id,
(gain == readw(&chip->mixer.array->src_gain[id]))) (gain == readw(&chip->mixer.array->src_gain[id])))
return 0; return 0;
snd_printdd("lola_mixer_set_src_gain (id=%d, gain=%d) enable=%x\n", dev_dbg(chip->card->dev,
"lola_mixer_set_src_gain (id=%d, gain=%d) enable=%x\n",
id, gain, val); id, gain, val);
writew(gain, &chip->mixer.array->src_gain[id]); writew(gain, &chip->mixer.array->src_gain[id]);
writel(val, &chip->mixer.array->src_gain_enable); writel(val, &chip->mixer.array->src_gain_enable);
...@@ -409,7 +410,8 @@ static int set_analog_volume(struct lola *chip, int dir, ...@@ -409,7 +410,8 @@ static int set_analog_volume(struct lola *chip, int dir,
return 0; return 0;
if (external_call) if (external_call)
lola_codec_flush(chip); lola_codec_flush(chip);
snd_printdd("set_analog_volume (dir=%d idx=%d, volume=%d)\n", dev_dbg(chip->card->dev,
"set_analog_volume (dir=%d idx=%d, volume=%d)\n",
dir, idx, val); dir, idx, val);
err = lola_codec_write(chip, pin->nid, err = lola_codec_write(chip, pin->nid,
LOLA_VERB_SET_AMP_GAIN_MUTE, val, 0); LOLA_VERB_SET_AMP_GAIN_MUTE, val, 0);
......
...@@ -103,7 +103,7 @@ static void wait_for_srst_clear(struct lola *chip, struct lola_stream *str) ...@@ -103,7 +103,7 @@ static void wait_for_srst_clear(struct lola *chip, struct lola_stream *str)
return; return;
msleep(1); msleep(1);
} }
printk(KERN_WARNING SFX "SRST not clear (stream %d)\n", str->dsd); dev_warn(chip->card->dev, "SRST not clear (stream %d)\n", str->dsd);
} }
static int lola_stream_wait_for_fifo(struct lola *chip, static int lola_stream_wait_for_fifo(struct lola *chip,
...@@ -118,7 +118,7 @@ static int lola_stream_wait_for_fifo(struct lola *chip, ...@@ -118,7 +118,7 @@ static int lola_stream_wait_for_fifo(struct lola *chip,
return 0; return 0;
msleep(1); msleep(1);
} }
printk(KERN_WARNING SFX "FIFO not ready (stream %d)\n", str->dsd); dev_warn(chip->card->dev, "FIFO not ready (stream %d)\n", str->dsd);
return -EIO; return -EIO;
} }
...@@ -156,7 +156,7 @@ static int lola_sync_wait_for_fifo(struct lola *chip, ...@@ -156,7 +156,7 @@ static int lola_sync_wait_for_fifo(struct lola *chip,
return 0; return 0;
msleep(1); msleep(1);
} }
printk(KERN_WARNING SFX "FIFO not ready (pending %d)\n", pending - 1); dev_warn(chip->card->dev, "FIFO not ready (pending %d)\n", pending - 1);
return -EIO; return -EIO;
} }
...@@ -373,7 +373,7 @@ static int lola_setup_periods(struct lola *chip, struct lola_pcm *pcm, ...@@ -373,7 +373,7 @@ static int lola_setup_periods(struct lola *chip, struct lola_pcm *pcm,
return 0; return 0;
error: error:
snd_printk(KERN_ERR SFX "Too many BDL entries: buffer=%d, period=%d\n", dev_err(chip->card->dev, "Too many BDL entries: buffer=%d, period=%d\n",
str->bufsize, period_bytes); str->bufsize, period_bytes);
return -EINVAL; return -EINVAL;
} }
...@@ -415,7 +415,7 @@ static int lola_set_stream_config(struct lola *chip, ...@@ -415,7 +415,7 @@ static int lola_set_stream_config(struct lola *chip,
err = lola_codec_read(chip, str->nid, LOLA_VERB_SET_STREAM_FORMAT, err = lola_codec_read(chip, str->nid, LOLA_VERB_SET_STREAM_FORMAT,
str->format_verb, 0, &val, NULL); str->format_verb, 0, &val, NULL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Cannot set stream format 0x%x\n", dev_err(chip->card->dev, "Cannot set stream format 0x%x\n",
str->format_verb); str->format_verb);
return err; return err;
} }
...@@ -427,7 +427,8 @@ static int lola_set_stream_config(struct lola *chip, ...@@ -427,7 +427,8 @@ static int lola_set_stream_config(struct lola *chip,
LOLA_VERB_SET_CHANNEL_STREAMID, 0, verb, LOLA_VERB_SET_CHANNEL_STREAMID, 0, verb,
&val, NULL); &val, NULL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Cannot set stream channel %d\n", i); dev_err(chip->card->dev,
"Cannot set stream channel %d\n", i);
return err; return err;
} }
} }
...@@ -651,13 +652,14 @@ static int lola_init_stream(struct lola *chip, struct lola_stream *str, ...@@ -651,13 +652,14 @@ static int lola_init_stream(struct lola *chip, struct lola_stream *str,
str->dsd += MAX_STREAM_IN_COUNT; str->dsd += MAX_STREAM_IN_COUNT;
err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val); err = lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read wcaps for 0x%x\n", nid); dev_err(chip->card->dev, "Can't read wcaps for 0x%x\n", nid);
return err; return err;
} }
if (dir == PLAY) { if (dir == PLAY) {
/* test TYPE and bits 0..11 (no test bit9 : Digital = 0/1) */ /* test TYPE and bits 0..11 (no test bit9 : Digital = 0/1) */
if ((val & 0x00f00dff) != 0x00000010) { if ((val & 0x00f00dff) != 0x00000010) {
printk(KERN_ERR SFX "Invalid wcaps 0x%x for 0x%x\n", dev_err(chip->card->dev,
"Invalid wcaps 0x%x for 0x%x\n",
val, nid); val, nid);
return -EINVAL; return -EINVAL;
} }
...@@ -666,7 +668,8 @@ static int lola_init_stream(struct lola *chip, struct lola_stream *str, ...@@ -666,7 +668,8 @@ static int lola_init_stream(struct lola *chip, struct lola_stream *str,
* (bug : ignore bit8: Conn list = 0/1) * (bug : ignore bit8: Conn list = 0/1)
*/ */
if ((val & 0x00f00cff) != 0x00100010) { if ((val & 0x00f00cff) != 0x00100010) {
printk(KERN_ERR SFX "Invalid wcaps 0x%x for 0x%x\n", dev_err(chip->card->dev,
"Invalid wcaps 0x%x for 0x%x\n",
val, nid); val, nid);
return -EINVAL; return -EINVAL;
} }
...@@ -677,14 +680,15 @@ static int lola_init_stream(struct lola *chip, struct lola_stream *str, ...@@ -677,14 +680,15 @@ static int lola_init_stream(struct lola *chip, struct lola_stream *str,
err = lola_read_param(chip, nid, LOLA_PAR_STREAM_FORMATS, &val); err = lola_read_param(chip, nid, LOLA_PAR_STREAM_FORMATS, &val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR SFX "Can't read FORMATS 0x%x\n", nid); dev_err(chip->card->dev, "Can't read FORMATS 0x%x\n", nid);
return err; return err;
} }
val &= 3; val &= 3;
if (val == 3) if (val == 3)
str->can_float = true; str->can_float = true;
if (!(val & 1)) { if (!(val & 1)) {
printk(KERN_ERR SFX "Invalid formats 0x%x for 0x%x", val, nid); dev_err(chip->card->dev,
"Invalid formats 0x%x for 0x%x", val, nid);
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
......
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