From patchwork Mon Jun 18 12:00:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 138904 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3866816lji; Mon, 18 Jun 2018 05:02:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJCMIBmR0H7v8y8jSLPAAWv+mmSVH/bNhkzWB/j9E0SPc9hZzLJbfTUaQ6SqAehGX8kk+0X X-Received: by 2002:a1c:8f8b:: with SMTP id r133-v6mr8297262wmd.1.1529323332099; Mon, 18 Jun 2018 05:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323332; cv=none; d=google.com; s=arc-20160816; b=MYK9aAaHHM0X3vwktFsKQxu/15BZ7+3pGLh14SdikSDUul9E8T9LVex6e7/igphRL+ Jhx+A6Kiidrx87HIZ9r0ZASBPV8LGyVCQqv2UjRFdoB2uP4Vj+fFUoQgOlU2wdQsR0Ed i8NtxOiXFFobvt/q1Qm7uoit3ezP/LHUl57ZkWibM7ZZz4TH51jhH+kiapAi+9HBE/YM 5CizJM7I+ab7ZmrJKG9Kgv3i05lSIYmpZDBxFcGsiDCqK9BI2RnDUpvhReZy7MugRtC7 yIcFMI9qVIc8KMBAuL94sUILDC+5nSxNZPXgBF06m1q8vrF2L89GEjK2SULh1v0Cvyf9 NRTQ== 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=LsW+1szefeyOwgf9HWjCgxN9kvXklY2rHfoxnVEOOHc=; b=dU2f8u6EFXjqd01JDbyCNHj+H8wmycIDJ5cw+VURlyzeBSExO9CkRREcQ4xu0ezE7u 8PGK8YrDruflkJkVQjGdozQn/OdKJid6FROifhzNrl/HOBZOkJTU16f/aPGh2YiXnX/V uvZ8Z8/LgGBhByVbqRtTe2/4Oer/cML7NkKy4GE4CziofTJsJ1A+k2+vnZ2N3ksuHU2p oXi4pz5vyFjf6oZTNrk67LLud+brn2MOXdCpde5ICBKkVxaJ3h7J6W5CKV4SutzwmCD3 OtGMKZhqgJkIw86X0ue/QVXe7vAU3OV3cDN8NOPQb++ABjZ1qh8LlqD2KLQObbA2n0c1 Wf/A== 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=pTVt61Mj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id t80-v6si9500294wrc.86.2018.06.18.05.02.11; Mon, 18 Jun 2018 05:02:12 -0700 (PDT) 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=pTVt61Mj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 127A2267743; Mon, 18 Jun 2018 14:00:34 +0200 (CEST) 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 2A2C1267738; Mon, 18 Jun 2018 14:00:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, 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 2477226772E for ; Mon, 18 Jun 2018 14:00:24 +0200 (CEST) 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=e8iJtGIlS8rC/Hi5PENbBYpVJZYnm31uzxIBnSqOM5U=; b=pTVt61MjqdZx R2NInLir9/Bu1jPEL3shDMNAy+0E+G4ZegrTYWoZ4XeJNIwqiYKpBHq7ZP46BV9TEXi8hOG1wosPb Tv7WrHPNJtQ4Loqw0Sk6a5fpA70P82os10sPkJy/xPJUsGypQgMLjrKuSXfiwl598vFgLpEckqbn5 lBr6A=; 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 1fUspY-0007yj-Ia; Mon, 18 Jun 2018 12:00:20 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fUspY-0000DI-3A; Mon, 18 Jun 2018 13:00:20 +0100 From: Mark Brown To: Jianqun Xu In-Reply-To: Message-Id: Date: Mon, 18 Jun 2018 13:00:20 +0100 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: rockchip: add config for rockchip dmaengine pcm register" 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: rockchip: add config for rockchip dmaengine pcm register 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 75b31192fe6ad20b42276b20ee3bdf1493216d63 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Fri, 8 Jun 2018 16:31:09 +0800 Subject: [PATCH] ASoC: rockchip: add config for rockchip dmaengine pcm register This patch makes the rockchip i2s pcm configurable by adding rockchip pcm config for devm_snd_dmaengine_pcm_register. Signed-off-by: Jianqun Xu Signed-off-by: Mark Brown --- sound/soc/rockchip/Makefile | 3 ++- sound/soc/rockchip/rockchip_i2s.c | 3 ++- sound/soc/rockchip/rockchip_pcm.c | 45 +++++++++++++++++++++++++++++++ sound/soc/rockchip/rockchip_pcm.h | 14 ++++++++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 sound/soc/rockchip/rockchip_pcm.c create mode 100644 sound/soc/rockchip/rockchip_pcm.h -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/rockchip/Makefile b/sound/soc/rockchip/Makefile index 05b078e7b87f..65e814d46006 100644 --- a/sound/soc/rockchip/Makefile +++ b/sound/soc/rockchip/Makefile @@ -1,10 +1,11 @@ # SPDX-License-Identifier: GPL-2.0 # ROCKCHIP Platform Support snd-soc-rockchip-i2s-objs := rockchip_i2s.o +snd-soc-rockchip-pcm-objs := rockchip_pcm.o snd-soc-rockchip-pdm-objs := rockchip_pdm.o snd-soc-rockchip-spdif-objs := rockchip_spdif.o -obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o +obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o snd-soc-rockchip-pcm.o obj-$(CONFIG_SND_SOC_ROCKCHIP_PDM) += snd-soc-rockchip-pdm.o obj-$(CONFIG_SND_SOC_ROCKCHIP_SPDIF) += snd-soc-rockchip-spdif.o diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 950823d69e9c..60d43d53a8f5 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -22,6 +22,7 @@ #include #include "rockchip_i2s.h" +#include "rockchip_pcm.h" #define DRV_NAME "rockchip-i2s" @@ -674,7 +675,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) goto err_suspend; } - ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); + ret = rockchip_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); return ret; diff --git a/sound/soc/rockchip/rockchip_pcm.c b/sound/soc/rockchip/rockchip_pcm.c new file mode 100644 index 000000000000..f77538319221 --- /dev/null +++ b/sound/soc/rockchip/rockchip_pcm.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018 Rockchip Electronics Co. Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include "rockchip_pcm.h" + +static const struct snd_pcm_hardware snd_rockchip_hardware = { + .info = SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_PAUSE | + SNDRV_PCM_INFO_RESUME, + .period_bytes_min = 32, + .period_bytes_max = 8192, + .periods_min = 1, + .periods_max = 52, + .buffer_bytes_max = 64 * 1024, + .fifo_size = 32, +}; + +static const struct snd_dmaengine_pcm_config rk_dmaengine_pcm_config = { + .pcm_hardware = &snd_rockchip_hardware, + .prealloc_buffer_size = 32 * 1024, +}; + +int rockchip_pcm_platform_register(struct device *dev) +{ + return devm_snd_dmaengine_pcm_register(dev, &rk_dmaengine_pcm_config, + SND_DMAENGINE_PCM_FLAG_COMPAT); +} +EXPORT_SYMBOL_GPL(rockchip_pcm_platform_register); + +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/rockchip/rockchip_pcm.h b/sound/soc/rockchip/rockchip_pcm.h new file mode 100644 index 000000000000..d6c36115c60a --- /dev/null +++ b/sound/soc/rockchip/rockchip_pcm.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2018 Rockchip Electronics Co. Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _ROCKCHIP_PCM_H +#define _ROCKCHIP_PCM_H + +int rockchip_pcm_platform_register(struct device *dev); + +#endif