From patchwork Mon Jun 9 07:36:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4317911 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2EB2EBEEAA for ; Mon, 9 Jun 2014 07:37:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 626C820107 for ; Mon, 9 Jun 2014 07:37:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 213F1200F0 for ; Mon, 9 Jun 2014 07:37:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1AEF9265551; Mon, 9 Jun 2014 09:37:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 60A5F2655D1; Mon, 9 Jun 2014 09:37:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0B21E2655D2; Mon, 9 Jun 2014 09:37:01 +0200 (CEST) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by alsa0.perex.cz (Postfix) with ESMTP id 8E1C02655D9 for ; Mon, 9 Jun 2014 09:36:04 +0200 (CEST) Received: by mail-pb0-f48.google.com with SMTP id rr13so4628251pbb.7 for ; Mon, 09 Jun 2014 00:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:mime-version :content-type; bh=PfVTELSfPc8pxC6h2UAAmSD1YkZAhlwB54r6TIDRcoY=; b=KqoI8I+6rAEf3bVspPYehgC0jsykio+4f5OiOkWBFvGfFirlT+gXkEvNqYs6KElKEL 2Ezl1Dr/zHoqnUJPX39tzbRBahHkXBk8MV7q1VGEfsa3RPiR3gWN9fXDSZpRGh128Bxm 8dZQCv7fvgNezJUVVqDZalkN94sZUdjggZJ1YpJqwmWOzSmJ/HtzKsUt2h3wZIgd/Kn5 yQBLMrVUOh8sytLo6Hp1BRHKigwZBUj6/ov60k1J3wKrHS4R3lLRip2wiPVsg+zyOHf8 CqQTP8LXJ1bAybqq2vuhS+2zVoRjAK8CNXr1xjlABxxCo1tH9YK4l8kcJHZb/J5cSYy4 fUDg== X-Received: by 10.68.197.39 with SMTP id ir7mr2769709pbc.78.1402299362985; Mon, 09 Jun 2014 00:36:02 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id io8sm62307223pbc.96.2014.06.09.00.36.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Jun 2014 00:36:02 -0700 (PDT) Date: Mon, 09 Jun 2014 00:36:02 -0700 (PDT) Message-ID: <87d2eisffc.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH] ASoC: rsnd: enable DVC when capture X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current DVC can be enabled only when playback, but, this came from misunderstanding. It is not correct. DVC <-> DMA relationship is... Playback: MEM -> DMAC -> SRC -> DVC -> DMACp -> SSI Capture: SSI -> DMACp -> SRC -> DVC -> DMAC -> MEM DVC can be used for both Playback/Capture Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/dvc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index ed00070..deef310 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -191,24 +191,20 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, struct snd_soc_pcm_runtime *rtd) { struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); - struct rsnd_priv *priv = rsnd_mod_to_priv(mod); - struct device *dev = rsnd_priv_to_dev(priv); struct snd_card *card = rtd->card->snd_card; struct snd_kcontrol *kctrl; static struct snd_kcontrol_new knew = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, - .name = "Playback Volume", .info = rsnd_dvc_volume_info, .get = rsnd_dvc_volume_get, .put = rsnd_dvc_volume_put, }; int ret; - if (!rsnd_dai_is_play(rdai, io)) { - dev_err(dev, "DVC%d is connected to Capture DAI\n", - rsnd_mod_id(mod)); - return -EINVAL; - } + if (rsnd_dai_is_play(rdai, io)) + knew.name = "Playback Volume"; + else + knew.name = "Capture Volume"; kctrl = snd_ctl_new1(&knew, mod); if (!kctrl)