From patchwork Thu Feb 22 13:16:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 129231 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp585715lja; Thu, 22 Feb 2018 05:17:04 -0800 (PST) X-Google-Smtp-Source: AH8x227F0VAUC03qLtOt3FoyruDM80E9Zj5YWZhgFGr/XFEUMCyeK51trSsNC7OW6gS7M1iXpygR X-Received: by 10.28.23.14 with SMTP id 14mr5174188wmx.5.1519305424522; Thu, 22 Feb 2018 05:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519305424; cv=none; d=google.com; s=arc-20160816; b=Z1GivDW66i6oMKlnPGR0chdcS76GkFxSDI1bFJzkXHL4z71ePEJ1G2qUozaoHBKNrO NMaXH/TEIAD8ucE6YztifmX/m3xpImYpcP1JaihY3fOFD09N72XYz8VkYIBqt9FUHyY+ pd2CU+NRG+7uqBFk6VjYLwQQtDRYNhpyLqA7CJAczDuWuYXXZr0/rbRJ6mNyrRfxLkLB X7LzDog2Az3U+f+d8Lhb5fFGTOF7LXDLAnZ0UXxtvEk9ODY2qhRJ0In6l2GtPpMsl5ZQ TJlTQAFslxOVeE/aisTLzjmXUGqLjKzBEmMKNFv883bcxpsw91Qo0bzYe2s+6+xAFjqf tMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=GnyGaGpKBesaSWU8mkFaq6OrjP33/cVKWFjgQr8FeqY=; b=OQZGC3m6EuTB7v46mmGgW4yEuYEdPd6FvCN7mGVUI9auZ7BsUX2SFhW/jJQc0CF7w+ T79dfXZwZsH8Bm+JWmdfe6XkUP2lasAuub152Ndi6aXXrIOAJMEPbHz+HTrvn16kVOmd 7VNxJ6jTppekMgcJIIyiSMrM+5Bfoj9bqLrnJiC/BzFpteZD06mEyUY1oAbrkrGWOeip R6WC5L84PhlMCxtbeBH+/5ux6KavkPimhHXOa0W8KPL254M3QDf23EDW4LoDWuljPav/ aAU2aOLsgPzEYu8zOZ6JCKefXxVC1dQ6pRwC1WEo2mOIIYgQcF9xfN2LhKMfRHWsHN1a 4ShA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=rEW5zXtW; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y6si41957wrg.454.2018.02.22.05.17.03; Thu, 22 Feb 2018 05:17:04 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=rEW5zXtW; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 07D4626774A; Thu, 22 Feb 2018 14:16:40 +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 D2AE2267747; Thu, 22 Feb 2018 14:16:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 7C2BF267737 for ; Thu, 22 Feb 2018 14:16:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=6fiO/YrrjB8fUiZ9d41fg16zDMQmHhRbUDjRyjU1Kow=; b=rEW5zXtWvc8J VMFkW8NrpDLU4H2zYmdG1h/n8uSlftmP0LOIfLYBAUaH5zC2zFQWOvaU3AQIByfHn2CXbLDT+cbCr yK6zP9111B6bXyMAzyXsgCrm9m+HA2ILEEPNkQxu91SJOxRTYo6JDEBW30XGd+N8TE2eWGjSsbAEr nnEzc=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoqjf-0002Tz-Bh; Thu, 22 Feb 2018 13:16:31 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1eoqje-0006HV-Sj; Thu, 22 Feb 2018 13:16:30 +0000 From: Mark Brown To: Nicolin Chen In-Reply-To: Message-Id: Date: Thu, 22 Feb 2018 13:16:30 +0000 Cc: "Maciej S. Szmigiero" , Mark Brown , alsa-devel@alsa-project.org, Caleb Crome Subject: [alsa-devel] Applied "ASoC: fsl_ssi: Move one-time configurations to probe()" to the asoc tree 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 The patch ASoC: fsl_ssi: Move one-time configurations to probe() has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From a1d154ac2765cf982be0d4d378bc6ba342c467a3 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Mon, 12 Feb 2018 14:03:20 -0800 Subject: [PATCH] ASoC: fsl_ssi: Move one-time configurations to probe() The probe() could handle some one-time configurations since they will not be changed once being configured. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 7e15b30d4f94..36f3d51c5c43 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -865,7 +865,6 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev, { struct regmap *regs = ssi->regs; u32 strcr = 0, stcr, srcr, scr, mask; - u8 wm; ssi->dai_fmt = fmt; @@ -874,8 +873,6 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev, return -EINVAL; } - fsl_ssi_setup_regvals(ssi); - regmap_read(regs, REG_SSI_SCR, &scr); scr &= ~(SSI_SCR_SYN | SSI_SCR_I2S_MODE_MASK); /* Synchronize frame sync clock for TE to avoid data slipping */ @@ -990,16 +987,6 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev, regmap_write(regs, REG_SSI_SRCR, srcr); regmap_write(regs, REG_SSI_SCR, scr); - wm = ssi->fifo_watermark; - - regmap_write(regs, REG_SSI_SFCSR, - SSI_SFCSR_TFWM0(wm) | SSI_SFCSR_RFWM0(wm) | - SSI_SFCSR_TFWM1(wm) | SSI_SFCSR_RFWM1(wm)); - - if (ssi->use_dual_fifo) - regmap_update_bits(regs, REG_SSI_SCR, - SSI_SCR_TCH_EN, SSI_SCR_TCH_EN); - if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97) fsl_ssi_setup_ac97(ssi); @@ -1248,6 +1235,29 @@ static struct snd_ac97_bus_ops fsl_ssi_ac97_ops = { .write = fsl_ssi_ac97_write, }; +/** + * Initialize SSI registers + */ +static int fsl_ssi_hw_init(struct fsl_ssi *ssi) +{ + u32 wm = ssi->fifo_watermark; + + /* Initialize regvals */ + fsl_ssi_setup_regvals(ssi); + + /* Set watermarks */ + regmap_write(ssi->regs, REG_SSI_SFCSR, + SSI_SFCSR_TFWM0(wm) | SSI_SFCSR_RFWM0(wm) | + SSI_SFCSR_TFWM1(wm) | SSI_SFCSR_RFWM1(wm)); + + /* Enable Dual FIFO mode */ + if (ssi->use_dual_fifo) + regmap_update_bits(ssi->regs, REG_SSI_SCR, + SSI_SCR_TCH_EN, SSI_SCR_TCH_EN); + + return 0; +} + /** * Make every character in a string lower-case */ @@ -1533,6 +1543,9 @@ static int fsl_ssi_probe(struct platform_device *pdev) if (ssi->dai_fmt) _fsl_ssi_set_dai_fmt(dev, ssi, ssi->dai_fmt); + /* Initially configures SSI registers */ + fsl_ssi_hw_init(ssi); + if (fsl_ssi_is_ac97(ssi)) { u32 ssi_idx;