aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-12-23 13:28:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-12-23 13:28:39 -0500
commita88164345b81292b55a8d4829fdd35c8d611cd7d (patch)
treebeaf46dbd0876d3f93bb55de0c789fc08d00211a
parent5b726e06d6e8309e5c9ef4109a32caf27c71dfc8 (diff)
parent0fb0b822d157325b66c503d23332f64899bfb828 (diff)
Merge tag 'sound-4.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "This shouldn't be a nightmare before Christmas: just a handful small device-specific fixes for various ASoC and HD-audio drivers. Most of them are stable fixes" * tag 'sound-4.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Fix silent headphone output on MacPro 4,1 (v2) ASoC: fsl_sai: fix no frame clk in master mode ALSA: hda - Set SKL+ hda controller power at freeze() and thaw() ASoC: sgtl5000: fix VAG power up timing ASoC: rockchip: spdif: Set transmit data level to 16 samples ASoC: wm8974: set cache type for regmap ASoC: es8328: Fix shifts for mixer switches ASoC: davinci-mcasp: Fix XDATA check in mcasp_start_tx ASoC: es8328: Fix deemphasis values
-rw-r--r--sound/pci/hda/hda_intel.c34
-rw-r--r--sound/pci/hda/patch_realtek.c11
-rw-r--r--sound/soc/codecs/es8328.c25
-rw-r--r--sound/soc/codecs/es8328.h1
-rw-r--r--sound/soc/codecs/sgtl5000.c1
-rw-r--r--sound/soc/codecs/wm8974.c1
-rw-r--r--sound/soc/davinci/davinci-mcasp.c4
-rw-r--r--sound/soc/fsl/fsl_sai.c18
-rw-r--r--sound/soc/rockchip/rockchip_spdif.c6
-rw-r--r--sound/soc/rockchip/rockchip_spdif.h2
10 files changed, 88 insertions, 15 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index bff5c8b329d1..3b3658297070 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -954,6 +954,36 @@ static int azx_resume(struct device *dev)
954} 954}
955#endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */ 955#endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */
956 956
957#ifdef CONFIG_PM_SLEEP
958/* put codec down to D3 at hibernation for Intel SKL+;
959 * otherwise BIOS may still access the codec and screw up the driver
960 */
961#define IS_SKL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170)
962#define IS_SKL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70)
963#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
964#define IS_SKL_PLUS(pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci))
965
966static int azx_freeze_noirq(struct device *dev)
967{
968 struct pci_dev *pci = to_pci_dev(dev);
969
970 if (IS_SKL_PLUS(pci))
971 pci_set_power_state(pci, PCI_D3hot);
972
973 return 0;
974}
975
976static int azx_thaw_noirq(struct device *dev)
977{
978 struct pci_dev *pci = to_pci_dev(dev);
979
980 if (IS_SKL_PLUS(pci))
981 pci_set_power_state(pci, PCI_D0);
982
983 return 0;
984}
985#endif /* CONFIG_PM_SLEEP */
986
957#ifdef CONFIG_PM 987#ifdef CONFIG_PM
958static int azx_runtime_suspend(struct device *dev) 988static int azx_runtime_suspend(struct device *dev)
959{ 989{
@@ -1063,6 +1093,10 @@ static int azx_runtime_idle(struct device *dev)
1063 1093
1064static const struct dev_pm_ops azx_pm = { 1094static const struct dev_pm_ops azx_pm = {
1065 SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) 1095 SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume)
1096#ifdef CONFIG_PM_SLEEP
1097 .freeze_noirq = azx_freeze_noirq,
1098 .thaw_noirq = azx_thaw_noirq,
1099#endif
1066 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) 1100 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle)
1067}; 1101};
1068 1102
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6c268dad143f..fe96428aa403 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1775,6 +1775,7 @@ enum {
1775 ALC889_FIXUP_MBA11_VREF, 1775 ALC889_FIXUP_MBA11_VREF,
1776 ALC889_FIXUP_MBA21_VREF, 1776 ALC889_FIXUP_MBA21_VREF,
1777 ALC889_FIXUP_MP11_VREF, 1777 ALC889_FIXUP_MP11_VREF,
1778 ALC889_FIXUP_MP41_VREF,
1778 ALC882_FIXUP_INV_DMIC, 1779 ALC882_FIXUP_INV_DMIC,
1779 ALC882_FIXUP_NO_PRIMARY_HP, 1780 ALC882_FIXUP_NO_PRIMARY_HP,
1780 ALC887_FIXUP_ASUS_BASS, 1781 ALC887_FIXUP_ASUS_BASS,
@@ -1863,7 +1864,7 @@ static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1863 const struct hda_fixup *fix, int action) 1864 const struct hda_fixup *fix, int action)
1864{ 1865{
1865 struct alc_spec *spec = codec->spec; 1866 struct alc_spec *spec = codec->spec;
1866 static hda_nid_t nids[2] = { 0x14, 0x15 }; 1867 static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 };
1867 int i; 1868 int i;
1868 1869
1869 if (action != HDA_FIXUP_ACT_INIT) 1870 if (action != HDA_FIXUP_ACT_INIT)
@@ -2153,6 +2154,12 @@ static const struct hda_fixup alc882_fixups[] = {
2153 .chained = true, 2154 .chained = true,
2154 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2155 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2155 }, 2156 },
2157 [ALC889_FIXUP_MP41_VREF] = {
2158 .type = HDA_FIXUP_FUNC,
2159 .v.func = alc889_fixup_mbp_vref,
2160 .chained = true,
2161 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2162 },
2156 [ALC882_FIXUP_INV_DMIC] = { 2163 [ALC882_FIXUP_INV_DMIC] = {
2157 .type = HDA_FIXUP_FUNC, 2164 .type = HDA_FIXUP_FUNC,
2158 .v.func = alc_fixup_inv_dmic, 2165 .v.func = alc_fixup_inv_dmic,
@@ -2235,7 +2242,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2235 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), 2242 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2236 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), 2243 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2237 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), 2244 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2238 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), 2245 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2239 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), 2246 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2240 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), 2247 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2241 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), 2248 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
index 84f5eb07a91b..afa6c5db9dcc 100644
--- a/sound/soc/codecs/es8328.c
+++ b/sound/soc/codecs/es8328.c
@@ -85,7 +85,15 @@ static const DECLARE_TLV_DB_SCALE(pga_tlv, 0, 300, 0);
85static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); 85static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
86static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 300, 0); 86static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 300, 0);
87 87
88static const int deemph_settings[] = { 0, 32000, 44100, 48000 }; 88static const struct {
89 int rate;
90 unsigned int val;
91} deemph_settings[] = {
92 { 0, ES8328_DACCONTROL6_DEEMPH_OFF },
93 { 32000, ES8328_DACCONTROL6_DEEMPH_32k },
94 { 44100, ES8328_DACCONTROL6_DEEMPH_44_1k },
95 { 48000, ES8328_DACCONTROL6_DEEMPH_48k },
96};
89 97
90static int es8328_set_deemph(struct snd_soc_codec *codec) 98static int es8328_set_deemph(struct snd_soc_codec *codec)
91{ 99{
@@ -97,21 +105,22 @@ static int es8328_set_deemph(struct snd_soc_codec *codec)
97 * rate. 105 * rate.
98 */ 106 */
99 if (es8328->deemph) { 107 if (es8328->deemph) {
100 best = 1; 108 best = 0;
101 for (i = 2; i < ARRAY_SIZE(deemph_settings); i++) { 109 for (i = 1; i < ARRAY_SIZE(deemph_settings); i++) {
102 if (abs(deemph_settings[i] - es8328->playback_fs) < 110 if (abs(deemph_settings[i].rate - es8328->playback_fs) <
103 abs(deemph_settings[best] - es8328->playback_fs)) 111 abs(deemph_settings[best].rate - es8328->playback_fs))
104 best = i; 112 best = i;
105 } 113 }
106 114
107 val = best << 1; 115 val = deemph_settings[best].val;
108 } else { 116 } else {
109 val = 0; 117 val = ES8328_DACCONTROL6_DEEMPH_OFF;
110 } 118 }
111 119
112 dev_dbg(codec->dev, "Set deemphasis %d\n", val); 120 dev_dbg(codec->dev, "Set deemphasis %d\n", val);
113 121
114 return snd_soc_update_bits(codec, ES8328_DACCONTROL6, 0x6, val); 122 return snd_soc_update_bits(codec, ES8328_DACCONTROL6,
123 ES8328_DACCONTROL6_DEEMPH_MASK, val);
115} 124}
116 125
117static int es8328_get_deemph(struct snd_kcontrol *kcontrol, 126static int es8328_get_deemph(struct snd_kcontrol *kcontrol,
diff --git a/sound/soc/codecs/es8328.h b/sound/soc/codecs/es8328.h
index cb36afe10c0e..156c748c89c7 100644
--- a/sound/soc/codecs/es8328.h
+++ b/sound/soc/codecs/es8328.h
@@ -153,6 +153,7 @@ int es8328_probe(struct device *dev, struct regmap *regmap);
153#define ES8328_DACCONTROL6_CLICKFREE (1 << 3) 153#define ES8328_DACCONTROL6_CLICKFREE (1 << 3)
154#define ES8328_DACCONTROL6_DAC_INVR (1 << 4) 154#define ES8328_DACCONTROL6_DAC_INVR (1 << 4)
155#define ES8328_DACCONTROL6_DAC_INVL (1 << 5) 155#define ES8328_DACCONTROL6_DAC_INVL (1 << 5)
156#define ES8328_DACCONTROL6_DEEMPH_MASK (3 << 6)
156#define ES8328_DACCONTROL6_DEEMPH_OFF (0 << 6) 157#define ES8328_DACCONTROL6_DEEMPH_OFF (0 << 6)
157#define ES8328_DACCONTROL6_DEEMPH_32k (1 << 6) 158#define ES8328_DACCONTROL6_DEEMPH_32k (1 << 6)
158#define ES8328_DACCONTROL6_DEEMPH_44_1k (2 << 6) 159#define ES8328_DACCONTROL6_DEEMPH_44_1k (2 << 6)
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index f540f82b1f27..08b40460663c 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -189,6 +189,7 @@ static int power_vag_event(struct snd_soc_dapm_widget *w,
189 case SND_SOC_DAPM_POST_PMU: 189 case SND_SOC_DAPM_POST_PMU:
190 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, 190 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
191 SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP); 191 SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
192 msleep(400);
192 break; 193 break;
193 194
194 case SND_SOC_DAPM_PRE_PMD: 195 case SND_SOC_DAPM_PRE_PMD:
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c
index 0a60677397b3..4c29bd2ae75c 100644
--- a/sound/soc/codecs/wm8974.c
+++ b/sound/soc/codecs/wm8974.c
@@ -574,6 +574,7 @@ static const struct regmap_config wm8974_regmap = {
574 .max_register = WM8974_MONOMIX, 574 .max_register = WM8974_MONOMIX,
575 .reg_defaults = wm8974_reg_defaults, 575 .reg_defaults = wm8974_reg_defaults,
576 .num_reg_defaults = ARRAY_SIZE(wm8974_reg_defaults), 576 .num_reg_defaults = ARRAY_SIZE(wm8974_reg_defaults),
577 .cache_type = REGCACHE_FLAT,
577}; 578};
578 579
579static int wm8974_probe(struct snd_soc_codec *codec) 580static int wm8974_probe(struct snd_soc_codec *codec)
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index c1c9c2e3525b..2ccb8bccc9d4 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -223,8 +223,8 @@ static void mcasp_start_tx(struct davinci_mcasp *mcasp)
223 223
224 /* wait for XDATA to be cleared */ 224 /* wait for XDATA to be cleared */
225 cnt = 0; 225 cnt = 0;
226 while (!(mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG) & 226 while ((mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG) & XRDATA) &&
227 ~XRDATA) && (cnt < 100000)) 227 (cnt < 100000))
228 cnt++; 228 cnt++;
229 229
230 /* Release TX state machine */ 230 /* Release TX state machine */
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index ffd5f9acc849..08b460ba06ef 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -505,6 +505,24 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
505 FSL_SAI_CSR_FR, FSL_SAI_CSR_FR); 505 FSL_SAI_CSR_FR, FSL_SAI_CSR_FR);
506 regmap_update_bits(sai->regmap, FSL_SAI_RCSR, 506 regmap_update_bits(sai->regmap, FSL_SAI_RCSR,
507 FSL_SAI_CSR_FR, FSL_SAI_CSR_FR); 507 FSL_SAI_CSR_FR, FSL_SAI_CSR_FR);
508
509 /*
510 * For sai master mode, after several open/close sai,
511 * there will be no frame clock, and can't recover
512 * anymore. Add software reset to fix this issue.
513 * This is a hardware bug, and will be fix in the
514 * next sai version.
515 */
516 if (!sai->is_slave_mode) {
517 /* Software Reset for both Tx and Rx */
518 regmap_write(sai->regmap,
519 FSL_SAI_TCSR, FSL_SAI_CSR_SR);
520 regmap_write(sai->regmap,
521 FSL_SAI_RCSR, FSL_SAI_CSR_SR);
522 /* Clear SR bit to finish the reset */
523 regmap_write(sai->regmap, FSL_SAI_TCSR, 0);
524 regmap_write(sai->regmap, FSL_SAI_RCSR, 0);
525 }
508 } 526 }
509 break; 527 break;
510 default: 528 default:
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
index ac72ff5055bb..5a806da89f42 100644
--- a/sound/soc/rockchip/rockchip_spdif.c
+++ b/sound/soc/rockchip/rockchip_spdif.c
@@ -152,8 +152,10 @@ static int rk_spdif_trigger(struct snd_pcm_substream *substream,
152 case SNDRV_PCM_TRIGGER_RESUME: 152 case SNDRV_PCM_TRIGGER_RESUME:
153 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 153 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
154 ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR, 154 ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR,
155 SPDIF_DMACR_TDE_ENABLE, 155 SPDIF_DMACR_TDE_ENABLE |
156 SPDIF_DMACR_TDE_ENABLE); 156 SPDIF_DMACR_TDL_MASK,
157 SPDIF_DMACR_TDE_ENABLE |
158 SPDIF_DMACR_TDL(16));
157 159
158 if (ret != 0) 160 if (ret != 0)
159 return ret; 161 return ret;
diff --git a/sound/soc/rockchip/rockchip_spdif.h b/sound/soc/rockchip/rockchip_spdif.h
index 921b4095fb92..3ef12770ae12 100644
--- a/sound/soc/rockchip/rockchip_spdif.h
+++ b/sound/soc/rockchip/rockchip_spdif.h
@@ -42,7 +42,7 @@
42 42
43#define SPDIF_DMACR_TDL_SHIFT 0 43#define SPDIF_DMACR_TDL_SHIFT 0
44#define SPDIF_DMACR_TDL(x) ((x) << SPDIF_DMACR_TDL_SHIFT) 44#define SPDIF_DMACR_TDL(x) ((x) << SPDIF_DMACR_TDL_SHIFT)
45#define SPDIF_DMACR_TDL_MASK (0x1f << SDPIF_DMACR_TDL_SHIFT) 45#define SPDIF_DMACR_TDL_MASK (0x1f << SPDIF_DMACR_TDL_SHIFT)
46 46
47/* 47/*
48 * XFER 48 * XFER