Unverified Commit 1766ac52 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown
Browse files

ASoC: ux500: remove platform_data support



The platform data definition for ux500 sound devices was removed
six years ago after the DT conversion was completed, see commit
4b483ed0 ("ARM: ux500: cut some platform data").

Remove some leftover bits in the ASoC driver and just assume that
it always gets probed using DT.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230118161110.521504-3-arnd@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8dc08c82
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) ST-Ericsson SA 2010
 *
 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
 */

#ifndef __MSP_H
#define __MSP_H

#include <linux/platform_data/dma-ste-dma40.h>

/* Platform data structure for a MSP I2S-device */
struct msp_i2s_platform_data {
	int id;
	struct stedma40_chan_cfg *msp_i2s_dma_rx;
	struct stedma40_chan_cfg *msp_i2s_dma_tx;
};

#endif
+3 −5
Original line number Diff line number Diff line
@@ -109,11 +109,9 @@ static int mop500_probe(struct platform_device *pdev)

	mop500_card.dev = &pdev->dev;

	if (np) {
	ret = mop500_of_probe(pdev, np);
	if (ret)
		return ret;
	}

	dev_dbg(&pdev->dev, "%s: Card %s: Set platform drvdata.\n",
		__func__, mop500_card.name);
+2 −31
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
#include <linux/of.h>
#include <linux/regulator/consumer.h>
#include <linux/mfd/dbx500-prcmu.h>
#include <linux/platform_data/asoc-ux500-msp.h>

#include <sound/soc.h>
#include <sound/soc-dai.h>
@@ -682,26 +681,6 @@ static int ux500_msp_dai_of_probe(struct snd_soc_dai *dai)
	return 0;
}

static int ux500_msp_dai_probe(struct snd_soc_dai *dai)
{
	struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev);
	struct msp_i2s_platform_data *pdata = dai->dev->platform_data;
	int ret;

	if (!pdata) {
		ret = ux500_msp_dai_of_probe(dai);
		return ret;
	}

	drvdata->msp->playback_dma_data.data_size = drvdata->slot_width;
	drvdata->msp->capture_dma_data.data_size = drvdata->slot_width;

	snd_soc_dai_init_dma_data(dai,
				  &drvdata->msp->playback_dma_data,
				  &drvdata->msp->capture_dma_data);
	return 0;
}

static const struct snd_soc_dai_ops ux500_msp_dai_ops[] = {
	{
		.set_sysclk = ux500_msp_dai_set_dai_sysclk,
@@ -716,7 +695,7 @@ static const struct snd_soc_dai_ops ux500_msp_dai_ops[] = {
};

static struct snd_soc_dai_driver ux500_msp_dai_drv = {
	.probe                 = ux500_msp_dai_probe,
	.probe                 = ux500_msp_dai_of_probe,
	.playback.channels_min = UX500_MSP_MIN_CHANNELS,
	.playback.channels_max = UX500_MSP_MAX_CHANNELS,
	.playback.rates        = UX500_I2S_RATES,
@@ -737,15 +716,8 @@ static const struct snd_soc_component_driver ux500_msp_component = {
static int ux500_msp_drv_probe(struct platform_device *pdev)
{
	struct ux500_msp_i2s_drvdata *drvdata;
	struct msp_i2s_platform_data *pdata = pdev->dev.platform_data;
	struct device_node *np = pdev->dev.of_node;
	int ret = 0;

	if (!pdata && !np) {
		dev_err(&pdev->dev, "No platform data or Device Tree found\n");
		return -ENODEV;
	}

	drvdata = devm_kzalloc(&pdev->dev,
				sizeof(struct ux500_msp_i2s_drvdata),
				GFP_KERNEL);
@@ -787,8 +759,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
		return ret;
	}

	ret = ux500_msp_i2s_init_msp(pdev, &drvdata->msp,
				pdev->dev.platform_data);
	ret = ux500_msp_i2s_init_msp(pdev, &drvdata->msp);
	if (!drvdata->msp) {
		dev_err(&pdev->dev,
			"%s: ERROR: Failed to init MSP-struct (%d)!",
+5 −28
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_data/asoc-ux500-msp.h>

#include <sound/soc.h>

@@ -640,18 +639,8 @@ int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir)
}

static int ux500_msp_i2s_of_init_msp(struct platform_device *pdev,
				struct ux500_msp *msp,
				struct msp_i2s_platform_data **platform_data)
				struct ux500_msp *msp);
{
	struct msp_i2s_platform_data *pdata;

	*platform_data = devm_kzalloc(&pdev->dev,
				     sizeof(struct msp_i2s_platform_data),
				     GFP_KERNEL);
	pdata = *platform_data;
	if (!pdata)
		return -ENOMEM;

	msp->playback_dma_data.dma_cfg = devm_kzalloc(&pdev->dev,
					sizeof(struct stedma40_chan_cfg),
					GFP_KERNEL);
@@ -668,11 +657,9 @@ static int ux500_msp_i2s_of_init_msp(struct platform_device *pdev,
}

int ux500_msp_i2s_init_msp(struct platform_device *pdev,
			struct ux500_msp **msp_p,
			struct msp_i2s_platform_data *platform_data)
			struct ux500_msp **msp_p)
{
	struct resource *res = NULL;
	struct device_node *np = pdev->dev.of_node;
	struct ux500_msp *msp;
	int ret;

@@ -681,19 +668,9 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
	if (!msp)
		return -ENOMEM;

	if (!platform_data) {
		if (np) {
			ret = ux500_msp_i2s_of_init_msp(pdev, msp,
							&platform_data);
	ret = ux500_msp_i2s_of_init_msp(pdev, msp);
	if (ret)
		return ret;
		} else
			return -EINVAL;
	} else {
		msp->playback_dma_data.dma_cfg = platform_data->msp_i2s_dma_tx;
		msp->capture_dma_data.dma_cfg = platform_data->msp_i2s_dma_rx;
		msp->id = platform_data->id;
	}

	msp->dev = &pdev->dev;

+1 −4
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#define UX500_MSP_I2S_H

#include <linux/platform_device.h>
#include <linux/platform_data/asoc-ux500-msp.h>

#define MSP_INPUT_FREQ_APB 48000000

@@ -482,10 +481,8 @@ struct ux500_msp {
	unsigned int f_bitclk;
};

struct msp_i2s_platform_data;
int ux500_msp_i2s_init_msp(struct platform_device *pdev,
			struct ux500_msp **msp_p,
			struct msp_i2s_platform_data *platform_data);
			struct ux500_msp **msp_p);
void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev,
			struct ux500_msp *msp);
int ux500_msp_i2s_open(struct ux500_msp *msp, struct ux500_msp_config *config);
Loading