Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168878
b: refs/heads/master
c: 77a9d3e
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Nov 30, 2009
1 parent 2d38000 commit 322f3cf
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 45 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: e9ff5eb2ae018fe2298c68746c873bf828c6b10e
refs/heads/master: 77a9d3eb774f50965106cb2937be660d093a5272
42 changes: 20 additions & 22 deletions trunk/sound/core/rawmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ static int assign_substream(struct snd_rawmidi *rmidi, int subdevice,
list_for_each_entry(substream, &s->substreams, list) {
if (substream->opened) {
if (stream == SNDRV_RAWMIDI_STREAM_INPUT ||
!(mode & SNDRV_RAWMIDI_LFLG_APPEND))
!(mode & SNDRV_RAWMIDI_LFLG_APPEND) ||
!substream->append)
continue;
}
if (subdevice < 0 || subdevice == substream->number) {
Expand All @@ -266,17 +267,21 @@ static int open_substream(struct snd_rawmidi *rmidi,
{
int err;

err = snd_rawmidi_runtime_create(substream);
if (err < 0)
return err;
err = substream->ops->open(substream);
if (err < 0)
return err;
substream->opened = 1;
if (substream->use_count++ == 0)
if (substream->use_count == 0) {
err = snd_rawmidi_runtime_create(substream);
if (err < 0)
return err;
err = substream->ops->open(substream);
if (err < 0) {
snd_rawmidi_runtime_free(substream);
return err;
}
substream->opened = 1;
substream->active_sensing = 0;
if (mode & SNDRV_RAWMIDI_LFLG_APPEND)
substream->append = 1;
if (mode & SNDRV_RAWMIDI_LFLG_APPEND)
substream->append = 1;
}
substream->use_count++;
rmidi->streams[substream->stream].substream_opened++;
return 0;
}
Expand All @@ -297,41 +302,34 @@ static int rawmidi_open_priv(struct snd_rawmidi *rmidi, int subdevice, int mode,
SNDRV_RAWMIDI_STREAM_INPUT,
mode, &sinput);
if (err < 0)
goto __error;
return err;
}
if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) {
err = assign_substream(rmidi, subdevice,
SNDRV_RAWMIDI_STREAM_OUTPUT,
mode, &soutput);
if (err < 0)
goto __error;
return err;
}

if (sinput) {
err = open_substream(rmidi, sinput, mode);
if (err < 0)
goto __error;
return err;
}
if (soutput) {
err = open_substream(rmidi, soutput, mode);
if (err < 0) {
if (sinput)
close_substream(rmidi, sinput, 0);
goto __error;
return err;
}
}

rfile->rmidi = rmidi;
rfile->input = sinput;
rfile->output = soutput;
return 0;

__error:
if (sinput && sinput->runtime)
snd_rawmidi_runtime_free(sinput);
if (soutput && soutput->runtime)
snd_rawmidi_runtime_free(soutput);
return err;
}

/* called from sound/core/seq/seq_midi.c */
Expand Down
4 changes: 3 additions & 1 deletion trunk/sound/oss/dmasound/dmasound_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ static int shared_resources_initialised;
* Mid level stuff
*/

struct sound_settings dmasound = { .lock = SPIN_LOCK_UNLOCKED };
struct sound_settings dmasound = {
.lock = __SPIN_LOCK_UNLOCKED(dmasound.lock)
};

static inline void sound_silence(void)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/oss/sb_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void sb_intr (sb_devc *devc)
break;

default:
/* printk(KERN_WARN "Sound Blaster: Unexpected interrupt\n"); */
/* printk(KERN_WARNING "Sound Blaster: Unexpected interrupt\n"); */
;
}
}
Expand All @@ -177,7 +177,7 @@ static void sb_intr (sb_devc *devc)
break;

default:
/* printk(KERN_WARN "Sound Blaster: Unexpected interrupt\n"); */
/* printk(KERN_WARNING "Sound Blaster: Unexpected interrupt\n"); */
;
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/oss/sb_ess.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ printk(KERN_INFO "FKS: ess_handle_channel %s irq_mode=%d\n", channel, irq_mode);
break;

default:;
/* printk(KERN_WARN "ESS: Unexpected interrupt\n"); */
/* printk(KERN_WARNING "ESS: Unexpected interrupt\n"); */
}
}

Expand Down
12 changes: 8 additions & 4 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
chip->last_cmd[addr]);
chip->single_cmd = 1;
bus->response_reset = 0;
/* re-initialize CORB/RIRB */
/* release CORB/RIRB */
azx_free_cmd_io(chip);
azx_init_cmd_io(chip);
/* disable unsolicited responses */
azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_UNSOL);
return -1;
}

Expand Down Expand Up @@ -865,7 +866,9 @@ static int azx_reset(struct azx *chip)
}

/* Accept unsolicited responses */
azx_writel(chip, GCTL, azx_readl(chip, GCTL) | ICH6_GCTL_UNSOL);
if (!chip->single_cmd)
azx_writel(chip, GCTL, azx_readl(chip, GCTL) |
ICH6_GCTL_UNSOL);

/* detect codecs */
if (!chip->codec_mask) {
Expand Down Expand Up @@ -980,7 +983,8 @@ static void azx_init_chip(struct azx *chip)
azx_int_enable(chip);

/* initialize the codec command I/O */
azx_init_cmd_io(chip);
if (!chip->single_cmd)
azx_init_cmd_io(chip);

/* program the position buffer */
azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);
Expand Down
16 changes: 13 additions & 3 deletions trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct conexant_spec {

unsigned int dell_automute;
unsigned int port_d_mode;
unsigned char ext_mic_bias;
};

static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
Expand Down Expand Up @@ -1927,6 +1928,11 @@ static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 };
static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 };
#define CXT5066_SPDIF_OUT 0x21

/* OLPC's microphone port is DC coupled for use with external sensors,
* therefore we use a 50% mic bias in order to center the input signal with
* the DC input range of the codec. */
#define CXT5066_OLPC_EXT_MIC_BIAS PIN_VREF50

static struct hda_channel_mode cxt5066_modes[1] = {
{ 2, NULL },
};
Expand Down Expand Up @@ -1980,9 +1986,10 @@ static int cxt5066_hp_master_sw_put(struct snd_kcontrol *kcontrol,
/* toggle input of built-in and mic jack appropriately */
static void cxt5066_automic(struct hda_codec *codec)
{
static struct hda_verb ext_mic_present[] = {
struct conexant_spec *spec = codec->spec;
struct hda_verb ext_mic_present[] = {
/* enable external mic, port B */
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, spec->ext_mic_bias},

/* switch to external mic input */
{0x17, AC_VERB_SET_CONNECT_SEL, 0},
Expand Down Expand Up @@ -2235,7 +2242,7 @@ static struct hda_verb cxt5066_init_verbs_olpc[] = {
{0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */

/* Port B: external microphone */
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, CXT5066_OLPC_EXT_MIC_BIAS},

/* Port C: internal microphone */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
Expand Down Expand Up @@ -2325,6 +2332,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
CXT5066_LAPTOP),
SND_PCI_QUIRK(0x1028, 0x02f5, "Dell",
CXT5066_DELL_LAPTOP),
SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
{}
};

Expand Down Expand Up @@ -2352,6 +2360,7 @@ static int patch_cxt5066(struct hda_codec *codec)
spec->input_mux = &cxt5066_capture_source;

spec->port_d_mode = PIN_HP;
spec->ext_mic_bias = PIN_VREF80;

spec->num_init_verbs = 1;
spec->init_verbs[0] = cxt5066_init_verbs;
Expand Down Expand Up @@ -2383,6 +2392,7 @@ static int patch_cxt5066(struct hda_codec *codec)
spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
spec->mixers[spec->num_mixers++] = cxt5066_mixers;
spec->port_d_mode = 0;
spec->ext_mic_bias = CXT5066_OLPC_EXT_MIC_BIAS;

/* no S/PDIF out */
spec->multiout.dig_out_nid = 0;
Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/pci/hda/patch_nvhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
{ .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
{ .id = 0x10de0003, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
{ .id = 0x10de0005, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
{ .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
{ .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi_8ch },
{ .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
Expand All @@ -406,6 +407,7 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {

MODULE_ALIAS("snd-hda-codec-id:10de0002");
MODULE_ALIAS("snd-hda-codec-id:10de0003");
MODULE_ALIAS("snd-hda-codec-id:10de0005");
MODULE_ALIAS("snd-hda-codec-id:10de0006");
MODULE_ALIAS("snd-hda-codec-id:10de0007");
MODULE_ALIAS("snd-hda-codec-id:10de0067");
Expand Down
17 changes: 10 additions & 7 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -4684,9 +4684,9 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
spec->multiout.dig_out_nid = dig_nid;
else {
spec->multiout.slave_dig_outs = spec->slave_dig_outs;
spec->slave_dig_outs[i - 1] = dig_nid;
if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
break;
spec->slave_dig_outs[i - 1] = dig_nid;
}
}
if (spec->autocfg.dig_in_pin)
Expand Down Expand Up @@ -6249,7 +6249,7 @@ static struct snd_pci_quirk alc260_cfg_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_AUTO), /* no quirk */
SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013),
SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600),
Expand Down Expand Up @@ -8911,10 +8911,11 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
/* FIXME: HP jack sense seems not working for MBP 5,1, so apparently
* no perfect solution yet
/* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
* so apparently no perfect solution yet
*/
SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
{} /* terminator */
};

Expand Down Expand Up @@ -9813,9 +9814,9 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
spec->multiout.dig_out_nid = dig_nid;
else {
spec->multiout.slave_dig_outs = spec->slave_dig_outs;
spec->slave_dig_outs[i - 1] = dig_nid;
if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
break;
spec->slave_dig_outs[i - 1] = dig_nid;
}
}
if (spec->autocfg.dig_in_pin)
Expand Down Expand Up @@ -11460,6 +11461,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD),
SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */
SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06),
SND_PCI_QUIRK(0x104d, 0x9035, "Sony VAIO VGN-FW170J", ALC262_AUTO),
SND_PCI_QUIRK(0x104d, 0x9047, "Sony VAIO Type G", ALC262_AUTO),
SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
ALC262_SONY_ASSAMD),
SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
Expand Down
Loading

0 comments on commit 322f3cf

Please sign in to comment.