From patchwork Mon Mar 10 11:41:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 3802361 Return-Path: X-Original-To: patchwork-linux-omap@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 99F1C9F1CD for ; Mon, 10 Mar 2014 11:41:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4E36201B6 for ; Mon, 10 Mar 2014 11:41:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFF1720257 for ; Mon, 10 Mar 2014 11:41:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753350AbaCJLl1 (ORCPT ); Mon, 10 Mar 2014 07:41:27 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:44337 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753032AbaCJLl0 (ORCPT ); Mon, 10 Mar 2014 07:41:26 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2ABfLht004391; Mon, 10 Mar 2014 06:41:21 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2ABfL6h010832; Mon, 10 Mar 2014 06:41:21 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Mon, 10 Mar 2014 06:41:21 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2ABfK1q012743; Mon, 10 Mar 2014 06:41:20 -0500 From: Jyri Sarha To: , , CC: , , , , , Jyri Sarha Subject: [PATCH RFC v2 1/2] ASoC: core: Add is_cpu_dai_node-parameter to snd_soc_of_parse_daifmt() Date: Mon, 10 Mar 2014 13:41:15 +0200 Message-ID: <2fdbb57b2598e014a443bbe882af75072bddac6f.1394451329.git.jsarha@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The sematics of bitclock-master and frame-master DT parameters should be inversed when parsing a cpu-dai node. Signed-off-by: Jyri Sarha --- include/sound/soc.h | 3 ++- sound/soc/soc-core.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index c0b6656..ecd0745 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1231,7 +1231,8 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, const char *propname); unsigned int snd_soc_of_parse_daifmt(struct device_node *np, - const char *prefix); + const char *prefix, + bool is_cpu_dai_node); int snd_soc_of_get_dai_name(struct device_node *of_node, const char **dai_name); 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;