diff options
author | Yang-Rong Jerry Zhou <Yangrong.Zhou@Sun.COM> | 2008-09-24 13:26:54 +0800 |
---|---|---|
committer | Yang-Rong Jerry Zhou <Yangrong.Zhou@Sun.COM> | 2008-09-24 13:26:54 +0800 |
commit | feccaf6df4d61f3e7e0723a768ce407f9eb6a1dd (patch) | |
tree | ddc1ca77cbfae306826ccf6b1a4f4211036408a9 /usr/src | |
parent | 15ba2a7917c1e0c36501399ba36b90a63d62d8b4 (diff) | |
download | illumos-joyent-feccaf6df4d61f3e7e0723a768ce407f9eb6a1dd.tar.gz |
6750056 panic in audiohd codecs parser with ad1986a
6750297 Memory leak in audiohd driver
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c | 34 | ||||
-rw-r--r-- | usr/src/uts/common/sys/audio/impl/audiohd_impl.h | 2 |
2 files changed, 23 insertions, 13 deletions
diff --git a/usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c b/usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c index c1608d0804..acf0cea893 100644 --- a/usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c +++ b/usr/src/uts/common/io/audio/sada/drv/audiohd/audiohd.c @@ -3239,9 +3239,10 @@ audiohd_finish_output_path(hda_codec_t *codec) } /* If this pin has external amplifier, enable it */ - if (pin->cap & 0x00010000) + if (pin->cap & AUDIOHD_EXT_AMP_MASK) (void) audioha_codec_verb_get(statep, caddr, - wid, AUDIOHDC_VERB_SET_EAPD, 0x02); + wid, AUDIOHDC_VERB_SET_EAPD, + AUDIOHD_EXT_AMP_ENABLE); if (widget->outamp_cap) { (void) audioha_codec_4bit_verb_get(statep, @@ -3323,12 +3324,15 @@ audiohd_find_input_pins(hda_codec_t *codec, wid_t wid, int allowmixer, audiohd_state_t *statep = codec->soft_statep; uint_t caddr = codec->index; int retval = -1; - int num; + int num, i; uint32_t pinctrl; if (depth > AUDIOHD_MAX_DEPTH) return (uint32_t)(AUDIO_FAILURE); + if (widget == NULL) + return (uint32_t)(AUDIO_FAILURE); + /* we don't share widgets */ if (widget->path_flags & AUDIOHD_PATH_ADC) return (uint32_t)(AUDIO_FAILURE); @@ -3406,17 +3410,18 @@ audiohd_find_input_pins(hda_codec_t *codec, wid_t wid, int allowmixer, } else { /* * We had already found a real sum before this one since - * allowmixer is 0. For this one, we use only its first - * input and treat it as an one-input widget. In other - * words, the other inputs except the fist one of this - * widget won't be used by our audio driver in any case. + * allowmixer is 0. */ - retval = audiohd_find_input_pins(codec, - widget->avail_conn[0], 0, depth + 1, istream); - if (retval != AUDIO_FAILURE) { - widget->selconn = 0; - widget->path_flags |= AUDIOHD_PATH_ADC; - widget->in_weight++; + for (i = 0; i < widget->nconns; i++) { + retval = audiohd_find_input_pins(codec, + widget->avail_conn[i], 0, depth + 1, + istream); + if (retval != AUDIO_FAILURE) { + widget->selconn = i; + widget->path_flags |= AUDIOHD_PATH_ADC; + widget->in_weight++; + break; + } } } break; @@ -3488,6 +3493,9 @@ audiohd_build_input_path(hda_codec_t *codec) } } } + + if (istream) + kmem_free(istream, sizeof (audiohd_istream_t)); } /* audiohd_build_input_path */ /* diff --git a/usr/src/uts/common/sys/audio/impl/audiohd_impl.h b/usr/src/uts/common/sys/audio/impl/audiohd_impl.h index 727e3d8866..d8b9ddfd0f 100644 --- a/usr/src/uts/common/sys/audio/impl/audiohd_impl.h +++ b/usr/src/uts/common/sys/audio/impl/audiohd_impl.h @@ -72,6 +72,8 @@ extern "C" { #define AUDIOHD_FMT_PCMOUT 0x0011 #define AUDIOHD_FMT_PCMIN 0x0011 +#define AUDIOHD_EXT_AMP_MASK 0x00010000 +#define AUDIOHD_EXT_AMP_ENABLE 0x02 /* NVIDIA snoop */ #define AUDIOHD_NVIDIA_SNOOP 0x0f |