Commit 0920c9b4 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Remove beep_mode=2

The beep_mode=2 option was introduced to make the beep mixer
controlling the beep input allocation/deallocation dynamically, so
that a user can switch between HD-audio codec digital beep and the
system beep only via mixer API.  This was necessary because the
keyboard driver took only the first input beep instance at that time.

However, the recent keyboard driver already processes the multiple
input instances, thus there is no point to keep this mode.

Let's remove it.
Acked-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6887a413
...@@ -875,8 +875,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ...@@ -875,8 +875,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
setup before initializing the codecs. This option is setup before initializing the codecs. This option is
available only when CONFIG_SND_HDA_PATCH_LOADER=y is set. available only when CONFIG_SND_HDA_PATCH_LOADER=y is set.
See HD-Audio.txt for details. See HD-Audio.txt for details.
beep_mode - Selects the beep registration mode (0=off, 1=on, 2= beep_mode - Selects the beep registration mode (0=off, 1=on); default
dynamic registration via mute switch on/off); the default
value is set via CONFIG_SND_HDA_INPUT_BEEP_MODE kconfig. value is set via CONFIG_SND_HDA_INPUT_BEEP_MODE kconfig.
[Single (global) options] [Single (global) options]
......
...@@ -53,15 +53,14 @@ config SND_HDA_INPUT_BEEP ...@@ -53,15 +53,14 @@ config SND_HDA_INPUT_BEEP
driver. This interface is used to generate digital beeps. driver. This interface is used to generate digital beeps.
config SND_HDA_INPUT_BEEP_MODE config SND_HDA_INPUT_BEEP_MODE
int "Digital beep registration mode (0=off, 1=on, 2=mute sw on/off)" int "Digital beep registration mode (0=off, 1=on)"
depends on SND_HDA_INPUT_BEEP=y depends on SND_HDA_INPUT_BEEP=y
default "1" default "1"
range 0 2 range 0 1
help help
Set 0 to disable the digital beep interface for HD-audio by default. Set 0 to disable the digital beep interface for HD-audio by default.
Set 1 to always enable the digital beep interface for HD-audio by Set 1 to always enable the digital beep interface for HD-audio by
default. Set 2 to control the beep device registration to input default.
layer using a "Beep Switch" in mixer applications.
config SND_HDA_INPUT_JACK config SND_HDA_INPUT_JACK
bool "Support jack plugging notification via input layer" bool "Support jack plugging notification via input layer"
......
...@@ -162,28 +162,6 @@ static int snd_hda_do_attach(struct hda_beep *beep) ...@@ -162,28 +162,6 @@ static int snd_hda_do_attach(struct hda_beep *beep)
return 0; return 0;
} }
static void snd_hda_do_register(struct work_struct *work)
{
struct hda_beep *beep =
container_of(work, struct hda_beep, register_work);
mutex_lock(&beep->mutex);
if (beep->enabled && !beep->dev)
snd_hda_do_attach(beep);
mutex_unlock(&beep->mutex);
}
static void snd_hda_do_unregister(struct work_struct *work)
{
struct hda_beep *beep =
container_of(work, struct hda_beep, unregister_work.work);
mutex_lock(&beep->mutex);
if (!beep->enabled && beep->dev)
snd_hda_do_detach(beep);
mutex_unlock(&beep->mutex);
}
int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) int snd_hda_enable_beep_device(struct hda_codec *codec, int enable)
{ {
struct hda_beep *beep = codec->beep; struct hda_beep *beep = codec->beep;
...@@ -197,15 +175,6 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) ...@@ -197,15 +175,6 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable)
snd_hda_codec_write(beep->codec, beep->nid, 0, snd_hda_codec_write(beep->codec, beep->nid, 0,
AC_VERB_SET_BEEP_CONTROL, 0); AC_VERB_SET_BEEP_CONTROL, 0);
} }
if (beep->mode == HDA_BEEP_MODE_SWREG) {
if (enable) {
cancel_delayed_work(&beep->unregister_work);
schedule_work(&beep->register_work);
} else {
schedule_delayed_work(&beep->unregister_work,
HZ);
}
}
return 1; return 1;
} }
return 0; return 0;
...@@ -235,12 +204,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -235,12 +204,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
beep->mode = codec->beep_mode; beep->mode = codec->beep_mode;
codec->beep = beep; codec->beep = beep;
INIT_WORK(&beep->register_work, &snd_hda_do_register);
INIT_DELAYED_WORK(&beep->unregister_work, &snd_hda_do_unregister);
INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
mutex_init(&beep->mutex); mutex_init(&beep->mutex);
if (beep->mode == HDA_BEEP_MODE_ON) { if (beep->mode) {
int err = snd_hda_do_attach(beep); int err = snd_hda_do_attach(beep);
if (err < 0) { if (err < 0) {
kfree(beep); kfree(beep);
...@@ -257,8 +224,6 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) ...@@ -257,8 +224,6 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
{ {
struct hda_beep *beep = codec->beep; struct hda_beep *beep = codec->beep;
if (beep) { if (beep) {
cancel_work_sync(&beep->register_work);
cancel_delayed_work(&beep->unregister_work);
if (beep->dev) if (beep->dev)
snd_hda_do_detach(beep); snd_hda_do_detach(beep);
codec->beep = NULL; codec->beep = NULL;
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define HDA_BEEP_MODE_OFF 0 #define HDA_BEEP_MODE_OFF 0
#define HDA_BEEP_MODE_ON 1 #define HDA_BEEP_MODE_ON 1
#define HDA_BEEP_MODE_SWREG 2
/* beep information */ /* beep information */
struct hda_beep { struct hda_beep {
...@@ -37,10 +36,7 @@ struct hda_beep { ...@@ -37,10 +36,7 @@ struct hda_beep {
int tone; int tone;
hda_nid_t nid; hda_nid_t nid;
unsigned int enabled:1; unsigned int enabled:1;
unsigned int request_enable:1;
unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */ unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */
struct work_struct register_work; /* registration work */
struct delayed_work unregister_work; /* unregistration work */
struct work_struct beep_work; /* scheduled task for beep event */ struct work_struct beep_work; /* scheduled task for beep event */
struct mutex mutex; struct mutex mutex;
}; };
......
...@@ -72,7 +72,7 @@ static int enable_msi = -1; ...@@ -72,7 +72,7 @@ static int enable_msi = -1;
static char *patch[SNDRV_CARDS]; static char *patch[SNDRV_CARDS];
#endif #endif
#ifdef CONFIG_SND_HDA_INPUT_BEEP #ifdef CONFIG_SND_HDA_INPUT_BEEP
static int beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] =
CONFIG_SND_HDA_INPUT_BEEP_MODE}; CONFIG_SND_HDA_INPUT_BEEP_MODE};
#endif #endif
...@@ -103,9 +103,9 @@ module_param_array(patch, charp, NULL, 0444); ...@@ -103,9 +103,9 @@ module_param_array(patch, charp, NULL, 0444);
MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface."); MODULE_PARM_DESC(patch, "Patch file for Intel HD audio interface.");
#endif #endif
#ifdef CONFIG_SND_HDA_INPUT_BEEP #ifdef CONFIG_SND_HDA_INPUT_BEEP
module_param_array(beep_mode, int, NULL, 0444); module_param_array(beep_mode, bool, NULL, 0444);
MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
"(0=off, 1=on, 2=mute switch on/off) (default=1)."); "(0=off, 1=on) (default=1).");
#endif #endif
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
......
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