summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia.h
AgeCommit message (Collapse)Author
2009-12-22treat the front headphone jack more like a built-in speaker. make it'sJacob Meuser
default DAC receive the first playback stereo channel pair if the DAC wouldn't otherwise be used and allow the jack's output volume to be controlled by outputs.master by default. this was already mostly implemented for codecs with 3 or more dacs, but front headphone jacks are also common on 2 dac codecs as well.
2009-11-24implement suspend and resumeJacob Meuser
2009-10-11* define a constant for the specification defined maximum number ofJacob Meuser
codecs a controller can support * dynamically allocate memory for the array of codec structures
2009-10-11this driver doesn't yet support HDMI codecs enough for them to beJacob Meuser
usable. detach the driver if the device is only capable of HDMI. this keeps an unusable device from being /dev/audio0 (thus /dev/audio by default), while /dev/audio1 is fully functional.
2009-09-09move code to enable widget unsolicited event generation into it'sJacob Meuser
own function
2009-09-09azalia.h:Jacob Meuser
* remove irrelevant comment * this driver uses at most 2 converter groups per group set, don't allocate more than needed * remove unused members from codec_t azalia.c: * macros for register values
2009-06-09AD1981HD output amps are weird. they report 63 volume steps but theJacob Meuser
first 30 do nothing. perhaps there are other codecs with such amps? (ab)use some reserved bits in the amplifier capabilities parameter to store the first volume step that actually changes the volume. problem reported and patch tested by LEVAI Daniel.
2009-06-09quirks for MacBookPro3,1 inspired by FreeBSD's snd_hda. problemJacob Meuser
reported and patch tested by Bryan Chapman. according to FreeBSD, this might be needed for other MacBookPro models but no one else has told me their MacBookPro doesn't work.
2009-05-31zap _generic from the names of several functions. there are noJacob Meuser
more non-generic versions, and there never will be again.
2009-05-31- all codecs now use the same functions, always. call the functionsJacob Meuser
directly instead of through pointers in the codec_t. - fold azalia_generic_{g,s}et_port into azalia_{g,s}et_port since both are small and partly duplicated eachother.
2009-05-29register all GPIO and widget "quirks" in a bitmask instead of usingJacob Meuser
macros and codec->init_widget. now there is only only place to look to see what special handling a specific codec will get.
2009-05-29- if a codec is capable of multichannel playback, try to connectJacob Meuser
the output jacks to different DACs. - multichannel codecs often have a front headphone jack that is intended to be used separately from the multichannel jacks. if a front headphone jack exists, try to connect it to a DAC not used by the multichannel jacks.
2009-05-29- when a widget will be considered part of a different widget, recordJacob Meuser
the node id of the "parent" widget - initialize widgets' mixer_class ealier
2009-05-12- try to identify a "main input mixer"Jacob Meuser
- don't unmute input from a built-in mic on the main input mixer intended to stop possible feedback loops between buit-in speakers and built-in mics. built-in mics also tend to capture machine noise, especially fans. actual recording should not be affected.
2009-05-01allow jack sensing to mute the DAC the speaker is connected to byJacob Meuser
default, as long is the first output pin is not also connected to that DAC. cleanup a bit now that there are multiple muting methods.
2009-04-24drop _generic from azalia_generic_codec_fnode(). there will notJacob Meuser
be a non-generic version. move the prototype to azalia.h so it can also be used in azalia.c in the future.
2009-04-24create lists of analog and digital input and output pins. storeJacob Meuser
the pin nids, the default converter the pin connects to and the pin's priority. priority is based on the pin's default direction and the association and sequence numbers from the vendor. according to the hda spec, lower association/priority means higher priority. sort the list in order of highest to lowest priority.
2009-04-24after all widgets have been initialized, loop through all widgetsJacob Meuser
and do some further initialization and information gathering: - disable mixer and selector widgets that don't have any enabled connections - create lists of analog and digital input and output converters - find the internal/fixed connection microphone and speaker, and which converters they are connected to by default - create a list of jack sensing capable pins some of this was already being done in other places, but moved here for simplification/better organization
2009-01-05expand the _dir controls for output pins to also be able to selectJacob Meuser
VRef level and be sure to turn VRef off when not set for input.
2009-01-05remove now unused macrosJacob Meuser
2009-01-05use AUDIO_MIXER_SET instead of AUDIO_MIXER_ENUM to display mixersJacob Meuser
that don't have selectable inputs. all connections are active, always. showing all connections in the set rather than just one makes a lot more sense.
2009-01-03- configure volume knob widgets for indirect mode, which means they noJacob Meuser
longer direcly affect other widgets - if an unsolicited response is received from a volume knob widget, adjust outputs.master according to the measured change in level of the volume knob widget
2009-01-02- get rid of the function that was mostly just a wrapper for the oldJacob Meuser
function for creating "master" volume control. - apply gpio quirks separately from and prior to configuring the mixer. gpio manipulation can cause noise on output channels. configuring gpio before amps are unmuted in the mixer configuration is a good thing. from Alexey Suslikov, thanks
2009-01-02add macros for setting/getting GPIO polarity instead of usingJacob Meuser
magic numbers from Alexey Suslikov
2009-01-02this is what I really wanted with r1.100 of azalia.c - fixed micsJacob Meuser
are not really useful as output devices and fixed speakers are not really useful as input devices
2009-01-02now that some devices will get output from/to two different sources/Jacob Meuser
outputs by default it's nice to have a way to control multiple sources/ outputs with a single control setting. so here's an implementation of "master" controls that uses selectable control lists, because the biggest problem is figuring out what should be "master". outputs.master.slaves is the current set of output mixer controls that settings for outputs.master and outputs.master will be applied to. record.volume.slaves works similarly for recording inputs.
2009-01-02- store information about relevant volume controls along bothJacob Meuser
recording and playback paths. - select a subset of controls that are relevant in a default configuration for each path.
2008-12-31reimplement jack sense/speaker auto muting using unsolicited responses.Jacob Meuser
jacks which can mute speaker output are chosen with the new mixer item 'outputs.spkr_muters'. e.g. $ mixerctl -v outputs.spkr_muters outputs.spkr_muters=hp,mic,line-in { hp mic line-in } if a jack is present in any listed "muter" plug, AND that plug is configured for output (e.g. outputs.hp_dir=output) the speaker will be muted. the list of muters is selectable, selecting none turns of muting altogether.
2008-12-31builtin speakers and headphone jacks have an interesting relationship.Jacob Meuser
keep track of some information about them, such as the DAC they are connected to by default. this will be used soon.
2008-12-23a) a widget's nid is always it's index in the codec's widget list.Jacob Meuser
b) members of the widget connection list may be invalid. so, - change azalia_nid_to_index to azalia_widget_enabled, and have it only check that the given nid is valid, and that the corresponding widget is enabled. - use azalia_widget_enabled every time members of the connection list are used.
2008-12-22- expand/add macros for pin configuration manipulationJacob Meuser
- use "beep" as pin device 0xe
2008-12-21add mixer_class member to struct widget_t, and define the mixerJacob Meuser
classes in azalia.h instead of azalia_codec.c. this will allow the mixer class to be determined outside of azalia_generic_mixer_init.
2008-11-30- AZ_MAX_SENSE_PINS -> HDA_MAX_SENSE_PINSJacob Meuser
- MI_TARGET_* are enumerated in hex from Alexey Suslikov
2008-11-28AZ_TARGET_PINSENSE -> MI_TARGET_PINSENSEJacob Meuser
reminder from Alexey Suslikov, thanks
2008-11-28check the jack detect override bit before creating jack sense mixerJacob Meuser
items. BIOSes can set the jack detect override bit to tell us that the jack detection circuirty isn't actually attached. should remove the _sense controls that never change.
2008-11-28- use switch() instead of multiple if elseJacob Meuser
- put selectors that feed ADCs into the record class like we do for mixers - use azalia_nid_to_index more - shrink mixer items list by condensing mutes for multiple input sources into a single _source control of type AUDIO_MIXER_SET. for example, record.mix6_mic_mute=off record.mix6_mic2_mute=off record.mix6_line_mute=off record.mix6_hp_mute=off record.mix6_spkr_mute=off record.mix6_mix_mute=off is now represented as record.mix6_source=mic,mic2,line,hp,spkr,mix to mute all sources but the mic just do record.mix6_source=mic reduces mixer items by about 25% on my machine. also shortens the longest names.
2008-11-27widget initialization cleanup:Jacob Meuser
* configure widgets all in one place * add a flag on the widget_t to let us know if the widget is not connected; shaves a lot of connection checking code * be sure not to add power widgets as connectable sources/sinks * configure unconnected pins as output pins. should help some MacBooks and be benign to other devices. the last change has been tested by several as a separate diff. no real functional changes otherwise. from Alexey Suslikov. thanks!
2008-11-19the jack sense automatic muting code has many problems, includingJacob Meuser
being the cause of PR5982. unfortunately, there's no easy and clean solution to automatic muting. we can't always rely on the codec giving us the right information. people have different preferences as to what should be muted and what shouldn't. etc, etc. so instead, just make the sense state of jacks that support sensing available through the mixer interface. this allows for any possible user configuration and supports all pins that have sense capabilities, not just headpones. codecs that use the generic mixer configuration (which is the plan for all codecs) and have sensing capable pins will now get a few more read-only mixer items, such as: outputs.hp_sense=plugged outputs.mic_sense=unplugged outputs.line_sense=unplugged hopefully what they mean is self-explanatory. based on much discussion with ratchov@ and Alexey Suslikov
2008-11-05remove unused macros, partly from Alexey SuslikovJacob Meuser
2008-11-04implement azalia_create_encodings, which scans through the supportedJacob Meuser
formats and creates an array of unique encodings. use the array in azalia_query_encoding. in other words, no more duplicate encodings in `audioctl encodings`.
2008-11-04volume scaling/setting cleanup:Jacob Meuser
* MAX_VOLUME_255 has been defined for ages. remove this define and the code that was only being used when this wasn't defined. * remove azalia_generic_mixer_{max,validate_value} since they are pointless. * when setting both stereo channels to the same level, just set the right channel level to the left channel level instead of calculating both separately. from Alexey Suslikov
2008-10-16Add S/PDIF support. From NetBSD.Jacob Meuser
Clean up a little while here. from Alexey Suslikov, thanks tested by several as part of a larger diff, thanks also
2008-10-16Some pins are not connected and dead-end. This diff removes such pinsJacob Meuser
from conection and mixer lists. It also removes knobs connected to power widgets. from NetBSD via Alexey Suslikov, thanks tested by several, thanks also
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2007-10-10Rework the debug dmesg to perform a more complete codec dump.Deanna Phillips
Tested by jmc, ckuethe, kettenis and jakemsr.
2007-09-10If 44.1kHz sample rate isn't supported, use 48kHz instead.Deanna Phillips
2007-09-10Add command verbs, a mixer target and mixer controls for EAPD control.Deanna Phillips
Some codecs, like the AD1984 found in x60s, need this in order for the speakers to work. New mixer items with names *.eapd will show up for codecs that need it and that are using the generic functions. From kent@netbsd
2007-07-23We will never make a mixer item out of the pin control operation, soDeanna Phillips
move it out of azalia_generic_mixer_set into its own function, azalia_generic_mixer_pinctrl. From kent@netbsd. In azalia_stac9200_mixer_init, let the unsolicited event handler make the initial headphone vs speaker choice. Removes some duplicate code. These changes only affect STAC9200. Tested by krw@ on a Latitude D620.
2007-05-02- Add support for handling unsolicited events (based on NetBSD).Deanna Phillips
- The STAC9200 codec was mistakenly referred to as STAC9220. Change this to STAC9200 and add a link to the datasheet. - Add a new target, MI_TARGET_PINCTRL, to azalia_generic_mixer_set() that allows us to turn pins on and off. - Add an unsolicited event handler for STAC9200 that will toggle the headphone and speaker pins. This means the speaker will now mute and unmute based on headphone presence. - Spelling: PRESENSE -> PRESENCE Tested by ajacoutot@, tedu@ and krw@, ok krw@.
2006-06-23add some constant macros for unsolicited response and jack sense.Brad Smith
From kent NetBSD