From: Mark Brown Date: Mon, 11 Jan 2016 13:54:32 +0000 (+0000) Subject: Merge remote-tracking branches 'asoc/topic/adsp' and 'asoc/topic/amd' into asoc-next X-Git-Tag: v4.5-rc1~20^2~24^2~6 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=188bdf726877fb27530934baea90876dfc2012ba;p=cascardo%2Flinux.git Merge remote-tracking branches 'asoc/topic/adsp' and 'asoc/topic/amd' into asoc-next --- 188bdf726877fb27530934baea90876dfc2012ba diff --cc sound/soc/codecs/wm5110.c index f276d2dd1683,61fa7cc91d15,c04c0bc6f58a..6088d30962a9 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@@@ -2131,48 -2135,60 -1996,8 +2131,60 @@@@ static struct snd_soc_dai_driver wm5110 }, .ops = &arizona_simple_dai_ops, }, + { + .name = "wm5110-cpu-voicectrl", + .capture = { + .stream_name = "Voice Control CPU", + .channels_min = 1, + .channels_max = 1, + .rates = WM5110_RATES, + .formats = WM5110_FORMATS, + }, + .compress_new = snd_soc_new_compress, + }, + { + .name = "wm5110-dsp-voicectrl", + .capture = { + .stream_name = "Voice Control DSP", + .channels_min = 1, + .channels_max = 1, + .rates = WM5110_RATES, + .formats = WM5110_FORMATS, + }, + }, }; +static int wm5110_open(struct snd_compr_stream *stream) +{ + struct snd_soc_pcm_runtime *rtd = stream->private_data; + struct wm5110_priv *priv = snd_soc_codec_get_drvdata(rtd->codec); + struct arizona *arizona = priv->core.arizona; + int n_adsp; + + if (strcmp(rtd->codec_dai->name, "wm5110-dsp-voicectrl") == 0) { + n_adsp = 2; + } else { + dev_err(arizona->dev, + "No suitable compressed stream for DAI '%s'\n", + rtd->codec_dai->name); + return -EINVAL; + } + + return wm_adsp_compr_open(&priv->core.adsp[n_adsp], stream); +} + + +static irqreturn_t wm5110_adsp2_irq(int irq, void *data) + +{ + + struct wm5110_priv *florida = data; + + int ret; + + + + ret = wm_adsp_compr_handle_irq(&florida->core.adsp[2]); + + if (ret == -ENODEV) + + return IRQ_NONE; + + + + return IRQ_HANDLED; + +} + + static int wm5110_codec_probe(struct snd_soc_codec *codec) { struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); @@@@ -2263,18 -2293,20 -2088,6 +2289,20 @@@@ static struct snd_soc_codec_driver soc_ .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes), }; +static struct snd_compr_ops wm5110_compr_ops = { + .open = wm5110_open, + .free = wm_adsp_compr_free, + .set_params = wm_adsp_compr_set_params, + .get_caps = wm_adsp_compr_get_caps, + .trigger = wm_adsp_compr_trigger, + + .pointer = wm_adsp_compr_pointer, + + .copy = wm_adsp_compr_copy, +}; + +static struct snd_soc_platform_driver wm5110_compr_platform = { + .compr_ops = &wm5110_compr_ops, +}; + static int wm5110_probe(struct platform_device *pdev) { struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);