diff options
author | Kusanagi Kouichi <slash@ma.neweb.ne.jp> | 2009-02-04 10:00:58 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-04 10:17:42 -0500 |
commit | 680cd53652d8bfb2b97d8c0248d1afb82de6b61d (patch) | |
tree | b1fd65c49253445ea836addc4d287804855b9234 /sound/pci/hda/patch_realtek.c | |
parent | 123848e77623b9996288e85433985439c157fcd0 (diff) |
ALSA: hda: Add digital beep generator support for Realtek codecs.
A digital beep generator can be used via input layer.
Signed-off-by: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index bd9ef3363890..0faa41bfc8be 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <sound/core.h> | 30 | #include <sound/core.h> |
31 | #include "hda_codec.h" | 31 | #include "hda_codec.h" |
32 | #include "hda_local.h" | 32 | #include "hda_local.h" |
33 | #include "hda_beep.h" | ||
33 | 34 | ||
34 | #define ALC880_FRONT_EVENT 0x01 | 35 | #define ALC880_FRONT_EVENT 0x01 |
35 | #define ALC880_DCVOL_EVENT 0x02 | 36 | #define ALC880_DCVOL_EVENT 0x02 |
@@ -3187,6 +3188,7 @@ static void alc_free(struct hda_codec *codec) | |||
3187 | 3188 | ||
3188 | alc_free_kctls(codec); | 3189 | alc_free_kctls(codec); |
3189 | kfree(spec); | 3190 | kfree(spec); |
3191 | snd_hda_detach_beep_device(codec); | ||
3190 | codec->spec = NULL; /* to be sure */ | 3192 | codec->spec = NULL; /* to be sure */ |
3191 | } | 3193 | } |
3192 | 3194 | ||
@@ -4355,6 +4357,12 @@ static int patch_alc880(struct hda_codec *codec) | |||
4355 | } | 4357 | } |
4356 | } | 4358 | } |
4357 | 4359 | ||
4360 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
4361 | if (err < 0) { | ||
4362 | alc_free(codec); | ||
4363 | return err; | ||
4364 | } | ||
4365 | |||
4358 | if (board_config != ALC880_AUTO) | 4366 | if (board_config != ALC880_AUTO) |
4359 | setup_preset(spec, &alc880_presets[board_config]); | 4367 | setup_preset(spec, &alc880_presets[board_config]); |
4360 | 4368 | ||
@@ -5882,6 +5890,12 @@ static int patch_alc260(struct hda_codec *codec) | |||
5882 | } | 5890 | } |
5883 | } | 5891 | } |
5884 | 5892 | ||
5893 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
5894 | if (err < 0) { | ||
5895 | alc_free(codec); | ||
5896 | return err; | ||
5897 | } | ||
5898 | |||
5885 | if (board_config != ALC260_AUTO) | 5899 | if (board_config != ALC260_AUTO) |
5886 | setup_preset(spec, &alc260_presets[board_config]); | 5900 | setup_preset(spec, &alc260_presets[board_config]); |
5887 | 5901 | ||
@@ -7093,6 +7107,12 @@ static int patch_alc882(struct hda_codec *codec) | |||
7093 | } | 7107 | } |
7094 | } | 7108 | } |
7095 | 7109 | ||
7110 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
7111 | if (err < 0) { | ||
7112 | alc_free(codec); | ||
7113 | return err; | ||
7114 | } | ||
7115 | |||
7096 | if (board_config != ALC882_AUTO) | 7116 | if (board_config != ALC882_AUTO) |
7097 | setup_preset(spec, &alc882_presets[board_config]); | 7117 | setup_preset(spec, &alc882_presets[board_config]); |
7098 | 7118 | ||
@@ -9093,6 +9113,12 @@ static int patch_alc883(struct hda_codec *codec) | |||
9093 | } | 9113 | } |
9094 | } | 9114 | } |
9095 | 9115 | ||
9116 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
9117 | if (err < 0) { | ||
9118 | alc_free(codec); | ||
9119 | return err; | ||
9120 | } | ||
9121 | |||
9096 | if (board_config != ALC883_AUTO) | 9122 | if (board_config != ALC883_AUTO) |
9097 | setup_preset(spec, &alc883_presets[board_config]); | 9123 | setup_preset(spec, &alc883_presets[board_config]); |
9098 | 9124 | ||
@@ -11013,6 +11039,12 @@ static int patch_alc262(struct hda_codec *codec) | |||
11013 | } | 11039 | } |
11014 | } | 11040 | } |
11015 | 11041 | ||
11042 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
11043 | if (err < 0) { | ||
11044 | alc_free(codec); | ||
11045 | return err; | ||
11046 | } | ||
11047 | |||
11016 | if (board_config != ALC262_AUTO) | 11048 | if (board_config != ALC262_AUTO) |
11017 | setup_preset(spec, &alc262_presets[board_config]); | 11049 | setup_preset(spec, &alc262_presets[board_config]); |
11018 | 11050 | ||
@@ -12051,6 +12083,12 @@ static int patch_alc268(struct hda_codec *codec) | |||
12051 | } | 12083 | } |
12052 | } | 12084 | } |
12053 | 12085 | ||
12086 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
12087 | if (err < 0) { | ||
12088 | alc_free(codec); | ||
12089 | return err; | ||
12090 | } | ||
12091 | |||
12054 | if (board_config != ALC268_AUTO) | 12092 | if (board_config != ALC268_AUTO) |
12055 | setup_preset(spec, &alc268_presets[board_config]); | 12093 | setup_preset(spec, &alc268_presets[board_config]); |
12056 | 12094 | ||
@@ -12885,6 +12923,12 @@ static int patch_alc269(struct hda_codec *codec) | |||
12885 | } | 12923 | } |
12886 | } | 12924 | } |
12887 | 12925 | ||
12926 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
12927 | if (err < 0) { | ||
12928 | alc_free(codec); | ||
12929 | return err; | ||
12930 | } | ||
12931 | |||
12888 | if (board_config != ALC269_AUTO) | 12932 | if (board_config != ALC269_AUTO) |
12889 | setup_preset(spec, &alc269_presets[board_config]); | 12933 | setup_preset(spec, &alc269_presets[board_config]); |
12890 | 12934 | ||
@@ -13978,6 +14022,12 @@ static int patch_alc861(struct hda_codec *codec) | |||
13978 | } | 14022 | } |
13979 | } | 14023 | } |
13980 | 14024 | ||
14025 | err = snd_hda_attach_beep_device(codec, 0x23); | ||
14026 | if (err < 0) { | ||
14027 | alc_free(codec); | ||
14028 | return err; | ||
14029 | } | ||
14030 | |||
13981 | if (board_config != ALC861_AUTO) | 14031 | if (board_config != ALC861_AUTO) |
13982 | setup_preset(spec, &alc861_presets[board_config]); | 14032 | setup_preset(spec, &alc861_presets[board_config]); |
13983 | 14033 | ||
@@ -14924,6 +14974,12 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
14924 | } | 14974 | } |
14925 | } | 14975 | } |
14926 | 14976 | ||
14977 | err = snd_hda_attach_beep_device(codec, 0x23); | ||
14978 | if (err < 0) { | ||
14979 | alc_free(codec); | ||
14980 | return err; | ||
14981 | } | ||
14982 | |||
14927 | if (board_config != ALC861VD_AUTO) | 14983 | if (board_config != ALC861VD_AUTO) |
14928 | setup_preset(spec, &alc861vd_presets[board_config]); | 14984 | setup_preset(spec, &alc861vd_presets[board_config]); |
14929 | 14985 | ||
@@ -16733,6 +16789,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
16733 | } | 16789 | } |
16734 | } | 16790 | } |
16735 | 16791 | ||
16792 | err = snd_hda_attach_beep_device(codec, 0x1); | ||
16793 | if (err < 0) { | ||
16794 | alc_free(codec); | ||
16795 | return err; | ||
16796 | } | ||
16797 | |||
16736 | if (board_config != ALC662_AUTO) | 16798 | if (board_config != ALC662_AUTO) |
16737 | setup_preset(spec, &alc662_presets[board_config]); | 16799 | setup_preset(spec, &alc662_presets[board_config]); |
16738 | 16800 | ||