Commit 1165d956 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/adau1701', 'asoc/fix/adsp',...

Merge remote-tracking branches 'asoc/fix/adau1701', 'asoc/fix/adsp', 'asoc/fix/arizona', 'asoc/fix/blackfin', 'asoc/fix/cs42l56', 'asoc/fix/davinci' and 'asoc/fix/debugfs' into asoc-linus
...@@ -290,19 +290,19 @@ static int bf5xx_pcm_silence(struct snd_pcm_substream *substream, ...@@ -290,19 +290,19 @@ static int bf5xx_pcm_silence(struct snd_pcm_substream *substream,
unsigned int sample_size = runtime->sample_bits / 8; unsigned int sample_size = runtime->sample_bits / 8;
void *buf = runtime->dma_area; void *buf = runtime->dma_area;
struct bf5xx_i2s_pcm_data *dma_data; struct bf5xx_i2s_pcm_data *dma_data;
unsigned int offset, size; unsigned int offset, samples;
dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
if (dma_data->tdm_mode) { if (dma_data->tdm_mode) {
offset = pos * 8 * sample_size; offset = pos * 8 * sample_size;
size = count * 8 * sample_size; samples = count * 8;
} else { } else {
offset = frames_to_bytes(runtime, pos); offset = frames_to_bytes(runtime, pos);
size = frames_to_bytes(runtime, count); samples = count * runtime->channels;
} }
snd_pcm_format_set_silence(runtime->format, buf + offset, size); snd_pcm_format_set_silence(runtime->format, buf + offset, samples);
return 0; return 0;
} }
......
...@@ -230,8 +230,10 @@ static int adau1701_reg_read(void *context, unsigned int reg, ...@@ -230,8 +230,10 @@ static int adau1701_reg_read(void *context, unsigned int reg,
*value = 0; *value = 0;
for (i = 0; i < size; i++) for (i = 0; i < size; i++) {
*value |= recv_buf[i] << (i * 8); *value <<= 8;
*value |= recv_buf[i];
}
return 0; return 0;
} }
......
...@@ -243,6 +243,31 @@ int arizona_init_spk(struct snd_soc_codec *codec) ...@@ -243,6 +243,31 @@ int arizona_init_spk(struct snd_soc_codec *codec)
} }
EXPORT_SYMBOL_GPL(arizona_init_spk); EXPORT_SYMBOL_GPL(arizona_init_spk);
static const struct snd_soc_dapm_route arizona_mono_routes[] = {
{ "OUT1R", NULL, "OUT1L" },
{ "OUT2R", NULL, "OUT2L" },
{ "OUT3R", NULL, "OUT3L" },
{ "OUT4R", NULL, "OUT4L" },
{ "OUT5R", NULL, "OUT5L" },
{ "OUT6R", NULL, "OUT6L" },
};
int arizona_init_mono(struct snd_soc_codec *codec)
{
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona = priv->arizona;
int i;
for (i = 0; i < ARIZONA_MAX_OUTPUT; ++i) {
if (arizona->pdata.out_mono[i])
snd_soc_dapm_add_routes(&codec->dapm,
&arizona_mono_routes[i], 1);
}
return 0;
}
EXPORT_SYMBOL_GPL(arizona_init_mono);
int arizona_init_gpio(struct snd_soc_codec *codec) int arizona_init_gpio(struct snd_soc_codec *codec)
{ {
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
......
...@@ -249,6 +249,7 @@ extern int arizona_set_fll(struct arizona_fll *fll, int source, ...@@ -249,6 +249,7 @@ extern int arizona_set_fll(struct arizona_fll *fll, int source,
extern int arizona_init_spk(struct snd_soc_codec *codec); extern int arizona_init_spk(struct snd_soc_codec *codec);
extern int arizona_init_gpio(struct snd_soc_codec *codec); extern int arizona_init_gpio(struct snd_soc_codec *codec);
extern int arizona_init_mono(struct snd_soc_codec *codec);
extern int arizona_init_dai(struct arizona_priv *priv, int dai); extern int arizona_init_dai(struct arizona_priv *priv, int dai);
......
...@@ -445,9 +445,9 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = { ...@@ -445,9 +445,9 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = {
SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1), SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1),
SOC_DOUBLE_R_SX_TLV("Headphone Volume", CS42L56_HPA_VOLUME, SOC_DOUBLE_R_SX_TLV("Headphone Volume", CS42L56_HPA_VOLUME,
CS42L56_HPA_VOLUME, 0, 0x44, 0x55, hl_tlv), CS42L56_HPB_VOLUME, 0, 0x44, 0x55, hl_tlv),
SOC_DOUBLE_R_SX_TLV("LineOut Volume", CS42L56_LOA_VOLUME, SOC_DOUBLE_R_SX_TLV("LineOut Volume", CS42L56_LOA_VOLUME,
CS42L56_LOA_VOLUME, 0, 0x44, 0x55, hl_tlv), CS42L56_LOB_VOLUME, 0, 0x44, 0x55, hl_tlv),
SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL, SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL,
0, 0x00, 1, tone_tlv), 0, 0x00, 1, tone_tlv),
......
...@@ -1596,6 +1596,7 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec) ...@@ -1596,6 +1596,7 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)
arizona_init_spk(codec); arizona_init_spk(codec);
arizona_init_gpio(codec); arizona_init_gpio(codec);
arizona_init_mono(codec);
ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 8); ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 8);
if (ret != 0) if (ret != 0)
......
...@@ -1758,3 +1758,5 @@ int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs) ...@@ -1758,3 +1758,5 @@ int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(wm_adsp2_init); EXPORT_SYMBOL_GPL(wm_adsp2_init);
MODULE_LICENSE("GPL v2");
...@@ -6,6 +6,7 @@ config SND_DAVINCI_SOC_I2S ...@@ -6,6 +6,7 @@ config SND_DAVINCI_SOC_I2S
tristate tristate
config SND_DAVINCI_SOC_MCASP config SND_DAVINCI_SOC_MCASP
depends on SND_DAVINCI_SOC || SND_OMAP_SOC
tristate tristate
config SND_DAVINCI_SOC_VCIF config SND_DAVINCI_SOC_VCIF
......
...@@ -720,6 +720,10 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, ...@@ -720,6 +720,10 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
case SNDRV_PCM_FORMAT_U24_LE: case SNDRV_PCM_FORMAT_U24_LE:
case SNDRV_PCM_FORMAT_S24_LE: case SNDRV_PCM_FORMAT_S24_LE:
dma_params->data_type = 4;
word_length = 24;
break;
case SNDRV_PCM_FORMAT_U32_LE: case SNDRV_PCM_FORMAT_U32_LE:
case SNDRV_PCM_FORMAT_S32_LE: case SNDRV_PCM_FORMAT_S32_LE:
dma_params->data_type = 4; dma_params->data_type = 4;
...@@ -1223,14 +1227,22 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1223,14 +1227,22 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
goto err; goto err;
switch (mcasp->version) { switch (mcasp->version) {
#if IS_BUILTIN(CONFIG_SND_DAVINCI_SOC) || \
(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
IS_MODULE(CONFIG_SND_DAVINCI_SOC))
case MCASP_VERSION_1: case MCASP_VERSION_1:
case MCASP_VERSION_2: case MCASP_VERSION_2:
case MCASP_VERSION_3: case MCASP_VERSION_3:
ret = davinci_soc_platform_register(&pdev->dev); ret = davinci_soc_platform_register(&pdev->dev);
break; break;
#endif
#if IS_BUILTIN(CONFIG_SND_OMAP_SOC) || \
(IS_MODULE(CONFIG_SND_DAVINCI_SOC_MCASP) && \
IS_MODULE(CONFIG_SND_OMAP_SOC))
case MCASP_VERSION_4: case MCASP_VERSION_4:
ret = omap_pcm_platform_register(&pdev->dev); ret = omap_pcm_platform_register(&pdev->dev);
break; break;
#endif
default: default:
dev_err(&pdev->dev, "Invalid McASP version: %d\n", dev_err(&pdev->dev, "Invalid McASP version: %d\n",
mcasp->version); mcasp->version);
......
...@@ -270,12 +270,32 @@ static const struct file_operations codec_reg_fops = { ...@@ -270,12 +270,32 @@ static const struct file_operations codec_reg_fops = {
.llseek = default_llseek, .llseek = default_llseek,
}; };
static struct dentry *soc_debugfs_create_dir(struct dentry *parent,
const char *fmt, ...)
{
struct dentry *de;
va_list ap;
char *s;
va_start(ap, fmt);
s = kvasprintf(GFP_KERNEL, fmt, ap);
va_end(ap);
if (!s)
return NULL;
de = debugfs_create_dir(s, parent);
kfree(s);
return de;
}
static void soc_init_codec_debugfs(struct snd_soc_codec *codec) static void soc_init_codec_debugfs(struct snd_soc_codec *codec)
{ {
struct dentry *debugfs_card_root = codec->card->debugfs_card_root; struct dentry *debugfs_card_root = codec->card->debugfs_card_root;
codec->debugfs_codec_root = debugfs_create_dir(codec->name, codec->debugfs_codec_root = soc_debugfs_create_dir(debugfs_card_root,
debugfs_card_root); "codec:%s", codec->name);
if (!codec->debugfs_codec_root) { if (!codec->debugfs_codec_root) {
dev_warn(codec->dev, dev_warn(codec->dev,
"ASoC: Failed to create codec debugfs directory\n"); "ASoC: Failed to create codec debugfs directory\n");
...@@ -306,8 +326,8 @@ static void soc_init_platform_debugfs(struct snd_soc_platform *platform) ...@@ -306,8 +326,8 @@ static void soc_init_platform_debugfs(struct snd_soc_platform *platform)
{ {
struct dentry *debugfs_card_root = platform->card->debugfs_card_root; struct dentry *debugfs_card_root = platform->card->debugfs_card_root;
platform->debugfs_platform_root = debugfs_create_dir(platform->name, platform->debugfs_platform_root = soc_debugfs_create_dir(debugfs_card_root,
debugfs_card_root); "platform:%s", platform->name);
if (!platform->debugfs_platform_root) { if (!platform->debugfs_platform_root) {
dev_warn(platform->dev, dev_warn(platform->dev,
"ASoC: Failed to create platform debugfs directory\n"); "ASoC: Failed to create platform debugfs directory\n");
......
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