Skip to content

Commit e48f88a

Browse files
committed
Merge tag 'sound-fix2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull second set of sound fixes from Takashi Iwai: "A collection of small fixes in HD-audio quirks and runtime PM, ASoC rcar, abs8500 and other codecs. Most of commits are for stable kernels, too" * tag 'sound-fix2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Set current_headset_type to ALC_HEADSET_TYPE_ENUM (janitorial) ALSA: hda - Provide missing pin configs for VAIO with ALC260 ALSA: hda - Add headset quirk for Dell Inspiron 3135 ALSA: hda - Fix the headphone jack detection on Sony VAIO TX ALSA: hda - Fix missing bass speaker on ASUS N550 ALSA: hda - Fix unbalanced runtime PM notification at resume ASoC: arizona: Set FLL to free-run before disabling ALSA: hda - A casual Dell Headset quirk ASoC: rcar: fixup dma_async_issue_pending() timing ASoC: rcar: off by one in rsnd_scu_set_route() ASoC: wm5110: Add post SYSCLK register patch for rev D chip ASoC: ab8500: Revert to using custom I/O functions ALSA: hda - Also enable mute/micmute LED control for "Lenovo dock" fixup ALSA: firewire-lib: include sound/asound.h to refer to snd_pcm_format_t ALSA: hda - Select FW_LOADER from CONFIG_SND_HDA_CODEC_CA0132_DSP ALSA: hda - Enable mute/mic-mute LEDs for more Thinkpads with Realtek codec ASoC: rcar: fixup mod access before checking
2 parents aecde27 + 5db4d34 commit e48f88a

File tree

9 files changed

+161
-47
lines changed

9 files changed

+161
-47
lines changed

sound/firewire/amdtp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <linux/err.h>
55
#include <linux/interrupt.h>
66
#include <linux/mutex.h>
7+
#include <sound/asound.h>
78
#include "packets-buffer.h"
89

910
/**

sound/pci/hda/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ config SND_HDA_CODEC_CA0132
209209

210210
config SND_HDA_CODEC_CA0132_DSP
211211
bool "Support new DSP code for CA0132 codec"
212-
depends on SND_HDA_CODEC_CA0132 && FW_LOADER
212+
depends on SND_HDA_CODEC_CA0132
213213
select SND_HDA_DSP_LOADER
214+
select FW_LOADER
214215
help
215216
Say Y here to enable the DSP for Creative CA0132 for extended
216217
features like equalizer or echo cancellation.

sound/pci/hda/hda_codec.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,6 +4000,10 @@ static void hda_call_codec_resume(struct hda_codec *codec)
40004000
* in the resume / power-save sequence
40014001
*/
40024002
hda_keep_power_on(codec);
4003+
if (codec->pm_down_notified) {
4004+
codec->pm_down_notified = 0;
4005+
hda_call_pm_notify(codec->bus, true);
4006+
}
40034007
hda_set_power_state(codec, AC_PWRST_D0);
40044008
restore_shutup_pins(codec);
40054009
hda_exec_init_verbs(codec);

sound/pci/hda/patch_realtek.c

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ enum {
15121512
ALC260_FIXUP_KN1,
15131513
ALC260_FIXUP_FSC_S7020,
15141514
ALC260_FIXUP_FSC_S7020_JWSE,
1515+
ALC260_FIXUP_VAIO_PINS,
15151516
};
15161517

15171518
static void alc260_gpio1_automute(struct hda_codec *codec)
@@ -1652,6 +1653,24 @@ static const struct hda_fixup alc260_fixups[] = {
16521653
.chained = true,
16531654
.chain_id = ALC260_FIXUP_FSC_S7020,
16541655
},
1656+
[ALC260_FIXUP_VAIO_PINS] = {
1657+
.type = HDA_FIXUP_PINS,
1658+
.v.pins = (const struct hda_pintbl[]) {
1659+
/* Pin configs are missing completely on some VAIOs */
1660+
{ 0x0f, 0x01211020 },
1661+
{ 0x10, 0x0001003f },
1662+
{ 0x11, 0x411111f0 },
1663+
{ 0x12, 0x01a15930 },
1664+
{ 0x13, 0x411111f0 },
1665+
{ 0x14, 0x411111f0 },
1666+
{ 0x15, 0x411111f0 },
1667+
{ 0x16, 0x411111f0 },
1668+
{ 0x17, 0x411111f0 },
1669+
{ 0x18, 0x411111f0 },
1670+
{ 0x19, 0x411111f0 },
1671+
{ }
1672+
}
1673+
},
16551674
};
16561675

16571676
static const struct snd_pci_quirk alc260_fixup_tbl[] = {
@@ -1660,6 +1679,8 @@ static const struct snd_pci_quirk alc260_fixup_tbl[] = {
16601679
SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
16611680
SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
16621681
SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1682+
SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1683+
SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
16631684
SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
16641685
SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
16651686
SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
@@ -3393,7 +3414,7 @@ static void alc_update_headset_mode_hook(struct hda_codec *codec,
33933414
static void alc_update_headset_jack_cb(struct hda_codec *codec, struct hda_jack_tbl *jack)
33943415
{
33953416
struct alc_spec *spec = codec->spec;
3396-
spec->current_headset_type = ALC_HEADSET_MODE_UNKNOWN;
3417+
spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
33973418
snd_hda_gen_hp_automute(codec, jack);
33983419
}
33993420

@@ -3652,9 +3673,29 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec,
36523673
#if IS_ENABLED(CONFIG_THINKPAD_ACPI)
36533674

36543675
#include <linux/thinkpad_acpi.h>
3676+
#include <acpi/acpi.h>
36553677

36563678
static int (*led_set_func)(int, bool);
36573679

3680+
static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context,
3681+
void **rv)
3682+
{
3683+
bool *found = context;
3684+
*found = true;
3685+
return AE_OK;
3686+
}
3687+
3688+
static bool is_thinkpad(struct hda_codec *codec)
3689+
{
3690+
bool found = false;
3691+
if (codec->subsystem_id >> 16 != 0x17aa)
3692+
return false;
3693+
if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found)
3694+
return true;
3695+
found = false;
3696+
return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found;
3697+
}
3698+
36583699
static void update_tpacpi_mute_led(void *private_data, int enabled)
36593700
{
36603701
if (led_set_func)
@@ -3680,6 +3721,8 @@ static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
36803721
bool removefunc = false;
36813722

36823723
if (action == HDA_FIXUP_ACT_PROBE) {
3724+
if (!is_thinkpad(codec))
3725+
return;
36833726
if (!led_set_func)
36843727
led_set_func = symbol_request(tpacpi_led_set);
36853728
if (!led_set_func) {
@@ -3923,6 +3966,8 @@ static const struct hda_fixup alc269_fixups[] = {
39233966
[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
39243967
.type = HDA_FIXUP_FUNC,
39253968
.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
3969+
.chained = true,
3970+
.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
39263971
},
39273972
[ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
39283973
.type = HDA_FIXUP_PINS,
@@ -4027,6 +4072,8 @@ static const struct hda_fixup alc269_fixups[] = {
40274072
[ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
40284073
.type = HDA_FIXUP_FUNC,
40294074
.v.func = alc269_fixup_limit_int_mic_boost,
4075+
.chained = true,
4076+
.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
40304077
},
40314078
[ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
40324079
.type = HDA_FIXUP_FUNC,
@@ -4070,8 +4117,6 @@ static const struct hda_fixup alc269_fixups[] = {
40704117
[ALC269_FIXUP_THINKPAD_ACPI] = {
40714118
.type = HDA_FIXUP_FUNC,
40724119
.v.func = alc_fixup_thinkpad_acpi,
4073-
.chained = true,
4074-
.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
40754120
},
40764121
[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
40774122
.type = HDA_FIXUP_PINS,
@@ -4128,6 +4173,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
41284173
SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
41294174
SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
41304175
SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4176+
SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
41314177
SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS),
41324178
SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
41334179
SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
@@ -4173,14 +4219,15 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
41734219
SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
41744220
SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
41754221
SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4176-
SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
4222+
SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
41774223
SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
41784224
SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
41794225
SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
41804226
SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
41814227
SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
41824228
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
41834229
SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
4230+
SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
41844231
SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
41854232

41864233
#if 0
@@ -4698,6 +4745,8 @@ enum {
46984745
ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
46994746
ALC668_FIXUP_HEADSET_MODE,
47004747
ALC662_FIXUP_BASS_CHMAP,
4748+
ALC662_FIXUP_BASS_1A,
4749+
ALC662_FIXUP_BASS_1A_CHMAP,
47014750
};
47024751

47034752
static const struct hda_fixup alc662_fixups[] = {
@@ -4878,6 +4927,19 @@ static const struct hda_fixup alc662_fixups[] = {
48784927
.chained = true,
48794928
.chain_id = ALC662_FIXUP_ASUS_MODE4
48804929
},
4930+
[ALC662_FIXUP_BASS_1A] = {
4931+
.type = HDA_FIXUP_PINS,
4932+
.v.pins = (const struct hda_pintbl[]) {
4933+
{0x1a, 0x80106111}, /* bass speaker */
4934+
{}
4935+
},
4936+
},
4937+
[ALC662_FIXUP_BASS_1A_CHMAP] = {
4938+
.type = HDA_FIXUP_FUNC,
4939+
.v.func = alc662_fixup_bass_chmap,
4940+
.chained = true,
4941+
.chain_id = ALC662_FIXUP_BASS_1A,
4942+
},
48814943
};
48824944

48834945
static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -4890,8 +4952,10 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
48904952
SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
48914953
SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
48924954
SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
4955+
SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
48934956
SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
48944957
SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
4958+
SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP),
48954959
SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP),
48964960
SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_CHMAP),
48974961
SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),

sound/soc/codecs/ab8500-codec.c

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ struct ab8500_codec_drvdata_dbg {
126126

127127
/* Private data for AB8500 device-driver */
128128
struct ab8500_codec_drvdata {
129-
struct regmap *regmap;
130-
131129
/* Sidetone */
132130
long *sid_fir_values;
133131
enum sid_state sid_status;
@@ -168,34 +166,48 @@ static inline const char *amic_type_str(enum amic_type type)
168166
*/
169167

170168
/* Read a register from the audio-bank of AB8500 */
171-
static int ab8500_codec_read_reg(void *context, unsigned int reg,
172-
unsigned int *value)
169+
static unsigned int ab8500_codec_read_reg(struct snd_soc_codec *codec,
170+
unsigned int reg)
173171
{
174-
struct device *dev = context;
175172
int status;
173+
unsigned int value = 0;
176174

177175
u8 value8;
178-
status = abx500_get_register_interruptible(dev, AB8500_AUDIO,
179-
reg, &value8);
180-
*value = (unsigned int)value8;
176+
status = abx500_get_register_interruptible(codec->dev, AB8500_AUDIO,
177+
reg, &value8);
178+
if (status < 0) {
179+
dev_err(codec->dev,
180+
"%s: ERROR: Register (0x%02x:0x%02x) read failed (%d).\n",
181+
__func__, (u8)AB8500_AUDIO, (u8)reg, status);
182+
} else {
183+
dev_dbg(codec->dev,
184+
"%s: Read 0x%02x from register 0x%02x:0x%02x\n",
185+
__func__, value8, (u8)AB8500_AUDIO, (u8)reg);
186+
value = (unsigned int)value8;
187+
}
181188

182-
return status;
189+
return value;
183190
}
184191

185192
/* Write to a register in the audio-bank of AB8500 */
186-
static int ab8500_codec_write_reg(void *context, unsigned int reg,
187-
unsigned int value)
193+
static int ab8500_codec_write_reg(struct snd_soc_codec *codec,
194+
unsigned int reg, unsigned int value)
188195
{
189-
struct device *dev = context;
196+
int status;
190197

191-
return abx500_set_register_interruptible(dev, AB8500_AUDIO,
192-
reg, value);
193-
}
198+
status = abx500_set_register_interruptible(codec->dev, AB8500_AUDIO,
199+
reg, value);
200+
if (status < 0)
201+
dev_err(codec->dev,
202+
"%s: ERROR: Register (%02x:%02x) write failed (%d).\n",
203+
__func__, (u8)AB8500_AUDIO, (u8)reg, status);
204+
else
205+
dev_dbg(codec->dev,
206+
"%s: Wrote 0x%02x into register %02x:%02x\n",
207+
__func__, (u8)value, (u8)AB8500_AUDIO, (u8)reg);
194208

195-
static const struct regmap_config ab8500_codec_regmap = {
196-
.reg_read = ab8500_codec_read_reg,
197-
.reg_write = ab8500_codec_write_reg,
198-
};
209+
return status;
210+
}
199211

200212
/*
201213
* Controls - DAPM
@@ -2473,13 +2485,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
24732485

24742486
dev_dbg(dev, "%s: Enter.\n", __func__);
24752487

2476-
snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
2477-
24782488
/* Setup AB8500 according to board-settings */
24792489
pdata = dev_get_platdata(dev->parent);
24802490

2481-
codec->control_data = drvdata->regmap;
2482-
24832491
if (np) {
24842492
if (!pdata)
24852493
pdata = devm_kzalloc(dev,
@@ -2557,6 +2565,9 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
25572565

25582566
static struct snd_soc_codec_driver ab8500_codec_driver = {
25592567
.probe = ab8500_codec_probe,
2568+
.read = ab8500_codec_read_reg,
2569+
.write = ab8500_codec_write_reg,
2570+
.reg_word_size = sizeof(u8),
25602571
.controls = ab8500_ctrls,
25612572
.num_controls = ARRAY_SIZE(ab8500_ctrls),
25622573
.dapm_widgets = ab8500_dapm_widgets,
@@ -2581,15 +2592,6 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev)
25812592
drvdata->anc_status = ANC_UNCONFIGURED;
25822593
dev_set_drvdata(&pdev->dev, drvdata);
25832594

2584-
drvdata->regmap = devm_regmap_init(&pdev->dev, NULL, &pdev->dev,
2585-
&ab8500_codec_regmap);
2586-
if (IS_ERR(drvdata->regmap)) {
2587-
status = PTR_ERR(drvdata->regmap);
2588-
dev_err(&pdev->dev, "%s: Failed to allocate regmap: %d\n",
2589-
__func__, status);
2590-
return status;
2591-
}
2592-
25932595
dev_dbg(&pdev->dev, "%s: Register codec.\n", __func__);
25942596
status = snd_soc_register_codec(&pdev->dev, &ab8500_codec_driver,
25952597
ab8500_codec_dai,

sound/soc/codecs/arizona.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,8 @@ static void arizona_enable_fll(struct arizona_fll *fll,
15281528
/* Clear any pending completions */
15291529
try_wait_for_completion(&fll->ok);
15301530

1531+
regmap_update_bits(arizona->regmap, fll->base + 1,
1532+
ARIZONA_FLL1_FREERUN, 0);
15311533
regmap_update_bits(arizona->regmap, fll->base + 1,
15321534
ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
15331535
if (use_sync)
@@ -1546,6 +1548,8 @@ static void arizona_disable_fll(struct arizona_fll *fll)
15461548
struct arizona *arizona = fll->arizona;
15471549
bool change;
15481550

1551+
regmap_update_bits(arizona->regmap, fll->base + 1,
1552+
ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN);
15491553
regmap_update_bits_check(arizona->regmap, fll->base + 1,
15501554
ARIZONA_FLL1_ENA, 0, &change);
15511555
regmap_update_bits(arizona->regmap, fll->base + 0x11,

0 commit comments

Comments
 (0)