diff options
Diffstat (limited to 'sound/pci/fm801.c')
-rw-r--r-- | sound/pci/fm801.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index f69662322750..522c8706f244 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1254,7 +1254,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1254 | sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); | 1254 | sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); |
1255 | if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && | 1255 | if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && |
1256 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { | 1256 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { |
1257 | if (snd_tea575x_init(&chip->tea)) { | 1257 | if (snd_tea575x_init(&chip->tea, THIS_MODULE)) { |
1258 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1258 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1259 | snd_fm801_free(chip); | 1259 | snd_fm801_free(chip); |
1260 | return -ENODEV; | 1260 | return -ENODEV; |
@@ -1263,7 +1263,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1263 | /* autodetect tuner connection */ | 1263 | /* autodetect tuner connection */ |
1264 | for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { | 1264 | for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { |
1265 | chip->tea575x_tuner = tea575x_tuner; | 1265 | chip->tea575x_tuner = tea575x_tuner; |
1266 | if (!snd_tea575x_init(&chip->tea)) { | 1266 | if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) { |
1267 | snd_printk(KERN_INFO "detected TEA575x radio type %s\n", | 1267 | snd_printk(KERN_INFO "detected TEA575x radio type %s\n", |
1268 | get_tea575x_gpio(chip)->name); | 1268 | get_tea575x_gpio(chip)->name); |
1269 | break; | 1269 | break; |
@@ -1369,9 +1369,10 @@ static unsigned char saved_regs[] = { | |||
1369 | FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL, | 1369 | FM801_CODEC_CTRL, FM801_I2S_MODE, FM801_VOLUME, FM801_GEN_CTRL, |
1370 | }; | 1370 | }; |
1371 | 1371 | ||
1372 | static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | 1372 | static int snd_fm801_suspend(struct device *dev) |
1373 | { | 1373 | { |
1374 | struct snd_card *card = pci_get_drvdata(pci); | 1374 | struct pci_dev *pci = to_pci_dev(dev); |
1375 | struct snd_card *card = dev_get_drvdata(dev); | ||
1375 | struct fm801 *chip = card->private_data; | 1376 | struct fm801 *chip = card->private_data; |
1376 | int i; | 1377 | int i; |
1377 | 1378 | ||
@@ -1385,13 +1386,14 @@ static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state) | |||
1385 | 1386 | ||
1386 | pci_disable_device(pci); | 1387 | pci_disable_device(pci); |
1387 | pci_save_state(pci); | 1388 | pci_save_state(pci); |
1388 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 1389 | pci_set_power_state(pci, PCI_D3hot); |
1389 | return 0; | 1390 | return 0; |
1390 | } | 1391 | } |
1391 | 1392 | ||
1392 | static int snd_fm801_resume(struct pci_dev *pci) | 1393 | static int snd_fm801_resume(struct device *dev) |
1393 | { | 1394 | { |
1394 | struct snd_card *card = pci_get_drvdata(pci); | 1395 | struct pci_dev *pci = to_pci_dev(dev); |
1396 | struct snd_card *card = dev_get_drvdata(dev); | ||
1395 | struct fm801 *chip = card->private_data; | 1397 | struct fm801 *chip = card->private_data; |
1396 | int i; | 1398 | int i; |
1397 | 1399 | ||
@@ -1414,17 +1416,21 @@ static int snd_fm801_resume(struct pci_dev *pci) | |||
1414 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 1416 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
1415 | return 0; | 1417 | return 0; |
1416 | } | 1418 | } |
1417 | #endif | 1419 | |
1420 | static SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume); | ||
1421 | #define SND_FM801_PM_OPS &snd_fm801_pm | ||
1422 | #else | ||
1423 | #define SND_FM801_PM_OPS NULL | ||
1424 | #endif /* CONFIG_PM */ | ||
1418 | 1425 | ||
1419 | static struct pci_driver fm801_driver = { | 1426 | static struct pci_driver fm801_driver = { |
1420 | .name = KBUILD_MODNAME, | 1427 | .name = KBUILD_MODNAME, |
1421 | .id_table = snd_fm801_ids, | 1428 | .id_table = snd_fm801_ids, |
1422 | .probe = snd_card_fm801_probe, | 1429 | .probe = snd_card_fm801_probe, |
1423 | .remove = __devexit_p(snd_card_fm801_remove), | 1430 | .remove = __devexit_p(snd_card_fm801_remove), |
1424 | #ifdef CONFIG_PM | 1431 | .driver = { |
1425 | .suspend = snd_fm801_suspend, | 1432 | .pm = SND_FM801_PM_OPS, |
1426 | .resume = snd_fm801_resume, | 1433 | }, |
1427 | #endif | ||
1428 | }; | 1434 | }; |
1429 | 1435 | ||
1430 | module_pci_driver(fm801_driver); | 1436 | module_pci_driver(fm801_driver); |