From patchwork Sat Feb 4 12:18:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9555627 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 95C22602B7 for ; Sat, 4 Feb 2017 12:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FA152723E for ; Sat, 4 Feb 2017 12:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73D95283F6; Sat, 4 Feb 2017 12:20:42 +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.9 required=2.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 29D392723E for ; Sat, 4 Feb 2017 12:20:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZzKb-0007qE-H2; Sat, 04 Feb 2017 12:20:41 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZzKa-0007pv-0q for linux-rockchip@bombadil.infradead.org; Sat, 04 Feb 2017 12:20:40 +0000 Received: from mezzanine.sirena.org.uk ([2400:8900::f03c:91ff:fedb:4f4]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZzKW-0003UZ-NI for linux-rockchip@lists.infradead.org; Sat, 04 Feb 2017 12:20:38 +0000 Received: from [2001:67c:1810:f051:e387:5dab:49ba:da3] (helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cZzIb-0003dy-2v; Sat, 04 Feb 2017 12:18:39 +0000 Received: from broonie by finisterre with local (Exim 4.89) (envelope-from ) id 1cZzIL-0005TI-2e; Sat, 04 Feb 2017 13:18:21 +0100 From: Mark Brown To: Romain Perier In-Reply-To: <20170124100835.9540-3-romain.perier@collabora.com> Message-Id: Date: Sat, 04 Feb 2017 13:18:21 +0100 X-SA-Exim-Connect-IP: 2001:67c:1810:f051:e387:5dab:49ba:da3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "ASoC: es8328: Add support for slave mode" to the asoc tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure X-Bad-Reply: In-Reply-To but no 'Re:' in Subject. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170204_122037_021037_90523248 X-CRM114-Status: GOOD ( 19.86 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Heiko Stuebner , Pawel Moll , Ian Campbell , Takashi Iwai , Rob Herring , Liam Girdwood , linux-rockchip@lists.infradead.org, Sjoerd Simons , Mark Brown , Kumar Gala , Jaroslav Kysela MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: es8328: Add support for slave mode has been applied to the asoc tree at git://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 b9b044e2967dd47f0ffe98b5a989fc99c684f6d2 Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Fri, 3 Feb 2017 15:37:57 +0100 Subject: [PATCH] ASoC: es8328: Add support for slave mode Currently, the function that changes the DAI format only supports master mode. Trying to use a slave mode exits the function with -EINVAL and leave the codec misconfigured. This commits adds support for enabling the slave mode. Signed-off-by: Romain Perier Signed-off-by: Mark Brown --- sound/soc/codecs/es8328.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index 37722194b107..3f84fbd071e2 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -589,9 +589,21 @@ static int es8328_set_dai_fmt(struct snd_soc_dai *codec_dai, u8 dac_mode = 0; u8 adc_mode = 0; - /* set master/slave audio interface */ - if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBM_CFM) + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { + case SND_SOC_DAIFMT_CBM_CFM: + /* Master serial port mode, with BCLK generated automatically */ + snd_soc_update_bits(codec, ES8328_MASTERMODE, + ES8328_MASTERMODE_MSC, + ES8328_MASTERMODE_MSC); + break; + case SND_SOC_DAIFMT_CBS_CFS: + /* Slave serial port mode */ + snd_soc_update_bits(codec, ES8328_MASTERMODE, + ES8328_MASTERMODE_MSC, 0); + break; + default: return -EINVAL; + } /* interface format */ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { @@ -620,10 +632,6 @@ static int es8328_set_dai_fmt(struct snd_soc_dai *codec_dai, snd_soc_update_bits(codec, ES8328_ADCCONTROL4, ES8328_ADCCONTROL4_ADCFORMAT_MASK, adc_mode); - /* Master serial port mode, with BCLK generated automatically */ - snd_soc_update_bits(codec, ES8328_MASTERMODE, - ES8328_MASTERMODE_MSC, ES8328_MASTERMODE_MSC); - return 0; }