Commit c400c9e2 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'topic/hda' into for-linus

parents e38302f7 80c67852
...@@ -149,7 +149,6 @@ ALC882/883/885/888/889 ...@@ -149,7 +149,6 @@ ALC882/883/885/888/889
acer-aspire-7730g Acer Aspire 7730G acer-aspire-7730g Acer Aspire 7730G
acer-aspire-8930g Acer Aspire 8930G acer-aspire-8930g Acer Aspire 8930G
medion Medion Laptops medion Medion Laptops
medion-md2 Medion MD2
targa-dig Targa/MSI targa-dig Targa/MSI
targa-2ch-dig Targa/MSI with 2-channel targa-2ch-dig Targa/MSI with 2-channel
targa-8ch-dig Targa/MSI with 8-channel (MSI GX620) targa-8ch-dig Targa/MSI with 8-channel (MSI GX620)
......
...@@ -4571,6 +4571,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -4571,6 +4571,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
} }
memset(cfg->hp_pins + cfg->hp_outs, 0, memset(cfg->hp_pins + cfg->hp_outs, 0,
sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs)); sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs));
if (!cfg->hp_outs)
cfg->line_out_type = AUTO_PIN_HP_OUT;
} }
/* sort by sequence */ /* sort by sequence */
......
This diff is collapsed.
This diff is collapsed.
...@@ -31,10 +31,15 @@ ...@@ -31,10 +31,15 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/moduleparam.h>
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
static bool static_hdmi_pcm;
module_param(static_hdmi_pcm, bool, 0644);
MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
/* /*
* The HDMI/DisplayPort configuration can be highly dynamic. A graphics device * The HDMI/DisplayPort configuration can be highly dynamic. A graphics device
* could support two independent pipes, each of them can be connected to one or * could support two independent pipes, each of them can be connected to one or
...@@ -827,7 +832,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -827,7 +832,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
*codec_pars = *hinfo; *codec_pars = *hinfo;
eld = &spec->sink_eld[idx]; eld = &spec->sink_eld[idx];
if (eld->sad_count > 0) { if (!static_hdmi_pcm && eld->eld_valid && eld->sad_count > 0) {
hdmi_eld_update_pcm_info(eld, hinfo, codec_pars); hdmi_eld_update_pcm_info(eld, hinfo, codec_pars);
if (hinfo->channels_min > hinfo->channels_max || if (hinfo->channels_min > hinfo->channels_max ||
!hinfo->rates || !hinfo->formats) !hinfo->rates || !hinfo->formats)
...@@ -904,23 +909,28 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) ...@@ -904,23 +909,28 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
spec->pin[spec->num_pins] = pin_nid; spec->pin[spec->num_pins] = pin_nid;
spec->num_pins++; spec->num_pins++;
/*
* It is assumed that converter nodes come first in the node list and
* hence have been registered and usable now.
*/
return hdmi_read_pin_conn(codec, pin_nid); return hdmi_read_pin_conn(codec, pin_nid);
} }
static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t nid) static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t nid)
{ {
int i, found_pin = 0;
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
if (spec->num_cvts >= MAX_HDMI_CVTS) { for (i = 0; i < spec->num_pins; i++)
snd_printk(KERN_WARNING if (nid == spec->pin_cvt[i]) {
"HDMI: no space for converter %d\n", nid); found_pin = 1;
return -E2BIG; break;
}
if (!found_pin) {
snd_printdd("HDMI: Skipping node %d (no connection)\n", nid);
return -EINVAL;
} }
if (snd_BUG_ON(spec->num_cvts >= MAX_HDMI_CVTS))
return -E2BIG;
spec->cvt[spec->num_cvts] = nid; spec->cvt[spec->num_cvts] = nid;
spec->num_cvts++; spec->num_cvts++;
...@@ -931,6 +941,8 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -931,6 +941,8 @@ static int hdmi_parse_codec(struct hda_codec *codec)
{ {
hda_nid_t nid; hda_nid_t nid;
int i, nodes; int i, nodes;
int num_tmp_cvts = 0;
hda_nid_t tmp_cvt[MAX_HDMI_CVTS];
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
if (!nid || nodes < 0) { if (!nid || nodes < 0) {
...@@ -941,6 +953,7 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -941,6 +953,7 @@ static int hdmi_parse_codec(struct hda_codec *codec)
for (i = 0; i < nodes; i++, nid++) { for (i = 0; i < nodes; i++, nid++) {
unsigned int caps; unsigned int caps;
unsigned int type; unsigned int type;
unsigned int config;
caps = snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); caps = snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP);
type = get_wcaps_type(caps); type = get_wcaps_type(caps);
...@@ -950,17 +963,32 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -950,17 +963,32 @@ static int hdmi_parse_codec(struct hda_codec *codec)
switch (type) { switch (type) {
case AC_WID_AUD_OUT: case AC_WID_AUD_OUT:
hdmi_add_cvt(codec, nid); if (num_tmp_cvts >= MAX_HDMI_CVTS) {
snd_printk(KERN_WARNING
"HDMI: no space for converter %d\n", nid);
continue;
}
tmp_cvt[num_tmp_cvts] = nid;
num_tmp_cvts++;
break; break;
case AC_WID_PIN: case AC_WID_PIN:
caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP))) if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP)))
continue; continue;
config = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONFIG_DEFAULT, 0);
if (get_defcfg_connect(config) == AC_JACK_PORT_NONE)
continue;
hdmi_add_pin(codec, nid); hdmi_add_pin(codec, nid);
break; break;
} }
} }
for (i = 0; i < num_tmp_cvts; i++)
hdmi_add_cvt(codec, tmp_cvt[i]);
/* /*
* G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event * G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event
* can be lost and presence sense verb will become inaccurate if the * can be lost and presence sense verb will become inaccurate if the
...@@ -1165,11 +1193,53 @@ static int nvhdmi_7x_init(struct hda_codec *codec) ...@@ -1165,11 +1193,53 @@ static int nvhdmi_7x_init(struct hda_codec *codec)
return 0; return 0;
} }
static unsigned int channels_2_6_8[] = {
2, 6, 8
};
static unsigned int channels_2_8[] = {
2, 8
};
static struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = {
.count = ARRAY_SIZE(channels_2_6_8),
.list = channels_2_6_8,
.mask = 0,
};
static struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = {
.count = ARRAY_SIZE(channels_2_8),
.list = channels_2_8,
.mask = 0,
};
static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo, static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
struct hda_codec *codec, struct hda_codec *codec,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL;
switch (codec->preset->id) {
case 0x10de0002:
case 0x10de0003:
case 0x10de0005:
case 0x10de0006:
hw_constraints_channels = &hw_constraints_2_8_channels;
break;
case 0x10de0007:
hw_constraints_channels = &hw_constraints_2_6_8_channels;
break;
default:
break;
}
if (hw_constraints_channels != NULL) {
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_constraints_channels);
}
return snd_hda_multi_out_dig_open(codec, &spec->multiout); return snd_hda_multi_out_dig_open(codec, &spec->multiout);
} }
...@@ -1532,7 +1602,7 @@ static struct hda_codec_preset snd_hda_preset_hdmi[] = { ...@@ -1532,7 +1602,7 @@ static struct hda_codec_preset snd_hda_preset_hdmi[] = {
{ .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi }, { .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002aa01, .name = "R6xx HDMI", .patch = patch_atihdmi }, { .id = 0x1002aa01, .name = "R6xx HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10951390, .name = "SiI1390 HDMI", .patch = patch_generic_hdmi }, { .id = 0x10951390, .name = "SiI1390 HDMI", .patch = patch_generic_hdmi },
{ .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_generic_hdmi }, { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_generic_hdmi },
{ .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_generic_hdmi }, { .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_generic_hdmi },
......
This diff is collapsed.
...@@ -389,6 +389,9 @@ static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = { ...@@ -389,6 +389,9 @@ static hda_nid_t stac92hd83xxx_dmic_nids[STAC92HD83XXX_NUM_DMICS + 1] = {
0x11, 0x20, 0 0x11, 0x20, 0
}; };
#define STAC92HD88XXX_NUM_DMICS STAC92HD83XXX_NUM_DMICS
#define stac92hd88xxx_dmic_nids stac92hd83xxx_dmic_nids
#define STAC92HD87B_NUM_DMICS 1 #define STAC92HD87B_NUM_DMICS 1
static hda_nid_t stac92hd87b_dmic_nids[STAC92HD87B_NUM_DMICS + 1] = { static hda_nid_t stac92hd87b_dmic_nids[STAC92HD87B_NUM_DMICS + 1] = {
0x11, 0 0x11, 0
...@@ -3591,7 +3594,7 @@ static int stac_check_auto_mic(struct hda_codec *codec) ...@@ -3591,7 +3594,7 @@ static int stac_check_auto_mic(struct hda_codec *codec)
if (check_mic_pin(codec, spec->dmic_nids[i], if (check_mic_pin(codec, spec->dmic_nids[i],
&fixed, &ext, &dock)) &fixed, &ext, &dock))
return 0; return 0;
if (!fixed && !ext && !dock) if (!fixed || (!ext && !dock))
return 0; /* no input to switch */ return 0; /* no input to switch */
if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
return 0; /* no unsol support */ return 0; /* no unsol support */
...@@ -5422,7 +5425,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5422,7 +5425,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0);
codec->no_trigger_sense = 1; codec->no_trigger_sense = 1;
codec->spec = spec; codec->spec = spec;
spec->linear_tone_beep = 1; spec->linear_tone_beep = 0;
codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->digbeep_nid = 0x21; spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids; spec->dmic_nids = stac92hd83xxx_dmic_nids;
...@@ -5462,15 +5465,21 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5462,15 +5465,21 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
spec->num_dmics = stac92xx_connected_ports(codec, spec->num_dmics = stac92xx_connected_ports(codec,
stac92hd87b_dmic_nids, stac92hd87b_dmic_nids,
STAC92HD87B_NUM_DMICS); STAC92HD87B_NUM_DMICS);
/* Fall through */ spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids);
spec->pin_nids = stac92hd88xxx_pin_nids;
spec->mono_nid = 0;
spec->num_pwrs = 0;
break;
case 0x111d7666: case 0x111d7666:
case 0x111d7667: case 0x111d7667:
case 0x111d7668: case 0x111d7668:
case 0x111d7669: case 0x111d7669:
spec->num_dmics = stac92xx_connected_ports(codec,
stac92hd88xxx_dmic_nids,
STAC92HD88XXX_NUM_DMICS);
spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids);
spec->pin_nids = stac92hd88xxx_pin_nids; spec->pin_nids = stac92hd88xxx_pin_nids;
spec->mono_nid = 0; spec->mono_nid = 0;
spec->digbeep_nid = 0;
spec->num_pwrs = 0; spec->num_pwrs = 0;
break; break;
case 0x111d7604: case 0x111d7604:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment