Skip to content

Commit 576b354

Browse files
committed
Merge branch 'asoc-4.19' into asoc-linus
2 parents 35a7f35 + 747df19 commit 576b354

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

sound/soc/amd/acp-pcm-dma.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,16 +1036,22 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream)
10361036

10371037
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
10381038
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;
10441039
bytescount = acp_get_byte_count(rtd);
1045-
if (bytescount > rtd->bytescount)
1040+
if (bytescount >= rtd->bytescount)
10461041
bytescount -= rtd->bytescount;
1047-
delay = do_div(bytescount, period_bytes);
1048-
runtime->delay = bytes_to_frames(runtime, delay);
1042+
if (bytescount < period_bytes) {
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+
}
10491055
} else {
10501056
buffersize = frames_to_bytes(runtime, runtime->buffer_size);
10511057
bytescount = acp_get_byte_count(rtd);

sound/soc/codecs/rt5514-spi.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ static void rt5514_spi_copy_work(struct work_struct *work)
9191

9292
runtime = rt5514_dsp->substream->runtime;
9393
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;
94102

95103
if (rt5514_dsp->get_size >= rt5514_dsp->buf_size) {
96104
rt5514_spi_burst_read(RT5514_BUFFER_VOICE_WP, (u8 *)&buf,
@@ -149,13 +157,11 @@ static void rt5514_spi_copy_work(struct work_struct *work)
149157

150158
static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp)
151159
{
152-
size_t period_bytes;
153160
u8 buf[8];
154161

155162
if (!rt5514_dsp->substream)
156163
return;
157164

158-
period_bytes = snd_pcm_lib_period_bytes(rt5514_dsp->substream);
159165
rt5514_dsp->get_size = 0;
160166

161167
/**
@@ -183,10 +189,6 @@ static void rt5514_schedule_copy(struct rt5514_dsp *rt5514_dsp)
183189

184190
rt5514_dsp->buf_size = rt5514_dsp->buf_limit - rt5514_dsp->buf_base;
185191

186-
if (rt5514_dsp->buf_size % period_bytes)
187-
rt5514_dsp->buf_size = (rt5514_dsp->buf_size / period_bytes) *
188-
period_bytes;
189-
190192
if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit &&
191193
rt5514_dsp->buf_rp && rt5514_dsp->buf_size)
192194
schedule_delayed_work(&rt5514_dsp->copy_work, 0);

sound/soc/codecs/rt5682.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,6 @@ static bool rt5682_readable_register(struct device *dev, unsigned int reg)
749749
}
750750
}
751751

752-
static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -2250, 150, 0);
753752
static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0);
754753
static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0);
755754
static 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)
11081107
}
11091108

11101109
static 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-
11151110
/* DAC Digital Volume */
11161111
SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5682_DAC1_DIG_VOL,
11171112
RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 86, 0, dac_vol_tlv),

sound/soc/codecs/sta32x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,9 @@ static int sta32x_probe(struct snd_soc_component *component)
879879
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
880880
struct sta32x_platform_data *pdata = sta32x->pdata;
881881
int i, ret = 0, thermal = 0;
882+
883+
sta32x->component = component;
884+
882885
ret = regulator_bulk_enable(ARRAY_SIZE(sta32x->supplies),
883886
sta32x->supplies);
884887
if (ret != 0) {

0 commit comments

Comments
 (0)