case SNDRV_PCM_TRIGGER_SUSPEND:
spin_lock(&chip->reg_lock);
rec->running = 0;
- /*printk(KERN_DEBUG "stopped!!\n");*/
snd_pmac_dma_stop(rec);
for (i = 0, cp = rec->cmd.cmds; i < rec->nperiods; i++, cp++)
out_le16(&cp->command, DBDMA_STOP);
}
#endif
count += rec->cur_period * rec->period_size;
- /*printk(KERN_DEBUG "pointer=%d\n", count);*/
return bytes_to_frames(subs->runtime, count);
}
unsigned short req, res ;
unsigned int phy ;
- /* printk(KERN_WARNING "snd-powermac: DMA died - patching it up!\n"); */
-
/* to clear DEAD status we must first clear RUN
set it to quiescent to be on the safe side */
(void)in_le32(&rec->dma->status);
if (! (stat & ACTIVE))
break;
- /*printk(KERN_DEBUG "update frag %d\n", rec->cur_period);*/
cp->xfer_status = cpu_to_le16(0);
cp->req_count = cpu_to_le16(rec->period_size);
/*cp->res_count = cpu_to_le16(0);*/
struct snd_pmac *chip = devid;
int ctrl = in_le32(&chip->awacs->control);
- /*printk(KERN_DEBUG "pmac: control interrupt.. 0x%x\n", ctrl);*/
if (ctrl & MASK_PORTCHG) {
/* do something when headphone is plugged/unplugged? */
if (chip->update_automute)
if (ctrl & MASK_CNTLERR) {
int err = (in_le32(&chip->awacs->codec_stat) & MASK_ERRCODE) >> 16;
if (err && chip->model <= PMAC_SCREAMER)
- snd_printk(KERN_DEBUG "error %x\n", err);
+ dev_dbg(chip->card->dev, "%s: error %x\n", __func__, err);
}
/* Writing 1s to the CNTLERR and PORTCHG bits clears them... */
out_le32(&chip->awacs->control, ctrl);
if (prop) {
/* partly deprecate snd-powermac, for those machines
* that have a layout-id property for now */
- printk(KERN_INFO "snd-powermac no longer handles any "
- "machines with a layout-id property "
- "in the device-tree, use snd-aoa.\n");
+ dev_info(chip->card->dev,
+ "snd-powermac no longer handles any machines with a layout-id property in the device-tree, use snd-aoa.\n");
of_node_put(sound);
of_node_put(chip->node);
chip->node = NULL;
*/
macio = macio_find(chip->node, macio_unknown);
if (macio == NULL)
- printk(KERN_WARNING "snd-powermac: can't locate macio !\n");
+ dev_warn(chip->card->dev, "snd-powermac: can't locate macio !\n");
else {
struct pci_dev *pdev = NULL;
}
}
if (chip->pdev == NULL)
- printk(KERN_WARNING "snd-powermac: can't locate macio PCI"
- " device !\n");
+ dev_warn(chip->card->dev,
+ "snd-powermac: can't locate macio PCI device !\n");
detect_byte_swap(chip);
chip->auto_mute = 1;
err = snd_ctl_add(chip->card, snd_ctl_new1(&auto_mute_controls[0], chip));
if (err < 0) {
- printk(KERN_ERR "snd-powermac: Failed to add automute control\n");
+ dev_err(chip->card->dev,
+ "snd-powermac: Failed to add automute control\n");
return err;
}
chip->hp_detect_ctl = snd_ctl_new1(&auto_mute_controls[1], chip);
for (i = 0; i < 2; i ++) {
if (of_address_to_resource(np->parent, i,
&chip->rsrc[i])) {
- printk(KERN_ERR "snd: can't translate rsrc "
- " %d (%s)\n", i, rnames[i]);
+ dev_err(chip->card->dev,
+ "snd: can't translate rsrc %d (%s)\n",
+ i, rnames[i]);
err = -ENODEV;
goto __error;
}
if (request_mem_region(chip->rsrc[i].start,
resource_size(&chip->rsrc[i]),
rnames[i]) == NULL) {
- printk(KERN_ERR "snd: can't request rsrc "
- " %d (%s: %pR)\n",
- i, rnames[i], &chip->rsrc[i]);
+ dev_err(chip->card->dev,
+ "snd: can't request rsrc %d (%s: %pR)\n",
+ i, rnames[i], &chip->rsrc[i]);
err = -ENODEV;
goto __error;
}
for (i = 0; i < 3; i ++) {
if (of_address_to_resource(np, i,
&chip->rsrc[i])) {
- printk(KERN_ERR "snd: can't translate rsrc "
- " %d (%s)\n", i, rnames[i]);
+ dev_err(chip->card->dev,
+ "snd: can't translate rsrc %d (%s)\n",
+ i, rnames[i]);
err = -ENODEV;
goto __error;
}
if (request_mem_region(chip->rsrc[i].start,
resource_size(&chip->rsrc[i]),
rnames[i]) == NULL) {
- printk(KERN_ERR "snd: can't request rsrc "
- " %d (%s: %pR)\n",
- i, rnames[i], &chip->rsrc[i]);
+ dev_err(chip->card->dev,
+ "snd: can't request rsrc %d (%s: %pR)\n",
+ i, rnames[i], &chip->rsrc[i]);
err = -ENODEV;
goto __error;
}
irq = irq_of_parse_and_map(np, 0);
if (request_irq(irq, snd_pmac_ctrl_intr, 0,
"PMac", (void*)chip)) {
- snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n",
- irq);
+ dev_err(chip->card->dev,
+ "pmac: unable to grab IRQ %d\n", irq);
err = -EBUSY;
goto __error;
}
}
irq = irq_of_parse_and_map(np, 1);
if (request_irq(irq, snd_pmac_tx_intr, 0, "PMac Output", (void*)chip)){
- snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq);
+ dev_err(chip->card->dev, "pmac: unable to grab IRQ %d\n", irq);
err = -EBUSY;
goto __error;
}
chip->tx_irq = irq;
irq = irq_of_parse_and_map(np, 2);
if (request_irq(irq, snd_pmac_rx_intr, 0, "PMac Input", (void*)chip)) {
- snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq);
+ dev_err(chip->card->dev, "pmac: unable to grab IRQ %d\n", irq);
err = -EBUSY;
goto __error;
}
#undef DEBUG
#ifdef DEBUG
-#define DBG(fmt...) printk(KERN_DEBUG fmt)
+#define DBG(fmt...) pr_debug(fmt)
#else
#define DBG(fmt...)
#endif
if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_VOL, 6,
block) < 0) {
- snd_printk(KERN_ERR "failed to set volume \n");
+ dev_err(&mix->i2c.client->dev, "failed to set volume\n");
return -EINVAL;
}
DBG("(I) succeeded to set volume (%u, %u)\n", left_vol, right_vol);
if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC,
2, val) < 0) {
- snd_printk(KERN_ERR "failed to set DRC\n");
+ dev_err(&mix->i2c.client->dev, "failed to set DRC\n");
return -EINVAL;
}
DBG("(I) succeeded to set DRC (%u, %u)\n", val[0], val[1]);
if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC,
6, val) < 0) {
- snd_printk(KERN_ERR "failed to set DRC\n");
+ dev_err(&mix->i2c.client->dev, "failed to set DRC\n");
return -EINVAL;
}
DBG("(I) succeeded to set DRC (%u, %u)\n", val[0], val[1]);
block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff;
if (i2c_smbus_write_i2c_block_data(mix->i2c.client, info->reg,
info->bytes, block) < 0) {
- snd_printk(KERN_ERR "failed to set mono volume %d\n",
- info->index);
+ dev_err(&mix->i2c.client->dev, "failed to set mono volume %d\n",
+ info->index);
return -EINVAL;
}
return 0;
}
if (i2c_smbus_write_i2c_block_data(mix->i2c.client, reg,
9, block) < 0) {
- snd_printk(KERN_ERR "failed to set mono volume %d\n", reg);
+ dev_err(&mix->i2c.client->dev,
+ "failed to set mono volume %d\n", reg);
return -EINVAL;
}
return 0;
node = find_audio_device(device);
if (! node) {
DBG("(W) cannot find audio device %s !\n", device);
- snd_printdd("cannot find device %s\n", device);
return -ENODEV;
}
base = of_get_property(node, "reg", NULL);
if (!base) {
DBG("(E) cannot find address for device %s !\n", device);
- snd_printd("cannot find address for device %s\n", device);
of_node_put(node);
return -ENODEV;
}
tumbler_reset_audio(chip);
if (mix->i2c.client && mix->i2c.init_client) {
if (mix->i2c.init_client(&mix->i2c) < 0)
- printk(KERN_ERR "tumbler_init_client error\n");
+ dev_err(chip->card->dev, "tumbler_init_client error\n");
} else
- printk(KERN_ERR "tumbler: i2c is not initialized\n");
+ dev_err(chip->card->dev, "tumbler: i2c is not initialized\n");
if (chip->model == PMAC_TUMBLER) {
tumbler_set_mono_volume(mix, &tumbler_pcm_vol_info);
tumbler_set_mono_volume(mix, &tumbler_bass_vol_info);