Merge branch 'fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_realtek.c
This commit is contained in:
		
				commit
				
					
						b37c0096b4
					
				
			
		
					 10 changed files with 111 additions and 60 deletions
				
			
		| 
						 | 
					@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
 | 
				
			||||||
		struct cs5535audio_dma_desc *desc =
 | 
							struct cs5535audio_dma_desc *desc =
 | 
				
			||||||
			&((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
 | 
								&((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
 | 
				
			||||||
		desc->addr = cpu_to_le32(addr);
 | 
							desc->addr = cpu_to_le32(addr);
 | 
				
			||||||
		desc->size = cpu_to_le32(period_bytes);
 | 
							desc->size = cpu_to_le16(period_bytes);
 | 
				
			||||||
		desc->ctlreserved = cpu_to_le16(PRD_EOP);
 | 
							desc->ctlreserved = cpu_to_le16(PRD_EOP);
 | 
				
			||||||
		desc_addr += sizeof(struct cs5535audio_dma_desc);
 | 
							desc_addr += sizeof(struct cs5535audio_dma_desc);
 | 
				
			||||||
		addr += period_bytes;
 | 
							addr += period_bytes;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4046,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Search for codec ID */
 | 
						/* Search for codec ID */
 | 
				
			||||||
	for (q = tbl; q->subvendor; q++) {
 | 
						for (q = tbl; q->subvendor; q++) {
 | 
				
			||||||
		unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);
 | 
							unsigned int mask = 0xffff0000 | q->subdevice_mask;
 | 
				
			||||||
 | 
							unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;
 | 
				
			||||||
		if (vendorid == codec->subsystem_id)
 | 
							if ((codec->subsystem_id & mask) == id)
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -347,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < size; i++) {
 | 
						for (i = 0; i < size; i++) {
 | 
				
			||||||
		unsigned int val = hdmi_get_eld_data(codec, nid, i);
 | 
							unsigned int val = hdmi_get_eld_data(codec, nid, i);
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
 | 
							 * Graphics driver might be writing to ELD buffer right now.
 | 
				
			||||||
 | 
							 * Just abort. The caller will repoll after a while.
 | 
				
			||||||
 | 
							 */
 | 
				
			||||||
		if (!(val & AC_ELDD_ELD_VALID)) {
 | 
							if (!(val & AC_ELDD_ELD_VALID)) {
 | 
				
			||||||
			if (!i) {
 | 
					 | 
				
			||||||
				snd_printd(KERN_INFO
 | 
					 | 
				
			||||||
					   "HDMI: invalid ELD data\n");
 | 
					 | 
				
			||||||
				ret = -EINVAL;
 | 
					 | 
				
			||||||
				goto error;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			snd_printd(KERN_INFO
 | 
								snd_printd(KERN_INFO
 | 
				
			||||||
				  "HDMI: invalid ELD data byte %d\n", i);
 | 
									  "HDMI: invalid ELD data byte %d\n", i);
 | 
				
			||||||
			val = 0;
 | 
								ret = -EINVAL;
 | 
				
			||||||
		} else
 | 
								goto error;
 | 
				
			||||||
			val &= AC_ELDD_ELD_DATA;
 | 
							}
 | 
				
			||||||
 | 
							val &= AC_ELDD_ELD_DATA;
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
 | 
							 * The first byte cannot be zero. This can happen on some DVI
 | 
				
			||||||
 | 
							 * connections. Some Intel chips may also need some 250ms delay
 | 
				
			||||||
 | 
							 * to return non-zero ELD data, even when the graphics driver
 | 
				
			||||||
 | 
							 * correctly writes ELD content before setting ELD_valid bit.
 | 
				
			||||||
 | 
							 */
 | 
				
			||||||
 | 
							if (!val && !i) {
 | 
				
			||||||
 | 
								snd_printdd(KERN_INFO "HDMI: 0 ELD data\n");
 | 
				
			||||||
 | 
								ret = -EINVAL;
 | 
				
			||||||
 | 
								goto error;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		buf[i] = val;
 | 
							buf[i] = val;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,6 +58,8 @@ struct cs_spec {
 | 
				
			||||||
	unsigned int gpio_mask;
 | 
						unsigned int gpio_mask;
 | 
				
			||||||
	unsigned int gpio_dir;
 | 
						unsigned int gpio_dir;
 | 
				
			||||||
	unsigned int gpio_data;
 | 
						unsigned int gpio_data;
 | 
				
			||||||
 | 
						unsigned int gpio_eapd_hp; /* EAPD GPIO bit for headphones */
 | 
				
			||||||
 | 
						unsigned int gpio_eapd_speaker; /* EAPD GPIO bit for speakers */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct hda_pcm pcm_rec[2];	/* PCM information */
 | 
						struct hda_pcm pcm_rec[2];	/* PCM information */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,6 +78,7 @@ enum {
 | 
				
			||||||
	CS420X_MBP53,
 | 
						CS420X_MBP53,
 | 
				
			||||||
	CS420X_MBP55,
 | 
						CS420X_MBP55,
 | 
				
			||||||
	CS420X_IMAC27,
 | 
						CS420X_IMAC27,
 | 
				
			||||||
 | 
						CS420X_APPLE,
 | 
				
			||||||
	CS420X_AUTO,
 | 
						CS420X_AUTO,
 | 
				
			||||||
	CS420X_MODELS
 | 
						CS420X_MODELS
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -237,6 +240,15 @@ static int cs_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
 | 
				
			||||||
	return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
 | 
						return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void cs_update_input_select(struct hda_codec *codec)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct cs_spec *spec = codec->spec;
 | 
				
			||||||
 | 
						if (spec->cur_adc)
 | 
				
			||||||
 | 
							snd_hda_codec_write(codec, spec->cur_adc, 0,
 | 
				
			||||||
 | 
									    AC_VERB_SET_CONNECT_SEL,
 | 
				
			||||||
 | 
									    spec->adc_idx[spec->cur_input]);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Analog capture
 | 
					 * Analog capture
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -250,6 +262,7 @@ static int cs_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
 | 
				
			||||||
	spec->cur_adc = spec->adc_nid[spec->cur_input];
 | 
						spec->cur_adc = spec->adc_nid[spec->cur_input];
 | 
				
			||||||
	spec->cur_adc_stream_tag = stream_tag;
 | 
						spec->cur_adc_stream_tag = stream_tag;
 | 
				
			||||||
	spec->cur_adc_format = format;
 | 
						spec->cur_adc_format = format;
 | 
				
			||||||
 | 
						cs_update_input_select(codec);
 | 
				
			||||||
	snd_hda_codec_setup_stream(codec, spec->cur_adc, stream_tag, 0, format);
 | 
						snd_hda_codec_setup_stream(codec, spec->cur_adc, stream_tag, 0, format);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -689,10 +702,8 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx,
 | 
				
			||||||
					   spec->cur_adc_stream_tag, 0,
 | 
										   spec->cur_adc_stream_tag, 0,
 | 
				
			||||||
					   spec->cur_adc_format);
 | 
										   spec->cur_adc_format);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	snd_hda_codec_write(codec, spec->cur_adc, 0,
 | 
					 | 
				
			||||||
			    AC_VERB_SET_CONNECT_SEL,
 | 
					 | 
				
			||||||
			    spec->adc_idx[idx]);
 | 
					 | 
				
			||||||
	spec->cur_input = idx;
 | 
						spec->cur_input = idx;
 | 
				
			||||||
 | 
						cs_update_input_select(codec);
 | 
				
			||||||
	return 1;
 | 
						return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -920,10 +931,9 @@ static void cs_automute(struct hda_codec *codec)
 | 
				
			||||||
					spdif_present ? 0 : PIN_OUT);
 | 
										spdif_present ? 0 : PIN_OUT);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (spec->board_config == CS420X_MBP53 ||
 | 
						if (spec->gpio_eapd_hp) {
 | 
				
			||||||
	    spec->board_config == CS420X_MBP55 ||
 | 
							unsigned int gpio = hp_present ?
 | 
				
			||||||
	    spec->board_config == CS420X_IMAC27) {
 | 
								spec->gpio_eapd_hp : spec->gpio_eapd_speaker;
 | 
				
			||||||
		unsigned int gpio = hp_present ? 0x02 : 0x08;
 | 
					 | 
				
			||||||
		snd_hda_codec_write(codec, 0x01, 0,
 | 
							snd_hda_codec_write(codec, 0x01, 0,
 | 
				
			||||||
				    AC_VERB_SET_GPIO_DATA, gpio);
 | 
									    AC_VERB_SET_GPIO_DATA, gpio);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -973,10 +983,7 @@ static void cs_automic(struct hda_codec *codec)
 | 
				
			||||||
		} else  {
 | 
							} else  {
 | 
				
			||||||
			spec->cur_input = spec->last_input;
 | 
								spec->cur_input = spec->last_input;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							cs_update_input_select(codec);
 | 
				
			||||||
		snd_hda_codec_write_cache(codec, spec->cur_adc, 0,
 | 
					 | 
				
			||||||
					AC_VERB_SET_CONNECT_SEL,
 | 
					 | 
				
			||||||
					spec->adc_idx[spec->cur_input]);
 | 
					 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if (present)
 | 
							if (present)
 | 
				
			||||||
			change_cur_input(codec, spec->automic_idx, 0);
 | 
								change_cur_input(codec, spec->automic_idx, 0);
 | 
				
			||||||
| 
						 | 
					@ -1073,9 +1080,7 @@ static void init_input(struct hda_codec *codec)
 | 
				
			||||||
			cs_automic(codec);
 | 
								cs_automic(codec);
 | 
				
			||||||
		else  {
 | 
							else  {
 | 
				
			||||||
			spec->cur_adc = spec->adc_nid[spec->cur_input];
 | 
								spec->cur_adc = spec->adc_nid[spec->cur_input];
 | 
				
			||||||
			snd_hda_codec_write(codec, spec->cur_adc, 0,
 | 
								cs_update_input_select(codec);
 | 
				
			||||||
					AC_VERB_SET_CONNECT_SEL,
 | 
					 | 
				
			||||||
					spec->adc_idx[spec->cur_input]);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		change_cur_input(codec, spec->cur_input, 1);
 | 
							change_cur_input(codec, spec->cur_input, 1);
 | 
				
			||||||
| 
						 | 
					@ -1273,6 +1278,7 @@ static const char * const cs420x_models[CS420X_MODELS] = {
 | 
				
			||||||
	[CS420X_MBP53] = "mbp53",
 | 
						[CS420X_MBP53] = "mbp53",
 | 
				
			||||||
	[CS420X_MBP55] = "mbp55",
 | 
						[CS420X_MBP55] = "mbp55",
 | 
				
			||||||
	[CS420X_IMAC27] = "imac27",
 | 
						[CS420X_IMAC27] = "imac27",
 | 
				
			||||||
 | 
						[CS420X_IMAC27] = "apple",
 | 
				
			||||||
	[CS420X_AUTO] = "auto",
 | 
						[CS420X_AUTO] = "auto",
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1282,7 +1288,13 @@ static const struct snd_pci_quirk cs420x_cfg_tbl[] = {
 | 
				
			||||||
	SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
 | 
						SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
 | 
				
			||||||
	SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
 | 
						SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
 | 
				
			||||||
	SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),
 | 
						SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),
 | 
				
			||||||
	SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
 | 
						/* this conflicts with too many other models */
 | 
				
			||||||
 | 
						/*SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),*/
 | 
				
			||||||
 | 
						{} /* terminator */
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static const struct snd_pci_quirk cs420x_codec_cfg_tbl[] = {
 | 
				
			||||||
 | 
						SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),
 | 
				
			||||||
	{} /* terminator */
 | 
						{} /* terminator */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1364,6 +1376,10 @@ static int patch_cs420x(struct hda_codec *codec)
 | 
				
			||||||
	spec->board_config =
 | 
						spec->board_config =
 | 
				
			||||||
		snd_hda_check_board_config(codec, CS420X_MODELS,
 | 
							snd_hda_check_board_config(codec, CS420X_MODELS,
 | 
				
			||||||
					   cs420x_models, cs420x_cfg_tbl);
 | 
										   cs420x_models, cs420x_cfg_tbl);
 | 
				
			||||||
 | 
						if (spec->board_config < 0)
 | 
				
			||||||
 | 
							spec->board_config =
 | 
				
			||||||
 | 
								snd_hda_check_board_codec_sid_config(codec,
 | 
				
			||||||
 | 
									CS420X_MODELS, NULL, cs420x_codec_cfg_tbl);
 | 
				
			||||||
	if (spec->board_config >= 0)
 | 
						if (spec->board_config >= 0)
 | 
				
			||||||
		fix_pincfg(codec, spec->board_config, cs_pincfgs);
 | 
							fix_pincfg(codec, spec->board_config, cs_pincfgs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1371,10 +1387,11 @@ static int patch_cs420x(struct hda_codec *codec)
 | 
				
			||||||
	case CS420X_IMAC27:
 | 
						case CS420X_IMAC27:
 | 
				
			||||||
	case CS420X_MBP53:
 | 
						case CS420X_MBP53:
 | 
				
			||||||
	case CS420X_MBP55:
 | 
						case CS420X_MBP55:
 | 
				
			||||||
		/* GPIO1 = headphones */
 | 
						case CS420X_APPLE:
 | 
				
			||||||
		/* GPIO3 = speakers */
 | 
							spec->gpio_eapd_hp = 2; /* GPIO1 = headphones */
 | 
				
			||||||
		spec->gpio_mask = 0x0a;
 | 
							spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */
 | 
				
			||||||
		spec->gpio_dir = 0x0a;
 | 
							spec->gpio_mask = spec->gpio_dir =
 | 
				
			||||||
 | 
								spec->gpio_eapd_hp | spec->gpio_eapd_speaker;
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -69,6 +69,7 @@ struct hdmi_spec_per_pin {
 | 
				
			||||||
	struct hda_codec *codec;
 | 
						struct hda_codec *codec;
 | 
				
			||||||
	struct hdmi_eld sink_eld;
 | 
						struct hdmi_eld sink_eld;
 | 
				
			||||||
	struct delayed_work work;
 | 
						struct delayed_work work;
 | 
				
			||||||
 | 
						int repoll_count;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct hdmi_spec {
 | 
					struct hdmi_spec {
 | 
				
			||||||
| 
						 | 
					@ -748,7 +749,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
 | 
				
			||||||
 * Unsolicited events
 | 
					 * Unsolicited events
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry);
 | 
					static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
 | 
					static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -766,7 +767,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
 | 
				
			||||||
	if (pin_idx < 0)
 | 
						if (pin_idx < 0)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hdmi_present_sense(&spec->pins[pin_idx], true);
 | 
						hdmi_present_sense(&spec->pins[pin_idx], 1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
 | 
					static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
 | 
				
			||||||
| 
						 | 
					@ -960,7 +961,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry)
 | 
					static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct hda_codec *codec = per_pin->codec;
 | 
						struct hda_codec *codec = per_pin->codec;
 | 
				
			||||||
	struct hdmi_eld *eld = &per_pin->sink_eld;
 | 
						struct hdmi_eld *eld = &per_pin->sink_eld;
 | 
				
			||||||
| 
						 | 
					@ -989,7 +990,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry)
 | 
				
			||||||
	if (eld_valid) {
 | 
						if (eld_valid) {
 | 
				
			||||||
		if (!snd_hdmi_get_eld(eld, codec, pin_nid))
 | 
							if (!snd_hdmi_get_eld(eld, codec, pin_nid))
 | 
				
			||||||
			snd_hdmi_show_eld(eld);
 | 
								snd_hdmi_show_eld(eld);
 | 
				
			||||||
		else if (retry) {
 | 
							else if (repoll) {
 | 
				
			||||||
			queue_delayed_work(codec->bus->workq,
 | 
								queue_delayed_work(codec->bus->workq,
 | 
				
			||||||
					   &per_pin->work,
 | 
										   &per_pin->work,
 | 
				
			||||||
					   msecs_to_jiffies(300));
 | 
										   msecs_to_jiffies(300));
 | 
				
			||||||
| 
						 | 
					@ -1004,7 +1005,10 @@ static void hdmi_repoll_eld(struct work_struct *work)
 | 
				
			||||||
	struct hdmi_spec_per_pin *per_pin =
 | 
						struct hdmi_spec_per_pin *per_pin =
 | 
				
			||||||
	container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
 | 
						container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hdmi_present_sense(per_pin, false);
 | 
						if (per_pin->repoll_count++ > 6)
 | 
				
			||||||
 | 
							per_pin->repoll_count = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						hdmi_present_sense(per_pin, per_pin->repoll_count);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
 | 
					static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
 | 
				
			||||||
| 
						 | 
					@ -1235,7 +1239,7 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx)
 | 
				
			||||||
	if (err < 0)
 | 
						if (err < 0)
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hdmi_present_sense(per_pin, false);
 | 
						hdmi_present_sense(per_pin, 0);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -278,6 +278,12 @@ static bool alc_dyn_adc_pcm_resetup(struct hda_codec *codec, int cur)
 | 
				
			||||||
	return false;
 | 
						return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static inline hda_nid_t get_capsrc(struct alc_spec *spec, int idx)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return spec->capsrc_nids ?
 | 
				
			||||||
 | 
							spec->capsrc_nids[idx] : spec->adc_nids[idx];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void call_update_outputs(struct hda_codec *codec);
 | 
					static void call_update_outputs(struct hda_codec *codec);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* select the given imux item; either unmute exclusively or select the route */
 | 
					/* select the given imux item; either unmute exclusively or select the route */
 | 
				
			||||||
| 
						 | 
					@ -319,8 +325,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
 | 
				
			||||||
		adc_idx = spec->dyn_adc_idx[idx];
 | 
							adc_idx = spec->dyn_adc_idx[idx];
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nid = spec->capsrc_nids ?
 | 
						nid = get_capsrc(spec, adc_idx);
 | 
				
			||||||
		spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* no selection? */
 | 
						/* no selection? */
 | 
				
			||||||
	num_conns = snd_hda_get_conn_list(codec, nid, NULL);
 | 
						num_conns = snd_hda_get_conn_list(codec, nid, NULL);
 | 
				
			||||||
| 
						 | 
					@ -1071,8 +1076,19 @@ static bool alc_rebuild_imux_for_auto_mic(struct hda_codec *codec)
 | 
				
			||||||
	spec->imux_pins[2] = spec->dock_mic_pin;
 | 
						spec->imux_pins[2] = spec->dock_mic_pin;
 | 
				
			||||||
	for (i = 0; i < 3; i++) {
 | 
						for (i = 0; i < 3; i++) {
 | 
				
			||||||
		strcpy(imux->items[i].label, texts[i]);
 | 
							strcpy(imux->items[i].label, texts[i]);
 | 
				
			||||||
		if (spec->imux_pins[i])
 | 
							if (spec->imux_pins[i]) {
 | 
				
			||||||
 | 
								hda_nid_t pin = spec->imux_pins[i];
 | 
				
			||||||
 | 
								int c;
 | 
				
			||||||
 | 
								for (c = 0; c < spec->num_adc_nids; c++) {
 | 
				
			||||||
 | 
									hda_nid_t cap = get_capsrc(spec, c);
 | 
				
			||||||
 | 
									int idx = get_connection_index(codec, cap, pin);
 | 
				
			||||||
 | 
									if (idx >= 0) {
 | 
				
			||||||
 | 
										imux->items[i].index = idx;
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			imux->num_items = i + 1;
 | 
								imux->num_items = i + 1;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	spec->num_mux_defs = 1;
 | 
						spec->num_mux_defs = 1;
 | 
				
			||||||
	spec->input_mux = imux;
 | 
						spec->input_mux = imux;
 | 
				
			||||||
| 
						 | 
					@ -1991,10 +2007,8 @@ static int alc_build_controls(struct hda_codec *codec)
 | 
				
			||||||
		if (!kctl)
 | 
							if (!kctl)
 | 
				
			||||||
			kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
 | 
								kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
 | 
				
			||||||
		for (i = 0; kctl && i < kctl->count; i++) {
 | 
							for (i = 0; kctl && i < kctl->count; i++) {
 | 
				
			||||||
			const hda_nid_t *nids = spec->capsrc_nids;
 | 
								err = snd_hda_add_nid(codec, kctl, i,
 | 
				
			||||||
			if (!nids)
 | 
										      get_capsrc(spec, i));
 | 
				
			||||||
				nids = spec->adc_nids;
 | 
					 | 
				
			||||||
			err = snd_hda_add_nid(codec, kctl, i, nids[i]);
 | 
					 | 
				
			||||||
			if (err < 0)
 | 
								if (err < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -2786,8 +2800,7 @@ static int alc_auto_create_input_ctls(struct hda_codec *codec)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (c = 0; c < num_adcs; c++) {
 | 
							for (c = 0; c < num_adcs; c++) {
 | 
				
			||||||
			hda_nid_t cap = spec->capsrc_nids ?
 | 
								hda_nid_t cap = get_capsrc(spec, c);
 | 
				
			||||||
				spec->capsrc_nids[c] : spec->adc_nids[c];
 | 
					 | 
				
			||||||
			idx = get_connection_index(codec, cap, pin);
 | 
								idx = get_connection_index(codec, cap, pin);
 | 
				
			||||||
			if (idx >= 0) {
 | 
								if (idx >= 0) {
 | 
				
			||||||
				spec->imux_pins[imux->num_items] = pin;
 | 
									spec->imux_pins[imux->num_items] = pin;
 | 
				
			||||||
| 
						 | 
					@ -3820,8 +3833,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin)
 | 
				
			||||||
	if (!pin)
 | 
						if (!pin)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	for (i = 0; i < spec->num_adc_nids; i++) {
 | 
						for (i = 0; i < spec->num_adc_nids; i++) {
 | 
				
			||||||
		hda_nid_t cap = spec->capsrc_nids ?
 | 
							hda_nid_t cap = get_capsrc(spec, i);
 | 
				
			||||||
			spec->capsrc_nids[i] : spec->adc_nids[i];
 | 
					 | 
				
			||||||
		int idx;
 | 
							int idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		idx = get_connection_index(codec, cap, pin);
 | 
							idx = get_connection_index(codec, cap, pin);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1641,6 +1641,8 @@ static const struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = {
 | 
				
			||||||
		      "Alienware M17x", STAC_ALIENWARE_M17X),
 | 
							      "Alienware M17x", STAC_ALIENWARE_M17X),
 | 
				
			||||||
	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
 | 
						SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
 | 
				
			||||||
		      "Alienware M17x", STAC_ALIENWARE_M17X),
 | 
							      "Alienware M17x", STAC_ALIENWARE_M17X),
 | 
				
			||||||
 | 
						SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
 | 
				
			||||||
 | 
							      "Alienware M17x", STAC_ALIENWARE_M17X),
 | 
				
			||||||
	{} /* terminator */
 | 
						{} /* terminator */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,10 +78,15 @@ unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port)
 | 
				
			||||||
	return ioread32(address);
 | 
						return ioread32(address);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len)
 | 
					static void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data,
 | 
				
			||||||
 | 
								       u32 len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	void __iomem *address = lx_dsp_register(chip, port);
 | 
						u32 __iomem *address = lx_dsp_register(chip, port);
 | 
				
			||||||
	memcpy_fromio(data, address, len*sizeof(u32));
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* we cannot use memcpy_fromio */
 | 
				
			||||||
 | 
						for (i = 0; i != len; ++i)
 | 
				
			||||||
 | 
							data[i] = ioread32(address + i);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,11 +96,15 @@ void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data)
 | 
				
			||||||
	iowrite32(data, address);
 | 
						iowrite32(data, address);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,
 | 
					static void lx_dsp_reg_writebuf(struct lx6464es *chip, int port,
 | 
				
			||||||
			 u32 len)
 | 
									const u32 *data, u32 len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	void __iomem *address = lx_dsp_register(chip, port);
 | 
						u32 __iomem *address = lx_dsp_register(chip, port);
 | 
				
			||||||
	memcpy_toio(address, data, len*sizeof(u32));
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* we cannot use memcpy_to */
 | 
				
			||||||
 | 
						for (i = 0; i != len; ++i)
 | 
				
			||||||
 | 
							iowrite32(data[i], address + i);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,10 +72,7 @@ enum {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port);
 | 
					unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port);
 | 
				
			||||||
void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len);
 | 
					 | 
				
			||||||
void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data);
 | 
					void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data);
 | 
				
			||||||
void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,
 | 
					 | 
				
			||||||
			 u32 len);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* plx register access */
 | 
					/* plx register access */
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6518,7 +6518,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card,
 | 
				
			||||||
			hdspm->io_type = AES32;
 | 
								hdspm->io_type = AES32;
 | 
				
			||||||
			hdspm->card_name = "RME AES32";
 | 
								hdspm->card_name = "RME AES32";
 | 
				
			||||||
			hdspm->midiPorts = 2;
 | 
								hdspm->midiPorts = 2;
 | 
				
			||||||
		} else if ((hdspm->firmware_rev == 0xd5) ||
 | 
							} else if ((hdspm->firmware_rev == 0xd2) ||
 | 
				
			||||||
			((hdspm->firmware_rev >= 0xc8)  &&
 | 
								((hdspm->firmware_rev >= 0xc8)  &&
 | 
				
			||||||
				(hdspm->firmware_rev <= 0xcf))) {
 | 
									(hdspm->firmware_rev <= 0xcf))) {
 | 
				
			||||||
			hdspm->io_type = MADI;
 | 
								hdspm->io_type = MADI;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue