From patchwork Tue Feb 20 17:44:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10230609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EAD42601E7 for ; Tue, 20 Feb 2018 17:44:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D91C428824 for ; Tue, 20 Feb 2018 17:44:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDF9E28827; Tue, 20 Feb 2018 17:44:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E5C728824 for ; Tue, 20 Feb 2018 17:44:59 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0C82426751C; Tue, 20 Feb 2018 18:44:47 +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 CA669267510; Tue, 20 Feb 2018 18:44:44 +0100 (CET) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by alsa0.perex.cz (Postfix) with ESMTP id 3842D267502 for ; Tue, 20 Feb 2018 18:44:42 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id s5so16805716wra.0 for ; Tue, 20 Feb 2018 09:44:42 -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=ECv7tvgU/MfPZCQHOYhi+Aca6KoQhJL8M8uaDyFWLCg=; b=Nbe+SDN//Xmt0OvWRfG2c3TijZS2kScNyHcAQDcr5OdoiadMCEVCWHJDXZsH/bPWMS FDTuLCOFtdRCCgO3DUYaskzXHmtfFCg0B3YJ7U/msreQ69G3May83w7EPh8MI9aH+5fV xsBQxDN5d9a/LU4Yh0OWiLKn5U/UetsHBrwo1SOcy6p50fHxt1s0YGZwqMyYOoxXIjGu S5zO6dGNSvGNgjoPFXccxowV7JHMY7nfoHZLMJXAokUAowrG7j9Q6J5MhdpmiEkqfZ7C 9ur4oSuH3jUyn1UP879tB73iXntxeFnEVnm9rLsecTKKzzW5w2dmyiIXwF4Q9bVoo7Qd FW8g== 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=ECv7tvgU/MfPZCQHOYhi+Aca6KoQhJL8M8uaDyFWLCg=; b=mnlDLa2EJLubQTdNZVZU3Wgl7U2QrFQ++rz34j/dGwaPhj0718JZ2BePMiL19WZWq6 lRgk/h1MxOvoL7fbbsk8jllait5BPKIAqR93ggUZKkhwe9J+w7vQqos1fznJ72WzTyLO NpgkteypV16Hyw7qsjVvSVGrh/GbwDzVtBc2I1BZJ0dPKGAEnCsQHwtQ+vofted2KCAk YOSj4AQ5T3jujHnFJViQbKSLhQwqIHFzUJ4cDag0Fv85f+OtxGuRLnxussJ1yeb3QSKX S5QEcG7F5ehXeoqF+odjLIcKJG+UMoPK2iqWRMSo8QlDi1+GiwoJrARWzBfvYyjPga+B M5yQ== X-Gm-Message-State: APf1xPAO+TOKfIV9dl42wcwSqSQbIHj/JSU2tB6Zxj8VO7Kodx5ZCJwY pmwY6EUkbdAWCjiJByzp52A= X-Google-Smtp-Source: AH8x224VLKKqjfO/R0DZ2e9yFD16rezNWpJphIiPf7iyb1EoszGf5G7m5WuOo6BHbRqzQt3w6h5GRg== X-Received: by 10.28.245.25 with SMTP id t25mr821094wmh.77.1519148682692; Tue, 20 Feb 2018 09:44:42 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 09:44:41 -0800 (PST) From: Kirill Marinushkin To: linux-kernel@vger.kernel.org Date: Tue, 20 Feb 2018 18:44:45 +0100 Message-Id: <20180220174446.7784-2-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> Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , Mark Brown , Takashi Sakamoto , Kirill Marinushkin Subject: [alsa-devel] [RESEND PATCH v2 1/2] ASoC: topology: Add defines for snd_soc_tplg_hw_config.clock_gated 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In kernel `soc-dai.h`, DAI clock gating is defined as following: ~~~~ \#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ \#define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */ ~~~~ The corresponding field of struct snd_soc_tplg_hw_config cannot be used as bool values due to the inverted logic. Therefore this commit adds the defines for this field. snd_soc_tplg_hw_config.clock_gated = 0 => no effect snd_soc_tplg_hw_config.clock_gated = 1 => SND_SOC_DAIFMT_GATED snd_soc_tplg_hw_config.clock_gated = 2 => SND_SOC_DAIFMT_CONT 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 --- include/uapi/sound/asoc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h index 69c37ecbff7e..86d0599a6f13 100644 --- a/include/uapi/sound/asoc.h +++ b/include/uapi/sound/asoc.h @@ -139,6 +139,11 @@ #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) +/* DAI clock gating */ +#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0 +#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1 +#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2 + /* DAI physical PCM data formats. * Add new formats to the end of the list. */ @@ -312,7 +317,7 @@ struct snd_soc_tplg_hw_config { __le32 size; /* in bytes of this structure */ __le32 id; /* unique ID - - used to match */ __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */ - __u8 clock_gated; /* 1 if clock can be gated to save power */ + __u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */ __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */ __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */ __u8 bclk_master; /* 1 for master of BCLK, 0 for slave */