From patchwork Mon Mar 10 11:28:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 3802271 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 14ED29F369 for ; Mon, 10 Mar 2014 11:29:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D2A82034E for ; Mon, 10 Mar 2014 11:29:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 11946201B6 for ; Mon, 10 Mar 2014 11:29:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1450F265132; Mon, 10 Mar 2014 12:29:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 792AD265134; Mon, 10 Mar 2014 12:28:55 +0100 (CET) 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 913F0265682; Mon, 10 Mar 2014 12:28:54 +0100 (CET) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by alsa0.perex.cz (Postfix) with ESMTP id ADFAA2650AC for ; Mon, 10 Mar 2014 12:28:48 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2ABSlnK006153; Mon, 10 Mar 2014 06:28:47 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2ABSlpW002582; Mon, 10 Mar 2014 06:28:47 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 10 Mar 2014 06:28:47 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2ABSkwa003493; Mon, 10 Mar 2014 06:28:47 -0500 From: Jyri Sarha To: , , Date: Mon, 10 Mar 2014 13:28:37 +0200 Message-ID: <8e870602aecf36e8217bb9d0b37c50b060dc1a5b.1394450178.git.jsarha@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Cc: liam.r.girdwood@linux.intel.com, detheridge@ti.com, Jyri Sarha , peter.ujfalusi@ti.com, broonie@kernel.org, bcousson@baylibre.com Subject: [alsa-devel] [PATCH RFC 1/2] ASoC: core: Add is_cpu_dai_node-parameter to snd_soc_of_parse_daifmt() 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 The schematics of bitclock-master and frame-master DT parameters should be inversed when parsing a cpu-dai node. Signed-off-by: Jyri Sarha --- sound/soc/soc-core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 8ddb15c..dfff75f 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -4613,7 +4613,8 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing); unsigned int snd_soc_of_parse_daifmt(struct device_node *np, - const char *prefix) + const char *prefix, + bool is_cpu_dai_node) { int ret, i; char prop[128]; @@ -4700,6 +4701,11 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np, snprintf(prop, sizeof(prop), "%sframe-master", prefix); frame = !!of_get_property(np, prop, NULL); + if (is_cpu_dai_node) { + bit = !bit; + frame = !frame; + } + switch ((bit << 4) + frame) { case 0x11: format |= SND_SOC_DAIFMT_CBM_CFM;