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=-12.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH 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 2EE23C282CE for ; Tue, 4 Jun 2019 14:59:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 093D224AB7 for ; Tue, 4 Jun 2019 14:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559660353; bh=iUJ2WlwLAyuZXKgzDUj9gpNtBxyIwuLd2lBtChZk3iE=; h=From:To:Cc:Subject:In-Reply-To:Date:List-ID:From; b=XW8QwBd4I7o3ChkQQGRMSNA5QCavRO1vk5OAfHE2ntq3UVGYpbcktfQC7hqKEzirS II8GspfStVZDJBoZ27B8OKIENx9U1nuyJ4WXDx8vygPFP6UA2JXtxsvQgVeAaTpUkd 5+LlLcUpb4x63UABxPk1vhnlO17hrzrlC+gVFNA4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbfFDO7M (ORCPT ); Tue, 4 Jun 2019 10:59:12 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:48738 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727900AbfFDO7J (ORCPT ); Tue, 4 Jun 2019 10:59:09 -0400 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=/4bLYTz4FCL+5b2S/FXwjLi4433MjHEE1bCm7iOrEcM=; b=pdN5QjTxRGyP NKhdHnw581ytBzis1BuVcwgAoY46ggvS+ljEpSD/rtjcZNzNmfhxHtDMwJed6BvHoXJeO1PhA3DG0 amtlxEwYMw0uqtmp3u/oAelhrbKgJhSE/2pDBiQu0iBXVnc+bf8t5EEKIeX5rwwIomZvJUf8AL92L IxUSo=; Received: from [2001:470:1f1d:6b5:7e7a:91ff:fede:4a45] (helo=finisterre.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hYAtu-0006EO-LR; Tue, 04 Jun 2019 14:58:58 +0000 Received: by finisterre.sirena.org.uk (Postfix, from userid 1000) id 1D7AA440046; Tue, 4 Jun 2019 15:58:58 +0100 (BST) From: Mark Brown To: Yu-Hsuan Hsu Cc: alsa-devel@alsa-project.org, cychiang@chromium.org, dgreid@chromium.org, Jaroslav Kysela , Jon Hunter , Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Pierre-Louis Bossart , Takashi Iwai Subject: Applied "ASoC: max98090: remove 24-bit format support if RJ is 0" to the asoc tree In-Reply-To: <20190604104909.112984-1-yuhsuan@chromium.org> X-Patchwork-Hint: ignore Message-Id: <20190604145858.1D7AA440046@finisterre.sirena.org.uk> Date: Tue, 4 Jun 2019 15:58:58 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: max98090: remove 24-bit format support if RJ is 0 has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2 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 5628c8979642a076f91ee86c3bae5ad251639af0 Mon Sep 17 00:00:00 2001 From: Yu-Hsuan Hsu Date: Tue, 4 Jun 2019 18:49:09 +0800 Subject: [PATCH] ASoC: max98090: remove 24-bit format support if RJ is 0 The supported formats are S16_LE and S24_LE now. However, by datasheet of max98090, S24_LE is only supported when it is in the right justified mode. We should remove 24-bit format if it is not in that mode to avoid triggering error. Signed-off-by: Yu-Hsuan Hsu Signed-off-by: Mark Brown --- sound/soc/codecs/max98090.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 7619ea31ab50..ada8c25e643d 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -1909,6 +1909,21 @@ static int max98090_configure_dmic(struct max98090_priv *max98090, return 0; } +static int max98090_dai_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct snd_soc_component *component = dai->component; + struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component); + unsigned int fmt = max98090->dai_fmt; + + /* Remove 24-bit format support if it is not in right justified mode. */ + if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_RIGHT_J) { + substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; + snd_pcm_hw_constraint_msbits(substream->runtime, 0, 16, 16); + } + return 0; +} + static int max98090_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -2316,6 +2331,7 @@ EXPORT_SYMBOL_GPL(max98090_mic_detect); #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) static const struct snd_soc_dai_ops max98090_dai_ops = { + .startup = max98090_dai_startup, .set_sysclk = max98090_dai_set_sysclk, .set_fmt = max98090_dai_set_fmt, .set_tdm_slot = max98090_set_tdm_slot, -- 2.20.1