Commit b157c1b9 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] show codec name in card description

AC97 Codec Core,ATIIXP driver,Intel8x0 driver,VIA82xx driver
Include the AC97 codec name in the card longname of
motherboard controllers.
(to enhance the chance of getting useful bug reports :)
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent a7b24c52
......@@ -529,6 +529,7 @@ static inline int ac97_can_spdif(ac97_t * ac97)
/* functions */
int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops, void *private_data, ac97_bus_t **rbus); /* create new AC97 bus */
int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */
const char *snd_ac97_get_short_name(ac97_t *ac97);
void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value);
unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg);
......
......@@ -1759,6 +1759,22 @@ void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name, int modem)
sprintf(name + strlen(name), " id %x", id & 0xff);
}
/**
* snd_ac97_get_short_name - retrieve codec name
* @ac97: the codec instance
*
* Returns the short identifying name of the codec.
*/
const char *snd_ac97_get_short_name(ac97_t *ac97)
{
const ac97_codec_id_t *pid;
for (pid = snd_ac97_codec_ids; pid->id; pid++)
if (pid->id == (ac97->id & pid->mask))
return pid->name;
return "unknown codec";
}
/* wait for a while until registers are accessible after RESET
* return 0 if ok, negative not ready
......@@ -2496,6 +2512,7 @@ EXPORT_SYMBOL(snd_ac97_read);
EXPORT_SYMBOL(snd_ac97_write_cache);
EXPORT_SYMBOL(snd_ac97_update);
EXPORT_SYMBOL(snd_ac97_update_bits);
EXPORT_SYMBOL(snd_ac97_get_short_name);
EXPORT_SYMBOL(snd_ac97_bus);
EXPORT_SYMBOL(snd_ac97_mixer);
EXPORT_SYMBOL(snd_ac97_pcm_assign);
......
......@@ -1585,8 +1585,10 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
snd_atiixp_chip_start(chip);
sprintf(card->longname, "%s rev %x at 0x%lx, irq %i",
card->shortname, revision, chip->addr, chip->irq);
snprintf(card->longname, sizeof(card->longname),
"%s rev %x with %s at %#lx, irq %i", card->shortname, revision,
chip->ac97[0] ? snd_ac97_get_short_name(chip->ac97[0]) : "?",
chip->addr, chip->irq);
snd_card_set_pm_callback(card, snd_atiixp_suspend, snd_atiixp_resume, chip);
......
......@@ -2711,8 +2711,9 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
snd_intel8x0_proc_init(chip);
sprintf(card->longname, "%s at 0x%lx, irq %i",
card->shortname, chip->addr, chip->irq);
snprintf(card->longname, sizeof(card->longname),
"%s with %s at %#lx, irq %i", card->shortname,
snd_ac97_get_short_name(chip->ac97[0]), chip->addr, chip->irq);
if (! ac97_clock[dev])
intel8x0_measure_ac97_clock(chip);
......
......@@ -2243,8 +2243,9 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
for (i = 0; i < chip->num_devs; i++)
snd_via82xx_channel_reset(chip, &chip->devs[i]);
sprintf(card->longname, "%s at 0x%lx, irq %d",
card->shortname, chip->port, chip->irq);
snprintf(card->longname, sizeof(card->longname),
"%s with %s at %#lx, irq %d", card->shortname,
snd_ac97_get_short_name(chip->ac97), chip->port, chip->irq);
snd_via82xx_proc_init(chip);
......
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