Skip to content

Commit e83ce4a

Browse files
committed
Merge tag 'asoc-fix-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.19 A few fixes for v3.19, a few driver specifics and one core fix which fixes a boot crash on OMAP if deferred probing kicks in due to attempting to modify static data.
2 parents d679582 + f2ec1d3 commit e83ce4a

File tree

9 files changed

+52
-40
lines changed

9 files changed

+52
-40
lines changed

sound/soc/codecs/rt5677.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ static unsigned int bst_tlv[] = {
784784
static int rt5677_dsp_vad_get(struct snd_kcontrol *kcontrol,
785785
struct snd_ctl_elem_value *ucontrol)
786786
{
787-
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
788-
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
787+
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
788+
struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
789789

790790
ucontrol->value.integer.value[0] = rt5677->dsp_vad_en;
791791

@@ -795,8 +795,9 @@ static int rt5677_dsp_vad_get(struct snd_kcontrol *kcontrol,
795795
static int rt5677_dsp_vad_put(struct snd_kcontrol *kcontrol,
796796
struct snd_ctl_elem_value *ucontrol)
797797
{
798-
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
799-
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
798+
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
799+
struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
800+
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
800801

801802
rt5677->dsp_vad_en = !!ucontrol->value.integer.value[0];
802803

sound/soc/dwc/designware_i2s.c

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,9 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
209209

210210
switch (config->chan_nr) {
211211
case EIGHT_CHANNEL_SUPPORT:
212-
ch_reg = 3;
213-
break;
214212
case SIX_CHANNEL_SUPPORT:
215-
ch_reg = 2;
216-
break;
217213
case FOUR_CHANNEL_SUPPORT:
218-
ch_reg = 1;
219-
break;
220214
case TWO_CHANNEL_SUPPORT:
221-
ch_reg = 0;
222215
break;
223216
default:
224217
dev_err(dev->dev, "channel not supported\n");
@@ -227,18 +220,22 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
227220

228221
i2s_disable_channels(dev, substream->stream);
229222

230-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
231-
i2s_write_reg(dev->i2s_base, TCR(ch_reg), xfer_resolution);
232-
i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
233-
irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
234-
i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
235-
i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
236-
} else {
237-
i2s_write_reg(dev->i2s_base, RCR(ch_reg), xfer_resolution);
238-
i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);
239-
irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
240-
i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03);
241-
i2s_write_reg(dev->i2s_base, RER(ch_reg), 1);
223+
for (ch_reg = 0; ch_reg < (config->chan_nr / 2); ch_reg++) {
224+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
225+
i2s_write_reg(dev->i2s_base, TCR(ch_reg),
226+
xfer_resolution);
227+
i2s_write_reg(dev->i2s_base, TFCR(ch_reg), 0x02);
228+
irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
229+
i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x30);
230+
i2s_write_reg(dev->i2s_base, TER(ch_reg), 1);
231+
} else {
232+
i2s_write_reg(dev->i2s_base, RCR(ch_reg),
233+
xfer_resolution);
234+
i2s_write_reg(dev->i2s_base, RFCR(ch_reg), 0x07);
235+
irq = i2s_read_reg(dev->i2s_base, IMR(ch_reg));
236+
i2s_write_reg(dev->i2s_base, IMR(ch_reg), irq & ~0x03);
237+
i2s_write_reg(dev->i2s_base, RER(ch_reg), 1);
238+
}
242239
}
243240

244241
i2s_write_reg(dev->i2s_base, CCR, ccr);
@@ -263,6 +260,19 @@ static void dw_i2s_shutdown(struct snd_pcm_substream *substream,
263260
snd_soc_dai_set_dma_data(dai, substream, NULL);
264261
}
265262

263+
static int dw_i2s_prepare(struct snd_pcm_substream *substream,
264+
struct snd_soc_dai *dai)
265+
{
266+
struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai);
267+
268+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
269+
i2s_write_reg(dev->i2s_base, TXFFR, 1);
270+
else
271+
i2s_write_reg(dev->i2s_base, RXFFR, 1);
272+
273+
return 0;
274+
}
275+
266276
static int dw_i2s_trigger(struct snd_pcm_substream *substream,
267277
int cmd, struct snd_soc_dai *dai)
268278
{
@@ -294,6 +304,7 @@ static struct snd_soc_dai_ops dw_i2s_dai_ops = {
294304
.startup = dw_i2s_startup,
295305
.shutdown = dw_i2s_shutdown,
296306
.hw_params = dw_i2s_hw_params,
307+
.prepare = dw_i2s_prepare,
297308
.trigger = dw_i2s_trigger,
298309
};
299310

sound/soc/intel/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ config SND_SOC_INTEL_BROADWELL_MACH
8989

9090
config SND_SOC_INTEL_BYTCR_RT5640_MACH
9191
tristate "ASoC Audio DSP Support for MID BYT Platform"
92-
depends on X86
92+
depends on X86 && I2C
9393
select SND_SOC_RT5640
9494
select SND_SST_MFLD_PLATFORM
9595
select SND_SST_IPC_ACPI
@@ -101,7 +101,7 @@ config SND_SOC_INTEL_BYTCR_RT5640_MACH
101101

102102
config SND_SOC_INTEL_CHT_BSW_RT5672_MACH
103103
tristate "ASoC Audio driver for Intel Cherrytrail & Braswell with RT5672 codec"
104-
depends on X86_INTEL_LPSS
104+
depends on X86_INTEL_LPSS && I2C
105105
select SND_SOC_RT5670
106106
select SND_SST_MFLD_PLATFORM
107107
select SND_SST_IPC_ACPI

sound/soc/intel/bytcr_dpcm_rt5640.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,4 @@ module_platform_driver(snd_byt_mc_driver);
227227
MODULE_DESCRIPTION("ASoC Intel(R) Baytrail CR Machine driver");
228228
MODULE_AUTHOR("Subhransu S. Prusty <subhransu.s.prusty@intel.com>");
229229
MODULE_LICENSE("GPL v2");
230-
MODULE_ALIAS("platform:bytrt5640-audio");
230+
MODULE_ALIAS("platform:bytt100_rt5640");

sound/soc/intel/sst-firmware.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,12 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
763763
/* does block span more than 1 section */
764764
if (ba->offset >= block->offset && ba->offset < block_end) {
765765

766+
/* add block */
767+
list_move(&block->list, &dsp->used_block_list);
768+
list_add(&block->module_list, block_list);
766769
/* align ba to block boundary */
767-
ba->offset = block->offset;
770+
ba->size -= block_end - ba->offset;
771+
ba->offset = block_end;
768772

769773
err = block_alloc_contiguous(dsp, ba, block_list);
770774
if (err < 0)

sound/soc/intel/sst/sst_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ int sst_acpi_remove(struct platform_device *pdev)
343343
}
344344

345345
static struct sst_machines sst_acpi_bytcr[] = {
346-
{"10EC5640", "T100", "bytt100_rt5640", NULL, "fw_sst_0f28.bin",
346+
{"10EC5640", "T100", "bytt100_rt5640", NULL, "intel/fw_sst_0f28.bin",
347347
&byt_rvp_platform_data },
348348
{},
349349
};

sound/soc/rockchip/rockchip_i2s.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
454454

455455
i2s->playback_dma_data.addr = res->start + I2S_TXDR;
456456
i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
457-
i2s->playback_dma_data.maxburst = 16;
457+
i2s->playback_dma_data.maxburst = 4;
458458

459459
i2s->capture_dma_data.addr = res->start + I2S_RXDR;
460460
i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
461-
i2s->capture_dma_data.maxburst = 16;
461+
i2s->capture_dma_data.maxburst = 4;
462462

463463
i2s->dev = &pdev->dev;
464464
dev_set_drvdata(&pdev->dev, i2s);

sound/soc/rockchip/rockchip_i2s.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
#define I2S_DMACR_TDE_DISABLE (0 << I2S_DMACR_TDE_SHIFT)
128128
#define I2S_DMACR_TDE_ENABLE (1 << I2S_DMACR_TDE_SHIFT)
129129
#define I2S_DMACR_TDL_SHIFT 0
130-
#define I2S_DMACR_TDL(x) ((x - 1) << I2S_DMACR_TDL_SHIFT)
130+
#define I2S_DMACR_TDL(x) ((x) << I2S_DMACR_TDL_SHIFT)
131131
#define I2S_DMACR_TDL_MASK (0x1f << I2S_DMACR_TDL_SHIFT)
132132

133133
/*

sound/soc/soc-core.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,7 +3230,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
32303230
const char *propname)
32313231
{
32323232
struct device_node *np = card->dev->of_node;
3233-
int num_routes, old_routes;
3233+
int num_routes;
32343234
struct snd_soc_dapm_route *routes;
32353235
int i, ret;
32363236

@@ -3248,29 +3248,25 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
32483248
return -EINVAL;
32493249
}
32503250

3251-
old_routes = card->num_dapm_routes;
3252-
routes = devm_kzalloc(card->dev,
3253-
(old_routes + num_routes) * sizeof(*routes),
3251+
routes = devm_kzalloc(card->dev, num_routes * sizeof(*routes),
32543252
GFP_KERNEL);
32553253
if (!routes) {
32563254
dev_err(card->dev,
32573255
"ASoC: Could not allocate DAPM route table\n");
32583256
return -EINVAL;
32593257
}
32603258

3261-
memcpy(routes, card->dapm_routes, old_routes * sizeof(*routes));
3262-
32633259
for (i = 0; i < num_routes; i++) {
32643260
ret = of_property_read_string_index(np, propname,
3265-
2 * i, &routes[old_routes + i].sink);
3261+
2 * i, &routes[i].sink);
32663262
if (ret) {
32673263
dev_err(card->dev,
32683264
"ASoC: Property '%s' index %d could not be read: %d\n",
32693265
propname, 2 * i, ret);
32703266
return -EINVAL;
32713267
}
32723268
ret = of_property_read_string_index(np, propname,
3273-
(2 * i) + 1, &routes[old_routes + i].source);
3269+
(2 * i) + 1, &routes[i].source);
32743270
if (ret) {
32753271
dev_err(card->dev,
32763272
"ASoC: Property '%s' index %d could not be read: %d\n",
@@ -3279,7 +3275,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
32793275
}
32803276
}
32813277

3282-
card->num_dapm_routes += num_routes;
3278+
card->num_dapm_routes = num_routes;
32833279
card->dapm_routes = routes;
32843280

32853281
return 0;

0 commit comments

Comments
 (0)