From patchwork Wed Jul 4 09:49:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 141051 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp600520ljj; Wed, 4 Jul 2018 02:52:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfsAEG4yS3VxORrYdpDFjppxhtKZ+oc63RevNz9w8wwcnQT2QcneOr736HdYRX0ySAXrL4A X-Received: by 2002:a63:8c51:: with SMTP id q17-v6mr1313741pgn.236.1530697923250; Wed, 04 Jul 2018 02:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530697923; cv=none; d=google.com; s=arc-20160816; b=Jx7mnH3JTZJqK8UZESeBsQ2KC0R/Lo4W1myAVn27utp2hL+r62hnuNoT3XGvF+opQA 8m5wK/fVqUnMoJ+T1GyY/1XK5jnTzK4p294sfvN7nOI7srkmoYj7LJ1aR0J3R/Tdi1Xf X22QdMk/Sa2Ox7V9HeAxd4meYZRz29uJvbLoTa2J5+O66WhVkaYVu5qWjFxiT7NfrHo+ 1AmYn1I8BUg+SPYQXe/Ho4JdlgmphgU5kmetBKsdv0s/MCoM1MoamYWSs0uxNkV22daz 0OObhC8Isv0O4IHAtlkNZCXdF/lhoMT3eNYYizBJgdwEMw6ok4hBaTeGedBRtqd5zf+y v8PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=J9NlNC+HBVbx9h/W6EWGYjYfY0/f9mmfn41Tkqa7hTE=; b=tbEXk+XFLTRqA7JTneuhOlb8VcQPLTG2+21i4NBPfrVeMI9aoV6ByDgOTbBtW09kPI EAeJ+KYm9R0itFy1JGqlj76/+7qrlaGvxVsUukQhYWz0p3G2Raztx4ExIG7cQ14cJ9YB ioFdmO1uS4S//h7TjsEmuyqlLxa0fd4/og3MuMUgZ39u2NFO6/Oena4gprzA3ksoeUzs 0+BMzq6t8T3CGlffW+fHU/zjwpR4cukD372cfVVY8Gw/vypFIkDgN+cSkm0ffDHQQglz cw+yutsm93YpViDdFgoZ6+nP/sfvYH0IOlpZkV7lMv+cikxYnu4k8JkJtjvev58M+ltW IeVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gE3WzwpV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si2922624pgo.330.2018.07.04.02.52.02; Wed, 04 Jul 2018 02:52:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gE3WzwpV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387AbeGDJwA (ORCPT + 31 others); Wed, 4 Jul 2018 05:52:00 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36672 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932733AbeGDJv4 (ORCPT ); Wed, 4 Jul 2018 05:51:56 -0400 Received: by mail-wr0-f194.google.com with SMTP id f16-v6so4679409wrm.3 for ; Wed, 04 Jul 2018 02:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J9NlNC+HBVbx9h/W6EWGYjYfY0/f9mmfn41Tkqa7hTE=; b=gE3WzwpVqU8ousmUcUUdG4i+ZlzO9CPG1V7XS53U2AjsUmUmN96l+QMpI6d+TynSt2 9UcxmbBH/CXuNPAVeCU0NI0MuIIMSdkWdei81q4cyHb5HgF5dqrCD7RrwnZjN0sbxsq0 B66xLBmif6AjUwznUKuIl18AlcJfGC0B9H3Mg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J9NlNC+HBVbx9h/W6EWGYjYfY0/f9mmfn41Tkqa7hTE=; b=JTEXQy2Cs602pa7cRRLYodWngxx/cUGm8tdkMko887iwWr3WxatkqsZXYybEKdNyjV ZFUK0TIbsvi3JFY9wL++J0vrd7q0xXnM6Ht3unNgrit5TFlY1ee39fwKttiqSnko48mg oSLlrpX8Rua1BirN2yTMzgTkDRq0DmPPexGC9RZuvLi81bLEgaKdXjVunvmM/YC9re23 KFt5xuCgKTdeTrBk1IRaP2kHf4Wd5tDzAYmfsvI9Wh4iCn6die6IC+5gU0DN93qQBvQ2 WmXkXdiGpzlZynX6awqqIwdhUqIWu/dMWFtAynrgMcbGWUIDRsZVwx0OljOC8KgdH5pI ytPQ== X-Gm-Message-State: APt69E2nCmljcxC7lQtmExJRvo/kcnjW53t8Y8NIey03MpbqJTao7fuB qq0TOz6LxQCA8CG9Su9GoPiwEw== X-Received: by 2002:adf:b3d4:: with SMTP id x20-v6mr1090402wrd.272.1530697915216; Wed, 04 Jul 2018 02:51:55 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id 125-v6sm6370089wmw.9.2018.07.04.02.51.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jul 2018 02:51:54 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org Cc: linux-arm-msm@vger.kernel.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, tiwai@suse.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla Subject: [PATCH 2/6] ASoC: qdsp6: q6afe-dai: add support to slim tx dais Date: Wed, 4 Jul 2018 10:49:40 +0100 Message-Id: <20180704094944.16440-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180704094944.16440-1-srinivas.kandagatla@linaro.org> References: <20180704094944.16440-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support to SLIMbus TX dais in AFE module. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6afe-dai.c | 175 +++++++++++++++++++++++++++++++++++---- 1 file changed, 161 insertions(+), 14 deletions(-) -- 2.16.2 diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index 1d2e5013c121..8dd3683eb367 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -382,23 +382,31 @@ static int q6slim_set_channel_map(struct snd_soc_dai *dai, struct q6afe_port_config *pcfg = &dai_data->port_config[dai->id]; int i; - if (!rx_slot) { - pr_err("%s: rx slot not found\n", __func__); - return -EINVAL; - } + if (dai->id & 0x1) { + /* TX */ + if (!tx_slot) { + pr_err("%s: tx slot not found\n", __func__); + return -EINVAL; + } - for (i = 0; i < rx_num; i++) { - pcfg->slim.ch_mapping[i] = rx_slot[i]; - pr_debug("%s: find number of channels[%d] ch[%d]\n", - __func__, i, rx_slot[i]); - } + for (i = 0; i < tx_num; i++) + pcfg->slim.ch_mapping[i] = tx_slot[i]; + + pcfg->slim.num_channels = tx_num; + + + } else { + if (!rx_slot) { + pr_err("%s: rx slot not found\n", __func__); + return -EINVAL; + } - pcfg->slim.num_channels = rx_num; + for (i = 0; i < rx_num; i++) + pcfg->slim.ch_mapping[i] = rx_slot[i]; - pr_debug("%s: SLIMBUS_%d_RX cnt[%d] ch[%d %d]\n", __func__, - (dai->id - SLIMBUS_0_RX) / 2, rx_num, - pcfg->slim.ch_mapping[0], - pcfg->slim.ch_mapping[1]); + pcfg->slim.num_channels = rx_num; + + } return 0; } @@ -443,6 +451,14 @@ static const struct snd_soc_dapm_route q6afe_dapm_routes[] = { {"Slimbus5 Playback", NULL, "SLIMBUS_5_RX"}, {"Slimbus6 Playback", NULL, "SLIMBUS_6_RX"}, + {"SLIMBUS_0_TX", NULL, "Slimbus Capture"}, + {"SLIMBUS_1_TX", NULL, "Slimbus1 Capture"}, + {"SLIMBUS_2_TX", NULL, "Slimbus2 Capture"}, + {"SLIMBUS_3_TX", NULL, "Slimbus3 Capture"}, + {"SLIMBUS_4_TX", NULL, "Slimbus4 Capture"}, + {"SLIMBUS_5_TX", NULL, "Slimbus5 Capture"}, + {"SLIMBUS_6_TX", NULL, "Slimbus6 Capture"}, + {"Primary MI2S Playback", NULL, "PRI_MI2S_RX"}, {"Secondary MI2S Playback", NULL, "SEC_MI2S_RX"}, {"Tertiary MI2S Playback", NULL, "TERT_MI2S_RX"}, @@ -636,6 +652,24 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .rate_min = 8000, .rate_max = 192000, }, + }, { + .name = "SLIMBUS_0_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_0_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Slimbus1 Playback", @@ -654,6 +688,24 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .id = SLIMBUS_1_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, + }, { + .name = "SLIMBUS_1_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_1_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus1 Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Slimbus2 Playback", @@ -672,6 +724,25 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .id = SLIMBUS_2_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, + + }, { + .name = "SLIMBUS_2_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_2_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus2 Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Slimbus3 Playback", @@ -690,6 +761,25 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .id = SLIMBUS_3_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, + + }, { + .name = "SLIMBUS_3_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_3_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus3 Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Slimbus4 Playback", @@ -708,6 +798,25 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .id = SLIMBUS_4_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, + + }, { + .name = "SLIMBUS_4_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_4_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus4 Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Slimbus5 Playback", @@ -726,6 +835,25 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .id = SLIMBUS_5_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, + + }, { + .name = "SLIMBUS_5_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_5_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus5 Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Slimbus6 Playback", @@ -744,6 +872,25 @@ static struct snd_soc_dai_driver q6afe_dais[] = { .id = SLIMBUS_6_RX, .probe = msm_dai_q6_dai_probe, .remove = msm_dai_q6_dai_remove, + + }, { + .name = "SLIMBUS_6_TX", + .ops = &q6slim_ops, + .id = SLIMBUS_6_TX, + .probe = msm_dai_q6_dai_probe, + .remove = msm_dai_q6_dai_remove, + .capture = { + .stream_name = "Slimbus6 Capture", + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, }, { .playback = { .stream_name = "Primary MI2S Playback",