From patchwork Mon Jul 17 14:02:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 107964 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4603104obm; Mon, 17 Jul 2017 07:02:43 -0700 (PDT) X-Received: by 10.99.44.8 with SMTP id s8mr29674035pgs.84.1500300163749; Mon, 17 Jul 2017 07:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500300163; cv=none; d=google.com; s=arc-20160816; b=RzPwfFNRWCxv5nSYONL9GT8SwQbk4DIuQvM01YuoPxN1yl36wLPNQZuq9wbI4Szdfk SFpEcq5HokyTJbshADyBy7Jqsr0ovs0UrqLH0VNdOmz7bnUahRL1CZPmWqkOeYqpkwKu Be8C6kAi7i1lVvMVuHRo0kfPHOJkZIoJdBYIy2RQsY9cWosW1OgYmp4o6oVbAuSvRwpX LiTNGBfeBlkMzMZWQyhMbqU1uCTKDLxgTxcX0ShSUK0TDJX92uFAg9XZYZmQVPrGSxuo qKYQUNGf1HqFylKGfunH1SawFtV3hO6GRFwYICbfMxCf0EX4BupAIYroY9G1YLHQ8TRS 1bmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Z/3NK9f2ybQJH7GK8pzdcSPjSo4Kkv9JDwNzut/Bxhs=; b=k/WHZhMoCT9AlOuljSkOGc5FA6sb1jVuR/T9sJNV1oxCIRNx5GTGBhnnvpdIjM1c9s 2UiLq9kHBq9lkKhRmQNHl0rfkjywIn1d2bSXQbw7t9YbPe/Vmdz8Ibj4tn8sWbiJCovc wTwxJxb8F60z8HECugJi5BtxQQjBTYArmKAxSMsXLdlHF5Ii3PrBIMKzp3pOAiPM3uyf 8qXeFqYgtDOBSy9Cr99Tq/HoY7y3NlTOEjZ0ENDduP+5pstQUtk/MMSWBRyw0klF/8eQ 9eCcfzjB3qpPA9sYKJXIganCulbNIpqGNVKlzyfo9ACEBgRZiXPXDjhLM3TGNupP71VD QAFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=GXf04Wnb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32si13363017pld.1.2017.07.17.07.02.43; Mon, 17 Jul 2017 07:02:43 -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=pass header.i=@linaro.org header.b=GXf04Wnb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbdGQOCk (ORCPT + 25 others); Mon, 17 Jul 2017 10:02:40 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35790 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbdGQOCh (ORCPT ); Mon, 17 Jul 2017 10:02:37 -0400 Received: by mail-it0-f46.google.com with SMTP id v202so50177526itb.0 for ; Mon, 17 Jul 2017 07:02:36 -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=Z/3NK9f2ybQJH7GK8pzdcSPjSo4Kkv9JDwNzut/Bxhs=; b=GXf04WnbWGWRLgioQKAXQN4b2ErYdxVlz75Jg7WH3AHJR0IydB4j7x8Mb55DlOc8zF FFacgeUWUifHu8CNE9Pvm6Rxk/IjwsQH4qDz29txGzcaVndSTZfjqyCsUmnS01WyAcHU dykc/S9RTDqHqYbpEHyRXbjcPV08762eUGpsI= 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=Z/3NK9f2ybQJH7GK8pzdcSPjSo4Kkv9JDwNzut/Bxhs=; b=JgNg3JcLSBi0FQ2hlVmfIrFjDy6gidfnW3KYrqoRB38DMDI5ZUaGHzj2v7anK9piQq bMB1hjvqPTNPpvamAwN6PXjBIricB+SewA9ZNHo9CrqGNW4gOM1c5tbRDpPA3jS7P4op CGfT6sN0PXyatT6oZ9BkxZDFR0iZPteENC7+ar2xP43HK/pn7DAyHWGyv32+bh6VjXYF ZJOt1f5EPDbBUfU2k/GXr3z1gk1t7Fs0njpWUmcXDBbLMzQrt4Sqy89lt52rgf1Q6RUM d/fHux6YQxDHGN3QDthO8rULBBvjROfddlX6bWPM49qMGLxclWS2gcKPxM8lYfrLtyDG 4mRA== X-Gm-Message-State: AIVw1132mp1GGjVgPbrs9CvyB60AV273CeQKxoGpLFgai5S58fSspMPb FNGLak+/wkjY4Alp X-Received: by 10.36.46.19 with SMTP id i19mr5411409ita.124.1500300156101; Mon, 17 Jul 2017 07:02:36 -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 s14sm2709483ita.2.2017.07.17.07.02.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 07:02:35 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Jyri Sarha , Mark Brown , alsa-devel@alsa-project.org Cc: Archit Taneja , Andrzej Hajda , David Airlie , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 1/2] ASoC: hdmi-codec: Allow drivers to restrict sample sizes. Date: Mon, 17 Jul 2017 16:02:26 +0200 Message-Id: <20170717140227.17312-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170717140227.17312-1-srinivas.kandagatla@linaro.org> References: <20170717140227.17312-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/sound/hdmi-codec.h | 1 + sound/soc/codecs/hdmi-codec.c | 3 +++ 2 files changed, 4 insertions(+) -- 2.11.0 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..1ece73f4be92 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -780,6 +780,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 17 14:02:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 107965 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4603331obm; Mon, 17 Jul 2017 07:02:53 -0700 (PDT) X-Received: by 10.84.138.3 with SMTP id 3mr31521138plo.101.1500300173701; Mon, 17 Jul 2017 07:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500300173; cv=none; d=google.com; s=arc-20160816; b=MY3xmiLZPSTXv8+cGd+ofBkZe3BNhTAJzktmrQm5+ewQ+Xf9b/v+azynB2p+OTHvoZ u7orCjnsyDTVu0rbq7MpLIGZoZ4SvKLBzuAa022wLW+8jLBrPbiPvXr8cW7e/5zpI7II 85N+nGib8VeAjLMuQXt4/MvxCuEEe1mur33Vn7hi2aI5/FU4HSYEZb45IHV5Rx5d9iYh aj37arzsOlquhg74ayPFYgGnMjhHcF3ZQFpKnRYrxa0Y8txEsxPRCsfb8eTvNmj0wf4o WNUDZWjAYVZ7Z2zeufjIWmtxCB2bsVa4sp0jZ/VQKurSrFJjDpLD50XLWdknwf73m5tB 4ZPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=dlovniiQGTFRW2WEmt+maiPv3aHzqpbbHTWqk2VTrgI=; b=yaSRtaMvIGHS/D9b87JF3hD64Zm193igwoyizaRub54/hrQ4Y9x+JQ2u5cjWRLjApH q0N2qyFcKnGDXk+1XXTDeAKJuSvQnBQLq/7qKKiUb3PhzNoY4CHn+rB4tnRHtq4WDxXw dewmjtuyqtKaQGBu3Nqck8J0a7lSrSlp10QUA+a1MvHFIC3g24XqZ0DlkQo5vZ1GnWmp ZBmAl29TyfJ6c7a2ZgEuoFSazo8jmkQ60FX9Byw/qwVEjU+PzXal3IEfFCy1Dcf8Uien RsF+9sEMRyNRmsm1g/x8kGWl51YXmEJUGo8BhGN2SLMFp+LLVBgXFoldCwgojEa5zLlq g3NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=h1uaAvQX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32si13363017pld.1.2017.07.17.07.02.53; Mon, 17 Jul 2017 07:02:53 -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=pass header.i=@linaro.org header.b=h1uaAvQX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbdGQOCv (ORCPT + 25 others); Mon, 17 Jul 2017 10:02:51 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:36709 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbdGQOCj (ORCPT ); Mon, 17 Jul 2017 10:02:39 -0400 Received: by mail-it0-f54.google.com with SMTP id a62so4215108itd.1 for ; Mon, 17 Jul 2017 07:02:39 -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=h1uaAvQX1XP/c+PZKqgbCHBKoOJU2ju1oKleRmr+A16kLB3TGB4TF08mzpXIOjUsR6 5Sj477TnvTx4ClF+KNXMRt185+x4rCdi5u7vLoZ/VKaj4skLGy+uOaIPFESUcoLhFPZn 3iu46IkZG7XIdlvSyfaHMeM056n7diVzZR0gk= 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=N8E+1bRUf/gqFQwuoPgqQZM9wegbJoRlvmOQDjgaJsJS/6JKmw4UdNCUufv+x+RV5e ehNSuJ2B4arR0p5yiOb0lkq+WkGdFkYGhUNZYnDPNGZ2M0evLhV3ubbIzIfi86p/ne5s m8k770VXQ94w+lQFmNU2VLk7+nFnhCIyku88FwxDmSnTBh4xmNDqwhfqQrq6iPmhLXE/ s2kC7I4ko58THonQ3xYCP4vNLDBky28qSgFpiqke8159KutQH3+9Lr131Y9ywM7Ggl3Y AkPy6993BWCaTnxs6iogEiaoD7g0CMpg/QNa7jypedgZW+laEVLnshcZN00wqMw82557 cKRA== X-Gm-Message-State: AIVw113/3f1UqlZpYM0P141G9HGRixZIGVq11aoEvP1SCawJv8qMzMkT dHucx9LqXX48+XS1 X-Received: by 10.36.80.201 with SMTP id m192mr5347326itb.31.1500300158489; Mon, 17 Jul 2017 07:02:38 -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 s14sm2709483ita.2.2017.07.17.07.02.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 07:02:38 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Jyri Sarha , Mark Brown , alsa-devel@alsa-project.org Cc: Archit Taneja , Andrzej Hajda , David Airlie , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 2/2] drm/bridge: adv7511: restrict audio sample sizes Date: Mon, 17 Jul 2017 16:02:27 +0200 Message-Id: <20170717140227.17312-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170717140227.17312-1-srinivas.kandagatla@linaro.org> References: <20170717140227.17312-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.11.0 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)