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
Kirill Smelkov
linux
Commits
d832f3dc
Commit
d832f3dc
authored
Jan 28, 2015
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/ak411x-fix' into for-next
parents
5da7f924
1781e78c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
27 deletions
+81
-27
include/sound/ak4113.h
include/sound/ak4113.h
+10
-1
include/sound/ak4114.h
include/sound/ak4114.h
+10
-1
sound/i2c/other/ak4113.c
sound/i2c/other/ak4113.c
+27
-9
sound/i2c/other/ak4114.c
sound/i2c/other/ak4114.c
+31
-15
sound/pci/ice1712/juli.c
sound/pci/ice1712/juli.c
+3
-1
No files found.
include/sound/ak4113.h
View file @
d832f3dc
...
...
@@ -286,7 +286,8 @@ struct ak4113 {
ak4113_write_t
*
write
;
ak4113_read_t
*
read
;
void
*
private_data
;
unsigned
int
init
:
1
;
atomic_t
wq_processing
;
struct
mutex
reinit_mutex
;
spinlock_t
lock
;
unsigned
char
regmap
[
AK4113_WRITABLE_REGS
];
struct
snd_kcontrol
*
kctls
[
AK4113_CONTROLS
];
...
...
@@ -317,5 +318,13 @@ int snd_ak4113_build(struct ak4113 *ak4113,
int
snd_ak4113_external_rate
(
struct
ak4113
*
ak4113
);
int
snd_ak4113_check_rate_and_errors
(
struct
ak4113
*
ak4113
,
unsigned
int
flags
);
#ifdef CONFIG_PM
void
snd_ak4113_suspend
(
struct
ak4113
*
chip
);
void
snd_ak4113_resume
(
struct
ak4113
*
chip
);
#else
static
inline
void
snd_ak4113_suspend
(
struct
ak4113
*
chip
)
{}
static
inline
void
snd_ak4113_resume
(
struct
ak4113
*
chip
)
{}
#endif
#endif
/* __SOUND_AK4113_H */
include/sound/ak4114.h
View file @
d832f3dc
...
...
@@ -168,7 +168,8 @@ struct ak4114 {
ak4114_write_t
*
write
;
ak4114_read_t
*
read
;
void
*
private_data
;
unsigned
int
init
:
1
;
atomic_t
wq_processing
;
struct
mutex
reinit_mutex
;
spinlock_t
lock
;
unsigned
char
regmap
[
6
];
unsigned
char
txcsb
[
5
];
...
...
@@ -199,5 +200,13 @@ int snd_ak4114_build(struct ak4114 *ak4114,
int
snd_ak4114_external_rate
(
struct
ak4114
*
ak4114
);
int
snd_ak4114_check_rate_and_errors
(
struct
ak4114
*
ak4114
,
unsigned
int
flags
);
#ifdef CONFIG_PM
void
snd_ak4114_suspend
(
struct
ak4114
*
chip
);
void
snd_ak4114_resume
(
struct
ak4114
*
chip
);
#else
static
inline
void
snd_ak4114_suspend
(
struct
ak4114
*
chip
)
{}
static
inline
void
snd_ak4114_resume
(
struct
ak4114
*
chip
)
{}
#endif
#endif
/* __SOUND_AK4114_H */
sound/i2c/other/ak4113.c
View file @
d832f3dc
...
...
@@ -56,8 +56,7 @@ static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg)
static
void
snd_ak4113_free
(
struct
ak4113
*
chip
)
{
chip
->
init
=
1
;
/* don't schedule new work */
mb
();
atomic_inc
(
&
chip
->
wq_processing
);
/* don't schedule new work */
cancel_delayed_work_sync
(
&
chip
->
work
);
kfree
(
chip
);
}
...
...
@@ -89,6 +88,8 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
chip
->
write
=
write
;
chip
->
private_data
=
private_data
;
INIT_DELAYED_WORK
(
&
chip
->
work
,
ak4113_stats
);
atomic_set
(
&
chip
->
wq_processing
,
0
);
mutex_init
(
&
chip
->
reinit_mutex
);
for
(
reg
=
0
;
reg
<
AK4113_WRITABLE_REGS
;
reg
++
)
chip
->
regmap
[
reg
]
=
pgm
[
reg
];
...
...
@@ -139,13 +140,13 @@ static void ak4113_init_regs(struct ak4113 *chip)
void
snd_ak4113_reinit
(
struct
ak4113
*
chip
)
{
chip
->
init
=
1
;
mb
(
);
flush_delayed_work
(
&
chip
->
work
);
if
(
atomic_inc_return
(
&
chip
->
wq_processing
)
==
1
)
cancel_delayed_work_sync
(
&
chip
->
work
);
mutex_lock
(
&
chip
->
reinit_mutex
);
ak4113_init_regs
(
chip
);
mutex_unlock
(
&
chip
->
reinit_mutex
);
/* bring up statistics / event queing */
chip
->
init
=
0
;
if
(
chip
->
kctls
[
0
])
if
(
atomic_dec_and_test
(
&
chip
->
wq_processing
))
schedule_delayed_work
(
&
chip
->
work
,
HZ
/
10
);
}
EXPORT_SYMBOL_GPL
(
snd_ak4113_reinit
);
...
...
@@ -632,8 +633,25 @@ static void ak4113_stats(struct work_struct *work)
{
struct
ak4113
*
chip
=
container_of
(
work
,
struct
ak4113
,
work
.
work
);
if
(
!
chip
->
init
)
if
(
atomic_inc_return
(
&
chip
->
wq_processing
)
==
1
)
snd_ak4113_check_rate_and_errors
(
chip
,
chip
->
check_flags
);
schedule_delayed_work
(
&
chip
->
work
,
HZ
/
10
);
if
(
atomic_dec_and_test
(
&
chip
->
wq_processing
))
schedule_delayed_work
(
&
chip
->
work
,
HZ
/
10
);
}
#ifdef CONFIG_PM
void
snd_ak4113_suspend
(
struct
ak4113
*
chip
)
{
atomic_inc
(
&
chip
->
wq_processing
);
/* don't schedule new work */
cancel_delayed_work_sync
(
&
chip
->
work
);
}
EXPORT_SYMBOL
(
snd_ak4113_suspend
);
void
snd_ak4113_resume
(
struct
ak4113
*
chip
)
{
atomic_dec
(
&
chip
->
wq_processing
);
snd_ak4113_reinit
(
chip
);
}
EXPORT_SYMBOL
(
snd_ak4113_resume
);
#endif
sound/i2c/other/ak4114.c
View file @
d832f3dc
...
...
@@ -66,8 +66,7 @@ static void reg_dump(struct ak4114 *ak4114)
static
void
snd_ak4114_free
(
struct
ak4114
*
chip
)
{
chip
->
init
=
1
;
/* don't schedule new work */
mb
();
atomic_inc
(
&
chip
->
wq_processing
);
/* don't schedule new work */
cancel_delayed_work_sync
(
&
chip
->
work
);
kfree
(
chip
);
}
...
...
@@ -100,6 +99,8 @@ int snd_ak4114_create(struct snd_card *card,
chip
->
write
=
write
;
chip
->
private_data
=
private_data
;
INIT_DELAYED_WORK
(
&
chip
->
work
,
ak4114_stats
);
atomic_set
(
&
chip
->
wq_processing
,
0
);
mutex_init
(
&
chip
->
reinit_mutex
);
for
(
reg
=
0
;
reg
<
6
;
reg
++
)
chip
->
regmap
[
reg
]
=
pgm
[
reg
];
...
...
@@ -122,6 +123,7 @@ int snd_ak4114_create(struct snd_card *card,
snd_ak4114_free
(
chip
);
return
err
<
0
?
err
:
-
EIO
;
}
EXPORT_SYMBOL
(
snd_ak4114_create
);
void
snd_ak4114_reg_write
(
struct
ak4114
*
chip
,
unsigned
char
reg
,
unsigned
char
mask
,
unsigned
char
val
)
{
...
...
@@ -131,6 +133,7 @@ void snd_ak4114_reg_write(struct ak4114 *chip, unsigned char reg, unsigned char
reg_write
(
chip
,
reg
,
(
chip
->
txcsb
[
reg
-
AK4114_REG_TXCSB0
]
&
~
mask
)
|
val
);
}
EXPORT_SYMBOL
(
snd_ak4114_reg_write
);
static
void
ak4114_init_regs
(
struct
ak4114
*
chip
)
{
...
...
@@ -152,15 +155,16 @@ static void ak4114_init_regs(struct ak4114 *chip)
void
snd_ak4114_reinit
(
struct
ak4114
*
chip
)
{
chip
->
init
=
1
;
mb
(
);
flush_delayed_work
(
&
chip
->
work
);
if
(
atomic_inc_return
(
&
chip
->
wq_processing
)
==
1
)
cancel_delayed_work_sync
(
&
chip
->
work
);
mutex_lock
(
&
chip
->
reinit_mutex
);
ak4114_init_regs
(
chip
);
mutex_unlock
(
&
chip
->
reinit_mutex
);
/* bring up statistics / event queing */
chip
->
init
=
0
;
if
(
chip
->
kctls
[
0
])
if
(
atomic_dec_and_test
(
&
chip
->
wq_processing
))
schedule_delayed_work
(
&
chip
->
work
,
HZ
/
10
);
}
EXPORT_SYMBOL
(
snd_ak4114_reinit
);
static
unsigned
int
external_rate
(
unsigned
char
rcs1
)
{
...
...
@@ -505,6 +509,7 @@ int snd_ak4114_build(struct ak4114 *ak4114,
schedule_delayed_work
(
&
ak4114
->
work
,
HZ
/
10
);
return
0
;
}
EXPORT_SYMBOL
(
snd_ak4114_build
);
/* notify kcontrols if any parameters are changed */
static
void
ak4114_notify
(
struct
ak4114
*
ak4114
,
...
...
@@ -560,6 +565,7 @@ int snd_ak4114_external_rate(struct ak4114 *ak4114)
rcs1
=
reg_read
(
ak4114
,
AK4114_REG_RCS1
);
return
external_rate
(
rcs1
);
}
EXPORT_SYMBOL
(
snd_ak4114_external_rate
);
int
snd_ak4114_check_rate_and_errors
(
struct
ak4114
*
ak4114
,
unsigned
int
flags
)
{
...
...
@@ -607,20 +613,30 @@ int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags)
}
return
res
;
}
EXPORT_SYMBOL
(
snd_ak4114_check_rate_and_errors
);
static
void
ak4114_stats
(
struct
work_struct
*
work
)
{
struct
ak4114
*
chip
=
container_of
(
work
,
struct
ak4114
,
work
.
work
);
if
(
!
chip
->
init
)
if
(
atomic_inc_return
(
&
chip
->
wq_processing
)
==
1
)
snd_ak4114_check_rate_and_errors
(
chip
,
chip
->
check_flags
);
if
(
atomic_dec_and_test
(
&
chip
->
wq_processing
))
schedule_delayed_work
(
&
chip
->
work
,
HZ
/
10
);
}
schedule_delayed_work
(
&
chip
->
work
,
HZ
/
10
);
#ifdef CONFIG_PM
void
snd_ak4114_suspend
(
struct
ak4114
*
chip
)
{
atomic_inc
(
&
chip
->
wq_processing
);
/* don't schedule new work */
cancel_delayed_work_sync
(
&
chip
->
work
);
}
EXPORT_SYMBOL
(
snd_ak4114_suspend
);
EXPORT_SYMBOL
(
snd_ak4114_create
);
EXPORT_SYMBOL
(
snd_ak4114_reg_write
);
EXPORT_SYMBOL
(
snd_ak4114_reinit
);
EXPORT_SYMBOL
(
snd_ak4114_build
);
EXPORT_SYMBOL
(
snd_ak4114_external_rate
);
EXPORT_SYMBOL
(
snd_ak4114_check_rate_and_errors
);
void
snd_ak4114_resume
(
struct
ak4114
*
chip
)
{
atomic_dec
(
&
chip
->
wq_processing
);
snd_ak4114_reinit
(
chip
);
}
EXPORT_SYMBOL
(
snd_ak4114_resume
);
#endif
sound/pci/ice1712/juli.c
View file @
d832f3dc
...
...
@@ -491,15 +491,17 @@ static int juli_resume(struct snd_ice1712 *ice)
/* akm4358 un-reset, un-mute */
snd_akm4xxx_reset
(
ak
,
0
);
/* reinit ak4114 */
snd_ak4114_re
init
(
spec
->
ak4114
);
snd_ak4114_re
sume
(
spec
->
ak4114
);
return
0
;
}
static
int
juli_suspend
(
struct
snd_ice1712
*
ice
)
{
struct
snd_akm4xxx
*
ak
=
ice
->
akm
;
struct
juli_spec
*
spec
=
ice
->
spec
;
/* akm4358 reset and soft-mute */
snd_akm4xxx_reset
(
ak
,
1
);
snd_ak4114_suspend
(
spec
->
ak4114
);
return
0
;
}
#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