Loading sound/pci/ice1712/aureon.c +5 −2 Original line number Original line Diff line number Diff line Loading @@ -1937,9 +1937,12 @@ static int aureon_add_controls(struct snd_ice1712 *ice) snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice); id = aureon_cs8415_get(ice, CS8415_ID); id = aureon_cs8415_get(ice, CS8415_ID); if (id != 0x41) if (id != 0x41) snd_printk(KERN_INFO "No CS8415 chip. Skipping CS8415 controls.\n"); dev_info(ice->card->dev, "No CS8415 chip. Skipping CS8415 controls.\n"); else if ((id & 0x0F) != 0x01) else if ((id & 0x0F) != 0x01) snd_printk(KERN_INFO "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1)); dev_info(ice->card->dev, "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1)); else { else { for (i = 0; i < ARRAY_SIZE(cs8415_controls); i++) { for (i = 0; i < ARRAY_SIZE(cs8415_controls); i++) { struct snd_kcontrol *kctl; struct snd_kcontrol *kctl; Loading sound/pci/ice1712/delta.c +3 −2 Original line number Original line Diff line number Diff line Loading @@ -425,7 +425,8 @@ static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kco struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1) if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1) snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg); dev_err(ice->card->dev, "unable to send register 0x%x byte to CS8427\n", reg); snd_i2c_readbytes(ice->cs8427, ®, 1); snd_i2c_readbytes(ice->cs8427, ®, 1); ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0; ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0; return 0; return 0; Loading Loading @@ -637,7 +638,7 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice) case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_DELTA66E: case ICE1712_SUBDEVICE_DELTA66E: if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { snd_printk(KERN_ERR "unable to create I2C bus\n"); dev_err(ice->card->dev, "unable to create I2C bus\n"); return err; return err; } } ice->i2c->private_data = ice; ice->i2c->private_data = ice; Loading sound/pci/ice1712/ews.c +7 −5 Original line number Original line Diff line number Diff line Loading @@ -163,7 +163,8 @@ static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mas __error: __error: snd_i2c_unlock(ice->i2c); snd_i2c_unlock(ice->i2c); snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n"); dev_err(ice->card->dev, "AK4524 chip select failed, check cable to the front module\n"); return -EIO; return -EIO; } } Loading @@ -174,7 +175,7 @@ static void ews88mt_ak4524_lock(struct snd_akm4xxx *ak, int chip) unsigned char tmp; unsigned char tmp; /* assert AK4524 CS */ /* assert AK4524 CS */ if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) snd_printk(KERN_ERR "fatal error (ews88mt chip select)\n"); dev_err(ice->card->dev, "fatal error (ews88mt chip select)\n"); snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice); tmp = ICE1712_EWS88_SERIAL_DATA | tmp = ICE1712_EWS88_SERIAL_DATA | ICE1712_EWS88_SERIAL_CLOCK | ICE1712_EWS88_SERIAL_CLOCK | Loading Loading @@ -456,7 +457,7 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) /* create i2c */ /* create i2c */ if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { snd_printk(KERN_ERR "unable to create I2C bus\n"); dev_err(ice->card->dev, "unable to create I2C bus\n"); return err; return err; } } ice->i2c->private_data = ice; ice->i2c->private_data = ice; Loading @@ -469,7 +470,8 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) ICE1712_6FIRE_PCF9554_ADDR, ICE1712_6FIRE_PCF9554_ADDR, &spec->i2cdevs[EWS_I2C_6FIRE]); &spec->i2cdevs[EWS_I2C_6FIRE]); if (err < 0) { if (err < 0) { snd_printk(KERN_ERR "PCF9554 initialization failed\n"); dev_err(ice->card->dev, "PCF9554 initialization failed\n"); return err; return err; } } snd_ice1712_6fire_write_pca(ice, PCF9554_REG_CONFIG, 0x80); snd_ice1712_6fire_write_pca(ice, PCF9554_REG_CONFIG, 0x80); Loading Loading @@ -834,7 +836,7 @@ static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg byte = 0; byte = 0; if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { snd_i2c_unlock(ice->i2c); snd_i2c_unlock(ice->i2c); printk(KERN_ERR "cannot read pca\n"); dev_err(ice->card->dev, "cannot read pca\n"); return -EIO; return -EIO; } } snd_i2c_unlock(ice->i2c); snd_i2c_unlock(ice->i2c); Loading sound/pci/ice1712/ice1712.c +20 −13 Original line number Original line Diff line number Diff line Loading @@ -394,7 +394,7 @@ int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr) err = snd_cs8427_create(ice->i2c, addr, err = snd_cs8427_create(ice->i2c, addr, (ice->cs8427_timeout * HZ) / 1000, &ice->cs8427); (ice->cs8427_timeout * HZ) / 1000, &ice->cs8427); if (err < 0) { if (err < 0) { snd_printk(KERN_ERR "CS8427 initialization failed\n"); dev_err(ice->card->dev, "CS8427 initialization failed\n"); return err; return err; } } ice->spdif.ops.open = open_cs8427; ice->spdif.ops.open = open_cs8427; Loading Loading @@ -467,7 +467,7 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id) u16 pbkstatus; u16 pbkstatus; struct snd_pcm_substream *substream; struct snd_pcm_substream *substream; pbkstatus = inw(ICEDS(ice, INTSTAT)); pbkstatus = inw(ICEDS(ice, INTSTAT)); /* printk(KERN_DEBUG "pbkstatus = 0x%x\n", pbkstatus); */ /* dev_dbg(ice->card->dev, "pbkstatus = 0x%x\n", pbkstatus); */ for (idx = 0; idx < 6; idx++) { for (idx = 0; idx < 6; idx++) { if ((pbkstatus & (3 << (idx * 2))) == 0) if ((pbkstatus & (3 << (idx * 2))) == 0) continue; continue; Loading Loading @@ -903,7 +903,8 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm * if (rpcm) if (rpcm) *rpcm = pcm; *rpcm = pcm; printk(KERN_WARNING "Consumer PCM code does not work well at the moment --jk\n"); dev_warn(ice->card->dev, "Consumer PCM code does not work well at the moment --jk\n"); return 0; return 0; } } Loading Loading @@ -1534,7 +1535,8 @@ static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice) ac97.private_free = snd_ice1712_mixer_free_ac97; ac97.private_free = snd_ice1712_mixer_free_ac97; err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); if (err < 0) if (err < 0) printk(KERN_WARNING "ice1712: cannot initialize ac97 for consumer, skipped\n"); dev_warn(ice->card->dev, "cannot initialize ac97 for consumer, skipped\n"); else { else { err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice)); err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice)); if (err < 0) if (err < 0) Loading @@ -1552,7 +1554,8 @@ static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice) ac97.private_free = snd_ice1712_mixer_free_ac97; ac97.private_free = snd_ice1712_mixer_free_ac97; err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); if (err < 0) if (err < 0) printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n"); dev_warn(ice->card->dev, "cannot initialize pro ac97, skipped\n"); else else return 0; return 0; } } Loading Loading @@ -2332,7 +2335,8 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, pci_read_config_word(ice->pci, PCI_SUBSYSTEM_ID, &device); pci_read_config_word(ice->pci, PCI_SUBSYSTEM_ID, &device); ice->eeprom.subvendor = ((unsigned int)swab16(vendor) << 16) | swab16(device); ice->eeprom.subvendor = ((unsigned int)swab16(vendor) << 16) | swab16(device); if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { printk(KERN_ERR "ice1712: No valid ID is found\n"); dev_err(ice->card->dev, "No valid ID is found\n"); return -ENXIO; return -ENXIO; } } } } Loading @@ -2340,21 +2344,22 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, for (tbl = card_tables; *tbl; tbl++) { for (tbl = card_tables; *tbl; tbl++) { for (c = *tbl; c->subvendor; c++) { for (c = *tbl; c->subvendor; c++) { if (modelname && c->model && !strcmp(modelname, c->model)) { if (modelname && c->model && !strcmp(modelname, c->model)) { printk(KERN_INFO "ice1712: Using board model %s\n", c->name); dev_info(ice->card->dev, "Using board model %s\n", c->name); ice->eeprom.subvendor = c->subvendor; ice->eeprom.subvendor = c->subvendor; } else if (c->subvendor != ice->eeprom.subvendor) } else if (c->subvendor != ice->eeprom.subvendor) continue; continue; if (!c->eeprom_size || !c->eeprom_data) if (!c->eeprom_size || !c->eeprom_data) goto found; goto found; /* if the EEPROM is given by the driver, use it */ /* if the EEPROM is given by the driver, use it */ snd_printdd("using the defined eeprom..\n"); dev_dbg(ice->card->dev, "using the defined eeprom..\n"); ice->eeprom.version = 1; ice->eeprom.version = 1; ice->eeprom.size = c->eeprom_size + 6; ice->eeprom.size = c->eeprom_size + 6; memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); goto read_skipped; goto read_skipped; } } } } printk(KERN_WARNING "ice1712: No matching model found for ID 0x%x\n", dev_warn(ice->card->dev, "No matching model found for ID 0x%x\n", ice->eeprom.subvendor); ice->eeprom.subvendor); found: found: Loading @@ -2362,12 +2367,13 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, if (ice->eeprom.size < 6) if (ice->eeprom.size < 6) ice->eeprom.size = 32; /* FIXME: any cards without the correct size? */ ice->eeprom.size = 32; /* FIXME: any cards without the correct size? */ else if (ice->eeprom.size > 32) { else if (ice->eeprom.size > 32) { snd_printk(KERN_ERR "invalid EEPROM (size = %i)\n", ice->eeprom.size); dev_err(ice->card->dev, "invalid EEPROM (size = %i)\n", ice->eeprom.size); return -EIO; return -EIO; } } ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05); ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05); if (ice->eeprom.version != 1) { if (ice->eeprom.version != 1) { snd_printk(KERN_ERR "invalid EEPROM version %i\n", dev_err(ice->card->dev, "invalid EEPROM version %i\n", ice->eeprom.version); ice->eeprom.version); /* return -EIO; */ /* return -EIO; */ } } Loading Loading @@ -2553,7 +2559,8 @@ static int snd_ice1712_create(struct snd_card *card, /* check, if we can restrict PCI DMA transfers to 28 bits */ /* check, if we can restrict PCI DMA transfers to 28 bits */ if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); dev_err(card->dev, "architecture does not support 28bit PCI busmaster DMA\n"); pci_disable_device(pci); pci_disable_device(pci); return -ENXIO; return -ENXIO; } } Loading Loading @@ -2609,7 +2616,7 @@ static int snd_ice1712_create(struct snd_card *card, if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_SHARED, if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_SHARED, KBUILD_MODNAME, ice)) { KBUILD_MODNAME, ice)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); snd_ice1712_free(ice); snd_ice1712_free(ice); return -EIO; return -EIO; } } Loading sound/pci/ice1712/ice1724.c +24 −21 Original line number Original line Diff line number Diff line Loading @@ -146,7 +146,7 @@ static unsigned char snd_vt1724_ac97_ready(struct snd_ice1712 *ice) continue; continue; return old_cmd; return old_cmd; } } snd_printd(KERN_ERR "snd_vt1724_ac97_ready: timeout\n"); dev_dbg(ice->card->dev, "snd_vt1724_ac97_ready: timeout\n"); return old_cmd; return old_cmd; } } Loading @@ -156,7 +156,7 @@ static int snd_vt1724_ac97_wait_bit(struct snd_ice1712 *ice, unsigned char bit) for (tm = 0; tm < 0x10000; tm++) for (tm = 0; tm < 0x10000; tm++) if ((inb(ICEMT1724(ice, AC97_CMD)) & bit) == 0) if ((inb(ICEMT1724(ice, AC97_CMD)) & bit) == 0) return 0; return 0; snd_printd(KERN_ERR "snd_vt1724_ac97_wait_bit: timeout\n"); dev_dbg(ice->card->dev, "snd_vt1724_ac97_wait_bit: timeout\n"); return -EIO; return -EIO; } } Loading Loading @@ -430,10 +430,10 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id) spin_lock(&ice->reg_lock); spin_lock(&ice->reg_lock); if (++timeout > 10) { if (++timeout > 10) { status = inb(ICEREG1724(ice, IRQSTAT)); status = inb(ICEREG1724(ice, IRQSTAT)); printk(KERN_ERR "ice1724: Too long irq loop, " dev_err(ice->card->dev, "status = 0x%x\n", status); "Too long irq loop, status = 0x%x\n", status); if (status & VT1724_IRQ_MPU_TX) { if (status & VT1724_IRQ_MPU_TX) { printk(KERN_ERR "ice1724: Disabling MPU_TX\n"); dev_err(ice->card->dev, "Disabling MPU_TX\n"); enable_midi_irq(ice, VT1724_IRQ_MPU_TX, 0); enable_midi_irq(ice, VT1724_IRQ_MPU_TX, 0); } } spin_unlock(&ice->reg_lock); spin_unlock(&ice->reg_lock); Loading Loading @@ -801,7 +801,7 @@ static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream) spin_unlock_irq(&ice->reg_lock); spin_unlock_irq(&ice->reg_lock); /* /* printk(KERN_DEBUG "pro prepare: ch = %d, addr = 0x%x, " dev_dbg(ice->card->dev, "pro prepare: ch = %d, addr = 0x%x, " "buffer = 0x%x, period = 0x%x\n", "buffer = 0x%x, period = 0x%x\n", substream->runtime->channels, substream->runtime->channels, (unsigned int)substream->runtime->dma_addr, (unsigned int)substream->runtime->dma_addr, Loading @@ -821,13 +821,13 @@ static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substrea #if 0 /* read PLAYBACK_ADDR */ #if 0 /* read PLAYBACK_ADDR */ ptr = inl(ICEMT1724(ice, PLAYBACK_ADDR)); ptr = inl(ICEMT1724(ice, PLAYBACK_ADDR)); if (ptr < substream->runtime->dma_addr) { if (ptr < substream->runtime->dma_addr) { snd_printd("ice1724: invalid negative ptr\n"); dev_dbg(ice->card->dev, "invalid negative ptr\n"); return 0; return 0; } } ptr -= substream->runtime->dma_addr; ptr -= substream->runtime->dma_addr; ptr = bytes_to_frames(substream->runtime, ptr); ptr = bytes_to_frames(substream->runtime, ptr); if (ptr >= substream->runtime->buffer_size) { if (ptr >= substream->runtime->buffer_size) { snd_printd("ice1724: invalid ptr %d (size=%d)\n", dev_dbg(ice->card->dev, "invalid ptr %d (size=%d)\n", (int)ptr, (int)substream->runtime->period_size); (int)ptr, (int)substream->runtime->period_size); return 0; return 0; } } Loading @@ -840,7 +840,7 @@ static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substrea else if (ptr <= substream->runtime->buffer_size) else if (ptr <= substream->runtime->buffer_size) ptr = substream->runtime->buffer_size - ptr; ptr = substream->runtime->buffer_size - ptr; else { else { snd_printd("ice1724: invalid ptr %d (size=%d)\n", dev_dbg(ice->card->dev, "invalid ptr %d (size=%d)\n", (int)ptr, (int)substream->runtime->buffer_size); (int)ptr, (int)substream->runtime->buffer_size); ptr = 0; ptr = 0; } } Loading Loading @@ -884,7 +884,7 @@ static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substr else if (ptr <= substream->runtime->buffer_size) else if (ptr <= substream->runtime->buffer_size) ptr = substream->runtime->buffer_size - ptr; ptr = substream->runtime->buffer_size - ptr; else { else { snd_printd("ice1724: invalid ptr %d (size=%d)\n", dev_dbg(ice->card->dev, "invalid ptr %d (size=%d)\n", (int)ptr, (int)substream->runtime->buffer_size); (int)ptr, (int)substream->runtime->buffer_size); ptr = 0; ptr = 0; } } Loading Loading @@ -1508,7 +1508,8 @@ static int snd_vt1724_ac97_mixer(struct snd_ice1712 *ice) ac97.private_data = ice; ac97.private_data = ice; err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); if (err < 0) if (err < 0) printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n"); dev_warn(ice->card->dev, "cannot initialize pro ac97, skipped\n"); else else return 0; return 0; } } Loading Loading @@ -2271,7 +2272,7 @@ static void wait_i2c_busy(struct snd_ice1712 *ice) while ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_BUSY) && t--) while ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_BUSY) && t--) ; ; if (t == -1) if (t == -1) printk(KERN_ERR "ice1724: i2c busy timeout\n"); dev_err(ice->card->dev, "i2c busy timeout\n"); } } unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, Loading @@ -2287,7 +2288,7 @@ unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, val = inb(ICEREG1724(ice, I2C_DATA)); val = inb(ICEREG1724(ice, I2C_DATA)); mutex_unlock(&ice->i2c_mutex); mutex_unlock(&ice->i2c_mutex); /* /* printk(KERN_DEBUG "i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); dev_dbg(ice->card->dev, "i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); */ */ return val; return val; } } Loading @@ -2298,7 +2299,7 @@ void snd_vt1724_write_i2c(struct snd_ice1712 *ice, mutex_lock(&ice->i2c_mutex); mutex_lock(&ice->i2c_mutex); wait_i2c_busy(ice); wait_i2c_busy(ice); /* /* printk(KERN_DEBUG "i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); dev_dbg(ice->card->dev, "i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); */ */ outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); outb(data, ICEREG1724(ice, I2C_DATA)); outb(data, ICEREG1724(ice, I2C_DATA)); Loading Loading @@ -2335,7 +2336,8 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, ((unsigned int)swab16(vendor) << 16) | swab16(device); ((unsigned int)swab16(vendor) << 16) | swab16(device); if (ice->eeprom.subvendor == 0 || if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { ice->eeprom.subvendor == (unsigned int)-1) { printk(KERN_ERR "ice1724: No valid ID is found\n"); dev_err(ice->card->dev, "No valid ID is found\n"); return -ENXIO; return -ENXIO; } } } } Loading @@ -2344,7 +2346,8 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, for (c = *tbl; c->name; c++) { for (c = *tbl; c->name; c++) { if (modelname && c->model && if (modelname && c->model && !strcmp(modelname, c->model)) { !strcmp(modelname, c->model)) { printk(KERN_INFO "ice1724: Using board model %s\n", dev_info(ice->card->dev, "Using board model %s\n", c->name); c->name); ice->eeprom.subvendor = c->subvendor; ice->eeprom.subvendor = c->subvendor; } else if (c->subvendor != ice->eeprom.subvendor) } else if (c->subvendor != ice->eeprom.subvendor) Loading @@ -2353,14 +2356,14 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, if (!c->eeprom_size || !c->eeprom_data) if (!c->eeprom_size || !c->eeprom_data) goto found; goto found; /* if the EEPROM is given by the driver, use it */ /* if the EEPROM is given by the driver, use it */ snd_printdd("using the defined eeprom..\n"); dev_dbg(ice->card->dev, "using the defined eeprom..\n"); ice->eeprom.version = 2; ice->eeprom.version = 2; ice->eeprom.size = c->eeprom_size + 6; ice->eeprom.size = c->eeprom_size + 6; memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); goto read_skipped; goto read_skipped; } } } } printk(KERN_WARNING "ice1724: No matching model found for ID 0x%x\n", dev_warn(ice->card->dev, "No matching model found for ID 0x%x\n", ice->eeprom.subvendor); ice->eeprom.subvendor); #ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP /* assume AC97-only card which can suspend without additional code */ /* assume AC97-only card which can suspend without additional code */ Loading @@ -2372,13 +2375,13 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, if (ice->eeprom.size < 6) if (ice->eeprom.size < 6) ice->eeprom.size = 32; ice->eeprom.size = 32; else if (ice->eeprom.size > 32) { else if (ice->eeprom.size > 32) { printk(KERN_ERR "ice1724: Invalid EEPROM (size = %i)\n", dev_err(ice->card->dev, "Invalid EEPROM (size = %i)\n", ice->eeprom.size); ice->eeprom.size); return -EIO; return -EIO; } } ice->eeprom.version = snd_vt1724_read_i2c(ice, dev, 0x05); ice->eeprom.version = snd_vt1724_read_i2c(ice, dev, 0x05); if (ice->eeprom.version != 1 && ice->eeprom.version != 2) if (ice->eeprom.version != 1 && ice->eeprom.version != 2) printk(KERN_WARNING "ice1724: Invalid EEPROM version %i\n", dev_warn(ice->card->dev, "Invalid EEPROM version %i\n", ice->eeprom.version); ice->eeprom.version); size = ice->eeprom.size - 6; size = ice->eeprom.size - 6; for (i = 0; i < size; i++) for (i = 0; i < size; i++) Loading Loading @@ -2586,7 +2589,7 @@ static int snd_vt1724_create(struct snd_card *card, if (request_irq(pci->irq, snd_vt1724_interrupt, if (request_irq(pci->irq, snd_vt1724_interrupt, IRQF_SHARED, KBUILD_MODNAME, ice)) { IRQF_SHARED, KBUILD_MODNAME, ice)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); snd_vt1724_free(ice); snd_vt1724_free(ice); return -EIO; return -EIO; } } Loading Loading
sound/pci/ice1712/aureon.c +5 −2 Original line number Original line Diff line number Diff line Loading @@ -1937,9 +1937,12 @@ static int aureon_add_controls(struct snd_ice1712 *ice) snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice); id = aureon_cs8415_get(ice, CS8415_ID); id = aureon_cs8415_get(ice, CS8415_ID); if (id != 0x41) if (id != 0x41) snd_printk(KERN_INFO "No CS8415 chip. Skipping CS8415 controls.\n"); dev_info(ice->card->dev, "No CS8415 chip. Skipping CS8415 controls.\n"); else if ((id & 0x0F) != 0x01) else if ((id & 0x0F) != 0x01) snd_printk(KERN_INFO "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1)); dev_info(ice->card->dev, "Detected unsupported CS8415 rev. (%c)\n", (char)((id & 0x0F) + 'A' - 1)); else { else { for (i = 0; i < ARRAY_SIZE(cs8415_controls); i++) { for (i = 0; i < ARRAY_SIZE(cs8415_controls); i++) { struct snd_kcontrol *kctl; struct snd_kcontrol *kctl; Loading
sound/pci/ice1712/delta.c +3 −2 Original line number Original line Diff line number Diff line Loading @@ -425,7 +425,8 @@ static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kco struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1) if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1) snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg); dev_err(ice->card->dev, "unable to send register 0x%x byte to CS8427\n", reg); snd_i2c_readbytes(ice->cs8427, ®, 1); snd_i2c_readbytes(ice->cs8427, ®, 1); ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0; ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0; return 0; return 0; Loading Loading @@ -637,7 +638,7 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice) case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_DELTA66E: case ICE1712_SUBDEVICE_DELTA66E: if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { snd_printk(KERN_ERR "unable to create I2C bus\n"); dev_err(ice->card->dev, "unable to create I2C bus\n"); return err; return err; } } ice->i2c->private_data = ice; ice->i2c->private_data = ice; Loading
sound/pci/ice1712/ews.c +7 −5 Original line number Original line Diff line number Diff line Loading @@ -163,7 +163,8 @@ static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mas __error: __error: snd_i2c_unlock(ice->i2c); snd_i2c_unlock(ice->i2c); snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n"); dev_err(ice->card->dev, "AK4524 chip select failed, check cable to the front module\n"); return -EIO; return -EIO; } } Loading @@ -174,7 +175,7 @@ static void ews88mt_ak4524_lock(struct snd_akm4xxx *ak, int chip) unsigned char tmp; unsigned char tmp; /* assert AK4524 CS */ /* assert AK4524 CS */ if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) snd_printk(KERN_ERR "fatal error (ews88mt chip select)\n"); dev_err(ice->card->dev, "fatal error (ews88mt chip select)\n"); snd_ice1712_save_gpio_status(ice); snd_ice1712_save_gpio_status(ice); tmp = ICE1712_EWS88_SERIAL_DATA | tmp = ICE1712_EWS88_SERIAL_DATA | ICE1712_EWS88_SERIAL_CLOCK | ICE1712_EWS88_SERIAL_CLOCK | Loading Loading @@ -456,7 +457,7 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) /* create i2c */ /* create i2c */ if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { snd_printk(KERN_ERR "unable to create I2C bus\n"); dev_err(ice->card->dev, "unable to create I2C bus\n"); return err; return err; } } ice->i2c->private_data = ice; ice->i2c->private_data = ice; Loading @@ -469,7 +470,8 @@ static int snd_ice1712_ews_init(struct snd_ice1712 *ice) ICE1712_6FIRE_PCF9554_ADDR, ICE1712_6FIRE_PCF9554_ADDR, &spec->i2cdevs[EWS_I2C_6FIRE]); &spec->i2cdevs[EWS_I2C_6FIRE]); if (err < 0) { if (err < 0) { snd_printk(KERN_ERR "PCF9554 initialization failed\n"); dev_err(ice->card->dev, "PCF9554 initialization failed\n"); return err; return err; } } snd_ice1712_6fire_write_pca(ice, PCF9554_REG_CONFIG, 0x80); snd_ice1712_6fire_write_pca(ice, PCF9554_REG_CONFIG, 0x80); Loading Loading @@ -834,7 +836,7 @@ static int snd_ice1712_6fire_read_pca(struct snd_ice1712 *ice, unsigned char reg byte = 0; byte = 0; if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { snd_i2c_unlock(ice->i2c); snd_i2c_unlock(ice->i2c); printk(KERN_ERR "cannot read pca\n"); dev_err(ice->card->dev, "cannot read pca\n"); return -EIO; return -EIO; } } snd_i2c_unlock(ice->i2c); snd_i2c_unlock(ice->i2c); Loading
sound/pci/ice1712/ice1712.c +20 −13 Original line number Original line Diff line number Diff line Loading @@ -394,7 +394,7 @@ int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr) err = snd_cs8427_create(ice->i2c, addr, err = snd_cs8427_create(ice->i2c, addr, (ice->cs8427_timeout * HZ) / 1000, &ice->cs8427); (ice->cs8427_timeout * HZ) / 1000, &ice->cs8427); if (err < 0) { if (err < 0) { snd_printk(KERN_ERR "CS8427 initialization failed\n"); dev_err(ice->card->dev, "CS8427 initialization failed\n"); return err; return err; } } ice->spdif.ops.open = open_cs8427; ice->spdif.ops.open = open_cs8427; Loading Loading @@ -467,7 +467,7 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id) u16 pbkstatus; u16 pbkstatus; struct snd_pcm_substream *substream; struct snd_pcm_substream *substream; pbkstatus = inw(ICEDS(ice, INTSTAT)); pbkstatus = inw(ICEDS(ice, INTSTAT)); /* printk(KERN_DEBUG "pbkstatus = 0x%x\n", pbkstatus); */ /* dev_dbg(ice->card->dev, "pbkstatus = 0x%x\n", pbkstatus); */ for (idx = 0; idx < 6; idx++) { for (idx = 0; idx < 6; idx++) { if ((pbkstatus & (3 << (idx * 2))) == 0) if ((pbkstatus & (3 << (idx * 2))) == 0) continue; continue; Loading Loading @@ -903,7 +903,8 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm * if (rpcm) if (rpcm) *rpcm = pcm; *rpcm = pcm; printk(KERN_WARNING "Consumer PCM code does not work well at the moment --jk\n"); dev_warn(ice->card->dev, "Consumer PCM code does not work well at the moment --jk\n"); return 0; return 0; } } Loading Loading @@ -1534,7 +1535,8 @@ static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice) ac97.private_free = snd_ice1712_mixer_free_ac97; ac97.private_free = snd_ice1712_mixer_free_ac97; err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); if (err < 0) if (err < 0) printk(KERN_WARNING "ice1712: cannot initialize ac97 for consumer, skipped\n"); dev_warn(ice->card->dev, "cannot initialize ac97 for consumer, skipped\n"); else { else { err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice)); err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice)); if (err < 0) if (err < 0) Loading @@ -1552,7 +1554,8 @@ static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice) ac97.private_free = snd_ice1712_mixer_free_ac97; ac97.private_free = snd_ice1712_mixer_free_ac97; err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); if (err < 0) if (err < 0) printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n"); dev_warn(ice->card->dev, "cannot initialize pro ac97, skipped\n"); else else return 0; return 0; } } Loading Loading @@ -2332,7 +2335,8 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, pci_read_config_word(ice->pci, PCI_SUBSYSTEM_ID, &device); pci_read_config_word(ice->pci, PCI_SUBSYSTEM_ID, &device); ice->eeprom.subvendor = ((unsigned int)swab16(vendor) << 16) | swab16(device); ice->eeprom.subvendor = ((unsigned int)swab16(vendor) << 16) | swab16(device); if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { printk(KERN_ERR "ice1712: No valid ID is found\n"); dev_err(ice->card->dev, "No valid ID is found\n"); return -ENXIO; return -ENXIO; } } } } Loading @@ -2340,21 +2344,22 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, for (tbl = card_tables; *tbl; tbl++) { for (tbl = card_tables; *tbl; tbl++) { for (c = *tbl; c->subvendor; c++) { for (c = *tbl; c->subvendor; c++) { if (modelname && c->model && !strcmp(modelname, c->model)) { if (modelname && c->model && !strcmp(modelname, c->model)) { printk(KERN_INFO "ice1712: Using board model %s\n", c->name); dev_info(ice->card->dev, "Using board model %s\n", c->name); ice->eeprom.subvendor = c->subvendor; ice->eeprom.subvendor = c->subvendor; } else if (c->subvendor != ice->eeprom.subvendor) } else if (c->subvendor != ice->eeprom.subvendor) continue; continue; if (!c->eeprom_size || !c->eeprom_data) if (!c->eeprom_size || !c->eeprom_data) goto found; goto found; /* if the EEPROM is given by the driver, use it */ /* if the EEPROM is given by the driver, use it */ snd_printdd("using the defined eeprom..\n"); dev_dbg(ice->card->dev, "using the defined eeprom..\n"); ice->eeprom.version = 1; ice->eeprom.version = 1; ice->eeprom.size = c->eeprom_size + 6; ice->eeprom.size = c->eeprom_size + 6; memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); goto read_skipped; goto read_skipped; } } } } printk(KERN_WARNING "ice1712: No matching model found for ID 0x%x\n", dev_warn(ice->card->dev, "No matching model found for ID 0x%x\n", ice->eeprom.subvendor); ice->eeprom.subvendor); found: found: Loading @@ -2362,12 +2367,13 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, if (ice->eeprom.size < 6) if (ice->eeprom.size < 6) ice->eeprom.size = 32; /* FIXME: any cards without the correct size? */ ice->eeprom.size = 32; /* FIXME: any cards without the correct size? */ else if (ice->eeprom.size > 32) { else if (ice->eeprom.size > 32) { snd_printk(KERN_ERR "invalid EEPROM (size = %i)\n", ice->eeprom.size); dev_err(ice->card->dev, "invalid EEPROM (size = %i)\n", ice->eeprom.size); return -EIO; return -EIO; } } ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05); ice->eeprom.version = snd_ice1712_read_i2c(ice, dev, 0x05); if (ice->eeprom.version != 1) { if (ice->eeprom.version != 1) { snd_printk(KERN_ERR "invalid EEPROM version %i\n", dev_err(ice->card->dev, "invalid EEPROM version %i\n", ice->eeprom.version); ice->eeprom.version); /* return -EIO; */ /* return -EIO; */ } } Loading Loading @@ -2553,7 +2559,8 @@ static int snd_ice1712_create(struct snd_card *card, /* check, if we can restrict PCI DMA transfers to 28 bits */ /* check, if we can restrict PCI DMA transfers to 28 bits */ if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); dev_err(card->dev, "architecture does not support 28bit PCI busmaster DMA\n"); pci_disable_device(pci); pci_disable_device(pci); return -ENXIO; return -ENXIO; } } Loading Loading @@ -2609,7 +2616,7 @@ static int snd_ice1712_create(struct snd_card *card, if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_SHARED, if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_SHARED, KBUILD_MODNAME, ice)) { KBUILD_MODNAME, ice)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); snd_ice1712_free(ice); snd_ice1712_free(ice); return -EIO; return -EIO; } } Loading
sound/pci/ice1712/ice1724.c +24 −21 Original line number Original line Diff line number Diff line Loading @@ -146,7 +146,7 @@ static unsigned char snd_vt1724_ac97_ready(struct snd_ice1712 *ice) continue; continue; return old_cmd; return old_cmd; } } snd_printd(KERN_ERR "snd_vt1724_ac97_ready: timeout\n"); dev_dbg(ice->card->dev, "snd_vt1724_ac97_ready: timeout\n"); return old_cmd; return old_cmd; } } Loading @@ -156,7 +156,7 @@ static int snd_vt1724_ac97_wait_bit(struct snd_ice1712 *ice, unsigned char bit) for (tm = 0; tm < 0x10000; tm++) for (tm = 0; tm < 0x10000; tm++) if ((inb(ICEMT1724(ice, AC97_CMD)) & bit) == 0) if ((inb(ICEMT1724(ice, AC97_CMD)) & bit) == 0) return 0; return 0; snd_printd(KERN_ERR "snd_vt1724_ac97_wait_bit: timeout\n"); dev_dbg(ice->card->dev, "snd_vt1724_ac97_wait_bit: timeout\n"); return -EIO; return -EIO; } } Loading Loading @@ -430,10 +430,10 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id) spin_lock(&ice->reg_lock); spin_lock(&ice->reg_lock); if (++timeout > 10) { if (++timeout > 10) { status = inb(ICEREG1724(ice, IRQSTAT)); status = inb(ICEREG1724(ice, IRQSTAT)); printk(KERN_ERR "ice1724: Too long irq loop, " dev_err(ice->card->dev, "status = 0x%x\n", status); "Too long irq loop, status = 0x%x\n", status); if (status & VT1724_IRQ_MPU_TX) { if (status & VT1724_IRQ_MPU_TX) { printk(KERN_ERR "ice1724: Disabling MPU_TX\n"); dev_err(ice->card->dev, "Disabling MPU_TX\n"); enable_midi_irq(ice, VT1724_IRQ_MPU_TX, 0); enable_midi_irq(ice, VT1724_IRQ_MPU_TX, 0); } } spin_unlock(&ice->reg_lock); spin_unlock(&ice->reg_lock); Loading Loading @@ -801,7 +801,7 @@ static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream) spin_unlock_irq(&ice->reg_lock); spin_unlock_irq(&ice->reg_lock); /* /* printk(KERN_DEBUG "pro prepare: ch = %d, addr = 0x%x, " dev_dbg(ice->card->dev, "pro prepare: ch = %d, addr = 0x%x, " "buffer = 0x%x, period = 0x%x\n", "buffer = 0x%x, period = 0x%x\n", substream->runtime->channels, substream->runtime->channels, (unsigned int)substream->runtime->dma_addr, (unsigned int)substream->runtime->dma_addr, Loading @@ -821,13 +821,13 @@ static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substrea #if 0 /* read PLAYBACK_ADDR */ #if 0 /* read PLAYBACK_ADDR */ ptr = inl(ICEMT1724(ice, PLAYBACK_ADDR)); ptr = inl(ICEMT1724(ice, PLAYBACK_ADDR)); if (ptr < substream->runtime->dma_addr) { if (ptr < substream->runtime->dma_addr) { snd_printd("ice1724: invalid negative ptr\n"); dev_dbg(ice->card->dev, "invalid negative ptr\n"); return 0; return 0; } } ptr -= substream->runtime->dma_addr; ptr -= substream->runtime->dma_addr; ptr = bytes_to_frames(substream->runtime, ptr); ptr = bytes_to_frames(substream->runtime, ptr); if (ptr >= substream->runtime->buffer_size) { if (ptr >= substream->runtime->buffer_size) { snd_printd("ice1724: invalid ptr %d (size=%d)\n", dev_dbg(ice->card->dev, "invalid ptr %d (size=%d)\n", (int)ptr, (int)substream->runtime->period_size); (int)ptr, (int)substream->runtime->period_size); return 0; return 0; } } Loading @@ -840,7 +840,7 @@ static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substrea else if (ptr <= substream->runtime->buffer_size) else if (ptr <= substream->runtime->buffer_size) ptr = substream->runtime->buffer_size - ptr; ptr = substream->runtime->buffer_size - ptr; else { else { snd_printd("ice1724: invalid ptr %d (size=%d)\n", dev_dbg(ice->card->dev, "invalid ptr %d (size=%d)\n", (int)ptr, (int)substream->runtime->buffer_size); (int)ptr, (int)substream->runtime->buffer_size); ptr = 0; ptr = 0; } } Loading Loading @@ -884,7 +884,7 @@ static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substr else if (ptr <= substream->runtime->buffer_size) else if (ptr <= substream->runtime->buffer_size) ptr = substream->runtime->buffer_size - ptr; ptr = substream->runtime->buffer_size - ptr; else { else { snd_printd("ice1724: invalid ptr %d (size=%d)\n", dev_dbg(ice->card->dev, "invalid ptr %d (size=%d)\n", (int)ptr, (int)substream->runtime->buffer_size); (int)ptr, (int)substream->runtime->buffer_size); ptr = 0; ptr = 0; } } Loading Loading @@ -1508,7 +1508,8 @@ static int snd_vt1724_ac97_mixer(struct snd_ice1712 *ice) ac97.private_data = ice; ac97.private_data = ice; err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); err = snd_ac97_mixer(pbus, &ac97, &ice->ac97); if (err < 0) if (err < 0) printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n"); dev_warn(ice->card->dev, "cannot initialize pro ac97, skipped\n"); else else return 0; return 0; } } Loading Loading @@ -2271,7 +2272,7 @@ static void wait_i2c_busy(struct snd_ice1712 *ice) while ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_BUSY) && t--) while ((inb(ICEREG1724(ice, I2C_CTRL)) & VT1724_I2C_BUSY) && t--) ; ; if (t == -1) if (t == -1) printk(KERN_ERR "ice1724: i2c busy timeout\n"); dev_err(ice->card->dev, "i2c busy timeout\n"); } } unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, Loading @@ -2287,7 +2288,7 @@ unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, val = inb(ICEREG1724(ice, I2C_DATA)); val = inb(ICEREG1724(ice, I2C_DATA)); mutex_unlock(&ice->i2c_mutex); mutex_unlock(&ice->i2c_mutex); /* /* printk(KERN_DEBUG "i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); dev_dbg(ice->card->dev, "i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); */ */ return val; return val; } } Loading @@ -2298,7 +2299,7 @@ void snd_vt1724_write_i2c(struct snd_ice1712 *ice, mutex_lock(&ice->i2c_mutex); mutex_lock(&ice->i2c_mutex); wait_i2c_busy(ice); wait_i2c_busy(ice); /* /* printk(KERN_DEBUG "i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); dev_dbg(ice->card->dev, "i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); */ */ outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR)); outb(data, ICEREG1724(ice, I2C_DATA)); outb(data, ICEREG1724(ice, I2C_DATA)); Loading Loading @@ -2335,7 +2336,8 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, ((unsigned int)swab16(vendor) << 16) | swab16(device); ((unsigned int)swab16(vendor) << 16) | swab16(device); if (ice->eeprom.subvendor == 0 || if (ice->eeprom.subvendor == 0 || ice->eeprom.subvendor == (unsigned int)-1) { ice->eeprom.subvendor == (unsigned int)-1) { printk(KERN_ERR "ice1724: No valid ID is found\n"); dev_err(ice->card->dev, "No valid ID is found\n"); return -ENXIO; return -ENXIO; } } } } Loading @@ -2344,7 +2346,8 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, for (c = *tbl; c->name; c++) { for (c = *tbl; c->name; c++) { if (modelname && c->model && if (modelname && c->model && !strcmp(modelname, c->model)) { !strcmp(modelname, c->model)) { printk(KERN_INFO "ice1724: Using board model %s\n", dev_info(ice->card->dev, "Using board model %s\n", c->name); c->name); ice->eeprom.subvendor = c->subvendor; ice->eeprom.subvendor = c->subvendor; } else if (c->subvendor != ice->eeprom.subvendor) } else if (c->subvendor != ice->eeprom.subvendor) Loading @@ -2353,14 +2356,14 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, if (!c->eeprom_size || !c->eeprom_data) if (!c->eeprom_size || !c->eeprom_data) goto found; goto found; /* if the EEPROM is given by the driver, use it */ /* if the EEPROM is given by the driver, use it */ snd_printdd("using the defined eeprom..\n"); dev_dbg(ice->card->dev, "using the defined eeprom..\n"); ice->eeprom.version = 2; ice->eeprom.version = 2; ice->eeprom.size = c->eeprom_size + 6; ice->eeprom.size = c->eeprom_size + 6; memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); memcpy(ice->eeprom.data, c->eeprom_data, c->eeprom_size); goto read_skipped; goto read_skipped; } } } } printk(KERN_WARNING "ice1724: No matching model found for ID 0x%x\n", dev_warn(ice->card->dev, "No matching model found for ID 0x%x\n", ice->eeprom.subvendor); ice->eeprom.subvendor); #ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP /* assume AC97-only card which can suspend without additional code */ /* assume AC97-only card which can suspend without additional code */ Loading @@ -2372,13 +2375,13 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, if (ice->eeprom.size < 6) if (ice->eeprom.size < 6) ice->eeprom.size = 32; ice->eeprom.size = 32; else if (ice->eeprom.size > 32) { else if (ice->eeprom.size > 32) { printk(KERN_ERR "ice1724: Invalid EEPROM (size = %i)\n", dev_err(ice->card->dev, "Invalid EEPROM (size = %i)\n", ice->eeprom.size); ice->eeprom.size); return -EIO; return -EIO; } } ice->eeprom.version = snd_vt1724_read_i2c(ice, dev, 0x05); ice->eeprom.version = snd_vt1724_read_i2c(ice, dev, 0x05); if (ice->eeprom.version != 1 && ice->eeprom.version != 2) if (ice->eeprom.version != 1 && ice->eeprom.version != 2) printk(KERN_WARNING "ice1724: Invalid EEPROM version %i\n", dev_warn(ice->card->dev, "Invalid EEPROM version %i\n", ice->eeprom.version); ice->eeprom.version); size = ice->eeprom.size - 6; size = ice->eeprom.size - 6; for (i = 0; i < size; i++) for (i = 0; i < size; i++) Loading Loading @@ -2586,7 +2589,7 @@ static int snd_vt1724_create(struct snd_card *card, if (request_irq(pci->irq, snd_vt1724_interrupt, if (request_irq(pci->irq, snd_vt1724_interrupt, IRQF_SHARED, KBUILD_MODNAME, ice)) { IRQF_SHARED, KBUILD_MODNAME, ice)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); snd_vt1724_free(ice); snd_vt1724_free(ice); return -EIO; return -EIO; } } Loading