diff options
Diffstat (limited to 'sound/pci/ac97')
-rw-r--r-- | sound/pci/ac97/ac97_bus.c | 23 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 3 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 6 |
3 files changed, 13 insertions, 19 deletions
diff --git a/sound/pci/ac97/ac97_bus.c b/sound/pci/ac97/ac97_bus.c index 227f8b9f67ce..becbc420ba41 100644 --- a/sound/pci/ac97/ac97_bus.c +++ b/sound/pci/ac97/ac97_bus.c | |||
@@ -17,25 +17,21 @@ | |||
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * Codec families have names seperated by commas, so we search for an | 20 | * Let drivers decide whether they want to support given codec from their |
21 | * individual codec name within the family string. | 21 | * probe method. Drivers have direct access to the ac97_t structure and may |
22 | * decide based on the id field amongst other things. | ||
22 | */ | 23 | */ |
23 | static int ac97_bus_match(struct device *dev, struct device_driver *drv) | 24 | static int ac97_bus_match(struct device *dev, struct device_driver *drv) |
24 | { | 25 | { |
25 | return (strstr(dev->bus_id, drv->name) != NULL); | 26 | return 1; |
26 | } | 27 | } |
27 | 28 | ||
28 | static int ac97_bus_suspend(struct device *dev, pm_message_t state) | 29 | static int ac97_bus_suspend(struct device *dev, pm_message_t state) |
29 | { | 30 | { |
30 | int ret = 0; | 31 | int ret = 0; |
31 | 32 | ||
32 | if (dev->driver && dev->driver->suspend) { | 33 | if (dev->driver && dev->driver->suspend) |
33 | ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE); | 34 | ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN); |
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 | } | ||
39 | return ret; | 35 | return ret; |
40 | } | 36 | } |
41 | 37 | ||
@@ -43,13 +39,8 @@ static int ac97_bus_resume(struct device *dev) | |||
43 | { | 39 | { |
44 | int ret = 0; | 40 | int ret = 0; |
45 | 41 | ||
46 | if (dev->driver && dev->driver->resume) { | 42 | if (dev->driver && dev->driver->resume) |
47 | ret = dev->driver->resume(dev, RESUME_POWER_ON); | 43 | 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 | } | ||
53 | return ret; | 44 | return ret; |
54 | } | 45 | } |
55 | 46 | ||
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index e64cb07a39c2..41fc290149ed 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -1557,7 +1557,7 @@ static int snd_ac97_modem_build(snd_card_t * card, ac97_t * ac97) | |||
1557 | 1557 | ||
1558 | /* build modem switches */ | 1558 | /* build modem switches */ |
1559 | for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_modem_switches); idx++) | 1559 | 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) |
1561 | return err; | 1561 | return err; |
1562 | 1562 | ||
1563 | /* build chip specific controls */ | 1563 | /* build chip specific controls */ |
@@ -1828,7 +1828,6 @@ static int snd_ac97_dev_register(snd_device_t *device) | |||
1828 | 1828 | ||
1829 | ac97->dev.bus = &ac97_bus_type; | 1829 | ac97->dev.bus = &ac97_bus_type; |
1830 | ac97->dev.parent = ac97->bus->card->dev; | 1830 | ac97->dev.parent = ac97->bus->card->dev; |
1831 | ac97->dev.platform_data = ac97; | ||
1832 | ac97->dev.release = ac97_device_release; | 1831 | ac97->dev.release = ac97_device_release; |
1833 | snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "card%d-%d", ac97->bus->card->number, ac97->num); | 1832 | snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "card%d-%d", ac97->bus->card->number, ac97->num); |
1834 | if ((err = device_register(&ac97->dev)) < 0) { | 1833 | if ((err = device_register(&ac97->dev)) < 0) { |
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 045ddc743edc..0238cc65d32a 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -2752,7 +2752,11 @@ AC97_DOUBLE("Modem Speaker Volume", 0x5c, 14, 12, 3, 1) | |||
2752 | 2752 | ||
2753 | static int patch_si3036_specific(ac97_t * ac97) | 2753 | static int patch_si3036_specific(ac97_t * ac97) |
2754 | { | 2754 | { |
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; | ||
2756 | } | 2760 | } |
2757 | 2761 | ||
2758 | static struct snd_ac97_build_ops patch_si3036_ops = { | 2762 | static struct snd_ac97_build_ops patch_si3036_ops = { |