Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117883
b: refs/heads/master
c: 0a9b863
h: refs/heads/master
i:
  117881: 37208ba
  117879: bdfc8ea
v: v3
  • Loading branch information
Takashi Iwai committed Oct 27, 2008
1 parent 2094f74 commit 81aac23
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 40 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: 2f5ad54ea6e2e38156bfb889964deee991f3087a
refs/heads/master: 0a9b86381c76e9d33a9b6edb66aef32d7a3306e3
6 changes: 3 additions & 3 deletions trunk/sound/aoa/soundbus/i2sbus/i2sbus-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
struct i2sbus_dev *dev;
struct device_node *child = NULL, *sound = NULL;
struct resource *r;
int i, layout = 0, rlen;
int i, layout = 0, rlen, ok = force;
static const char *rnames[] = { "i2sbus: %s (control)",
"i2sbus: %s (tx)",
"i2sbus: %s (rx)" };
Expand Down Expand Up @@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
layout = *layout_id;
snprintf(dev->sound.modalias, 32,
"sound-layout-%d", layout);
force = 1;
ok = 1;
}
}
/* for the time being, until we can handle non-layout-id
Expand All @@ -201,7 +201,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
* When there are two i2s busses and only one has a layout-id,
* then this depends on the order, but that isn't important
* either as the second one in that case is just a modem. */
if (!force) {
if (!ok) {
kfree(dev);
return -ENODEV;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/arm/pxa2xx-pcm-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
goto out;

ret = -ENOMEM;
rtd = kmalloc(sizeof(*rtd), GFP_KERNEL);
rtd = kzalloc(sizeof(*rtd), GFP_KERNEL);
if (!rtd)
goto out;
rtd->dma_desc_array =
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/oss/kahlua.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Initialisation code for Cyrix/NatSemi VSA1 softaudio
*
* (C) Copyright 2003 Red Hat Inc <alan@redhat.com>
* (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
*
* XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
* The older version (VSA1) provides fairly good soundblaster emulation
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio
*
* (C) Copyright 2007 Ash Willis <ashwillis@programmer.net>
* (C) Copyright 2003 Red Hat Inc <alan@redhat.com>
* (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
*
* This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did
* mess with it a bit. The chip seems to have to have trouble with full duplex
Expand Down
99 changes: 91 additions & 8 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ struct alc_spec {
/* for PLL fix */
hda_nid_t pll_nid;
unsigned int pll_coef_idx, pll_coef_bit;

#ifdef SND_HDA_NEEDS_RESUME
#define ALC_MAX_PINS 16
unsigned int num_pins;
hda_nid_t pin_nids[ALC_MAX_PINS];
unsigned int pin_cfgs[ALC_MAX_PINS];
#endif
};

/*
Expand Down Expand Up @@ -2778,6 +2785,64 @@ static void alc_free(struct hda_codec *codec)
codec->spec = NULL; /* to be sure */
}

#ifdef SND_HDA_NEEDS_RESUME
static void store_pin_configs(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
hda_nid_t nid, end_nid;

end_nid = codec->start_nid + codec->num_nodes;
for (nid = codec->start_nid; nid < end_nid; nid++) {
unsigned int wid_caps = get_wcaps(codec, nid);
unsigned int wid_type =
(wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
if (wid_type != AC_WID_PIN)
continue;
if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids))
break;
spec->pin_nids[spec->num_pins] = nid;
spec->pin_cfgs[spec->num_pins] =
snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CONFIG_DEFAULT, 0);
spec->num_pins++;
}
}

static void resume_pin_configs(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
int i;

for (i = 0; i < spec->num_pins; i++) {
hda_nid_t pin_nid = spec->pin_nids[i];
unsigned int pin_config = spec->pin_cfgs[i];
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_0,
pin_config & 0x000000ff);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_1,
(pin_config & 0x0000ff00) >> 8);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_2,
(pin_config & 0x00ff0000) >> 16);
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
pin_config >> 24);
}
}

static int alc_resume(struct hda_codec *codec)
{
resume_pin_configs(codec);
codec->patch_ops.init(codec);
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
return 0;
}
#else
#define store_pin_configs(codec)
#endif

/*
*/
static struct hda_codec_ops alc_patch_ops = {
Expand All @@ -2786,6 +2851,9 @@ static struct hda_codec_ops alc_patch_ops = {
.init = alc_init,
.free = alc_free,
.unsol_event = alc_unsol_event,
#ifdef SND_HDA_NEEDS_RESUME
.resume = alc_resume,
#endif
#ifdef CONFIG_SND_HDA_POWER_SAVE
.check_power_status = alc_check_power_status,
#endif
Expand Down Expand Up @@ -3832,6 +3900,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
spec->num_mux_defs = 1;
spec->input_mux = &spec->private_imux;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -4996,7 +5065,7 @@ static struct hda_verb alc260_test_init_verbs[] = {
*/

static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
const char *pfx)
const char *pfx, int *vol_bits)
{
hda_nid_t nid_vol;
unsigned long vol_val, sw_val;
Expand All @@ -5018,10 +5087,14 @@ static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
} else
return 0; /* N/A */

snprintf(name, sizeof(name), "%s Playback Volume", pfx);
err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
if (err < 0)
return err;
if (!(*vol_bits & (1 << nid_vol))) {
/* first control for the volume widget */
snprintf(name, sizeof(name), "%s Playback Volume", pfx);
err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
if (err < 0)
return err;
*vol_bits |= (1 << nid_vol);
}
snprintf(name, sizeof(name), "%s Playback Switch", pfx);
err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, sw_val);
if (err < 0)
Expand All @@ -5035,28 +5108,30 @@ static int alc260_auto_create_multi_out_ctls(struct alc_spec *spec,
{
hda_nid_t nid;
int err;
int vols = 0;

spec->multiout.num_dacs = 1;
spec->multiout.dac_nids = spec->private_dac_nids;
spec->multiout.dac_nids[0] = 0x02;

nid = cfg->line_out_pins[0];
if (nid) {
err = alc260_add_playback_controls(spec, nid, "Front");
err = alc260_add_playback_controls(spec, nid, "Front", &vols);
if (err < 0)
return err;
}

nid = cfg->speaker_pins[0];
if (nid) {
err = alc260_add_playback_controls(spec, nid, "Speaker");
err = alc260_add_playback_controls(spec, nid, "Speaker", &vols);
if (err < 0)
return err;
}

nid = cfg->hp_pins[0];
if (nid) {
err = alc260_add_playback_controls(spec, nid, "Headphone");
err = alc260_add_playback_controls(spec, nid, "Headphone",
&vols);
if (err < 0)
return err;
}
Expand Down Expand Up @@ -5244,6 +5319,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
}
spec->num_mixers++;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -10307,6 +10383,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -11441,6 +11518,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -12224,6 +12302,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
spec->mixers[spec->num_mixers] = alc269_capture_mixer;
spec->num_mixers++;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -13310,6 +13389,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
spec->mixers[spec->num_mixers] = alc861_capture_mixer;
spec->num_mixers++;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -14421,6 +14501,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
if (err < 0)
return err;

store_pin_configs(codec);
return 1;
}

Expand Down Expand Up @@ -16252,6 +16333,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)

spec->mixers[spec->num_mixers] = alc662_capture_mixer;
spec->num_mixers++;

store_pin_configs(codec);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ static int stac92xx_build_controls(struct hda_codec *codec)
return err;
spec->multiout.share_spdif = 1;
}
if (spec->dig_in_nid && (!spec->gpio_dir & 0x01)) {
if (spec->dig_in_nid && !(spec->gpio_dir & 0x01)) {
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
if (err < 0)
return err;
Expand Down
34 changes: 22 additions & 12 deletions trunk/sound/soc/blackfin/bf5xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,24 @@ static struct sport_param sport_params[2] = {
}
};

static u16 sport_req[][7] = {
{ P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0},
{ P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0},
};
/*
* Setting the TFS pin selector for SPORT 0 based on whether the selected
* port id F or G. If the port is F then no conflict should exist for the
* TFS. When Port G is selected and EMAC then there is a conflict between
* the PHY interrupt line and TFS. Current settings prevent the conflict
* by ignoring the TFS pin when Port G is selected. This allows both
* ssm2602 using Port G and EMAC concurrently.
*/
#ifdef CONFIG_BF527_SPORT0_PORTF
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#else
#define LOCAL_SPORT0_TFS (0)
#endif

static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
P_SPORT0_DRPRI, P_SPORT0_RSCLK, LOCAL_SPORT0_TFS, 0},
{P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, P_SPORT1_DRPRI,
P_SPORT1_RSCLK, P_SPORT1_TFS, 0} };

static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
Expand All @@ -98,23 +110,21 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
ret = -EINVAL;
break;
default:
printk(KERN_ERR "%s: Unknown DAI format type\n", __func__);
ret = -EINVAL;
break;
}

switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS:
ret = -EINVAL;
break;
case SND_SOC_DAIFMT_CBM_CFS:
ret = -EINVAL;
break;
case SND_SOC_DAIFMT_CBM_CFM:
break;
case SND_SOC_DAIFMT_CBS_CFS:
case SND_SOC_DAIFMT_CBM_CFS:
case SND_SOC_DAIFMT_CBS_CFM:
ret = -EINVAL;
break;
default:
printk(KERN_ERR "%s: Unknown DAI master type\n", __func__);
ret = -EINVAL;
break;
}
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
Loading

0 comments on commit 81aac23

Please sign in to comment.