Received: by 10.223.185.116 with SMTP id b49csp908778wrg; Tue, 20 Feb 2018 09:45:44 -0800 (PST) X-Google-Smtp-Source: AH8x225z3FhlBraAWjn8JyrVpHPhsYNCle0OFujcph35aHyxC/l9KHaM/u0uU3Bp+K85LBBX9vd3 X-Received: by 10.98.46.70 with SMTP id u67mr429903pfu.16.1519148743997; Tue, 20 Feb 2018 09:45:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519148743; cv=none; d=google.com; s=arc-20160816; b=LSqkY5+McejhCjD/lJNP1ihPKUHFLOWJ+BcNxA0qpRkxQ9AE/5ZtvHBPpvptGnEpWY 9/NQCLYkQq8l8H96t6uzntnwe1qgPQwH1VXnD+mBethZLzDZ59mERMJZ+rMFh07Qp6kx yy/dVDAZbkxXqHDS4HSFj6lpOgizALavrPOyABuH3ZYK2KgtTZT3XOJ09oBu8UODOnu5 0dKD8LN3sPIuI7ELZgaiorlqLb87hLkelhNkxH0/2DhHDO8MZ2ppmrRSPt+JV2iTHu7c LDm2TFLTyWAoi0uLIzwkmyrlQodEWflKCBnfsFPqu5zE3hBP2z1kj9BHlbzW+j1NVUea jrOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=loFzp5QYEfuhkTGamOEzowGU70VZVP70YTHav+vxpHA=; b=H+wRGuSXj6gaovY6N8yHSHreCLhptJSOokvGmycpW2uOkdkPPq6Ar0IlRKQqv3HNHs cHAhd6L6UXZULoQxO1n+zX1bkzFEDN4ubvXXYzSheCgtslF4w6JOZGilSlkk2LcP+XCx hORzAkqj9fbdNbyAMx+cgGRtyj2q9x/P/RvQqgIgfSkzXzhuSgTMDXGNWQl8cm6h+NTk pBvqfvgFttv+vICp6bkC6euV4OXmR4X3czuLayHDwjm9FcqZeuyHU8dKpEBDzrwhDc5+ JXKLLdbahjSFWp6Dv21qIhCU17X4nyUMm2oCKXti6anRZ7jA46DPqtuJNiTK970WqMOu jNHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LT5r+EwE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si503275pfh.229.2018.02.20.09.45.29; Tue, 20 Feb 2018 09:45:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LT5r+EwE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364AbeBTRov (ORCPT + 99 others); Tue, 20 Feb 2018 12:44:51 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45330 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753341AbeBTRor (ORCPT ); Tue, 20 Feb 2018 12:44:47 -0500 Received: by mail-wr0-f193.google.com with SMTP id p104so15437402wrc.12 for ; Tue, 20 Feb 2018 09:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=loFzp5QYEfuhkTGamOEzowGU70VZVP70YTHav+vxpHA=; b=LT5r+EwENBZHCc+7EcBU1mTw61Ksxy+GchuLprODu8DwCOheVqpLyL+7S+SZE6gjYX echTTG5BspSEhage+4+V6x1XO26xekALNnKrhEyqK6KcXeXqc5AN2bEo7BThlauJo3bA Z+bpNhszJMwfWfMwWZCmXjrLE195uGkh2OqJ6ir2NYjrQBzd4V4XaaBqpFR9+Fq/m/89 cpXFRnW8lQMjBYavuaMP415p/SI7EsnxEVrGQN75biZ0JRtW+BQINDVM32YlKKlDxr5S 1RKQSRm+zQkNuh3uImOqB5XReTYgqux9EErgsKngJzP06lMKtfRjHZM1rsBRcqJtzhf7 omMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=loFzp5QYEfuhkTGamOEzowGU70VZVP70YTHav+vxpHA=; b=BLytXimSJQ/bTQtN7L4yQHQbH/LbD/cpnKWTX03AiC5J6A3RZKESw6l6TlhpFNG7fh 8t7A/bFbOXT8ceSdQ/Ukfg4feFyDiNn+zs9tVpfmHCE6vHVqZvMcn88RD78ZiYDsAl/W /1PnL1NeRrxQVvpqa7k05YiiBP7bdAU+raFjrKAniwMeTkYDzWtCJXTwLoSEHqppOiPh AhpkntN2VyqCeK8zM42GFxAT3NyIJQM3vpZTSg2SINXpLDwLuBQNv/T0fUCha356ar2k 0rO3nHLCH9RU5SH1K1gl3bz0Z6IFvi8Pvl7VIliPSxFxkbYsElhcQ0Uxice6THZG1MBV XYvw== X-Gm-Message-State: APf1xPBd9g81BRTmM3rgJkADTIiCAkJIybEim1wbBjehjebk/2Yl+lVo i+mVIOIIwWKfJNBk8KN3+DZxmBhS X-Received: by 10.28.137.140 with SMTP id l134mr829334wmd.137.1519148686096; Tue, 20 Feb 2018 09:44:46 -0800 (PST) Received: from gentoo0.localdomain (x4dbc326f.dyn.telefonica.de. [77.188.50.111]) by smtp.gmail.com with ESMTPSA id o94sm9353780wrc.7.2018.02.20.09.44.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 09:44:45 -0800 (PST) From: Kirill Marinushkin To: linux-kernel@vger.kernel.org Cc: Kirill Marinushkin , Mark Brown , Takashi Sakamoto , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , alsa-devel@alsa-project.org Subject: [RESEND PATCH v2 2/2] ASoC: topology: Add missing clock gating parameter when parsing hw_configs Date: Tue, 20 Feb 2018 18:44:46 +0100 Message-Id: <20180220174446.7784-3-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180220174446.7784-1-k.marinushkin@gmail.com> References: <20180220174446.7784-1-k.marinushkin@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clock gating parameter is a part of `dai_fmt`. It is supported by `alsa-lib` when creating a topology binary file, but ignored by kernel when loading this topology file. After applying this commit, the clock gating parameter is not ignored any more. The old behaviour is not broken, as by default the parameter value is 0. For example, the following config, based on alsa-lib/src/conf/topology/broadwell/broadwell.conf, is now supported: ~~~~ SectionHWConfig."CodecHWConfig" { id "1" format "I2S" # physical audio format. bclk "master" # Platform is master of bit clock fsync "master" # platform is master of fsync pm_gate_clocks "true" # clock can be gated } SectionLink."Codec" { # used for binding to the physical link id "0" hw_configs [ "CodecHWConfig" ] default_hw_conf_id "1" } ~~~~ Signed-off-by: Kirill Marinushkin Cc: Mark Brown Cc: Takashi Sakamoto Cc: Takashi Iwai Cc: Jaroslav Kysela Cc: Liam Girdwood Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org --- sound/soc/soc-topology.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 01a50413c66f..bac70676a6b4 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1981,6 +1981,13 @@ static void set_link_hw_format(struct snd_soc_dai_link *link, link->dai_fmt = hw_config->fmt & SND_SOC_DAIFMT_FORMAT_MASK; + /* clock gating */ + if (hw_config->clock_gated == SND_SOC_TPLG_DAI_CLK_GATE_GATED) + link->dai_fmt |= SND_SOC_DAIFMT_GATED; + else if (hw_config->clock_gated == + SND_SOC_TPLG_DAI_CLK_GATE_CONT) + link->dai_fmt |= SND_SOC_DAIFMT_CONT; + /* clock signal polarity */ invert_bclk = hw_config->invert_bclk; invert_fsync = hw_config->invert_fsync; -- 2.13.6