From patchwork Fri Oct 12 17:00:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 148794 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp962222lji; Fri, 12 Oct 2018 10:00:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV60QSPQiIxIiULNaZRhe+Sh4mDp0C71ayBYW5SD0uwQahmyYfKDz+trN5XQk2o3z12rVbE2y X-Received: by 2002:a5d:4409:: with SMTP id z9-v6mr5600589wrq.227.1539363652117; Fri, 12 Oct 2018 10:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539363652; cv=none; d=google.com; s=arc-20160816; b=kktuugcAeCpVKQcTFE2EVi+gBWlRi8rkipt9a4cy7+W86PxCseSWt4yUmmrocaMAYy 46HisNFqeeIiKpP61n37+ucZVbwYb/MK0Zjy1L2QwMT7dheeIzhv2lJC3j3YskA+NH4h sWmFh/fdXlLtK7jUkwQ4w7pbPEtz89QsjW+BdY1YX6BUEBI+ApG/q+qPVZrWjXFKKKlo WfhYSwL+w2RawrJiIOZ3UDqDY6GtY+0oJspDmpPbnTfyp6162953X+zV9Wjqi6V0h1bN ZaZ8cg4dvo+XSuUw1uhISOc6UvUH+tsA4xifj2O8EXYhrkknjO8Jy7P58MmLvZ7EfiAM ewxw== 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; bh=wINlZX0+Kk6eVYihb99W5iFcuUeLJ1SF6ZfwrOr24FI=; b=ps5O6cVNDFVwp7asdwtQQFZkyYe/jzjUZSkhA44wzO3BO5i/MGKsg9fuNLY8xaJgLm v+kh7ztzhz2cGBjblbA0FUlGTtroHlbaIGldLoqv/SD0v3kkNvpAAcRopjNhjMVoIlyz LgWgGtWa5ETZRR6S8lf6dPpoHX02afdI1KCbFSssbqjgEMKTbeRWyjUakXkbsjNKOtNo H6Lg/RecseDtBLblJ57l3q+VObus+mLzxaK33tgajTreVaXwdySW0+cEg9ilsRgnQ7aZ UpI2eQnMdvF2NjUyr0sN3dM+hNmeXBiQI1JguVFG/6pYgfN20ytUTCjKiGicbP2rn0fs 13dA== 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=ta8eVaz7; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id p6-v6si1489830wrj.8.2018.10.12.10.00.51; Fri, 12 Oct 2018 10:00:52 -0700 (PDT) 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=ta8eVaz7; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EE3532679B0; Fri, 12 Oct 2018 19:00:50 +0200 (CEST) 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 DB3C62679B2; Fri, 12 Oct 2018 19:00:47 +0200 (CEST) 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,RCVD_IN_DNSWL_NONE 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 612C22679AF for ; Fri, 12 Oct 2018 19:00:46 +0200 (CEST) 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=Qw3Qhf07D1v3dIbXGD3VfX5zt95YPoww5ZGdWcmU3NY=; b=ta8eVaz7fu+/ whWEeCNehBjfitT74qYMUfGOhvdOpw/iaOZqplcrHwryaVIpXp4ahH0ms7fNAw9Y8ZXc9aHDsteT+ cqO1aObljp1uTfGRL0QX1kC61lSOC1sY5a8KCHkdW2RB9DLiIpbyP8pZxtkWJrNPlZXRDSO20C5x7 wMFr0=; Received: from [91.126.136.150] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gB0nu-0006dy-0c; Fri, 12 Oct 2018 17:00:46 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 88385440078; Fri, 12 Oct 2018 19:00:45 +0200 (CEST) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87pnwfbs5b.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20181012170045.88385440078@finisterre.ee.mobilebroadband> Date: Fri, 12 Oct 2018 19:00:45 +0200 (CEST) Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: pcm3168a: add HW constraint for non RIGHT_J" 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: pcm3168a: add HW constraint for non RIGHT_J 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 3809688980205622f75ed5d5890759430da4e7e4 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 12 Oct 2018 06:31:00 +0000 Subject: [PATCH] ASoC: pcm3168a: add HW constraint for non RIGHT_J RIGHT_J only can handle 16bit data bits. Current driver just errored if user requests non RIGHT_J + 16bit combination. But it is not useful for user. This patch adds HW constraint for it, and avoid error on such situation. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/codecs/pcm3168a.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) -- 2.19.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c index 3356c91f55b0..233a8df5d7a5 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c @@ -476,7 +476,43 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream, return 0; } +static int pcm3168a_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct snd_soc_component *component = dai->component; + struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(component); + bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + unsigned int fmt; + unsigned int sample_min; + + if (tx) + fmt = pcm3168a->dac_fmt; + else + fmt = pcm3168a->adc_fmt; + + /* + * Available Data Bits + * + * RIGHT_J : 24 / 16 + * LEFT_J : 24 + * I2S : 24 + */ + switch (fmt) { + case PCM3168A_FMT_RIGHT_J: + sample_min = 16; + break; + default: + sample_min = 24; + } + + snd_pcm_hw_constraint_minmax(substream->runtime, + SNDRV_PCM_HW_PARAM_SAMPLE_BITS, + sample_min, 32); + + return 0; +} static const struct snd_soc_dai_ops pcm3168a_dac_dai_ops = { + .startup = pcm3168a_startup, .set_fmt = pcm3168a_set_dai_fmt_dac, .set_sysclk = pcm3168a_set_dai_sysclk, .hw_params = pcm3168a_hw_params,