From patchwork Thu Feb 22 13:16:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 129230 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp585437lja; Thu, 22 Feb 2018 05:16:51 -0800 (PST) X-Google-Smtp-Source: AH8x226TlqNY7UqcwpSw9i+zDUqpUMo2YnvJyqbtfazFGNE95MhhTPWdVyK4u6OVKfMLaRg9joS9 X-Received: by 10.28.144.193 with SMTP id s184mr1501201wmd.68.1519305411706; Thu, 22 Feb 2018 05:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519305411; cv=none; d=google.com; s=arc-20160816; b=X4Gyn2gjzwY1a2PkH2NAMpGJei7o/SWWYb+TsvZKwxZSxwgw8pigmHlcNFn1CRtq0f 3aSWm0lSrkhhlBb5TJcuVFxovYJuVv5GhqnW0n1pobvc2wGQCPsqCVoal0JBeOC/um0/ C4kyN3epFectXUmmjE+Xd8W+wDg15n666XBHwGHOUlAcrLp4duYhOkFBd50Rgpci2ba0 1H+t7Ke8IjYaBa+Oi52gmgFt7nf3xwRfM95WIqVI/Um7B7QWv6zd1ERpl4poM2dddO5n rtDAwNFi4sAbdCXutTEbK1u0Ur1gP6BHqINklOiyI+XJfncImP0uSa8B4vEQ8r3bK9Ve ZVaw== 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=jupmPlGBQl6Y82fY4irNTME10e5zVEIVZu1dQfu3AU4=; b=tHkknKPWOp4hjUPARnRVnMlb6YGz59YBBiWwR/dDsSKbayhnvMo54LjyEqUhxR3+YW 94mCvmvflBk6h3Cr9lMJxKql0vopKHaG2Umyy/z4nRezW7lBSI3OYglBSyNl9yoN9uMB NVlWYErKKsv0m7hyG4IQc6L45uei/il7FjZfAkoLUTdULpAju5G5/y50dBf2db//ykpw jtyqAlhcN5Q3r1EFDZAsrOIUgzty1G00D4Pp4+o+Qvv2JWhHT3G996FSFaZ02nmgbgyo x44j3xP/gQMCZonbrBTJudLfYyYZW/J+aCN+eggkqW920O2qK2Y4AjIybc1bMZaHMipU R/rg== 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=KYWL1eS0; 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 v75si229522wmd.256.2018.02.22.05.16.51; Thu, 22 Feb 2018 05:16:51 -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=KYWL1eS0; 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 9371A267735; Thu, 22 Feb 2018 14:16:37 +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 195F7267742; Thu, 22 Feb 2018 14:16:34 +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 7B25926772F for ; Thu, 22 Feb 2018 14:16:30 +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=vXZguECuNHM7HcbQO5DFy1zzITg3pRIkRpL1UuyZqjo=; b=KYWL1eS0I06f HevMWbJCelmK/q1TxNu1fGHm2SYhxNrHcwFdlWtKZt+vnHDx6DT/TCcfrC/vwYdTHl4zfcy+Pxe4L K3A7zCCVxCy+3ssK946iIbAM1sSymC93p07Z0iIennq6gw+JjHci5Fu/Uh4D0rgLSpKnTuqwdaqBb q6Yq0=; 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 1eoqjd-0002To-6H; Thu, 22 Feb 2018 13:16:29 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1eoqjc-0006Gi-N5; Thu, 22 Feb 2018 13:16:28 +0000 From: Mark Brown To: Nicolin Chen In-Reply-To: Message-Id: Date: Thu, 22 Feb 2018 13:16:28 +0000 Cc: "Maciej S. Szmigiero" , Mark Brown , alsa-devel@alsa-project.org, Caleb Crome Subject: [alsa-devel] Applied "ASoC: fsl_ssi: Setup AC97 in fsl_ssi_hw_init()" 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: Setup AC97 in fsl_ssi_hw_init() 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 37ac30a4bdc397cf1311111264ac35dc8473e1de Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Mon, 12 Feb 2018 14:03:21 -0800 Subject: [PATCH] ASoC: fsl_ssi: Setup AC97 in fsl_ssi_hw_init() AC97 configures most of registers earlier to start a communication with CODECs in order to successfully initialize CODEC. Currently, _fsl_ssi_set_dai_fmt() and fsl_ssi_setup_ac97() are called to get all SSI registers properly set. Since now the driver has a fsl_ssi_hw_init() to handle all register initial settings, this patch moves those register settings of AC97 to the fsl_ssi_hw_init() as well. Meanwhile it applies _fsl_ssi_set_dai_fmt() call to AC97 only since other formats would be configured via normal set_dai_fmt() directly. This patch also adds fsl_ssi_hw_clean() to cleanup control bits for AC97 in the platform remote() function. 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 | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 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 36f3d51c5c43..dfb0da3cedda 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -987,9 +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); - if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97) - fsl_ssi_setup_ac97(ssi); - return 0; } @@ -1255,9 +1252,33 @@ static int fsl_ssi_hw_init(struct fsl_ssi *ssi) regmap_update_bits(ssi->regs, REG_SSI_SCR, SSI_SCR_TCH_EN, SSI_SCR_TCH_EN); + /* AC97 should start earlier to communicate with CODECs */ + if (fsl_ssi_is_ac97(ssi)) { + _fsl_ssi_set_dai_fmt(ssi->dev, ssi, ssi->dai_fmt); + fsl_ssi_setup_ac97(ssi); + } + return 0; } +/** + * Clear SSI registers + */ +static void fsl_ssi_hw_clean(struct fsl_ssi *ssi) +{ + /* Disable registers for AC97 */ + if (fsl_ssi_is_ac97(ssi)) { + /* Disable TE and RE bits first */ + regmap_update_bits(ssi->regs, REG_SSI_SCR, + SSI_SCR_TE | SSI_SCR_RE, 0); + /* Disable AC97 mode */ + regmap_write(ssi->regs, REG_SSI_SACNT, 0); + /* Unset WAIT bits */ + regmap_write(ssi->regs, REG_SSI_SOR, 0); + /* Disable SSI -- software reset */ + regmap_update_bits(ssi->regs, REG_SSI_SCR, SSI_SCR_SSIEN, 0); + } +} /** * Make every character in a string lower-case */ @@ -1540,9 +1561,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) } done: - if (ssi->dai_fmt) - _fsl_ssi_set_dai_fmt(dev, ssi, ssi->dai_fmt); - /* Initially configures SSI registers */ fsl_ssi_hw_init(ssi); @@ -1592,6 +1610,9 @@ static int fsl_ssi_remove(struct platform_device *pdev) if (ssi->pdev) platform_device_unregister(ssi->pdev); + /* Clean up SSI registers */ + fsl_ssi_hw_clean(ssi); + if (ssi->soc->imx) fsl_ssi_imx_clean(pdev, ssi);