The DACs on Sigmatel/IDT codecs do mute at the lowest volume level,
and in the earlier drivers, we passed TLV_DB_SCALE_MUTE bit for each
volume control element like Speaker and Headphone as well as Master.
Along with the translation to the generic parser, however, the TLV bit
was lost for the slave controls (e.g. Speaker) but set only to
Master. In theory this should have sufficed, but apps, particularly
PA, do care the slave volume bits, so we seem to see a regression in
the volume controls.
This patch adds a flag to hda_gen_spec to specify the DAC mute
feature, and adds the TLV bit properly for all relevant volume
controls. Also, the TLV bit for vmaster is set in hda_generic.c, so
that we can get rid of all tricks from the codec driver side.
As the similar hack is applied to Conexant 5051 stuff, we can get rid
of it as well.
The DACs on Sigmatel/IDT codecs do mute at the lowest volume level,
and in the earlier drivers, we passed TLV_DB_SCALE_MUTE bit for each
volume control element like Speaker and Headphone as well as Master.
Along with the translation to the generic parser, however, the TLV bit
was lost for the slave controls (e.g. Speaker) but set only to
Master. In theory this should have sufficed, but apps, particularly
PA, do care the slave volume bits, so we seem to see a regression in
the volume controls.
This patch adds a flag to hda_gen_spec to specify the DAC mute
feature, and adds the TLV bit properly for all relevant volume
controls. Also, the TLV bit for vmaster is set in hda_generic.c, so
that we can get rid of all tricks from the codec driver side.
As the similar hack is applied to Conexant 5051 stuff, we can get rid
of it as well.
BugLink: https:/ /bugs.launchpad .net/bugs/ 1357928 pci/hda/ hda_generic. c | 9 ++++++++- pci/hda/ hda_generic. h | 1 + pci/hda/ patch_conexant. c | 8 ++------ pci/hda/ patch_sigmatel. c | 5 +----
Signed-off-by: Takashi Iwai <email address hidden>
---
sound/
sound/
sound/
sound/
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/sound/ pci/hda/ hda_generic. c b/sound/ pci/hda/ hda_generic. c .95121e818b4d 100644 pci/hda/ hda_generic. c pci/hda/ hda_generic. c out_path_ ctls(struct hda_codec *codec, struct nid_path *path) out_path_ ctls(struct hda_codec *codec, struct nid_path *path) out_vol_ nid(codec, path); AMP_VAL( nid, 3, 0, HDA_OUTPUT); dac_min_ mute) VAL_MIN_ MUTE; paths(struct hda_codec *codec) get_path_ from_idx( codec, spec->out_ paths[0] ); >vmaster_ nid = look_for_ out_vol_ nid(codec, path); hda_set_ vmaster_ tlv(codec, spec->vmaster_nid, dac_min_ mute) tlv[3] |= TLV_DB_SCALE_MUTE;
index b956449ddada.
--- a/sound/
+++ b/sound/
@@ -31,6 +31,7 @@
#include <linux/module.h>
#include <sound/core.h>
#include <sound/jack.h>
+#include <sound/tlv.h>
#include "hda_codec.h"
#include "hda_local.h"
#include "hda_auto_parser.h"
@@ -1105,6 +1106,7 @@ enum {
*/
static int assign_
{
+ struct hda_gen_spec *spec = codec->spec;
hda_nid_t nid;
unsigned int val;
int badness = 0;
@@ -1119,6 +1121,8 @@ static int assign_
nid = look_for_
if (nid) {
val = HDA_COMPOSE_
+ if (spec->
+ val |= HDA_AMP_
if (is_ctl_used(codec, val, NID_PATH_VOL_CTL))
badness += BAD_SHARED_VOL;
else
@@ -1880,9 +1884,12 @@ static int parse_output_
path = snd_hda_
if (path)
spec-
- if (spec->vmaster_nid)
+ if (spec->vmaster_nid) {
snd_
HDA_OUTPUT, spec->vmaster_tlv);
+ if (spec->
+ spec->vmaster_
+ }
}
/* set initial pinctl targets */ pci/hda/ hda_generic. h b/sound/ pci/hda/ hda_generic. h .3f95f1d3f1f8 100644 pci/hda/ hda_generic. h pci/hda/ hda_generic. h mix_input: 1; /* add aamix as a capture src */ unused: 1; /* power down unused widgets */
diff --git a/sound/
index bb2dea743986.
--- a/sound/
+++ b/sound/
@@ -231,6 +231,7 @@ struct hda_gen_spec {
unsigned int add_stereo_
unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */
unsigned int power_down_
+ unsigned int dac_min_mute:1; /* minimal = mute for DACs */
/* other internal flags */ pci/hda/ patch_conexant. c b/sound/ pci/hda/ patch_conexant. c .c0b03c112187 100644 pci/hda/ patch_conexant. c pci/hda/ patch_conexant. c
unsigned int no_analog:1; /* digital I/O only */
diff --git a/sound/
index 6f2fa838b635.
--- a/sound/
+++ b/sound/
@@ -26,7 +26,6 @@
#include <linux/module.h>
#include <sound/core.h>
#include <sound/jack.h>
-#include <sound/tlv.h>
#include "hda_codec.h" fixup_models[ ] = { fake_mutes( struct hda_codec *codec) fake_mutes( struct hda_codec *codec) hda_override_ amp_caps( codec, *p, HDA_OUTPUT,
AC_AMPCAP_ MIN_MUTE |
query_ amp_caps( codec, *p, HDA_OUTPUT)); dac_min_ mute = true;
#include "hda_local.h"
@@ -779,6 +778,7 @@ static const struct hda_model_fixup cxt5066_
*/
static void add_cx5051_
{
+ struct conexant_spec *spec = codec->spec;
static hda_nid_t out_nids[] = {
0x10, 0x11, 0
};
@@ -788,6 +788,7 @@ static void add_cx5051_
snd_
+ spec->gen.
}
static int patch_conexant_ auto(struct hda_codec *codec) auto(struct hda_codec *codec)
@@ -860,11 +861,6 @@ static int patch_conexant_
if (err < 0)
goto error;
- if (codec->vendor_id == 0x14f15051) { vmaster_ tlv[3] |= TLV_DB_SCALE_MUTE;
- /* minimum value is actually mute */
- spec->gen.
- }
-
codec->patch_ops = cx_auto_patch_ops;
/* Some laptops with Conexant chips show stalls in S3 resume, pci/hda/ patch_sigmatel. c b/sound/ pci/hda/ patch_sigmatel. c .f26ec04a29b5 100644 pci/hda/ patch_sigmatel. c pci/hda/ patch_sigmatel. c auto_config( struct hda_codec *codec)
diff --git a/sound/
index ea823e1100da.
--- a/sound/
+++ b/sound/
@@ -32,7 +32,6 @@
#include <linux/module.h>
#include <sound/core.h>
#include <sound/jack.h>
-#include <sound/tlv.h>
#include "hda_codec.h"
#include "hda_local.h"
#include "hda_auto_parser.h"
@@ -4227,9 +4226,6 @@ static int stac_parse_
if (err < 0)
return err;
- /* minimum value is actually mute */ vmaster_ tlv[3] |= TLV_DB_SCALE_MUTE; create_ beep_ctls( codec, spec(struct hda_codec *codec) gen_spec_ init(&spec- >gen); >no_trigger_ sense = 1; /* seems common with STAC/IDT codecs */ dac_min_ mute = true;
- spec->gen.
-
/* setup analog beep controls */
if (spec->anabeep_nid > 0) {
err = stac_auto_
@@ -4413,6 +4409,7 @@ static int alloc_stac_
snd_hda_
codec->spec = spec;
codec-
+ spec->gen.
return 0;
}
--
2.1.0