Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f2032a1 authored by Stephen Warren's avatar Stephen Warren Committed by Mark Brown
Browse files

ASoC: ep93xx: get rid of ep93xx-pcm-audio struct device



Modify the ep93xx PCM driver so that it's a utility library that can be
registered on each DAI, rather than a separate struct device. This is
more in line with how many recent DT-converted platforms operate, and
avoids the need for yet another struct device.

Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 237eeb1c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -63,7 +63,7 @@ static struct snd_soc_ops edb93xx_ops = {
static struct snd_soc_dai_link edb93xx_dai = {
static struct snd_soc_dai_link edb93xx_dai = {
	.name		= "CS4271",
	.name		= "CS4271",
	.stream_name	= "CS4271 HiFi",
	.stream_name	= "CS4271 HiFi",
	.platform_name	= "ep93xx-pcm-audio",
	.platform_name	= "ep93xx-i2s",
	.cpu_dai_name	= "ep93xx-i2s",
	.cpu_dai_name	= "ep93xx-i2s",
	.codec_name	= "spi0.0",
	.codec_name	= "spi0.0",
	.codec_dai_name	= "cs4271-hifi",
	.codec_dai_name	= "cs4271-hifi",
+8 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,8 @@


#include <linux/platform_data/dma-ep93xx.h>
#include <linux/platform_data/dma-ep93xx.h>


#include "ep93xx-pcm.h"

/*
/*
 * Per channel (1-4) registers.
 * Per channel (1-4) registers.
 */
 */
@@ -394,8 +396,14 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
	if (ret)
	if (ret)
		goto fail;
		goto fail;


	ret = devm_ep93xx_pcm_platform_register(&pdev->dev);
	if (ret)
		goto fail_unregister;

	return 0;
	return 0;


fail_unregister:
	snd_soc_unregister_component(&pdev->dev);
fail:
fail:
	ep93xx_ac97_info = NULL;
	ep93xx_ac97_info = NULL;
	snd_soc_set_ac97_ops(NULL);
	snd_soc_set_ac97_ops(NULL);
+8 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,8 @@
#include <mach/ep93xx-regs.h>
#include <mach/ep93xx-regs.h>
#include <linux/platform_data/dma-ep93xx.h>
#include <linux/platform_data/dma-ep93xx.h>


#include "ep93xx-pcm.h"

#define EP93XX_I2S_TXCLKCFG		0x00
#define EP93XX_I2S_TXCLKCFG		0x00
#define EP93XX_I2S_RXCLKCFG		0x04
#define EP93XX_I2S_RXCLKCFG		0x04
#define EP93XX_I2S_GLCTRL		0x0C
#define EP93XX_I2S_GLCTRL		0x0C
@@ -405,8 +407,14 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
	if (err)
	if (err)
		goto fail_put_lrclk;
		goto fail_put_lrclk;


	err = devm_ep93xx_pcm_platform_register(&pdev->dev);
	if (err)
		goto fail_unregister;

	return 0;
	return 0;


fail_unregister:
	snd_soc_unregister_component(&pdev->dev);
fail_put_lrclk:
fail_put_lrclk:
	clk_put(info->lrclk);
	clk_put(info->lrclk);
fail_put_sclk:
fail_put_sclk:
+5 −14
Original line number Original line Diff line number Diff line
@@ -23,6 +23,8 @@


#include <linux/platform_data/dma-ep93xx.h>
#include <linux/platform_data/dma-ep93xx.h>


#include "ep93xx-pcm.h"

static const struct snd_pcm_hardware ep93xx_pcm_hardware = {
static const struct snd_pcm_hardware ep93xx_pcm_hardware = {
	.info			= (SNDRV_PCM_INFO_MMAP		|
	.info			= (SNDRV_PCM_INFO_MMAP		|
				   SNDRV_PCM_INFO_MMAP_VALID	|
				   SNDRV_PCM_INFO_MMAP_VALID	|
@@ -76,27 +78,16 @@ static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = {
	.prealloc_buffer_size = 131072,
	.prealloc_buffer_size = 131072,
};
};


static int ep93xx_soc_platform_probe(struct platform_device *pdev)
int devm_ep93xx_pcm_platform_register(struct device *dev)
{
{
	return devm_snd_dmaengine_pcm_register(&pdev->dev,
	return devm_snd_dmaengine_pcm_register(dev,
		&ep93xx_dmaengine_pcm_config,
		&ep93xx_dmaengine_pcm_config,
		SND_DMAENGINE_PCM_FLAG_NO_RESIDUE |
		SND_DMAENGINE_PCM_FLAG_NO_RESIDUE |
		SND_DMAENGINE_PCM_FLAG_NO_DT |
		SND_DMAENGINE_PCM_FLAG_NO_DT |
		SND_DMAENGINE_PCM_FLAG_COMPAT);
		SND_DMAENGINE_PCM_FLAG_COMPAT);
}
}

EXPORT_SYMBOL_GPL(devm_ep93xx_pcm_platform_register);
static struct platform_driver ep93xx_pcm_driver = {
	.driver = {
			.name = "ep93xx-pcm-audio",
			.owner = THIS_MODULE,
	},

	.probe = ep93xx_soc_platform_probe,
};

module_platform_driver(ep93xx_pcm_driver);


MODULE_AUTHOR("Ryan Mallon");
MODULE_AUTHOR("Ryan Mallon");
MODULE_DESCRIPTION("EP93xx ALSA PCM interface");
MODULE_DESCRIPTION("EP93xx ALSA PCM interface");
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ep93xx-pcm-audio");
+22 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __EP93XX_PCM_H__
#define __EP93XX_PCM_H__

int devm_ep93xx_pcm_platform_register(struct device *dev);

#endif
Loading