Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4363701ybl; Tue, 20 Aug 2019 10:45:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYbszJ4CPMJi1J3xhKQDVz2DN0Bt7q5tDFiO24c77hQmYqYT24i8Puszf9QzkPJ56GH4z4 X-Received: by 2002:a62:4d41:: with SMTP id a62mr12744591pfb.155.1566323121953; Tue, 20 Aug 2019 10:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566323121; cv=none; d=google.com; s=arc-20160816; b=bCHLOzI1jaRGyUybFKp0nKuCaG500yw31AESMq1i3g5Fdl5cxWC+S7125NnDgFD9yJ G/Eb/TuuKDWjq3Asu+NSR4uawTIvsoiOY8SK6rkUiifUZnKGMVZZiCI0K4AnfzVe+HH9 157dzo9VKRmYhPccoMs+38v12FiwRxm9Dt93cAfGHoLIg31cZ4Hx7HBJ61pEbmdhlDPH SBEqOYf9GqM230w0UIDa4g/JDZNYoSiLunezrUTIRp0oMCTcowr7a5cBvv6EzNgGMBrP MUuDMM77VNtrxy6i49TfntU8jFkAFPvIFYEuhIi38W/S73WNn7sCUkmn7Jy8XPhaUxjg DVuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from; bh=ABCcOn5GHJ8lNU8EGGWNRlyaGFZyomNizJdK6sCFsYs=; b=paYhPu3RnIOlFDuX84k8/53s6OrTxAYT6srk0gXANmyPBSugExUIbViQ2UHLPCChzj y1eYrRCYhE0gqz1cE7IeKwng9zlOnStDcc7qHENpyvMw72fmlG+dhHn7MBLFABPzzJCy Lxix4CSqKZNeEQVbN7mKDSTf9Ssr2TLeFBtOSZtWRZNGtTBdZcTrw8JGatQF64uRkHHT D/Fpmr+c/E+3xVZLLAD8Md3IoRE/tMLDZW3maMBJWD2oSry6HhMRqZ9JTmN7ZS6KIu24 ZiRdT9DjfCnU0CfkJLiRM1STVQDPBhLxDQPydncIn5K2XeHb5GsVFOO7FXGb99ePANjl cZCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si13704918pfq.58.2019.08.20.10.45.06; Tue, 20 Aug 2019 10:45:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730597AbfHTRme (ORCPT + 99 others); Tue, 20 Aug 2019 13:42:34 -0400 Received: from mail-wr1-f97.google.com ([209.85.221.97]:37515 "EHLO mail-wr1-f97.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729852AbfHTRlG (ORCPT ); Tue, 20 Aug 2019 13:41:06 -0400 Received: by mail-wr1-f97.google.com with SMTP id z11so13269671wrt.4 for ; Tue, 20 Aug 2019 10:41:05 -0700 (PDT) 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:in-reply-to:message-id:date; bh=ABCcOn5GHJ8lNU8EGGWNRlyaGFZyomNizJdK6sCFsYs=; b=CQlaT8ArlBYtIeUz/WUb7BzZ3sXN8Uk+o/FfEEtt9ebsjd60Yj612BIf98yp2pQ4Y8 ApgJssA/lmJC9/lk+fKTD9QTq4MMRrEp5HXCr2UrTtIfrAgfk10m11u1xPJY8IugoUrE zgSoEaj9052c9x+C6SGCgxK9FXbyPakNtE5F7BmCuYWmQVelxU0K9ErKxTtGnn1YEfId T8tTaLPIkG+7UTS3Jig2451DKSH55/FChYEtcyMOFZIVseIeKESTpc6Q8StN1Ez3St78 Du1wSgmwDDZEBfra8Fbt1ORdG8b96+XEBWfQCC/unTil/ZChnTSwLcRfT5h6K9pmP2fa nULQ== X-Gm-Message-State: APjAAAXkuGxErHpYbQlwdMqJKWxCd8klCHknOer/wwGwATNLERPL8mQ+ LZBRA3HyqKWJegYHFE4SMDJKH5P1A0Yl55h/QG2eGXSyA0Gu5RXiOzpRbQOv8jwVgA== X-Received: by 2002:adf:82cd:: with SMTP id 71mr31193025wrc.265.1566322864760; Tue, 20 Aug 2019 10:41:04 -0700 (PDT) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk. [2a01:7e01::f03c:91ff:fed4:a3b6]) by smtp-relay.gmail.com with ESMTPS id x12sm314086wrv.41.2019.08.20.10.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 10:41:04 -0700 (PDT) X-Relaying-Domain: sirena.org.uk Received: from ypsilon.sirena.org.uk ([2001:470:1f1d:6b5::7]) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0880-00032F-Fp; Tue, 20 Aug 2019 17:41:04 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id C506D274314F; Tue, 20 Aug 2019 18:41:03 +0100 (BST) From: Mark Brown To: Maxime Ripard Cc: alsa-devel@alsa-project.org, broonie@kernel.org, Chen-Yu Tsai , codekipper@gmail.com, lgirdwood@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown , Maxime Ripard Subject: Applied "ASoC: sun4i-i2s: Support more channels" to the asoc tree In-Reply-To: <27d9de5cd56f3a544851b8cd8af08bf836d19637.1566242458.git-series.maxime.ripard@bootlin.com> X-Patchwork-Hint: ignore Message-Id: <20190820174103.C506D274314F@ypsilon.sirena.org.uk> Date: Tue, 20 Aug 2019 18:41:03 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: sun4i-i2s: Support more channels has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From bbf9a127abca4aac5cc75f882bc7efcc398e86ae Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 19 Aug 2019 21:25:26 +0200 Subject: [PATCH] ASoC: sun4i-i2s: Support more channels We've been limited to 2 channels in the driver while the controller supports from 1 to 8 channels, in both capture and playback. let's remove the hardcoded checks and numbers, and extend the range of channel numbers we can use. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/27d9de5cd56f3a544851b8cd8af08bf836d19637.1566242458.git-series.maxime.ripard@bootlin.com Signed-off-by: Mark Brown --- sound/soc/sunxi/sun4i-i2s.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 6b172dfbc25d..9e691baee1e8 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -400,9 +400,6 @@ static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, { unsigned int channels = params_channels(params); - if (channels != 2) - return -EINVAL; - /* Map the channels for playback and capture */ regmap_write(i2s->regmap, SUN4I_I2S_TX_CHAN_MAP_REG, 0x76543210); regmap_write(i2s->regmap, SUN4I_I2S_RX_CHAN_MAP_REG, 0x00003210); @@ -423,9 +420,6 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, { unsigned int channels = params_channels(params); - if (channels != 2) - return -EINVAL; - /* Map the channels for playback and capture */ regmap_write(i2s->regmap, SUN8I_I2S_TX_CHAN_MAP_REG, 0x76543210); regmap_write(i2s->regmap, SUN8I_I2S_RX_CHAN_MAP_REG, 0x76543210); @@ -458,6 +452,7 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai); + unsigned int channels = params_channels(params); int ret, sr, wss; u32 width; @@ -490,7 +485,7 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, regmap_field_write(i2s->field_fmt_sr, sr); return sun4i_i2s_set_clk_rate(dai, params_rate(params), - 2, params_width(params)); + channels, params_width(params)); } static int sun4i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, @@ -814,15 +809,15 @@ static struct snd_soc_dai_driver sun4i_i2s_dai = { .probe = sun4i_i2s_dai_probe, .capture = { .stream_name = "Capture", - .channels_min = 2, - .channels_max = 2, + .channels_min = 1, + .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, .formats = SNDRV_PCM_FMTBIT_S16_LE, }, .playback = { .stream_name = "Playback", - .channels_min = 2, - .channels_max = 2, + .channels_min = 1, + .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000, .formats = SNDRV_PCM_FMTBIT_S16_LE, }, -- 2.20.1