Skip to content

Commit 8aa19ad

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
2 parents 58a2c32 + a25f175 commit 8aa19ad

19 files changed

Lines changed: 115 additions & 53 deletions

File tree

‎include/sound/ac97_codec.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ struct _snd_ac97 {
527527
struct device dev;
528528
};
529529

530+
#define to_ac97_t(d) container_of(d, struct _snd_ac97, dev)
531+
530532
/* conditions */
531533
static inline int ac97_is_audio(ac97_t * ac97)
532534
{

‎include/sound/emu10k1.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ typedef struct {
10591059
unsigned char spk71; /* Has 7.1 speakers */
10601060
unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */
10611061
unsigned char spdif_bug; /* Has Spdif phasing bug */
1062-
unsigned char ac97_chip; /* Has an AC97 chip */
1062+
unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */
10631063
unsigned char ecard; /* APS EEPROM */
10641064
const char *driver;
10651065
const char *name;

‎sound/arm/pxa2xx-ac97.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static pxa2xx_pcm_client_t pxa2xx_ac97_pcm_client = {
245245

246246
#ifdef CONFIG_PM
247247

248-
static int pxa2xx_ac97_do_suspend(snd_card_t *card, unsigned int state)
248+
static int pxa2xx_ac97_do_suspend(snd_card_t *card, pm_message_t state)
249249
{
250250
if (card->power_state != SNDRV_CTL_POWER_D3cold) {
251251
pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;

‎sound/isa/opl3sa2.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ static int __init alsa_card_opl3sa2_init(void)
914914
#endif
915915
#ifdef CONFIG_PNP
916916
pnp_unregister_card_driver(&opl3sa2_pnpc_driver);
917+
pnp_unregister_driver(&opl3sa2_pnp_driver);
917918
#endif
918919
return -ENODEV;
919920
}
@@ -927,6 +928,7 @@ static void __exit alsa_card_opl3sa2_exit(void)
927928
#ifdef CONFIG_PNP
928929
/* PnP cards first */
929930
pnp_unregister_card_driver(&opl3sa2_pnpc_driver);
931+
pnp_unregister_driver(&opl3sa2_pnp_driver);
930932
#endif
931933
for (idx = 0; idx < SNDRV_CARDS; idx++)
932934
snd_card_free(snd_opl3sa2_legacy[idx]);

‎sound/pci/ac97/ac97_bus.c‎

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,30 @@
1717
#include <linux/string.h>
1818

1919
/*
20-
* Codec families have names seperated by commas, so we search for an
21-
* individual codec name within the family string.
20+
* Let drivers decide whether they want to support given codec from their
21+
* probe method. Drivers have direct access to the ac97_t structure and may
22+
* decide based on the id field amongst other things.
2223
*/
2324
static int ac97_bus_match(struct device *dev, struct device_driver *drv)
2425
{
25-
return (strstr(dev->bus_id, drv->name) != NULL);
26+
return 1;
2627
}
2728

2829
static int ac97_bus_suspend(struct device *dev, pm_message_t state)
2930
{
3031
int ret = 0;
3132

32-
if (dev->driver && dev->driver->suspend) {
33-
ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE);
34-
if (ret == 0)
35-
ret = dev->driver->suspend(dev, state, SUSPEND_SAVE_STATE);
36-
if (ret == 0)
37-
ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
38-
}
33+
if (dev->driver && dev->driver->suspend)
34+
ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
3935
return ret;
4036
}
4137

4238
static int ac97_bus_resume(struct device *dev)
4339
{
4440
int ret = 0;
4541

46-
if (dev->driver && dev->driver->resume) {
42+
if (dev->driver && dev->driver->resume)
4743
ret = dev->driver->resume(dev, RESUME_POWER_ON);
48-
if (ret == 0)
49-
ret = dev->driver->resume(dev, RESUME_RESTORE_STATE);
50-
if (ret == 0)
51-
ret = dev->driver->resume(dev, RESUME_ENABLE);
52-
}
5344
return ret;
5445
}
5546

‎sound/pci/ac97/ac97_codec.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97)
15571557

15581558
/* build modem switches */
15591559
for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_modem_switches); idx++)
1560-
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_modem_switches[idx], ac97))) < 0)
1560+
if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_ac97_controls_modem_switches[idx], ac97))) < 0)
15611561
return err;
15621562

15631563
/* build chip specific controls */
@@ -1828,7 +1828,6 @@ static int snd_ac97_dev_register(snd_device_t *device)
18281828

18291829
ac97->dev.bus = &ac97_bus_type;
18301830
ac97->dev.parent = ac97->bus->card->dev;
1831-
ac97->dev.platform_data = ac97;
18321831
ac97->dev.release = ac97_device_release;
18331832
snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "card%d-%d", ac97->bus->card->number, ac97->num);
18341833
if ((err = device_register(&ac97->dev)) < 0) {

‎sound/pci/ac97/ac97_patch.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2752,7 +2752,11 @@ AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1)
27522752

27532753
static int patch_si3036_specific(ac97_t * ac97)
27542754
{
2755-
return patch_build_controls(ac97, snd_ac97_controls_si3036, ARRAY_SIZE(snd_ac97_controls_si3036));
2755+
int idx, err;
2756+
for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_si3036); idx++)
2757+
if ((err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_si3036[idx], ac97))) < 0)
2758+
return err;
2759+
return 0;
27562760
}
27572761

27582762
static struct snd_ac97_build_ops patch_si3036_ops = {

‎sound/pci/ali5451/ali5451.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,8 +1993,10 @@ static int __devinit snd_ali_mixer(ali_t * codec)
19931993
if ((err = snd_ac97_mixer(codec->ac97_bus, &ac97, &codec->ac97[i])) < 0) {
19941994
snd_printk("ali mixer %d creating error.\n", i);
19951995
if(i == 0)
1996-
return err;
1997-
}
1996+
return err;
1997+
codec->num_of_codecs = 1;
1998+
break;
1999+
}
19982000
}
19992001

20002002
if (codec->spdif_support) {

‎sound/pci/emu10k1/emu10k1_main.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,12 @@ static emu_chip_details_t emu_chip_details[] = {
756756
.sblive51 = 1} ,
757757
/* Tested by alsa bugtrack user "hus" bug #1297 12th Aug 2005 */
758758
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80611102,
759-
.driver = "EMU10K1", .name = "SBLive! Platinum 5.1 [SB0060]",
759+
.driver = "EMU10K1", .name = "SBLive 5.1 [SB0060]",
760760
.id = "Live",
761761
.emu10k1_chip = 1,
762+
.ac97_chip = 2, /* ac97 is optional; both SBLive 5.1 and platinum
763+
* share the same IDs!
764+
*/
762765
.sblive51 = 1} ,
763766
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80511102,
764767
.driver = "EMU10K1", .name = "SBLive! Value [CT4850]",

‎sound/pci/emu10k1/emumixer.c‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,14 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu,
810810
ac97.private_data = emu;
811811
ac97.private_free = snd_emu10k1_mixer_free_ac97;
812812
ac97.scaps = AC97_SCAP_NO_SPDIF;
813-
if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
814-
return err;
813+
if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) {
814+
if (emu->card_capabilities->ac97_chip == 1)
815+
return err;
816+
snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n");
817+
snd_printd(KERN_INFO" Proceeding without ac97 mixers...\n");
818+
snd_device_free(emu->card, pbus);
819+
goto no_ac97; /* FIXME: get rid of ugly gotos.. */
820+
}
815821
if (emu->audigy) {
816822
/* set master volume to 0 dB */
817823
snd_ac97_write(emu->ac97, AC97_MASTER, 0x0000);
@@ -836,6 +842,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu,
836842
for (; *c; c++)
837843
remove_ctl(card, *c);
838844
} else {
845+
no_ac97:
839846
if (emu->card_capabilities->ecard)
840847
strcpy(emu->card->mixername, "EMU APS");
841848
else if (emu->audigy)

0 commit comments

Comments
 (0)