Age | Commit message (Collapse) | Author |
|
Add this and other missing entries to the pre-defined DAC groups.
Tested with ALC885; other models according to their data sheets.
ok jakemsr@
|
|
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
|
|
- recognize several STAC (Sigmatel/IDT) codecs and create converter
groups for the multi-channel capable codecs.
- use the correct name for Sigmatel 7661/7662.
|
|
adds outputs.master to ALC885 and ALC888 (and probably others that
don't yet have it). also makes ALC88{2,3} much more useful.
tested by jmc@ and simon@ (and myself), thanks.
|
|
the real and already existing inputs.dac in most cases.
|
|
passing in "preferred" DACs and ADCs. this will be used to give more
devices "outputs.master" and "record.volume".
|
|
use the lists to figure out what class some widgets belong to.
ok ratchov
|
|
between class, device and qualifier.
replace use of '.' with '_' where it's not really a separator.
idea from/ok ratchov@
warning: if you have a mixerctl.conf(5), it will need to be updated.
|
|
|
|
* DEBUG cleanup
from Alexey Suslikov, thanks
|
|
jack sense handling. makes azalia_generic_mixer_pinctrl useless, so zap it.
* azalia_generic_mixer_pin_sense works well enough to not need guessing
of pin direction in azalia_generic_mixer_default.
from Alexey Suslikov, thanks
|
|
* 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
|
|
needs adjustment. Allows the integrated speakers to work.
from Alexey Suslikov
|
|
tested by danh@ and Aaron Stellman on Thinkpad T61.
from Alexey Suslikov, thanks
|
|
This fixes fallout for AD1984 revealed by recent azalia.c
changes and reported on misc@.
While here:
* move gpio_unmute to more logical place,
* remove code ifdef'ed and unused for ages.
from Alexey Suslikov, thanks
Index: sys/dev/pci/azalia_codec.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/azalia_codec.c,v
retrieving revision 1.52
diff -u -r1.52 azalia_codec.c
--- sys/dev/pci/azalia_codec.c 23 Oct 2008 02:23:04 -0000 1.52
+++ sys/dev/pci/azalia_codec.c 24 Oct 2008 17:29:36 -0000
@@ -98,6 +98,7 @@
(const codec_t *, nid_t, int, u_char);
int azalia_generic_set_port(codec_t *, mixer_ctrl_t *);
int azalia_generic_get_port(codec_t *, mixer_ctrl_t *);
+int azalia_gpio_unmute(codec_t *, int);
int azalia_alc260_init_dacgroup(codec_t *);
int azalia_alc260_mixer_init(codec_t *);
@@ -127,7 +128,6 @@
int azalia_stac9221_set_port(codec_t *, mixer_ctrl_t *);
int azalia_stac9221_get_port(codec_t *, mixer_ctrl_t *);
int azalia_stac9221_apple_unsol_event(codec_t *, int);
-int azalia_gpio_unmute(codec_t *, int);
int azalia_stac7661_init_dacgroup(codec_t *);
int azalia_stac7661_mixer_init(codec_t *);
int azalia_stac7661_set_port(codec_t *, mixer_ctrl_t *);
@@ -1708,6 +1708,26 @@
return azalia_generic_mixer_get(this, m->nid, m->target, mc);
}
+int
+azalia_gpio_unmute(codec_t *this, int pin)
+{
+ uint32_t data, mask, dir;
+
+ this->comresp(this, this->audiofunc, CORB_GET_GPIO_DATA, 0, &data);
+ this->comresp(this, this->audiofunc, CORB_GET_GPIO_ENABLE_MASK, 0, &mask);
+ this->comresp(this, this->audiofunc, CORB_GET_GPIO_DIRECTION, 0, &dir);
+
+ data |= 1 << pin;
+ mask |= 1 << pin;
+ dir |= 1 << pin;
+
+ this->comresp(this, this->audiofunc, CORB_SET_GPIO_ENABLE_MASK, mask, NULL);
+ this->comresp(this, this->audiofunc, CORB_SET_GPIO_DIRECTION, dir, NULL);
+ DELAY(1000);
+ this->comresp(this, this->audiofunc, CORB_SET_GPIO_DATA, data, NULL);
+
+ return 0;
+}
/* ----------------------------------------------------------------
* Realtek ALC260
@@ -2181,18 +2201,11 @@
int
azalia_alc882_init_dacgroup(codec_t *this)
{
-#if 0
- static const convgroupset_t dacs = {
- -1, 3,
- {{4, {0x02, 0x03, 0x04, 0x05}}, /* analog 8ch */
- {1, {0x06}}, /* digital */
- {1, {0x25}}}}; /* another analog */
-#else
static const convgroupset_t dacs = {
-1, 2,
{{4, {0x02, 0x03, 0x04, 0x05}}, /* analog 8ch */
{1, {0x06}}}}; /* digital */
-#endif
+ /* don't support for 0x25 dac */
static const convgroupset_t adcs = {
-1, 2,
{{3, {0x07, 0x08, 0x09}}, /* analog 6ch */
@@ -2484,13 +2497,14 @@
azalia_ad1984_init_dacgroup(codec_t *this)
{
static const convgroupset_t dacs = {
- -1, 1,
- {{2, {0x03, 0x04}}}};
-
+ -1, 2,
+ {{2, {0x04, 0x03}}, /* analog 4ch */
+ {1, {0x02}}}}; /* digital */
static const convgroupset_t adcs = {
- -1, 1,
- {{1, {0x08}}}};
-
+ -1, 3,
+ {{2, {0x08, 0x09}}, /* analog 4ch */
+ {1, {0x06}}, /* digital */
+ {1, {0x05}}}}; /* digital */
this->dacs = dacs;
this->adcs = adcs;
return 0;
@@ -3006,27 +3020,6 @@
DPRINTF(("%s: unknown tag: %d\n", __func__, tag));
}
return 0;
-}
-
-int
-azalia_gpio_unmute(codec_t *this, int pin)
-{
- uint32_t data, mask, dir;
-
- this->comresp(this, this->audiofunc, CORB_GET_GPIO_DATA, 0, &data);
- this->comresp(this, this->audiofunc, CORB_GET_GPIO_ENABLE_MASK, 0, &mask);
- this->comresp(this, this->audiofunc, CORB_GET_GPIO_DIRECTION, 0, &dir);
-
- data |= 1 << pin;
- mask |= 1 << pin;
- dir |= 1 << pin;
-
- this->comresp(this, this->audiofunc, CORB_SET_GPIO_ENABLE_MASK, mask, NULL);
- this->comresp(this, this->audiofunc, CORB_SET_GPIO_DIRECTION, dir, NULL);
- DELAY(1000);
- this->comresp(this, this->audiofunc, CORB_SET_GPIO_DATA, data, NULL);
-
- return 0;
}
/* ----------------------------------------------------------------
|
|
enables EAPD when needed
- new function azalia_generic_mixer_create_virtual - creates some
well known mixer controls, such as outputs.master
- use the two new functions when setting up a codec with the generic
codec support
- remove explicit pindir manipulations (azalia_generic_mixer_pin_sense
does this automatically now)
- add some GPIO quirks (from FreeBSD's snd_hda)
- move all GPIO quirks into one place
- add DAC/ADC groupings and support for several more codecs using the
generic codec support
- correct Sigmatel STAC9872AK name
- initialize unsol_event to NULL by default
DAC/ADC grouping and create_virtual/pin_sense code from NetBSD.
GPIO quirks from FreeBSD.
from Alexey Suslikov, thanks
|
|
Clean up a little while here.
from Alexey Suslikov, thanks
tested by several as part of a larger diff, thanks also
|
|
from conection and mixer lists. It also removes knobs connected to
power widgets.
from NetBSD via Alexey Suslikov, thanks
tested by several, thanks also
|
|
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@
|
|
ok dlg@
|
|
Tested by Alexander Hall, thanks
ok jakemsr
|
|
avoids some duplicate items when a pin widget has both input and
output amplifiers.
|
|
now. Also, note that codec->init_widget functions must be used with
care since they can create duplicate mixer item names.
|
|
the code here. Tested by Rob Lytle, thanks.
|
|
|
|
ok ratchov
|
|
other machines with STAC9221.
Tested by Vladas Urbonas on XPS M1210.
no objections jakemsr@
|
|
Tested jmc, jakemsr
|
|
Tested by jmc, ckuethe, kettenis and jakemsr.
|
|
to be enabled in order for it to produce sound. It can use the same
gpio function as the macs, so rename that to azalia_gpio_unmute.
Tested by damien@, no regressions noticed by jakemsr@
|
|
for master, remove useless pin direction calls, add mixer item for mic
boost, remove useless item for the volume knob.
|
|
AD1984. Recording isn't supported yet.
Lots of testing by reyk@, Pau Amaro-Seoane and Alexey Vatchenko;
thanks!
|
|
is available.
|
|
the DAC volumes.
Tested by otto@, ajacoutot@, merdeley@ and Darrin Chandler.
|
|
ok dlg@
|
|
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
|
|
their purpose, since that's often incorrect.
This should solve some no-sound problems for codecs using the generic
functions.
From kent@netbsd
|
|
speakers and line outputs will now mute and unmute depending on
headphone presence.
Tested on Macbook, Macbook Pro and Mini by otto@, ajacoutot@, merdely@
and Darrin Chandler, thanks.
|
|
"selector" and "front", so instead create the items that it actually
needs.
This unbreaks the mute button in wscons, and allows setting the volume
in programs like xmms and xine. This is for STAC9200 only - similiar
fixes for other codecs coming soon.
Tested and ok krw@
|
|
valid step, and keep them in sync. This lets audio(4) set exact gain
levels based on the mixer delta, and unbreaks volume up/down buttons
in wscons. This also avoids a divide by zero that could occur if the
generic mixer init found an amplifier with zero steps.
Problem noticed and tested by jmc@, similar diff tested by krw@
|
|
- enable internal mic and select it as the default recording source,
- create mixerctl record.source for selecting between internal and
external mics,
- mute input by default.
|
|
|
|
audio layer wants, and is a more accurate description. Use the
correct number of steps.
|
|
- Add set_port and get_port functions and use them to create a stereo
master volume out of the headphone and speaker dacs. Unbreaks setting
the volume in ports like xmms.
- Use the correct number of steps for the dac volumes.
|
|
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.
|
|
ALC882, and differs only by lacking an ADC and a mixer, so have it use
ALC882's get_port(), set_port() and a slightly modified version of its
mixer init.
This also works around a problem where the generic mixer init creates
truncated mixer item names which can't be manipulated (noticed by
steven@).
Tested by steven@, ckuethe@ and jmc@.
|
|
codec ID 83847661 found in some Sony VAIO FE and SZ laptops.
No regressions noticed by jasper@, steven@ or Will Backman. I've been
using it for months.
|
|
Tested by many.
|
|
- 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@.
|
|
From kent@NetBSD
|