Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cd80bc6f
Commit
cd80bc6f
authored
Nov 13, 2008
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/fix/hda' into topic/hda
Conflicts: sound/pci/hda/patch_sigmatel.c
parents
c4da29ca
6a12afb5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
6 deletions
+72
-6
sound/pci/hda/hda_beep.c
sound/pci/hda/hda_beep.c
+8
-0
sound/pci/hda/hda_beep.h
sound/pci/hda/hda_beep.h
+1
-0
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_sigmatel.c
+63
-6
No files found.
sound/pci/hda/hda_beep.c
View file @
cd80bc6f
...
...
@@ -37,6 +37,9 @@ static void snd_hda_generate_beep(struct work_struct *work)
container_of
(
work
,
struct
hda_beep
,
beep_work
);
struct
hda_codec
*
codec
=
beep
->
codec
;
if
(
!
beep
->
enabled
)
return
;
/* generate tone */
snd_hda_codec_write_cache
(
codec
,
beep
->
nid
,
0
,
AC_VERB_SET_BEEP_CONTROL
,
beep
->
tone
);
...
...
@@ -85,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
snprintf
(
beep
->
phys
,
sizeof
(
beep
->
phys
),
"card%d/codec#%d/beep0"
,
codec
->
bus
->
card
->
number
,
codec
->
addr
);
input_dev
=
input_allocate_device
();
if
(
!
input_dev
)
{
kfree
(
beep
);
return
-
ENOMEM
;
}
/* setup digital beep device */
input_dev
->
name
=
"HDA Digital PCBeep"
;
...
...
@@ -115,6 +122,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
beep
->
nid
=
nid
;
beep
->
dev
=
input_dev
;
beep
->
codec
=
codec
;
beep
->
enabled
=
1
;
codec
->
beep
=
beep
;
INIT_WORK
(
&
beep
->
beep_work
,
&
snd_hda_generate_beep
);
...
...
sound/pci/hda/hda_beep.h
View file @
cd80bc6f
...
...
@@ -31,6 +31,7 @@ struct hda_beep {
char
phys
[
32
];
int
tone
;
int
nid
;
int
enabled
;
struct
work_struct
beep_work
;
/* scheduled task for beep event */
};
...
...
sound/pci/hda/patch_sigmatel.c
View file @
cd80bc6f
...
...
@@ -2608,8 +2608,10 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
};
/* add dynamic controls */
static
int
stac92xx_add_control_idx
(
struct
sigmatel_spec
*
spec
,
int
type
,
int
idx
,
const
char
*
name
,
unsigned
long
val
)
static
int
stac92xx_add_control_temp
(
struct
sigmatel_spec
*
spec
,
struct
snd_kcontrol_new
*
ktemp
,
int
idx
,
const
char
*
name
,
unsigned
long
val
)
{
struct
snd_kcontrol_new
*
knew
;
...
...
@@ -2617,18 +2619,27 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
knew
=
snd_array_new
(
&
spec
->
kctls
);
if
(
!
knew
)
return
-
ENOMEM
;
*
knew
=
stac92xx_control_templates
[
type
]
;
*
knew
=
*
ktemp
;
knew
->
index
=
idx
;
knew
->
name
=
kstrdup
(
name
,
GFP_KERNEL
);
if
(
!
knew
->
name
)
if
(
!
knew
->
name
)
return
-
ENOMEM
;
knew
->
private_value
=
val
;
return
0
;
}
static
inline
int
stac92xx_add_control_idx
(
struct
sigmatel_spec
*
spec
,
int
type
,
int
idx
,
const
char
*
name
,
unsigned
long
val
)
{
return
stac92xx_add_control_temp
(
spec
,
&
stac92xx_control_templates
[
type
],
idx
,
name
,
val
);
}
/* add dynamic controls */
static
int
stac92xx_add_control
(
struct
sigmatel_spec
*
spec
,
int
type
,
static
in
line
in
t
stac92xx_add_control
(
struct
sigmatel_spec
*
spec
,
int
type
,
const
char
*
name
,
unsigned
long
val
)
{
return
stac92xx_add_control_idx
(
spec
,
type
,
0
,
name
,
val
);
...
...
@@ -3071,6 +3082,43 @@ static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
return
0
;
}
#ifdef CONFIG_SND_HDA_INPUT_BEEP
#define stac92xx_dig_beep_switch_info snd_ctl_boolean_mono_info
static
int
stac92xx_dig_beep_switch_get
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
hda_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
ucontrol
->
value
.
integer
.
value
[
0
]
=
codec
->
beep
->
enabled
;
return
0
;
}
static
int
stac92xx_dig_beep_switch_put
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
hda_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
int
enabled
=
!!
ucontrol
->
value
.
integer
.
value
[
0
];
if
(
codec
->
beep
->
enabled
!=
enabled
)
{
codec
->
beep
->
enabled
=
enabled
;
return
1
;
}
return
0
;
}
static
struct
snd_kcontrol_new
stac92xx_dig_beep_ctrl
=
{
.
iface
=
SNDRV_CTL_ELEM_IFACE_MIXER
,
.
info
=
stac92xx_dig_beep_switch_info
,
.
get
=
stac92xx_dig_beep_switch_get
,
.
put
=
stac92xx_dig_beep_switch_put
,
};
static
int
stac92xx_beep_switch_ctl
(
struct
hda_codec
*
codec
)
{
return
stac92xx_add_control_temp
(
codec
->
spec
,
&
stac92xx_dig_beep_ctrl
,
0
,
"PC Beep Playback Switch"
,
0
);
}
#endif
static
int
stac92xx_auto_create_mux_input_ctls
(
struct
hda_codec
*
codec
)
{
struct
sigmatel_spec
*
spec
=
codec
->
spec
;
...
...
@@ -3377,6 +3425,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
#ifdef CONFIG_SND_HDA_INPUT_BEEP
if
(
spec
->
digbeep_nid
>
0
)
{
hda_nid_t
nid
=
spec
->
digbeep_nid
;
unsigned
int
caps
;
err
=
stac92xx_auto_create_beep_ctls
(
codec
,
nid
);
if
(
err
<
0
)
...
...
@@ -3384,6 +3433,14 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
err
=
snd_hda_attach_beep_device
(
codec
,
nid
);
if
(
err
<
0
)
return
err
;
/* if no beep switch is available, make its own one */
caps
=
query_amp_caps
(
codec
,
nid
,
HDA_OUTPUT
);
if
(
codec
->
beep
&&
!
((
caps
&
AC_AMPCAP_MUTE
)
>>
AC_AMPCAP_MUTE_SHIFT
))
{
err
=
stac92xx_beep_switch_ctl
(
codec
);
if
(
err
<
0
)
return
err
;
}
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment