From patchwork Mon Jul 31 22:49:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 9873235 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 4402D6037D for ; Mon, 31 Jul 2017 22:50:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3129328564 for ; Mon, 31 Jul 2017 22:50:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25D9A285DE; Mon, 31 Jul 2017 22:50:22 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53FD528564 for ; Mon, 31 Jul 2017 22:50:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5FE46266FEA; Tue, 1 Aug 2017 00:50:01 +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 A6B55266FEA; Tue, 1 Aug 2017 00:49:58 +0200 (CEST) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) by alsa0.perex.cz (Postfix) with ESMTP id C1CD3266BF5 for ; Tue, 1 Aug 2017 00:49:54 +0200 (CEST) Received: by mail-io0-f178.google.com with SMTP id g13so1650096ioj.5 for ; Mon, 31 Jul 2017 15:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YM6+umIHmcGgTZ6J5SAyeV0xYuWAuZt6Pmde/sbFtQI=; b=MhzL/pta9/GBtR+iRhPdQ/vH2ijf7+NHGsquyHDv71beIUVX6aUWWY60//6rcpD7Ay e0kgWIkG09FbrJW7FvWvGrrgcneXrDlJ5Q6IlAvlUBUbmMWsfIx7OFJIOaaCPfLBMdIJ lHwmR+Ar1mPV5JYk/KJrlJveJEWVCH62XAR6g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YM6+umIHmcGgTZ6J5SAyeV0xYuWAuZt6Pmde/sbFtQI=; b=XSfdYpOLsOxdby7FylBPsw3I+nfoUQHQXLcXrFG1pdpNWnkVUIL5mSQ5UdjFt5EXHS Ua6m7rPQDJIeF+uIXPn6h1rn2IP9GiLQqSTtajQM1iun3LlsjaIfRj8bN+iQtkogX0+h HoFa3paFy+CBHQzVp6m1eJd5Li3sfdM++44yHoQlR7FCtv+yhgoHgEux0z7iDH20uqde bAX1rRFUDIrQxn0lU/vRdaZLx9N+dt4nOvmU/J6sOUDpOmQlUnq0PxKCnhkIiFP3w8nD xMz6IOYUQ1HTWI7kSLBJTeU/wdQ1YYdd4wUcYTr3WDrwPA2EzVe4JkGLi/Kb4CYV/0wQ ZzCQ== X-Gm-Message-State: AIVw111f6c5BXQWy77mVlRoQBJKoKtZAgJs7Zz4hj+3k+QGaJjc/0UTV iTIO1tIb6NYpcH2h X-Received: by 10.107.154.143 with SMTP id c137mr20003721ioe.174.1501541393649; Mon, 31 Jul 2017 15:49:53 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id l197sm5988574itl.15.2017.07.31.15.49.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 15:49:53 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Jyri Sarha , Mark Brown , alsa-devel@alsa-project.org Date: Tue, 1 Aug 2017 00:49:43 +0200 Message-Id: <20170731224944.9986-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170731224944.9986-1-srinivas.kandagatla@linaro.org> References: <20170731224944.9986-1-srinivas.kandagatla@linaro.org> Cc: Archit Taneja , David Airlie , linux-kernel@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Takashi Iwai , Andrzej Hajda , Srinivas Kandagatla Subject: [alsa-devel] [PATCH v2 1/2] ASoC: hdmi-codec: Allow drivers to restrict sample sizes. 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Srinivas Kandagatla Currently hdmi client drivers does have means to limit the sample sizes that it can only support. Having formats parameter option would solve this. This issue was noticed on DB410c board when adv7511 hdmi codec driver failed to play a 32 bits audio samples, as it does not support them. Signed-off-by: Srinivas Kandagatla Reviewed-by: Jyri Sarha --- include/sound/hdmi-codec.h | 1 + sound/soc/codecs/hdmi-codec.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 9483c55f871b..89fc4cce5785 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -104,6 +104,7 @@ struct hdmi_codec_pdata { uint i2s:1; uint spdif:1; int max_i2s_channels; + u64 formats; void *data; }; diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 22ed0dc88f0a..a7b4d6757ff1 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -653,9 +653,8 @@ static const struct snd_soc_dai_ops hdmi_dai_ops = { * This list is only for formats allowed on the I2S bus. So there is * some formats listed that are not supported by HDMI interface. For * instance allowing the 32-bit formats enables 24-precision with CPU - * DAIs that do not support 24-bit formats. If the extra formats cause - * problems, we should add the video side driver an option to disable - * them. + * DAIs that do not support 24-bit formats. Driver can either use this + * list or specify supported formats in formats field of hdmi_codec_pdata. */ #define I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |\ SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\ @@ -780,6 +779,9 @@ static int hdmi_codec_probe(struct platform_device *pdev) hcp->daidrv[i] = hdmi_i2s_dai; hcp->daidrv[i].playback.channels_max = hcd->max_i2s_channels; + + if (hcd->formats) + hcp->daidrv[i].playback.formats = hcd->formats; i++; }