Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1941090rwd; Fri, 2 Jun 2023 02:22:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41gdEm1qoE2q0b8t+7aK7Cmqb0LJQhUDIfg9g1JGXeog/A/jjLrW/Are0Z6oBs8CoyhGQ6 X-Received: by 2002:a05:6870:a486:b0:19a:7870:4ce0 with SMTP id j6-20020a056870a48600b0019a78704ce0mr1431792oal.18.1685697747045; Fri, 02 Jun 2023 02:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685697747; cv=none; d=google.com; s=arc-20160816; b=FcGDavlAzL9eoF13Q9m1Z3BmB3tkVMeBi5wFaQMg/ODblK9nh3bbDdqu2l70WhGKTT 4AhlRIc4ZJaQu4Wtpx9JagWceXZ1hRidiL6UbruXEd8beWwkXXBucFji3kI/Dh4e1BDb LZx1mUA/MTauoEmdvrcD6zy+qmHylhBCi9ZO4qXrzlxzKCMOtFqC2pQu8rh4bKwuXpJ9 PS/KNrGhD5HAjNAoCVredRBspQJG3mF5ZiHd3csinQBFGKrpoUzQvyfM429AaDZi99RF 3AV1vx1IX9vMPSFiysp3hV217JeXWNYlBw4qZTOrCI7ZGut70hD866+M91XecLp0rbIl QtKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ppOouDsw2ZJBp9Pb63smrW3GHRr3r6Vq+ntYkWdxiUU=; b=y6Olj8agkECgstSAPuQWd821x5e5VRvTehqLWGcDO2G8hYMtvkwZ9HeML3E4RIcXKU MOKND7p1O9MuTgHgbbmmBKhABT0cxIOATpSf8iDt2GiB+cucRkBRxMumdVHEG6KaedIa 0mRbSbt+0kDk4RGTOb7mRuJHevjwvdaRIdFJ8pCYqOAwjgZkrtp1ZY5sE76+pnfda/Il 6zpoNTMFSHwvif5hq6n798wFoFY72Fxal2h7g00PQ8uOgIc+WNts9PXRr26WbEjU1gRE eMvK6a0hVYBkSneoF9VOmk6gxfuogU1ZqW4YGLkUKC98LQLH1Y/ac9CNNsXl7lonh3Op 0dkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pqrs.dk header.s=google header.b=W7A072+4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a637152000000b0053fec1cf2dcsi729611pgn.28.2023.06.02.02.22.12; Fri, 02 Jun 2023 02:22:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@pqrs.dk header.s=google header.b=W7A072+4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234903AbjFBJFN (ORCPT + 99 others); Fri, 2 Jun 2023 05:05:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234812AbjFBJEM (ORCPT ); Fri, 2 Jun 2023 05:04:12 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A888510CE for ; Fri, 2 Jun 2023 02:03:49 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5147e40bbbbso2630652a12.3 for ; Fri, 02 Jun 2023 02:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqrs.dk; s=google; t=1685696628; x=1688288628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ppOouDsw2ZJBp9Pb63smrW3GHRr3r6Vq+ntYkWdxiUU=; b=W7A072+4L5LVDFH8xeLtIvjZhQinq7JukGEfUyDMsfu3Ltgt+G1BtIcw7ak1xEEHGl hAUqRouAfhJg//9Q+p9+8CJGUpYPUOHUrUGQLFmt/FgEgERYhiqusJZ/e0ZQu9O6eSc4 DmqOcdWC7yH1yDWj3Mg1nCVroO1VyUTPGMiUYTYRge94t/W+DcZlKQs6ItelryoyQ93m AEse3zS9XK/8Xz0VxP5mXPBfOf9dJj5ZVZ6CBqR4kiMc1Y4YCpeB0HjfKGSca7+rNxCz j7/GQhJUvGMovqQPDjqKV+Ah7gqBFlQFoVekcAxbhOM1gWsPj9HXrKGxgdKQrIOH6NjA ZO6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685696628; x=1688288628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ppOouDsw2ZJBp9Pb63smrW3GHRr3r6Vq+ntYkWdxiUU=; b=F1G7rFHoau7zziPMyxc+A1NsvQCESqS4QdOoiTTuv7Xd/KfIUnbmKt0WdI0QCDJzko R2ACyvBIO7YxD70f/0efIHXx1+gCrObpxiHmMchSYuyra+/sFPzyw0W3z8fA8E25ksUA hXkQwc2lrRkEx81+ujsVmlh53bvUeqFVAIt3h2wS+KrPSh4hlJ9Q5drHpI+D/OK0el0w FzkvCe68ctsWQnuU2sfEXk/htC+Imk2PeZOhwkxasr4srtVgc1Ekx0+dyZ1h6PzTiNS8 7O8F3/3W4ohz5BRlZ0s1FUQoCICdyiSQ15f9qWiXkiv9qM46zgDRkyTO7mhhRRb3nU5F l6Aw== X-Gm-Message-State: AC+VfDy5lSEcglMz7ddy4swHKbqWWf4UBLKXty6TJTlIpl5imu2MtL6F d73wfbgd9MFqLejVOgDlIjQD2g== X-Received: by 2002:a17:907:d17:b0:966:eb8:2f12 with SMTP id gn23-20020a1709070d1700b009660eb82f12mr10334273ejc.11.1685696628034; Fri, 02 Jun 2023 02:03:48 -0700 (PDT) Received: from localhost.localdomain (80.71.142.18.ipv4.parknet.dk. [80.71.142.18]) by smtp.gmail.com with ESMTPSA id w23-20020a170906385700b009707fa1c316sm488031ejc.213.2023.06.02.02.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 02:03:47 -0700 (PDT) From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto Cc: =?UTF-8?q?Alvin=20=C5=A0ipraga?= , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] ASoC: audio-graph-card2: parse symmetric-clock-roles property Date: Fri, 2 Jun 2023 11:03:20 +0200 Message-Id: <20230602090322.1876359-4-alvin@pqrs.dk> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230602090322.1876359-1-alvin@pqrs.dk> References: <20230602090322.1876359-1-alvin@pqrs.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alvin Šipraga The property, when set, specifies that both ends of the dai-link should have the same clock consumer/provider roles. Like with parsing of DAI format, the property can be specified in multiple places: ports { (A) port { (B) endpoint { (C) }; }; }; So each place has to be checked. In case the clock roles are symmetric, there is then no need to flip the role when parsing the DAI format on the CPU side, as it should then be the same on the Codec side. Signed-off-by: Alvin Šipraga --- sound/soc/generic/audio-graph-card2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 25aa79dd55b3..9b4ebfd0c0b6 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -721,13 +721,18 @@ static void graph_link_init(struct asoc_simple_priv *priv, if (of_node_name_eq(ports, "ports")) graph_parse_daifmt(ports, &daifmt, &bit_frame); /* (A) */ + if (of_property_read_bool(ep, "symmetric-clock-roles") || + of_property_read_bool(port, "symmetric-clock-roles") || + of_property_read_bool(ports, "symmetric-clock-roles")) + dai_link->symmetric_clock_roles = 1; + /* * convert bit_frame * We need to flip clock_provider if it was CPU node, * because it is Codec base. */ daiclk = snd_soc_daifmt_clock_provider_from_bitmap(bit_frame); - if (is_cpu_node) + if (is_cpu_node && !dai_link->symmetric_clock_roles) daiclk = snd_soc_daifmt_clock_provider_flipped(daiclk); dai_link->dai_fmt = daifmt | daiclk; -- 2.40.0