Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182642
b: refs/heads/master
c: 5240279
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Dec 23, 2009
1 parent 711c56c commit cee3abf
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75d1aeb9d6899b10420d10284e8ea894b2794224
refs/heads/master: 524027916e5763a0c9a7da80aa8dd013a14a0440
1 change: 1 addition & 0 deletions trunk/Documentation/sound/alsa/HD-Audio-Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,5 @@ STAC9872
Cirrus Logic CS4206/4207
========================
mbp55 MacBook Pro 5,5
imac27 IMac 27 Inch
auto BIOS setup (default)
1 change: 1 addition & 0 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev)
* white/black-list for enable_msi
*/
static struct snd_pci_quirk msi_black_list[] __devinitdata = {
SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */
{}
};

Expand Down
22 changes: 21 additions & 1 deletion trunk/sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct cs_spec {
/* available models */
enum {
CS420X_MBP55,
CS420X_IMAC27,
CS420X_AUTO,
CS420X_MODELS
};
Expand Down Expand Up @@ -833,7 +834,8 @@ static void cs_automute(struct hda_codec *codec)
AC_VERB_SET_PIN_WIDGET_CONTROL,
hp_present ? 0 : PIN_OUT);
}
if (spec->board_config == CS420X_MBP55) {
if (spec->board_config == CS420X_MBP55 ||
spec->board_config == CS420X_IMAC27) {
unsigned int gpio = hp_present ? 0x02 : 0x08;
snd_hda_codec_write(codec, 0x01, 0,
AC_VERB_SET_GPIO_DATA, gpio);
Expand Down Expand Up @@ -1075,12 +1077,14 @@ static int cs_parse_auto_config(struct hda_codec *codec)

static const char *cs420x_models[CS420X_MODELS] = {
[CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27",
[CS420X_AUTO] = "auto",
};


static struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
{} /* terminator */
};

Expand All @@ -1103,8 +1107,23 @@ static struct cs_pincfg mbp55_pincfgs[] = {
{} /* terminator */
};

static struct cs_pincfg imac27_pincfgs[] = {
{ 0x09, 0x012b4050 },
{ 0x0a, 0x90100140 },
{ 0x0b, 0x90100142 },
{ 0x0c, 0x018b3020 },
{ 0x0d, 0x90a00110 },
{ 0x0e, 0x400000f0 },
{ 0x0f, 0x01cbe030 },
{ 0x10, 0x014be060 },
{ 0x12, 0x01ab9070 },
{ 0x15, 0x400000f0 },
{} /* terminator */
};

static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
[CS420X_MBP55] = mbp55_pincfgs,
[CS420X_IMAC27] = imac27_pincfgs,
};

static void fix_pincfg(struct hda_codec *codec, int model)
Expand Down Expand Up @@ -1134,6 +1153,7 @@ static int patch_cs420x(struct hda_codec *codec)
fix_pincfg(codec, spec->board_config);

switch (spec->board_config) {
case CS420X_IMAC27:
case CS420X_MBP55:
/* GPIO1 = headphones */
/* GPIO3 = speakers */
Expand Down
43 changes: 37 additions & 6 deletions trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "hda_codec.h"
#include "hda_local.h"
#include "hda_beep.h"

#define CXT_PIN_DIR_IN 0x00
#define CXT_PIN_DIR_OUT 0x01
Expand Down Expand Up @@ -111,6 +112,7 @@ struct conexant_spec {
unsigned int dell_automute;
unsigned int port_d_mode;
unsigned char ext_mic_bias;
unsigned int dell_vostro;
};

static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
Expand Down Expand Up @@ -476,6 +478,7 @@ static void conexant_free(struct hda_codec *codec)
snd_array_free(&spec->jacks);
}
#endif
snd_hda_detach_beep_device(codec);
kfree(codec->spec);
}

Expand Down Expand Up @@ -2109,9 +2112,12 @@ static int cxt5066_mic_boost_mux_enum_get(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
int val;
hda_nid_t nid = kcontrol->private_value & 0xff;
int inout = (kcontrol->private_value & 0x100) ?
AC_AMP_GET_INPUT : AC_AMP_GET_OUTPUT;

val = snd_hda_codec_read(codec, 0x17, 0,
AC_VERB_GET_AMP_GAIN_MUTE, AC_AMP_GET_OUTPUT);
val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_AMP_GAIN_MUTE, inout);

ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN;
return 0;
Expand All @@ -2123,16 +2129,19 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
const struct hda_input_mux *imux = &cxt5066_analog_mic_boost;
unsigned int idx;
hda_nid_t nid = kcontrol->private_value & 0xff;
int inout = (kcontrol->private_value & 0x100) ?
AC_AMP_SET_INPUT : AC_AMP_SET_OUTPUT;

if (!imux->num_items)
return 0;
idx = ucontrol->value.enumerated.item[0];
if (idx >= imux->num_items)
idx = imux->num_items - 1;

snd_hda_codec_write_cache(codec, 0x17, 0,
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT |
AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | inout |
imux->items[idx].index);

return 1;
Expand Down Expand Up @@ -2202,17 +2211,31 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {

{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Analog Mic Boost Capture Enum",
.name = "Ext Mic Boost Capture Enum",
.info = cxt5066_mic_boost_mux_enum_info,
.get = cxt5066_mic_boost_mux_enum_get,
.put = cxt5066_mic_boost_mux_enum_put,
.private_value = 0x17,
},

HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others),
HDA_BIND_SW("Capture Switch", &cxt5066_bind_capture_sw_others),
{}
};

static struct snd_kcontrol_new cxt5066_vostro_mixers[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Int Mic Boost Capture Enum",
.info = cxt5066_mic_boost_mux_enum_info,
.get = cxt5066_mic_boost_mux_enum_get,
.put = cxt5066_mic_boost_mux_enum_put,
.private_value = 0x23 | 0x100,
},
HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT),
{}
};

static struct hda_verb cxt5066_init_verbs[] = {
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */
Expand Down Expand Up @@ -2398,11 +2421,16 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = {
/* initialize jack-sensing, too */
static int cxt5066_init(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;

snd_printdd("CXT5066: init\n");
conexant_init(codec);
if (codec->patch_ops.unsol_event) {
cxt5066_hp_automute(codec);
cxt5066_automic(codec);
if (spec->dell_vostro)
cxt5066_vostro_automic(codec);
else
cxt5066_automic(codec);
}
return 0;
}
Expand Down Expand Up @@ -2501,7 +2529,10 @@ static int patch_cxt5066(struct hda_codec *codec)
spec->init_verbs[0] = cxt5066_init_verbs_vostro;
spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
spec->mixers[spec->num_mixers++] = cxt5066_mixers;
spec->mixers[spec->num_mixers++] = cxt5066_vostro_mixers;
spec->port_d_mode = 0;
spec->dell_vostro = 1;
snd_hda_attach_beep_device(codec, 0x13);

/* no S/PDIF out */
spec->multiout.dig_out_nid = 0;
Expand Down
Loading

0 comments on commit cee3abf

Please sign in to comment.