From patchwork Wed Jul 9 05:36:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4511631 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 06DF29F39B for ; Wed, 9 Jul 2014 05:36:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39D05202BE for ; Wed, 9 Jul 2014 05:36:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1A5DA2021F for ; Wed, 9 Jul 2014 05:36:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BFF4D261B32; Wed, 9 Jul 2014 07:36:52 +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 993A6261B07; Wed, 9 Jul 2014 07:36:41 +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 E2034261B0E; Wed, 9 Jul 2014 07:36:40 +0200 (CEST) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by alsa0.perex.cz (Postfix) with ESMTP id 8972B261B07 for ; Wed, 9 Jul 2014 07:36:32 +0200 (CEST) Received: by mail-pd0-f180.google.com with SMTP id fp1so8401926pdb.39 for ; Tue, 08 Jul 2014 22:36:31 -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=lHyOMZttSswT2MJEOHLIsfUnQFNaHLWh9dyMVlqud4E=; b=WhQVAhyYEnL1DXbm73PQjhLbnIw4KNpqgL1opbHYUW/LkifzIf6VzSjgTefTe7R/wy AnpMYt0V6nIqtde8YFiekB6ypymbi3+9Pyki7Wc64mfh/Ab25vNtwXQZDyWaFlRJeTJm 34/l//7UTWQxwPqtIXZg51z40It45hPpgsiWsfixt4qFkfGzGJhI+3KX4gOsAJM4noA+ IkqdTQ/OFST6MeITPPKBrWXGcjIG4UFMEzvGqubni0+xk4KxDns0sEglA3wZyi77Vs1V 2RaZTrz6vujeT6xIBYu0RQHosL6mkvj51ZcSWTbHWeKGZUHeK/eCNfis+hpKb3JTnllo 3Afg== X-Received: by 10.66.159.34 with SMTP id wz2mr19891888pab.96.1404884190908; Tue, 08 Jul 2014 22:36:30 -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 nm14sm22160456pdb.54.2014.07.08.22.36.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 22:36:30 -0700 (PDT) Date: Tue, 08 Jul 2014 22:36:30 -0700 (PDT) Message-ID: <87oawzum8z.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 v2] ASoC: rsnd: enable SRC setting via DT 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 Some special board wants to exchange sampling rate for special codec (or for very simple DA/AD converter) which can accept only 1 sampling rate. This patch enables its settings. 48kHz ---> 48kHz 44.1kHz ---> [SRC] ---> [codec] 96kHz ---> Signed-off-by: Kuninori Morimoto --- v1 -> v2 - add detail git log .../devicetree/bindings/sound/renesas,rsnd.txt | 2 +- sound/soc/sh/rcar/src.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt index aa697ab..652573e 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -27,7 +27,7 @@ SSI subnode properties: - no-busif : BUSIF is not ussed when [mem -> SSI] via DMA case SRC subnode properties: -no properties at this point +- convert-rate : SRC convert rate if needed DAI subnode properties: - playback : list of playback modules diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 4d39505..7f3c7d7 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -612,11 +612,11 @@ static void rsnd_of_parse_src(struct platform_device *pdev, const struct rsnd_of_data *of_data, struct rsnd_priv *priv) { - struct device_node *src_node; + struct device_node *src_node, *np; struct rcar_snd_info *info = rsnd_priv_to_info(priv); struct rsnd_src_platform_info *src_info; struct device *dev = &pdev->dev; - int nr; + int nr, i; if (!of_data) return; @@ -640,6 +640,16 @@ static void rsnd_of_parse_src(struct platform_device *pdev, info->src_info = src_info; info->src_info_nr = nr; + i = 0; + for_each_child_of_node(src_node, np) { + src_info = info->src_info + i; + + of_property_read_u32(np, "convert-rate", + &src_info->convert_rate); + + i++; + } + rsnd_of_parse_src_end: of_node_put(src_node); }