mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
ALSA: asoc: fsl - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
This patch merges struct snd_soc_codec_dai and struct snd_soc_cpu_dai into struct snd_soc_dai for the Freescale PPC platform. Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
e550e17ffe
commit
8cf7b2b393
5 changed files with 18 additions and 18 deletions
|
@ -282,7 +282,7 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id)
|
||||||
* 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_machine
|
||||||
* structure.
|
* structure.
|
||||||
*/
|
*/
|
||||||
static int fsl_dma_new(struct snd_card *card, struct snd_soc_codec_dai *dai,
|
static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
|
||||||
struct snd_pcm *pcm)
|
struct snd_pcm *pcm)
|
||||||
{
|
{
|
||||||
static u64 fsl_dma_dmamask = DMA_BIT_MASK(32);
|
static u64 fsl_dma_dmamask = DMA_BIT_MASK(32);
|
||||||
|
|
|
@ -126,7 +126,7 @@ struct fsl_dma_link_descriptor {
|
||||||
u8 res[4]; /* Reserved */
|
u8 res[4]; /* Reserved */
|
||||||
} __attribute__ ((aligned(32), packed));
|
} __attribute__ ((aligned(32), packed));
|
||||||
|
|
||||||
/* DMA information needed to create a snd_soc_cpu_dai object
|
/* DMA information needed to create a snd_soc_dai object
|
||||||
*
|
*
|
||||||
* ssi_stx_phys: bus address of SSI STX register to use
|
* ssi_stx_phys: bus address of SSI STX register to use
|
||||||
* ssi_srx_phys: bus address of SSI SRX register to use
|
* ssi_srx_phys: bus address of SSI SRX register to use
|
||||||
|
|
|
@ -82,7 +82,7 @@ struct fsl_ssi_private {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
unsigned int playback;
|
unsigned int playback;
|
||||||
unsigned int capture;
|
unsigned int capture;
|
||||||
struct snd_soc_cpu_dai cpu_dai;
|
struct snd_soc_dai cpu_dai;
|
||||||
struct device_attribute dev_attr;
|
struct device_attribute dev_attr;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -479,7 +479,7 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream)
|
||||||
* @freq: the frequency of the given clock ID, currently ignored
|
* @freq: the frequency of the given clock ID, currently ignored
|
||||||
* @dir: SND_SOC_CLOCK_IN (clock slave) or SND_SOC_CLOCK_OUT (clock master)
|
* @dir: SND_SOC_CLOCK_IN (clock slave) or SND_SOC_CLOCK_OUT (clock master)
|
||||||
*/
|
*/
|
||||||
static int fsl_ssi_set_sysclk(struct snd_soc_cpu_dai *cpu_dai,
|
static int fsl_ssi_set_sysclk(struct snd_soc_dai *cpu_dai,
|
||||||
int clk_id, unsigned int freq, int dir)
|
int clk_id, unsigned int freq, int dir)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ static int fsl_ssi_set_sysclk(struct snd_soc_cpu_dai *cpu_dai,
|
||||||
*
|
*
|
||||||
* @format: one of SND_SOC_DAIFMT_xxx
|
* @format: one of SND_SOC_DAIFMT_xxx
|
||||||
*/
|
*/
|
||||||
static int fsl_ssi_set_fmt(struct snd_soc_cpu_dai *cpu_dai, unsigned int format)
|
static int fsl_ssi_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
|
||||||
{
|
{
|
||||||
return (format == SND_SOC_DAIFMT_I2S) ? 0 : -EINVAL;
|
return (format == SND_SOC_DAIFMT_I2S) ? 0 : -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -505,7 +505,7 @@ static int fsl_ssi_set_fmt(struct snd_soc_cpu_dai *cpu_dai, unsigned int format)
|
||||||
/**
|
/**
|
||||||
* fsl_ssi_dai_template: template CPU DAI for the SSI
|
* fsl_ssi_dai_template: template CPU DAI for the SSI
|
||||||
*/
|
*/
|
||||||
static struct snd_soc_cpu_dai fsl_ssi_dai_template = {
|
static struct snd_soc_dai fsl_ssi_dai_template = {
|
||||||
.playback = {
|
.playback = {
|
||||||
/* The SSI does not support monaural audio. */
|
/* The SSI does not support monaural audio. */
|
||||||
.channels_min = 2,
|
.channels_min = 2,
|
||||||
|
@ -569,15 +569,15 @@ static ssize_t fsl_sysfs_ssi_show(struct device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fsl_ssi_create_dai: create a snd_soc_cpu_dai structure
|
* fsl_ssi_create_dai: create a snd_soc_dai structure
|
||||||
*
|
*
|
||||||
* This function is called by the machine driver to create a snd_soc_cpu_dai
|
* This function is called by the machine driver to create a snd_soc_dai
|
||||||
* structure. The function creates an ssi_private object, which contains
|
* structure. The function creates an ssi_private object, which contains
|
||||||
* the snd_soc_cpu_dai. It also creates the sysfs statistics device.
|
* the snd_soc_dai. It also creates the sysfs statistics device.
|
||||||
*/
|
*/
|
||||||
struct snd_soc_cpu_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info)
|
struct snd_soc_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info)
|
||||||
{
|
{
|
||||||
struct snd_soc_cpu_dai *fsl_ssi_dai;
|
struct snd_soc_dai *fsl_ssi_dai;
|
||||||
struct fsl_ssi_private *ssi_private;
|
struct fsl_ssi_private *ssi_private;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct device_attribute *dev_attr;
|
struct device_attribute *dev_attr;
|
||||||
|
@ -588,7 +588,7 @@ struct snd_soc_cpu_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memcpy(&ssi_private->cpu_dai, &fsl_ssi_dai_template,
|
memcpy(&ssi_private->cpu_dai, &fsl_ssi_dai_template,
|
||||||
sizeof(struct snd_soc_cpu_dai));
|
sizeof(struct snd_soc_dai));
|
||||||
|
|
||||||
fsl_ssi_dai = &ssi_private->cpu_dai;
|
fsl_ssi_dai = &ssi_private->cpu_dai;
|
||||||
dev_attr = &ssi_private->dev_attr;
|
dev_attr = &ssi_private->dev_attr;
|
||||||
|
@ -623,11 +623,11 @@ struct snd_soc_cpu_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info)
|
||||||
EXPORT_SYMBOL_GPL(fsl_ssi_create_dai);
|
EXPORT_SYMBOL_GPL(fsl_ssi_create_dai);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fsl_ssi_destroy_dai: destroy the snd_soc_cpu_dai object
|
* fsl_ssi_destroy_dai: destroy the snd_soc_dai object
|
||||||
*
|
*
|
||||||
* This function undoes the operations of fsl_ssi_create_dai()
|
* This function undoes the operations of fsl_ssi_create_dai()
|
||||||
*/
|
*/
|
||||||
void fsl_ssi_destroy_dai(struct snd_soc_cpu_dai *fsl_ssi_dai)
|
void fsl_ssi_destroy_dai(struct snd_soc_dai *fsl_ssi_dai)
|
||||||
{
|
{
|
||||||
struct fsl_ssi_private *ssi_private =
|
struct fsl_ssi_private *ssi_private =
|
||||||
container_of(fsl_ssi_dai, struct fsl_ssi_private, cpu_dai);
|
container_of(fsl_ssi_dai, struct fsl_ssi_private, cpu_dai);
|
||||||
|
|
|
@ -217,8 +217,8 @@ struct fsl_ssi_info {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct snd_soc_cpu_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info);
|
struct snd_soc_dai *fsl_ssi_create_dai(struct fsl_ssi_info *ssi_info);
|
||||||
void fsl_ssi_destroy_dai(struct snd_soc_cpu_dai *fsl_ssi_dai);
|
void fsl_ssi_destroy_dai(struct snd_soc_dai *fsl_ssi_dai);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ static int mpc8610_hpcd_machine_probe(struct platform_device *sound_device)
|
||||||
static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream)
|
static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
|
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
|
||||||
struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai;
|
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
|
||||||
struct mpc8610_hpcd_data *machine_data =
|
struct mpc8610_hpcd_data *machine_data =
|
||||||
rtd->socdev->dev->platform_data;
|
rtd->socdev->dev->platform_data;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue