Skip to content

Commit

Permalink
ASoC: Merge dai_ops factor out
Browse files Browse the repository at this point in the history
Merge Eric Maio's patch to merge snd_soc_dai_ops out of line.  Fixed
merge issues and updated drivers, plus an issue with the ops for the two
s3c2443 AC97 DAIs having been merged.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Mar 11, 2009
2 parents 5314adc + 6335d05 commit 65ec1cd
Show file tree
Hide file tree
Showing 42 changed files with 495 additions and 433 deletions.
2 changes: 1 addition & 1 deletion include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ struct snd_soc_dai {
int (*resume)(struct snd_soc_dai *dai);

/* ops */
struct snd_soc_dai_ops ops;
struct snd_soc_dai_ops *ops;

/* DAI capabilities */
struct snd_soc_pcm_stream capture;
Expand Down
33 changes: 12 additions & 21 deletions sound/soc/atmel/atmel_ssc_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,15 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops atmel_ssc_dai_ops = {
.startup = atmel_ssc_startup,
.shutdown = atmel_ssc_shutdown,
.prepare = atmel_ssc_prepare,
.hw_params = atmel_ssc_hw_params,
.set_fmt = atmel_ssc_set_dai_fmt,
.set_clkdiv = atmel_ssc_set_dai_clkdiv,
};

struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
{ .name = "atmel-ssc0",
.id = 0,
Expand All @@ -712,13 +721,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
.channels_max = 2,
.rates = ATMEL_SSC_RATES,
.formats = ATMEL_SSC_FORMATS,},
.ops = {
.startup = atmel_ssc_startup,
.shutdown = atmel_ssc_shutdown,
.prepare = atmel_ssc_prepare,
.hw_params = atmel_ssc_hw_params,
.set_fmt = atmel_ssc_set_dai_fmt,
.set_clkdiv = atmel_ssc_set_dai_clkdiv,},
.ops = &atmel_ssc_dai_ops,
.private_data = &ssc_info[0],
},
#if NUM_SSC_DEVICES == 3
Expand All @@ -736,13 +739,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
.channels_max = 2,
.rates = ATMEL_SSC_RATES,
.formats = ATMEL_SSC_FORMATS,},
.ops = {
.startup = atmel_ssc_startup,
.shutdown = atmel_ssc_shutdown,
.prepare = atmel_ssc_prepare,
.hw_params = atmel_ssc_hw_params,
.set_fmt = atmel_ssc_set_dai_fmt,
.set_clkdiv = atmel_ssc_set_dai_clkdiv,},
.ops = &atmel_ssc_dai_ops,
.private_data = &ssc_info[1],
},
{ .name = "atmel-ssc2",
Expand All @@ -759,13 +756,7 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
.channels_max = 2,
.rates = ATMEL_SSC_RATES,
.formats = ATMEL_SSC_FORMATS,},
.ops = {
.startup = atmel_ssc_startup,
.shutdown = atmel_ssc_shutdown,
.prepare = atmel_ssc_prepare,
.hw_params = atmel_ssc_hw_params,
.set_fmt = atmel_ssc_set_dai_fmt,
.set_clkdiv = atmel_ssc_set_dai_clkdiv,},
.ops = &atmel_ssc_dai_ops,
.private_data = &ssc_info[2],
},
#endif
Expand Down
10 changes: 6 additions & 4 deletions sound/soc/au1x/psc-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ static int au1xpsc_ac97_resume(struct snd_soc_dai *dai)
return 0;
}

static struct snd_soc_dai_ops au1xpsc_ac97_dai_ops = {
.trigger = au1xpsc_ac97_trigger,
.hw_params = au1xpsc_ac97_hw_params,
};

struct snd_soc_dai au1xpsc_ac97_dai = {
.name = "au1xpsc_ac97",
.ac97_control = 1,
Expand All @@ -361,10 +366,7 @@ struct snd_soc_dai au1xpsc_ac97_dai = {
.channels_min = 2,
.channels_max = 2,
},
.ops = {
.trigger = au1xpsc_ac97_trigger,
.hw_params = au1xpsc_ac97_hw_params,
},
.ops = &au1xpsc_ac97_dai_ops,
};
EXPORT_SYMBOL_GPL(au1xpsc_ac97_dai);

Expand Down
12 changes: 7 additions & 5 deletions sound/soc/au1x/psc-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ static int au1xpsc_i2s_resume(struct snd_soc_dai *cpu_dai)
return 0;
}

static struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = {
.trigger = au1xpsc_i2s_trigger,
.hw_params = au1xpsc_i2s_hw_params,
.set_fmt = au1xpsc_i2s_set_fmt,
};

struct snd_soc_dai au1xpsc_i2s_dai = {
.name = "au1xpsc_i2s",
.probe = au1xpsc_i2s_probe,
Expand All @@ -385,11 +391,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = {
.channels_min = 2,
.channels_max = 8, /* 2 without external help */
},
.ops = {
.trigger = au1xpsc_i2s_trigger,
.hw_params = au1xpsc_i2s_hw_params,
.set_fmt = au1xpsc_i2s_set_fmt,
},
.ops = &au1xpsc_i2s_dai_ops,
};
EXPORT_SYMBOL(au1xpsc_i2s_dai);

Expand Down
14 changes: 8 additions & 6 deletions sound/soc/blackfin/bf5xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ static int bf5xx_i2s_resume(struct platform_device *pdev,
#define BF5XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops bf5xx_i2s_dai_ops = {
.startup = bf5xx_i2s_startup,
.shutdown = bf5xx_i2s_shutdown,
.hw_params = bf5xx_i2s_hw_params,
.set_fmt = bf5xx_i2s_set_dai_fmt,
};

struct snd_soc_dai bf5xx_i2s_dai = {
.name = "bf5xx-i2s",
.id = 0,
Expand All @@ -304,12 +311,7 @@ struct snd_soc_dai bf5xx_i2s_dai = {
.channels_max = 2,
.rates = BF5XX_I2S_RATES,
.formats = BF5XX_I2S_FORMATS,},
.ops = {
.startup = bf5xx_i2s_startup,
.shutdown = bf5xx_i2s_shutdown,
.hw_params = bf5xx_i2s_hw_params,
.set_fmt = bf5xx_i2s_set_dai_fmt,
},
.ops = &bf5xx_i2s_dai_ops,
};
EXPORT_SYMBOL_GPL(bf5xx_i2s_dai);

Expand Down
7 changes: 5 additions & 2 deletions sound/soc/codecs/ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
SNDRV_PCM_RATE_48000)

static struct snd_soc_dai_ops ac97_dai_ops = {
.prepare = ac97_prepare,
};

struct snd_soc_dai ac97_dai = {
.name = "AC97 HiFi",
.ac97_control = 1,
Expand All @@ -56,8 +60,7 @@ struct snd_soc_dai ac97_dai = {
.channels_max = 2,
.rates = STD_AC97_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
.ops = {
.prepare = ac97_prepare,},
.ops = &ac97_dai_ops,
};
EXPORT_SYMBOL_GPL(ac97_dai);

Expand Down
10 changes: 6 additions & 4 deletions sound/soc/codecs/ak4104.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream,
return ak4104_spi_write(codec, AK4104_REG_CHN_STATUS(3), val);
}

static struct snd_soc_dai_ops ak4101_dai_ops = {
.hw_params = ak4104_hw_params,
.set_fmt = ak4104_set_dai_fmt,
};

struct snd_soc_dai ak4104_dai = {
.name = DRV_NAME,
.playback = {
Expand All @@ -187,10 +192,7 @@ struct snd_soc_dai ak4104_dai = {
SNDRV_PCM_FMTBIT_S24_3LE |
SNDRV_PCM_FMTBIT_S24_LE
},
.ops = {
.hw_params = ak4104_hw_params,
.set_fmt = ak4104_set_dai_fmt,
}
.ops = &ak4101_dai_ops,
};

static struct snd_soc_codec *ak4104_codec;
Expand Down
14 changes: 8 additions & 6 deletions sound/soc/codecs/ak4535.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)

static struct snd_soc_dai_ops ak4535_dai_ops = {
.hw_params = ak4535_hw_params,
.set_fmt = ak4535_set_dai_fmt,
.digital_mute = ak4535_mute,
.set_sysclk = ak4535_set_dai_sysclk,
};

struct snd_soc_dai ak4535_dai = {
.name = "AK4535",
.playback = {
Expand All @@ -435,12 +442,7 @@ struct snd_soc_dai ak4535_dai = {
.channels_max = 2,
.rates = AK4535_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,},
.ops = {
.hw_params = ak4535_hw_params,
.set_fmt = ak4535_set_dai_fmt,
.digital_mute = ak4535_mute,
.set_sysclk = ak4535_set_dai_sysclk,
},
.ops = &ak4535_dai_ops,
};
EXPORT_SYMBOL_GPL(ak4535_dai);

Expand Down
14 changes: 8 additions & 6 deletions sound/soc/codecs/cs4270.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,13 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = {
*/
static struct snd_soc_codec *cs4270_codec;

static struct snd_soc_dai_ops cs4270_dai_ops = {
.hw_params = cs4270_hw_params,
.set_sysclk = cs4270_set_dai_sysclk,
.set_fmt = cs4270_set_dai_fmt,
.digital_mute = cs4270_mute,
};

struct snd_soc_dai cs4270_dai = {
.name = "cs4270",
.playback = {
Expand All @@ -518,12 +525,7 @@ struct snd_soc_dai cs4270_dai = {
.rates = 0,
.formats = CS4270_FORMATS,
},
.ops = {
.hw_params = cs4270_hw_params,
.set_sysclk = cs4270_set_dai_sysclk,
.set_fmt = cs4270_set_dai_fmt,
.digital_mute = cs4270_mute,
},
.ops = &cs4270_dai_ops,
};
EXPORT_SYMBOL_GPL(cs4270_dai);

Expand Down
20 changes: 11 additions & 9 deletions sound/soc/codecs/ssm2602.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,16 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,
#define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops ssm2602_dai_ops = {
.startup = ssm2602_startup,
.prepare = ssm2602_pcm_prepare,
.hw_params = ssm2602_hw_params,
.shutdown = ssm2602_shutdown,
.digital_mute = ssm2602_mute,
.set_sysclk = ssm2602_set_dai_sysclk,
.set_fmt = ssm2602_set_dai_fmt,
};

struct snd_soc_dai ssm2602_dai = {
.name = "SSM2602",
.playback = {
Expand All @@ -520,15 +530,7 @@ struct snd_soc_dai ssm2602_dai = {
.channels_max = 2,
.rates = SSM2602_RATES,
.formats = SSM2602_FORMATS,},
.ops = {
.startup = ssm2602_startup,
.prepare = ssm2602_pcm_prepare,
.hw_params = ssm2602_hw_params,
.shutdown = ssm2602_shutdown,
.digital_mute = ssm2602_mute,
.set_sysclk = ssm2602_set_dai_sysclk,
.set_fmt = ssm2602_set_dai_fmt,
}
.ops = &ssm2602_dai_ops,
};
EXPORT_SYMBOL_GPL(ssm2602_dai);

Expand Down
18 changes: 10 additions & 8 deletions sound/soc/codecs/tlv320aic23.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,15 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
#define AIC23_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops tlv320aic23_dai_ops = {
.prepare = tlv320aic23_pcm_prepare,
.hw_params = tlv320aic23_hw_params,
.shutdown = tlv320aic23_shutdown,
.digital_mute = tlv320aic23_mute,
.set_fmt = tlv320aic23_set_dai_fmt,
.set_sysclk = tlv320aic23_set_dai_sysclk,
};

struct snd_soc_dai tlv320aic23_dai = {
.name = "tlv320aic23",
.playback = {
Expand All @@ -594,14 +603,7 @@ struct snd_soc_dai tlv320aic23_dai = {
.channels_max = 2,
.rates = AIC23_RATES,
.formats = AIC23_FORMATS,},
.ops = {
.prepare = tlv320aic23_pcm_prepare,
.hw_params = tlv320aic23_hw_params,
.shutdown = tlv320aic23_shutdown,
.digital_mute = tlv320aic23_mute,
.set_fmt = tlv320aic23_set_dai_fmt,
.set_sysclk = tlv320aic23_set_dai_sysclk,
}
.ops = &tlv320aic23_dai_ops,
};
EXPORT_SYMBOL_GPL(tlv320aic23_dai);

Expand Down
14 changes: 8 additions & 6 deletions sound/soc/codecs/tlv320aic26.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
#define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\
SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE)

static struct snd_soc_dai_ops aic26_dai_ops = {
.hw_params = aic26_hw_params,
.digital_mute = aic26_mute,
.set_sysclk = aic26_set_sysclk,
.set_fmt = aic26_set_fmt,
};

struct snd_soc_dai aic26_dai = {
.name = "tlv320aic26",
.playback = {
Expand All @@ -286,12 +293,7 @@ struct snd_soc_dai aic26_dai = {
.rates = AIC26_RATES,
.formats = AIC26_FORMATS,
},
.ops = {
.hw_params = aic26_hw_params,
.digital_mute = aic26_mute,
.set_sysclk = aic26_set_sysclk,
.set_fmt = aic26_set_fmt,
},
.ops = &aic26_dai_ops,
};
EXPORT_SYMBOL_GPL(aic26_dai);

Expand Down
14 changes: 8 additions & 6 deletions sound/soc/codecs/tlv320aic3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,13 @@ EXPORT_SYMBOL_GPL(aic3x_button_pressed);
#define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops aic3x_dai_ops = {
.hw_params = aic3x_hw_params,
.digital_mute = aic3x_mute,
.set_sysclk = aic3x_set_dai_sysclk,
.set_fmt = aic3x_set_dai_fmt,
};

struct snd_soc_dai aic3x_dai = {
.name = "tlv320aic3x",
.playback = {
Expand All @@ -1102,12 +1109,7 @@ struct snd_soc_dai aic3x_dai = {
.channels_max = 2,
.rates = AIC3X_RATES,
.formats = AIC3X_FORMATS,},
.ops = {
.hw_params = aic3x_hw_params,
.digital_mute = aic3x_mute,
.set_sysclk = aic3x_set_dai_sysclk,
.set_fmt = aic3x_set_dai_fmt,
}
.ops = &aic3x_dai_ops,
};
EXPORT_SYMBOL_GPL(aic3x_dai);

Expand Down
Loading

0 comments on commit 65ec1cd

Please sign in to comment.