diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-01-28 11:08:53 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-01-28 11:08:53 -0500 |
commit | c89362225152fc6f2247f65371bfe3ccced3203b (patch) | |
tree | a4b07e2ab1d6b85771ab4c8eba13c681fd8b076f /sound/pci/hda | |
parent | 7b36ea967cc5b5088a57fe225f1f72a3c160058b (diff) |
ALSA: hda - Define max number of PCM devices in hda_codec.h
Define the constant rather in the common header file.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 3 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 26ceace88c96..98767df4f03a 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3275,6 +3275,8 @@ const char *snd_hda_pcm_type_name[HDA_PCM_NTYPES] = { | |||
3275 | 3275 | ||
3276 | /* | 3276 | /* |
3277 | * get the empty PCM device number to assign | 3277 | * get the empty PCM device number to assign |
3278 | * | ||
3279 | * note the max device number is limited by HDA_MAX_PCMS, currently 10 | ||
3278 | */ | 3280 | */ |
3279 | static int get_empty_pcm_device(struct hda_bus *bus, int type) | 3281 | static int get_empty_pcm_device(struct hda_bus *bus, int type) |
3280 | { | 3282 | { |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 0c8f05cc56be..b75da47571e6 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -527,6 +527,9 @@ enum { | |||
527 | /* max. codec address */ | 527 | /* max. codec address */ |
528 | #define HDA_MAX_CODEC_ADDRESS 0x0f | 528 | #define HDA_MAX_CODEC_ADDRESS 0x0f |
529 | 529 | ||
530 | /* max number of PCM devics per card */ | ||
531 | #define HDA_MAX_PCMS 10 | ||
532 | |||
530 | /* | 533 | /* |
531 | * generic arrays | 534 | * generic arrays |
532 | */ | 535 | */ |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 170126c28abd..12230a2ed4f1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -260,8 +260,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
260 | #define AZX_MAX_FRAG 32 | 260 | #define AZX_MAX_FRAG 32 |
261 | /* max buffer size - no h/w limit, you can increase as you like */ | 261 | /* max buffer size - no h/w limit, you can increase as you like */ |
262 | #define AZX_MAX_BUF_SIZE (1024*1024*1024) | 262 | #define AZX_MAX_BUF_SIZE (1024*1024*1024) |
263 | /* max number of PCM devics per card */ | ||
264 | #define AZX_MAX_PCMS 10 | ||
265 | 263 | ||
266 | /* RIRB int mask: overrun[2], response[0] */ | 264 | /* RIRB int mask: overrun[2], response[0] */ |
267 | #define RIRB_INT_RESPONSE 0x01 | 265 | #define RIRB_INT_RESPONSE 0x01 |
@@ -409,7 +407,7 @@ struct azx { | |||
409 | struct azx_dev *azx_dev; | 407 | struct azx_dev *azx_dev; |
410 | 408 | ||
411 | /* PCM */ | 409 | /* PCM */ |
412 | struct snd_pcm *pcm[AZX_MAX_PCMS]; | 410 | struct snd_pcm *pcm[HDA_MAX_PCMS]; |
413 | 411 | ||
414 | /* HD codec */ | 412 | /* HD codec */ |
415 | unsigned short codec_mask; | 413 | unsigned short codec_mask; |
@@ -1336,7 +1334,7 @@ static void azx_bus_reset(struct hda_bus *bus) | |||
1336 | if (chip->initialized) { | 1334 | if (chip->initialized) { |
1337 | int i; | 1335 | int i; |
1338 | 1336 | ||
1339 | for (i = 0; i < AZX_MAX_PCMS; i++) | 1337 | for (i = 0; i < HDA_MAX_PCMS; i++) |
1340 | snd_pcm_suspend_all(chip->pcm[i]); | 1338 | snd_pcm_suspend_all(chip->pcm[i]); |
1341 | snd_hda_suspend(chip->bus); | 1339 | snd_hda_suspend(chip->bus); |
1342 | snd_hda_resume(chip->bus); | 1340 | snd_hda_resume(chip->bus); |
@@ -1966,7 +1964,7 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec, | |||
1966 | int pcm_dev = cpcm->device; | 1964 | int pcm_dev = cpcm->device; |
1967 | int s, err; | 1965 | int s, err; |
1968 | 1966 | ||
1969 | if (pcm_dev >= AZX_MAX_PCMS) { | 1967 | if (pcm_dev >= HDA_MAX_PCMS) { |
1970 | snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n", | 1968 | snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n", |
1971 | pcm_dev); | 1969 | pcm_dev); |
1972 | return -EINVAL; | 1970 | return -EINVAL; |
@@ -2122,7 +2120,7 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2122 | 2120 | ||
2123 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 2121 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
2124 | azx_clear_irq_pending(chip); | 2122 | azx_clear_irq_pending(chip); |
2125 | for (i = 0; i < AZX_MAX_PCMS; i++) | 2123 | for (i = 0; i < HDA_MAX_PCMS; i++) |
2126 | snd_pcm_suspend_all(chip->pcm[i]); | 2124 | snd_pcm_suspend_all(chip->pcm[i]); |
2127 | if (chip->initialized) | 2125 | if (chip->initialized) |
2128 | snd_hda_suspend(chip->bus); | 2126 | snd_hda_suspend(chip->bus); |