aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c92
1 files changed, 15 insertions, 77 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index deef21399586..c85d1ffcc955 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -361,74 +361,6 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
361#define DSP2HOST_REQ_I2SRATE 0x02 361#define DSP2HOST_REQ_I2SRATE 0x02
362#define DSP2HOST_REQ_TIMER 0x04 362#define DSP2HOST_REQ_TIMER 0x04
363 363
364/* AC97 registers */
365/* XXX fix this crap up */
366/*#define AC97_RESET 0x00*/
367
368#define AC97_VOL_MUTE_B 0x8000
369#define AC97_VOL_M 0x1F
370#define AC97_LEFT_VOL_S 8
371
372#define AC97_MASTER_VOL 0x02
373#define AC97_LINE_LEVEL_VOL 0x04
374#define AC97_MASTER_MONO_VOL 0x06
375#define AC97_PC_BEEP_VOL 0x0A
376#define AC97_PC_BEEP_VOL_M 0x0F
377#define AC97_SROUND_MASTER_VOL 0x38
378#define AC97_PC_BEEP_VOL_S 1
379
380/*#define AC97_PHONE_VOL 0x0C
381#define AC97_MIC_VOL 0x0E*/
382#define AC97_MIC_20DB_ENABLE 0x40
383
384/*#define AC97_LINEIN_VOL 0x10
385#define AC97_CD_VOL 0x12
386#define AC97_VIDEO_VOL 0x14
387#define AC97_AUX_VOL 0x16*/
388#define AC97_PCM_OUT_VOL 0x18
389/*#define AC97_RECORD_SELECT 0x1A*/
390#define AC97_RECORD_MIC 0x00
391#define AC97_RECORD_CD 0x01
392#define AC97_RECORD_VIDEO 0x02
393#define AC97_RECORD_AUX 0x03
394#define AC97_RECORD_MONO_MUX 0x02
395#define AC97_RECORD_DIGITAL 0x03
396#define AC97_RECORD_LINE 0x04
397#define AC97_RECORD_STEREO 0x05
398#define AC97_RECORD_MONO 0x06
399#define AC97_RECORD_PHONE 0x07
400
401/*#define AC97_RECORD_GAIN 0x1C*/
402#define AC97_RECORD_VOL_M 0x0F
403
404/*#define AC97_GENERAL_PURPOSE 0x20*/
405#define AC97_POWER_DOWN_CTRL 0x26
406#define AC97_ADC_READY 0x0001
407#define AC97_DAC_READY 0x0002
408#define AC97_ANALOG_READY 0x0004
409#define AC97_VREF_ON 0x0008
410#define AC97_PR0 0x0100
411#define AC97_PR1 0x0200
412#define AC97_PR2 0x0400
413#define AC97_PR3 0x0800
414#define AC97_PR4 0x1000
415
416#define AC97_RESERVED1 0x28
417
418#define AC97_VENDOR_TEST 0x5A
419
420#define AC97_CLOCK_DELAY 0x5C
421#define AC97_LINEOUT_MUX_SEL 0x0001
422#define AC97_MONO_MUX_SEL 0x0002
423#define AC97_CLOCK_DELAY_SEL 0x1F
424#define AC97_DAC_CDS_SHIFT 6
425#define AC97_ADC_CDS_SHIFT 11
426
427#define AC97_MULTI_CHANNEL_SEL 0x74
428
429/*#define AC97_VENDOR_ID1 0x7C
430#define AC97_VENDOR_ID2 0x7E*/
431
432/* 364/*
433 * ASSP control regs 365 * ASSP control regs
434 */ 366 */
@@ -2459,9 +2391,10 @@ static int snd_m3_free(struct snd_m3 *chip)
2459 * APM support 2391 * APM support
2460 */ 2392 */
2461#ifdef CONFIG_PM 2393#ifdef CONFIG_PM
2462static int m3_suspend(struct pci_dev *pci, pm_message_t state) 2394static int m3_suspend(struct device *dev)
2463{ 2395{
2464 struct snd_card *card = pci_get_drvdata(pci); 2396 struct pci_dev *pci = to_pci_dev(dev);
2397 struct snd_card *card = dev_get_drvdata(dev);
2465 struct snd_m3 *chip = card->private_data; 2398 struct snd_m3 *chip = card->private_data;
2466 int i, dsp_index; 2399 int i, dsp_index;
2467 2400
@@ -2489,13 +2422,14 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2489 2422
2490 pci_disable_device(pci); 2423 pci_disable_device(pci);
2491 pci_save_state(pci); 2424 pci_save_state(pci);
2492 pci_set_power_state(pci, pci_choose_state(pci, state)); 2425 pci_set_power_state(pci, PCI_D3hot);
2493 return 0; 2426 return 0;
2494} 2427}
2495 2428
2496static int m3_resume(struct pci_dev *pci) 2429static int m3_resume(struct device *dev)
2497{ 2430{
2498 struct snd_card *card = pci_get_drvdata(pci); 2431 struct pci_dev *pci = to_pci_dev(dev);
2432 struct snd_card *card = dev_get_drvdata(dev);
2499 struct snd_m3 *chip = card->private_data; 2433 struct snd_m3 *chip = card->private_data;
2500 int i, dsp_index; 2434 int i, dsp_index;
2501 2435
@@ -2546,6 +2480,11 @@ static int m3_resume(struct pci_dev *pci)
2546 chip->in_suspend = 0; 2480 chip->in_suspend = 0;
2547 return 0; 2481 return 0;
2548} 2482}
2483
2484static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume);
2485#define M3_PM_OPS &m3_pm
2486#else
2487#define M3_PM_OPS NULL
2549#endif /* CONFIG_PM */ 2488#endif /* CONFIG_PM */
2550 2489
2551#ifdef CONFIG_SND_MAESTRO3_INPUT 2490#ifdef CONFIG_SND_MAESTRO3_INPUT
@@ -2842,10 +2781,9 @@ static struct pci_driver m3_driver = {
2842 .id_table = snd_m3_ids, 2781 .id_table = snd_m3_ids,
2843 .probe = snd_m3_probe, 2782 .probe = snd_m3_probe,
2844 .remove = __devexit_p(snd_m3_remove), 2783 .remove = __devexit_p(snd_m3_remove),
2845#ifdef CONFIG_PM 2784 .driver = {
2846 .suspend = m3_suspend, 2785 .pm = M3_PM_OPS,
2847 .resume = m3_resume, 2786 },
2848#endif
2849}; 2787};
2850 2788
2851module_pci_driver(m3_driver); 2789module_pci_driver(m3_driver);