Commit 2848551b authored by Linus Torvalds's avatar Linus Torvalds

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

Pull sound fixes from Takashi Iwai:
 "A collection of small patches, mostly for old and new regressions and
  device-specific fixes.

   - Regression fixes regarding ALSA core SG-buffer helpers

   - Regression fix for Realtek HD-audio mutex deadlock

   - Regression fix for USB-audio PM resume error

   - More coverage of ASoC core control API notification fixes

   - Old regression fixes for HD-audio probe mask

   - Fixes for ASoC Realtek codec work handling

   - Other device-specific quirks / fixes"

* tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits)
  ASoC: intel: skylake: Set max DMA segment size
  ASoC: SOF: hda: Set max DMA segment size
  ALSA: hda: Set max DMA segment size
  ALSA: hda/realtek: Fix deadlock by COEF mutex
  ALSA: usb-audio: Don't abort resume upon errors
  ALSA: hda: Fix missing codec probe on Shenker Dock 15
  ALSA: hda: Fix regression on forced probe mask option
  ALSA: hda/realtek: Add quirk for Legion Y9000X 2019
  ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra
  ASoC: wm_adsp: Correct control read size when parsing compressed buffer
  ASoC: qcom: Actually clear DMA interrupt register for HDMI
  ALSA: memalloc: invalidate SG pages before sync
  ALSA: memalloc: Fix dma_need_sync() checks
  MAINTAINERS: update cros_ec_codec maintainers
  ASoC: rt5682: do not block workqueue if card is unbound
  ASoC: rt5668: do not block workqueue if card is unbound
  ASoC: rt5682s: do not block workqueue if card is unbound
  ASoC: tas2770: Insert post reset delay
  ASoC: Revert "ASoC: mediatek: Check for error clk pointer"
  ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
  ...
parents 45a98a71 c22a8086
...@@ -8,6 +8,7 @@ title: Audio codec controlled by ChromeOS EC ...@@ -8,6 +8,7 @@ title: Audio codec controlled by ChromeOS EC
maintainers: maintainers:
- Cheng-Yi Chiang <cychiang@chromium.org> - Cheng-Yi Chiang <cychiang@chromium.org>
- Tzung-Bi Shih <tzungbi@google.com>
description: | description: |
Google's ChromeOS EC codec is a digital mic codec provided by the Google's ChromeOS EC codec is a digital mic codec provided by the
......
...@@ -4547,6 +4547,7 @@ F: drivers/platform/chrome/ ...@@ -4547,6 +4547,7 @@ F: drivers/platform/chrome/
CHROMEOS EC CODEC DRIVER CHROMEOS EC CODEC DRIVER
M: Cheng-Yi Chiang <cychiang@chromium.org> M: Cheng-Yi Chiang <cychiang@chromium.org>
M: Tzung-Bi Shih <tzungbi@google.com>
R: Guenter Roeck <groeck@chromium.org> R: Guenter Roeck <groeck@chromium.org>
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
......
...@@ -411,17 +411,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd) ...@@ -411,17 +411,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
return ret; return ret;
} }
static int init_clks(struct platform_device *pdev, struct clk **clk) static void init_clks(struct platform_device *pdev, struct clk **clk)
{ {
int i; int i;
for (i = CLK_NONE + 1; i < CLK_MAX; i++) { for (i = CLK_NONE + 1; i < CLK_MAX; i++)
clk[i] = devm_clk_get(&pdev->dev, clk_names[i]); clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
if (IS_ERR(clk[i]))
return PTR_ERR(clk[i]);
}
return 0;
} }
static struct scp *init_scp(struct platform_device *pdev, static struct scp *init_scp(struct platform_device *pdev,
...@@ -431,7 +426,7 @@ static struct scp *init_scp(struct platform_device *pdev, ...@@ -431,7 +426,7 @@ static struct scp *init_scp(struct platform_device *pdev,
{ {
struct genpd_onecell_data *pd_data; struct genpd_onecell_data *pd_data;
struct resource *res; struct resource *res;
int i, j, ret; int i, j;
struct scp *scp; struct scp *scp;
struct clk *clk[CLK_MAX]; struct clk *clk[CLK_MAX];
...@@ -486,9 +481,7 @@ static struct scp *init_scp(struct platform_device *pdev, ...@@ -486,9 +481,7 @@ static struct scp *init_scp(struct platform_device *pdev,
pd_data->num_domains = num; pd_data->num_domains = num;
ret = init_clks(pdev, clk); init_clks(pdev, clk);
if (ret)
return ERR_PTR(ret);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
struct scp_domain *scpd = &scp->domains[i]; struct scp_domain *scpd = &scp->domains[i];
......
...@@ -511,7 +511,8 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size) ...@@ -511,7 +511,8 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
DEFAULT_GFP, 0); DEFAULT_GFP, 0);
if (!sgt) if (!sgt)
return NULL; return NULL;
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir); dmab->dev.need_sync = dma_need_sync(dmab->dev.dev,
sg_dma_address(sgt->sgl));
p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt); p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt);
if (p) if (p)
dmab->private_data = sgt; dmab->private_data = sgt;
...@@ -540,9 +541,9 @@ static void snd_dma_noncontig_sync(struct snd_dma_buffer *dmab, ...@@ -540,9 +541,9 @@ static void snd_dma_noncontig_sync(struct snd_dma_buffer *dmab,
if (mode == SNDRV_DMA_SYNC_CPU) { if (mode == SNDRV_DMA_SYNC_CPU) {
if (dmab->dev.dir == DMA_TO_DEVICE) if (dmab->dev.dir == DMA_TO_DEVICE)
return; return;
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data, dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data,
dmab->dev.dir); dmab->dev.dir);
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
} else { } else {
if (dmab->dev.dir == DMA_FROM_DEVICE) if (dmab->dev.dir == DMA_FROM_DEVICE)
return; return;
...@@ -671,9 +672,13 @@ static const struct snd_malloc_ops snd_dma_sg_wc_ops = { ...@@ -671,9 +672,13 @@ static const struct snd_malloc_ops snd_dma_sg_wc_ops = {
*/ */
static void *snd_dma_noncoherent_alloc(struct snd_dma_buffer *dmab, size_t size) static void *snd_dma_noncoherent_alloc(struct snd_dma_buffer *dmab, size_t size)
{ {
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir); void *p;
return dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
dmab->dev.dir, DEFAULT_GFP); p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
dmab->dev.dir, DEFAULT_GFP);
if (p)
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr);
return p;
} }
static void snd_dma_noncoherent_free(struct snd_dma_buffer *dmab) static void snd_dma_noncoherent_free(struct snd_dma_buffer *dmab)
......
...@@ -1615,6 +1615,7 @@ static const struct snd_pci_quirk probe_mask_list[] = { ...@@ -1615,6 +1615,7 @@ static const struct snd_pci_quirk probe_mask_list[] = {
/* forced codec slots */ /* forced codec slots */
SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103), SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103),
SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103), SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103),
SND_PCI_QUIRK(0x1558, 0x0351, "Schenker Dock 15", 0x105),
/* WinFast VP200 H (Teradici) user reported broken communication */ /* WinFast VP200 H (Teradici) user reported broken communication */
SND_PCI_QUIRK(0x3a21, 0x040d, "WinFast VP200 H", 0x101), SND_PCI_QUIRK(0x3a21, 0x040d, "WinFast VP200 H", 0x101),
{} {}
...@@ -1798,8 +1799,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -1798,8 +1799,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
assign_position_fix(chip, check_position_fix(chip, position_fix[dev])); assign_position_fix(chip, check_position_fix(chip, position_fix[dev]));
check_probe_mask(chip, dev);
if (single_cmd < 0) /* allow fallback to single_cmd at errors */ if (single_cmd < 0) /* allow fallback to single_cmd at errors */
chip->fallback_to_single_cmd = 1; chip->fallback_to_single_cmd = 1;
else /* explicitly set to single_cmd or not */ else /* explicitly set to single_cmd or not */
...@@ -1825,6 +1824,8 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -1825,6 +1824,8 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
chip->bus.core.needs_damn_long_delay = 1; chip->bus.core.needs_damn_long_delay = 1;
} }
check_probe_mask(chip, dev);
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) { if (err < 0) {
dev_err(card->dev, "Error creating device [card]!\n"); dev_err(card->dev, "Error creating device [card]!\n");
...@@ -1940,6 +1941,7 @@ static int azx_first_init(struct azx *chip) ...@@ -1940,6 +1941,7 @@ static int azx_first_init(struct azx *chip)
dma_bits = 32; dma_bits = 32;
if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(dma_bits))) if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(dma_bits)))
dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32)); dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
dma_set_max_seg_size(&pci->dev, UINT_MAX);
/* read number of streams from GCAP register instead of using /* read number of streams from GCAP register instead of using
* hardcoded value * hardcoded value
......
...@@ -138,6 +138,22 @@ struct alc_spec { ...@@ -138,6 +138,22 @@ struct alc_spec {
* COEF access helper functions * COEF access helper functions
*/ */
static void coef_mutex_lock(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
snd_hda_power_up_pm(codec);
mutex_lock(&spec->coef_mutex);
}
static void coef_mutex_unlock(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
mutex_unlock(&spec->coef_mutex);
snd_hda_power_down_pm(codec);
}
static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
unsigned int coef_idx) unsigned int coef_idx)
{ {
...@@ -151,12 +167,11 @@ static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, ...@@ -151,12 +167,11 @@ static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
unsigned int coef_idx) unsigned int coef_idx)
{ {
struct alc_spec *spec = codec->spec;
unsigned int val; unsigned int val;
mutex_lock(&spec->coef_mutex); coef_mutex_lock(codec);
val = __alc_read_coefex_idx(codec, nid, coef_idx); val = __alc_read_coefex_idx(codec, nid, coef_idx);
mutex_unlock(&spec->coef_mutex); coef_mutex_unlock(codec);
return val; return val;
} }
...@@ -173,11 +188,9 @@ static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, ...@@ -173,11 +188,9 @@ static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
unsigned int coef_idx, unsigned int coef_val) unsigned int coef_idx, unsigned int coef_val)
{ {
struct alc_spec *spec = codec->spec; coef_mutex_lock(codec);
mutex_lock(&spec->coef_mutex);
__alc_write_coefex_idx(codec, nid, coef_idx, coef_val); __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
mutex_unlock(&spec->coef_mutex); coef_mutex_unlock(codec);
} }
#define alc_write_coef_idx(codec, coef_idx, coef_val) \ #define alc_write_coef_idx(codec, coef_idx, coef_val) \
...@@ -198,11 +211,9 @@ static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, ...@@ -198,11 +211,9 @@ static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
unsigned int coef_idx, unsigned int mask, unsigned int coef_idx, unsigned int mask,
unsigned int bits_set) unsigned int bits_set)
{ {
struct alc_spec *spec = codec->spec; coef_mutex_lock(codec);
mutex_lock(&spec->coef_mutex);
__alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set); __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
mutex_unlock(&spec->coef_mutex); coef_mutex_unlock(codec);
} }
#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
...@@ -235,9 +246,7 @@ struct coef_fw { ...@@ -235,9 +246,7 @@ struct coef_fw {
static void alc_process_coef_fw(struct hda_codec *codec, static void alc_process_coef_fw(struct hda_codec *codec,
const struct coef_fw *fw) const struct coef_fw *fw)
{ {
struct alc_spec *spec = codec->spec; coef_mutex_lock(codec);
mutex_lock(&spec->coef_mutex);
for (; fw->nid; fw++) { for (; fw->nid; fw++) {
if (fw->mask == (unsigned short)-1) if (fw->mask == (unsigned short)-1)
__alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
...@@ -245,7 +254,7 @@ static void alc_process_coef_fw(struct hda_codec *codec, ...@@ -245,7 +254,7 @@ static void alc_process_coef_fw(struct hda_codec *codec,
__alc_update_coefex_idx(codec, fw->nid, fw->idx, __alc_update_coefex_idx(codec, fw->nid, fw->idx,
fw->mask, fw->val); fw->mask, fw->val);
} }
mutex_unlock(&spec->coef_mutex); coef_mutex_unlock(codec);
} }
/* /*
...@@ -9170,6 +9179,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -9170,6 +9179,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6), SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#define EN_SPKR_GPIO_GB 0x11F #define EN_SPKR_GPIO_GB 0x11F
#define EN_SPKR_GPIO_NK 0x146
#define EN_SPKR_GPIO_NONE -EINVAL #define EN_SPKR_GPIO_NONE -EINVAL
enum be_id { enum be_id {
......
...@@ -37,7 +37,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = { ...@@ -37,7 +37,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = {
.hs_codec_id = RT5682, .hs_codec_id = RT5682,
.amp_codec_id = MAX98360A, .amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.gpio_spkr_en = EN_SPKR_GPIO_NK, .gpio_spkr_en = EN_SPKR_GPIO_NONE,
}; };
static struct acp_card_drvdata sof_rt5682s_max_data = { static struct acp_card_drvdata sof_rt5682s_max_data = {
...@@ -47,7 +47,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = { ...@@ -47,7 +47,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
.hs_codec_id = RT5682S, .hs_codec_id = RT5682S,
.amp_codec_id = MAX98360A, .amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.gpio_spkr_en = EN_SPKR_GPIO_NK, .gpio_spkr_en = EN_SPKR_GPIO_NONE,
}; };
static const struct snd_kcontrol_new acp_controls[] = { static const struct snd_kcontrol_new acp_controls[] = {
......
...@@ -1022,11 +1022,13 @@ static void rt5668_jack_detect_handler(struct work_struct *work) ...@@ -1022,11 +1022,13 @@ static void rt5668_jack_detect_handler(struct work_struct *work)
container_of(work, struct rt5668_priv, jack_detect_work.work); container_of(work, struct rt5668_priv, jack_detect_work.work);
int val, btn_type; int val, btn_type;
while (!rt5668->component) if (!rt5668->component || !rt5668->component->card ||
usleep_range(10000, 15000); !rt5668->component->card->instantiated) {
/* card not yet ready, try later */
while (!rt5668->component->card->instantiated) mod_delayed_work(system_power_efficient_wq,
usleep_range(10000, 15000); &rt5668->jack_detect_work, msecs_to_jiffies(15));
return;
}
mutex_lock(&rt5668->calibrate_mutex); mutex_lock(&rt5668->calibrate_mutex);
......
...@@ -1092,11 +1092,13 @@ void rt5682_jack_detect_handler(struct work_struct *work) ...@@ -1092,11 +1092,13 @@ void rt5682_jack_detect_handler(struct work_struct *work)
struct snd_soc_dapm_context *dapm; struct snd_soc_dapm_context *dapm;
int val, btn_type; int val, btn_type;
while (!rt5682->component) if (!rt5682->component || !rt5682->component->card ||
usleep_range(10000, 15000); !rt5682->component->card->instantiated) {
/* card not yet ready, try later */
while (!rt5682->component->card->instantiated) mod_delayed_work(system_power_efficient_wq,
usleep_range(10000, 15000); &rt5682->jack_detect_work, msecs_to_jiffies(15));
return;
}
dapm = snd_soc_component_get_dapm(rt5682->component); dapm = snd_soc_component_get_dapm(rt5682->component);
......
...@@ -824,11 +824,13 @@ static void rt5682s_jack_detect_handler(struct work_struct *work) ...@@ -824,11 +824,13 @@ static void rt5682s_jack_detect_handler(struct work_struct *work)
container_of(work, struct rt5682s_priv, jack_detect_work.work); container_of(work, struct rt5682s_priv, jack_detect_work.work);
int val, btn_type; int val, btn_type;
while (!rt5682s->component) if (!rt5682s->component || !rt5682s->component->card ||
usleep_range(10000, 15000); !rt5682s->component->card->instantiated) {
/* card not yet ready, try later */
while (!rt5682s->component->card->instantiated) mod_delayed_work(system_power_efficient_wq,
usleep_range(10000, 15000); &rt5682s->jack_detect_work, msecs_to_jiffies(15));
return;
}
mutex_lock(&rt5682s->jdet_mutex); mutex_lock(&rt5682s->jdet_mutex);
mutex_lock(&rt5682s->calibrate_mutex); mutex_lock(&rt5682s->calibrate_mutex);
......
...@@ -38,10 +38,12 @@ static void tas2770_reset(struct tas2770_priv *tas2770) ...@@ -38,10 +38,12 @@ static void tas2770_reset(struct tas2770_priv *tas2770)
gpiod_set_value_cansleep(tas2770->reset_gpio, 0); gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
msleep(20); msleep(20);
gpiod_set_value_cansleep(tas2770->reset_gpio, 1); gpiod_set_value_cansleep(tas2770->reset_gpio, 1);
usleep_range(1000, 2000);
} }
snd_soc_component_write(tas2770->component, TAS2770_SW_RST, snd_soc_component_write(tas2770->component, TAS2770_SW_RST,
TAS2770_RST); TAS2770_RST);
usleep_range(1000, 2000);
} }
static int tas2770_set_bias_level(struct snd_soc_component *component, static int tas2770_set_bias_level(struct snd_soc_component *component,
...@@ -110,6 +112,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component) ...@@ -110,6 +112,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component)
if (tas2770->sdz_gpio) { if (tas2770->sdz_gpio) {
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
usleep_range(1000, 2000);
} else { } else {
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
TAS2770_PWR_CTRL_MASK, TAS2770_PWR_CTRL_MASK,
...@@ -510,8 +513,10 @@ static int tas2770_codec_probe(struct snd_soc_component *component) ...@@ -510,8 +513,10 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
tas2770->component = component; tas2770->component = component;
if (tas2770->sdz_gpio) if (tas2770->sdz_gpio) {
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
usleep_range(1000, 2000);
}
tas2770_reset(tas2770); tas2770_reset(tas2770);
......
...@@ -1441,7 +1441,8 @@ static int wm_adsp_buffer_parse_coeff(struct cs_dsp_coeff_ctl *cs_ctl) ...@@ -1441,7 +1441,8 @@ static int wm_adsp_buffer_parse_coeff(struct cs_dsp_coeff_ctl *cs_ctl)
int ret, i; int ret, i;
for (i = 0; i < 5; ++i) { for (i = 0; i < 5; ++i) {
ret = cs_dsp_coeff_read_ctrl(cs_ctl, 0, &coeff_v1, sizeof(coeff_v1)); ret = cs_dsp_coeff_read_ctrl(cs_ctl, 0, &coeff_v1,
min(cs_ctl->len, sizeof(coeff_v1)));
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -952,6 +952,7 @@ static int skl_first_init(struct hdac_bus *bus) ...@@ -952,6 +952,7 @@ static int skl_first_init(struct hdac_bus *bus)
/* allow 64bit DMA address if supported by H/W */ /* allow 64bit DMA address if supported by H/W */
if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64))) if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32)); dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
dma_set_max_seg_size(bus->dev, UINT_MAX);
/* initialize streams */ /* initialize streams */
snd_hdac_ext_stream_init_all snd_hdac_ext_stream_init_all
......
...@@ -524,7 +524,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, ...@@ -524,7 +524,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,
return -EINVAL; return -EINVAL;
} }
ret = regmap_update_bits(map, reg_irqclr, val_irqclr, val_irqclr); ret = regmap_write_bits(map, reg_irqclr, val_irqclr, val_irqclr);
if (ret) { if (ret) {
dev_err(soc_runtime->dev, "error writing to irqclear reg: %d\n", ret); dev_err(soc_runtime->dev, "error writing to irqclear reg: %d\n", ret);
return ret; return ret;
...@@ -665,7 +665,7 @@ static irqreturn_t lpass_dma_interrupt_handler( ...@@ -665,7 +665,7 @@ static irqreturn_t lpass_dma_interrupt_handler(
return -EINVAL; return -EINVAL;
} }
if (interrupts & LPAIF_IRQ_PER(chan)) { if (interrupts & LPAIF_IRQ_PER(chan)) {
rv = regmap_update_bits(map, reg, mask, (LPAIF_IRQ_PER(chan) | val)); rv = regmap_write_bits(map, reg, mask, (LPAIF_IRQ_PER(chan) | val));
if (rv) { if (rv) {
dev_err(soc_runtime->dev, dev_err(soc_runtime->dev,
"error writing to irqclear reg: %d\n", rv); "error writing to irqclear reg: %d\n", rv);
...@@ -676,7 +676,7 @@ static irqreturn_t lpass_dma_interrupt_handler( ...@@ -676,7 +676,7 @@ static irqreturn_t lpass_dma_interrupt_handler(
} }
if (interrupts & LPAIF_IRQ_XRUN(chan)) { if (interrupts & LPAIF_IRQ_XRUN(chan)) {
rv = regmap_update_bits(map, reg, mask, (LPAIF_IRQ_XRUN(chan) | val)); rv = regmap_write_bits(map, reg, mask, (LPAIF_IRQ_XRUN(chan) | val));
if (rv) { if (rv) {
dev_err(soc_runtime->dev, dev_err(soc_runtime->dev,
"error writing to irqclear reg: %d\n", rv); "error writing to irqclear reg: %d\n", rv);
...@@ -688,7 +688,7 @@ static irqreturn_t lpass_dma_interrupt_handler( ...@@ -688,7 +688,7 @@ static irqreturn_t lpass_dma_interrupt_handler(
} }
if (interrupts & LPAIF_IRQ_ERR(chan)) { if (interrupts & LPAIF_IRQ_ERR(chan)) {
rv = regmap_update_bits(map, reg, mask, (LPAIF_IRQ_ERR(chan) | val)); rv = regmap_write_bits(map, reg, mask, (LPAIF_IRQ_ERR(chan) | val));
if (rv) { if (rv) {
dev_err(soc_runtime->dev, dev_err(soc_runtime->dev,
"error writing to irqclear reg: %d\n", rv); "error writing to irqclear reg: %d\n", rv);
......
...@@ -308,7 +308,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, ...@@ -308,7 +308,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
unsigned int sign_bit = mc->sign_bit; unsigned int sign_bit = mc->sign_bit;
unsigned int mask = (1 << fls(max)) - 1; unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert; unsigned int invert = mc->invert;
int err; int err, ret;
bool type_2r = false; bool type_2r = false;
unsigned int val2 = 0; unsigned int val2 = 0;
unsigned int val, val_mask; unsigned int val, val_mask;
...@@ -350,12 +350,18 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, ...@@ -350,12 +350,18 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
err = snd_soc_component_update_bits(component, reg, val_mask, val); err = snd_soc_component_update_bits(component, reg, val_mask, val);
if (err < 0) if (err < 0)
return err; return err;
ret = err;
if (type_2r) if (type_2r) {
err = snd_soc_component_update_bits(component, reg2, val_mask, err = snd_soc_component_update_bits(component, reg2, val_mask,
val2); val2);
/* Don't discard any error code or drop change flag */
if (ret == 0 || err < 0) {
ret = err;
}
}
return err; return ret;
} }
EXPORT_SYMBOL_GPL(snd_soc_put_volsw); EXPORT_SYMBOL_GPL(snd_soc_put_volsw);
...@@ -421,6 +427,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, ...@@ -421,6 +427,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
int min = mc->min; int min = mc->min;
unsigned int mask = (1U << (fls(min + max) - 1)) - 1; unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
int err = 0; int err = 0;
int ret;
unsigned int val, val_mask; unsigned int val, val_mask;
if (ucontrol->value.integer.value[0] < 0) if (ucontrol->value.integer.value[0] < 0)
...@@ -437,6 +444,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, ...@@ -437,6 +444,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
err = snd_soc_component_update_bits(component, reg, val_mask, val); err = snd_soc_component_update_bits(component, reg, val_mask, val);
if (err < 0) if (err < 0)
return err; return err;
ret = err;
if (snd_soc_volsw_is_stereo(mc)) { if (snd_soc_volsw_is_stereo(mc)) {
unsigned int val2; unsigned int val2;
...@@ -447,6 +455,11 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, ...@@ -447,6 +455,11 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
err = snd_soc_component_update_bits(component, reg2, val_mask, err = snd_soc_component_update_bits(component, reg2, val_mask,
val2); val2);
/* Don't discard any error code or drop change flag */
if (ret == 0 || err < 0) {
ret = err;
}
} }
return err; return err;
} }
...@@ -506,7 +519,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, ...@@ -506,7 +519,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
unsigned int mask = (1 << fls(max)) - 1; unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert; unsigned int invert = mc->invert;
unsigned int val, val_mask; unsigned int val, val_mask;
int ret; int err, ret;
if (invert) if (invert)
val = (max - ucontrol->value.integer.value[0]) & mask; val = (max - ucontrol->value.integer.value[0]) & mask;
...@@ -515,9 +528,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, ...@@ -515,9 +528,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
val_mask = mask << shift; val_mask = mask << shift;
val = val << shift; val = val << shift;
ret = snd_soc_component_update_bits(component, reg, val_mask, val); err = snd_soc_component_update_bits(component, reg, val_mask, val);
if (ret < 0) if (err < 0)
return ret; return err;
ret = err;
if (snd_soc_volsw_is_stereo(mc)) { if (snd_soc_volsw_is_stereo(mc)) {
if (invert) if (invert)
...@@ -527,8 +541,12 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, ...@@ -527,8 +541,12 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
val_mask = mask << shift; val_mask = mask << shift;
val = val << shift; val = val << shift;
ret = snd_soc_component_update_bits(component, rreg, val_mask, err = snd_soc_component_update_bits(component, rreg, val_mask,
val); val);
/* Don't discard any error code or drop change flag */
if (ret == 0 || err < 0) {
ret = err;
}
} }
return ret; return ret;
...@@ -877,6 +895,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, ...@@ -877,6 +895,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
unsigned long mask = (1UL<<mc->nbits)-1; unsigned long mask = (1UL<<mc->nbits)-1;
long max = mc->max; long max = mc->max;
long val = ucontrol->value.integer.value[0]; long val = ucontrol->value.integer.value[0];
int ret = 0;
unsigned int i; unsigned int i;
if (val < mc->min || val > mc->max) if (val < mc->min || val > mc->max)
...@@ -891,9 +910,11 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, ...@@ -891,9 +910,11 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
regmask, regval); regmask, regval);
if (err < 0) if (err < 0)
return err; return err;
if (err > 0)
ret = err;
} }
return 0; return ret;
} }
EXPORT_SYMBOL_GPL(snd_soc_put_xr_sx); EXPORT_SYMBOL_GPL(snd_soc_put_xr_sx);
......
...@@ -956,6 +956,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) ...@@ -956,6 +956,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
dev_dbg(sdev->dev, "DMA mask is 32 bit\n"); dev_dbg(sdev->dev, "DMA mask is 32 bit\n");
dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32)); dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
} }
dma_set_max_seg_size(&pci->dev, UINT_MAX);
/* init streams */ /* init streams */
ret = hda_dsp_stream_init(sdev); ret = hda_dsp_stream_init(sdev);
......
...@@ -47,13 +47,13 @@ struct snd_usb_implicit_fb_match { ...@@ -47,13 +47,13 @@ struct snd_usb_implicit_fb_match {
static const struct snd_usb_implicit_fb_match playback_implicit_fb_quirks[] = { static const struct snd_usb_implicit_fb_match playback_implicit_fb_quirks[] = {
/* Generic matching */ /* Generic matching */
IMPLICIT_FB_GENERIC_DEV(0x0499, 0x1509), /* Steinberg UR22 */ IMPLICIT_FB_GENERIC_DEV(0x0499, 0x1509), /* Steinberg UR22 */
IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2080), /* M-Audio FastTrack Ultra */
IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2081), /* M-Audio FastTrack Ultra */
IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2030), /* M-Audio Fast Track C400 */ IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2030), /* M-Audio Fast Track C400 */
IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2031), /* M-Audio Fast Track C600 */ IMPLICIT_FB_GENERIC_DEV(0x0763, 0x2031), /* M-Audio Fast Track C600 */
/* Fixed EP */ /* Fixed EP */
/* FIXME: check the availability of generic matching */ /* FIXME: check the availability of generic matching */
IMPLICIT_FB_FIXED_DEV(0x0763, 0x2080, 0x81, 2), /* M-Audio FastTrack Ultra */
IMPLICIT_FB_FIXED_DEV(0x0763, 0x2081, 0x81, 2), /* M-Audio FastTrack Ultra */
IMPLICIT_FB_FIXED_DEV(0x2466, 0x8010, 0x81, 2), /* Fractal Audio Axe-Fx III */ IMPLICIT_FB_FIXED_DEV(0x2466, 0x8010, 0x81, 2), /* Fractal Audio Axe-Fx III */
IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0001, 0x81, 2), /* Solid State Logic SSL2 */ IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0001, 0x81, 2), /* Solid State Logic SSL2 */
IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0002, 0x81, 2), /* Solid State Logic SSL2+ */ IMPLICIT_FB_FIXED_DEV(0x31e9, 0x0002, 0x81, 2), /* Solid State Logic SSL2+ */
......
...@@ -3678,17 +3678,14 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list) ...@@ -3678,17 +3678,14 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list)
err = snd_usb_set_cur_mix_value(cval, c + 1, idx, err = snd_usb_set_cur_mix_value(cval, c + 1, idx,
cval->cache_val[idx]); cval->cache_val[idx]);
if (err < 0) if (err < 0)
return err; break;
} }
idx++; idx++;
} }
} else { } else {
/* master */ /* master */
if (cval->cached) { if (cval->cached)
err = snd_usb_set_cur_mix_value(cval, 0, 0, *cval->cache_val); snd_usb_set_cur_mix_value(cval, 0, 0, *cval->cache_val);
if (err < 0)
return err;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment