diff options
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b9a8e238b0a8..1672cace1ae7 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -199,7 +199,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
199 | 199 | ||
200 | /* STATESTS int mask: SD2,SD1,SD0 */ | 200 | /* STATESTS int mask: SD2,SD1,SD0 */ |
201 | #define STATESTS_INT_MASK 0x07 | 201 | #define STATESTS_INT_MASK 0x07 |
202 | #define AZX_MAX_CODECS 3 | ||
203 | 202 | ||
204 | /* SD_CTL bits */ | 203 | /* SD_CTL bits */ |
205 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ | 204 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ |
@@ -966,6 +965,16 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev) | |||
966 | * Codec initialization | 965 | * Codec initialization |
967 | */ | 966 | */ |
968 | 967 | ||
968 | static unsigned int azx_max_codecs[] __devinitdata = { | ||
969 | [AZX_DRIVER_ICH] = 3, | ||
970 | [AZX_DRIVER_ATI] = 4, | ||
971 | [AZX_DRIVER_ATIHDMI] = 4, | ||
972 | [AZX_DRIVER_VIA] = 3, /* FIXME: correct? */ | ||
973 | [AZX_DRIVER_SIS] = 3, /* FIXME: correct? */ | ||
974 | [AZX_DRIVER_ULI] = 3, /* FIXME: correct? */ | ||
975 | [AZX_DRIVER_NVIDIA] = 3, /* FIXME: correct? */ | ||
976 | }; | ||
977 | |||
969 | static int __devinit azx_codec_create(struct azx *chip, const char *model) | 978 | static int __devinit azx_codec_create(struct azx *chip, const char *model) |
970 | { | 979 | { |
971 | struct hda_bus_template bus_temp; | 980 | struct hda_bus_template bus_temp; |
@@ -982,7 +991,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
982 | return err; | 991 | return err; |
983 | 992 | ||
984 | codecs = 0; | 993 | codecs = 0; |
985 | for (c = 0; c < AZX_MAX_CODECS; c++) { | 994 | for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) { |
986 | if ((chip->codec_mask & (1 << c)) & probe_mask) { | 995 | if ((chip->codec_mask & (1 << c)) & probe_mask) { |
987 | err = snd_hda_codec_new(chip->bus, c, NULL); | 996 | err = snd_hda_codec_new(chip->bus, c, NULL); |
988 | if (err < 0) | 997 | if (err < 0) |
@@ -1078,6 +1087,10 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) | |||
1078 | runtime->hw.rates = hinfo->rates; | 1087 | runtime->hw.rates = hinfo->rates; |
1079 | snd_pcm_limit_hw_rates(runtime); | 1088 | snd_pcm_limit_hw_rates(runtime); |
1080 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); | 1089 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); |
1090 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, | ||
1091 | 128); | ||
1092 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, | ||
1093 | 128); | ||
1081 | if ((err = hinfo->ops.open(hinfo, apcm->codec, substream)) < 0) { | 1094 | if ((err = hinfo->ops.open(hinfo, apcm->codec, substream)) < 0) { |
1082 | azx_release_device(azx_dev); | 1095 | azx_release_device(azx_dev); |
1083 | mutex_unlock(&chip->open_mutex); | 1096 | mutex_unlock(&chip->open_mutex); |