From patchwork Thu Nov 9 17:43:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 118471 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6883598qgn; Thu, 9 Nov 2017 09:43:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMYv9h7vsMTEwubyACoS4GNkQLddvFcTin3GE/IroedfiVvYBHt1ngJxLbYatYcn0/5VWohw X-Received: by 10.28.14.85 with SMTP id 82mr465880wmo.120.1510249403962; Thu, 09 Nov 2017 09:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510249403; cv=none; d=google.com; s=arc-20160816; b=gSx7s5nalqEENJY3s3aycL+fCaxTI9cfM97GoVGvpgH+amx9mET30kuYK364vWEOQl A/jkFOnMOOQ+hGhJURXtHV0dZWGMiildADWOO2DmzXoiNg4l0S3mIahxatpkwsn5SS0T WfLjpxJk99gPY0JwiZLkG5VBzb1Rdpn00nqI438OTZ23is/KtRwdUJttTZgDk/8uuOw3 NU+YMEAr9ww722Dr+COh/qOR6EHb1aUDcl7udYCM/1U51ZaUiDK5EVUAdTb96y1mASb9 9FjLsYLLVxUSgfoGQTe9Ui0DF1s6kV+aBELglbW1K/724lF9jJOggbqu6c1SixGmFOeH z6fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=VocivJY4Py9cPlpUExbukqkUbE7MTTiAuP4TMovoNd4=; b=KlXnelLPRNEB7oYW/r5YnYxbKtnQGbCepBi5y+CEwrnePzvcxKPnnniNvu+5patAyM MdwAumKM7eoOrJ4lS8lGzaXwIqNH3dVZj7iF+ahjrXNi5dHPI0+k8p2VVyai+uOYZzEp 0wZoAoUGcBmq7wRPtJvzpcnnEUI7CiAyqpVrkITZ5FO7J/0o7FjLSljZIRMuAr/dbZTY RMSe+GnkaICl1szQsqbY0cYMQnuqQYmxagaMQxmgJSHVuoCMcYCxrcT1fiakaa3HxqNq hjXFSuHR/Z+CHy2LqoQdpWeSW//TEZ2yES1ocg/pzncLWAFyYbqNGsul40qPwBS45lU6 NWUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=gryiY8TP; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id u26si6923655wru.419.2017.11.09.09.43.23; Thu, 09 Nov 2017 09:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=gryiY8TP; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C26F2267857; Thu, 9 Nov 2017 18:43:12 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8A70926785E; Thu, 9 Nov 2017 18:43:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id BBF2F267826 for ; Thu, 9 Nov 2017 18:43:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=tsEJlAapONu/t7osYFiuGwfSw8fc47eNmyuvB8lI+RI=; b=gryiY8TPtapN 1VpqUpG+inFz679J/nh4oZuf9ksYvf4+pPOQAwKtP9ZyULkh1nFYejwf8czu2TDSCgt3hWqahaClj EiCvYTHrf3E31HNQddCFovYeXzXyTReqg9bD3u7GWLhkofhCck9fC3ePnwLp6ymHfvVPayZCfFeia YqTpg=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eCqr6-0005Mw-Op; Thu, 09 Nov 2017 17:43:08 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eCqr6-0006f0-Au; Thu, 09 Nov 2017 17:43:08 +0000 From: Mark Brown To: Andrea Bondavalli In-Reply-To: Message-Id: Date: Thu, 09 Nov 2017 17:43:08 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: sun4i-codec: fixed 32bit audio capture support for H3/H2+" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: sun4i-codec: fixed 32bit audio capture support for H3/H2+ has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 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 8a0f95ce48304364979066600eba7cc5c939ba83 Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Tue, 31 Oct 2017 12:58:18 +0100 Subject: [PATCH] ASoC: sun4i-codec: fixed 32bit audio capture support for H3/H2+ 32bit and 24bit audio capture formats for H3/H2+ are broken because the RX_SAMPLE_BITS and the RX_FIFO_MODE bits of AC_ADC_FIFOC register of the audio codec are not set to operate in 24bit mode but in 16bit mode only. The following patch sets the H3 audio codec registers and the DMA bus width properly when a 24/32bit capture is requested. Signed-off-by: Andrea Bondavalli Signed-off-by: Mark Brown --- sound/soc/sunxi/sun4i-codec.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index baa9007464ed..5da4efe7a550 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -346,11 +346,6 @@ static int sun4i_codec_prepare_capture(struct snd_pcm_substream *substream, 0x3 << 8, 0x1 << 8); - /* Fill most significant bits with valid data MSB */ - regmap_field_update_bits(scodec->reg_adc_fifoc, - BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE), - BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE)); - return 0; } @@ -490,6 +485,30 @@ static int sun4i_codec_hw_params_capture(struct sun4i_codec *scodec, BIT(SUN4I_CODEC_ADC_FIFOC_MONO_EN), 0); + /* Set the number of sample bits to either 16 or 24 bits */ + if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS)->min == 32) { + regmap_field_update_bits(scodec->reg_adc_fifoc, + BIT(SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS), + BIT(SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS)); + + regmap_field_update_bits(scodec->reg_adc_fifoc, + BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE), + 0); + + scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + } else { + regmap_field_update_bits(scodec->reg_adc_fifoc, + BIT(SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS), + 0); + + /* Fill most significant bits with valid data MSB */ + regmap_field_update_bits(scodec->reg_adc_fifoc, + BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE), + BIT(SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE)); + + scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + } + return 0; }