Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5527440ybi; Tue, 4 Jun 2019 08:00:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwf+LyGmLb8Tp5ZeIlucLYeUH6kTVE4+FlkpynYKPPodqk7mp1Q8jKT8HHwtM60ycnZWLvT X-Received: by 2002:a62:e041:: with SMTP id f62mr13783585pfh.128.1559660455685; Tue, 04 Jun 2019 08:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559660455; cv=none; d=google.com; s=arc-20160816; b=bU39WBRVrKePs9OkwLJyeHN2SgmMEWANuamBFj8wHE9V+EAMWcTII9+D2Ggk0aLJER ClMmd5kpT6AVl87E9MYUYxE2171g2GnXUlXef5haFb3BO5X7U/VwVRjGChjkDWZIjDZG nfYlPa13sTWLSDkQnw2MDm53hLPwKj8CeDa0IswwSGGvvJkQZap7a+QptwG3I1z+EMS2 rEZTA9Rc6MiRA6DpSNI23zDHaokGtaIskJoQ2Z1/9+HLzSpemXqDy6Tb3t4uprAroR0V elyVvV10ow/q4HHLdXdoVsDXMFkMmqE8lC1a5uODVIL+a+UjYoX1xLMMxGPfO0GRS9fA Yx/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=/4bLYTz4FCL+5b2S/FXwjLi4433MjHEE1bCm7iOrEcM=; b=i+6WIxZiC7SfyL89u9OaE6LEExJkKX+qAxQZKVDmt6xwrBmtVEq1PYPLoHLigf+obw SCUjP6QFusD4olPEo6wS671j93e3ICTi12XAGGHKs6N1TBg8xBpuxbjfO2rOhzQrpUZK A5SbvVdVNXcwTgcHnvErO6OhgMEG/hfGve20op4X4PuyDRTq9ivx5C4DW3I6KnpoeSD6 Fs2qV+YEFQ2f2twvvXx45HDb44aA+6FYoR7IQViMUU4yn7sybpJHcq43ef1VKN/xKhj9 qasKjaSc6xEpxKY9T1FyWBRd5EJG14ABB8ltsbLuvoQtfIG07aoJ/lh2aO6vjT1WnCNN c/ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=pdN5QjTx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si2404260pjo.33.2019.06.04.08.00.36; Tue, 04 Jun 2019 08:00:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=pdN5QjTx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727961AbfFDO7M (ORCPT + 99 others); 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