* Conexant test code.
@ 2006-11-04 9:52 Tobin Davis
2006-11-04 12:35 ` Konstantin Shaposhnikov
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Tobin Davis @ 2006-11-04 9:52 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]
Here's test release 8. Changes of significance:
Preliminary Conexant 5045 support
Preliminary HP DV6000 series support.
Preliminary test mode (when compiled with debugging).
Separation of Conexant 5047 support models
HP DV1000/2000/3000 series split from 5000/8000 series due to
implementation differences. No change on HP muting speakers
(still need to figure this one out).
HP DV5000/8000 series/Compaq V5209US/V5204NR series
Headphone mutes speakers ok (same as test7).
Removed Internal Microphone from mixer.
Toshiba P100 series
changed EAPD default. Hopefully this triggers audio.
Code changes to "test" model.
Adjusted Mic gains (I think).
Areas to test:
5045 series - everything.
5047 series
HP DV1/2/3000 series - try test mode and start toggling
controls until speakers are muted and headphones work.
Report findings.
HP 5000/8000 series - make sure I didn't break things.
Test recording.
Toshiba - everything.
For the new testers in the group, here's the instructions:
wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.13.tar.bz2
tar -jxf alsa-driver-1.0.13.tar.bz2
cd alsa-driver-1.0.13
./configure --with-debug=full --with-cards=hda-intel
patch -p1 <conexant-test8.patch
make ; make install
dmesg -c
Stop all audio applications and remove all audio drivers (lsmod |fgrep
snd). Reload the new driver with "modprobe snd-hda-intel" and test it
out. Use alsamixer to report any mixer issues (easier to debug than
kmix/gmix, whatever-gui-mixer). If nothing works, or one function
doesn't work, try reloading the driver with "model=test" as a parameter.
This should enable everything.
Send me your test results. Please include the system make/model, the
subsystem line from "lspci -s 0:1b -vn" (Ex: Subsystem: 103c:30b2), and
the output from "cat /proc/asound/card0/codec#0".
I need this for tracking what works on what systems.
Thanks for helping test this new driver.
--
Tobin Davis <tdavis@dsl-only.net>
[-- Attachment #2: conexant-test8.patch --]
[-- Type: text/x-patch, Size: 44159 bytes --]
--- /dev/null 2006-09-13 00:29:45.000000000 -0700
+++ alsa-driver-1.0.13/pci/hda/patch_conexant.c 2006-10-21 21:30:35.000000000 -0700
@@ -0,0 +1,2 @@
+#define __NO_VERSION__
+#include "../../alsa-kernel/pci/hda/patch_conexant.c"
diff -r d7fe584f7395 Documentation/ALSA-Configuration.txt
--- alsa-driver-1.0.13/alsa-kernel/Documentation/ALSA-Configuration.txt Thu Oct 19 20:35:56 2006 +0200
+++ alsa-driver-1.0.13/alsa-kernel/Documentation/ALSA-Configuration.txt Sun Oct 22 10:03:13 2006 -0700
@@ -866,6 +865,20 @@ Prior to version 0.9.0rc4 options had a
laptop 3-jack with hp-jack automute
laptop-dig ditto with SPDIF
auto auto-config reading BIOS (default)
+
+ Conexant 5045
+ laptop Laptop config
+ test for testing/debugging purpose, almost all controls can be
+ adjusted. Appearing only when compiled with
+ $CONFIG_SND_DEBUG=y
+
+ Conexant 5047
+ laptop Basic Laptop config
+ laptop-hp Laptop config with Headphone detect
+ laptop-eapd Laptop config EAPD support
+ test for testing/debugging purpose, almost all controls can be
+ adjusted. Appearing only when compiled with
+ $CONFIG_SND_DEBUG=y
STAC9200/9205/9220/9221/9254
ref Reference board
diff -r d7fe584f7395 pci/hda/Makefile
--- alsa-driver-1.0.13/alsa-kernel/pci/hda/Makefile Thu Oct 19 20:35:56 2006 +0200
+++ alsa-driver-1.0.13/alsa-kernel/pci/hda/Makefile Sun Oct 22 10:03:13 2006 -0700
@@ -1,5 +1,5 @@ snd-hda-intel-objs := hda_intel.o
snd-hda-intel-objs := hda_intel.o
-snd-hda-codec-objs := hda_codec.o hda_generic.o patch_realtek.o patch_cmedia.o patch_analog.o patch_sigmatel.o patch_si3054.o patch_atihdmi.o
+snd-hda-codec-objs := hda_codec.o hda_generic.o patch_realtek.o patch_cmedia.o patch_analog.o patch_sigmatel.o patch_si3054.o patch_atihdmi.o patch_conexant.o
ifdef CONFIG_PROC_FS
snd-hda-codec-objs += hda_proc.o
endif
diff -r d7fe584f7395 pci/hda/hda_patch.h
--- a/alsa-kernel/pci/hda/hda_patch.h Thu Oct 19 20:35:56 2006 +0200
+++ alsa-driver-1.0.13/alsa-kernel/pci/hda/hda_patch.h Sun Oct 22 10:03:13 2006 -0700
@@ -14,6 +14,8 @@ extern struct hda_codec_preset snd_hda_p
extern struct hda_codec_preset snd_hda_preset_si3054[];
/* ATI HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_atihdmi[];
+/* Conexant audio codec */
+extern struct hda_codec_preset snd_hda_preset_conexant[];
static const struct hda_codec_preset *hda_preset_tables[] = {
snd_hda_preset_realtek,
@@ -22,5 +24,6 @@ static const struct hda_codec_preset *hd
snd_hda_preset_sigmatel,
snd_hda_preset_si3054,
snd_hda_preset_atihdmi,
+ snd_hda_preset_conexant,
NULL
};
--- /dev/null 2006-10-23 04:17:47.000000000 -0700
+++ alsa-driver-1.0.13/alsa-kernel/pci/hda/patch_conexant.c 2006-11-04 01:18:21.000000000 -0800
@@ -0,0 +1,1281 @@
+/*
+ * HD audio interface patch for Conexant HDA audio codec
+ *
+ * Copyright (c) 2006 Pototskiy Akex <alex.pototskiy@gmail.com>
+ * Takashi Iwai <tiwai@suse.de>
+ * Tobin Davis <tdavis@dsl-only.net>
+ *
+ * This driver is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This driver is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <sound/driver.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/pci.h>
+#include <sound/core.h>
+#include "hda_codec.h"
+#include "hda_local.h"
+
+#define CXT_PIN_DIR_IN 0x00
+#define CXT_PIN_DIR_OUT 0x01
+#define CXT_PIN_DIR_INOUT 0x02
+#define CXT_PIN_DIR_IN_NOMICBIAS 0x03
+#define CXT_PIN_DIR_INOUT_NOMICBIAS 0x04
+
+#define CONEXANT_HP_EVENT 0x37
+#define CONEXANT_MIC_EVENT 0x38
+
+
+
+struct conexant_spec {
+
+ struct snd_kcontrol_new *mixers[5];
+ int num_mixers;
+
+ const struct hda_verb *init_verbs[5]; /* initialization verbs
+ * don't forget NULL termination!
+ */
+ unsigned int num_init_verbs;
+
+ /* playback */
+ struct hda_multi_out multiout; /* playback set-up
+ * max_channels, dacs must be set
+ * dig_out_nid and hp_nid are optional
+ */
+ unsigned int cur_eapd;
+ unsigned int need_dac_fix;
+
+ /* capture */
+ unsigned int num_adc_nids;
+ hda_nid_t *adc_nids;
+ hda_nid_t dig_in_nid; /* digital-in NID; optional */
+
+ /* capture source */
+ const struct hda_input_mux *input_mux;
+ hda_nid_t *capsrc_nids;
+ unsigned int cur_mux[3];
+
+ /* channel model */
+ const struct hda_channel_mode *channel_mode;
+ int num_channel_mode;
+
+ /* PCM information */
+ struct hda_pcm pcm_rec[2]; /* used in build_pcms() */
+
+ struct mutex amp_mutex; /* PCM volume/mute control mutex */
+ unsigned int spdif_route;
+
+ /* dynamic controls, init_verbs and input_mux */
+ struct auto_pin_cfg autocfg;
+ unsigned int num_kctl_alloc, num_kctl_used;
+ struct snd_kcontrol_new *kctl_alloc;
+ struct hda_input_mux private_imux;
+ hda_nid_t private_dac_nids[4];
+
+};
+
+static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+}
+
+static int conexant_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ unsigned int stream_tag,
+ unsigned int format,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, stream_tag,
+ format, substream);
+}
+
+static int conexant_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
+}
+
+/*
+ * Digital out
+ */
+static int conexant_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_dig_open(codec, &spec->multiout);
+}
+
+static int conexant_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_dig_close(codec, &spec->multiout);
+}
+
+/*
+ * Analog capture
+ */
+static int conexant_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ unsigned int stream_tag,
+ unsigned int format,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number],
+ stream_tag, 0, format);
+ return 0;
+}
+
+static int conexant_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number],
+ 0, 0, 0);
+ return 0;
+}
+
+
+
+static struct hda_pcm_stream conexant_pcm_analog_playback = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ .nid = 0, /* fill later */
+ .ops = {
+ .open = conexant_playback_pcm_open,
+ .prepare = conexant_playback_pcm_prepare,
+ .cleanup = conexant_playback_pcm_cleanup
+ },
+
+};
+
+static struct hda_pcm_stream conexant_pcm_analog_capture = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ .nid = 0, /* fill later */
+ .ops = {
+ .prepare = conexant_capture_pcm_prepare,
+ .cleanup = conexant_capture_pcm_cleanup
+ },
+
+};
+
+
+static struct hda_pcm_stream conexant_pcm_digital_playback = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ .nid = 0, /* fill later */
+ .ops = {
+ .open = conexant_dig_playback_pcm_open,
+ .close = conexant_dig_playback_pcm_close
+ },
+};
+
+static struct hda_pcm_stream conexant_pcm_digital_capture = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ /* NID is set in alc_build_pcms */
+};
+
+static int conexant_build_pcms(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ struct hda_pcm *info = spec->pcm_rec;
+
+ codec->num_pcms = 1;
+ codec->pcm_info = info;
+
+ info->name = "CONEXANT Analog";
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK] = conexant_pcm_analog_playback;
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = spec->multiout.max_channels;
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dac_nids[0];
+ info->stream[SNDRV_PCM_STREAM_CAPTURE] = conexant_pcm_analog_capture;
+ info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = spec->num_adc_nids;
+ info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
+
+ if (spec->multiout.dig_out_nid) {
+ info++;
+ codec->num_pcms++;
+ info->name = "Conexant Digital";
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK] = conexant_pcm_digital_playback;
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid;
+ if (spec->dig_in_nid) {
+ info->stream[SNDRV_PCM_STREAM_CAPTURE] = conexant_pcm_digital_capture;
+ info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid;
+ }
+ }
+
+ return 0;
+}
+
+static int conexant_mux_enum_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+
+ return snd_hda_input_mux_info(spec->input_mux, uinfo);
+}
+
+static int conexant_mux_enum_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+ ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx];
+ return 0;
+}
+
+static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+ return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
+ spec->capsrc_nids[adc_idx],
+ &spec->cur_mux[adc_idx]);
+}
+
+static int conexant_init(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ int i;
+
+ for (i = 0; i < spec->num_init_verbs; i++)
+ snd_hda_sequence_write(codec, spec->init_verbs[i]);
+ return 0;
+}
+
+static void conexant_free(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ unsigned int i;
+
+ if (spec->kctl_alloc) {
+ for (i = 0; i < spec->num_kctl_used; i++)
+ kfree(spec->kctl_alloc[i].name);
+ kfree(spec->kctl_alloc);
+ }
+
+ kfree(codec->spec);
+}
+
+#ifdef CONFIG_PM
+static int conexant_resume(struct hda_codec *codec)
+{
+ struct conexant_spec *spec = codec->spec;
+ int i;
+
+ codec->patch_ops.init(codec);
+ for (i = 0; i < spec->num_mixers; i++)
+ snd_hda_resume_ctls(codec, spec->mixers[i]);
+ if (spec->multiout.dig_out_nid)
+ snd_hda_resume_spdif_out(codec);
+ if (spec->dig_in_nid)
+ snd_hda_resume_spdif_in(codec);
+ return 0;
+}
+#endif
+
+static int conexant_build_controls(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ unsigned int i;
+ int err;
+
+ for (i = 0; i < spec->num_mixers; i++) {
+ err = snd_hda_add_new_ctls(codec, spec->mixers[i]);
+ if (err < 0)
+ return err;
+ }
+ if (spec->multiout.dig_out_nid) {
+ err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
+ if (err < 0)
+ return err;
+ }
+ if (spec->dig_in_nid) {
+ err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
+ if (err < 0)
+ return err;
+ }
+ return 0;
+}
+
+static struct hda_codec_ops conexant_patch_ops = {
+ .build_controls = conexant_build_controls,
+ .build_pcms = conexant_build_pcms,
+ .init = conexant_init,
+ .free = conexant_free,
+#ifdef CONFIG_PM
+ .resume = conexant_resume,
+#endif
+};
+
+/*
+ * EAPD control
+ * the private value = nid | (invert << 8)
+ */
+
+
+
+static int conexant_eapd_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int conexant_eapd_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ int invert = (kcontrol->private_value >> 8) & 1;
+ if (invert)
+ ucontrol->value.integer.value[0] = ! spec->cur_eapd;
+ else
+ ucontrol->value.integer.value[0] = spec->cur_eapd;
+ return 0;
+}
+
+static int conexant_eapd_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ int invert = (kcontrol->private_value >> 8) & 1;
+ hda_nid_t nid = kcontrol->private_value & 0xff;
+ unsigned int eapd;
+ eapd = ucontrol->value.integer.value[0];
+ if (invert)
+ eapd = !eapd;
+ if (eapd == spec->cur_eapd && ! codec->in_resume)
+ return 0;
+ spec->cur_eapd = eapd;
+ snd_hda_codec_write(codec, nid,
+ 0, AC_VERB_SET_EAPD_BTLENABLE,
+ eapd ? 0x02 : 0x00);
+ return 1;
+}
+
+static int conexant_ch_mode_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_ch_mode_info(codec, uinfo, spec->channel_mode,
+ spec->num_channel_mode);
+}
+
+static int conexant_ch_mode_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode,
+ spec->num_channel_mode, spec->multiout.max_channels);
+}
+
+static int conexant_ch_mode_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
+ spec->num_channel_mode,
+ &spec->multiout.max_channels);
+ if (err >= 0 && spec->need_dac_fix)
+ spec->multiout.num_dacs = spec->multiout.max_channels / 2;
+ return err;
+}
+
+#define CXT_PIN_MODE(xname, nid, dir) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = conexant_ch_mode_info, \
+ .get = conexant_ch_mode_get, \
+ .put = conexant_ch_mode_put, \
+ .private_value = nid | (dir<<16) }
+
+static int cxt_gpio_data_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int cxt_gpio_data_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long *valp = ucontrol->value.integer.value;
+ unsigned int val = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_GPIO_DATA, 0x00);
+
+ *valp = (val & mask) != 0;
+ return 0;
+}
+
+static int cxt_gpio_data_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ signed int change;
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long val = *ucontrol->value.integer.value;
+ unsigned int gpio_data = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_GPIO_DATA,
+ 0x00);
+
+ /* Set/unset the masked GPIO bit(s) as needed */
+ change = (val == 0 ? 0 : mask) != (gpio_data & mask);
+ if (val == 0)
+ gpio_data &= ~mask;
+ else
+ gpio_data |= mask;
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_GPIO_DATA, gpio_data);
+
+ return change;
+}
+
+#define CXT_GPIO_DATA_SWITCH(xname, nid, mask) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = cxt_gpio_data_info, \
+ .get = cxt_gpio_data_get, \
+ .put = cxt_gpio_data_put, \
+ .private_value = nid | (mask<<16) }
+
+static int cxt_spdif_ctrl_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int cxt_spdif_ctrl_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long *valp = ucontrol->value.integer.value;
+ unsigned int val = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_DIGI_CONVERT, 0x00);
+
+ *valp = (val & mask) != 0;
+ return 0;
+}
+
+static int cxt_spdif_ctrl_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ signed int change;
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long val = *ucontrol->value.integer.value;
+ unsigned int ctrl_data = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_DIGI_CONVERT,
+ 0x00);
+
+ /* Set/unset the masked control bit(s) as needed */
+ change = (val == 0 ? 0 : mask) != (ctrl_data & mask);
+ if (val==0)
+ ctrl_data &= ~mask;
+ else
+ ctrl_data |= mask;
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
+ ctrl_data);
+
+ return change;
+}
+
+#define CXT_SPDIF_CTRL_SWITCH(xname, nid, mask) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = cxt_spdif_ctrl_info, \
+ .get = cxt_spdif_ctrl_get, \
+ .put = cxt_spdif_ctrl_put, \
+ .private_value = nid | (mask<<16) }
+
+/* Conexant 5045 specific */
+
+static hda_nid_t cxt5045_dac_nids[1] = { 0x10 };
+static hda_nid_t cxt5045_adc_nids[1] = { 0x1a };
+static hda_nid_t cxt5045_capsrc_nids[1] = { 0x1a };
+#define CXT5045_SPDIF_OUT 0x13
+
+
+static struct hda_input_mux cxt5045_capture_source = {
+ .num_items = 1,
+ .items = {
+ { "ExtMic", 0x1 },
+ }
+};
+
+/* turn on/off EAPD (+ mute HP) as a master switch */
+static int cxt5045_hp_master_sw_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+
+ if (! conexant_eapd_put(kcontrol, ucontrol))
+ return 0;
+
+ /* toggle HP mute appropriately */
+ snd_hda_codec_amp_update(codec, 0x11, 0, HDA_OUTPUT, 0,
+ 0x80, spec->cur_eapd ? 0 : 0x80);
+ snd_hda_codec_amp_update(codec, 0x11, 1, HDA_OUTPUT, 0,
+ 0x80, spec->cur_eapd ? 0 : 0x80);
+ return 1;
+}
+
+/* bind volumes of both NID 0x10 and 0x11 */
+static int cxt5045_hp_master_vol_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ long *valp = ucontrol->value.integer.value;
+ int change;
+
+ change = snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0,
+ 0x7f, valp[0] & 0x7f);
+ change |= snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0,
+ 0x7f, valp[1] & 0x7f);
+ snd_hda_codec_amp_update(codec, 0x11, 0, HDA_OUTPUT, 0,
+ 0x7f, valp[0] & 0x7f);
+ snd_hda_codec_amp_update(codec, 0x11, 1, HDA_OUTPUT, 0,
+ 0x7f, valp[1] & 0x7f);
+ return change;
+}
+
+
+/* mute internal speaker if HP is plugged */
+static void cxt5045_hp_automute(struct hda_codec *codec)
+{
+ unsigned int present;
+
+ present = snd_hda_codec_read(codec, 0x11, 0,
+ AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+ snd_hda_codec_amp_update(codec, 0x10, 0, HDA_OUTPUT, 0,
+ 0x80, present ? 0x80 : 0);
+ snd_hda_codec_amp_update(codec, 0x10, 1, HDA_OUTPUT, 0,
+ 0x80, present ? 0x80 : 0);
+}
+
+/* unsolicited event for HP jack sensing */
+static void cxt5045_hp_unsol_event(struct hda_codec *codec,
+ unsigned int res)
+{
+ res >>= 26;
+ switch (res) {
+ case CONEXANT_HP_EVENT:
+ cxt5045_hp_automute(codec);
+ break;
+ }
+}
+
+static struct snd_kcontrol_new cxt5045_mixers[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put
+ },
+ HDA_CODEC_VOLUME("Mic Bypass Capture Volume",0x17,0x02,HDA_INPUT),
+ HDA_CODEC_MUTE("Mic Bypass Capture Switch",0x17,0x02,HDA_INPUT),
+ HDA_CODEC_VOLUME("Capture Volume",0x1a,0x03,HDA_INPUT),
+ HDA_CODEC_MUTE("Capture Switch",0x1a,0x03,HDA_INPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Master Playback Volume",
+ .info = snd_hda_mixer_amp_volume_info,
+ .get = snd_hda_mixer_amp_volume_get,
+ .put = cxt5045_hp_master_vol_put,
+ .private_value = HDA_COMPOSE_AMP_VAL(0x11, 3, 0, HDA_OUTPUT),
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Master Playback Switch",
+ .info = conexant_eapd_info,
+ .get = conexant_eapd_get,
+ .put = cxt5045_hp_master_sw_put,
+ .private_value = 0x11,
+ },
+
+ {}
+};
+
+static struct hda_verb cxt5045_init_verbs[] = {
+ /* Line in, Mic */
+ {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
+ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
+ /* HP, Amp */
+ {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
+ {0x1A, AC_VERB_SET_CONNECT_SEL,0x01},
+ {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00},
+ {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03},
+ /* Record selector: Front mic */
+ {0x14, AC_VERB_SET_CONNECT_SEL,0x03},
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
+ /* SPDIF route: PCM */
+ { 0x13, AC_VERB_SET_CONNECT_SEL, 0x0 },
+ /* pin sensing on HP and Mic jacks */
+ {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
+ { } /* end */
+};
+
+/* Test configuration for debugging, modelled after the ALC260 test
+ * configuration.
+ */
+#ifdef CONFIG_SND_DEBUG
+static struct hda_input_mux cxt5045_test_capture_source = {
+ .num_items = 5,
+ .items = {
+ { "MIXER", 0x0 },
+ { "LINE1 pin", 0x1 },
+ { "MIC1 pin", 0x2 },
+ { "CD pin", 0x3 },
+ { "HP-OUT pin", 0x4 },
+ },
+};
+
+static struct snd_kcontrol_new cxt5045_test_mixer[] = {
+
+ /* Modes for retasking pin widgets */
+ CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT),
+ CXT_PIN_MODE("LINE1 pin mode", 0x12, CXT_PIN_DIR_INOUT),
+
+ /* Loopback mixer controls */
+ HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x17, 0x00, HDA_INPUT),
+ HDA_CODEC_MUTE("MIC1 Playback Switch", 0x17, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x17, 0x01, HDA_INPUT),
+ HDA_CODEC_MUTE("MIC2 Playback Switch", 0x17, 0x01, HDA_INPUT),
+ HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x17, 0x03, HDA_INPUT),
+ HDA_CODEC_MUTE("LINE2 Playback Switch", 0x17, 0x03, HDA_INPUT),
+ HDA_CODEC_VOLUME("CD Playback Volume", 0x17, 0x04, HDA_INPUT),
+ HDA_CODEC_MUTE("CD Playback Switch", 0x17, 0x04, HDA_INPUT),
+ HDA_CODEC_VOLUME("Beep Playback Volume", 0x17, 0x05, HDA_INPUT),
+ HDA_CODEC_MUTE("Beep Playback Switch", 0x17, 0x05, HDA_INPUT),
+ HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x17, 0x06, HDA_INPUT),
+ HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x17, 0x06, HDA_INPUT),
+ HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x17, 0x07, HDA_INPUT),
+ HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x17, 0x07, HDA_INPUT),
+
+ /* Controls for GPIO pins, assuming they exist and are configured as outputs */
+ CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
+#if 0 /* limit this to one GPIO pin for now */
+ CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
+#endif
+ CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x13, 0x01),
+
+ HDA_CODEC_VOLUME("Capture Volume", 0x17, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("Capture Switch", 0x17, 0x0, HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Input Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put,
+ },
+
+ { } /* end */
+};
+
+static struct hda_verb cxt5045_test_init_verbs[] = {
+ /* Enable all GPIOs as outputs with an initial value of 0 */
+ {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
+ {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
+ {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
+
+ /* Enable retasking pins as output, initially without power amp */
+ {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+ {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+
+ /* Disable digital (SPDIF) pins initially, but users can enable
+ * them via a mixer switch. In the case of SPDIF-out, this initverb
+ * payload also sets the generation to 0, output to be in "consumer"
+ * PCM format, copyright asserted, no pre-emphasis and no validity
+ * control.
+ */
+ {0x13, AC_VERB_SET_DIGI_CONVERT_1, 0},
+
+ /* Start with output sum widgets muted and their output gains at min */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+
+ /* Unmute retasking pin widget output buffers since the default
+ * state appears to be output. As the pin mode is changed by the
+ * user the pin mode control will take care of enabling the pin's
+ * input/output buffers as needed.
+ */
+ {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+ {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+
+ /* Mute capture amp left and right */
+ {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+
+ /* Set ADC connection select to match default mixer setting (mic1
+ * pin)
+ */
+ {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
+
+ /* Mute all inputs to mixer widget (even unconnected ones) */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
+
+ { }
+};
+#endif
+
+
+/* initialize jack-sensing, too */
+static int cxt5045_init(struct hda_codec *codec)
+{
+ conexant_init(codec);
+ cxt5045_hp_automute(codec);
+ return 0;
+}
+
+
+enum { CXT5045_LAPTOP,
+#ifdef CONFIG_SND_DEBUG
+ CXT5045_TEST,
+#endif
+ };
+
+static struct hda_board_config cxt5045_cfg_tbl[] = {
+ /* Laptops w/o EAPD support */
+ { .modelname = "laptop", .config = CXT5045_LAPTOP },
+ /* HP DV6000Z */
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b7,
+ .config = CXT5045_LAPTOP },
+#ifdef CONFIG_SND_DEBUG
+ { .modelname = "test", .config = CXT5045_TEST },
+#endif
+
+ {}
+};
+
+static int patch_cxt5045(struct hda_codec *codec) {
+ struct conexant_spec *spec;
+ int board_config;
+
+ spec = kzalloc(sizeof(*spec), GFP_KERNEL);
+ if ( !spec )
+ return -ENOMEM;
+ mutex_init(&spec->amp_mutex);
+ codec->spec = spec;
+
+ spec->multiout.max_channels = 2;
+ spec->multiout.num_dacs = ARRAY_SIZE(cxt5045_dac_nids);
+ spec->multiout.dac_nids = cxt5045_dac_nids;
+ spec->multiout.dig_out_nid = CXT5045_SPDIF_OUT;
+ spec->num_adc_nids = 1;
+ spec->adc_nids = cxt5045_adc_nids;
+ spec->capsrc_nids = cxt5045_capsrc_nids;
+ spec->input_mux = &cxt5045_capture_source;
+ spec->num_mixers = 1;
+ spec->mixers[0] = cxt5045_mixers;
+ spec->num_init_verbs = 1;
+ spec->init_verbs[0] = cxt5045_init_verbs;
+ spec->spdif_route = 0;
+
+ codec->patch_ops = conexant_patch_ops;
+ codec->patch_ops.unsol_event = cxt5045_hp_unsol_event;
+
+ board_config = snd_hda_check_board_config(codec, cxt5045_cfg_tbl);
+ switch (board_config) {
+ case CXT5045_LAPTOP:
+ spec->input_mux = &cxt5045_capture_source;
+ spec->num_init_verbs = 2;
+ spec->init_verbs[1] = cxt5045_init_verbs;
+ spec->mixers[0] = cxt5045_mixers;
+ codec->patch_ops.init = cxt5045_init;
+ break;
+#ifdef CONFIG_SND_DEBUG
+ case CXT5045_TEST:
+ spec->input_mux = &cxt5045_test_capture_source;
+ spec->mixers[0] = cxt5045_test_mixer;
+ spec->init_verbs[0] = cxt5045_test_init_verbs;
+#endif
+ }
+ return 0;
+}
+
+
+/* Conexant 5047 specific */
+
+static hda_nid_t cxt5047_dac_nids[1] = { 0x10 };
+static hda_nid_t cxt5047_adc_nids[1] = { 0x12 };
+static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a };
+#define CXT5047_SPDIF_OUT 0x11
+
+
+static struct hda_input_mux cxt5047_capture_source = {
+ .num_items = 2,
+ .items = {
+ { "ExtMic", 0x1 },
+ { "IntMic", 0x2 },
+ }
+};
+
+static struct hda_input_mux cxt5047_hp_capture_source = {
+ .num_items = 1,
+ .items = {
+ { "ExtMic", 0x1 },
+ }
+};
+
+/* turn on/off EAPD (+ mute HP) as a master switch */
+static int cxt5047_hp_master_sw_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+
+ if (! conexant_eapd_put(kcontrol, ucontrol))
+ return 0;
+
+ /* toggle HP mute appropriately */
+ snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0,
+ 0x80, spec->cur_eapd ? 0 : 0x80);
+ snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0,
+ 0x80, spec->cur_eapd ? 0 : 0x80);
+ return 1;
+}
+
+#if 0
+/* bind volumes of both NID 0x13 and 0x1d */
+static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ long *valp = ucontrol->value.integer.value;
+ int change;
+
+ change = snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0,
+ 0x7f, valp[0] & 0x7f);
+ change |= snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0,
+ 0x7f, valp[1] & 0x7f);
+ snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0,
+ 0x7f, valp[0] & 0x7f);
+ snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0,
+ 0x7f, valp[1] & 0x7f);
+ return change;
+}
+#endif
+
+/* mute internal speaker if HP is plugged */
+static void cxt5047_hp_automute(struct hda_codec *codec)
+{
+ unsigned int present;
+
+ present = snd_hda_codec_read(codec, 0x13, 0,
+ AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+ snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0,
+ 0x80, present ? 0x80 : 0);
+ snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0,
+ 0x80, present ? 0x80 : 0);
+}
+
+/* toggle input of built-in and mic jack appropriately */
+static void cxt5047_hp_automic(struct hda_codec *codec)
+{
+ static struct hda_verb mic_jack_on[] = {
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ {}
+ };
+ static struct hda_verb mic_jack_off[] = {
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ {}
+ };
+ unsigned int present;
+
+ present = snd_hda_codec_read(codec, 0x08, 0,
+ AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+ if (present)
+ snd_hda_sequence_write(codec, mic_jack_on);
+ else
+ snd_hda_sequence_write(codec, mic_jack_off);
+}
+
+/* unsolicited event for HP jack sensing */
+static void cxt5047_hp_unsol_event(struct hda_codec *codec,
+ unsigned int res)
+{
+ res >>= 26;
+ switch (res) {
+ case CONEXANT_HP_EVENT:
+ cxt5047_hp_automute(codec);
+ break;
+ case CONEXANT_MIC_EVENT:
+ cxt5047_hp_automic(codec);
+ break;
+ }
+}
+
+static struct snd_kcontrol_new cxt5047_mixers[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put
+ },
+ HDA_CODEC_VOLUME("Mic Bypass Capture Volume",0x19,0x02,HDA_INPUT),
+ HDA_CODEC_MUTE("Mic Bypass Capture Switch",0x19,0x02,HDA_INPUT),
+ HDA_CODEC_VOLUME("Capture Volume",0x12,0x03,HDA_INPUT),
+ HDA_CODEC_MUTE("Capture Switch",0x12,0x03,HDA_INPUT),
+ HDA_CODEC_VOLUME("PCM Volume",0x10,0x00,HDA_OUTPUT),
+ HDA_CODEC_MUTE("PCM Switch",0x10,0x00,HDA_OUTPUT),
+ HDA_CODEC_VOLUME("Master Playback Volume",0x13,0x00,HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Master Playback Switch",
+ .info = conexant_eapd_info,
+ .get = conexant_eapd_get,
+ .put = cxt5047_hp_master_sw_put,
+ .private_value = 0x13,
+ },
+
+ {}
+};
+
+static struct snd_kcontrol_new cxt5047_hp_mixers[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put
+ },
+ HDA_CODEC_VOLUME("Mic Bypass Capture Volume",0x19,0x02,HDA_INPUT),
+ HDA_CODEC_MUTE("Mic Bypass Capture Switch",0x19,0x02,HDA_INPUT),
+ HDA_CODEC_VOLUME("Capture Volume",0x12,0x03,HDA_INPUT),
+ HDA_CODEC_MUTE("Capture Switch",0x12,0x03,HDA_INPUT),
+ HDA_CODEC_VOLUME("PCM Volume",0x10,0x00,HDA_OUTPUT),
+ HDA_CODEC_MUTE("PCM Switch",0x10,0x00,HDA_OUTPUT),
+ HDA_CODEC_VOLUME("Master Playback Volume",0x13,0x00,HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Master Playback Switch",
+ .info = conexant_eapd_info,
+ .get = conexant_eapd_get,
+ .put = cxt5047_hp_master_sw_put,
+ .private_value = 0x13,
+ },
+ { } /* end */
+};
+
+static struct hda_verb cxt5047_init_verbs[] = {
+ /* Line in, Mic, Built-in Mic */
+ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
+ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
+ {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
+ /* HP, Amp */
+ {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
+ {0x1A, AC_VERB_SET_CONNECT_SEL,0x01},
+ {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00},
+ {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03},
+ /* Record selector: Front mic */
+ {0x12, AC_VERB_SET_CONNECT_SEL,0x03},
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
+ /* SPDIF route: PCM */
+ { 0x18, AC_VERB_SET_CONNECT_SEL, 0x0 },
+ { } /* end */
+};
+
+/* configuration for Toshiba Laptops */
+static struct hda_verb cxt5047_toshiba_init_verbs[] = {
+ {0x13, AC_VERB_SET_EAPD_BTLENABLE, 0x0 }, /* default on */
+ /* pin sensing on HP and Mic jacks */
+ {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
+ {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT},
+ {}
+};
+
+/* configuration for HP Laptops */
+static struct hda_verb cxt5047_hp_init_verbs[] = {
+ /* pin sensing on HP and Mic jacks */
+ {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT},
+ {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT},
+ {}
+};
+/* Test configuration for debugging, modelled after the ALC260 test
+ * configuration.
+ */
+#ifdef CONFIG_SND_DEBUG
+static struct hda_input_mux cxt5047_test_capture_source = {
+ .num_items = 6,
+ .items = {
+ { "MIXER", 0x0 },
+ { "LINE1 pin", 0x1 },
+ { "MIC1 pin", 0x2 },
+ { "MIC2 pin", 0x3 },
+ { "CD pin", 0x4 },
+ { "HP-OUT pin", 0x5 },
+ },
+};
+
+#define CXT_PIN_MODE(xname, nid, dir) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = conexant_ch_mode_info, \
+ .get = conexant_ch_mode_get, \
+ .put = conexant_ch_mode_put, \
+ .private_value = nid | (dir<<16) }
+
+static struct snd_kcontrol_new cxt5047_test_mixer[] = {
+
+ /* Modes for retasking pin widgets */
+ CXT_PIN_MODE("HP-OUT pin mode", 0x13, CXT_PIN_DIR_INOUT),
+ CXT_PIN_MODE("LINE1 pin mode", 0x14, CXT_PIN_DIR_INOUT),
+ CXT_PIN_MODE("MIC1 pin mode", 0x15, CXT_PIN_DIR_INOUT),
+
+ /* Loopback mixer controls */
+ HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x19, 0x00, HDA_INPUT),
+ HDA_CODEC_MUTE("MIC1 Playback Switch", 0x19, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x19, 0x01, HDA_INPUT),
+ HDA_CODEC_MUTE("MIC2 Playback Switch", 0x19, 0x01, HDA_INPUT),
+ HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x19, 0x03, HDA_INPUT),
+ HDA_CODEC_MUTE("LINE2 Playback Switch", 0x19, 0x03, HDA_INPUT),
+ HDA_CODEC_VOLUME("CD Playback Volume", 0x19, 0x04, HDA_INPUT),
+ HDA_CODEC_MUTE("CD Playback Switch", 0x19, 0x04, HDA_INPUT),
+ HDA_CODEC_VOLUME("Beep Playback Volume", 0x19, 0x05, HDA_INPUT),
+ HDA_CODEC_MUTE("Beep Playback Switch", 0x19, 0x05, HDA_INPUT),
+ HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x19, 0x06, HDA_INPUT),
+ HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x19, 0x06, HDA_INPUT),
+ HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x19, 0x07, HDA_INPUT),
+ HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x19, 0x07, HDA_INPUT),
+
+ /* Controls for GPIO pins, assuming they exist and are configured as outputs */
+ CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
+#if 0 /* limit this to one GPIO pin for now */
+ CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
+#endif
+ CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x18, 0x01),
+
+ HDA_CODEC_VOLUME("Capture Volume", 0x19, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("Capture Switch", 0x19, 0x0, HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Input Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put,
+ },
+
+ { } /* end */
+};
+
+static struct hda_verb cxt5047_test_init_verbs[] = {
+ /* Enable all GPIOs as outputs with an initial value of 0 */
+ {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
+ {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
+ {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
+
+ /* Enable retasking pins as output, initially without power amp */
+ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+ {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+
+ /* Disable digital (SPDIF) pins initially, but users can enable
+ * them via a mixer switch. In the case of SPDIF-out, this initverb
+ * payload also sets the generation to 0, output to be in "consumer"
+ * PCM format, copyright asserted, no pre-emphasis and no validity
+ * control.
+ */
+ {0x18, AC_VERB_SET_DIGI_CONVERT_1, 0},
+
+ /* Ensure mic1, mic2, line1 pin widgets take input from the
+ * OUT1 sum bus when acting as an output.
+ */
+ {0x1a, AC_VERB_SET_CONNECT_SEL, 0},
+ {0x1b, AC_VERB_SET_CONNECT_SEL, 0},
+
+ /* Start with output sum widgets muted and their output gains at min */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+
+ /* Unmute retasking pin widget output buffers since the default
+ * state appears to be output. As the pin mode is changed by the
+ * user the pin mode control will take care of enabling the pin's
+ * input/output buffers as needed.
+ */
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+ {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+ {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+
+ /* Mute capture amp left and right */
+ {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+
+ /* Set ADC connection select to match default mixer setting (mic1
+ * pin)
+ */
+ {0x12, AC_VERB_SET_CONNECT_SEL, 0x00},
+
+ /* Mute all inputs to mixer widget (even unconnected ones) */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
+
+ { }
+};
+#endif
+
+
+/* initialize jack-sensing, too */
+static int cxt5047_hp_init(struct hda_codec *codec)
+{
+ conexant_init(codec);
+ cxt5047_hp_automute(codec);
+ cxt5047_hp_automic(codec);
+ return 0;
+}
+
+
+enum { CXT5047_LAPTOP,
+#ifdef CONFIG_SND_DEBUG
+ CXT5047_TEST,
+#endif
+ CXT5047_LAPTOP_HP,
+ CXT5047_LAPTOP_EAPD };
+
+static struct hda_board_config cxt5047_cfg_tbl[] = {
+ /* Laptops w/o EAPD support */
+ { .modelname = "laptop", .config = CXT5047_LAPTOP },
+ /*HP DV1000 */
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a0,
+ .config = CXT5047_LAPTOP },
+ /*HP DV2000T/DV3000T */
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b2,
+ .config = CXT5047_LAPTOP },
+ /* Not all HP's are created equal */
+ { .modelname = "laptop-hp", .config = CXT5047_LAPTOP_HP },
+ /*HP DV5200TX/DV8000T / Compaq V5209US/V5204NR */
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a5,
+ .config = CXT5047_LAPTOP_HP },
+ /* Laptops with EAPD support */
+ { .modelname = "laptop-eapd", .config = CXT5047_LAPTOP_EAPD },
+ { .pci_subvendor = 0x1179, .pci_subdevice = 0xff31,
+ .config = CXT5047_LAPTOP_EAPD }, /* Toshiba P100 */
+#ifdef CONFIG_SND_DEBUG
+ { .modelname = "test", .config = CXT5047_TEST },
+#endif
+
+ {}
+};
+
+static int patch_cxt5047(struct hda_codec *codec) {
+ struct conexant_spec *spec;
+ int board_config;
+
+ spec = kzalloc(sizeof(*spec), GFP_KERNEL);
+ if ( !spec )
+ return -ENOMEM;
+ mutex_init(&spec->amp_mutex);
+ codec->spec = spec;
+
+ spec->multiout.max_channels = 2;
+ spec->multiout.num_dacs = ARRAY_SIZE(cxt5047_dac_nids);
+ spec->multiout.dac_nids = cxt5047_dac_nids;
+ spec->multiout.dig_out_nid = CXT5047_SPDIF_OUT;
+ spec->num_adc_nids = 1;
+ spec->adc_nids = cxt5047_adc_nids;
+ spec->capsrc_nids = cxt5047_capsrc_nids;
+ spec->input_mux = &cxt5047_capture_source;
+ spec->num_mixers = 1;
+ spec->mixers[0] = cxt5047_mixers;
+ spec->num_init_verbs = 1;
+ spec->init_verbs[0] = cxt5047_init_verbs;
+ spec->spdif_route = 0;
+
+ codec->patch_ops = conexant_patch_ops;
+ codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
+
+ board_config = snd_hda_check_board_config(codec, cxt5047_cfg_tbl);
+ switch (board_config) {
+ case CXT5047_LAPTOP:
+ break;
+ case CXT5047_LAPTOP_HP:
+ spec->input_mux = &cxt5047_hp_capture_source;
+ spec->num_init_verbs = 2;
+ spec->init_verbs[1] = cxt5047_hp_init_verbs;
+ spec->mixers[0] = cxt5047_hp_mixers;
+ codec->patch_ops.init = cxt5047_hp_init;
+ break;
+ case CXT5047_LAPTOP_EAPD:
+ spec->num_init_verbs = 2;
+ spec->init_verbs[1] = cxt5047_toshiba_init_verbs;
+ break;
+#ifdef CONFIG_SND_DEBUG
+ case CXT5047_TEST:
+ spec->input_mux = &cxt5047_test_capture_source;
+ spec->mixers[0] = cxt5047_test_mixer;
+ spec->init_verbs[0] = cxt5047_test_init_verbs;
+#endif
+ }
+ return 0;
+}
+
+struct hda_codec_preset snd_hda_preset_conexant[] = {
+ { .id = 0x14f15045, .name = "CXT5045", .patch = patch_cxt5045 },
+ { .id = 0x14f15047, .name = "CXT5047", .patch = patch_cxt5047 },
+ {} /* terminator */
+};
[-- Attachment #3: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Conexant test code.
2006-11-04 9:52 Conexant test code Tobin Davis
@ 2006-11-04 12:35 ` Konstantin Shaposhnikov
2006-11-04 18:05 ` Guyjo91
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Konstantin Shaposhnikov @ 2006-11-04 12:35 UTC (permalink / raw)
To: Tobin Davis; +Cc: alsa-devel
Hi Tobin,
Below you can find results of my testing of conexant test patch 8.
Model: HP pavilion DV2000
Subsystem: 103c:30b2
Sound and internal microphone is working (as with previous patch)
I've alsa noticed following strange behaviour of alsamixer: the first control
named "Master" (in previous patches it was named "Headphones") affects only
sound in headphones, sound in internal speakers can be modfied only by
changing value of PCM control. PCM affects both headphones and internal
speaker.
>From other side DV2000 has LED button to mute sound, when I mute "Master"
control this LED is glowing orange inicating that sound is muted (but actually
sound muted only in headphones).
Unfortunately I can not test patch with model=test. Alsamixer can not be
started and prints following error:
alsamixer: function snd_mixer_load failed: Invalid argument
At the same time dmesg says:
hda_codec: num_steps = 0 for NID=0x19
When I try to execute following command (from init scripts):
alsactl -f asound.state store
I get "unable to handle kernel paging request" error:
BUG: unable to handle kernel paging request at virtual address fffffff8
printing eip:
f8cc4714
*pde = 00004067
*pte = 00000000
Oops: 0000 [#1]
SMP
Modules linked in: snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
snd_pcm_oss snd_mixer_oss snd_hda_intel snd_hda_codec snd_pcm snd_timer snd
soundcore snd_page_alloc ohci1394 e100 nvidia i2c_core ntfs ipw3945 ieee80211
ieee80211_crypt firmware_class joydev
CPU: 1
EIP: 0060:[<f8cc4714>] Tainted: PF VLI
EFLAGS: 00010296 (2.6.18-suspend2 #5)
EIP is at snd_hda_ch_mode_info+0x24/0x50 [snd_hda_codec]
eax: ffffffff ebx: 00000000 ecx: 00000000 edx: f50dbe04
esi: f74a3140 edi: c1105511 ebp: f6f49014 esp: f50dbdb4
ds: 007b es: 007b ss: 0068
Process alsactl (pid: 31485, ti=f50da000 task=c266ba90 task.ti=f50da000)
Stack: 00000000 f6f49014 f6f49014 f8ccfec8 00000000 f7a5cb54 f88ee5a7
f50dbe1c f57766c0 f50dbf34 c108ae93 f50dbe04 bff5cab0 f6ed9254
00000000 f88fb000 00000000 f6bd7408 f6f49160 f6f49160 00000001
00000002 00000000 00000000
Call Trace:
[<f8ccfec8>] conexant_ch_mode_info+0x18/0x20 [snd_hda_codec]
[<f88ee5a7>] snd_ctl_ioctl+0x4e7/0xb50 [snd]
[<c108f85b>] do_ioctl+0x2b/0x90
[<c108f91c>] vfs_ioctl+0x5c/0x2b0
[<c108fbad>] sys_ioctl+0x3d/0x70
[<c100311d>] sysenter_past_esp+0x56/0x79
[<b7f80410>] 0xb7f80410
Code: 8d bc 27 00 00 00 00 83 ec 0c 8b 44 24 10 3b 42 54
c7 42 40 03 00 00 00 c7 42 48 01 00 00 00 89 42 50 77 04
48 89 42 54 8b 42 54 <8b> 04 c1 89 44 24 08 b8 38 1f cd
f8 89 44 24 04 8d 42 58 89 04
EIP: [<f8cc4714>] snd_hda_ch_mode_info+0x24/0x50 [snd_hda_codec]
SS:ESP 0068:f50dbdb4
Regards,
Konstantin
On 11/4/06, Tobin Davis <tdavis@dsl-only.net> wrote:
> Here's test release 8. Changes of significance:
>
> Preliminary Conexant 5045 support
> Preliminary HP DV6000 series support.
> Preliminary test mode (when compiled with debugging).
>
> Separation of Conexant 5047 support models
> HP DV1000/2000/3000 series split from 5000/8000 series due to
> implementation differences. No change on HP muting speakers
> (still need to figure this one out).
> HP DV5000/8000 series/Compaq V5209US/V5204NR series
> Headphone mutes speakers ok (same as test7).
> Removed Internal Microphone from mixer.
> Toshiba P100 series
> changed EAPD default. Hopefully this triggers audio.
> Code changes to "test" model.
> Adjusted Mic gains (I think).
>
> Areas to test:
> 5045 series - everything.
> 5047 series
> HP DV1/2/3000 series - try test mode and start toggling
> controls until speakers are muted and headphones work.
> Report findings.
> HP 5000/8000 series - make sure I didn't break things.
> Test recording.
> Toshiba - everything.
>
> For the new testers in the group, here's the instructions:
>
> wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.13.tar.bz2
> tar -jxf alsa-driver-1.0.13.tar.bz2
> cd alsa-driver-1.0.13
> ./configure --with-debug=full --with-cards=hda-intel
> patch -p1 <conexant-test8.patch
> make ; make install
> dmesg -c
>
> Stop all audio applications and remove all audio drivers (lsmod |fgrep
> snd). Reload the new driver with "modprobe snd-hda-intel" and test it
> out. Use alsamixer to report any mixer issues (easier to debug than
> kmix/gmix, whatever-gui-mixer). If nothing works, or one function
> doesn't work, try reloading the driver with "model=test" as a parameter.
> This should enable everything.
>
> Send me your test results. Please include the system make/model, the
> subsystem line from "lspci -s 0:1b -vn" (Ex: Subsystem: 103c:30b2), and
> the output from "cat /proc/asound/card0/codec#0".
> I need this for tracking what works on what systems.
>
> Thanks for helping test this new driver.
>
> --
> Tobin Davis <tdavis@dsl-only.net>
>
>
>
--
http://step-inside.org
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Conexant test code.
2006-11-04 9:52 Conexant test code Tobin Davis
2006-11-04 12:35 ` Konstantin Shaposhnikov
@ 2006-11-04 18:05 ` Guyjo91
2006-11-04 23:55 ` Anders
2006-11-05 13:45 ` Matthew Strahan
3 siblings, 0 replies; 11+ messages in thread
From: Guyjo91 @ 2006-11-04 18:05 UTC (permalink / raw)
To: Tobin Davis; +Cc: alsa-devel
Hi Tobin,
Here are the results of Patch 8 test: ========> No sound :-(
Model: Toshiba Satellite P100-114
Subsystem: 1179:ff31
Alsamixer shows:
- Master: ok
- PCM: ok
- Mic Bypass: ok
- IEC958: Just the mute/unmute case
- Capture: ok
- ExtMic: nothing
- IntMic: nothing
# cat /proc/asound/card0/codec#0
Codec: Conexant CXT5047
Address: 0
Vendor Id: 0x14f15047
Subsystem Id: 0x1179ff31
Revision Id: 0x100000
Default PCM: rates 0x040, bits 0x02, types 0x1
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x10 [Audio Output] wcaps 0x41d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1e 0x1e]
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Node 0x11 [Audio Output] wcaps 0x611: Stereo Digital
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Node 0x12 [Audio Input] wcaps 0x100d1b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x0e, stepsize=0x05, mute=1
Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x0e 0x0e] [0x80
0x80] [0x80 0x80]
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Connection: 6
0x19 0x14 0x15 0x1a* 0x16 0x10
Node 0x13 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1e 0x1e]
Pincap 0x081001c: OUT HP EAPD Detect
Pin Default 0xc3111010: [Both] Speaker at Ext Left
Conn = 1/8, Color = Black
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 3
0x19* 0x10 0x16
Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1f 0x1f]
Pincap 0x0833c: IN OUT HP Detect
Pin Default 0x03811011: [Jack] Line In at Ext Left
Conn = 1/8, Color = Black
Pin-ctls: 0x20: IN
Power: 0x0
Connection: 2
0x19* 0x16
Node 0x15 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1f 0x1f]
Pincap 0x0833c: IN OUT HP Detect
Pin Default 0x03a11012: [Jack] Mic at Ext Left
Conn = 1/8, Color = Black
Pin-ctls: 0x21: IN
Power: 0x0
Connection: 3
0x1c 0x19* 0x16
Node 0x16 [Pin Complex] wcaps 0x400401: Stereo
Pincap 0x0860: IN
Pin Default 0x99330100: [Fixed] CD at Int ATAPI
Conn = ATAPI, Color = Unknown
Pin-ctls: 0x20: IN
Power: 0x0
Node 0x17 [Pin Complex] wcaps 0x400481: Stereo
Pincap 0x08324: IN Detect
Pin Default 0xb7a00100: [Fixed] Mic at Oth Mobile-In
Conn = Unknown, Color = Unknown
Pin-ctls: 0x21: IN
Power: 0x0
Node 0x18 [Pin Complex] wcaps 0x400701: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x21440100: [Jack] SPDIF Out at Sep Rear
Conn = RCA, Color = Unknown
Pin-ctls: 0x00:
Power: 0x0
Connection: 1
0x11
Node 0x19 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
Amp-In caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
Amp-In vals: [0x17 0x17] [0x80 0x80] [0x00 0x00] [0x17 0x17]
Power: 0x0
Connection: 4
0x10 0x1b 0x1a 0x16
Node 0x1a [Audio Selector] wcaps 0x30050d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x1f, mute=0
Amp-Out vals: [0x03 0x03]
Power: 0x0
Connection: 3
0x15 0x14* 0x17
Node 0x1b [Audio Selector] wcaps 0x300501: Stereo
Power: 0x0
Connection: 2
0x14* 0x15
Node 0x1c [Audio Output] wcaps 0x41d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x80 0x80]
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Node 0x1d [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1f 0x1f]
Pincap 0x08314: OUT Detect
Pin Default 0x90100112: [Fixed] Speaker at Int N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 3
0x1c 0x19* 0x16
Node 0x1e [Vendor Defined Widget] wcaps 0xf00000: Mono
Thank's for your work !
Guy-jo.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Conexant test code.
2006-11-04 9:52 Conexant test code Tobin Davis
2006-11-04 12:35 ` Konstantin Shaposhnikov
2006-11-04 18:05 ` Guyjo91
@ 2006-11-04 23:55 ` Anders
2006-11-05 13:45 ` Matthew Strahan
3 siblings, 0 replies; 11+ messages in thread
From: Anders @ 2006-11-04 23:55 UTC (permalink / raw)
To: alsa-devel
Conexant 5047, HP DV3000.
Only difference I see from patch 7 is Headphone mixer is renamed to Main.
Same issues with headphones not muting speakers and scratchy sound.
I'd like to try model=test, but I still get a bunch of Unknown symbols and
unknown parameter model. Am I doing something wrong? Need to compile a kernel
with debugging enabled? I am using ./configure --with-debug=full
--with-cards=hda-intel
lspci -s 0:1b -vn
00:1b.0 0403: 8086:27d8 (rev 02)
Subsystem: 103c:30b2
Flags: bus master, fast devsel, latency 0, IRQ 74
Memory at d4340000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable+
Capabilities: [70] Express Unknown type IRQ 0
Capabilities: [100] Virtual Channel
Capabilities: [130] Unknown (5)
root@anders-laptop:~/Desktop/alsa/alsa-driver-1.0.13# modprobe snd-hda-intel
root@anders-laptop:~/Desktop/alsa/alsa-driver-1.0.13# dmesg
[17182639.584000] ACPI: PCI interrupt for device 0000:00:1b.0 disabled
[17182653.732000] ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) ->
IRQ 66
[17182653.732000] PCI: Setting latency timer of device 0000:00:1b.0 to 64
[17182654.888000] ALSA
/home/anders/Desktop/alsa/alsa-driver-1.0.13/pci/hda/\
../../alsa-kernel/pci/hda/hda_intel.c:540:
hda_intel: azx_get_response timeout, switching to polling mode...
root@anders-laptop:~/Desktop/alsa/alsa-driver-1.0.13# /etc/init.d/alsasound
stop; dmesg -c; modprobe snd-hda-intel model=test
Shutting down sound driver: done
[17182639.584000] ACPI: PCI interrupt for device 0000:00:1b.0 disabled
[17182653.732000] ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) ->
IRQ 66
[17182653.732000] PCI: Setting latency timer of device 0000:00:1b.0 to 64
[17182654.888000] ALSA
/home/anders/Desktop/alsa/alsa-driver-1.0.13/pci/hda/\
../../alsa-kernel/pci/hda/hda_intel.c:540:
hda_intel: azx_get_response timeout, switching to polling mode...
[17182741.976000] ACPI: PCI interrupt for device 0000:00:1b.0 disabled
FATAL: Error inserting snd
(/lib/modules/2.6.17-10-generic/kernel/sound/acore/snd.ko): Unknown symbol in
module, or unknown parameter (see dmesg)
WARNING: Error running install command for snd
WARNING: Error inserting snd_timer
(/lib/modules/2.6.17-10-generic/kernel/sound/acore/snd-timer.ko): Unknown symbol
in module, or unknown parameter (see dmesg)
FATAL: Error inserting snd
(/lib/modules/2.6.17-10-generic/kernel/sound/acore/snd.ko): Unknown symbol in
module, or unknown parameter (see dmesg)
WARNING: Error running install command for snd
WARNING: Error inserting snd_timer
(/lib/modules/2.6.17-10-generic/kernel/sound/acore/snd-timer.ko): Unknown symbol
in module, or unknown parameter (see dmesg)
FATAL: Error inserting snd_pcm
(/lib/modules/2.6.17-10-generic/kernel/sound/acore/snd-pcm.ko): Unknown symbol
in module, or unknown parameter (see dmesg)
WARNING: Error running install command for snd_pcm
WARNING: Error inserting snd_hda_codec
(/lib/modules/2.6.17-10-generic/kernel/sound/pci/hda/snd-hda-codec.ko): Unknown
symbol in module, or unknown parameter (see dmesg)
FATAL: Error inserting snd_hda_intel
(/lib/modules/2.6.17-10-generic/kernel/sound/pci/hda/snd-hda-intel.ko): Unknown
symbol in module, or unknown parameter (see dmesg)
root@anders-laptop:~/Desktop/alsa/alsa-driver-1.0.13# dmesg
[17182742.056000] snd: Unknown parameter `model'
[17182742.056000] snd_timer: Unknown symbol snd_verbose_printd
[17182742.056000] snd_timer: Unknown symbol snd_hidden_kzalloc
[17182742.056000] snd_timer: Unknown symbol snd_info_register
[17182742.056000] snd_timer: Unknown symbol snd_info_create_module_entry
[17182742.056000] snd_timer: Unknown symbol snd_info_free_entry
[17182742.056000] snd_timer: Unknown symbol snd_hidden_kfree
[17182742.056000] snd_timer: Unknown symbol snd_verbose_printk
[17182742.056000] snd_timer: Unknown symbol snd_iprintf
[17182742.056000] snd_timer: Unknown symbol snd_ecards_limit
[17182742.056000] snd_timer: Unknown symbol snd_oss_info_register
[17182742.056000] snd_timer: Unknown symbol snd_unregister_device
[17182742.056000] snd_timer: Unknown symbol snd_hidden_kstrdup
[17182742.056000] snd_timer: Unknown symbol snd_device_new
[17182742.056000] snd_timer: Unknown symbol snd_hidden_kmalloc
[17182742.056000] snd_timer: Unknown symbol snd_register_device
[17182742.068000] snd: Unknown parameter `model'
[17182742.072000] snd_timer: Unknown symbol snd_verbose_printd
[17182742.072000] snd_timer: Unknown symbol snd_hidden_kzalloc
[17182742.072000] snd_timer: Unknown symbol snd_info_register
[17182742.072000] snd_timer: Unknown symbol snd_info_create_module_entry
[17182742.072000] snd_timer: Unknown symbol snd_info_free_entry
[17182742.072000] snd_timer: Unknown symbol snd_hidden_kfree
[17182742.072000] snd_timer: Unknown symbol snd_verbose_printk
[17182742.072000] snd_timer: Unknown symbol snd_iprintf
[17182742.072000] snd_timer: Unknown symbol snd_ecards_limit
[17182742.072000] snd_timer: Unknown symbol snd_oss_info_register
[17182742.072000] snd_timer: Unknown symbol snd_unregister_device
[17182742.072000] snd_timer: Unknown symbol snd_hidden_kstrdup
[17182742.072000] snd_timer: Unknown symbol snd_device_new
[17182742.072000] snd_timer: Unknown symbol snd_hidden_kmalloc
[17182742.072000] snd_timer: Unknown symbol snd_register_device
[17182742.076000] snd_pcm: Unknown symbol snd_verbose_printd
[17182742.076000] snd_pcm: Unknown symbol snd_hidden_kzalloc
[17182742.076000] snd_pcm: Unknown symbol snd_info_register
[17182742.076000] snd_pcm: Unknown symbol snd_info_create_module_entry
[17182742.076000] snd_pcm: Unknown symbol snd_timer_notify
[17182742.076000] snd_pcm: Unknown symbol snd_timer_interrupt
[17182742.076000] snd_pcm: Unknown symbol snd_info_free_entry
[17182742.076000] snd_pcm: Unknown symbol snd_add_device_sysfs_file
[17182742.076000] snd_pcm: Unknown symbol snd_info_get_str
[17182742.076000] snd_pcm: Unknown symbol snd_hidden_kcalloc
[17182742.076000] snd_pcm: Unknown symbol snd_hidden_kfree
[17182742.076000] snd_pcm: Unknown symbol snd_verbose_printk
[17182742.076000] snd_pcm: Unknown symbol snd_ctl_register_ioctl
[17182742.076000] snd_pcm: Unknown symbol snd_card_file_add
[17182742.076000] snd_pcm: Unknown symbol snd_iprintf
[17182742.076000] snd_pcm: Unknown symbol snd_major
[17182742.076000] snd_pcm: Unknown symbol snd_unregister_device
[17182742.076000] snd_pcm: Unknown symbol snd_timer_new
[17182742.076000] snd_pcm: Unknown symbol snd_device_new
[17182742.076000] snd_pcm: Unknown symbol snd_ctl_unregister_ioctl
[17182742.076000] snd_pcm: Unknown symbol snd_lookup_minor_data
[17182742.076000] snd_pcm: Unknown symbol snd_info_create_card_entry
[17182742.076000] snd_pcm: Unknown symbol snd_power_wait
[17182742.076000] snd_pcm: Unknown symbol snd_hidden_kmalloc
[17182742.076000] snd_pcm: Unknown symbol snd_device_free
[17182742.076000] snd_pcm: Unknown symbol snd_card_file_remove
[17182742.076000] snd_pcm: Unknown symbol snd_device_register
[17182742.076000] snd_pcm: Unknown symbol snd_register_device
[17182742.076000] snd_pcm: Unknown symbol snd_info_get_line
[17182742.080000] snd_hda_codec: Unknown symbol snd_verbose_printd
[17182742.080000] snd_hda_codec: Unknown symbol snd_hidden_kzalloc
[17182742.080000] snd_hda_codec: Unknown symbol snd_ctl_add
[17182742.080000] snd_hda_codec: Unknown symbol snd_card_proc_new
[17182742.080000] snd_hda_codec: Unknown symbol snd_hidden_kcalloc
[17182742.080000] snd_hda_codec: Unknown symbol snd_hidden_kfree
[17182742.080000] snd_hda_codec: Unknown symbol snd_ctl_find_id
[17182742.080000] snd_hda_codec: Unknown symbol snd_verbose_printk
[17182742.080000] snd_hda_codec: Unknown symbol snd_ctl_new1
[17182742.080000] snd_hda_codec: Unknown symbol snd_component_add
[17182742.080000] snd_hda_codec: Unknown symbol snd_iprintf
[17182742.080000] snd_hda_codec: Unknown symbol snd_ctl_elem_read
[17182742.080000] snd_hda_codec: Unknown symbol snd_ctl_elem_write
[17182742.080000] snd_hda_codec: Unknown symbol snd_hidden_kstrdup
[17182742.080000] snd_hda_codec: Unknown symbol snd_pcm_hw_constraint_list
[17182742.080000] snd_hda_codec: Unknown symbol snd_device_new
[17182742.080000] snd_hda_codec: Unknown symbol snd_hidden_kmalloc
[17182742.080000] snd_hda_codec: Unknown symbol snd_pcm_hw_constraint_step
[17182742.080000] snd_hda_codec: Unknown symbol snd_pcm_format_width
[17182742.084000] snd_hda_intel: Unknown symbol snd_verbose_printd
[17182742.084000] snd_hda_intel: Unknown symbol snd_hidden_kzalloc
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_new
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_limit_hw_rates
[17182742.084000] snd_hda_intel: Unknown symbol snd_card_register
[17182742.084000] snd_hda_intel: Unknown symbol snd_card_free
[17182742.084000] snd_hda_intel: Unknown symbol
snd_pcm_lib_preallocate_pages_for_all
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_bus_new
[17182742.084000] snd_hda_intel: Unknown symbol snd_hidden_kcalloc
[17182742.084000] snd_hda_intel: Unknown symbol snd_hidden_kfree
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_build_pcms
[17182742.084000] snd_hda_intel: Unknown symbol snd_verbose_printk
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_codec_new
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_queue_unsol_event
[17182742.084000] snd_hda_intel: Unknown symbol snd_card_new
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_lib_malloc_pages
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_lib_ioctl
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_lib_free_pages
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_calc_stream_format
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_set_ops
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_suspend
[17182742.084000] snd_hda_intel: Unknown symbol snd_device_new
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_suspend_all
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_resume
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_hw_constraint_integer
[17182742.084000] snd_hda_intel: Unknown symbol snd_hda_build_controls
[17182742.084000] snd_hda_intel: Unknown symbol snd_hidden_kmalloc
[17182742.084000] snd_hda_intel: Unknown symbol snd_pcm_period_elapsed
root@anders-laptop:~/Desktop/alsa/alsa-driver-1.0.13# \
cat /proc/asound/card0/codec#0
Codec: Conexant CXT5047
Address: 0
Vendor Id: 0x14f15047
Subsystem Id: 0x103c30b2
Revision Id: 0x100000
Default PCM: rates 0x040, bits 0x02, types 0x1
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x10 [Audio Output] wcaps 0x41d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x0e 0x0e]
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Node 0x11 [Audio Output] wcaps 0x611: Stereo Digital
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Node 0x12 [Audio Input] wcaps 0x100d1b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x0e, stepsize=0x05, mute=1
Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x8e 0x8e] [0x80 0x80]
[0x80 0x80]
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Connection: 6
0x19 0x14 0x15 0x1a* 0x16 0x10
Node 0x13 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x9e 0x9e]
Pincap 0x081001c: OUT HP EAPD Detect
Pin Default 0x0221101f: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Black
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 3
0x19* 0x10 0x16
Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1f 0x1f]
Pincap 0x0833c: IN OUT HP Detect
Pin Default 0x02a1102e: [Jack] Mic at Ext Front
Conn = 1/8, Color = Black
Pin-ctls: 0x20: IN
Power: 0x0
Connection: 2
0x19* 0x16
Node 0x15 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1f 0x1f]
Pincap 0x0833c: IN OUT HP Detect
Pin Default 0x40000180: [N/A] Line Out at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x21: IN
Power: 0x0
Connection: 3
0x1c 0x19* 0x16
Node 0x16 [Pin Complex] wcaps 0x400401: Stereo
Pincap 0x0860: IN
Pin Default 0x94330121: [Fixed] CD at Int Right
Conn = ATAPI, Color = Unknown
Pin-ctls: 0x20: IN
Power: 0x0
Node 0x17 [Pin Complex] wcaps 0x400481: Stereo
Pincap 0x08324: IN Detect
Pin Default 0x95a70122: [Fixed] Mic at Int Top
Conn = Analog, Color = Unknown
Pin-ctls: 0x21: IN
Power: 0x0
Node 0x18 [Pin Complex] wcaps 0x400701: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x04440131: [Jack] SPDIF Out at Ext Right
Conn = RCA, Color = Unknown
Pin-ctls: 0x00:
Power: 0x0
Connection: 1
0x11
Node 0x19 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
Amp-In caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
Amp-In vals: [0x17 0x17] [0x80 0x80] [0x80 0x80] [0x17 0x17]
Power: 0x0
Connection: 4
0x10 0x1b 0x1a 0x16
Node 0x1a [Audio Selector] wcaps 0x30050d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x1f, mute=0
Amp-Out vals: [0x03 0x03]
Power: 0x0
Connection: 3
0x15 0x14 0x17*
Node 0x1b [Audio Selector] wcaps 0x300501: Stereo
Power: 0x0
Connection: 2
0x14* 0x15
Node 0x1c [Audio Output] wcaps 0x41d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x80 0x80]
PCM: rates 0x040, bits 0x02, types 0x1
Power: 0x0
Node 0x1d [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
Amp-Out vals: [0x1f 0x1f]
Pincap 0x08314: OUT Detect
Pin Default 0x92170110: [Fixed] Speaker at Int Front
Conn = Analog, Color = Unknown
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 3
0x1c 0x19* 0x16
Node 0x1e [Vendor Defined Widget] wcaps 0xf00000: Mono
--
Anders
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Conexant test code.
2006-11-04 9:52 Conexant test code Tobin Davis
` (2 preceding siblings ...)
2006-11-04 23:55 ` Anders
@ 2006-11-05 13:45 ` Matthew Strahan
2006-11-05 14:03 ` Konstantin Shaposhnikov
3 siblings, 1 reply; 11+ messages in thread
From: Matthew Strahan @ 2006-11-05 13:45 UTC (permalink / raw)
To: alsa-devel
Hi Tobin,
I had the same results for my HP DV2000 (with same subsystem) except for
me alsactl -f asound.state store worked. It exits successfully without
comment.
Funnily enough also for me when I press the mute button it doesn't glow
orange. That's hardly an important issue however.
Thanks,
Matthew
> From: Konstantin Shaposhnikov <k.shaposhnikov <at> gmail.com>
> Subject: Re: Conexant test code.
> <http://news.gmane.org/find-root.php?message_id=%3cb12092cb0611040435k38bb2094if074160cc9769ec4%40mail.gmail.com%3e>
> <http://news.gmane.org/gmane.linux.alsa.devel>
> Hi Tobin,
>
> Below you can find results of my testing of conexant test patch 8.
>
> Model: HP pavilion DV2000
> Subsystem: 103c:30b2
>
> Sound and internal microphone is working (as with previous patch)
>
> I've alsa noticed following strange behaviour of alsamixer: the first control
> named "Master" (in previous patches it was named "Headphones") affects only
> sound in headphones, sound in internal speakers can be modfied only by
> changing value of PCM control. PCM affects both headphones and internal
> speaker.
>
> >From other side DV2000 has LED button to mute sound, when I mute "Master"
> control this LED is glowing orange inicating that sound is muted (but actually
> sound muted only in headphones).
>
> Unfortunately I can not test patch with model=test. Alsamixer can not be
> started and prints following error:
> alsamixer: function snd_mixer_load failed: Invalid argument
> At the same time dmesg says:
> hda_codec: num_steps = 0 for NID=0x19
>
> When I try to execute following command (from init scripts):
> alsactl -f asound.state store
> I get "unable to handle kernel paging request" error:
>
> BUG: unable to handle kernel paging request at virtual address fffffff8
> printing eip:
> f8cc4714
> *pde = 00004067
> *pte = 00000000
> Oops: 0000 [#1]
> SMP
> Modules linked in: snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
> snd_pcm_oss snd_mixer_oss snd_hda_intel snd_hda_codec snd_pcm snd_timer snd
> soundcore snd_page_alloc ohci1394 e100 nvidia i2c_core ntfs ipw3945 ieee80211
> ieee80211_crypt firmware_class joydev
> CPU: 1
> EIP: 0060:[<f8cc4714>] Tainted: PF VLI
> EFLAGS: 00010296 (2.6.18-suspend2 #5)
> EIP is at snd_hda_ch_mode_info+0x24/0x50 [snd_hda_codec]
> eax: ffffffff ebx: 00000000 ecx: 00000000 edx: f50dbe04
> esi: f74a3140 edi: c1105511 ebp: f6f49014 esp: f50dbdb4
> ds: 007b es: 007b ss: 0068
> Process alsactl (pid: 31485, ti=f50da000 task=c266ba90 task.ti=f50da000)
> Stack: 00000000 f6f49014 f6f49014 f8ccfec8 00000000 f7a5cb54 f88ee5a7
> f50dbe1c f57766c0 f50dbf34 c108ae93 f50dbe04 bff5cab0 f6ed9254
> 00000000 f88fb000 00000000 f6bd7408 f6f49160 f6f49160 00000001
> 00000002 00000000 00000000
> Call Trace:
> [<f8ccfec8>] conexant_ch_mode_info+0x18/0x20 [snd_hda_codec]
> [<f88ee5a7>] snd_ctl_ioctl+0x4e7/0xb50 [snd]
> [<c108f85b>] do_ioctl+0x2b/0x90
> [<c108f91c>] vfs_ioctl+0x5c/0x2b0
> [<c108fbad>] sys_ioctl+0x3d/0x70
> [<c100311d>] sysenter_past_esp+0x56/0x79
> [<b7f80410>] 0xb7f80410
> Code: 8d bc 27 00 00 00 00 83 ec 0c 8b 44 24 10 3b 42 54
> c7 42 40 03 00 00 00 c7 42 48 01 00 00 00 89 42 50 77 04
> 48 89 42 54 8b 42 54 <8b> 04 c1 89 44 24 08 b8 38 1f cd
> f8 89 44 24 04 8d 42 58 89 04
> EIP: [<f8cc4714>] snd_hda_ch_mode_info+0x24/0x50 [snd_hda_codec]
> SS:ESP 0068:f50dbdb4
>
> Regards,
> Konstantin
>
> On 11/4/06, Tobin Davis <tdavis <at> dsl-only.net> wrote:
> > Here's test release 8. Changes of significance:
> >
> > Preliminary Conexant 5045 support
> > Preliminary HP DV6000 series support.
> > Preliminary test mode (when compiled with debugging).
> >
> > Separation of Conexant 5047 support models
> > HP DV1000/2000/3000 series split from 5000/8000 series due to
> > implementation differences. No change on HP muting speakers
> > (still need to figure this one out).
> > HP DV5000/8000 series/Compaq V5209US/V5204NR series
> > Headphone mutes speakers ok (same as test7).
> > Removed Internal Microphone from mixer.
> > Toshiba P100 series
> > changed EAPD default. Hopefully this triggers audio.
> > Code changes to "test" model.
> > Adjusted Mic gains (I think).
> >
> > Areas to test:
> > 5045 series - everything.
> > 5047 series
> > HP DV1/2/3000 series - try test mode and start toggling
> > controls until speakers are muted and headphones work.
> > Report findings.
> > HP 5000/8000 series - make sure I didn't break things.
> > Test recording.
> > Toshiba - everything.
> >
> > For the new testers in the group, here's the instructions:
> >
> > wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.13.tar.bz2
> > tar -jxf alsa-driver-1.0.13.tar.bz2
> > cd alsa-driver-1.0.13
> > ./configure --with-debug=full --with-cards=hda-intel
> > patch -p1 <conexant-test8.patch
> > make ; make install
> > dmesg -c
> >
> > Stop all audio applications and remove all audio drivers (lsmod |fgrep
> > snd). Reload the new driver with "modprobe snd-hda-intel" and test it
> > out. Use alsamixer to report any mixer issues (easier to debug than
> > kmix/gmix, whatever-gui-mixer). If nothing works, or one function
> > doesn't work, try reloading the driver with "model=test" as a parameter.
> > This should enable everything.
> >
> > Send me your test results. Please include the system make/model, the
> > subsystem line from "lspci -s 0:1b -vn" (Ex: Subsystem: 103c:30b2), and
> > the output from "cat /proc/asound/card0/codec#0".
> > I need this for tracking what works on what systems.
> >
> > Thanks for helping test this new driver.
> >
> > --
> > Tobin Davis <tdavis <at> dsl-only.net>
> >
> >
> >
>
> --
> http://step-inside.org
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Conexant test code.
2006-11-05 13:45 ` Matthew Strahan
@ 2006-11-05 14:03 ` Konstantin Shaposhnikov
2006-11-05 22:52 ` enigma_0Z
2006-11-09 0:08 ` Anders
0 siblings, 2 replies; 11+ messages in thread
From: Konstantin Shaposhnikov @ 2006-11-05 14:03 UTC (permalink / raw)
To: alsa-devel
Hi,
I want to clarify that bugs with alsamixer and alsactl that I have
described occure only with model=test option to the driver.
As for mute button, I think that color of this LED is determined by
mute status of sound card and this functionlaity is implemented in
hardware.
When you press this button soundcard is not muted, such thing should
be implemented programmatically, f.e. you can configure your window
manager to execute alsactl with appropriate parameters on button
click.
Regards,
Konstantin
On 11/5/06, Matthew Strahan <mstrahan@cse.unsw.edu.au> wrote:
> Hi Tobin,
>
> I had the same results for my HP DV2000 (with same subsystem) except for
> me alsactl -f asound.state store worked. It exits successfully without
> comment.
>
> Funnily enough also for me when I press the mute button it doesn't glow
> orange. That's hardly an important issue however.
>
> Thanks,
> Matthew
>
> > From: Konstantin Shaposhnikov <k.shaposhnikov <at> gmail.com>
> > Subject: Re: Conexant test code.
> > <http://news.gmane.org/find-root.php?message_id=%3cb12092cb0611040435k38bb2094if074160cc9769ec4%40mail.gmail.com%3e>
> > <http://news.gmane.org/gmane.linux.alsa.devel>
> > Hi Tobin,
> >
> > Below you can find results of my testing of conexant test patch 8.
> >
> > Model: HP pavilion DV2000
> > Subsystem: 103c:30b2
> >
> > Sound and internal microphone is working (as with previous patch)
> >
> > I've alsa noticed following strange behaviour of alsamixer: the first control
> > named "Master" (in previous patches it was named "Headphones") affects only
> > sound in headphones, sound in internal speakers can be modfied only by
> > changing value of PCM control. PCM affects both headphones and internal
> > speaker.
> >
> > >From other side DV2000 has LED button to mute sound, when I mute "Master"
> > control this LED is glowing orange inicating that sound is muted (but actually
> > sound muted only in headphones).
> >
> > Unfortunately I can not test patch with model=test. Alsamixer can not be
> > started and prints following error:
> > alsamixer: function snd_mixer_load failed: Invalid argument
> > At the same time dmesg says:
> > hda_codec: num_steps = 0 for NID=0x19
> >
> > When I try to execute following command (from init scripts):
> > alsactl -f asound.state store
> > I get "unable to handle kernel paging request" error:
> >
> > BUG: unable to handle kernel paging request at virtual address fffffff8
> > printing eip:
> > f8cc4714
> > *pde = 00004067
> > *pte = 00000000
> > Oops: 0000 [#1]
> > SMP
> > Modules linked in: snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
> > snd_pcm_oss snd_mixer_oss snd_hda_intel snd_hda_codec snd_pcm snd_timer snd
> > soundcore snd_page_alloc ohci1394 e100 nvidia i2c_core ntfs ipw3945 ieee80211
> > ieee80211_crypt firmware_class joydev
> > CPU: 1
> > EIP: 0060:[<f8cc4714>] Tainted: PF VLI
> > EFLAGS: 00010296 (2.6.18-suspend2 #5)
> > EIP is at snd_hda_ch_mode_info+0x24/0x50 [snd_hda_codec]
> > eax: ffffffff ebx: 00000000 ecx: 00000000 edx: f50dbe04
> > esi: f74a3140 edi: c1105511 ebp: f6f49014 esp: f50dbdb4
> > ds: 007b es: 007b ss: 0068
> > Process alsactl (pid: 31485, ti=f50da000 task=c266ba90 task.ti=f50da000)
> > Stack: 00000000 f6f49014 f6f49014 f8ccfec8 00000000 f7a5cb54 f88ee5a7
> > f50dbe1c f57766c0 f50dbf34 c108ae93 f50dbe04 bff5cab0 f6ed9254
> > 00000000 f88fb000 00000000 f6bd7408 f6f49160 f6f49160 00000001
> > 00000002 00000000 00000000
> > Call Trace:
> > [<f8ccfec8>] conexant_ch_mode_info+0x18/0x20 [snd_hda_codec]
> > [<f88ee5a7>] snd_ctl_ioctl+0x4e7/0xb50 [snd]
> > [<c108f85b>] do_ioctl+0x2b/0x90
> > [<c108f91c>] vfs_ioctl+0x5c/0x2b0
> > [<c108fbad>] sys_ioctl+0x3d/0x70
> > [<c100311d>] sysenter_past_esp+0x56/0x79
> > [<b7f80410>] 0xb7f80410
> > Code: 8d bc 27 00 00 00 00 83 ec 0c 8b 44 24 10 3b 42 54
> > c7 42 40 03 00 00 00 c7 42 48 01 00 00 00 89 42 50 77 04
> > 48 89 42 54 8b 42 54 <8b> 04 c1 89 44 24 08 b8 38 1f cd
> > f8 89 44 24 04 8d 42 58 89 04
> > EIP: [<f8cc4714>] snd_hda_ch_mode_info+0x24/0x50 [snd_hda_codec]
> > SS:ESP 0068:f50dbdb4
> >
> > Regards,
> > Konstantin
> >
> > On 11/4/06, Tobin Davis <tdavis <at> dsl-only.net> wrote:
> > > Here's test release 8. Changes of significance:
> > >
> > > Preliminary Conexant 5045 support
> > > Preliminary HP DV6000 series support.
> > > Preliminary test mode (when compiled with debugging).
> > >
> > > Separation of Conexant 5047 support models
> > > HP DV1000/2000/3000 series split from 5000/8000 series due to
> > > implementation differences. No change on HP muting speakers
> > > (still need to figure this one out).
> > > HP DV5000/8000 series/Compaq V5209US/V5204NR series
> > > Headphone mutes speakers ok (same as test7).
> > > Removed Internal Microphone from mixer.
> > > Toshiba P100 series
> > > changed EAPD default. Hopefully this triggers audio.
> > > Code changes to "test" model.
> > > Adjusted Mic gains (I think).
> > >
> > > Areas to test:
> > > 5045 series - everything.
> > > 5047 series
> > > HP DV1/2/3000 series - try test mode and start toggling
> > > controls until speakers are muted and headphones work.
> > > Report findings.
> > > HP 5000/8000 series - make sure I didn't break things.
> > > Test recording.
> > > Toshiba - everything.
> > >
> > > For the new testers in the group, here's the instructions:
> > >
> > > wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.13.tar.bz2
> > > tar -jxf alsa-driver-1.0.13.tar.bz2
> > > cd alsa-driver-1.0.13
> > > ./configure --with-debug=full --with-cards=hda-intel
> > > patch -p1 <conexant-test8.patch
> > > make ; make install
> > > dmesg -c
> > >
> > > Stop all audio applications and remove all audio drivers (lsmod |fgrep
> > > snd). Reload the new driver with "modprobe snd-hda-intel" and test it
> > > out. Use alsamixer to report any mixer issues (easier to debug than
> > > kmix/gmix, whatever-gui-mixer). If nothing works, or one function
> > > doesn't work, try reloading the driver with "model=test" as a parameter.
> > > This should enable everything.
> > >
> > > Send me your test results. Please include the system make/model, the
> > > subsystem line from "lspci -s 0:1b -vn" (Ex: Subsystem: 103c:30b2), and
> > > the output from "cat /proc/asound/card0/codec#0".
> > > I need this for tracking what works on what systems.
> > >
> > > Thanks for helping test this new driver.
> > >
> > > --
> > > Tobin Davis <tdavis <at> dsl-only.net>
> > >
> > >
> > >
> >
> > --
> > http://step-inside.org
> >
> > -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
> >
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
--
http://step-inside.org
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Conexant test code.
2006-11-05 14:03 ` Konstantin Shaposhnikov
@ 2006-11-05 22:52 ` enigma_0Z
2006-11-09 0:08 ` Anders
1 sibling, 0 replies; 11+ messages in thread
From: enigma_0Z @ 2006-11-05 22:52 UTC (permalink / raw)
To: Tobin Davis, alsa-devel
Just adding my results...
HP dv6000z does not work at all...
Loading driver as so:
--code--
modprobe snd-hda-intel disable_msi=1
--code--
Yields no sound, athough I can launch alsamixer and whatnot
Loading the driver as so:
--code--
modprobe snd-hda-intel disable_msi=1 model=test
--code--
causes a(lsa)mixer to freeze on launch, kill will not kill processes.
dmesg:
--code--
[17199716.196000] ACPI: PCI interrupt for device 0000:00:10.1 disabled
[17199802.688000] ACPI: PCI Interrupt 0000:00:10.1[B] -> Link [LAZA]
-> GSI 18 (level, high) -> IRQ 58
[17199802.688000] PCI: Setting latency timer of device 0000:00:10.1 to 64
[17199802.812000] ALSA
/home/enigma/src/build/alsa/test/alsa-driver-1.0.13/pci/hda/hda_codec.c:1741:
hda_codec: model 'test' is selected
[17199802.892000] hda_codec: num_steps = 0 for NID=0x17
[17199803.024000] BUG: unable to handle kernel paging request at
virtual address fffffff8
[17199803.024000] printing eip:
[17199803.024000] f8eca71e
[17199803.024000] *pde = 00002067
[17199803.024000] Oops: 0000 [#1]
[17199803.024000] Modules linked in: snd_hda_intel snd_hda_codec
snd_pcm_oss snd_pcm snd_mixer_oss snd_seq_oss snd_seq_midi_event
snd_seq snd_timer snd_seq_device snd soundcore
snd_page_alloc ipv6 rfcomm hidp l2cap bluetooth powernow_k8
cpufreq_userspace cpufreq_stats freq_table cpufreq_powersave
cpufreq_ondemand cpufreq_conservative video tc1100_wmi s
bs sony_acpi pcc_acpi i2c_ec hotkey dev_acpi button battery container
ac asus_acpi nls_utf8 ntfs ext2 dm_mod md_mod ndiswrapper sr_mod sbp2
parport_pc lp parport joydev af_packe
t nvidia tsdev psmouse sg agpgart serio_raw evdev sdhci mmc_core
i2c_core rtc shpchp pci_hotplug usbhid ext3 jbd ehci_hcd ohci1394
ieee1394 ohci_hcd usbcore forcedeth ide_generi
c ide_cd cdrom generic sd_mod amd74xx sata_nv libata scsi_mod thermal
processor fan fbcon tileblit font bitblit softcursor vesafb capability
commoncap
[17199803.024000] CPU: 0
[17199803.024000] EIP: 0060:[<f8eca71e>] Tainted: P VLI
[17199803.024000] EFLAGS: 00010297 (2.6.17-10-386 #2)
[17199803.024000] EIP is at snd_hda_ch_mode_info+0x2e/0x50 [snd_hda_codec]
[17199803.024000] eax: ffffffff ebx: 00000000 ecx: 00000000 edx: d6151e0c
[17199803.024000] esi: f1fdcbd4 edi: ed156560 ebp: d6151e0c esp: d6151dcc
[17199803.024000] ds: 007b es: 007b ss: 0068
[17199803.024000] Process alsactl (pid: 17349, threadinfo=d6150000
task=ec7f4540)
[17199803.024000] Stack: 00000246 f8ed8c98 ed156414 f8ed6c58 00000000
ed156414 f8aec977 d6151e38
[17199803.024000] de352814 d6151f44 c0165443 bfaf40a0 e65d86d4
00000001 c016572f d6151e38
[17199803.024000] 00000001 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[17199803.024000] Call Trace:
[17199803.024000] <f8ed6c58> conexant_ch_mode_info+0x18/0x20
[snd_hda_codec] <f8aec977> snd_ctl_ioctl+0x4f7/0xc60 [snd]
[17199803.024000] <c0165443> do_lookup+0x53/0x160 <c016572f>
permission+0xbf/0xd0
[17199803.024000] <c0148023> __handle_mm_fault+0x1e3/0x840
<c0156b05> nameidata_to_filp+0x35/0x40
[17199803.024000] <c0156b60> do_filp_open+0x50/0x60 <f8aec480>
snd_ctl_ioctl+0x0/0xc60 [snd]
[17199803.024000] <c0169bef> do_ioctl+0x1f/0x70 <c02c7ba9>
do_page_fault+0x3d9/0x6e0
[17199803.024000] <c0169c9c> vfs_ioctl+0x5c/0x270 <c0169f22>
sys_ioctl+0x72/0x90
[17199803.024000] <c0102dbb> sysenter_past_esp+0x54/0x79
[17199803.024000] Code: 8b 44 24 10 3b 42 54 c7 42 40 03 00 00 00 c7
42 48 01 00 00 00 89 42 50 77 06 83 e8 01 89 42 54 8b 42 54 c7 44 24
04 98 8c ed f8 <8b> 04 c1 89 44 24 08 8
d 42 58 89 04 24 e8 30 21 30 c7 31 c0 83
[17199803.024000] EIP: [<f8eca71e>] snd_hda_ch_mode_info+0x2e/0x50
[snd_hda_codec] SS:ESP 0068:d6151dcc
--code--
/proc/asound/card0/codec#0:
--code--
Codec: Conexant CXT5045
Address: 0
Vendor Id: 0x14f15045
Subsystem Id: 0x103c30b7
Revision Id: 0x100100
Default PCM: rates 0x140, bits 0x0e, types 0x1
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x10 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x2b, nsteps=0x2b, stepsize=0x05, mute=1
Amp-Out vals: [0xa2 0xa2]
Pincap 0x0810014: OUT EAPD Detect
Pin Default 0x92170010: [Fixed] Speaker at Int Front
Conn = Analog, Color = Unknown
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 2
0x19* 0x17
Node 0x11 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x2b, nsteps=0x2b, stepsize=0x05, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x08113c: IN OUT HP Detect
Pin Default 0x01214020: [Jack] HP Out at Ext Rear
Conn = 1/8, Color = Green
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 2
0x19* 0x17
Node 0x12 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Amp-Out caps: ofs=0x2b, nsteps=0x2b, stepsize=0x05, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x08113c: IN OUT HP Detect
Pin Default 0x01813030: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
Pin-ctls: 0x40: OUT
Power: 0x0
Connection: 2
0x19* 0x17
Node 0x13 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x21447040: [Jack] SPDIF Out at Sep Rear
Conn = RCA, Color = Yellow
Pin-ctls: 0x00:
Connection: 1
0x18
Node 0x14 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081124: IN Detect
Pin Default 0x97a70050: [Fixed] Mic at Int Riser
Conn = Analog, Color = Unknown
Pin-ctls: 0x00:
Node 0x15 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x99330060: [Fixed] CD at Int ATAPI
Conn = ATAPI, Color = Unknown
Pin-ctls: 0x00:
Node 0x16 [Beep Generator Widget] wcaps 0x70000c: Mono Amp-Out
Amp-Out caps: ofs=0x07, nsteps=0x07, stepsize=0x0b, mute=1
Amp-Out vals: [0x06]
Node 0x17 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
Amp-In caps: ofs=0x14, nsteps=0x2b, stepsize=0x05, mute=1
Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
Power: 0x0
Connection: 5
0x19 0x14 0x12 0x11 0x15
Node 0x18 [Audio Output] wcaps 0x211: Stereo Digital
PCM: rates 0x040, bits 0x06, types 0x5
Node 0x19 [Audio Output] wcaps 0xc11: Stereo
PCM: rates 0x540, bits 0x0e, types 0x1
Power: 0x0
Node 0x1a [Audio Input] wcaps 0x100d0b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x17, stepsize=0x05, mute=1
Amp-In vals: [0x80 0x80] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00]
Power: 0x0
Connection: 5
0x17* 0x14 0x12 0x11 0x15
Node 0x1b [Vendor Defined Widget] wcaps 0xf00000: Mono
--code--
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Conexant test code.
2006-11-05 14:03 ` Konstantin Shaposhnikov
2006-11-05 22:52 ` enigma_0Z
@ 2006-11-09 0:08 ` Anders
1 sibling, 0 replies; 11+ messages in thread
From: Anders @ 2006-11-09 0:08 UTC (permalink / raw)
To: alsa-devel
I can confirm this behavior.
HP dv3000, Subsystem: 103c:30b2
model=test gives some kind of kernel problem that brakes alsa:
It's ubuntu patched kernel 2.6.17-10-generic #2 SMP Fri Oct 13 18:45:35,
in case that's relevant.
dmesg:
[17179844.140000] ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) \
-> IRQ 66
[17179844.140000] PCI: Setting latency timer of device 0000:00:1b.0 to 64
[17179844.264000] ALSA \
/home/anders/Desktop/alsa/alsa-driver-1.0.13/pci/hda/hda_codec.c:1741: \
hda_codec: model 'test' is selected
[17179844.420000] BUG: unable to handle kernel paging request at virtual \
address fffffff8
[17179844.420000] printing eip:
[17179844.420000] f8f3771e
[17179844.420000] *pde = 00004067
[17179844.420000] Oops: 0000 [#1]
[17179844.420000] SMP
[17179844.420000] Modules linked in: snd_hda_intel snd_hda_codec snd_pcm \
snd_timer snd snd_page_alloc ipv6 binfmt_misc i915 drm speedstep_centrino \
cpufreq_userspace cpufreq_stats freq_table cpufreq_powersave cpufreq_ondemand \
cpufreq_conservative video tc1100_wmi sony_acpi sbs pcc_acpi i2c_ec i2c_core \
hotkey dev_acpi container button battery asus_acpi ac af_packet sbp2 \
parport_pc lp parport joydev tsdev sdhci mmc_core e100 mii sg ipw3945 psmouse \
hw_random ieee80211 ieee80211_crypt shpchp pci_hotplug serio_raw intel_agp \
agpgart soundcore evdev ext3 jbd ohci1394 ieee1394 ehci_hcd uhci_hcd usbcore \
ide_generic sd_mod ata_piix libata scsi_mod ide_cd cdrom piix generic thermal \
processor fan fbcon tileblit font bitblit softcursor vesafb capability \
commoncap
[17179844.420000] CPU: 1
[17179844.420000] EIP: 0060:[<f8f3771e>] Not tainted VLI
[17179844.420000] EFLAGS: 00010297 (2.6.17-10-generic #2)
[17179844.420000] EIP is at snd_hda_ch_mode_info+0x2e/0x50 [snd_hda_codec]
[17179844.420000] eax: ffffffff ebx: 00000000 ecx: 00000000 edx: f17f3e04
[17179844.420000] esi: f5ea56d4 edi: f63e7160 ebp: f17f3e04 esp: f17f3dc4
[17179844.420000] ds: 007b es: 007b ss: 0068
[17179844.420000] Process alsactl \
(pid: 6297, threadinfo=f17f2000 task=f5d78560)
[17179844.420000] Stack: f8e1de67 f8f45c98 f63e7014 f8f43c48 00000000 \
f63e7014 f8e1bc09 f17f3e34
[17179844.420000] f17ce84c f17f3f44 c0178953 bfeefca0 f1b83a54 \
00000001 f17ce114 f17d4e80
[17179844.420000] 00000001 00000000 00000000 00000000 00000000 \
00000000 00000000 00000000
[17179844.420000] Call Trace:
[17179844.420000] <f8e1de67> snd_hidden_kfree+0x77/0xa0 [snd] <f8f43c48> \
conexant_ch_mode_info+0x18/0x20 [snd_hda_codec]
[17179844.420000] <f8e1bc09> snd_ctl_ioctl+0x509/0xc80 [snd] <c0178953> \
do_lookup+0x53/0x160
[17179844.420000] <c0158f41> __handle_mm_fault+0x211/0x900 <c0168f25> \
nameidata_to_filp+0x35/0x40
[17179844.420000] <f8e1b700> snd_ctl_ioctl+0x0/0xc80 [snd] <c017d5eb> \
do_ioctl+0x2b/0x90
[17179844.420000] <c017d6ac> vfs_ioctl+0x5c/0x2b0 <c017d972> \
sys_ioctl+0x72/0x90
[17179844.420000] <c0102fbb> sysenter_past_esp+0x54/0x79
[17179844.420000] Code: 8b 44 24 10 3b 42 54 c7 42 40 03 00 00 00 c7 42 48 01 \
00 00 00 89 42 50 77 06 83 e8 01 89 42 54 8b 42 54 c7 44 24 04 98 5c f4 f8 \
<8b> 04 c1 89 44 24 08 8d 42 58 89 04 24 e8 50 d2 2a c7 31 c0 83
[17179844.420000] EIP: [<f8f3771e>] snd_hda_ch_mode_info+0x2e/0x50 \
[snd_hda_codec] SS:ESP 0068:f17f3dc4
[17179844.420000]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Conexant test code.
@ 2006-11-04 17:56 alsa
0 siblings, 0 replies; 11+ messages in thread
From: alsa @ 2006-11-04 17:56 UTC (permalink / raw)
To: alsa-devel
> Here's test release 8.
Another Oops on loading under Toshiba P100
> BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
> printing eip:
> f883ba12
> *pde = 00000000
> Oops: 0002 [#1]
> SMP
> Modules linked in: snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device ieee80211_crypt_wep fuse vmnet vmmon nvidiafb nvidia ipw3945 ieee80211 ieee80211_crypt e1000 snd_hda_intel snd_hda_codec snd_pcm snd_timer snd snd_page_allocCPU: 0
> EIP: 0060:[<f883ba12>] Tainted: P VLI
> EFLAGS: 00010282 (2.6.18-gentoo-r1 #5)
> EIP is at snd_info_register+0xbd/0xce [snd]
> eax: f473a358 ebx: f4069754 ecx: 00000000 edx: f406979c
> esi: f88463d6 edi: f473a2f0 ebp: f2737ed0 esp: f2737e34
> ds: 007b es: 007b ss: 0068
> Process modprobe (pid: 9069, ti=f2736000 task=c229d030 task.ti=f2736000)
> Stack: f4069754 f473a214 f8eb237a 00000001 c02f9825 f2737ea8 00000082 c200c260
> 002dc6c0 00000001 dff08a90 6dcb5280 0000005d 00000000 c229d144 c200c260
> 002dc6c0 00000000 dffad560 f2737e90 c0110d91 6dcb5280 6dcb5280 00000282
> Call Trace:
> [<f8eb237a>] snd_pcm_oss_register_minor+0x105/0x131 [snd_pcm_oss]
> [<c02f9825>] schedule+0x699/0x73d
> [<c0110d91>] __activate_task+0x1c/0x29
> [<c0111f27>] try_to_wake_up+0x2ed/0x2f7
> [<c0112e90>] __cond_resched+0x16/0x34
> [<c02f98f3>] cond_resched+0x2a/0x31
> [<c02f9928>] wait_for_completion+0x18/0xa2
> [<f885c316>] snd_pcm_notify+0xb4/0xd3 [snd_pcm]
> [<f884e078>] alsa_pcm_oss_init+0x78/0x86 [snd_pcm_oss]
> [<c012e3fa>] sys_init_module+0x1574/0x16fb
> [<c014ab4a>] vfs_read+0x81/0x123
> [<c0102805>] sysenter_past_esp+0x56/0x79
> Code: 08 89 5a 3c 89 c1 c1 f9 1f 89 42 18 89 4a 1c 8b 43 18 89 53 2c 85 c0 74 > 14 83 c0 40 8b 48 04 8d
> 53 48 89 50 04 89 43 48 89 4a 04 <89> 11 b8 60 42 84 f8 e8 3a e7 ab c7 31 c0 5b 5e c3 8b 40 14 e9
> EIP: [<f883ba12>] snd_info_register+0xbd/0xce [snd] SS:ESP 0068:f2737e34
This time I did remember the "model=test" parameter. That crashed loading the OSS compatibility module
> # /etc/init.d/mpd start
> * Loading ALSA modules ...
> * Loading: snd-card-0 ... [ ok ]
> * Loading: snd-seq-oss ... [ ok ]
> * Loading: snd-mixer-oss ... [ ok ]
> * Loading: snd-pcm-oss ...
> /etc/init.d/alsasound: line 91: 9344 Segmentation fault /sbin/modprobe ${DRIVER}
[ !! ]
I'm busy rebuilding mpd without oss support to see if I the patch works without it
Make/Model etc:
Toshiba P100-240 (pspa3e) - Gentoo Linux
> # lspci -s 0:1b -vn
> 00:1b.0 0403: 8086:27d8 (rev 02)
> Subsystem: 1179:ff31
> Flags: bus master, fast devsel, latency 0, IRQ 21
> Memory at b0000000 (64-bit, non-prefetchable) [size=16K]
> Capabilities: [50] Power Management version 2
> Capabilities: [60] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
> Capabilities: [70] Express Unknown type IRQ 0
> Capabilities: [100] Virtual Channel
> Capabilities: [130] Unknown (5)
"cat /proc/asound/card0/codec#0" appears to have hung my command shell, and I think the desktop is going to crash soon. I can give the results under vanilla alsa-drivers if that helps. But first I want to post this before everything crashes
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread[parent not found: <1162339150.18211.239.camel@razman>]
* Re: Conexant test code
[not found] <1162339150.18211.239.camel@razman>
@ 2006-11-02 17:59 ` Konstantin Shaposhnikov
0 siblings, 0 replies; 11+ messages in thread
From: Konstantin Shaposhnikov @ 2006-11-02 17:59 UTC (permalink / raw)
To: Tobin Davis; +Cc: alsa-devel
Hi,
This is results of testing conexant patch 7.
Information about test notebook (HP Pavilion dv2000)
uname -a
Linux zeon 2.6.18-suspend2 #5 SMP Thu Oct 19 11:12:15 BST 2006 i686 Genuine
Intel(R) CPU T2300 @ 1.66GHz GNU/Linux
"lspci -s 0:1b -vn | grep Subsystem
Subsystem: 103c:30b2
Alsa version: 1.0.13
Internal microphone is working.
Probably it was my fault during testing of test patch 6 that microphone didn't
work. It is necessary to toggle capture facility on both internal
microphone and
Capture control (using Space key in alsamixer).
I guess that cxt5047_hp_automic should be called when user plug in/plug out
external microphone and unmute internal microphone automatically. Unfortunately
I am not able to test it because I haven't external mic.
Internal speakers still not muted when headphones are plugged.
If you give me some suggestions how to experiment with my notebook in order to
find right commands to mute internal speakers I will be able to help with
fixing this problem. As I already wrote ctx5047_hp_automute is called
correctly, but code of this method doesn't mute internal speakers.
Regards,
Konstantin
On 10/31/06, Tobin Davis <tdavis@dsl-only.net> wrote:
> Here's test patch 7. This should (hopefully) re-enable Mic recording
> and mute the internal speakers when headphones are plugged in.
>
> I've combined the driver wrapper with the kernel patch for easier
> distribution and integration.
>
> For the new testers in the group, here's the instructions:
>
> wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.13.tar.bz2
> tar -jxf alsa-driver-1.0.13.tar.bz2
> cd alsa-driver-1.0.13
> ./configure --with-debug=full --with-cards=hda-intel
> patch -p1 <conexant-test7.patch
> make ; make install
> dmesg -c
>
> Stop all audio applications and remove all audio drivers (lsmod |fgrep
> snd). Reload the new driver with "modprobe snd-hda-intel" and test it
> out. Use alsamixer to report any mixer issues (easier to debug than
> kmix/gmix, whatever-gui-mixer). If nothing works, or one function
> doesn't work, try reloading the driver with "model=test" as a parameter.
> This should enable everything.
>
> Send me your test results. Please include the system make/model, and
> the subsystem line from "lspci -s 0:1b -vn" (Ex: Subsystem: 103c:30b2).
> I need this for tracking what works on what systems.
>
> Thanks,
> --
> Tobin Davis <tdavis@dsl-only.net>
>
>
>
--
http://step-inside.org
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Conexant test code
@ 2006-10-27 16:44 Tobin Davis
0 siblings, 0 replies; 11+ messages in thread
From: Tobin Davis @ 2006-10-27 16:44 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]
Here's test patch 7. This should (hopefully) re-enable Mic recording
and mute the internal speakers when headphones are plugged in.
I've combined the driver wrapper with the kernel patch for easier
distribution and integration.
For the new testers in the group, here's the instructions:
wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.13.tar.bz2
tar -jxf alsa-driver-1.0.13.tar.bz2
cd alsa-driver-1.0.13
./configure --with-debug=full --with-cards=hda-intel
patch -p1 <conexant-test7.patch
make ; make install
dmesg -c
Stop all audio applications and remove all audio drivers (lsmod |fgrep
snd). Reload the new driver with "modprobe snd-hda-intel" and test it
out. Use alsamixer to report any mixer issues (easier to debug than
kmix/gmix, whatever-gui-mixer). If nothing works, or one function
doesn't work, try reloading the driver with "model=test" as a parameter.
This should enable everything.
Send me your test results. Please include the system make/model, and
the subsystem line from "lspci -s 0:1b -vn" (Ex: Subsystem: 103c:30b2).
I need this for tracking what works on what systems.
Thanks,
--
Tobin Davis <tdavis@dsl-only.net>
[-- Attachment #2: conexant-test7.patch --]
[-- Type: text/x-patch, Size: 32434 bytes --]
--- /dev/null 2006-09-13 00:29:45.000000000 -0700
+++ alsa-driver-1.0.13/pci/hda/patch_conexant.c 2006-10-21 21:30:35.000000000 -0700
@@ -0,0 +1,2 @@
+#define __NO_VERSION__
+#include "../../alsa-kernel/pci/hda/patch_conexant.c"
diff -r d7fe584f7395 Documentation/ALSA-Configuration.txt
--- alsa-driver-1.0.13/alsa-kernel/Documentation/ALSA-Configuration.txt Thu Oct 19 20:35:56 2006 +0200
+++ alsa-driver-1.0.13/alsa-kernel/Documentation/ALSA-Configuration.txt Sun Oct 22 10:03:13 2006 -0700
@@ -865,6 +865,9 @@ Prior to version 0.9.0rc4 options had a
laptop 3-jack with hp-jack automute
laptop-dig ditto with SPDIF
auto auto-config reading BIOS (default)
+
+ Conexant
+ laptop Laptop config with SPDIF
STAC9200/9205/9220/9221/9254
ref Reference board
diff -r d7fe584f7395 pci/hda/Makefile
--- alsa-driver-1.0.13/alsa-kernel/pci/hda/Makefile Thu Oct 19 20:35:56 2006 +0200
+++ alsa-driver-1.0.13/alsa-kernel/pci/hda/Makefile Sun Oct 22 10:03:13 2006 -0700
@@ -1,5 +1,5 @@ snd-hda-intel-objs := hda_intel.o
snd-hda-intel-objs := hda_intel.o
-snd-hda-codec-objs := hda_codec.o hda_generic.o patch_realtek.o patch_cmedia.o patch_analog.o patch_sigmatel.o patch_si3054.o patch_atihdmi.o
+snd-hda-codec-objs := hda_codec.o hda_generic.o patch_realtek.o patch_cmedia.o patch_analog.o patch_sigmatel.o patch_si3054.o patch_atihdmi.o patch_conexant.o
ifdef CONFIG_PROC_FS
snd-hda-codec-objs += hda_proc.o
endif
diff -r d7fe584f7395 pci/hda/hda_patch.h
--- alsa-driver-1.0.13/alsa-kernel/pci/hda/hda_patch.h Thu Oct 19 20:35:56 2006 +0200
+++ alsa-driver-1.0.13/alsa-kernel/pci/hda/hda_patch.h Sun Oct 22 10:03:13 2006 -0700
@@ -14,6 +14,8 @@ extern struct hda_codec_preset snd_hda_p
extern struct hda_codec_preset snd_hda_preset_si3054[];
/* ATI HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_atihdmi[];
+/* Conexant audio codec */
+extern struct hda_codec_preset snd_hda_preset_conexant[];
static const struct hda_codec_preset *hda_preset_tables[] = {
snd_hda_preset_realtek,
@@ -22,5 +24,6 @@ static const struct hda_codec_preset *hd
snd_hda_preset_sigmatel,
snd_hda_preset_si3054,
snd_hda_preset_atihdmi,
+ snd_hda_preset_conexant,
NULL
};
--- /dev/null 2006-10-23 04:17:47.000000000 -0700
+++ alsa-driver-1.0.13/alsa-kernel/pci/hda/patch_conexant.c 2006-10-27 09:08:45.000000000 -0700
@@ -0,0 +1,950 @@
+/*
+ * HD audio interface patch for Conexant HDA audio codec
+ *
+ * Copyright (c) 2006 Pototskiy Akex <alex.pototskiy@gmail.com>
+ * Takashi Iwai <tiwai@suse.de>
+ * Tobin Davis <tdavis@dsl-only.net>
+ *
+ * This driver is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This driver is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <sound/driver.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/pci.h>
+#include <sound/core.h>
+#include "hda_codec.h"
+#include "hda_local.h"
+
+#define CXT_PIN_DIR_IN 0x00
+#define CXT_PIN_DIR_OUT 0x01
+#define CXT_PIN_DIR_INOUT 0x02
+#define CXT_PIN_DIR_IN_NOMICBIAS 0x03
+#define CXT_PIN_DIR_INOUT_NOMICBIAS 0x04
+
+
+
+struct conexant_spec {
+
+ struct snd_kcontrol_new *mixers[5];
+ int num_mixers;
+
+ const struct hda_verb *init_verbs[5]; /* initialization verbs
+ * don't forget NULL termination!
+ */
+ unsigned int num_init_verbs;
+
+ /* playback */
+ struct hda_multi_out multiout; /* playback set-up
+ * max_channels, dacs must be set
+ * dig_out_nid and hp_nid are optional
+ */
+ unsigned int cur_eapd;
+ unsigned int need_dac_fix;
+
+ /* capture */
+ unsigned int num_adc_nids;
+ hda_nid_t *adc_nids;
+ hda_nid_t dig_in_nid; /* digital-in NID; optional */
+
+ /* capture source */
+ const struct hda_input_mux *input_mux;
+ hda_nid_t *capsrc_nids;
+ unsigned int cur_mux[3];
+
+ /* channel model */
+ const struct hda_channel_mode *channel_mode;
+ int num_channel_mode;
+
+ /* PCM information */
+ struct hda_pcm pcm_rec[2]; /* used in build_pcms() */
+
+ struct mutex amp_mutex; /* PCM volume/mute control mutex */
+ unsigned int spdif_route;
+
+ /* dynamic controls, init_verbs and input_mux */
+ struct auto_pin_cfg autocfg;
+ unsigned int num_kctl_alloc, num_kctl_used;
+ struct snd_kcontrol_new *kctl_alloc;
+ struct hda_input_mux private_imux;
+ hda_nid_t private_dac_nids[4];
+
+};
+
+static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+}
+
+static int conexant_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ unsigned int stream_tag,
+ unsigned int format,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, stream_tag,
+ format, substream);
+}
+
+static int conexant_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
+}
+
+/*
+ * Digital out
+ */
+static int conexant_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_dig_open(codec, &spec->multiout);
+}
+
+static int conexant_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_multi_out_dig_close(codec, &spec->multiout);
+}
+
+/*
+ * Analog capture
+ */
+static int conexant_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ unsigned int stream_tag,
+ unsigned int format,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number],
+ stream_tag, 0, format);
+ return 0;
+}
+
+static int conexant_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+{
+ struct conexant_spec *spec = codec->spec;
+ snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number],
+ 0, 0, 0);
+ return 0;
+}
+
+
+
+static struct hda_pcm_stream conexant_pcm_analog_playback = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ .nid = 0, /* fill later */
+ .ops = {
+ .open = conexant_playback_pcm_open,
+ .prepare = conexant_playback_pcm_prepare,
+ .cleanup = conexant_playback_pcm_cleanup
+ },
+
+};
+
+static struct hda_pcm_stream conexant_pcm_analog_capture = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ .nid = 0, /* fill later */
+ .ops = {
+ .prepare = conexant_capture_pcm_prepare,
+ .cleanup = conexant_capture_pcm_cleanup
+ },
+
+};
+
+
+static struct hda_pcm_stream conexant_pcm_digital_playback = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ .nid = 0, /* fill later */
+ .ops = {
+ .open = conexant_dig_playback_pcm_open,
+ .close = conexant_dig_playback_pcm_close
+ },
+};
+
+static struct hda_pcm_stream conexant_pcm_digital_capture = {
+ .substreams = 1,
+ .channels_min = 2,
+ .channels_max = 2,
+ /* NID is set in alc_build_pcms */
+};
+
+static int conexant_build_pcms(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ struct hda_pcm *info = spec->pcm_rec;
+
+ codec->num_pcms = 1;
+ codec->pcm_info = info;
+
+ info->name = "CONEXANT Analog";
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK] = conexant_pcm_analog_playback;
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = spec->multiout.max_channels;
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dac_nids[0];
+ info->stream[SNDRV_PCM_STREAM_CAPTURE] = conexant_pcm_analog_capture;
+ info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = spec->num_adc_nids;
+ info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
+
+ if (spec->multiout.dig_out_nid) {
+ info++;
+ codec->num_pcms++;
+ info->name = "Conexant Digital";
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK] = conexant_pcm_digital_playback;
+ info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid;
+ if (spec->dig_in_nid) {
+ info->stream[SNDRV_PCM_STREAM_CAPTURE] = conexant_pcm_digital_capture;
+ info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in_nid;
+ }
+ }
+
+ return 0;
+}
+/* */
+static struct hda_input_mux conexant_capture_source = {
+ .num_items = 2,
+ .items = {
+ { "ExtMic", 0x1 },
+ { "IntMic", 0x2 },
+ }
+};
+
+static int conexant_mux_enum_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+
+ return snd_hda_input_mux_info(spec->input_mux, uinfo);
+}
+
+static int conexant_mux_enum_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+ ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx];
+ return 0;
+}
+
+static int conexant_mux_enum_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+
+ return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
+ spec->capsrc_nids[adc_idx],
+ &spec->cur_mux[adc_idx]);
+}
+
+static int conexant_init(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ int i;
+
+ for (i = 0; i < spec->num_init_verbs; i++)
+ snd_hda_sequence_write(codec, spec->init_verbs[i]);
+ return 0;
+}
+
+static void conexant_free(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ unsigned int i;
+
+ if (spec->kctl_alloc) {
+ for (i = 0; i < spec->num_kctl_used; i++)
+ kfree(spec->kctl_alloc[i].name);
+ kfree(spec->kctl_alloc);
+ }
+
+ kfree(codec->spec);
+}
+
+#ifdef CONFIG_PM
+static int conexant_resume(struct hda_codec *codec)
+{
+ struct conexant_spec *spec = codec->spec;
+ int i;
+
+ codec->patch_ops.init(codec);
+ for (i = 0; i < spec->num_mixers; i++)
+ snd_hda_resume_ctls(codec, spec->mixers[i]);
+ if (spec->multiout.dig_out_nid)
+ snd_hda_resume_spdif_out(codec);
+ if (spec->dig_in_nid)
+ snd_hda_resume_spdif_in(codec);
+ return 0;
+}
+#endif
+
+static int conexant_build_controls(struct hda_codec *codec) {
+ struct conexant_spec *spec = codec->spec;
+ unsigned int i;
+ int err;
+
+ for (i = 0; i < spec->num_mixers; i++) {
+ err = snd_hda_add_new_ctls(codec, spec->mixers[i]);
+ if (err < 0)
+ return err;
+ }
+ if (spec->multiout.dig_out_nid) {
+ err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
+ if (err < 0)
+ return err;
+ }
+ if (spec->dig_in_nid) {
+ err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
+ if (err < 0)
+ return err;
+ }
+ return 0;
+}
+
+static struct hda_codec_ops conexant_patch_ops = {
+ .build_controls = conexant_build_controls,
+ .build_pcms = conexant_build_pcms,
+ .init = conexant_init,
+ .free = conexant_free,
+#ifdef CONFIG_PM
+ .resume = conexant_resume,
+#endif
+};
+
+/*
+ * EAPD control
+ * the private value = nid | (invert << 8)
+ */
+
+#define CXT5047_HP_EVENT 0x37
+#define CXT5047_MIC_EVENT 0x38
+
+
+static int conexant_eapd_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int conexant_eapd_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ int invert = (kcontrol->private_value >> 8) & 1;
+ if (invert)
+ ucontrol->value.integer.value[0] = ! spec->cur_eapd;
+ else
+ ucontrol->value.integer.value[0] = spec->cur_eapd;
+ return 0;
+}
+
+static int conexant_eapd_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ int invert = (kcontrol->private_value >> 8) & 1;
+ hda_nid_t nid = kcontrol->private_value & 0xff;
+ unsigned int eapd;
+ eapd = ucontrol->value.integer.value[0];
+ if (invert)
+ eapd = !eapd;
+ if (eapd == spec->cur_eapd && ! codec->in_resume)
+ return 0;
+ spec->cur_eapd = eapd;
+ snd_hda_codec_write(codec, nid,
+ 0, AC_VERB_SET_EAPD_BTLENABLE,
+ eapd ? 0x02 : 0x00);
+ return 1;
+}
+
+static int conexant_ch_mode_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_ch_mode_info(codec, uinfo, spec->channel_mode,
+ spec->num_channel_mode);
+}
+
+static int conexant_ch_mode_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ return snd_hda_ch_mode_get(codec, ucontrol, spec->channel_mode,
+ spec->num_channel_mode, spec->multiout.max_channels);
+}
+
+static int conexant_ch_mode_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+ int err = snd_hda_ch_mode_put(codec, ucontrol, spec->channel_mode,
+ spec->num_channel_mode,
+ &spec->multiout.max_channels);
+ if (err >= 0 && spec->need_dac_fix)
+ spec->multiout.num_dacs = spec->multiout.max_channels / 2;
+ return err;
+}
+
+
+/* Conexant 5047 specific */
+
+static hda_nid_t cxt5047_dac_nids[1] = { 0x10 };
+static hda_nid_t cxt5047_adc_nids[1] = { 0x12 };
+static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a };
+#define CXT5047_SPDIF_OUT 0x11
+
+
+/* turn on/off EAPD (+ mute HP) as a master switch */
+static int cxt5047_hp_master_sw_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct conexant_spec *spec = codec->spec;
+
+ if (! conexant_eapd_put(kcontrol, ucontrol))
+ return 0;
+
+ /* toggle HP mute appropriately */
+ snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0,
+ 0x80, spec->cur_eapd ? 0 : 0x80);
+ snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0,
+ 0x80, spec->cur_eapd ? 0 : 0x80);
+ return 1;
+}
+
+/* bind volumes of both NID 0x13 and 0x14 */
+static int cxt5047_hp_master_vol_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ long *valp = ucontrol->value.integer.value;
+ int change;
+
+ change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
+ 0x7f, valp[0] & 0x7f);
+ change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
+ 0x7f, valp[1] & 0x7f);
+ snd_hda_codec_amp_update(codec, 0x13, 0, HDA_OUTPUT, 0,
+ 0x7f, valp[0] & 0x7f);
+ snd_hda_codec_amp_update(codec, 0x13, 1, HDA_OUTPUT, 0,
+ 0x7f, valp[1] & 0x7f);
+ return change;
+}
+
+
+/* mute internal speaker if HP is plugged */
+static void cxt5047_hp_automute(struct hda_codec *codec)
+{
+ unsigned int present;
+
+ present = snd_hda_codec_read(codec, 0x13, 0,
+ AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+ snd_hda_codec_amp_update(codec, 0x1c, 0, HDA_OUTPUT, 0,
+ 0x80, present ? 0x80 : 0);
+ snd_hda_codec_amp_update(codec, 0x1c, 1, HDA_OUTPUT, 0,
+ 0x80, present ? 0x80 : 0);
+}
+
+/* toggle input of built-in and mic jack appropriately */
+static void cxt5047_hp_automic(struct hda_codec *codec)
+{
+ static struct hda_verb mic_jack_on[] = {
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ {}
+ };
+ static struct hda_verb mic_jack_off[] = {
+ {0x17, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+ {}
+ };
+ unsigned int present;
+
+ present = snd_hda_codec_read(codec, 0x08, 0,
+ AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
+ if (present)
+ snd_hda_sequence_write(codec, mic_jack_on);
+ else
+ snd_hda_sequence_write(codec, mic_jack_off);
+}
+
+/* unsolicited event for HP jack sensing */
+static void cxt5047_hp_unsol_event(struct hda_codec *codec,
+ unsigned int res)
+{
+ res >>= 26;
+ switch (res) {
+ case CXT5047_HP_EVENT:
+ cxt5047_hp_automute(codec);
+ break;
+ case CXT5047_MIC_EVENT:
+ cxt5047_hp_automic(codec);
+ break;
+ }
+}
+
+static struct snd_kcontrol_new cxt5047_mixers[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put
+ },
+ HDA_CODEC_VOLUME("Mic Bypass Capture Volume",0x19,0x02,HDA_INPUT),
+ HDA_CODEC_MUTE("Mic Bypass Capture Switch",0x19,0x02,HDA_INPUT),
+ HDA_CODEC_VOLUME("Capture Volume",0x12,0x03,HDA_INPUT),
+ HDA_CODEC_MUTE("Capture Switch",0x12,0x03,HDA_INPUT),
+ HDA_CODEC_VOLUME("PCM Volume",0x10,0x00,HDA_OUTPUT),
+ HDA_CODEC_MUTE("PCM Switch",0x10,0x00,HDA_OUTPUT),
+ HDA_CODEC_VOLUME("Headphone Playback Volume",0x13,0x00,HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Headphone Playback Switch",
+ .info = conexant_eapd_info,
+ .get = conexant_eapd_get,
+ .put = cxt5047_hp_master_sw_put,
+ .private_value = 0x13,
+ },
+
+ {}
+};
+
+#if 0
+static struct snd_kcontrol_new cxt5047_hp_mixers[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Master Playback Volume",
+ .info = snd_hda_mixer_amp_volume_info,
+ .get = snd_hda_mixer_amp_volume_get,
+ .put = cxt5047_hp_master_vol_put,
+ .private_value = HDA_COMPOSE_AMP_VAL(0x13, 3, 0, HDA_OUTPUT),
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Master Playback Switch",
+ .info = conexant_eapd_info,
+ .get = conexant_eapd_get,
+ .put = cxt5047_hp_master_sw_put,
+ .private_value = 0x13,
+ },
+ HDA_CODEC_VOLUME("PCM Playback Volume", 0x10, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("PCM Playback Switch", 0x10, 0x0, HDA_OUTPUT),
+ HDA_CODEC_VOLUME("Mic Boost", 0x15, 0x0, HDA_INPUT),
+ HDA_CODEC_VOLUME("Internal Mic Boost", 0x17, 0x0, HDA_INPUT),
+ HDA_CODEC_VOLUME("Capture Volume", 0x19, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("Capture Switch", 0x19, 0x0, HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Capture Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put,
+ },
+ { } /* end */
+};
+#endif
+
+static struct hda_verb cxt5047_init_verbs[] = {
+ /* Line in, Mic, Built-in Mic */
+ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
+ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
+ {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
+ /* HP, Amp */
+ {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
+ {0x1A, AC_VERB_SET_CONNECT_SEL,0x01},
+ {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x00},
+ {0x1A, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_OUTPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x03},
+ /* Record selector: Front mic */
+ {0x12, AC_VERB_SET_CONNECT_SEL,0x03},
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
+ /* SPDIF route: PCM */
+ { 0x18, AC_VERB_SET_CONNECT_SEL, 0x0 },
+ { } /* end */
+};
+
+/* configuration for Toshiba Laptops */
+static struct hda_verb cxt5047_toshiba_init_verbs[] = {
+ {0x13, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */
+ /* pin sensing on HP and Mic jacks */
+ {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CXT5047_HP_EVENT},
+ {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CXT5047_MIC_EVENT},
+ {}
+};
+
+/* configuration for HP Laptops */
+static struct hda_verb cxt5047_hp_init_verbs[] = {
+ /* pin sensing on HP and Mic jacks */
+ {0x13, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CXT5047_HP_EVENT},
+ {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CXT5047_MIC_EVENT},
+ {}
+};
+/* Test configuration for debugging, modelled after the ALC260 test
+ * configuration.
+ */
+#ifdef CONFIG_SND_DEBUG
+static struct hda_input_mux cxt5047_test_capture_sources[1] = {
+ {
+ .num_items = 6,
+ .items = {
+ { "MIXER", 0x0 },
+ { "LINE1 pin", 0x1 },
+ { "MIC1 pin", 0x2 },
+ { "MIC2 pin", 0x3 },
+ { "CD pin", 0x4 },
+ { "HP-OUT pin", 0x5 },
+ },
+ },
+};
+
+#define CXT_PIN_MODE(xname, nid, dir) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = conexant_ch_mode_info, \
+ .get = conexant_ch_mode_get, \
+ .put = conexant_ch_mode_put, \
+ .private_value = nid | (dir<<16) }
+
+static int cxt_gpio_data_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int cxt_gpio_data_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long *valp = ucontrol->value.integer.value;
+ unsigned int val = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_GPIO_DATA, 0x00);
+
+ *valp = (val & mask) != 0;
+ return 0;
+}
+
+static int cxt_gpio_data_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ signed int change;
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long val = *ucontrol->value.integer.value;
+ unsigned int gpio_data = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_GPIO_DATA,
+ 0x00);
+
+ /* Set/unset the masked GPIO bit(s) as needed */
+ change = (val == 0 ? 0 : mask) != (gpio_data & mask);
+ if (val == 0)
+ gpio_data &= ~mask;
+ else
+ gpio_data |= mask;
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_GPIO_DATA, gpio_data);
+
+ return change;
+}
+
+#define CXT_GPIO_DATA_SWITCH(xname, nid, mask) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = cxt_gpio_data_info, \
+ .get = cxt_gpio_data_get, \
+ .put = cxt_gpio_data_put, \
+ .private_value = nid | (mask<<16) }
+
+static int cxt_spdif_ctrl_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+ uinfo->count = 1;
+ uinfo->value.integer.min = 0;
+ uinfo->value.integer.max = 1;
+ return 0;
+}
+
+static int cxt_spdif_ctrl_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long *valp = ucontrol->value.integer.value;
+ unsigned int val = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_DIGI_CONVERT, 0x00);
+
+ *valp = (val & mask) != 0;
+ return 0;
+}
+
+static int cxt_spdif_ctrl_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ signed int change;
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ hda_nid_t nid = kcontrol->private_value & 0xffff;
+ unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
+ long val = *ucontrol->value.integer.value;
+ unsigned int ctrl_data = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_DIGI_CONVERT,
+ 0x00);
+
+ /* Set/unset the masked control bit(s) as needed */
+ change = (val == 0 ? 0 : mask) != (ctrl_data & mask);
+ if (val==0)
+ ctrl_data &= ~mask;
+ else
+ ctrl_data |= mask;
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
+ ctrl_data);
+
+ return change;
+}
+
+#define CXT_SPDIF_CTRL_SWITCH(xname, nid, mask) \
+ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \
+ .info = cxt_spdif_ctrl_info, \
+ .get = cxt_spdif_ctrl_get, \
+ .put = cxt_spdif_ctrl_put, \
+ .private_value = nid | (mask<<16) }
+
+static struct snd_kcontrol_new cxt5047_test_mixer[] = {
+
+ /* Modes for retasking pin widgets */
+ CXT_PIN_MODE("HP-OUT pin mode", 0x13, CXT_PIN_DIR_INOUT),
+ CXT_PIN_MODE("LINE1 pin mode", 0x14, CXT_PIN_DIR_INOUT),
+ CXT_PIN_MODE("MIC1 pin mode", 0x15, CXT_PIN_DIR_INOUT),
+
+ /* Loopback mixer controls */
+ HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x19, 0x00, HDA_INPUT),
+ HDA_CODEC_MUTE("MIC1 Playback Switch", 0x19, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x19, 0x01, HDA_INPUT),
+ HDA_CODEC_MUTE("MIC2 Playback Switch", 0x19, 0x01, HDA_INPUT),
+ HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x19, 0x03, HDA_INPUT),
+ HDA_CODEC_MUTE("LINE2 Playback Switch", 0x19, 0x03, HDA_INPUT),
+ HDA_CODEC_VOLUME("CD Playback Volume", 0x19, 0x04, HDA_INPUT),
+ HDA_CODEC_MUTE("CD Playback Switch", 0x19, 0x04, HDA_INPUT),
+ HDA_CODEC_VOLUME("Beep Playback Volume", 0x19, 0x05, HDA_INPUT),
+ HDA_CODEC_MUTE("Beep Playback Switch", 0x19, 0x05, HDA_INPUT),
+ HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x19, 0x06, HDA_INPUT),
+ HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x19, 0x06, HDA_INPUT),
+ HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x19, 0x07, HDA_INPUT),
+ HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x19, 0x07, HDA_INPUT),
+
+ /* Controls for GPIO pins, assuming they exist and are configured as outputs */
+ CXT_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
+ CXT_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
+
+ CXT_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x18, 0x01),
+
+ HDA_CODEC_VOLUME("Capture Volume", 0x19, 0x0, HDA_OUTPUT),
+ HDA_CODEC_MUTE("Capture Switch", 0x19, 0x0, HDA_OUTPUT),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Input Source",
+ .info = conexant_mux_enum_info,
+ .get = conexant_mux_enum_get,
+ .put = conexant_mux_enum_put,
+ },
+
+ { } /* end */
+};
+
+static struct hda_verb cxt5047_test_init_verbs[] = {
+ /* Enable all GPIOs as outputs with an initial value of 0 */
+ {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
+ {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
+ {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
+
+ /* Enable retasking pins as output, initially without power amp */
+ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+ {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+ {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+
+ /* Disable digital (SPDIF) pins initially, but users can enable
+ * them via a mixer switch. In the case of SPDIF-out, this initverb
+ * payload also sets the generation to 0, output to be in "consumer"
+ * PCM format, copyright asserted, no pre-emphasis and no validity
+ * control.
+ */
+ {0x18, AC_VERB_SET_DIGI_CONVERT_1, 0},
+
+ /* Ensure mic1, mic2, line1 pin widgets take input from the
+ * OUT1 sum bus when acting as an output.
+ */
+ {0x1a, AC_VERB_SET_CONNECT_SEL, 0},
+ {0x1b, AC_VERB_SET_CONNECT_SEL, 0},
+
+ /* Start with output sum widgets muted and their output gains at min */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+
+ /* Unmute retasking pin widget output buffers since the default
+ * state appears to be output. As the pin mode is changed by the
+ * user the pin mode control will take care of enabling the pin's
+ * input/output buffers as needed.
+ */
+ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+ {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+ {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+
+ /* Mute capture amp left and right */
+ {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+
+ /* Set ADC connection select to match default mixer setting (mic1
+ * pin)
+ */
+ {0x12, AC_VERB_SET_CONNECT_SEL, 0x00},
+
+ /* Mute all inputs to mixer widget (even unconnected ones) */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
+ {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
+
+ { }
+};
+#endif
+
+
+/* initialize jack-sensing, too */
+static int cxt5047_hp_init(struct hda_codec *codec)
+{
+ conexant_init(codec);
+ cxt5047_hp_automute(codec);
+ cxt5047_hp_automic(codec);
+ return 0;
+}
+
+
+enum { CXT5047_LAPTOP,
+#ifdef CONFIG_SND_DEBUG
+ CXT5047_TEST,
+#endif
+ CXT5047_LAPTOP_EAPD };
+
+static struct hda_board_config cxt5047_cfg_tbl[] = {
+ /* Laptops w/o EAPD support */
+ { .modelname = "laptop", .config = CXT5047_LAPTOP },
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a0,
+ .config = CXT5047_LAPTOP }, /*HP DV1000 */
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30b2,
+ .config = CXT5047_LAPTOP }, /*HP DV2000T */
+ { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a5,
+ .config = CXT5047_LAPTOP }, /*HP DV8000 */
+ /* Laptops with EAPD support */
+ { .modelname = "laptop-eapd", .config = CXT5047_LAPTOP_EAPD },
+ { .pci_subvendor = 0x1179, .pci_subdevice = 0xff31,
+ .config = CXT5047_LAPTOP_EAPD }, /* Toshiba P100 */
+#ifdef CONFIG_SND_DEBUG
+ { .modelname = "test", .config = CXT5047_TEST },
+#endif
+
+ {}
+};
+
+static int patch_cxt5047(struct hda_codec *codec) {
+ struct conexant_spec *spec;
+ int board_config;
+
+ spec = kzalloc(sizeof(*spec), GFP_KERNEL);
+ if ( !spec )
+ return -ENOMEM;
+ mutex_init(&spec->amp_mutex);
+ codec->spec = spec;
+
+ spec->multiout.max_channels = 2;
+ spec->multiout.num_dacs = ARRAY_SIZE(cxt5047_dac_nids);
+ spec->multiout.dac_nids = cxt5047_dac_nids;
+ spec->multiout.dig_out_nid = CXT5047_SPDIF_OUT;
+ spec->num_adc_nids = 1;
+ spec->adc_nids = cxt5047_adc_nids;
+ spec->capsrc_nids = cxt5047_capsrc_nids;
+ spec->input_mux = &conexant_capture_source;
+ spec->num_mixers = 1;
+ spec->mixers[0] = cxt5047_mixers;
+ spec->num_init_verbs = 1;
+ spec->init_verbs[0] = cxt5047_init_verbs;
+ spec->spdif_route = 0;
+
+ codec->patch_ops = conexant_patch_ops;
+ codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
+
+ board_config = snd_hda_check_board_config(codec, cxt5047_cfg_tbl);
+ switch (board_config) {
+ case CXT5047_LAPTOP:
+ spec->num_init_verbs = 2;
+ spec->init_verbs[1] = cxt5047_hp_init_verbs;
+
+ codec->patch_ops.init = cxt5047_hp_init;
+ break;
+ case CXT5047_LAPTOP_EAPD:
+ spec->num_init_verbs = 2;
+ spec->init_verbs[1] = cxt5047_toshiba_init_verbs;
+ break;
+#ifdef CONFIG_SND_DEBUG
+ case CXT5047_TEST:
+ spec->input_mux = cxt5047_test_capture_sources;
+ spec->mixers[0] = cxt5047_test_mixer;
+ spec->init_verbs[0] = cxt5047_test_init_verbs;
+#endif
+ }
+ return 0;
+}
+
+struct hda_codec_preset snd_hda_preset_conexant[] = {
+ { .id = 0x14f15047, .name = "CXT5047", .patch = patch_cxt5047 },
+ {} /* terminator */
+};
[-- Attachment #3: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-11-09 0:08 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 9:52 Conexant test code Tobin Davis
2006-11-04 12:35 ` Konstantin Shaposhnikov
2006-11-04 18:05 ` Guyjo91
2006-11-04 23:55 ` Anders
2006-11-05 13:45 ` Matthew Strahan
2006-11-05 14:03 ` Konstantin Shaposhnikov
2006-11-05 22:52 ` enigma_0Z
2006-11-09 0:08 ` Anders
-- strict thread matches above, loose matches on Subject: below --
2006-11-04 17:56 alsa
[not found] <1162339150.18211.239.camel@razman>
2006-11-02 17:59 ` Konstantin Shaposhnikov
2006-10-27 16:44 Tobin Davis
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.