From patchwork Mon Jun 23 00:57:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4397111 Return-Path: X-Original-To: patchwork-linux-sh@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 B7E0DBEEAA for ; Mon, 23 Jun 2014 00:57:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA0562024F for ; Mon, 23 Jun 2014 00:57:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1179020256 for ; Mon, 23 Jun 2014 00:57:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751142AbaFWA5n (ORCPT ); Sun, 22 Jun 2014 20:57:43 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:59528 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbaFWA5n (ORCPT ); Sun, 22 Jun 2014 20:57:43 -0400 Received: by mail-pa0-f50.google.com with SMTP id bj1so5154080pad.23 for ; Sun, 22 Jun 2014 17:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=YHJg02/2N3bJTSlPE+G+uweGbZT71WO+WY4zeWaCUUg=; b=z/IvJO4dyQ6NbckgkCxkLv2pr8VkYMtCnUdOXClrS2aTFnhHf+aAh0vDaK7RI/WOwS IT5B4rPn7z1b/LPoNeKxamRIHCKqnmWxhxJsYy44ExE3lbT04HWS8+9wYgv7w+cooJQ0 OIeWOyBqoHsuLduC/qmBSJw2KcJMHsPkPKvoJ9EX5+DvMMiarehedXGYys1D4Q6rPV5p xGW0kgiXXMgcd9TKb5iSnjAePqeaNHw88zu0NlTrCDtZeujZevUK6/nTsr0xME33RZtP xY0hR5mgkSPWJTJIAjxwlYU6EAiZiQjDEDjjL0k7r0x/20+q73lU7VGEM5SwR3zwFEX4 BXoQ== X-Received: by 10.66.254.68 with SMTP id ag4mr24671774pad.83.1403485062914; Sun, 22 Jun 2014 17:57:42 -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 pq3sm23903960pbb.57.2014.06.22.17.57.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 22 Jun 2014 17:57:42 -0700 (PDT) Date: Sun, 22 Jun 2014 17:57:42 -0700 (PDT) Message-ID: <87vbrssar8.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/10 v2] ASoC: rsnd: enable SRC setting via DT User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown Cc: Kuninori Morimoto , Linux-ALSA , Liam Girdwood , Simon , linux-sh@vger.kernel.org In-Reply-To: <8761jstphc.wl%kuninori.morimoto.gx@gmail.com> References: <87d2e6zjhf.wl%kuninori.morimoto.gx@gmail.com> <8761jstphc.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto some special board wants to exchange sampling rate by using SRC. This patch enables its settings. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - src_node -> np on of_property_read_u32() .../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 41a120c..1d88d42 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt @@ -24,7 +24,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); }