aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/amd/acp-pcm-dma.c22
-rw-r--r--sound/soc/codecs/rt5514-spi.c14
-rw-r--r--sound/soc/codecs/rt5682.c5
-rw-r--r--sound/soc/codecs/sta32x.c3
4 files changed, 25 insertions, 19 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 77b265bd0505..3135e9eafd18 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -1036,16 +1036,22 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
1036 1036
1037 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { 1037 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
1038 period_bytes = frames_to_bytes(runtime, runtime->period_size); 1038 period_bytes = frames_to_bytes(runtime, runtime->period_size);
1039 dscr = acp_reg_read(rtd->acp_mmio, rtd->dma_curr_dscr);
1040 if (dscr == rtd->dma_dscr_idx_1)
1041 pos = period_bytes;
1042 else
1043 pos = 0;
1044 bytescount = acp_get_byte_count(rtd); 1039 bytescount = acp_get_byte_count(rtd);
1045 if (bytescount > rtd->bytescount) 1040 if (bytescount >= rtd->bytescount)
1046 bytescount -= rtd->bytescount; 1041 bytescount -= rtd->bytescount;
1047 delay = do_div(bytescount, period_bytes); 1042 if (bytescount < period_bytes) {
1048 runtime->delay = bytes_to_frames(runtime, delay); 1043 pos = 0;
1044 } else {
1045 dscr = acp_reg_read(rtd->acp_mmio, rtd->dma_curr_dscr);
1046 if (dscr == rtd->dma_dscr_idx_1)
1047 pos = period_bytes;
1048 else
1049 pos = 0;
1050 }
1051 if (bytescount > 0) {
1052 delay = do_div(bytescount, period_bytes);
1053 runtime->delay = bytes_to_frames(runtime, delay);
1054 }
1049 } else { 1055 } else {
1050 buffersize = frames_to_bytes(runtime, runtime->buffer_size); 1056 buffersize = frames_to_bytes(runtime, runtime->buffer_size);
1051 bytescount = acp_get_byte_count(rtd); 1057 bytescount = acp_get_byte_count(rtd);
diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 6478d10c4f4a..4d46f4567c3a 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -91,6 +91,14 @@ static void rt5514_spi_copy_work(struct work_struct *work)
91 91
92 runtime = rt5514_dsp->substream->runtime; 92 runtime = rt5514_dsp->substream->runtime;
93 period_bytes = snd_pcm_lib_period_bytes(rt5514_dsp->substream); 93 period_bytes = snd_pcm_lib_period_bytes(rt5514_dsp->substream);
94 if (!period_bytes) {
95 schedule_delayed_work(&rt5514_dsp->copy_work, 5);
96 goto done;
97 }
98
99 if (rt5514_dsp->buf_size % period_bytes)
100 rt5514_dsp->buf_size = (rt5514_dsp->buf_size / period_bytes) *
101 period_bytes;
94 102
95 if (rt5514_dsp->get_size >= rt5514_dsp->buf_size) { 103 if (rt5514_dsp->get_size >= rt5514_dsp->buf_size) {
96 rt5514_spi_burst_read(RT5514_BUFFER_VOICE_WP, (u8 *)&buf, 104 rt5514_spi_burst_read(RT5514_BUFFER_VOICE_WP, (u8 *)&buf,
@@ -149,13 +157,11 @@ done:
149 157
150static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp) 158static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp)
151{ 159{
152 size_t period_bytes;
153 u8 buf[8]; 160 u8 buf[8];
154 161
155 if (!rt5514_dsp->substream) 162 if (!rt5514_dsp->substream)
156 return; 163 return;
157 164
158 period_bytes = snd_pcm_lib_period_bytes(rt5514_dsp->substream);
159 rt5514_dsp->get_size = 0; 165 rt5514_dsp->get_size = 0;
160 166
161 /** 167 /**
@@ -183,10 +189,6 @@ static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp)
183 189
184 rt5514_dsp->buf_size = rt5514_dsp->buf_limit - rt5514_dsp->buf_base; 190 rt5514_dsp->buf_size = rt5514_dsp->buf_limit - rt5514_dsp->buf_base;
185 191
186 if (rt5514_dsp->buf_size % period_bytes)
187 rt5514_dsp->buf_size = (rt5514_dsp->buf_size / period_bytes) *
188 period_bytes;
189
190 if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit && 192 if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit &&
191 rt5514_dsp->buf_rp && rt5514_dsp->buf_size) 193 rt5514_dsp->buf_rp && rt5514_dsp->buf_size)
192 schedule_delayed_work(&rt5514_dsp->copy_work, 0); 194 schedule_delayed_work(&rt5514_dsp->copy_work, 0);
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index afe7d5b19313..fad0bed82d79 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -749,7 +749,6 @@ static bool rt5682_readable_register(struct device *dev, unsigned int reg)
749 } 749 }
750} 750}
751 751
752static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -2250, 150, 0);
753static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0); 752static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0);
754static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0); 753static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0);
755static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); 754static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
@@ -1108,10 +1107,6 @@ static void rt5682_jack_detect_handler(struct work_struct *work)
1108} 1107}
1109 1108
1110static const struct snd_kcontrol_new rt5682_snd_controls[] = { 1109static const struct snd_kcontrol_new rt5682_snd_controls[] = {
1111 /* Headphone Output Volume */
1112 SOC_DOUBLE_R_TLV("Headphone Playback Volume", RT5682_HPL_GAIN,
1113 RT5682_HPR_GAIN, RT5682_G_HP_SFT, 15, 1, hp_vol_tlv),
1114
1115 /* DAC Digital Volume */ 1110 /* DAC Digital Volume */
1116 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5682_DAC1_DIG_VOL, 1111 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5682_DAC1_DIG_VOL,
1117 RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 86, 0, dac_vol_tlv), 1112 RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 86, 0, dac_vol_tlv),
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index d5035f2f2b2b..ce508b4cc85c 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -879,6 +879,9 @@ static int sta32x_probe(struct snd_soc_component *component)
879 struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component); 879 struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
880 struct sta32x_platform_data *pdata = sta32x->pdata; 880 struct sta32x_platform_data *pdata = sta32x->pdata;
881 int i, ret = 0, thermal = 0; 881 int i, ret = 0, thermal = 0;
882
883 sta32x->component = component;
884
882 ret = regulator_bulk_enable(ARRAY_SIZE(sta32x->supplies), 885 ret = regulator_bulk_enable(ARRAY_SIZE(sta32x->supplies),
883 sta32x->supplies); 886 sta32x->supplies);
884 if (ret != 0) { 887 if (ret != 0) {