Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2564132pxk; Sun, 27 Sep 2020 12:31:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Rs5wHr23lsnv0JMc7nQA5iP+L7qWKAZuLs0jHDluxtMCm50cgYTcXH0BBUXTBHMqmpWB X-Received: by 2002:a50:d64f:: with SMTP id c15mr12184102edj.248.1601235061392; Sun, 27 Sep 2020 12:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601235061; cv=none; d=google.com; s=arc-20160816; b=ZjOz/gGCzL5nPUIal9IZMowEws2Rlhl0mSOLEKPcW3FlJeErXMP+liASze7JSnt1VL te37410Mg8ZnEOpGoJBq1nfSisQ1KrxV52zPS0iXGhXS/IYZgmNJaqlOcVQmoL+GuqLW V32xzqWnlqJ68WIiXQ7+SuScHzyIjGUuUxLvQosJsSFmwQ1MfzC0egxfkq6AwYOaI7jM RpP9WaRBGW8AKVPn/opSkYXkjxGRc7epono+DBJO6f0bxTs3aZY4hf7MzSH9umBSt9AY GbvbNvDkFKLO6YpoEGNZT7tqX8G1F/0Vg/G0uNr0nIYaPMZSphvsL0xdqVdKU1/UzITS xXjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JlxXAFB85DXviVVzU9snS3b51VMvFbEM+bK6288hNSg=; b=MTG8bGqoM4P5YgZhnzlLbNlT6Om5GNmQ9xxtn7HfW0e/GFf15oSt02YvlMy3IEitkY 77FCe2B+QHVJdHH9uMOO/4amF4zAUGkuAasc8+Xum/4/0cihgSyAUe7fG3/IvP9ZnfxP iWxHC7/yoHrFL9fPd1Ls66k6qeT7Boxh6JZtILXeb/bqt2rrRBgnLH47UEw1GSQCscuS BfBW95S32ACaQHetHWj+LeGLh4q+I0lM1d2tUCc5UokigNHoxaeFLSM9JOk/VNL5N3l8 cGg9IbsWSQfWmiioC7n/BkxvH1YT5ZCMVu0nqx5VpBTcpyIc7kReF6TgqC+F2AlaJjlG zqqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LLJ61lga; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si6364105edv.391.2020.09.27.12.30.38; Sun, 27 Sep 2020 12:31:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LLJ61lga; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726578AbgI0T3c (ORCPT + 99 others); Sun, 27 Sep 2020 15:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbgI0T30 (ORCPT ); Sun, 27 Sep 2020 15:29:26 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D0A5C0613CE; Sun, 27 Sep 2020 12:29:26 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id e2so4633507wme.1; Sun, 27 Sep 2020 12:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JlxXAFB85DXviVVzU9snS3b51VMvFbEM+bK6288hNSg=; b=LLJ61lgaZTOMqpVlNPKwbccLGS/qKNP3TcbScbdHfhnJ57en1huY00FJx1oxE1n3LB 124K55B/1sRjka5yKE1J3I6Bx58rgfrPkKft9px1ggdQiNp1KYYH6mcOoSr13ZFI1Me8 NjNsx91mcPoB3s1koIWgwyg1jI2nX46eb+A383oA79ZuafsEv3KxKDGB2Ft5n5y52kAT Vbp7+spDWmRGv7zWxrdI8KJRymtbX6OF4cFQwwwBi8Xt2siPVqkJQMMR9LyGgf99g+eW bPaIaLUKmrj2trNfxDerkD8x9CzfwYQBI2WDsaE5rzUWF/QHzUTnHkJmu3/ybWAPMx5l piRg== 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=JlxXAFB85DXviVVzU9snS3b51VMvFbEM+bK6288hNSg=; b=K1248n8MUKA08mMfjcy/wKYVDUZLS1+0T3qiKvkzEKLJbQqrVpLhSE0ltG/1Z/1TPi 4Iziq90zcPR/XqCRSnEj6ovOaZ5MRDLyD4dOAIo7jDfBklU7MTytMFcFLBBLPVLCrIxo DBlJEs3o4dL2jpdIf1GTblIa/apP33tXwucJePdmpYqhn2uzmuctGgGEaD6Y5bNx0TDy i51O2kE5lAOE+eJhwGSwj7oKsujvSqcWRoWIOSF7eczBlWYV2c+cFlmlrzwNUMDqoWt+ sllK11bLU9SLfpmaxsybXKaaR0ujeiYyR4t3wrYYhtcJYnFPpWklQIz7dyAfNE40hEWL gAfA== X-Gm-Message-State: AOAM533SazOs/JrKX7c2I+cggI2tmkIqfujZlN8w6sZhgESGASKJjlHD MthuS0F7530Rc8H/Yg/CyxU= X-Received: by 2002:a1c:e046:: with SMTP id x67mr7969163wmg.35.1601234964796; Sun, 27 Sep 2020 12:29:24 -0700 (PDT) Received: from clement-Latitude-7490.numericable.fr (213-245-241-245.rev.numericable.fr. [213.245.241.245]) by smtp.gmail.com with ESMTPSA id n21sm6149609wmi.21.2020.09.27.12.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2020 12:29:24 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Subject: [PATCH v5 06/20] ASoc: sun4i-i2s: Add 20 and 24 bit support Date: Sun, 27 Sep 2020 21:28:58 +0200 Message-Id: <20200927192912.46323-7-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200927192912.46323-1-peron.clem@gmail.com> References: <20200927192912.46323-1-peron.clem@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcus Cooper Extend the functionality of the driver to include support of 20 and 24 bits per sample. Signed-off-by: Marcus Cooper Signed-off-by: Clément Péron Acked-by: Maxime Ripard --- sound/soc/sunxi/sun4i-i2s.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index b31454eee43c..60b2fec1bbe9 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -590,6 +590,9 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, case 16: width = DMA_SLAVE_BUSWIDTH_2_BYTES; break; + case 32: + width = DMA_SLAVE_BUSWIDTH_4_BYTES; + break; default: dev_err(dai->dev, "Unsupported physical sample width: %d\n", params_physical_width(params)); @@ -1071,6 +1074,10 @@ static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai) return 0; } +#define SUN4I_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S20_LE | \ + SNDRV_PCM_FMTBIT_S24_LE) + static struct snd_soc_dai_driver sun4i_i2s_dai = { .probe = sun4i_i2s_dai_probe, .capture = { @@ -1078,14 +1085,14 @@ static struct snd_soc_dai_driver sun4i_i2s_dai = { .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SUN4I_FORMATS, }, .playback = { .stream_name = "Playback", .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SUN4I_FORMATS, }, .ops = &sun4i_i2s_dai_ops, .symmetric_rates = 1, -- 2.25.1