|
@@ -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,
|
|
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,
|
|
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)
|
|
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)
|
|
|
|
|
|
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,
|
|
|
|
|
|
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,
|
|
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,
|
|
}
|
|
}
|
|
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,
|
|
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,
|
|
|
|
|
|
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,
|
|
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,
|
|
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,
|
|
|
|
|
|
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,
|
|
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;
|
|
}
|
|
}
|
|
|
|
|