diff options
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r-- | sound/pci/ctxfi/ctatc.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctatc.h | 2 | ||||
-rw-r--r-- | sound/pci/ctxfi/cthardware.h | 2 | ||||
-rw-r--r-- | sound/pci/ctxfi/cthw20k1.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/cthw20k2.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctmixer.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctmixer.h | 2 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctpcm.c | 52 | ||||
-rw-r--r-- | sound/pci/ctxfi/xfi.c | 2 |
9 files changed, 63 insertions, 13 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 2f6e9c762d3..a2f997a9977 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1536,7 +1536,7 @@ static void atc_connect_resources(struct ct_atc *atc) } } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int atc_suspend(struct ct_atc *atc) { int i; @@ -1647,7 +1647,7 @@ static struct ct_atc atc_preset __devinitdata = { .output_switch_put = atc_output_switch_put, .mic_source_switch_get = atc_mic_source_switch_get, .mic_source_switch_put = atc_mic_source_switch_put, -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .suspend = atc_suspend, .resume = atc_resume, #endif diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h index 653e813ad14..69b51f9d345 100644 --- a/sound/pci/ctxfi/ctatc.h +++ b/sound/pci/ctxfi/ctatc.h @@ -143,7 +143,7 @@ struct ct_atc { struct ct_timer *timer; -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP int (*suspend)(struct ct_atc *atc); int (*resume)(struct ct_atc *atc); #define NUM_PCMS (NUM_CTALSADEVS - 1) diff --git a/sound/pci/ctxfi/cthardware.h b/sound/pci/ctxfi/cthardware.h index c56fe533b3f..5977e9a24b5 100644 --- a/sound/pci/ctxfi/cthardware.h +++ b/sound/pci/ctxfi/cthardware.h @@ -72,7 +72,7 @@ struct hw { int (*card_init)(struct hw *hw, struct card_conf *info); int (*card_stop)(struct hw *hw); int (*pll_init)(struct hw *hw, unsigned int rsr); -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP int (*suspend)(struct hw *hw); int (*resume)(struct hw *hw, struct card_conf *info); #endif diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index dc1969bc67d..4507f7088b2 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c @@ -2085,7 +2085,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int hw_suspend(struct hw *hw) { struct pci_dev *pci = hw->pci; @@ -2180,7 +2180,7 @@ static struct hw ct20k1_preset __devinitdata = { .is_adc_source_selected = hw_is_adc_input_selected, .select_adc_source = hw_adc_input_select, .capabilities = hw_capabilities, -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .suspend = hw_suspend, .resume = hw_resume, #endif diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index 9d1231dc4ae..b9c9349058b 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -2201,7 +2201,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int hw_suspend(struct hw *hw) { struct pci_dev *pci = hw->pci; @@ -2250,7 +2250,7 @@ static struct hw ct20k2_preset __devinitdata = { .output_switch_put = hw_output_switch_put, .mic_source_switch_get = hw_mic_source_switch_get, .mic_source_switch_put = hw_mic_source_switch_put, -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .suspend = hw_suspend, .resume = hw_resume, #endif diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c index 0cc13eeef8d..48fe0e39c2b 100644 --- a/sound/pci/ctxfi/ctmixer.c +++ b/sound/pci/ctxfi/ctmixer.c @@ -1118,7 +1118,7 @@ mixer_set_input_right(struct ct_mixer *mixer, return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int mixer_resume(struct ct_mixer *mixer) { int i, state; @@ -1188,7 +1188,7 @@ int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer) mixer->get_output_ports = mixer_get_output_ports; mixer->set_input_left = mixer_set_input_left; mixer->set_input_right = mixer_set_input_right; -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP mixer->resume = mixer_resume; #endif diff --git a/sound/pci/ctxfi/ctmixer.h b/sound/pci/ctxfi/ctmixer.h index b009e989e77..be881c639fe 100644 --- a/sound/pci/ctxfi/ctmixer.h +++ b/sound/pci/ctxfi/ctmixer.h @@ -56,7 +56,7 @@ struct ct_mixer { enum MIXER_PORT_T type, struct rsc *rsc); int (*set_input_right)(struct ct_mixer *mixer, enum MIXER_PORT_T type, struct rsc *rsc); -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP int (*resume)(struct ct_mixer *mixer); #endif }; diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 2c8622617c8..e8a4feb1ed8 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c @@ -395,12 +395,38 @@ static struct snd_pcm_ops ct_pcm_capture_ops = { .page = snd_pcm_sgbuf_ops_page, }; +static const struct snd_pcm_chmap_elem surround_map[] = { + { .channels = 1, + .map = { SNDRV_CHMAP_MONO } }, + { .channels = 2, + .map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } }, + { } +}; + +static const struct snd_pcm_chmap_elem clfe_map[] = { + { .channels = 1, + .map = { SNDRV_CHMAP_MONO } }, + { .channels = 2, + .map = { SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } }, + { } +}; + +static const struct snd_pcm_chmap_elem side_map[] = { + { .channels = 1, + .map = { SNDRV_CHMAP_MONO } }, + { .channels = 2, + .map = { SNDRV_CHMAP_SL, SNDRV_CHMAP_SR } }, + { } +}; + /* Create ALSA pcm device */ int ct_alsa_pcm_create(struct ct_atc *atc, enum CTALSADEVS device, const char *device_name) { struct snd_pcm *pcm; + const struct snd_pcm_chmap_elem *map; + int chs; int err; int playback_count, capture_count; @@ -427,7 +453,31 @@ int ct_alsa_pcm_create(struct ct_atc *atc, snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(atc->pci), 128*1024, 128*1024); -#ifdef CONFIG_PM + chs = 2; + switch (device) { + case FRONT: + chs = 8; + map = snd_pcm_std_chmaps; + break; + case SURROUND: + map = surround_map; + break; + case CLFE: + map = clfe_map; + break; + case SIDE: + map = side_map; + break; + default: + map = snd_pcm_std_chmaps; + break; + } + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, chs, + 0, NULL); + if (err < 0) + return err; + +#ifdef CONFIG_PM_SLEEP atc->pcms[device] = pcm; #endif diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c index e002183ef8b..07c07d752fd 100644 --- a/sound/pci/ctxfi/xfi.c +++ b/sound/pci/ctxfi/xfi.c @@ -125,7 +125,7 @@ static void __devexit ct_card_remove(struct pci_dev *pci) pci_set_drvdata(pci, NULL); } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int ct_card_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); |