summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia.c
AgeCommit message (Collapse)Author
2009-02-05Remove the BUS_DMA_NOCACHE flag from all azalia dma mappings.Owain Ainsworth
The fact that this has only just been implemented, and that this hardware is only found on x86 shows that this flag should not be needed for operation of this hardware. It's been here since the initial netbsd commit the code came from. "sounds good to me" jakemsr@, ok kettenis@.
2009-01-16support 20 and 24-bit sample formats. remove the unneeded "validbits"Jacob Meuser
handling. ok ratchov; tested by naddy, thanks
2009-01-11allow one more level of connections (3 instead of 2) away from DACsJacob Meuser
for mixers and selectors when choosing the defaults for outputs.master.slaves.
2009-01-1132-bit mode for s/pdif transmitters/receivers does not reallyJacob Meuser
allow transmission/reception of 32-bit audio, so don't allow it. pointed out by naddy@, thanks.
2009-01-05- a little simplificationJacob Meuser
- don't set vref bits on mic pins unless the pin says it supports it - fall back on 50% vref if 80% vref isn't supported
2009-01-05explicitly check if azalia_codec_find_defdac didn't find a dac instead ofJacob Meuser
possibly matching a nonexistent hp or spkr dac.
2009-01-05if the high bit is set in a connection list entry, it means the entryJacob Meuser
is the end of a continuous list that started with the last entry. while here, rewrite a bit so both long form and short form entries are handled by the same code, and don't allocate more space than is needed.
2009-01-04try to get better default outputs.master.slaves by not includingJacob Meuser
beep generators or mixers and selectors that are more than 2 connections away from a DAC.
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-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-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-31the channel_mask field of struct audio_format is unused, so removedJacob Meuser
it and the associated macros. this is part of NetBSD's "converter pipeline", and it isn't really used there either.
2008-12-31rewrite azalia_codec_connect_streamJacob Meuser
- quit swapping channels 2:3 with 4:5 when processing 6 or more channels. hacks deep in drivers to "fix" wrongly encoded files is just wrong. - try to be sure headphones AND speakers get DAC output by default.
2008-12-31actually find the speakers and headphonesJacob Meuser
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-31a fixed mic isn't very useful as an output device, and a fixedJacob Meuser
speaker isn't very useful as an input device
2008-12-31- rearrange to be able to return earlier if nothing left toJacob Meuser
- remove a couple pointless comments
2008-12-31- always check that max channels isn't exceededJacob Meuser
- make the code readable and the comment understandable
2008-12-30- if widget X will be named for widget Y and widget Y is disabled,Jacob Meuser
widget X should be disabled as well. - change the comment about renaming widgets to better explain why instead of how the renaming is done.
2008-12-25currently azalia only supports one codec. instead of using simply theJacob Meuser
first codec with an audio function group, use the first codec with an audio function group that can do analog I/O, if there is one. codecs that just do digital I/O aren't quite as useful, yet.
2008-12-25before naming a widget after a pin because the widget is the only thingJacob Meuser
the pin is connected to, make sure the pin is the only device that is connected to the widget.
2008-12-25- one "default" direction is enoughJacob Meuser
- be careful not to set a direction that the pin doesn't support - remove a workaround in the generic code which is more or less for a specific device, there are better ways to deal with such situations now
2008-12-23gather up most of the code for printing debug info in dmesgs andJacob Meuser
move it to one place, instead of scattered thoughout with #define and DPRINTF. my eyes are happier now.
2008-12-23line-in is now "line-in", line-out is still "line". S/PDIF-out isJacob Meuser
now "SPDIF", S/PDIF-in is still "SPDIF-in". line change because we need to differentiate. S/PDIF change because SPDIF-out is too long, and for consistency.
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-23backout previous. changing the index of valid nids breaks things.Jacob Meuser
2008-12-23don't add invalid widgets to connection lists.Jacob Meuser
2008-12-22hex for unused widget namesJacob Meuser
2008-12-22set a default name for widgets (u-wid$NID) and don't try to giveJacob Meuser
disabled widgets any other name.
2008-12-22special case after general case. it's better to be named afterJacob Meuser
a converter than a selector.
2008-12-22- expand/add macros for pin configuration manipulationJacob Meuser
- use "beep" as pin device 0xe
2008-12-21move the codec specific widget initialization out ofJacob Meuser
azalia_widget_label_widgets to right after the generic widget initialization. nothing uses this yet.
2008-12-21if a widget is the sole connection to another widget, name theJacob Meuser
widget for the widget it's connected to. but be a bit careful to not end up with duplicate mixer item names.
2008-12-21label converter widgets for their place in the converter group.Jacob Meuser
e.g. the first DAC in the converter group is now dac, the second is dac2, etc. unused converters (not in a converter group) will have a "u-" prefix. these will disappear completely in the near future, as they are useless. if there is more than one converter group, converters in the second group will have a "dig-" prefix, since they are digital converters.
2008-12-21a little rearranging:Jacob Meuser
- move the azalia_widget_init_connection call from azalia_widget_label_widgets to just after azalia_widget_init - move azalia_widget_label_widgets to after dacgroup initialization - move the widget info printing from azalia_widget_init_connection and azalia_widget_init to new function azalia_widget_dump_info - call azalia_widget_dump_info right after azalia_widget_init_connection - in functions that are ony used if AZALIA_DEBUG is defined, use printf instead of DPRINTF()
2008-12-21add function azalia_widget_sole_conn, which determines if theJacob Meuser
given widget is the sole connection to an ADC, DAC or pin complex. not used just yet.
2008-11-30if an input mixer or selector has no usable inputs, disable it, asJacob Meuser
it is useless.
2008-11-30- AZ_MAX_SENSE_PINS -> HDA_MAX_SENSE_PINSJacob Meuser
- MI_TARGET_* are enumerated in hex from Alexey Suslikov
2008-11-30- don't access nonexistent converter goupsJacob Meuser
- don't try to create formats for converter groups that don't exist - don't allow playback or recording if there is no corresponding converter group - don't try to set audio processing parameters on converter groups that don't exist allows playback (or record) only devices to work, such as the azalias found on ATI graphics devices. note, the ATI devices generally attach before the onboard devices do. that means they will be audio0 and onboard devices will be audio1. don't forget to make sure the /dev/{audio[ctl],mixer,sound} links point to the nodes of the device you want to be the default. tested by naddy@, 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-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-27intrdoduce DPRINTFN macro so debug messages can be selectively enabled.Jacob Meuser
use it to quiet some debug messages by default, so people don't get scared when testing completely unrelated changes when AZALIA_DEBUG is defined. print out ADC groupings when AZALIA_DEBUG is defined like we do for DAC groupings.
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-14* readability improvement in azalia_codec_connect_streamJacob Meuser
* DEBUG cleanup from Alexey Suslikov, thanks
2008-11-05Remove some PCI macros no longer being used.Brad Smith
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-04need to take mode into account when verifying/setting parametersJacob Meuser
2008-11-01set the appropriate value (0, not emulated) in the flags field ofJacob Meuser
struct audio_encoding in azalia_query_encodings. otherwise it will be some random value. makes AUDIO_GETENC and thus sio_getcap(3) much more useful here.