Commit 13419625 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branch 'asoc/topic/component' into asoc-next

parents 604c724b 89cab462
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -95,14 +95,6 @@ struct snd_soc_dai_driver;
struct snd_soc_dai;
struct snd_ac97_bus_ops;

/* Digital Audio Interface registration */
int snd_soc_register_dai(struct device *dev,
		struct snd_soc_dai_driver *dai_drv);
void snd_soc_unregister_dai(struct device *dev);
int snd_soc_register_dais(struct device *dev,
		struct snd_soc_dai_driver *dai_drv, size_t count);
void snd_soc_unregister_dais(struct device *dev, size_t count);

/* Digital Audio Interface clocking API.*/
int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
	unsigned int freq, int dir);
+20 −0
Original line number Diff line number Diff line
@@ -324,6 +324,8 @@ struct snd_soc_dai_link;
struct snd_soc_platform_driver;
struct snd_soc_codec;
struct snd_soc_codec_driver;
struct snd_soc_component;
struct snd_soc_component_driver;
struct soc_enum;
struct snd_soc_jack;
struct snd_soc_jack_zone;
@@ -377,6 +379,10 @@ int snd_soc_register_codec(struct device *dev,
		const struct snd_soc_codec_driver *codec_drv,
		struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_codec(struct device *dev);
int snd_soc_register_component(struct device *dev,
			 const struct snd_soc_component_driver *cmpnt_drv,
			 struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_component(struct device *dev);
int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
				    unsigned int reg);
int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
@@ -841,6 +847,20 @@ struct snd_soc_platform {
#endif
};

struct snd_soc_component_driver {
	const char *name;
};

struct snd_soc_component {
	const char *name;
	int id;
	int num_dai;
	struct device *dev;
	struct list_head list;

	const struct snd_soc_component_driver *driver;
};

struct snd_soc_dai_link {
	/* config - must be set by machine driver */
	const char *name;			/* Codec name */
+8 −3
Original line number Diff line number Diff line
@@ -750,13 +750,18 @@ static struct snd_soc_dai_driver atmel_ssc_dai = {
		.ops = &atmel_ssc_dai_ops,
};

static const struct snd_soc_component_driver atmel_ssc_component = {
	.name		= "atmel-ssc",
};

static int asoc_ssc_init(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct ssc_device *ssc = platform_get_drvdata(pdev);
	int ret;

	ret = snd_soc_register_dai(dev, &atmel_ssc_dai);
	ret = snd_soc_register_component(dev, &atmel_ssc_component,
					 &atmel_ssc_dai, 1);
	if (ret) {
		dev_err(dev, "Could not register DAI: %d\n", ret);
		goto err;
@@ -775,7 +780,7 @@ static int asoc_ssc_init(struct device *dev)
	return 0;

err_unregister_dai:
	snd_soc_unregister_dai(dev);
	snd_soc_unregister_component(dev);
err:
	return ret;
}
@@ -790,7 +795,7 @@ static void asoc_ssc_exit(struct device *dev)
	else
		atmel_pcm_pdc_platform_unregister(dev);

	snd_soc_unregister_dai(dev);
	snd_soc_unregister_component(dev);
}

/**
+7 −2
Original line number Diff line number Diff line
@@ -223,6 +223,10 @@ static struct snd_soc_dai_driver au1xac97c_dai_driver = {
	.ops			= &alchemy_ac97c_ops,
};

static const struct snd_soc_component_driver au1xac97c_component = {
	.name		= "au1xac97c",
};

static int au1xac97c_drvprobe(struct platform_device *pdev)
{
	int ret;
@@ -268,7 +272,8 @@ static int au1xac97c_drvprobe(struct platform_device *pdev)

	platform_set_drvdata(pdev, ctx);

	ret = snd_soc_register_dai(&pdev->dev, &au1xac97c_dai_driver);
	ret = snd_soc_register_component(&pdev->dev, &au1xac97c_component,
					 &au1xac97c_dai_driver, 1);
	if (ret)
		return ret;

@@ -280,7 +285,7 @@ static int au1xac97c_drvremove(struct platform_device *pdev)
{
	struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);

	snd_soc_unregister_dai(&pdev->dev);
	snd_soc_unregister_component(&pdev->dev);

	WR(ctx, AC97_ENABLE, EN_D);	/* clock off, disable */

+7 −2
Original line number Diff line number Diff line
@@ -225,6 +225,10 @@ static struct snd_soc_dai_driver au1xi2s_dai_driver = {
	.ops = &au1xi2s_dai_ops,
};

static const struct snd_soc_component_driver au1xi2s_component = {
	.name		= "au1xi2s",
};

static int au1xi2s_drvprobe(struct platform_device *pdev)
{
	struct resource *iores, *dmares;
@@ -260,14 +264,15 @@ static int au1xi2s_drvprobe(struct platform_device *pdev)

	platform_set_drvdata(pdev, ctx);

	return snd_soc_register_dai(&pdev->dev, &au1xi2s_dai_driver);
	return snd_soc_register_component(&pdev->dev, &au1xi2s_component,
					  &au1xi2s_dai_driver, 1);
}

static int au1xi2s_drvremove(struct platform_device *pdev)
{
	struct au1xpsc_audio_data *ctx = platform_get_drvdata(pdev);

	snd_soc_unregister_dai(&pdev->dev);
	snd_soc_unregister_component(&pdev->dev);

	WR(ctx, I2S_ENABLE, EN_D);	/* clock off, disable */

Loading