Commit 9bb1fe39 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix beep_mode option value

The beep_mode option value was wrongly defined: it must be 0 = off and
1 = on.

Also, evaluate the beep_mode value at snd_hda_attach_beep_device()
properly so that no device is created when beep_mode=0 is given.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d5191e50
...@@ -215,7 +215,9 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -215,7 +215,9 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
struct hda_beep *beep; struct hda_beep *beep;
if (!snd_hda_get_bool_hint(codec, "beep")) if (!snd_hda_get_bool_hint(codec, "beep"))
return 0; /* disabled explicitly */ return 0; /* disabled explicitly by hints */
if (codec->beep_mode == HDA_BEEP_MODE_OFF)
return 0; /* disabled by module option */
beep = kzalloc(sizeof(*beep), GFP_KERNEL); beep = kzalloc(sizeof(*beep), GFP_KERNEL);
if (beep == NULL) if (beep == NULL)
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
#include "hda_codec.h" #include "hda_codec.h"
#define HDA_BEEP_MODE_ON 0 #define HDA_BEEP_MODE_OFF 0
#define HDA_BEEP_MODE_OFF 1 #define HDA_BEEP_MODE_ON 1
#define HDA_BEEP_MODE_SWREG 2 #define HDA_BEEP_MODE_SWREG 2
/* beep information */ /* beep information */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment