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: 109074 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp756029qge; Mon, 31 Jul 2017 15:49:57 -0700 (PDT) X-Received: by 10.98.63.83 with SMTP id m80mr16856429pfa.161.1501541397405; Mon, 31 Jul 2017 15:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501541397; cv=none; d=google.com; s=arc-20160816; b=xvqaF88QfCXTZH7utyhdkw9abaXxGC0T62GSC3HVsYtb17z35DUy7Pt3gR8q+Pevoz qUfJmAxuDaogt6aMV0hWsKSVxnS1IEgxir7ycwbCi7/9D24Ixw3jcLMTRrEdFS+7L/iu 2VbEd6jhqf6bJCyRHYRvONSQmbgXw6s+j/AG05mjilD/sN/tAgXShzMjOOHLo358E4wj BNYJP97oSOsDEZFoWEsiXerwiFf6/43yFdTm5vkgRdXj8pFWIFEj/iNU9YzmnK8taosZ gk5ZSUCMeBXPv4UmQ92dWDHeTanekRScTJ9bdFwlCba+CytX6753vsQAAbGpPhplWTq6 lZ2w== 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:cc:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=+fYZzpmmEkI0c34ynQDx6Z6xIVutipsxGTmP2bl8d20=; b=NQoXwdPl88pkm05a3fXVKuXlbXp8W2kn4i6SY4mtYoH6NiPPsnFEkNh1Ikhib9luH5 09THCZ8AE8a/A7Sd8+QhD8xX+WYGAeIaXmyUqWkeKqi7H0iP+CWMAdFGSE8MZkFQbjFk RovzE/v4DNf4p8rn3HWbEdb5imHbRsXI18JLnvwuhN6yHFJ8RjVAbb7w1axpfrAxqOWr HzmHtjCH3Iz5g/vaD6xQ6+8Y0kTz2n2ERBrZLrEwpfMGs49rD6jldCYj0OeGvbScypyh NEh5LtxttiBp2jhz4rWB4T+prP+LmJ0MzXlNljU2labd/mfMKkFb2otnUSZw21VWD+/K pvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=MhzL/pta; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f3si18089101plb.850.2017.07.31.15.49.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 15:49:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=MhzL/pta; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 278C86E8F6; Mon, 31 Jul 2017 22:49:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9466B6E8F6 for ; Mon, 31 Jul 2017 22:49:54 +0000 (UTC) Received: by mail-io0-x22b.google.com with SMTP id j32so1781600iod.0 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=pfruRUDPclCONFqJMLePBvNgOsZ7I9sHGdnVBh6WQyhATEGEZgxEnKM27eEZE/eX4g hibWQnHwWJ/COeZYzMgwmxA90OUEnHAPvHBf1T0aJGFSJxUelXSz2mDo9QPHoD7oxQ63 pDIAqIxrdPxuscHRD+kwmcmUHNjCd0Bn4C8m910zONavaI2dygkQyhooqf+PCrjgayy9 uyJ8UPp458512cR4tMQKmXqqTajpLipy7DBnzPHm7ovcVUKH6P6kKjWAHlqJoSHMoRg+ Ge3hk+9avIerTrGbWrKpxpQG208u8ktfDNqJRt6ehK/YQLFhPjI9yd/uO1FfI0jqZhES VWhg== X-Gm-Message-State: AIVw112lu1mrOflmSJkJZ497CxbKA7U3q3YO12tBtLMwgE4IJTXBaX5I 35KenHGo9b2+1Tv6 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 Subject: [PATCH v2 1/2] ASoC: hdmi-codec: Allow drivers to restrict sample sizes. 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: linux-kernel@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Takashi Iwai , Srinivas Kandagatla , Jaroslav Kysela X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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++; } From patchwork Mon Jul 31 22:49:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 109075 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp756091qge; Mon, 31 Jul 2017 15:50:01 -0700 (PDT) X-Received: by 10.99.124.86 with SMTP id l22mr16621752pgn.344.1501541401201; Mon, 31 Jul 2017 15:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501541401; cv=none; d=google.com; s=arc-20160816; b=RAXWzT7GdMnVxwPeuGH3vBsOnUR3DXrFbFYLMKewLFZEk6x3hhMUU+lI2K/mMFFaQA FP2mrQ6FIJvYxC9qcdXlmj+EItVILYkZ2hdHApQcyJvyZJ4uXdI44jH21DQduzGldYl7 feLn6Mgr2rETvi20z6Jzxh4Z+TDIZpT4h+5tCZEcdAV0G8hPPUWqWAsVlgicJx8T9duF +IldWJip9dql6XCPHhakhOadi6Ot+2X7TW1G/ip1E+82CAAIIGVBQm2VKbMGJcQyADjQ Mseb87F0OBw5nyWYTX0nOtUp3Zlt0rAmoOf6BWlvrRYJaqwPQBVmfR3M3D3RhGX0rBE4 TBTQ== 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:cc:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=AGDmibMN8v2lVFPBXXR6DV7v8+RNtLU7MxUy4CBwLKU=; b=mYLH0OantG+8tvwI1tMsKJEQaqDdTgT3FpXFJas9C8CwBvj51EfxvBBuBe/QsmQwea ws0kxIuTRmSqAYtBGNiun1Wnot6H6MlPKh92gTN86kOMNx9ZpqHqYTvwVMY0LapPeVgj v32zwlj5v1CbwJn042DB2nt4KX5KW+PL9z1lH95L05lkUDXMmjpF31mjsiUvdoeCtY6d D0NIZAsEamW4h8uIyID3JDuB4lqIzUY4vinT8jqTzmFSm10gnTvhljioIxqhFpC+MTnw riPDVTN2HeSD+k511jK7fTwDO/yUOJDIvCO+9hyyhXFTdAWAvwRxRIk/xGVz+Dt+SEKi 1v7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=cXnIwjvo; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id w62si16108089pgd.208.2017.07.31.15.50.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 15:50:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=cXnIwjvo; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5068B6E8FC; Mon, 31 Jul 2017 22:50:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) by gabe.freedesktop.org (Postfix) with ESMTPS id D9A356E8FA for ; Mon, 31 Jul 2017 22:49:56 +0000 (UTC) Received: by mail-it0-x234.google.com with SMTP id v127so2439625itd.0 for ; Mon, 31 Jul 2017 15:49:56 -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=dlovniiQGTFRW2WEmt+maiPv3aHzqpbbHTWqk2VTrgI=; b=cXnIwjvo4teH0eb/+hPqgPUvwhbuMdeEvia9AhOQiX/PJ5vX5ixW5fkcb9a+C+rRIh waHzOP5kif8EQ5ZA2V/XblOgFyaqCbc7hXnFQIRkbE02EnAdbML8nfq9EKO3nV+kcNHQ pYX7r6/07ENerHIcMQZfvCsseYgDWMsLczthE= 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=dlovniiQGTFRW2WEmt+maiPv3aHzqpbbHTWqk2VTrgI=; b=mW19qE6/MlP/Fsv4DnXt631yww4rjmtT9mXxS2w5lHHN2NV8K4jmMbO/UxitXOc88v HFq3s+JuAqUgBzfw80d3ZOhmfxyhOV3ea1mnms3oYKVc5HKHDJL69gv/oMw6GhL+wgtm Tx9LBG0tDYbr1iZCZ0PEGtWafLxhihcrTOCC/y0cdXQNBTmrISzTsls9oefL4bredSVi 2awRelx2Nj3KRGyciXUEnEs7bD2rspSRmn3O/BQdCybqlAi69+eCkuwWM5ik/ofQUiFs lSxrisfKsV1Z5+cXjXVOyHbYFxSv8uN7tIR8+76pqynai0WxA3RvGypXQjTUiKnekcIu 8RYg== X-Gm-Message-State: AIVw1139d6HvPj0ZUiYSMVEf52HzjpboUwZsd3LPV7z7GMCg+h0iTZyn cm7pCpwRxV+BCvgq X-Received: by 10.36.213.4 with SMTP id a4mr20243200itg.127.1501541396089; Mon, 31 Jul 2017 15:49:56 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 15:49:55 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Jyri Sarha , Mark Brown , alsa-devel@alsa-project.org Subject: [PATCH v2 2/2] drm/bridge: adv7511: restrict audio sample sizes Date: Tue, 1 Aug 2017 00:49:44 +0200 Message-Id: <20170731224944.9986-3-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: linux-kernel@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Takashi Iwai , Srinivas Kandagatla , Jaroslav Kysela X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Srinivas Kandagatla ADV7533 only supports audio samples word width from 16-24 bits. This patch restricts the audio sample sizes to the supported ones, so that sound card does not report wrong list of supported hwparms. Without this patch aplay would fail when playing a 32 bit audio. Signed-off-by: Srinivas Kandagatla --- drivers/gpu/drm/bridge/adv7511/adv7511_audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c index 67469c26bae8..d01d0aa0eef7 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c @@ -214,6 +214,8 @@ static struct hdmi_codec_pdata codec_data = { .ops = &adv7511_codec_ops, .max_i2s_channels = 2, .i2s = 1, + .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | + SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE), }; int adv7511_audio_init(struct device *dev, struct adv7511 *adv7511)