From patchwork Wed Oct 14 06:19:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 11836855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C55F614B4 for ; Wed, 14 Oct 2020 06:22:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7E80A2222C for ; Wed, 14 Oct 2020 06:22:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D37XqkcD"; dkim=temperror (0-bit key) header.d=sholland.org header.i=@sholland.org header.b="oAtdAZ/5"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lsB9QQHF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E80A2222C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8TjCOthuvjIsrTazv5KvwPTalRS8T1YlsLslzPb6bVk=; b=D37XqkcDcHMOoyk2DqSRzP2Ce WpuEUh1BG8C0rmchM1wdhJfB1xXc8ymrGmviUWBX6dP6rCev1pMqnmAZhXknAEBq189+HYal12nzV Bsq/a0fK57iwjxFPVcjv77nMe18sfGf/c9oKDLYP8dyY8sUd1zGcA8XyBiWY2XrcijUnptXC5Wvgj NdXfJTlJqIyirFcaYPZMT3r3kMKfgaZaG0+9n80qw9B+ejHAZeqDQCYvhB0BhCrhQyGUKJ8EeIvlU jn3qhGKmpJHL/8Tdp4M3Io6zuB5qAHWM/QaMG17tUBP781Wbz7B/XGTohpXATwyWs87EqY80ZMKwG G7g1GkP/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSaAm-0003qB-6S; Wed, 14 Oct 2020 06:22:04 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSa8i-00030f-NR for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 06:20:05 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id A5395CDC; Wed, 14 Oct 2020 02:19:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 14 Oct 2020 02:19:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Uq+D08HxvzTG1 9wqye1HARI/n17MUW30E0i8Uib4oD0=; b=oAtdAZ/5FWXOneoaI0Mn1PC0Njy// 7jm7V2wWdkeh4y8SSYYTNM1rNzMf2Qx7qsht+wh2FwQOhTiGgSSesmah4J6pBA+E pkyOocnBckrLZkSQ/fARPqQKY7CdTql6JyIP/dft5mFjXJp8gga8vuoKYUNXvFN1 W5g8Gc5flqExkgJoue/IU4WqlQlGK2a7p7UAi0nqs21MUWJNL+exzm7sZ2aXGCw3 zNNAIpJMLK+AdujCHFnJfb4fZmNxOEQG9itln4j9pBYp/TovTxZB+yWIbspVUsyt wsRVsKzulQ/wOjg4xenJspMT+0SYSdMtBNFCqRv8Th8b+AiVP4Zs90myw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=Uq+D08HxvzTG19wqye1HARI/n17MUW30E0i8Uib4oD0=; b=lsB9QQHF zIdJZo7UjCE/M9lAwsQy5Jd+l5S8k3wKHiXTgD/FwTV2wf9C01y29kb6Mv0EIq1C TAlAm5j78QMe7AqIAc+01B9VxRRSQ66dykzpGgWNhWStCUp+vxkyVDgUTG2f8N0I Vf8zFVpwW9dbmWZpTLH+/OaqXwc+xK10LVmpcU1WYwoetkC0bzHIYcTvE+X/7iY/ Olc24RsxVwPgKg+f8DLR87XYmIGVZD1dWVh6ve1wu1ehilN+iLb1zZbonBH4qY2G Pm5cDFXw3ohQgyxULeuMpSITvMXHLPrnPItrSXj1S5oL47iJqZQztpCrIXjpqPuG thoz2oxFh4ST9Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedriedtgddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgepjeenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 791FD328005E; Wed, 14 Oct 2020 02:19:48 -0400 (EDT) From: Samuel Holland To: Mark Brown , Liam Girdwood , Maxime Ripard , Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai Subject: [PATCH v2 14/17] ASoC: sun8i-codec: Enable all supported PCM formats Date: Wed, 14 Oct 2020 01:19:38 -0500 Message-Id: <20201014061941.4306-15-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201014061941.4306-1-samuel@sholland.org> References: <20201014061941.4306-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_021957_203786_0AFC9EDA X-CRM114-Status: GOOD ( 14.44 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [64.147.123.27 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ondrej Jirman , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Samuel Holland Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Now that the DAI clock setup is correct for all hardware-supported PCM formats, we can enable them in the driver. With the appropriate support in the CPU DAI driver, this allows userspace to access the additional formats. Since this codec is connected to the CPU via a DAI, not directly, we do not care if the CPU DAI is using 3-byte or 4-byte formats, so we can support them both. Acked-by: Maxime Ripard Signed-off-by: Samuel Holland --- sound/soc/sunxi/sun8i-codec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index a530e58018b7..e3abf8363d9b 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c @@ -91,16 +91,23 @@ #define SUN8I_AIF1CLK_CTRL_AIF1_CLK_INV_MASK GENMASK(14, 13) #define SUN8I_AIF1CLK_CTRL_AIF1_BCLK_DIV_MASK GENMASK(12, 9) #define SUN8I_AIF1CLK_CTRL_AIF1_LRCK_DIV_MASK GENMASK(8, 6) #define SUN8I_AIF1CLK_CTRL_AIF1_WORD_SIZ_MASK GENMASK(5, 4) #define SUN8I_AIF1CLK_CTRL_AIF1_DATA_FMT_MASK GENMASK(3, 2) #define SUN8I_CODEC_PASSTHROUGH_SAMPLE_RATE 48000 +#define SUN8I_CODEC_PCM_FORMATS (SNDRV_PCM_FMTBIT_S8 |\ + SNDRV_PCM_FMTBIT_S16_LE |\ + SNDRV_PCM_FMTBIT_S20_LE |\ + SNDRV_PCM_FMTBIT_S24_LE |\ + SNDRV_PCM_FMTBIT_S20_3LE|\ + SNDRV_PCM_FMTBIT_S24_3LE) + #define SUN8I_CODEC_PCM_RATES (SNDRV_PCM_RATE_8000_48000|\ SNDRV_PCM_RATE_88200 |\ SNDRV_PCM_RATE_96000 |\ SNDRV_PCM_RATE_176400 |\ SNDRV_PCM_RATE_192000 |\ SNDRV_PCM_RATE_KNOT) enum { @@ -535,26 +542,26 @@ static struct snd_soc_dai_driver sun8i_codec_dais[] = { .id = SUN8I_CODEC_AIF1, .ops = &sun8i_codec_dai_ops, /* capture capabilities */ .capture = { .stream_name = "AIF1 Capture", .channels_min = 1, .channels_max = 2, .rates = SUN8I_CODEC_PCM_RATES, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SUN8I_CODEC_PCM_FORMATS, .sig_bits = 24, }, /* playback capabilities */ .playback = { .stream_name = "AIF1 Playback", .channels_min = 1, .channels_max = 2, .rates = SUN8I_CODEC_PCM_RATES, - .formats = SNDRV_PCM_FMTBIT_S16_LE, + .formats = SUN8I_CODEC_PCM_FORMATS, }, .symmetric_rates = true, .symmetric_channels = true, .symmetric_samplebits = true, }, }; static int sun8i_codec_aif_event(struct snd_soc_dapm_widget *w,