Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120247
b: refs/heads/master
c: 3ba9e10
h: refs/heads/master
i:
  120245: 9d4d5bf
  120243: dd03ce5
  120239: 577b773
v: v3
  • Loading branch information
Mark Brown committed Nov 24, 2008
1 parent a629375 commit 33187de
Show file tree
Hide file tree
Showing 25 changed files with 22 additions and 64 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b0bd53a7399f65e2d1b37cd44c5003e55b886c1e
refs/heads/master: 3ba9e10a6d3b6abf5f5952572cff8f8d5a35ae54
2 changes: 1 addition & 1 deletion trunk/include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ struct snd_soc_dai {
/* DAI description */
char *name;
unsigned int id;
unsigned char type;
int ac97_control;

/* DAI callbacks */
int (*probe)(struct platform_device *pdev,
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,6 @@ enum snd_soc_bias_level {
SND_SOC_BIAS_OFF,
};

/*
* Digital Audio Interface (DAI) types
*/
#define SND_SOC_DAI_AC97 0x1
#define SND_SOC_DAI_I2S 0x2
#define SND_SOC_DAI_PCM 0x4
#define SND_SOC_DAI_AC97_BUS 0x8 /* for custom i.e. non ac97_codec.c */

struct snd_soc_device;
struct snd_soc_pcm_stream;
struct snd_soc_ops;
Expand Down
3 changes: 0 additions & 3 deletions trunk/sound/soc/atmel/atmel_ssc_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ static int atmel_ssc_resume(struct platform_device *pdev,
struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
{ .name = "atmel-ssc0",
.id = 0,
.type = SND_SOC_DAI_PCM,
.suspend = atmel_ssc_suspend,
.resume = atmel_ssc_resume,
.playback = {
Expand All @@ -727,7 +726,6 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
#if NUM_SSC_DEVICES == 3
{ .name = "atmel-ssc1",
.id = 1,
.type = SND_SOC_DAI_PCM,
.suspend = atmel_ssc_suspend,
.resume = atmel_ssc_resume,
.playback = {
Expand All @@ -751,7 +749,6 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
},
{ .name = "atmel-ssc2",
.id = 2,
.type = SND_SOC_DAI_PCM,
.suspend = atmel_ssc_suspend,
.resume = atmel_ssc_resume,
.playback = {
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/au1x/psc-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static int au1xpsc_ac97_resume(struct platform_device *pdev,

struct snd_soc_dai au1xpsc_ac97_dai = {
.name = "au1xpsc_ac97",
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.probe = au1xpsc_ac97_probe,
.remove = au1xpsc_ac97_remove,
.suspend = au1xpsc_ac97_suspend,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/au1x/psc-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ static int au1xpsc_i2s_resume(struct platform_device *pdev,

struct snd_soc_dai au1xpsc_i2s_dai = {
.name = "au1xpsc_i2s",
.type = SND_SOC_DAI_I2S,
.probe = au1xpsc_i2s_probe,
.remove = au1xpsc_i2s_remove,
.suspend = au1xpsc_i2s_suspend,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/blackfin/bf5xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static void bf5xx_ac97_remove(struct platform_device *pdev,
struct snd_soc_dai bfin_ac97_dai = {
.name = "bf5xx-ac97",
.id = 0,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.probe = bf5xx_ac97_probe,
.remove = bf5xx_ac97_remove,
.suspend = bf5xx_ac97_suspend,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/blackfin/bf5xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ static int bf5xx_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai bf5xx_i2s_dai = {
.name = "bf5xx-i2s",
.id = 0,
.type = SND_SOC_DAI_I2S,
.probe = bf5xx_i2s_probe,
.remove = bf5xx_i2s_remove,
.suspend = bf5xx_i2s_suspend,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,

struct snd_soc_dai ac97_dai = {
.name = "AC97 HiFi",
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.playback = {
.stream_name = "AC97 Playback",
.channels_min = 1,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/codecs/pcm3008.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

struct snd_soc_dai pcm3008_dai = {
.name = "PCM3008 HiFi",
.type = SND_SOC_DAI_I2S,
.playback = {
.stream_name = "PCM3008 Playback",
.channels_min = 1,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/wm9712.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai wm9712_dai[] = {
{
.name = "AC97 HiFi",
.type = SND_SOC_DAI_AC97_BUS,
.ac97_control = 1,
.playback = {
.stream_name = "HiFi Playback",
.channels_min = 1,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/wm9713.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai wm9713_dai[] = {
{
.name = "AC97 HiFi",
.type = SND_SOC_DAI_AC97_BUS,
.ac97_control = 1,
.playback = {
.stream_name = "HiFi Playback",
.channels_min = 1,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/davinci/davinci-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ static void davinci_i2s_remove(struct platform_device *pdev,
struct snd_soc_dai davinci_i2s_dai = {
.name = "davinci-i2s",
.id = 0,
.type = SND_SOC_DAI_I2S,
.probe = davinci_i2s_probe,
.remove = davinci_i2s_remove,
.playback = {
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/fsl/mpc5200_psc_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
* psc_i2s_dai_template: template CPU Digital Audio Interface
*/
static struct snd_soc_dai psc_i2s_dai_template = {
.type = SND_SOC_DAI_I2S,
.playback = {
.channels_min = 2,
.channels_max = 2,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/omap/omap-mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
{ \
.name = "omap-mcbsp-dai-"#link_id, \
.id = (link_id), \
.type = SND_SOC_DAI_I2S, \
.playback = { \
.channels_min = 2, \
.channels_max = 2, \
Expand Down
4 changes: 0 additions & 4 deletions trunk/sound/soc/pxa/pxa-ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
{
.name = "pxa2xx-ssp1",
.id = 0,
.type = SND_SOC_DAI_PCM,
.probe = pxa_ssp_probe,
.remove = pxa_ssp_remove,
.suspend = pxa_ssp_suspend,
Expand Down Expand Up @@ -820,7 +819,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
},
{ .name = "pxa2xx-ssp2",
.id = 1,
.type = SND_SOC_DAI_PCM,
.probe = pxa_ssp_probe,
.remove = pxa_ssp_remove,
.suspend = pxa_ssp_suspend,
Expand Down Expand Up @@ -853,7 +851,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
{
.name = "pxa2xx-ssp3",
.id = 2,
.type = SND_SOC_DAI_PCM,
.probe = pxa_ssp_probe,
.remove = pxa_ssp_remove,
.suspend = pxa_ssp_suspend,
Expand Down Expand Up @@ -886,7 +883,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
{
.name = "pxa2xx-ssp4",
.id = 3,
.type = SND_SOC_DAI_PCM,
.probe = pxa_ssp_probe,
.remove = pxa_ssp_remove,
.suspend = pxa_ssp_suspend,
Expand Down
6 changes: 3 additions & 3 deletions trunk/sound/soc/pxa/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
{
.name = "pxa2xx-ac97",
.id = 0,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.probe = pxa2xx_ac97_probe,
.remove = pxa2xx_ac97_remove,
.suspend = pxa2xx_ac97_suspend,
Expand All @@ -196,7 +196,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
{
.name = "pxa2xx-ac97-aux",
.id = 1,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.playback = {
.stream_name = "AC97 Aux Playback",
.channels_min = 1,
Expand All @@ -215,7 +215,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
{
.name = "pxa2xx-ac97-mic",
.id = 2,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.capture = {
.stream_name = "AC97 Mic Capture",
.channels_min = 1,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/pxa/pxa2xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ static int pxa2xx_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai pxa_i2s_dai = {
.name = "pxa2xx-i2s",
.id = 0,
.type = SND_SOC_DAI_I2S,
.suspend = pxa2xx_i2s_suspend,
.resume = pxa2xx_i2s_resume,
.playback = {
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/s3c24xx/neo1973_wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
static struct snd_soc_dai bt_dai = {
.name = "Bluetooth",
.id = 0,
.type = SND_SOC_DAI_PCM,
.playback = {
.channels_min = 1,
.channels_max = 1,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/s3c24xx/s3c2412-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ static int s3c2412_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai s3c2412_i2s_dai = {
.name = "s3c2412-i2s",
.id = 0,
.type = SND_SOC_DAI_I2S,
.probe = s3c2412_i2s_probe,
.suspend = s3c2412_i2s_suspend,
.resume = s3c2412_i2s_resume,
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/soc/s3c24xx/s3c2443-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
{
.name = "s3c2443-ac97",
.id = 0,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.probe = s3c2443_ac97_probe,
.remove = s3c2443_ac97_remove,
.playback = {
Expand All @@ -380,7 +380,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
{
.name = "pxa2xx-ac97-mic",
.id = 1,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.capture = {
.stream_name = "AC97 Mic Capture",
.channels_min = 1,
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/soc/s3c24xx/s3c24xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ static int s3c24xx_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai s3c24xx_i2s_dai = {
.name = "s3c24xx-i2s",
.id = 0,
.type = SND_SOC_DAI_I2S,
.probe = s3c24xx_i2s_probe,
.suspend = s3c24xx_i2s_suspend,
.resume = s3c24xx_i2s_resume,
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/soc/sh/hac.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ struct snd_soc_dai sh4_hac_dai[] = {
{
.name = "HAC0",
.id = 0,
.type = SND_SOC_DAI_AC97,
.ac97_control = 1,
.playback = {
.rates = AC97_RATES,
.formats = AC97_FMTS,
Expand All @@ -291,8 +291,8 @@ struct snd_soc_dai sh4_hac_dai[] = {
#ifdef CONFIG_CPU_SUBTYPE_SH7760
{
.name = "HAC1",
.ac97_control = 1,
.id = 1,
.type = SND_SOC_DAI_AC97,
.playback = {
.rates = AC97_RATES,
.formats = AC97_FMTS,
Expand Down
2 changes: 0 additions & 2 deletions trunk/sound/soc/sh/ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
{
.name = "SSI0",
.id = 0,
.type = SND_SOC_DAI_I2S,
.playback = {
.rates = SSI_RATES,
.formats = SSI_FMTS,
Expand All @@ -367,7 +366,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
{
.name = "SSI1",
.id = 1,
.type = SND_SOC_DAI_I2S,
.playback = {
.rates = SSI_RATES,
.formats = SSI_FMTS,
Expand Down
31 changes: 8 additions & 23 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,6 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
}
#endif

static inline const char *get_dai_name(int type)
{
switch (type) {
case SND_SOC_DAI_AC97_BUS:
case SND_SOC_DAI_AC97:
return "AC97";
case SND_SOC_DAI_I2S:
return "I2S";
case SND_SOC_DAI_PCM:
return "PCM";
}
return NULL;
}

/*
* Called by ALSA when a PCM substream is opened, the runtime->hw record is
* then initialized and any private data can be allocated. This also calls
Expand Down Expand Up @@ -652,7 +638,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97)
if (cpu_dai->suspend && !cpu_dai->ac97_control)
cpu_dai->suspend(pdev, cpu_dai);
if (platform->suspend)
platform->suspend(pdev, cpu_dai);
Expand All @@ -678,7 +664,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97)
if (cpu_dai->suspend && cpu_dai->ac97_control)
cpu_dai->suspend(pdev, cpu_dai);
}

Expand Down Expand Up @@ -714,7 +700,7 @@ static void soc_resume_deferred(struct work_struct *work)

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97)
if (cpu_dai->resume && cpu_dai->ac97_control)
cpu_dai->resume(pdev, cpu_dai);
}

Expand All @@ -741,7 +727,7 @@ static void soc_resume_deferred(struct work_struct *work)

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97)
if (cpu_dai->resume && !cpu_dai->ac97_control)
cpu_dai->resume(pdev, cpu_dai);
if (platform->resume)
platform->resume(pdev, cpu_dai);
Expand Down Expand Up @@ -898,8 +884,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
codec_dai->codec = socdev->codec;

/* check client and interface hw capabilities */
sprintf(new_name, "%s %s-%s-%d", dai_link->stream_name, codec_dai->name,
get_dai_name(cpu_dai->type), num);
sprintf(new_name, "%s %s-%d", dai_link->stream_name, codec_dai->name,
num);

if (codec_dai->playback.channels_min)
playback = 1;
Expand Down Expand Up @@ -1270,8 +1256,7 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
continue;
}
}
if (card->dai_link[i].codec_dai->type ==
SND_SOC_DAI_AC97_BUS)
if (card->dai_link[i].codec_dai->ac97_control)
ac97 = 1;
}
snprintf(codec->card->shortname, sizeof(codec->card->shortname),
Expand Down Expand Up @@ -1335,7 +1320,7 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev)
#ifdef CONFIG_SND_SOC_AC97_BUS
for (i = 0; i < codec->num_dai; i++) {
codec_dai = &codec->dai[i];
if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) {
if (codec_dai->ac97_control && codec->ac97) {
soc_ac97_dev_unregister(codec);
goto free_card;
}
Expand Down

0 comments on commit 33187de

Please sign in to comment.