Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
cc0db22a
Commit
cc0db22a
authored
Dec 27, 2009
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/hda' into for-linus
parents
fdfa6829
54f7190b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
24 deletions
+58
-24
sound/pci/hda/hda_beep.c
sound/pci/hda/hda_beep.c
+10
-6
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.c
+6
-4
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_codec.h
+1
-0
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_intel.c
+15
-6
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_analog.c
+16
-0
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_sigmatel.c
+10
-8
No files found.
sound/pci/hda/hda_beep.c
View file @
cc0db22a
...
...
@@ -42,7 +42,7 @@ static void snd_hda_generate_beep(struct work_struct *work)
return
;
/* generate tone */
snd_hda_codec_write
_cache
(
codec
,
beep
->
nid
,
0
,
snd_hda_codec_write
(
codec
,
beep
->
nid
,
0
,
AC_VERB_SET_BEEP_CONTROL
,
beep
->
tone
);
}
...
...
@@ -119,7 +119,7 @@ static void snd_hda_do_detach(struct hda_beep *beep)
beep
->
dev
=
NULL
;
cancel_work_sync
(
&
beep
->
beep_work
);
/* turn off beep for sure */
snd_hda_codec_write
_cache
(
beep
->
codec
,
beep
->
nid
,
0
,
snd_hda_codec_write
(
beep
->
codec
,
beep
->
nid
,
0
,
AC_VERB_SET_BEEP_CONTROL
,
0
);
}
...
...
@@ -192,7 +192,7 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable)
beep
->
enabled
=
enable
;
if
(
!
enable
)
{
/* turn off beep */
snd_hda_codec_write
_cache
(
beep
->
codec
,
beep
->
nid
,
0
,
snd_hda_codec_write
(
beep
->
codec
,
beep
->
nid
,
0
,
AC_VERB_SET_BEEP_CONTROL
,
0
);
}
if
(
beep
->
mode
==
HDA_BEEP_MODE_SWREG
)
{
...
...
@@ -239,8 +239,12 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
mutex_init
(
&
beep
->
mutex
);
if
(
beep
->
mode
==
HDA_BEEP_MODE_ON
)
{
beep
->
enabled
=
1
;
snd_hda_do_register
(
&
beep
->
register_work
);
int
err
=
snd_hda_do_attach
(
beep
);
if
(
err
<
0
)
{
kfree
(
beep
);
codec
->
beep
=
NULL
;
return
err
;
}
}
return
0
;
...
...
@@ -253,7 +257,7 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
if
(
beep
)
{
cancel_work_sync
(
&
beep
->
register_work
);
cancel_delayed_work
(
&
beep
->
unregister_work
);
if
(
beep
->
enabled
)
if
(
beep
->
dev
)
snd_hda_do_detach
(
beep
);
codec
->
beep
=
NULL
;
kfree
(
beep
);
...
...
sound/pci/hda/hda_codec.c
View file @
cc0db22a
...
...
@@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps);
*/
u32
snd_hda_pin_sense
(
struct
hda_codec
*
codec
,
hda_nid_t
nid
)
{
u32
pincap
=
snd_hda_query_pin_caps
(
codec
,
nid
);
if
(
pincap
&
AC_PINCAP_TRIG_REQ
)
/* need trigger? */
snd_hda_codec_read
(
codec
,
nid
,
0
,
AC_VERB_SET_PIN_SENSE
,
0
);
u32
pincap
;
if
(
!
codec
->
no_trigger_sense
)
{
pincap
=
snd_hda_query_pin_caps
(
codec
,
nid
);
if
(
pincap
&
AC_PINCAP_TRIG_REQ
)
/* need trigger? */
snd_hda_codec_read
(
codec
,
nid
,
0
,
AC_VERB_SET_PIN_SENSE
,
0
);
}
return
snd_hda_codec_read
(
codec
,
nid
,
0
,
AC_VERB_GET_PIN_SENSE
,
0
);
}
...
...
sound/pci/hda/hda_codec.h
View file @
cc0db22a
...
...
@@ -817,6 +817,7 @@ struct hda_codec {
unsigned
int
pin_amp_workaround
:
1
;
/* pin out-amp takes index
* (e.g. Conexant codecs)
*/
unsigned
int
no_trigger_sense
:
1
;
/* don't trigger at pin-sensing */
#ifdef CONFIG_SND_HDA_POWER_SAVE
unsigned
int
power_on
:
1
;
/* current (global) power-state */
unsigned
int
power_transition
:
1
;
/* power-state in transition */
...
...
sound/pci/hda/hda_intel.c
View file @
cc0db22a
...
...
@@ -356,6 +356,7 @@ struct azx_dev {
*/
unsigned
char
stream_tag
;
/* assigned stream */
unsigned
char
index
;
/* stream index */
int
device
;
/* last device number assigned to */
unsigned
int
opened
:
1
;
unsigned
int
running
:
1
;
...
...
@@ -1441,10 +1442,13 @@ static int __devinit azx_codec_configure(struct azx *chip)
*/
/* assign a stream for the PCM */
static
inline
struct
azx_dev
*
azx_assign_device
(
struct
azx
*
chip
,
int
stream
)
static
inline
struct
azx_dev
*
azx_assign_device
(
struct
azx
*
chip
,
struct
snd_pcm_substream
*
substream
)
{
int
dev
,
i
,
nums
;
if
(
stream
==
SNDRV_PCM_STREAM_PLAYBACK
)
{
struct
azx_dev
*
res
=
NULL
;
if
(
substream
->
stream
==
SNDRV_PCM_STREAM_PLAYBACK
)
{
dev
=
chip
->
playback_index_offset
;
nums
=
chip
->
playback_streams
;
}
else
{
...
...
@@ -1453,10 +1457,15 @@ static inline struct azx_dev *azx_assign_device(struct azx *chip, int stream)
}
for
(
i
=
0
;
i
<
nums
;
i
++
,
dev
++
)
if
(
!
chip
->
azx_dev
[
dev
].
opened
)
{
chip
->
azx_dev
[
dev
].
opened
=
1
;
return
&
chip
->
azx_dev
[
dev
];
res
=
&
chip
->
azx_dev
[
dev
];
if
(
res
->
device
==
substream
->
pcm
->
device
)
break
;
}
return
NULL
;
if
(
res
)
{
res
->
opened
=
1
;
res
->
device
=
substream
->
pcm
->
device
;
}
return
res
;
}
/* release the assigned stream */
...
...
@@ -1505,7 +1514,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
int
err
;
mutex_lock
(
&
chip
->
open_mutex
);
azx_dev
=
azx_assign_device
(
chip
,
substream
->
stream
);
azx_dev
=
azx_assign_device
(
chip
,
substream
);
if
(
azx_dev
==
NULL
)
{
mutex_unlock
(
&
chip
->
open_mutex
);
return
-
EBUSY
;
...
...
sound/pci/hda/patch_analog.c
View file @
cc0db22a
...
...
@@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec)
*/
spec
->
multiout
.
no_share_stream
=
1
;
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
@@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec)
codec
->
patch_ops
=
ad198x_patch_ops
;
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
@@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec)
codec
->
patch_ops
.
unsol_event
=
ad1981_hp_unsol_event
;
break
;
}
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
@@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec)
#endif
spec
->
vmaster_nid
=
0x04
;
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
@@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec)
codec
->
patch_ops
=
ad198x_patch_ops
;
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
@@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec)
break
;
}
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
@@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec)
spec
->
mixers
[
2
]
=
ad1882_6stack_mixers
;
break
;
}
codec
->
no_trigger_sense
=
1
;
return
0
;
}
...
...
sound/pci/hda/patch_sigmatel.c
View file @
cc0db22a
...
...
@@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid)
{
if
(
!
nid
)
return
0
;
/* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT
* codecs behave wrongly when SET_PIN_SENSE is triggered, although
* the pincap gives TRIG_REQ bit.
*/
if
(
snd_hda_codec_read
(
codec
,
nid
,
0
,
AC_VERB_GET_PIN_SENSE
,
0
)
&
AC_PINSENSE_PRESENCE
)
return
1
;
return
0
;
return
snd_hda_jack_detect
(
codec
,
nid
);
}
static
void
stac92xx_line_out_detect
(
struct
hda_codec
*
codec
,
...
...
@@ -4962,6 +4955,7 @@ static int patch_stac9200(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac9200_pin_nids
);
spec
->
pin_nids
=
stac9200_pin_nids
;
...
...
@@ -5024,6 +5018,7 @@ static int patch_stac925x(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac925x_pin_nids
);
spec
->
pin_nids
=
stac925x_pin_nids
;
...
...
@@ -5108,6 +5103,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
codec
->
slave_dig_outs
=
stac92hd73xx_slave_dig_outs
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac92hd73xx_pin_nids
);
...
...
@@ -5255,6 +5251,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
codec
->
slave_dig_outs
=
stac92hd83xxx_slave_dig_outs
;
spec
->
digbeep_nid
=
0x21
;
...
...
@@ -5418,6 +5415,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
codec
->
patch_ops
=
stac92xx_patch_ops
;
spec
->
num_pins
=
STAC92HD71BXX_NUM_PINS
;
...
...
@@ -5661,6 +5659,7 @@ static int patch_stac922x(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac922x_pin_nids
);
spec
->
pin_nids
=
stac922x_pin_nids
;
...
...
@@ -5764,6 +5763,7 @@ static int patch_stac927x(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
codec
->
slave_dig_outs
=
stac927x_slave_dig_outs
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac927x_pin_nids
);
...
...
@@ -5898,6 +5898,7 @@ static int patch_stac9205(struct hda_codec *codec)
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac9205_pin_nids
);
spec
->
pin_nids
=
stac9205_pin_nids
;
...
...
@@ -6053,6 +6054,7 @@ static int patch_stac9872(struct hda_codec *codec)
spec
=
kzalloc
(
sizeof
(
*
spec
),
GFP_KERNEL
);
if
(
spec
==
NULL
)
return
-
ENOMEM
;
codec
->
no_trigger_sense
=
1
;
codec
->
spec
=
spec
;
spec
->
num_pins
=
ARRAY_SIZE
(
stac9872_pin_nids
);
spec
->
pin_nids
=
stac9872_pin_nids
;
...
...
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