Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120422
b: refs/heads/master
c: afecd78
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Oct 31, 2008
1 parent 90f70f2 commit fc3860d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 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: 1b063c3d090c45298a37ebc879c71379cf845d9c
refs/heads/master: afecd78cd2ec81512d6ec451906f71d9671a0b3b
29 changes: 29 additions & 0 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/reboot.h>
#include <sound/core.h>
#include <sound/initval.h>
#include "hda_codec.h"
Expand Down Expand Up @@ -397,6 +398,9 @@ struct azx {

/* for pending irqs */
struct work_struct irq_pending_work;

/* reboot notifier (for mysterious hangup problem at power-down) */
struct notifier_block reboot_notifier;
};

/* driver types */
Expand Down Expand Up @@ -1902,13 +1906,37 @@ static int azx_resume(struct pci_dev *pci)
#endif /* CONFIG_PM */


/*
* reboot notifier for hang-up problem at power-down
*/
static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
{
struct azx *chip = container_of(nb, struct azx, reboot_notifier);
azx_stop_chip(chip);
return NOTIFY_OK;
}

static void azx_notifier_register(struct azx *chip)
{
chip->reboot_notifier.notifier_call = azx_halt;
register_reboot_notifier(&chip->reboot_notifier);
}

static void azx_notifier_unregister(struct azx *chip)
{
if (chip->reboot_notifier.notifier_call)
unregister_reboot_notifier(&chip->reboot_notifier);
}

/*
* destructor
*/
static int azx_free(struct azx *chip)
{
int i;

azx_notifier_unregister(chip);

if (chip->initialized) {
azx_clear_irq_pending(chip);
for (i = 0; i < chip->num_streams; i++)
Expand Down Expand Up @@ -2272,6 +2300,7 @@ static int __devinit azx_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
chip->running = 1;
power_down_all_codecs(chip);
azx_notifier_register(chip);

dev++;
return err;
Expand Down
28 changes: 26 additions & 2 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ static void alc_sku_automute(struct hda_codec *codec)
spec->jack_present ? 0 : PIN_OUT);
}

#if 0 /* it's broken in some acses -- temporarily disabled */
static void alc_mic_automute(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
Expand All @@ -848,6 +849,9 @@ static void alc_mic_automute(struct hda_codec *codec)
snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, capsrc_idx_fmic,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
}
#else
#define alc_mic_automute(codec) /* NOP */
#endif /* disabled */

/* unsolicited event for HP jack sensing */
static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
Expand Down Expand Up @@ -1057,12 +1061,14 @@ static void alc_subsystem_id(struct hda_codec *codec,
AC_VERB_SET_UNSOLICITED_ENABLE,
AC_USRSP_EN | ALC880_HP_EVENT);

#if 0 /* it's broken in some acses -- temporarily disabled */
if (spec->autocfg.input_pins[AUTO_PIN_MIC] &&
spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC])
snd_hda_codec_write(codec,
spec->autocfg.input_pins[AUTO_PIN_MIC], 0,
AC_VERB_SET_UNSOLICITED_ENABLE,
AC_USRSP_EN | ALC880_MIC_EVENT);
#endif /* disabled */

spec->unsol_event = alc_sku_unsol_event;
}
Expand Down Expand Up @@ -12232,8 +12238,26 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec,
return 0;
}

#define alc269_auto_create_analog_input_ctls \
alc880_auto_create_analog_input_ctls
static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec,
const struct auto_pin_cfg *cfg)
{
int err;

err = alc880_auto_create_analog_input_ctls(spec, cfg);
if (err < 0)
return err;
/* digital-mic input pin is excluded in alc880_auto_create..()
* because it's under 0x18
*/
if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 ||
cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) {
struct hda_input_mux *imux = &spec->private_imux;
imux->items[imux->num_items].label = "Int Mic";
imux->items[imux->num_items].index = 0x05;
imux->num_items++;
}
return 0;
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
#define alc269_loopbacks alc880_loopbacks
Expand Down

0 comments on commit fc3860d

Please sign in to comment.