Commit 999abd7a authored by Mark Brown's avatar Mark Brown

Merge existing fixes from asoc/for-5.14

parents e73f0f0e 9cf76a72
...@@ -1325,7 +1325,7 @@ config SND_SOC_SSM2305 ...@@ -1325,7 +1325,7 @@ config SND_SOC_SSM2305
high-efficiency mono Class-D audio power amplifiers. high-efficiency mono Class-D audio power amplifiers.
config SND_SOC_SSM2518 config SND_SOC_SSM2518
tristate tristate "Analog Devices SSM2518 Class-D Amplifier"
depends on I2C depends on I2C
config SND_SOC_SSM2602 config SND_SOC_SSM2602
...@@ -1813,11 +1813,6 @@ config SND_SOC_ZL38060 ...@@ -1813,11 +1813,6 @@ config SND_SOC_ZL38060
which consists of a Digital Signal Processor (DSP), several Digital which consists of a Digital Signal Processor (DSP), several Digital
Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs. Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs.
config SND_SOC_ZX_AUD96P22
tristate "ZTE ZX AUD96P22 CODEC"
depends on I2C
select REGMAP_I2C
# Amp # Amp
config SND_SOC_LM4857 config SND_SOC_LM4857
tristate tristate
......
...@@ -151,8 +151,8 @@ struct aic31xx_pdata { ...@@ -151,8 +151,8 @@ struct aic31xx_pdata {
#define AIC31XX_WORD_LEN_24BITS 0x02 #define AIC31XX_WORD_LEN_24BITS 0x02
#define AIC31XX_WORD_LEN_32BITS 0x03 #define AIC31XX_WORD_LEN_32BITS 0x03
#define AIC31XX_IFACE1_MASTER_MASK GENMASK(3, 2) #define AIC31XX_IFACE1_MASTER_MASK GENMASK(3, 2)
#define AIC31XX_BCLK_MASTER BIT(2) #define AIC31XX_BCLK_MASTER BIT(3)
#define AIC31XX_WCLK_MASTER BIT(3) #define AIC31XX_WCLK_MASTER BIT(2)
/* AIC31XX_DATA_OFFSET */ /* AIC31XX_DATA_OFFSET */
#define AIC31XX_DATA_OFFSET_MASK GENMASK(7, 0) #define AIC31XX_DATA_OFFSET_MASK GENMASK(7, 0)
......
...@@ -282,6 +282,7 @@ ...@@ -282,6 +282,7 @@
/* /*
* HALO_CCM_CORE_CONTROL * HALO_CCM_CORE_CONTROL
*/ */
#define HALO_CORE_RESET 0x00000200
#define HALO_CORE_EN 0x00000001 #define HALO_CORE_EN 0x00000001
/* /*
...@@ -1213,7 +1214,7 @@ static int wm_coeff_tlv_get(struct snd_kcontrol *kctl, ...@@ -1213,7 +1214,7 @@ static int wm_coeff_tlv_get(struct snd_kcontrol *kctl,
mutex_lock(&ctl->dsp->pwr_lock); mutex_lock(&ctl->dsp->pwr_lock);
ret = wm_coeff_read_ctrl_raw(ctl, ctl->cache, size); ret = wm_coeff_read_ctrl(ctl, ctl->cache, size);
if (!ret && copy_to_user(bytes, ctl->cache, size)) if (!ret && copy_to_user(bytes, ctl->cache, size))
ret = -EFAULT; ret = -EFAULT;
...@@ -3333,7 +3334,8 @@ static int wm_halo_start_core(struct wm_adsp *dsp) ...@@ -3333,7 +3334,8 @@ static int wm_halo_start_core(struct wm_adsp *dsp)
{ {
return regmap_update_bits(dsp->regmap, return regmap_update_bits(dsp->regmap,
dsp->base + HALO_CCM_CORE_CONTROL, dsp->base + HALO_CCM_CORE_CONTROL,
HALO_CORE_EN, HALO_CORE_EN); HALO_CORE_RESET | HALO_CORE_EN,
HALO_CORE_RESET | HALO_CORE_EN);
} }
static void wm_halo_stop_core(struct wm_adsp *dsp) static void wm_halo_stop_core(struct wm_adsp *dsp)
......
...@@ -55,43 +55,68 @@ static int spk_init(struct snd_soc_pcm_runtime *rtd) ...@@ -55,43 +55,68 @@ static int spk_init(struct snd_soc_pcm_runtime *rtd)
return ret; return ret;
} }
static int max98373_sdw_trigger(struct snd_pcm_substream *substream, int cmd) static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enable)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai;
struct snd_soc_dai *cpu_dai;
int ret; int ret;
int j;
switch (cmd) { /* set spk pin by playback only */
case SNDRV_PCM_TRIGGER_START: if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
case SNDRV_PCM_TRIGGER_RESUME: return 0;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
/* enable max98373 first */ cpu_dai = asoc_rtd_to_cpu(rtd, 0);
ret = max_98373_trigger(substream, cmd); for_each_rtd_codec_dais(rtd, j, codec_dai) {
if (ret < 0) struct snd_soc_dapm_context *dapm =
break; snd_soc_component_get_dapm(cpu_dai->component);
char pin_name[16];
ret = sdw_trigger(substream, cmd);
break; snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",
case SNDRV_PCM_TRIGGER_STOP: codec_dai->component->name_prefix);
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
ret = sdw_trigger(substream, cmd);
if (ret < 0)
break;
ret = max_98373_trigger(substream, cmd); if (enable)
break; ret = snd_soc_dapm_enable_pin(dapm, pin_name);
default: else
ret = -EINVAL; ret = snd_soc_dapm_disable_pin(dapm, pin_name);
break;
if (!ret)
snd_soc_dapm_sync(dapm);
} }
return 0;
}
static int mx8373_sdw_prepare(struct snd_pcm_substream *substream)
{
int ret = 0;
/* according to soc_pcm_prepare dai link prepare is called first */
ret = sdw_prepare(substream);
if (ret < 0)
return ret;
return mx8373_enable_spk_pin(substream, true);
}
static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream)
{
int ret = 0;
/* according to soc_pcm_hw_free dai link free is called first */
ret = sdw_hw_free(substream);
if (ret < 0)
return ret; return ret;
return mx8373_enable_spk_pin(substream, false);
} }
static const struct snd_soc_ops max_98373_sdw_ops = { static const struct snd_soc_ops max_98373_sdw_ops = {
.startup = sdw_startup, .startup = sdw_startup,
.prepare = sdw_prepare, .prepare = mx8373_sdw_prepare,
.trigger = max98373_sdw_trigger, .trigger = sdw_trigger,
.hw_free = sdw_hw_free, .hw_free = mx8373_sdw_hw_free,
.shutdown = sdw_shutdown, .shutdown = sdw_shutdown,
}; };
......
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