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

ASoC: Rename snd_soc_card to snd_soc_machine


One of the issues with the ASoC v1 API which has been addressed in the
ASoC v2 work that Liam Girdwood has done is that the ALSA card provided
by ASoC is distributed around the ASoC structures. For example, machine
wide data such as the struct snd_card are maintained as part of the
CODEC data structure, preventing the use of multiple codecs. This has
been addressed by refactoring the data structures so that all the data
for the ALSA card is contained in a single structure snd_soc_card which
replaces the existing snd_soc_machine and snd_soc_device.

Begin the process of backporting this by renaming struct snd_soc_machine
to struct snd_soc_card, better reflecting its function and bringing it
closer to standard ALSA terminology.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 9b0db7e7
......@@ -9,7 +9,7 @@ the audio subsystem with the kernel as a platform device and is represented by
the following struct:-
/* SoC machine */
struct snd_soc_machine {
struct snd_soc_card {_
char *name;
int (*probe)(struct platform_device *pdev);
......@@ -67,10 +67,10 @@ static struct snd_soc_dai_link corgi_dai = {
.ops = &corgi_ops,
};
struct snd_soc_machine then sets up the machine with it's DAIs. e.g.
struct snd_soc_card then sets up the machine with it's DAIs. e.g.
/* corgi audio machine driver */
static struct snd_soc_machine snd_soc_machine_corgi = {
static struct snd_soc_card snd_soc_corgi = {
.name = "Corgi",
.dai_link = &corgi_dai,
.num_links = 1,
......@@ -90,7 +90,7 @@ static struct wm8731_setup_data corgi_wm8731_setup = {
/* corgi audio subsystem */
static struct snd_soc_device corgi_snd_devdata = {
.machine = &snd_soc_machine_corgi,
.machine = &snd_soc_corgi,
.platform = &pxa2xx_soc_platform,
.codec_dev = &soc_codec_dev_wm8731,
.codec_data = &corgi_wm8731_setup,
......
......@@ -482,8 +482,8 @@ struct snd_soc_dai_link {
struct snd_pcm *pcm;
};
/* SoC machine */
struct snd_soc_machine {
/* SoC card */
struct snd_soc_card {
char *name;
int (*probe)(struct platform_device *pdev);
......@@ -497,7 +497,7 @@ struct snd_soc_machine {
int (*resume_post)(struct platform_device *pdev);
/* callbacks */
int (*set_bias_level)(struct snd_soc_machine *,
int (*set_bias_level)(struct snd_soc_card *,
enum snd_soc_bias_level level);
/* CPU <--> Codec DAI links */
......@@ -508,7 +508,7 @@ struct snd_soc_machine {
/* SoC Device - the audio subsystem */
struct snd_soc_device {
struct device *dev;
struct snd_soc_machine *machine;
struct snd_soc_card *card;
struct snd_soc_platform *platform;
struct snd_soc_codec *codec;
struct snd_soc_codec_device *codec_dev;
......
......@@ -361,7 +361,7 @@ static struct snd_soc_dai_link playpaq_wm8510_dai = {
static struct snd_soc_machine snd_soc_machine_playpaq = {
static struct snd_soc_card snd_soc_playpaq = {
.name = "LRS_PlayPaq_WM8510",
.dai_link = &playpaq_wm8510_dai,
.num_links = 1,
......@@ -377,7 +377,7 @@ static struct wm8510_setup_data playpaq_wm8510_setup = {
static struct snd_soc_device playpaq_wm8510_snd_devdata = {
.machine = &snd_soc_machine_playpaq,
.card = &snd_soc_playpaq,
.platform = &at32_soc_platform,
.codec_dev = &soc_codec_dev_wm8510,
.codec_data = &playpaq_wm8510_setup,
......
......@@ -242,7 +242,7 @@ static struct snd_soc_dai_link at91sam9g20ek_dai = {
.ops = &at91sam9g20ek_ops,
};
static struct snd_soc_machine snd_soc_machine_at91sam9g20ek = {
static struct snd_soc_card snd_soc_at91sam9g20ek = {
.name = "WM8731",
.dai_link = &at91sam9g20ek_dai,
.num_links = 1,
......@@ -254,7 +254,7 @@ static struct wm8731_setup_data at91sam9g20ek_wm8731_setup = {
};
static struct snd_soc_device at91sam9g20ek_snd_devdata = {
.machine = &snd_soc_machine_at91sam9g20ek,
.card = &snd_soc_at91sam9g20ek,
.platform = &atmel_soc_platform,
.codec_dev = &soc_codec_dev_wm8731,
.codec_data = &at91sam9g20ek_wm8731_setup,
......
......@@ -42,14 +42,14 @@ static struct snd_soc_dai_link au1xpsc_sample_ac97_dai = {
.ops = NULL,
};
static struct snd_soc_machine au1xpsc_sample_ac97_machine = {
static struct snd_soc_card au1xpsc_sample_ac97_machine = {
.name = "Au1xxx PSC AC97 Audio",
.dai_link = &au1xpsc_sample_ac97_dai,
.num_links = 1,
};
static struct snd_soc_device au1xpsc_sample_ac97_devdata = {
.machine = &au1xpsc_sample_ac97_machine,
.card = &au1xpsc_sample_ac97_machine,
.platform = &au1xpsc_soc_platform, /* see dbdma2.c */
.codec_dev = &soc_codec_dev_ac97,
};
......
......@@ -43,7 +43,7 @@
#include "bf5xx-ac97-pcm.h"
#include "bf5xx-ac97.h"
static struct snd_soc_machine bf5xx_board;
static struct snd_soc_card bf5xx_board;
static int bf5xx_board_startup(struct snd_pcm_substream *substream)
{
......@@ -67,14 +67,14 @@ static struct snd_soc_dai_link bf5xx_board_dai = {
.ops = &bf5xx_board_ops,
};
static struct snd_soc_machine bf5xx_board = {
static struct snd_soc_card bf5xx_board = {
.name = "bf5xx-board",
.dai_link = &bf5xx_board_dai,
.num_links = 1,
};
static struct snd_soc_device bf5xx_board_snd_devdata = {
.machine = &bf5xx_board,
.card = &bf5xx_board,
.platform = &bf5xx_ac97_soc_platform,
.codec_dev = &soc_codec_dev_ad1980,
};
......
......@@ -65,7 +65,7 @@
#define GPIO_SE CONFIG_SND_BFIN_AD73311_SE
static struct snd_soc_machine bf5xx_ad73311;
static struct snd_soc_card bf5xx_ad73311;
static int snd_ad73311_startup(void)
{
......@@ -190,7 +190,7 @@ static struct snd_soc_dai_link bf5xx_ad73311_dai = {
.ops = &bf5xx_ad73311_ops,
};
static struct snd_soc_machine bf5xx_ad73311 = {
static struct snd_soc_card bf5xx_ad73311 = {
.name = "bf5xx_ad73311",
.probe = bf5xx_probe,
.dai_link = &bf5xx_ad73311_dai,
......@@ -198,7 +198,7 @@ static struct snd_soc_machine bf5xx_ad73311 = {
};
static struct snd_soc_device bf5xx_ad73311_snd_devdata = {
.machine = &bf5xx_ad73311,
.card = &bf5xx_ad73311,
.platform = &bf5xx_i2s_soc_platform,
.codec_dev = &soc_codec_dev_ad73311,
};
......
......@@ -44,7 +44,7 @@
#include "bf5xx-i2s-pcm.h"
#include "bf5xx-i2s.h"
static struct snd_soc_machine bf5xx_ssm2602;
static struct snd_soc_card bf5xx_ssm2602;
static int bf5xx_ssm2602_startup(struct snd_pcm_substream *substream)
{
......@@ -135,14 +135,14 @@ static struct ssm2602_setup_data bf5xx_ssm2602_setup = {
.i2c_address = 0x1b,
};
static struct snd_soc_machine bf5xx_ssm2602 = {
static struct snd_soc_card bf5xx_ssm2602 = {
.name = "bf5xx_ssm2602",
.dai_link = &bf5xx_ssm2602_dai,
.num_links = 1,
};
static struct snd_soc_device bf5xx_ssm2602_snd_devdata = {
.machine = &bf5xx_ssm2602,
.card = &bf5xx_ssm2602,
.platform = &bf5xx_i2s_soc_platform,
.codec_dev = &soc_codec_dev_ssm2602,
.codec_data = &bf5xx_ssm2602_setup,
......
......@@ -128,7 +128,7 @@ static struct snd_soc_dai_link evm_dai = {
};
/* davinci-evm audio machine driver */
static struct snd_soc_machine snd_soc_machine_evm = {
static struct snd_soc_card snd_soc_card_evm = {
.name = "DaVinci EVM",
.dai_link = &evm_dai,
.num_links = 1,
......@@ -142,7 +142,7 @@ static struct aic3x_setup_data evm_aic3x_setup = {
/* evm audio subsystem */
static struct snd_soc_device evm_snd_devdata = {
.machine = &snd_soc_machine_evm,
.card = &snd_soc_card_evm,
.platform = &davinci_soc_platform,
.codec_dev = &soc_codec_dev_aic3x,
.codec_data = &evm_aic3x_setup,
......
......@@ -375,8 +375,8 @@ static int davinci_i2s_probe(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_machine *machine = socdev->machine;
struct snd_soc_dai *cpu_dai = machine->dai_link[pdev->id].cpu_dai;
struct snd_soc_card *card = socdev->card;
struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai;
struct davinci_mcbsp_dev *dev;
struct resource *mem, *ioarea;
struct evm_snd_platform_data *pdata;
......@@ -437,8 +437,8 @@ static void davinci_i2s_remove(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_machine *machine = socdev->machine;
struct snd_soc_dai *cpu_dai = machine->dai_link[pdev->id].cpu_dai;
struct snd_soc_card *card = socdev->card;
struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai;
struct davinci_mcbsp_dev *dev = cpu_dai->private_data;
struct resource *mem;
......
......@@ -73,7 +73,7 @@ static struct snd_soc_dai_link sffsdr_dai = {
};
/* davinci-sffsdr audio machine driver */
static struct snd_soc_machine snd_soc_machine_sffsdr = {
static struct snd_soc_card snd_soc_sffsdr = {
.name = "DaVinci SFFSDR",
.dai_link = &sffsdr_dai,
.num_links = 1,
......@@ -89,7 +89,7 @@ static struct pcm3008_setup_data sffsdr_pcm3008_setup = {
/* sffsdr audio subsystem */
static struct snd_soc_device sffsdr_snd_devdata = {
.machine = &snd_soc_machine_sffsdr,
.card = &snd_soc_sffsdr,
.platform = &davinci_soc_platform,
.codec_dev = &soc_codec_dev_pcm3008,
.codec_data = &sffsdr_pcm3008_setup,
......
......@@ -284,7 +284,7 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id)
* fsl_dma_new: initialize this PCM driver.
*
* This function is called when the codec driver calls snd_soc_new_pcms(),
* once for each .dai_link in the machine driver's snd_soc_machine
* once for each .dai_link in the machine driver's snd_soc_card
* structure.
*/
static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
......
......@@ -29,7 +29,7 @@
struct mpc8610_hpcd_data {
struct snd_soc_device sound_devdata;
struct snd_soc_dai_link dai;
struct snd_soc_machine machine;
struct snd_soc_card machine;
unsigned int dai_format;
unsigned int codec_clk_direction;
unsigned int cpu_clk_direction;
......@@ -185,7 +185,7 @@ static struct snd_soc_ops mpc8610_hpcd_ops = {
/**
* mpc8610_hpcd_machine: ASoC machine data
*/
static struct snd_soc_machine mpc8610_hpcd_machine = {
static struct snd_soc_card mpc8610_hpcd_machine = {
.probe = mpc8610_hpcd_machine_probe,
.remove = mpc8610_hpcd_machine_remove,
.name = "MPC8610 HPCD",
......@@ -465,7 +465,7 @@ static int mpc8610_hpcd_probe(struct of_device *ofdev,
goto error;
}
machine_data->sound_devdata.machine = &mpc8610_hpcd_machine;
machine_data->sound_devdata.card = &mpc8610_hpcd_machine;
machine_data->sound_devdata.codec_dev = &soc_codec_device_cs4270;
machine_data->sound_devdata.platform = &fsl_soc_platform;
......
......@@ -31,7 +31,7 @@ struct of_snd_soc_device {
int id;
struct list_head list;
struct snd_soc_device device;
struct snd_soc_machine machine;
struct snd_soc_card card;
struct snd_soc_dai_link dai_link;
struct platform_device *pdev;
struct device_node *platform_node;
......@@ -58,9 +58,9 @@ of_snd_soc_get_device(struct device_node *codec_node)
/* Initialize the structure and add it to the global list */
of_soc->codec_node = codec_node;
of_soc->id = of_snd_soc_next_index++;
of_soc->machine.dai_link = &of_soc->dai_link;
of_soc->machine.num_links = 1;
of_soc->device.machine = &of_soc->machine;
of_soc->card.dai_link = &of_soc->dai_link;
of_soc->card.num_links = 1;
of_soc->device.card = &of_soc->card;
of_soc->dai_link.ops = &of_snd_soc_ops;
list_add(&of_soc->list, &of_snd_soc_device_list);
......@@ -159,7 +159,7 @@ int of_snd_soc_register_platform(struct snd_soc_platform *platform,
of_soc->platform_node = node;
of_soc->dai_link.cpu_dai = cpu_dai;
of_soc->device.platform = platform;
of_soc->machine.name = of_soc->dai_link.cpu_dai->name;
of_soc->card.name = of_soc->dai_link.cpu_dai->name;
/* Now try to register the SoC device */
of_snd_soc_register_device(of_soc);
......
......@@ -282,7 +282,7 @@ static struct snd_soc_dai_link n810_dai = {
};
/* Audio machine driver */
static struct snd_soc_machine snd_soc_machine_n810 = {
static struct snd_soc_card snd_soc_n810 = {
.name = "N810",
.dai_link = &n810_dai,
.num_links = 1,
......@@ -298,7 +298,7 @@ static struct aic3x_setup_data n810_aic33_setup = {
/* Audio subsystem */
static struct snd_soc_device n810_snd_devdata = {
.machine = &snd_soc_machine_n810,
.card = &snd_soc_n810,
.platform = &omap_soc_platform,
.codec_dev = &soc_codec_dev_aic3x,
.codec_data = &n810_aic33_setup,
......
......@@ -90,7 +90,7 @@ static struct snd_soc_dai_link omap2evm_dai = {
};
/* Audio machine driver */
static struct snd_soc_machine snd_soc_machine_omap2evm = {
static struct snd_soc_card snd_soc_omap2evm = {
.name = "omap2evm",
.dai_link = &omap2evm_dai,
.num_links = 1,
......@@ -98,7 +98,7 @@ static struct snd_soc_machine snd_soc_machine_omap2evm = {
/* Audio subsystem */
static struct snd_soc_device omap2evm_snd_devdata = {
.machine = &snd_soc_machine_omap2evm,
.card = &snd_soc_omap2evm,
.platform = &omap_soc_platform,
.codec_dev = &soc_codec_dev_twl4030,
};
......
......@@ -88,7 +88,7 @@ static struct snd_soc_dai_link omap3beagle_dai = {
};
/* Audio machine driver */
static struct snd_soc_machine snd_soc_machine_omap3beagle = {
static struct snd_soc_card snd_soc_omap3beagle = {
.name = "omap3beagle",
.dai_link = &omap3beagle_dai,
.num_links = 1,
......@@ -96,7 +96,7 @@ static struct snd_soc_machine snd_soc_machine_omap3beagle = {
/* Audio subsystem */
static struct snd_soc_device omap3beagle_snd_devdata = {
.machine = &snd_soc_machine_omap3beagle,
.card = &snd_soc_omap3beagle,
.platform = &omap_soc_platform,
.codec_dev = &soc_codec_dev_twl4030,
};
......
......@@ -143,7 +143,7 @@ static struct snd_soc_dai_link osk_dai = {
};
/* Audio machine driver */
static struct snd_soc_machine snd_soc_machine_osk = {
static struct snd_soc_card snd_soc_card_osk = {
.name = "OSK5912",
.dai_link = &osk_dai,
.num_links = 1,
......@@ -151,7 +151,7 @@ static struct snd_soc_machine snd_soc_machine_osk = {
/* Audio subsystem */
static struct snd_soc_device osk_snd_devdata = {
.machine = &snd_soc_machine_osk,
.card = &snd_soc_card_osk,
.platform = &omap_soc_platform,
.codec_dev = &soc_codec_dev_tlv320aic23,
};
......
......@@ -88,7 +88,7 @@ static struct snd_soc_dai_link overo_dai = {
};
/* Audio machine driver */
static struct snd_soc_machine snd_soc_machine_overo = {
static struct snd_soc_card snd_soc_card_overo = {
.name = "overo",
.dai_link = &overo_dai,
.num_links = 1,
......@@ -96,7 +96,7 @@ static struct snd_soc_machine snd_soc_machine_overo = {
/* Audio subsystem */
static struct snd_soc_device overo_snd_devdata = {
.machine = &snd_soc_machine_overo,
.card = &snd_soc_card_overo,
.platform = &omap_soc_platform,
.codec_dev = &soc_codec_dev_twl4030,
};
......
......@@ -314,7 +314,7 @@ static struct snd_soc_dai_link corgi_dai = {
};
/* corgi audio machine driver */
static struct snd_soc_machine snd_soc_machine_corgi = {
static struct snd_soc_card snd_soc_corgi = {
.name = "Corgi",
.dai_link = &corgi_dai,
.num_links = 1,
......@@ -328,7 +328,7 @@ static struct wm8731_setup_data corgi_wm8731_setup = {
/* corgi audio subsystem */
static struct snd_soc_device corgi_snd_devdata = {
.machine = &snd_soc_machine_corgi,
.card = &snd_soc_corgi,
.platform = &pxa2xx_soc_platform,
.codec_dev = &soc_codec_dev_wm8731,
.codec_data = &corgi_wm8731_setup,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment