Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp612181pxx; Mon, 26 Oct 2020 16:53:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiUbMhrZnwk8mQM/kHIGIsRsTWszMMv8NxVyQ+ueN73r6SSRTWTqxwAApbrZH06DD3GjOJ X-Received: by 2002:a50:950e:: with SMTP id u14mr18112950eda.260.1603756400533; Mon, 26 Oct 2020 16:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603756400; cv=none; d=google.com; s=arc-20160816; b=cDVDyveqyCs3QpDGsL3vFVHRINugTMVOOz9/c3svDcajQaBnEnLAomLVcO/ZGHtG0S hL8xTf7KUkZDeZdI2g63Ir+ZFAfaHUw4/a2G98G2p7lleq+RIRJ9XeROyESnZosZ04NU KrTuESuXNDdkJJyhXp+VuuoKZaQu+LEq/7MuSh+/t/E5d5ZT0lr+i3+kWRlq7ONRg5eM CPMru6E2Ja2PsTOVzmRL/TB/ZGBktyqp/KNG4YIj7RFU/y8uOyX/1z7+cSScXEawDp7t n94Ghvu5jcYRXaCVMDHSDA3xFBRPg4kkbffpBnvTkA7mcWxIdBImg5V+1W4x4bIVQCDv 05YA== 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=djM7OyfVgD6rWaDQbsh+ExufRJOlpqGGlwiwTkQsm9s=; b=iLOIGZmwsmjzRRmJzjwohZv0aEPic8SYHn6l69XTdgxVEWNtKH8Cwjep5uS21s+DXa Zs+CsV5OIZAPkFBAtzIQNTzGEFjtQm0CJoFpqkXhUskmfZi9QH2q5zn2y03WczlS/+Qx hrJayp7N4I+jdxGyAt/HfmieKMIwxiXt1BE6nPVgGlGpPj/XO+yQP22OcNZHjg3vYWkl NrWD59++BqDMSR949+KYN/9jSHdc4zdTcDK7mPOt/c1Pt2RprKl3KKYJcmJDrAcm2VHo m4y/ID/DXjIq1FMFL1uabjhAFJpLAw05yODjHXREkaOKJinJgy3KjBPGwQZAij68cp18 w+Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XPITp7Mn; 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 g16si8197135ejk.300.2020.10.26.16.52.58; Mon, 26 Oct 2020 16:53:20 -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=XPITp7Mn; 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 S1790537AbgJZSw5 (ORCPT + 99 others); Mon, 26 Oct 2020 14:52:57 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45771 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790504AbgJZSww (ORCPT ); Mon, 26 Oct 2020 14:52:52 -0400 Received: by mail-wr1-f66.google.com with SMTP id e17so13877424wru.12; Mon, 26 Oct 2020 11:52:49 -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=djM7OyfVgD6rWaDQbsh+ExufRJOlpqGGlwiwTkQsm9s=; b=XPITp7Mn/F7ykF8dNJcHLgRgIoXgXlp/x/xHlDBwv4gzqpHQZIFPutG/5sI+OJlIMK fiWQqhIt68mai1qt8GzW8z4MKvGRb/YwhrU7cNjkfYjUC2FC1w5FcqiGb4dZaOxoJc6V inp2DbSQjsd7THaT8b9AgiVKvxbb49QaM3wMvOHA2/NMV0UhRh3XBgul+DBqbINOPjHh nDaOr+s1DRoERDgX/yXQRF8q6811drP5IHIstzDRneRb9RfqbltzeNt7O0Fr+fxUHwEN BHzcVtIxco2ocKBM6Ljsd79OSMLetjsLJdcVxKYy5H+YvH6+ZE0WRxG88hKVPyPW2FfI /OjA== 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=djM7OyfVgD6rWaDQbsh+ExufRJOlpqGGlwiwTkQsm9s=; b=Xo0ObsbhQKG3awuj9NQ9m5X6lv1KoxmemCwZuYRn6ODjzdZzK7wCd5Bt/HbfkHYFqh jv4xS6Ev49bSQkQoGHzl0rbOs8e0ruvzrRZdnSqVCwBjstEFyHvYkIzWeYnUi7yXVj8v rwy56bigBs1DzHIvSTwEszDslLLL+oFWZtFo/U7VChttBc6PDZ1Jbx632cX7kjOV6YKY +3DmFYnZEGN45YG9Ejji+Hk8xqEE13NxtX+nK4IHefSO0xNKst0ZZ4aew5Ei/VOECGBg E0wrTxVOPNAUxArr6kSdsnBTjOR2zt2slkmuVOD3QtLRbDbuKwsR6Xu01gt+rRvK5Z/9 5e4g== X-Gm-Message-State: AOAM533WdVRW9ZMgQZRViV6zyCejoA4PPN8V4dNm5OCHelFNd452Oc6D 57ZANcDV+4U4AdhFSSbXPug= X-Received: by 2002:adf:f20e:: with SMTP id p14mr455926wro.376.1603738368761; Mon, 26 Oct 2020 11:52:48 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id f7sm24885193wrx.64.2020.10.26.11.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 11:52:47 -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 v8 05/14] ASoc: sun4i-i2s: Add 20 and 24 bit support Date: Mon, 26 Oct 2020 19:52:30 +0100 Message-Id: <20201026185239.379417-6-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026185239.379417-1-peron.clem@gmail.com> References: <20201026185239.379417-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 Acked-by: Maxime Ripard Reviewed-by: Chen-Yu Tsai Signed-off-by: Clément Péron --- 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 beaca56a44ae..eee1e64cd8f4 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -599,6 +599,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)); @@ -1080,6 +1083,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 = { @@ -1087,14 +1094,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