From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Hunter Subject: Re: [PATCH v5 1/7] ASoC: tegra: add a TDM configuration callback Date: Thu, 24 Oct 2019 16:50:59 +0100 Message-ID: References: <20191018154833.7560-1-ben.dooks@codethink.co.uk> <20191018154833.7560-2-ben.dooks@codethink.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20191018154833.7560-2-ben.dooks@codethink.co.uk> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Ben Dooks , linux-tegra@vger.kernel.org, alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Thierry Reding Cc: linux-kernel@lists.codethink.co.uk, Edward Cragg List-Id: linux-tegra@vger.kernel.org On 18/10/2019 16:48, Ben Dooks wrote: > From: Edward Cragg > > Add a callback to configure TDM settings for the Tegra30 I2S ASoC 'platform' > driver. > > Signed-off-by: Edward Cragg > [ben.dooks@codethink.co.uk: merge fix for power management] > [ben.dooks@codethink.co.uk: add review change for fsync of 1 clock] > Signed-off-by: Ben Dooks > --- > sound/soc/tegra/tegra30_i2s.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c > index ac6983c6bd72..73f0dddeaef3 100644 > --- a/sound/soc/tegra/tegra30_i2s.c > +++ b/sound/soc/tegra/tegra30_i2s.c > @@ -254,6 +254,34 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd, > return 0; > } > > +static int tegra30_i2s_set_tdm(struct snd_soc_dai *dai, > + unsigned int tx_mask, unsigned int rx_mask, > + int slots, int slot_width) > +{ > + struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai); > + unsigned int mask, val; > + > + dev_dbg(dai->dev, "%s: txmask=0x%08x rxmask=0x%08x slots=%d width=%d\n", > + __func__, tx_mask, rx_mask, slots, slot_width); > + > + mask = TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK | > + TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_MASK | > + TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_MASK; > + > + val = (tx_mask << TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_SHIFT) | > + (rx_mask << TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT) | > + ((slots - 1) << TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT); > + > + pm_runtime_get_sync(dai->dev); > + regmap_update_bits(i2s->regmap, TEGRA30_I2S_SLOT_CTRL, mask, val); > + /* set the fsync width to minimum of 1 clock width */ > + regmap_update_bits(i2s->regmap, TEGRA30_I2S_CH_CTRL, > + TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK, 0x0); > + pm_runtime_put(dai->dev); > + > + return 0; > +} > + > static int tegra30_i2s_probe(struct snd_soc_dai *dai) > { > struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai); > @@ -268,6 +296,7 @@ static const struct snd_soc_dai_ops tegra30_i2s_dai_ops = { > .set_fmt = tegra30_i2s_set_fmt, > .hw_params = tegra30_i2s_hw_params, > .trigger = tegra30_i2s_trigger, > + .set_tdm_slot = tegra30_i2s_set_tdm, > }; > > static const struct snd_soc_dai_driver tegra30_i2s_dai_template = { Thanks! Reviewed-by: Jon Hunter Cheers Jon -- nvpublic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD83ECA9EAF for ; Thu, 24 Oct 2019 15:52:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA14020684 for ; Thu, 24 Oct 2019 15:52:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ffcyvp/i"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="PTqJzAC8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA14020684 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 73C1716F5; Thu, 24 Oct 2019 17:51:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 73C1716F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1571932321; bh=X80UtcDUM1mbDdeShA0SheSZPyMaL32yXkNqAqEz2SM=; h=To:References:From:Date:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ffcyvp/iTj2aqyu+a4Q6ucHY09UFSX06gf0b0oASIodrCB35KjOU/z9gEh7WFF88w N8B08gm0Qq8cBIGI5z6lBU8fS3RSuq3CM2/t7Y6VanEt2/9AbjJgt2adcahRolCE4o /stCPUuNkjNQIy8Yyo6cw6Ox7YQT4UIytI52Wbfg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EBA2DF80367; Thu, 24 Oct 2019 17:51:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CD93AF8036B; Thu, 24 Oct 2019 17:51:09 +0200 (CEST) Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 29076F80112 for ; Thu, 24 Oct 2019 17:51:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29076F80112 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="PTqJzAC8" Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 24 Oct 2019 08:51:09 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 24 Oct 2019 08:51:03 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 24 Oct 2019 08:51:03 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 24 Oct 2019 15:51:03 +0000 Received: from [10.21.133.51] (172.20.13.39) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 24 Oct 2019 15:51:00 +0000 To: Ben Dooks , , , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Thierry Reding References: <20191018154833.7560-1-ben.dooks@codethink.co.uk> <20191018154833.7560-2-ben.dooks@codethink.co.uk> From: Jon Hunter Message-ID: Date: Thu, 24 Oct 2019 16:50:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191018154833.7560-2-ben.dooks@codethink.co.uk> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1571932269; bh=/UMnG3zbDJ6aRhIhuPU8fUT/YKNZXu5bwGROSc+RF/M=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=PTqJzAC8ylpld4HbRa5hfXBrp24LwpA+VjHptHpsN1+gkgFDw/gcem+JUSiAhgEq6 frflg3woY6g5MtQ4AfHjCdXDZQuSmskcZLce/Hiy37Cz82rYybKd7QPhNd4gtGkxUK Pmj8usx9DVkpTTnx8wzVzPI1rmYgd+QcpOnitRBLJzUIrlM76CihfAyY/bUpL03Xk8 xM1+esr3ujauUxBE/SdKpg2wkgAJgls8TKCg1uIKt/p2oge5IpFTWkHrFP6lB64PvF oNSlzNfPsiY26o7Hdr36JKlFDkrDyaxGxqiNKIwQ+mye5bQgRral2mTOTd1Lv2pZzx cxhu9aF5yF8cQ== Cc: linux-kernel@lists.codethink.co.uk, Edward Cragg Subject: Re: [alsa-devel] [PATCH v5 1/7] ASoC: tegra: add a TDM configuration callback X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 18/10/2019 16:48, Ben Dooks wrote: > From: Edward Cragg > > Add a callback to configure TDM settings for the Tegra30 I2S ASoC 'platform' > driver. > > Signed-off-by: Edward Cragg > [ben.dooks@codethink.co.uk: merge fix for power management] > [ben.dooks@codethink.co.uk: add review change for fsync of 1 clock] > Signed-off-by: Ben Dooks > --- > sound/soc/tegra/tegra30_i2s.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c > index ac6983c6bd72..73f0dddeaef3 100644 > --- a/sound/soc/tegra/tegra30_i2s.c > +++ b/sound/soc/tegra/tegra30_i2s.c > @@ -254,6 +254,34 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd, > return 0; > } > > +static int tegra30_i2s_set_tdm(struct snd_soc_dai *dai, > + unsigned int tx_mask, unsigned int rx_mask, > + int slots, int slot_width) > +{ > + struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai); > + unsigned int mask, val; > + > + dev_dbg(dai->dev, "%s: txmask=0x%08x rxmask=0x%08x slots=%d width=%d\n", > + __func__, tx_mask, rx_mask, slots, slot_width); > + > + mask = TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_MASK | > + TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_MASK | > + TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_MASK; > + > + val = (tx_mask << TEGRA30_I2S_SLOT_CTRL_TX_SLOT_ENABLES_SHIFT) | > + (rx_mask << TEGRA30_I2S_SLOT_CTRL_RX_SLOT_ENABLES_SHIFT) | > + ((slots - 1) << TEGRA30_I2S_SLOT_CTRL_TOTAL_SLOTS_SHIFT); > + > + pm_runtime_get_sync(dai->dev); > + regmap_update_bits(i2s->regmap, TEGRA30_I2S_SLOT_CTRL, mask, val); > + /* set the fsync width to minimum of 1 clock width */ > + regmap_update_bits(i2s->regmap, TEGRA30_I2S_CH_CTRL, > + TEGRA30_I2S_CH_CTRL_FSYNC_WIDTH_MASK, 0x0); > + pm_runtime_put(dai->dev); > + > + return 0; > +} > + > static int tegra30_i2s_probe(struct snd_soc_dai *dai) > { > struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai); > @@ -268,6 +296,7 @@ static const struct snd_soc_dai_ops tegra30_i2s_dai_ops = { > .set_fmt = tegra30_i2s_set_fmt, > .hw_params = tegra30_i2s_hw_params, > .trigger = tegra30_i2s_trigger, > + .set_tdm_slot = tegra30_i2s_set_tdm, > }; > > static const struct snd_soc_dai_driver tegra30_i2s_dai_template = { Thanks! Reviewed-by: Jon Hunter Cheers Jon -- nvpublic _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel