From patchwork Sun Oct 11 20:22:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 284617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B245C433DF for ; Sun, 11 Oct 2020 20:26:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92AC12145D for ; Sun, 11 Oct 2020 20:26:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Pbm7pU6g"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IyS1xQwe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92AC12145D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DA274167D; Sun, 11 Oct 2020 22:25:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DA274167D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602448005; bh=VbaJ/GhQ+7eiMd2/GZRdXWjlLv07LNVYOadz4G8eKEc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pbm7pU6gCIh18kMd8WPNCchZgGnxmGD/ch6mwmk0CnhUynaPGywIh93qouBCol6MC 1NVcKQjFtm6Eu98a430VlZ1mV9Z+nCANhILnZzS6GBuKtRk1jqkJUXnXjOIsCOsyEB mDWbWSBl17RS5QVmksWDcvyCS2XVryrHyGJfUHck= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A7434F8029A; Sun, 11 Oct 2020 22:23:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B60BBF8028E; Sun, 11 Oct 2020 22:22:54 +0200 (CEST) Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 984B4F80260 for ; Sun, 11 Oct 2020 22:22:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 984B4F80260 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IyS1xQwe" Received: by mail-qv1-xf41.google.com with SMTP id t6so3383497qvz.4 for ; Sun, 11 Oct 2020 13:22:48 -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=e5BIP15E2ynXdUuWExU7KSVcEhvg2WEg1hiXXskFWeSqbXP4ItcE4kbG5qfZAljzmq 0SKzEwWCmSHZNK8iF65UZbRbREGuGAi2Uz22L5WbnCloS8WZvmVdDa4AMvASQqt7f5/H GRACPRXop+qujGm3sbKy2F1YvY0Dizk9zSgFNAva9SEShr+GVVC/ck53hPy/Az9QQMU5 mPk//3MYY9nGAiTvzxF+dE2O4J9otnMOQJNgVBW7/pq8CX0G/mIP+v9RAuLIm1JK3cuf lvhaF3xlc7sv9gFGrtiIMtByAHrUuQ+KahzQ4bIRZj9Maf5xb82sczsz5KLP5DMA3Iui 3x1Q== X-Gm-Message-State: AOAM53312RqHdoHl19lrGtnD8pT7lsJYgSRuzcfjc27fDR2oo9Vs5IRa d9Seubez2fKxV1BZZx5uxgM= X-Google-Smtp-Source: ABdhPJx+NO8hs3nQcTr1w1RkQ757q0aA38ZZh4DW7nzWF80tK2zH2HXQsw2IZdsZOYXzR6xqYtxNig== 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?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood 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 Cc: devicetree@vger.kernel.org, Jernej Skrabec , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Marcus Cooper , linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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,