diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-11-13 12:41:52 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-16 05:35:10 -0500 |
commit | 2dca0bba70ce3c233be152e384580c134935332d (patch) | |
tree | bd82dd7b15104f8ea2fa682a444099f7eb23443f /sound/pci/hda/hda_intel.c | |
parent | 5f81669750504b1e7e00acde5068d972af466f29 (diff) |
ALSA: hda - add beep_mode module parameter
The beep_mode parameter for snd-hda-intel module allows to choose among
different digital beep device registation to the input layer.
0 = do not register to the input layer
1 = register to the input layer all time
2 = use "Beep Switch" control exported to user space mixer applications
Also, introduce CONFIG_SND_HDA_INPUT_BEEP_MODE for default value.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index e73e395e760..91bcbdad5af 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -64,6 +64,10 @@ static int enable_msi = -1; | |||
64 | #ifdef CONFIG_SND_HDA_PATCH_LOADER | 64 | #ifdef CONFIG_SND_HDA_PATCH_LOADER |
65 | static char *patch[SNDRV_CARDS]; | 65 | static char *patch[SNDRV_CARDS]; |
66 | #endif | 66 | #endif |
67 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
68 | static int beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = | ||
69 | CONFIG_SND_HDA_INPUT_BEEP_MODE}; | ||
70 | #endif | ||
67 | 71 | ||
68 | module_param_array(index, int, NULL, 0444); | 72 | module_param_array(index, int, NULL, 0444); |
69 | MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); | 73 | MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); |
@@ -91,6 +95,11 @@ MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)"); | |||
91 | module_param_array(patch, charp, NULL, 0444); | 95 | module_param_array(patch, charp, NULL, 0444); |
92 | MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface."); | 96 | MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface."); |
93 | #endif | 97 | #endif |
98 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
99 | module_param_array(beep_mode, int, NULL, 0444); | ||
100 | MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " | ||
101 | "(0=off, 1=on, 2=mute switch on/off) (default=1)."); | ||
102 | #endif | ||
94 | 103 | ||
95 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 104 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
96 | static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; | 105 | static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT; |
@@ -404,6 +413,7 @@ struct azx { | |||
404 | unsigned short codec_mask; | 413 | unsigned short codec_mask; |
405 | int codec_probe_mask; /* copied from probe_mask option */ | 414 | int codec_probe_mask; /* copied from probe_mask option */ |
406 | struct hda_bus *bus; | 415 | struct hda_bus *bus; |
416 | unsigned int beep_mode; | ||
407 | 417 | ||
408 | /* CORB/RIRB */ | 418 | /* CORB/RIRB */ |
409 | struct azx_rb corb; | 419 | struct azx_rb corb; |
@@ -1404,6 +1414,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
1404 | err = snd_hda_codec_new(chip->bus, c, &codec); | 1414 | err = snd_hda_codec_new(chip->bus, c, &codec); |
1405 | if (err < 0) | 1415 | if (err < 0) |
1406 | continue; | 1416 | continue; |
1417 | codec->beep_mode = chip->beep_mode; | ||
1407 | codecs++; | 1418 | codecs++; |
1408 | } | 1419 | } |
1409 | } | 1420 | } |
@@ -2579,6 +2590,10 @@ static int __devinit azx_probe(struct pci_dev *pci, | |||
2579 | goto out_free; | 2590 | goto out_free; |
2580 | card->private_data = chip; | 2591 | card->private_data = chip; |
2581 | 2592 | ||
2593 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | ||
2594 | chip->beep_mode = beep_mode[dev]; | ||
2595 | #endif | ||
2596 | |||
2582 | /* create codec instances */ | 2597 | /* create codec instances */ |
2583 | err = azx_codec_create(chip, model[dev]); | 2598 | err = azx_codec_create(chip, model[dev]); |
2584 | if (err < 0) | 2599 | if (err < 0) |