Commit b905e2db authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "As a usual pattern, we've got relatively large updates at rc5:

   - A fix for races in ALSA control user elements

   - ASoC DAPM regression due to component refactoring

   - A fix in error handling of ASoC iteration macro

   - ASoC Intel SST Skylake kconfig fix; a new Kconfig will appear as a
     consequence, but in the end it's a good cleanup

   - HD-audio and USB-audio quirks as always

   - Assort of ASoC driver fixes (pcm186x, Intel cht, rockchip, pcm3060,
     rsnd, omap, wm_adsp, qcom, sunxi, stm32)"

* tag 'sound-4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (34 commits)
  ALSA: usb-audio: Add vendor and product name for Dell WD19 Dock
  ALSA: hda/realtek - Support ALC300
  ALSA: hda/realtek - Add auto-mute quirk for HP Spectre x360 laptop
  ALSA: hda/realtek - fix the pop noise on headphone for lenovo laptops
  ALSA: control: Fix race between adding and removing a user element
  ALSA: sparc: Fix invalid snd_free_pages() at error path
  ALSA: wss: Fix invalid snd_free_pages() at error path
  ALSA: hda/realtek - fix headset mic detection for MSI MS-B171
  ALSA: hda: Add ASRock N68C-S UCC the power_save blacklist
  ALSA: ac97: Fix incorrect bit shift at AC97-SPSA control write
  ASoC: omap-dmic: Add pm_qos handling to avoid overruns with CPU_IDLE
  ASoC: omap-mcpdm: Add pm_qos handling to avoid under/overruns with CPU_IDLE
  ASoC: omap-mcbsp: Fix latency value calculation for pm_qos
  ASoC: acpi: fix: continue searching when machine is ignored
  ASoC: Intel: Skylake: fix Kconfigs, make HDaudio codec optional
  MAINTAINERS: add ASoC maintainers for sound dt-bindings
  ASoC: pcm186x: Fix device reset-registers trigger value
  ASoC: dapm: Recalculate audio map forcely when card instantiated
  ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing
  ASoC: pcm3060: Rename output widgets
  ...
parents 9af33b57 8159a6a4
...@@ -14010,6 +14010,7 @@ S: Supported ...@@ -14010,6 +14010,7 @@ S: Supported
F: Documentation/devicetree/bindings/sound/ F: Documentation/devicetree/bindings/sound/
F: Documentation/sound/soc/ F: Documentation/sound/soc/
F: sound/soc/ F: sound/soc/
F: include/dt-bindings/sound/
F: include/sound/soc* F: include/sound/soc*
SOUNDWIRE SUBSYSTEM SOUNDWIRE SUBSYSTEM
......
...@@ -1192,7 +1192,7 @@ struct snd_soc_pcm_runtime { ...@@ -1192,7 +1192,7 @@ struct snd_soc_pcm_runtime {
((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \ ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
(i)++) (i)++)
#define for_each_rtd_codec_dai_rollback(rtd, i, dai) \ #define for_each_rtd_codec_dai_rollback(rtd, i, dai) \
for (; ((i--) >= 0) && ((dai) = rtd->codec_dais[i]);) for (; ((--i) >= 0) && ((dai) = rtd->codec_dais[i]);)
/* mixer control */ /* mixer control */
......
...@@ -348,6 +348,40 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count) ...@@ -348,6 +348,40 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count)
return 0; return 0;
} }
/* add a new kcontrol object; call with card->controls_rwsem locked */
static int __snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol)
{
struct snd_ctl_elem_id id;
unsigned int idx;
unsigned int count;
id = kcontrol->id;
if (id.index > UINT_MAX - kcontrol->count)
return -EINVAL;
if (snd_ctl_find_id(card, &id)) {
dev_err(card->dev,
"control %i:%i:%i:%s:%i is already present\n",
id.iface, id.device, id.subdevice, id.name, id.index);
return -EBUSY;
}
if (snd_ctl_find_hole(card, kcontrol->count) < 0)
return -ENOMEM;
list_add_tail(&kcontrol->list, &card->controls);
card->controls_count += kcontrol->count;
kcontrol->id.numid = card->last_numid + 1;
card->last_numid += kcontrol->count;
id = kcontrol->id;
count = kcontrol->count;
for (idx = 0; idx < count; idx++, id.index++, id.numid++)
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id);
return 0;
}
/** /**
* snd_ctl_add - add the control instance to the card * snd_ctl_add - add the control instance to the card
* @card: the card instance * @card: the card instance
...@@ -364,45 +398,18 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count) ...@@ -364,45 +398,18 @@ static int snd_ctl_find_hole(struct snd_card *card, unsigned int count)
*/ */
int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol)
{ {
struct snd_ctl_elem_id id;
unsigned int idx;
unsigned int count;
int err = -EINVAL; int err = -EINVAL;
if (! kcontrol) if (! kcontrol)
return err; return err;
if (snd_BUG_ON(!card || !kcontrol->info)) if (snd_BUG_ON(!card || !kcontrol->info))
goto error; goto error;
id = kcontrol->id;
if (id.index > UINT_MAX - kcontrol->count)
goto error;
down_write(&card->controls_rwsem); down_write(&card->controls_rwsem);
if (snd_ctl_find_id(card, &id)) { err = __snd_ctl_add(card, kcontrol);
up_write(&card->controls_rwsem);
dev_err(card->dev, "control %i:%i:%i:%s:%i is already present\n",
id.iface,
id.device,
id.subdevice,
id.name,
id.index);
err = -EBUSY;
goto error;
}
if (snd_ctl_find_hole(card, kcontrol->count) < 0) {
up_write(&card->controls_rwsem);
err = -ENOMEM;
goto error;
}
list_add_tail(&kcontrol->list, &card->controls);
card->controls_count += kcontrol->count;
kcontrol->id.numid = card->last_numid + 1;
card->last_numid += kcontrol->count;
id = kcontrol->id;
count = kcontrol->count;
up_write(&card->controls_rwsem); up_write(&card->controls_rwsem);
for (idx = 0; idx < count; idx++, id.index++, id.numid++) if (err < 0)
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_ADD, &id); goto error;
return 0; return 0;
error: error:
...@@ -1361,9 +1368,12 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, ...@@ -1361,9 +1368,12 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
kctl->tlv.c = snd_ctl_elem_user_tlv; kctl->tlv.c = snd_ctl_elem_user_tlv;
/* This function manage to free the instance on failure. */ /* This function manage to free the instance on failure. */
err = snd_ctl_add(card, kctl); down_write(&card->controls_rwsem);
if (err < 0) err = __snd_ctl_add(card, kctl);
return err; if (err < 0) {
snd_ctl_free_one(kctl);
goto unlock;
}
offset = snd_ctl_get_ioff(kctl, &info->id); offset = snd_ctl_get_ioff(kctl, &info->id);
snd_ctl_build_ioff(&info->id, kctl, offset); snd_ctl_build_ioff(&info->id, kctl, offset);
/* /*
...@@ -1374,10 +1384,10 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, ...@@ -1374,10 +1384,10 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
* which locks the element. * which locks the element.
*/ */
down_write(&card->controls_rwsem);
card->user_ctl_count++; card->user_ctl_count++;
up_write(&card->controls_rwsem);
unlock:
up_write(&card->controls_rwsem);
return 0; return 0;
} }
......
...@@ -1531,7 +1531,6 @@ static int snd_wss_playback_open(struct snd_pcm_substream *substream) ...@@ -1531,7 +1531,6 @@ static int snd_wss_playback_open(struct snd_pcm_substream *substream)
if (err < 0) { if (err < 0) {
if (chip->release_dma) if (chip->release_dma)
chip->release_dma(chip, chip->dma_private_data, chip->dma1); chip->release_dma(chip, chip->dma_private_data, chip->dma1);
snd_free_pages(runtime->dma_area, runtime->dma_bytes);
return err; return err;
} }
chip->playback_substream = substream; chip->playback_substream = substream;
...@@ -1572,7 +1571,6 @@ static int snd_wss_capture_open(struct snd_pcm_substream *substream) ...@@ -1572,7 +1571,6 @@ static int snd_wss_capture_open(struct snd_pcm_substream *substream)
if (err < 0) { if (err < 0) {
if (chip->release_dma) if (chip->release_dma)
chip->release_dma(chip, chip->dma_private_data, chip->dma2); chip->release_dma(chip, chip->dma_private_data, chip->dma2);
snd_free_pages(runtime->dma_area, runtime->dma_bytes);
return err; return err;
} }
chip->capture_substream = substream; chip->capture_substream = substream;
......
...@@ -824,7 +824,7 @@ static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ ...@@ -824,7 +824,7 @@ static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
{ {
struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value & 0xff; int reg = kcontrol->private_value & 0xff;
int shift = (kcontrol->private_value >> 8) & 0xff; int shift = (kcontrol->private_value >> 8) & 0x0f;
int mask = (kcontrol->private_value >> 16) & 0xff; int mask = (kcontrol->private_value >> 16) & 0xff;
// int invert = (kcontrol->private_value >> 24) & 0xff; // int invert = (kcontrol->private_value >> 24) & 0xff;
unsigned short value, old, new; unsigned short value, old, new;
......
...@@ -2169,6 +2169,8 @@ static struct snd_pci_quirk power_save_blacklist[] = { ...@@ -2169,6 +2169,8 @@ static struct snd_pci_quirk power_save_blacklist[] = {
/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
SND_PCI_QUIRK(0x1849, 0xc892, "Asrock B85M-ITX", 0), SND_PCI_QUIRK(0x1849, 0xc892, "Asrock B85M-ITX", 0),
/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
SND_PCI_QUIRK(0x1849, 0x0397, "Asrock N68C-S UCC", 0),
/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
SND_PCI_QUIRK(0x1849, 0x7662, "Asrock H81M-HDS", 0), SND_PCI_QUIRK(0x1849, 0x7662, "Asrock H81M-HDS", 0),
/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0), SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0),
......
...@@ -388,6 +388,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) ...@@ -388,6 +388,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
case 0x10ec0285: case 0x10ec0285:
case 0x10ec0298: case 0x10ec0298:
case 0x10ec0289: case 0x10ec0289:
case 0x10ec0300:
alc_update_coef_idx(codec, 0x10, 1<<9, 0); alc_update_coef_idx(codec, 0x10, 1<<9, 0);
break; break;
case 0x10ec0275: case 0x10ec0275:
...@@ -2830,6 +2831,7 @@ enum { ...@@ -2830,6 +2831,7 @@ enum {
ALC269_TYPE_ALC215, ALC269_TYPE_ALC215,
ALC269_TYPE_ALC225, ALC269_TYPE_ALC225,
ALC269_TYPE_ALC294, ALC269_TYPE_ALC294,
ALC269_TYPE_ALC300,
ALC269_TYPE_ALC700, ALC269_TYPE_ALC700,
}; };
...@@ -2864,6 +2866,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec) ...@@ -2864,6 +2866,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
case ALC269_TYPE_ALC215: case ALC269_TYPE_ALC215:
case ALC269_TYPE_ALC225: case ALC269_TYPE_ALC225:
case ALC269_TYPE_ALC294: case ALC269_TYPE_ALC294:
case ALC269_TYPE_ALC300:
case ALC269_TYPE_ALC700: case ALC269_TYPE_ALC700:
ssids = alc269_ssids; ssids = alc269_ssids;
break; break;
...@@ -5358,6 +5361,16 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec, ...@@ -5358,6 +5361,16 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec,
spec->gen.preferred_dacs = preferred_pairs; spec->gen.preferred_dacs = preferred_pairs;
} }
/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
if (action != HDA_FIXUP_ACT_PRE_PROBE)
return;
snd_hda_override_wcaps(codec, 0x03, 0);
}
/* for hda_fixup_thinkpad_acpi() */ /* for hda_fixup_thinkpad_acpi() */
#include "thinkpad_helper.c" #include "thinkpad_helper.c"
...@@ -5495,6 +5508,8 @@ enum { ...@@ -5495,6 +5508,8 @@ enum {
ALC255_FIXUP_DELL_HEADSET_MIC, ALC255_FIXUP_DELL_HEADSET_MIC,
ALC295_FIXUP_HP_X360, ALC295_FIXUP_HP_X360,
ALC221_FIXUP_HP_HEADSET_MIC, ALC221_FIXUP_HP_HEADSET_MIC,
ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
ALC295_FIXUP_HP_AUTO_MUTE,
}; };
static const struct hda_fixup alc269_fixups[] = { static const struct hda_fixup alc269_fixups[] = {
...@@ -5659,6 +5674,8 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -5659,6 +5674,8 @@ static const struct hda_fixup alc269_fixups[] = {
[ALC269_FIXUP_HP_MUTE_LED_MIC3] = { [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc269_fixup_hp_mute_led_mic3, .v.func = alc269_fixup_hp_mute_led_mic3,
.chained = true,
.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
}, },
[ALC269_FIXUP_HP_GPIO_LED] = { [ALC269_FIXUP_HP_GPIO_LED] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
...@@ -6362,6 +6379,14 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -6362,6 +6379,14 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true, .chained = true,
.chain_id = ALC269_FIXUP_HEADSET_MIC .chain_id = ALC269_FIXUP_HEADSET_MIC
}, },
[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_invalidate_dacs,
},
[ALC295_FIXUP_HP_AUTO_MUTE] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc_fixup_auto_mute_via_amp,
},
}; };
static const struct snd_pci_quirk alc269_fixup_tbl[] = { static const struct snd_pci_quirk alc269_fixup_tbl[] = {
...@@ -6532,6 +6557,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -6532,6 +6557,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
...@@ -7034,6 +7060,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { ...@@ -7034,6 +7060,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
{0x12, 0x90a60130}, {0x12, 0x90a60130},
{0x19, 0x03a11020}, {0x19, 0x03a11020},
{0x21, 0x0321101f}), {0x21, 0x0321101f}),
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
{0x12, 0x90a60130},
{0x14, 0x90170110},
{0x19, 0x04a11040},
{0x21, 0x04211020}),
SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
{0x12, 0x90a60120}, {0x12, 0x90a60120},
{0x14, 0x90170110}, {0x14, 0x90170110},
...@@ -7295,6 +7326,10 @@ static int patch_alc269(struct hda_codec *codec) ...@@ -7295,6 +7326,10 @@ static int patch_alc269(struct hda_codec *codec)
spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
break; break;
case 0x10ec0300:
spec->codec_variant = ALC269_TYPE_ALC300;
spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
break;
case 0x10ec0700: case 0x10ec0700:
case 0x10ec0701: case 0x10ec0701:
case 0x10ec0703: case 0x10ec0703:
...@@ -8405,6 +8440,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { ...@@ -8405,6 +8440,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
......
...@@ -2187,11 +2187,6 @@ static int hdac_hdmi_runtime_suspend(struct device *dev) ...@@ -2187,11 +2187,6 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)
*/ */
snd_hdac_codec_read(hdev, hdev->afg, 0, AC_VERB_SET_POWER_STATE, snd_hdac_codec_read(hdev, hdev->afg, 0, AC_VERB_SET_POWER_STATE,
AC_PWRST_D3); AC_PWRST_D3);
err = snd_hdac_display_power(bus, false);
if (err < 0) {
dev_err(dev, "Cannot turn on display power on i915\n");
return err;
}
hlink = snd_hdac_ext_bus_get_link(bus, dev_name(dev)); hlink = snd_hdac_ext_bus_get_link(bus, dev_name(dev));
if (!hlink) { if (!hlink) {
...@@ -2201,7 +2196,11 @@ static int hdac_hdmi_runtime_suspend(struct device *dev) ...@@ -2201,7 +2196,11 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)
snd_hdac_ext_bus_link_put(bus, hlink); snd_hdac_ext_bus_link_put(bus, hlink);
return 0; err = snd_hdac_display_power(bus, false);
if (err < 0)
dev_err(dev, "Cannot turn off display power on i915\n");
return err;
} }
static int hdac_hdmi_runtime_resume(struct device *dev) static int hdac_hdmi_runtime_resume(struct device *dev)
......
...@@ -139,7 +139,7 @@ enum pcm186x_type { ...@@ -139,7 +139,7 @@ enum pcm186x_type {
#define PCM186X_MAX_REGISTER PCM186X_CURR_TRIM_CTRL #define PCM186X_MAX_REGISTER PCM186X_CURR_TRIM_CTRL
/* PCM186X_PAGE */ /* PCM186X_PAGE */
#define PCM186X_RESET 0xff #define PCM186X_RESET 0xfe
/* PCM186X_ADCX_INPUT_SEL_X */ /* PCM186X_ADCX_INPUT_SEL_X */
#define PCM186X_ADC_INPUT_SEL_POL BIT(7) #define PCM186X_ADC_INPUT_SEL_POL BIT(7)
......
...@@ -198,20 +198,16 @@ static const struct snd_kcontrol_new pcm3060_dapm_controls[] = { ...@@ -198,20 +198,16 @@ static const struct snd_kcontrol_new pcm3060_dapm_controls[] = {
}; };
static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = { static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = {
SND_SOC_DAPM_OUTPUT("OUTL+"), SND_SOC_DAPM_OUTPUT("OUTL"),
SND_SOC_DAPM_OUTPUT("OUTR+"), SND_SOC_DAPM_OUTPUT("OUTR"),
SND_SOC_DAPM_OUTPUT("OUTL-"),
SND_SOC_DAPM_OUTPUT("OUTR-"),
SND_SOC_DAPM_INPUT("INL"), SND_SOC_DAPM_INPUT("INL"),
SND_SOC_DAPM_INPUT("INR"), SND_SOC_DAPM_INPUT("INR"),
}; };
static const struct snd_soc_dapm_route pcm3060_dapm_map[] = { static const struct snd_soc_dapm_route pcm3060_dapm_map[] = {
{ "OUTL+", NULL, "Playback" }, { "OUTL", NULL, "Playback" },
{ "OUTR+", NULL, "Playback" }, { "OUTR", NULL, "Playback" },
{ "OUTL-", NULL, "Playback" },
{ "OUTR-", NULL, "Playback" },
{ "Capture", NULL, "INL" }, { "Capture", NULL, "INL" },
{ "Capture", NULL, "INR" }, { "Capture", NULL, "INR" },
......
...@@ -765,38 +765,41 @@ static unsigned int wm_adsp_region_to_reg(struct wm_adsp_region const *mem, ...@@ -765,38 +765,41 @@ static unsigned int wm_adsp_region_to_reg(struct wm_adsp_region const *mem,
static void wm_adsp2_show_fw_status(struct wm_adsp *dsp) static void wm_adsp2_show_fw_status(struct wm_adsp *dsp)
{ {
u16 scratch[4]; unsigned int scratch[4];
unsigned int addr = dsp->base + ADSP2_SCRATCH0;
unsigned int i;
int ret; int ret;
ret = regmap_raw_read(dsp->regmap, dsp->base + ADSP2_SCRATCH0, for (i = 0; i < ARRAY_SIZE(scratch); ++i) {
scratch, sizeof(scratch)); ret = regmap_read(dsp->regmap, addr + i, &scratch[i]);
if (ret) { if (ret) {
adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret); adsp_err(dsp, "Failed to read SCRATCH%u: %d\n", i, ret);
return; return;
}
} }
adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n", adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n",
be16_to_cpu(scratch[0]), scratch[0], scratch[1], scratch[2], scratch[3]);
be16_to_cpu(scratch[1]),
be16_to_cpu(scratch[2]),
be16_to_cpu(scratch[3]));
} }
static void wm_adsp2v2_show_fw_status(struct wm_adsp *dsp) static void wm_adsp2v2_show_fw_status(struct wm_adsp *dsp)
{ {
u32 scratch[2]; unsigned int scratch[2];
int ret; int ret;
ret = regmap_raw_read(dsp->regmap, dsp->base + ADSP2V2_SCRATCH0_1, ret = regmap_read(dsp->regmap, dsp->base + ADSP2V2_SCRATCH0_1,
scratch, sizeof(scratch)); &scratch[0]);
if (ret) { if (ret) {
adsp_err(dsp, "Failed to read SCRATCH regs: %d\n", ret); adsp_err(dsp, "Failed to read SCRATCH0_1: %d\n", ret);
return; return;
} }
scratch[0] = be32_to_cpu(scratch[0]); ret = regmap_read(dsp->regmap, dsp->base + ADSP2V2_SCRATCH2_3,
scratch[1] = be32_to_cpu(scratch[1]); &scratch[1]);
if (ret) {
adsp_err(dsp, "Failed to read SCRATCH2_3: %d\n", ret);
return;
}
adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n", adsp_dbg(dsp, "FW SCRATCH 0:0x%x 1:0x%x 2:0x%x 3:0x%x\n",
scratch[0] & 0xFFFF, scratch[0] & 0xFFFF,
......
...@@ -101,22 +101,42 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI ...@@ -101,22 +101,42 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
codec, then enable this option by saying Y or m. This is a codec, then enable this option by saying Y or m. This is a
recommended option recommended option
config SND_SOC_INTEL_SKYLAKE_SSP_CLK
tristate
config SND_SOC_INTEL_SKYLAKE config SND_SOC_INTEL_SKYLAKE
tristate "SKL/BXT/KBL/GLK/CNL... Platforms" tristate "SKL/BXT/KBL/GLK/CNL... Platforms"
depends on PCI && ACPI depends on PCI && ACPI
select SND_SOC_INTEL_SKYLAKE_COMMON
help
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
GeminiLake or CannonLake platform with the DSP enabled in the BIOS
then enable this option by saying Y or m.
if SND_SOC_INTEL_SKYLAKE
config SND_SOC_INTEL_SKYLAKE_SSP_CLK
tristate
config SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
bool "HDAudio codec support"
help
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
GeminiLake or CannonLake platform with an HDaudio codec
then enable this option by saying Y
config SND_SOC_INTEL_SKYLAKE_COMMON
tristate
select SND_HDA_EXT_CORE select SND_HDA_EXT_CORE
select SND_HDA_DSP_LOADER select SND_HDA_DSP_LOADER
select SND_SOC_TOPOLOGY select SND_SOC_TOPOLOGY
select SND_SOC_INTEL_SST select SND_SOC_INTEL_SST
select SND_SOC_HDAC_HDA if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC
select SND_SOC_ACPI_INTEL_MATCH select SND_SOC_ACPI_INTEL_MATCH
help help
If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/ If you have a Intel Skylake/Broxton/ApolloLake/KabyLake/
GeminiLake or CannonLake platform with the DSP enabled in the BIOS GeminiLake or CannonLake platform with the DSP enabled in the BIOS
then enable this option by saying Y or m. then enable this option by saying Y or m.
endif ## SND_SOC_INTEL_SKYLAKE