* [PATCH - attached this time] azx/realtek: Cleanup of the W810 system support.
@ 2005-01-05 20:40 Stephen Warren
2005-01-07 14:24 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2005-01-05 20:40 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]
Clean-ups of the W810 support in azx/patch_realtek.c
* Correctly size a couple of static data arrays.
* Fix alc880_ch_mode_get so it only accesses index 0 of
spec->channel_mode,
in case there's only one entry.
* Add separate mute switch for headphone/speaker output pin of the W810
* Set all amps to be zero-volume, and pins to be muted, in the
initialization
verb sequence, like a standard ALSA driver.
* Enable SPDIF object creation (set dig_out_nid)
* Fix a lot of W810-specific comments to be more accurate.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Notes:
I hadn't realized that I'd included W810 support in my previous patch -
I'd meant to send that in later! This patch cleans up some of the
work-in-progress.
SPDIF output doesn't work on this system. The IEC958 muting control does
show up in alsamixer. This may be our application problem - I think
what's happening is that we can't open plug:iec958:... and just fall
back to analog mode.
DAC NID 0x02 is routed to both pin NID 0x14 (rear jack named "front")
and to pin NID 0x1b (connected to internal speakers, and headphone
jack). I've created a mixer element named "Headphone Playback Switch" to
allow the control of the mute for pin NID 0x1b. Is this the right way to
do this? Thanks for feedback.
Sorry about creating that bug in hda_codec.c!
--
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@nvidia.com http://www.nvidia.com/
swarren@wwwdotorg.org http://www.wwwdotorg.org/pgp.html
[-- Attachment #2: w810-cleanup.diff --]
[-- Type: application/octet-stream, Size: 6715 bytes --]
Index: patch_realtek.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/azx/patch_realtek.c,v
retrieving revision 1.8
diff -u -r1.8 patch_realtek.c
--- patch_realtek.c 3 Jan 2005 17:23:16 -0000 1.8
+++ patch_realtek.c 5 Jan 2005 20:28:12 -0000
@@ -86,7 +86,7 @@
0x02, 0x05, 0x04, 0x03
};
-static hda_nid_t alc880_w810_dac_nids[4] = {
+static hda_nid_t alc880_w810_dac_nids[3] = {
/* front, rear/surround, clfe */
0x02, 0x03, 0x04
};
@@ -256,7 +256,7 @@
};
/*
- * channel source setting (6/8 channel selection for W810)
+ * channel source setting for W810 system
*
* W810 has rear IO for:
* Front (DAC 02)
@@ -264,15 +264,23 @@
* Center/LFE (DAC 04)
* Digital out (06)
*
- * It also has a pair of internal speakers, and a headphone jack,
- * both connected to Line2 on the codec. This output has a hardware
- * volume control (variable resistor - no software API).
+ * The system also has a pair of internal speakers, and a headphone jack.
+ * These are both connected to Line2 on the codec, hence to DAC 02.
+ *
+ * There is a variable resistor to control the speaker or headphone
+ * volume. This is a hardware-only device without a software API.
+ *
+ * Plugging headphones in will disable the internal speakers. This is
+ * implemented in hardware, not via the driver using jack sense. In
+ * a similar fashion, plugging into the rear socket marked "front" will
+ * disable both the speakers and headphones.
*
* For input, there's a microphone jack, and an "audio in" jack.
- * These may not do anything useful with this driver yet.
+ * These may not do anything useful with this driver yet, because I
+ * haven't setup any initialization verbs for these yet...
*/
-static struct alc_channel_mode alc880_w810_modes[2] = {
+static struct alc_channel_mode alc880_w810_modes[1] = {
{ 6, 0 }
};
@@ -301,7 +309,7 @@
snd_assert(spec->channel_mode, return -ENXIO);
ucontrol->value.enumerated.item[0] =
- (spec->multiout.max_channels == spec->channel_mode[1].channels) ? 1 : 0;
+ (spec->multiout.max_channels == spec->channel_mode[0].channels) ? 0 : 1;
return 0;
}
@@ -391,6 +399,7 @@
HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x16, 1, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x16, 2, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT),
@@ -591,49 +600,49 @@
};
static struct hda_verb alc880_w810_init_verbs[] = {
- /* front channel selector/amp: input 0: DAC: Unmuted, (no volume selection) */
+ /* front channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
- /* front channel selector/amp: input 1: Capture mix: Unmuted, (no volume selection) */
+ /* front channel selector/amp: input 1: capture mix: muted, (no volume selection) */
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
- /* front channel selector/amp: output 0: Unmuted, max volume */
- {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb040},
+ /* front channel selector/amp: output 0: unmuted, max volume */
+ {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
- /* front out pin: unmuted, (no volume selection) */
- {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ /* front out pin: muted, (no volume selection) */
+ {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
- /* front out pin: headphone enable, out enable, vref disabled */
+ /* front out pin: NOT headphone enable, out enable, vref disabled */
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
- /* surround channel selector/amp: input 0: DAC: Unmuted, (no volume selection) */
+ /* surround channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
- /* surround channel selector/amp: input 1: Capture mix: Unmuted, (no volume selection) */
+ /* surround channel selector/amp: input 1: capture mix: muted, (no volume selection) */
{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
- /* surround channel selector/amp: output 0: Unmuted, max volume */
- {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb040},
+ /* surround channel selector/amp: output 0: unmuted, max volume */
+ {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
- /* surround out pin: unmuted, (no volume selection) */
- {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ /* surround out pin: muted, (no volume selection) */
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
- /* surround out pin: headphone enable, out enable, vref disabled */
+ /* surround out pin: NOT headphone enable, out enable, vref disabled */
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
- /* c/lfe channel selector/amp: input 0: DAC: Unmuted, (no volume selection) */
+ /* c/lfe channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
- /* c/lfe channel selector/amp: input 1: Capture mix: Unmuted, (no volume selection) */
+ /* c/lfe channel selector/amp: input 1: capture mix: muted, (no volume selection) */
{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
- /* c/lfe channel selector/amp: output 0: Unmuted, max volume */
- {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb040},
+ /* c/lfe channel selector/amp: output 0: unmuted, max volume */
+ {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
- /* c/lfe out pin: unmuted, (no volume selection) */
- {0x16, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ /* c/lfe out pin: muted, (no volume selection) */
+ {0x16, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
/* c/lfe out pin: NOT headphone enable, out enable, vref disabled */
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
@@ -642,24 +651,13 @@
/* hphone/speaker input selector: front DAC */
{0x13, AC_VERB_SET_CONNECT_SEL, 0x0},
- /* hphone/speaker out pin: unmuted, (no volume selection) */
- {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ /* hphone/speaker out pin: muted, (no volume selection) */
+ {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
/* hphone/speaker out pin: NOT headphone enable, out enable, vref disabled */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
-#if 0
- /* gpio direction: gpio0 input, gpio1 output */
- {0x01, 0x717, 2},
-
- /* gpio data: gpio0: 0, gpio1: 1 */
- {0x01, 0x715, 2},
-
- /* gpio enable: gpio0 no, gpio1 yes */
- {0x01, 0x716, 2},
-#endif
-
{ }
};
@@ -968,6 +966,7 @@
switch (board_config) {
case ALC880_3ST_DIG:
case ALC880_5ST_DIG:
+ case ALC880_W810:
spec->multiout.dig_out_nid = ALC880_DIGOUT_NID;
break;
default:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH - attached this time] azx/realtek: Cleanup of the W810 system support.
2005-01-05 20:40 [PATCH - attached this time] azx/realtek: Cleanup of the W810 system support Stephen Warren
@ 2005-01-07 14:24 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-01-07 14:24 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel
At Wed, 5 Jan 2005 12:40:41 -0800,
Stephen Warren wrote:
>
> Clean-ups of the W810 support in azx/patch_realtek.c
>
> * Correctly size a couple of static data arrays.
>
> * Fix alc880_ch_mode_get so it only accesses index 0 of
> spec->channel_mode,
> in case there's only one entry.
>
> * Add separate mute switch for headphone/speaker output pin of the W810
>
> * Set all amps to be zero-volume, and pins to be muted, in the
> initialization
> verb sequence, like a standard ALSA driver.
>
> * Enable SPDIF object creation (set dig_out_nid)
>
> * Fix a lot of W810-specific comments to be more accurate.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Thanks, the patch is now on CVS.
In addition to your original patch, I changed
alc880_w810_modes.sequence from 0 to NULL.
Also, added the NULL check of sequence pointer, just to be sure.
> I hadn't realized that I'd included W810 support in my previous patch -
> I'd meant to send that in later! This patch cleans up some of the
> work-in-progress.
Don't worry, it's still in rc phase :)
> DAC NID 0x02 is routed to both pin NID 0x14 (rear jack named "front")
> and to pin NID 0x1b (connected to internal speakers, and headphone
> jack). I've created a mixer element named "Headphone Playback Switch" to
> allow the control of the mute for pin NID 0x1b. Is this the right way to
> do this? Thanks for feedback.
It looks fine...
Takashi
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-07 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-05 20:40 [PATCH - attached this time] azx/realtek: Cleanup of the W810 system support Stephen Warren
2005-01-07 14:24 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.