Commit 10ca7201 authored by Ondrej Zary's avatar Ondrej Zary Committed by Takashi Iwai

ALSA: tea575x: use better card and bus names

Provide real card and bus_info instead of hardcoded values.
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3d11ba55
...@@ -52,6 +52,8 @@ struct snd_tea575x { ...@@ -52,6 +52,8 @@ struct snd_tea575x {
unsigned long in_use; /* set if the device is in use */ unsigned long in_use; /* set if the device is in use */
struct snd_tea575x_ops *ops; struct snd_tea575x_ops *ops;
void *private_data; void *private_data;
u8 card[32];
u8 bus_info[32];
}; };
int snd_tea575x_init(struct snd_tea575x *tea); int snd_tea575x_init(struct snd_tea575x *tea);
......
...@@ -178,8 +178,9 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -178,8 +178,9 @@ static int vidioc_querycap(struct file *file, void *priv,
struct snd_tea575x *tea = video_drvdata(file); struct snd_tea575x *tea = video_drvdata(file);
strlcpy(v->driver, "tea575x-tuner", sizeof(v->driver)); strlcpy(v->driver, "tea575x-tuner", sizeof(v->driver));
strlcpy(v->card, tea->tea5759 ? "TEA5759" : "TEA5757", sizeof(v->card)); strlcpy(v->card, tea->card, sizeof(v->card));
sprintf(v->bus_info, "PCI"); strlcat(v->card, tea->tea5759 ? " TEA5759" : " TEA5757", sizeof(v->card));
strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
v->version = RADIO_VERSION; v->version = RADIO_VERSION;
v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
return 0; return 0;
......
...@@ -2795,6 +2795,8 @@ static int __devinit snd_es1968_create(struct snd_card *card, ...@@ -2795,6 +2795,8 @@ static int __devinit snd_es1968_create(struct snd_card *card,
#ifdef CONFIG_SND_ES1968_RADIO #ifdef CONFIG_SND_ES1968_RADIO
chip->tea.private_data = chip; chip->tea.private_data = chip;
chip->tea.ops = &snd_es1968_tea_ops; chip->tea.ops = &snd_es1968_tea_ops;
strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card));
sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
if (!snd_tea575x_init(&chip->tea)) if (!snd_tea575x_init(&chip->tea))
printk(KERN_INFO "es1968: detected TEA575x radio\n"); printk(KERN_INFO "es1968: detected TEA575x radio\n");
#endif #endif
......
...@@ -1232,6 +1232,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, ...@@ -1232,6 +1232,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
#ifdef TEA575X_RADIO #ifdef TEA575X_RADIO
chip->tea.private_data = chip; chip->tea.private_data = chip;
chip->tea.ops = &snd_fm801_tea_ops; chip->tea.ops = &snd_fm801_tea_ops;
sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
(tea575x_tuner & TUNER_TYPE_MASK) < 4) { (tea575x_tuner & TUNER_TYPE_MASK) < 4) {
if (snd_tea575x_init(&chip->tea)) if (snd_tea575x_init(&chip->tea))
...@@ -1246,6 +1247,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, ...@@ -1246,6 +1247,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
break; break;
} }
} }
strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card));
#endif #endif
*rchip = chip; *rchip = 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