Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 374a69e7 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'fix/hda' into topic/hda

Necessary for working on the jack-detection suppression feature.
parents 8bc039a1 a1e0c3cf
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@
#include "emu8000_local.h"
#include "emu8000_local.h"
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <linux/moduleparam.h>
#include <linux/moduleparam.h>
#include <linux/moduleparam.h>


static int emu8000_reset_addr;
static int emu8000_reset_addr;
module_param(emu8000_reset_addr, int, 0444);
module_param(emu8000_reset_addr, int, 0444);
+19 −14
Original line number Original line Diff line number Diff line
@@ -728,18 +728,19 @@ static int ca0132_hp_switch_put(struct snd_kcontrol *kcontrol,


	err = chipio_read(codec, REG_CODEC_MUTE, &data);
	err = chipio_read(codec, REG_CODEC_MUTE, &data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	/* *valp 0 is mute, 1 is unmute */
	/* *valp 0 is mute, 1 is unmute */
	data = (data & 0x7f) | (*valp ? 0 : 0x80);
	data = (data & 0x7f) | (*valp ? 0 : 0x80);
	chipio_write(codec, REG_CODEC_MUTE, data);
	err = chipio_write(codec, REG_CODEC_MUTE, data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	spec->curr_hp_switch = *valp;
	spec->curr_hp_switch = *valp;


 exit:
	snd_hda_power_down(codec);
	snd_hda_power_down(codec);
	return 1;
	return err < 0 ? err : 1;
}
}


static int ca0132_speaker_switch_get(struct snd_kcontrol *kcontrol,
static int ca0132_speaker_switch_get(struct snd_kcontrol *kcontrol,
@@ -770,18 +771,19 @@ static int ca0132_speaker_switch_put(struct snd_kcontrol *kcontrol,


	err = chipio_read(codec, REG_CODEC_MUTE, &data);
	err = chipio_read(codec, REG_CODEC_MUTE, &data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	/* *valp 0 is mute, 1 is unmute */
	/* *valp 0 is mute, 1 is unmute */
	data = (data & 0xef) | (*valp ? 0 : 0x10);
	data = (data & 0xef) | (*valp ? 0 : 0x10);
	chipio_write(codec, REG_CODEC_MUTE, data);
	err = chipio_write(codec, REG_CODEC_MUTE, data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	spec->curr_speaker_switch = *valp;
	spec->curr_speaker_switch = *valp;


 exit:
	snd_hda_power_down(codec);
	snd_hda_power_down(codec);
	return 1;
	return err < 0 ? err : 1;
}
}


static int ca0132_hp_volume_get(struct snd_kcontrol *kcontrol,
static int ca0132_hp_volume_get(struct snd_kcontrol *kcontrol,
@@ -819,25 +821,26 @@ static int ca0132_hp_volume_put(struct snd_kcontrol *kcontrol,


	err = chipio_read(codec, REG_CODEC_HP_VOL_L, &data);
	err = chipio_read(codec, REG_CODEC_HP_VOL_L, &data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	val = 31 - left_vol;
	val = 31 - left_vol;
	data = (data & 0xe0) | val;
	data = (data & 0xe0) | val;
	chipio_write(codec, REG_CODEC_HP_VOL_L, data);
	err = chipio_write(codec, REG_CODEC_HP_VOL_L, data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	val = 31 - right_vol;
	val = 31 - right_vol;
	data = (data & 0xe0) | val;
	data = (data & 0xe0) | val;
	chipio_write(codec, REG_CODEC_HP_VOL_R, data);
	err = chipio_write(codec, REG_CODEC_HP_VOL_R, data);
	if (err < 0)
	if (err < 0)
		return err;
		goto exit;


	spec->curr_hp_volume[0] = left_vol;
	spec->curr_hp_volume[0] = left_vol;
	spec->curr_hp_volume[1] = right_vol;
	spec->curr_hp_volume[1] = right_vol;


 exit:
	snd_hda_power_down(codec);
	snd_hda_power_down(codec);
	return 1;
	return err < 0 ? err : 1;
}
}


static int add_hp_switch(struct hda_codec *codec, hda_nid_t nid)
static int add_hp_switch(struct hda_codec *codec, hda_nid_t nid)
@@ -936,6 +939,8 @@ static int ca0132_build_controls(struct hda_codec *codec)
		if (err < 0)
		if (err < 0)
			return err;
			return err;
		err = add_in_volume(codec, spec->dig_in, "IEC958");
		err = add_in_volume(codec, spec->dig_in, "IEC958");
		if (err < 0)
			return err;
	}
	}
	return 0;
	return 0;
}
}
+2 −1
Original line number Original line Diff line number Diff line
@@ -2298,7 +2298,7 @@ static int alc_build_pcms(struct hda_codec *codec)
		 "%s Analog", codec->chip_name);
		 "%s Analog", codec->chip_name);
	info->name = spec->stream_name_analog;
	info->name = spec->stream_name_analog;


	if (spec->multiout.dac_nids > 0) {
	if (spec->multiout.num_dacs > 0) {
		p = spec->stream_analog_playback;
		p = spec->stream_analog_playback;
		if (!p)
		if (!p)
			p = &alc_pcm_analog_playback;
			p = &alc_pcm_analog_playback;
@@ -5603,6 +5603,7 @@ static const struct alc_fixup alc861_fixups[] = {


static const struct snd_pci_quirk alc861_fixup_tbl[] = {
static const struct snd_pci_quirk alc861_fixup_tbl[] = {
	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", PINFIX_ASUS_A6RP),
	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", PINFIX_ASUS_A6RP),
	SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", PINFIX_ASUS_A6RP),	
	SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", PINFIX_ASUS_A6RP),
	SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", PINFIX_ASUS_A6RP),
	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1505),
	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", PINFIX_FSC_AMILO_PI1505),
	{}
	{}
+2 −2
Original line number Original line Diff line number Diff line
@@ -5063,9 +5063,9 @@ static int stac92xx_update_led_status(struct hda_codec *codec)
				spec->gpio_dir, spec->gpio_data);
				spec->gpio_dir, spec->gpio_data);
	} else {
	} else {
		notmtd_lvl = spec->gpio_led_polarity ?
		notmtd_lvl = spec->gpio_led_polarity ?
				AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_GRD;
				AC_PINCTL_VREF_50 : AC_PINCTL_VREF_GRD;
		muted_lvl = spec->gpio_led_polarity ?
		muted_lvl = spec->gpio_led_polarity ?
				AC_PINCTL_VREF_GRD : AC_PINCTL_VREF_HIZ;
				AC_PINCTL_VREF_GRD : AC_PINCTL_VREF_50;
		spec->vref_led = muted ? muted_lvl : notmtd_lvl;
		spec->vref_led = muted ? muted_lvl : notmtd_lvl;
		stac_vrefout_set(codec,	spec->vref_mute_led_nid,
		stac_vrefout_set(codec,	spec->vref_mute_led_nid,
				 spec->vref_led);
				 spec->vref_led);
+14 −11
Original line number Original line Diff line number Diff line
@@ -618,9 +618,12 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
	mutex_lock(&chip->mutex);
	mutex_lock(&chip->mutex);
	reg = oxygen_read_ac97(chip, codec, index);
	reg = oxygen_read_ac97(chip, codec, index);
	mutex_unlock(&chip->mutex);
	mutex_unlock(&chip->mutex);
	if (!stereo) {
		value->value.integer.value[0] = 31 - (reg & 0x1f);
		value->value.integer.value[0] = 31 - (reg & 0x1f);
	if (stereo)
	} else {
		value->value.integer.value[1] = 31 - ((reg >> 8) & 0x1f);
		value->value.integer.value[0] = 31 - ((reg >> 8) & 0x1f);
		value->value.integer.value[1] = 31 - (reg & 0x1f);
	}
	return 0;
	return 0;
}
}


@@ -636,14 +639,14 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,


	mutex_lock(&chip->mutex);
	mutex_lock(&chip->mutex);
	oldreg = oxygen_read_ac97(chip, codec, index);
	oldreg = oxygen_read_ac97(chip, codec, index);
	newreg = oldreg;
	if (!stereo) {
	newreg = (newreg & ~0x1f) |
		newreg = oldreg & ~0x1f;
		(31 - (value->value.integer.value[0] & 0x1f));
		newreg |= 31 - (value->value.integer.value[0] & 0x1f);
	if (stereo)
	} else {
		newreg = (newreg & ~0x1f00) |
		newreg = oldreg & ~0x1f1f;
			((31 - (value->value.integer.value[1] & 0x1f)) << 8);
		newreg |= (31 - (value->value.integer.value[0] & 0x1f)) << 8;
	else
		newreg |= 31 - (value->value.integer.value[1] & 0x1f);
		newreg = (newreg & ~0x1f00) | ((newreg & 0x1f) << 8);
	}
	change = newreg != oldreg;
	change = newreg != oldreg;
	if (change)
	if (change)
		oxygen_write_ac97(chip, codec, index, newreg);
		oxygen_write_ac97(chip, codec, index, newreg);
Loading