Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120174
b: refs/heads/master
c: 911fc25
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Oct 27, 2008
1 parent 4b49e84 commit 9f12dce
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 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: 6b9331165e9827e055389e22d1cbdb5fe3cff835
refs/heads/master: 911fc25dda145f4f7313535466eec0c9f4a51ea1
12 changes: 3 additions & 9 deletions trunk/sound/soc/at32/playpaq_wm8510.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,14 @@ static const struct snd_soc_dapm_widget playpaq_dapm_widgets[] = {



static const char *intercon[][3] = {
static const struct snd_soc_dapm_route intercon[] = {
/* speaker connected to SPKOUT */
{"Ext Spk", NULL, "SPKOUTP"},
{"Ext Spk", NULL, "SPKOUTN"},

{"Mic Bias", NULL, "Int Mic"},
{"MICN", NULL, "Mic Bias"},
{"MICP", NULL, "Mic Bias"},

/* Terminator */
{NULL, NULL, NULL},
};


Expand All @@ -334,11 +331,8 @@ static int playpaq_wm8510_init(struct snd_soc_codec *codec)
/*
* Setup audio path interconnects
*/
for (i = 0; intercon[i][0] != NULL; i++) {
snd_soc_dapm_connect_input(codec,
intercon[i][0],
intercon[i][1], intercon[i][2]);
}
snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));



/* always connected pins */
Expand Down
16 changes: 10 additions & 6 deletions trunk/sound/soc/codecs/tlv320aic3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,17 +863,21 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
return -EINVAL;
}

/* interface format */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
/*
* match both interface format and signal polarities since they
* are fixed
*/
switch (fmt & (SND_SOC_DAIFMT_FORMAT_MASK |
SND_SOC_DAIFMT_INV_MASK)) {
case (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF):
break;
case SND_SOC_DAIFMT_DSP_A:
case (SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF):
iface_breg |= (0x01 << 6);
break;
case SND_SOC_DAIFMT_RIGHT_J:
case (SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_NB_NF):
iface_breg |= (0x02 << 6);
break;
case SND_SOC_DAIFMT_LEFT_J:
case (SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF):
iface_breg |= (0x03 << 6);
break;
default:
Expand Down
19 changes: 16 additions & 3 deletions trunk/sound/soc/omap/omap-mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
struct omap_mcbsp_data {
unsigned int bus_id;
struct omap_mcbsp_reg_cfg regs;
unsigned int fmt;
/*
* Flags indicating is the bus already activated and configured by
* another substream
Expand Down Expand Up @@ -200,6 +201,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id;
int wlen;
unsigned long port;

if (cpu_class_is_omap1()) {
Expand Down Expand Up @@ -244,19 +246,29 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
/* Set word lengths */
wlen = 16;
regs->rcr2 |= RWDLEN2(OMAP_MCBSP_WORD_16);
regs->rcr1 |= RWDLEN1(OMAP_MCBSP_WORD_16);
regs->xcr2 |= XWDLEN2(OMAP_MCBSP_WORD_16);
regs->xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_16);
/* Set FS period and length in terms of bit clock periods */
regs->srgr2 |= FPER(16 * 2 - 1);
regs->srgr1 |= FWID(16 - 1);
break;
default:
/* Unsupported PCM format */
return -EINVAL;
}

/* Set FS period and length in terms of bit clock periods */
switch (mcbsp_data->fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
regs->srgr2 |= FPER(wlen * 2 - 1);
regs->srgr1 |= FWID(wlen - 1);
break;
case SND_SOC_DAIFMT_DSP_A:
regs->srgr2 |= FPER(wlen * 2 - 1);
regs->srgr1 |= FWID(wlen * 2 - 2);
break;
}

omap_mcbsp_config(bus_id, &mcbsp_data->regs);
mcbsp_data->configured = 1;

Expand All @@ -276,6 +288,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
if (mcbsp_data->configured)
return 0;

mcbsp_data->fmt = fmt;
memset(regs, 0, sizeof(*regs));
/* Generic McBSP register settings */
regs->spcr2 |= XINTM(3) | FREE;
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ int snd_soc_dapm_sys_add(struct device *dev)
return ret;

asoc_debugfs = debugfs_create_dir("asoc", NULL);
if (!IS_ERR(asoc_debugfs))
if (!IS_ERR(asoc_debugfs) && asoc_debugfs)
debugfs_create_u32("dapm_pop_time", 0744, asoc_debugfs,
&pop_time);
else
Expand Down

0 comments on commit 9f12dce

Please sign in to comment.