Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3661306pxu; Sun, 11 Oct 2020 19:13:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7KqN1XKO9SCSzMUS+HGJrf79uBFuTXxA5VuBfM96wQzD0VAgfQYIwuRGIcZOc6xHqMJAB X-Received: by 2002:a17:907:33ca:: with SMTP id zk10mr25222837ejb.317.1602468830326; Sun, 11 Oct 2020 19:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602468830; cv=none; d=google.com; s=arc-20160816; b=V3bG+IzDCjyoWxbt1zNqKzr3Te4s0C2L76shvPRG8VhgjxpcCSinlRMsHiwudfOmYV AAjGcT7Pf6FaBRwb4//f/hOypRhBIY3R1tvi9Ngd3ynRjjD1UUYiSIXtBEoUWEOssOMa lHI/yQoDbXMslXFv+OLrEVAUmiBoZAm7lXA91UZvEKm7WGN1nRdk+9r4ynVuCh5x8gwc 9C1Y23aZ1socgti6Pp0hX2qmW1T7pf8KoM0qyzlw5VdvitMvpJU1yF8RQCBEnlnyKW8m oOX1b07DJKbyTpRujk4zV9WVVk3A0fOgrjZVb4zsYj1NuQu/aFURWtoxgC03p3pk/Exc Xn/w== 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=X6foTdNByYaza+7IioC5Au+dQ6O1jD1KqRZFfbjoYWg=; b=h6fycNq72/f+ee7MvjTGzev0GTjbsxm8rNb8ScIY80hqgAfOp5Ph4d6M7jL2vwMImX r23GEmTnxnPAJBsQ6c54ZxqZdU3F/kUBtNvfKupp+vqFXmjgBKGr/JOX2WQCNhI1tKH9 5fguRQx0x3ZvgsO6u4wIEfuz5yFAYMCbMngYTESQnHR5GkQCdfkGUSQa3VamKFWhvAEQ 7VWski03X6m31nw1tBtLwVJ/NbBxhza/uxHEJHzlSYTCbziYokP5cHGvQWvDe1ShXLNZ df4EP+pLtMiPe4njtHk/4IzXZFHvJD+P4mltYT9cYsLBYMzlFc0wg3I5rMYYHBkR9OVg PCQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IyS1xQwe; 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 v19si11158011ejf.257.2020.10.11.19.13.28; Sun, 11 Oct 2020 19:13:50 -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=IyS1xQwe; 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 S1729231AbgJKUWt (ORCPT + 99 others); Sun, 11 Oct 2020 16:22:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729214AbgJKUWr (ORCPT ); Sun, 11 Oct 2020 16:22:47 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69766C0613D0; Sun, 11 Oct 2020 13:22:47 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id y9so3158345qvk.1; Sun, 11 Oct 2020 13:22:47 -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=X6foTdNByYaza+7IioC5Au+dQ6O1jD1KqRZFfbjoYWg=; b=IyS1xQweqtX7I7JqvRg2RP8mWx2QwzjtmI9o5PT8TY3EyXm5m+AhdZV8JyiEnRfj+C SQXu8zpe8zE/rjyALoawdUk2XiW070CIgVf+rojhN9sq2vbPHwPwMCFDfTkKrZxPf0pf FHnN2JVCP3rlT1ZSFjUgDXHZ3kGk7ZfgI9J70NuBV+R7H6orPbErWEGODJFUbdqnPWN5 FjFKLBsRvYbECj/5LjRVLy/7pPAi+nB0Vu1e40h9dBoc/bSke8FSLbbyQuNH3EY5vNJB 9EQjj1Tu24/533R2j0HvHo3yRw8Qka3QAM7j0MbMhWPN+8UwdZkezRz1CzXOPYBAVUva n5tg== 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=X6foTdNByYaza+7IioC5Au+dQ6O1jD1KqRZFfbjoYWg=; b=s5NXwByvHOhitu/TH41y/yCnj/WyyvI4885G0uAW9TtmFMkBCrpcLa0LmdA4xN8o3l qj/B307a6Q9p/20P35ZdjSyjdgF8PVU3Bk5Q0h3l6Kq7l9z7fM26qzLVvvUkioxRUzDw xDcN0dMv54CnJkRkyASx41tPR1LRQGR+PfyQxO4ENSsOTpv8bGq+riDDa3oE9vleHNTD au7plSTyGZxJtxaRTgc+eAWUFFW/Y4CYEDceQe3nB9TE+v/dwLZYCcwHHg1k+ok9tWS6 lUEjMU5oDofyZko9PgnzhrzzcpHpZhEzqbgT2CWbZfP3dnyppZN49pRpwIzzdCNr3jYI VvkQ== X-Gm-Message-State: AOAM530HqGKqDz5tUhT2IiuEaYXFHE3bMSiHFEavTlE6aM8hbjBOLcrN L5V5Q5m+lU7yFLP6nkdjLVA= X-Received: by 2002:a05:6214:153:: with SMTP id x19mr3061824qvs.50.1602447766535; Sun, 11 Oct 2020 13:22:46 -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 c72sm2987778qkg.56.2020.10.11.13.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 13:22:45 -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 v7 05/14] ASoc: sun4i-i2s: Add 20 and 24 bit support Date: Sun, 11 Oct 2020 22:22:15 +0200 Message-Id: <20201011202224.47544-6-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201011202224.47544-1-peron.clem@gmail.com> References: <20201011202224.47544-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 0b242f4615fe..d5eba58ff207 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -592,6 +592,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)); @@ -1073,6 +1076,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 = { @@ -1080,14 +1087,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