From patchwork Thu Aug 22 09:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 172020 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp646505ily; Thu, 22 Aug 2019 02:57:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw54VKwkKrcjPBbFRJx8FqY8+7u7k6U7FQlzyEUXP5+cXJWoA1uMxQOMkiBW1t9iHoEUApe X-Received: by 2002:a63:1908:: with SMTP id z8mr32016765pgl.433.1566467865912; Thu, 22 Aug 2019 02:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566467865; cv=none; d=google.com; s=arc-20160816; b=QpTdpWjuux7bJzWtKICjBQnYre3U/Arbufev6IIOZClAdeGYh/fqqQB2b//fJeIuiK dvBZjuWjLObQz0xaVL5tuLfUJNDgBnb5EhH7/u75PO0sz34HcGHnyO/f8aG29zbZIJ6S GSGuNW+MgSXa1PozZ0gtEACfGIgUeqmxcCVnPR/2SOfsd/F/8ZtjTrDJHMMJFV9iEBuK RM3wf2NsJD+Ir/5Wd/8lcuoHUQimpx/dGyVzr5ifodn/kQzD8Zg4GFOGUeXyrwLoo4ds DJYBm1Ry9W4N3ztIWtfb07VLSfek7hIkawZ5thYmGBaIg6rpK6AbpTDp8w1meOogd7zc 5VbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7lEwavhf3fUGzkEL5MEZgCjXL2zMuro3WN6EEJNDNjU=; b=avwLPsqsdLRAdN5THYtFsQGQma/oTmozOlyMlXEMx0hztT39+tz0rNulYN95gFVd6+ Nj9WGf8ahuBzCA4DSw2o+Dy+dSCgJ7+26Hts7fMSCXYQXz+CNEaoRNZpT3Uf+5cagPaj tG86Ah3fInMxATS3SaykKhQ8njL2gqkVjIjR5JfWEYErVlY7b9WFV8G0P8Cdgf6wy6Zo cXGK0xDq6h0rlOzElcWHo/2lvG7TKXqyxmgCit9z+42RApjtrhaWncXlEAMjw2g2Mv97 NissYqjm4uPvdHeEpGYVF7fRDYrPE4QPRN3Mf1cQBpqNKdCjS6eVWYqir65dAVPBKKi5 SOkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KNnlO3AS; 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 t3si17081595plz.101.2019.08.22.02.57.45; Thu, 22 Aug 2019 02:57:45 -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.s=google header.b=KNnlO3AS; 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 S1732531AbfHVJ5e (ORCPT + 28 others); Thu, 22 Aug 2019 05:57:34 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40628 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732403AbfHVJ5b (ORCPT ); Thu, 22 Aug 2019 05:57:31 -0400 Received: by mail-wm1-f68.google.com with SMTP id c5so4903225wmb.5 for ; Thu, 22 Aug 2019 02:57:30 -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 :mime-version:content-transfer-encoding; bh=7lEwavhf3fUGzkEL5MEZgCjXL2zMuro3WN6EEJNDNjU=; b=KNnlO3ASgv4ah2d8gdkaMFHttHgLNVvTnm4UPZ74Eqwfy7YLV+R7o/vIGBjnfyEh9E Xv1tzEw7a0qZuTR4qmbCKAeMqQFEJyk4L2SOdZhCRPcm2dCoG58ReEhEDi5blIeHiiFd VzKuaX13KfllCzPzSn3OiuysWFMb1eZQ9VePTg63dOcHiSVD6LX0OHU6EyaTuK1MaPx3 Fq1QgUzvgl/WKVRERRfykRgAnriXiGyZZPViuba/+Tlcbhv76oHh3cPV1qcdbAYWX27j lcydCzTlT7ABHQBsbCx7if52dsaxPcdMPGkyCSfG9L4xAE8gEzVYW0iXOkFs0llHuKFV XmDA== 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:mime-version:content-transfer-encoding; bh=7lEwavhf3fUGzkEL5MEZgCjXL2zMuro3WN6EEJNDNjU=; b=AnTBsR4eIiGuPY/G1on96jFKwPgb4qgJHZ9sOelyFPYy32u287rNXPQZUA6lkLWlDJ 3ZoWbUfiQn8cKqueMRtOrq+z+iPh5vuKYQWjUgJjaXkNz1VI7T+U2xgbBo6c+SeUU1ho 6OJ25GeJKnUOcEj8UcPn1384D8WyuT+FOqSgdCA+1aScmLUosxZs3tGD1PS+VUv5bWRn XaluyluE5KVq0eDVzOr0MF6xQqlg3rXHGF7jbm4dJhT5boW/ppfIJ0SObRi/oFff0ZB7 5fdKqann/irzYeQC51ZIRHe11Ql9eftmiTpewOIFnhHqxN6JYHZL9PNYThHgWP0pgJI1 3MLw== X-Gm-Message-State: APjAAAVz91OSRde/PmcKwfbl7OJd2G1zrq5PW8Ej3uWRA/s/ftdBvS+x B5dR3afjdOMpY9bmTao/HkwWCrGFlHM= X-Received: by 2002:a1c:4c06:: with SMTP id z6mr5154610wmf.47.1566467849478; Thu, 22 Aug 2019 02:57:29 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id t24sm3298909wmj.14.2019.08.22.02.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 02:57:28 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, tiwai@suse.de Cc: spapothi@codeaurora.org, bgoswami@codeaurora.org, plai@codeaurora.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, Vidyakumar Athota , Srinivas Kandagatla Subject: [PATCH v2 1/4] ALSA: pcm: add support for 352.8KHz and 384KHz sample rate Date: Thu, 22 Aug 2019 10:56:50 +0100 Message-Id: <20190822095653.7200-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190822095653.7200-1-srinivas.kandagatla@linaro.org> References: <20190822095653.7200-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vidyakumar Athota Most of the modern codecs supports 352.8KHz and 384KHz sample rates. Currenlty HW params fails to set 352.8Kz and 384KHz sample rate as these are not in known rates list. Add these new rates to known list to allow them. This patch also adds defines in pcm.h so that drivers can use it. Signed-off-by: Vidyakumar Athota Signed-off-by: Banajit Goswami Signed-off-by: Srinivas Kandagatla --- include/sound/pcm.h | 5 +++++ sound/core/pcm_native.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 1e9bb1c91770..bbe6eb1ff5d2 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -117,6 +117,8 @@ struct snd_pcm_ops { #define SNDRV_PCM_RATE_96000 (1<<10) /* 96000Hz */ #define SNDRV_PCM_RATE_176400 (1<<11) /* 176400Hz */ #define SNDRV_PCM_RATE_192000 (1<<12) /* 192000Hz */ +#define SNDRV_PCM_RATE_352800 (1<<13) /* 352800Hz */ +#define SNDRV_PCM_RATE_384000 (1<<14) /* 384000Hz */ #define SNDRV_PCM_RATE_CONTINUOUS (1<<30) /* continuous range */ #define SNDRV_PCM_RATE_KNOT (1<<31) /* supports more non-continuos rates */ @@ -129,6 +131,9 @@ struct snd_pcm_ops { SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000) #define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\ SNDRV_PCM_RATE_192000) +#define SNDRV_PCM_RATE_8000_384000 (SNDRV_PCM_RATE_8000_192000|\ + SNDRV_PCM_RATE_352800|\ + SNDRV_PCM_RATE_384000) #define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt) #define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8) #define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8) diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 703857aab00f..11e653c8aa0e 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2170,7 +2170,7 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params, static const unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100, - 48000, 64000, 88200, 96000, 176400, 192000 + 48000, 64000, 88200, 96000, 176400, 192000, 352800, 384000 }; const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {