Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1930622ybg; Thu, 24 Oct 2019 02:17:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNlP0Cvt0avCwJbWLS1ULe3RY219uqqXLeiWeHirIQv56mVr/mA386COfwTerPzVZxRbAh X-Received: by 2002:a05:6402:1519:: with SMTP id f25mr42680915edw.65.1571908677759; Thu, 24 Oct 2019 02:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571908677; cv=none; d=google.com; s=arc-20160816; b=0OBmCPvUznXPyAvJriLfNRGTM4Ko/rh4PL6Sg+pYRDQmV+5ssH84ERJMYaz03WlFWM VfMrMBQrG6k8LL4OmwLs0M17o3WHE5HF190Wc8PZZQm3rVlIujJZmnWIcWGf6N8Z9Fow 6A/sLX1Srg6cki/NJ/I8Scnav1fRNA9KpHZCP+gw5uPHx7w+HwBfC95C6R0qHhyLkYZ9 CCANfyedTqxY0TAjqwMBugt80hrt7SwUZC3kZUiky9+DHBBLd1biuPr2JlH/2C+gP8qk Ty6cO03Rv9NkAN00OT1qyzlWE0m9Q3MjwGf7uGDiqdYVlLwLNSjCIVkYyO929riREJfe zaog== 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:dkim-signature; bh=j/8yayfqMY0ZyCUC8zjVt9apU8LafgXQ0fDRwU+6/iQ=; b=oVOd1GKvOrTHKOHd4Y0DRMyMQ1nDa8cRQeYXDoUScDKmrUvm2DDAXX1alxAfIAPyih l0v2q9e33lK4PxgSb8KNWTBOwOlQa4twlJD7J3XnaOSzR2aZlUpoOu29oBYm63ZK1jpz GvkxBT2lAQOSMWrg5+m+kh5FJWSgzsm8PcwBRhQ1lrJZGjt/da+JrUSCg/D+jsRjfpZa aMdv0z7HT8ZrKWls6cRSIp9zDazY7i8d/GzoQohAcdWvNeB8dZZygCwOfI/QYTbbIec6 ujkhHf8COLYX4cfPSMsOY4Tx1XWDFKRBHTWRvC7pL0URoTf2caWawEmrsd6UPvjXz0H7 q0nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=L4TmW74B; 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 s22si3901241ejq.10.2019.10.24.02.17.32; Thu, 24 Oct 2019 02:17:57 -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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=L4TmW74B; 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 S2404508AbfJWS4W (ORCPT + 99 others); Wed, 23 Oct 2019 14:56:22 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:59580 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404472AbfJWS4V (ORCPT ); Wed, 23 Oct 2019 14:56:21 -0400 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=j/8yayfqMY0ZyCUC8zjVt9apU8LafgXQ0fDRwU+6/iQ=; b=L4TmW74BoYDt J9IEPYU9uFs7yHt4LFK7+xRfFBHFlm30/Dqz3JDPHWDoFirnv5GUmrMP8cnCqU3fwSQliUlAkblVe vjwQWzrLXRB4mpsqp7cTWweAYNZGRwalCZ7X11Ni7TT5+AXPjxSqpvCv6opPFOfYI8byw5k1/bQta A6A9I=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iNLnj-0001B9-4v; Wed, 23 Oct 2019 18:56:07 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 98437274326D; Wed, 23 Oct 2019 19:56:06 +0100 (BST) From: Mark Brown To: Jiada Wang Cc: alsa-devel@alsa-project.org, Andrew Gabbasov , Eugeniu Rosca , Eugeniu Rosca , Jaroslav Kysela , Kuninori Morimoto , Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Takashi Iwai , Timo Wischer Subject: Applied "ASoC: rsnd: dma: set bus width to data width for monaural data" to the asoc tree In-Reply-To: <20191022185518.12838-1-erosca@de.adit-jv.com> X-Patchwork-Hint: ignore Message-Id: <20191023185606.98437274326D@ypsilon.sirena.org.uk> Date: Wed, 23 Oct 2019 19:56:06 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: rsnd: dma: set bus width to data width for monaural data has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.5 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 d4d9360bf702890b5d3b1b62d8619a2690dd3278 Mon Sep 17 00:00:00 2001 From: Jiada Wang Date: Tue, 22 Oct 2019 20:55:18 +0200 Subject: [PATCH] ASoC: rsnd: dma: set bus width to data width for monaural data According to R-Car3 HW manual 40.3.3 (Data Format on Audio Local Bus), in case of monaural data writing or reading through Audio-DMAC, it's always in Left Justified format, so both src and dst DMA Bus width should be equal to physical data width. Therefore set src and dst's DMA bus width to: - [monaural case] data width - [non-monaural case] 32bits (as prior applying the patch) Cc: Andrew Gabbasov Cc: Timo Wischer Signed-off-by: Jiada Wang Signed-off-by: Eugeniu Rosca Link: https://lore.kernel.org/r/20191022185518.12838-1-erosca@de.adit-jv.com Signed-off-by: Mark Brown --- sound/soc/sh/rcar/dma.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 0324a5c39619..bcb6d5960661 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -165,14 +165,40 @@ static int rsnd_dmaen_start(struct rsnd_mod *mod, struct device *dev = rsnd_priv_to_dev(priv); struct dma_async_tx_descriptor *desc; struct dma_slave_config cfg = {}; + enum dma_slave_buswidth buswidth = DMA_SLAVE_BUSWIDTH_4_BYTES; int is_play = rsnd_io_is_play(io); int ret; + /* + * in case of monaural data writing or reading through Audio-DMAC + * data is always in Left Justified format, so both src and dst + * DMA Bus width need to be set equal to physical data width. + */ + if (rsnd_runtime_channel_original(io) == 1) { + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + int bits = snd_pcm_format_physical_width(runtime->format); + + switch (bits) { + case 8: + buswidth = DMA_SLAVE_BUSWIDTH_1_BYTE; + break; + case 16: + buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; + break; + case 32: + buswidth = DMA_SLAVE_BUSWIDTH_4_BYTES; + break; + default: + dev_err(dev, "invalid format width %d\n", bits); + return -EINVAL; + } + } + cfg.direction = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; cfg.src_addr = dma->src_addr; cfg.dst_addr = dma->dst_addr; - cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + cfg.src_addr_width = buswidth; + cfg.dst_addr_width = buswidth; dev_dbg(dev, "%s %pad -> %pad\n", rsnd_mod_name(mod), -- 2.20.1