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
cce9b271
Commit
cce9b271
authored
Apr 30, 2017
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-next
parents
245e302a
97c415a6
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
195 additions
and
82 deletions
+195
-82
include/sound/soc.h
include/sound/soc.h
+5
-0
sound/soc/codecs/rt5665.c
sound/soc/codecs/rt5665.c
+142
-80
sound/soc/codecs/rt5665.h
sound/soc/codecs/rt5665.h
+0
-2
sound/soc/soc-jack.c
sound/soc/soc-jack.c
+48
-0
No files found.
include/sound/soc.h
View file @
cce9b271
...
...
@@ -434,6 +434,8 @@ int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
int
source
,
unsigned
int
freq
,
int
dir
);
int
snd_soc_codec_set_pll
(
struct
snd_soc_codec
*
codec
,
int
pll_id
,
int
source
,
unsigned
int
freq_in
,
unsigned
int
freq_out
);
int
snd_soc_codec_set_jack
(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_jack
*
jack
,
void
*
data
);
int
snd_soc_register_card
(
struct
snd_soc_card
*
card
);
int
snd_soc_unregister_card
(
struct
snd_soc_card
*
card
);
...
...
@@ -729,6 +731,7 @@ struct snd_soc_jack_gpio {
/* private: */
struct
snd_soc_jack
*
jack
;
struct
delayed_work
work
;
struct
notifier_block
pm_notifier
;
struct
gpio_desc
*
desc
;
void
*
data
;
...
...
@@ -920,6 +923,8 @@ struct snd_soc_codec_driver {
int
clk_id
,
int
source
,
unsigned
int
freq
,
int
dir
);
int
(
*
set_pll
)(
struct
snd_soc_codec
*
codec
,
int
pll_id
,
int
source
,
unsigned
int
freq_in
,
unsigned
int
freq_out
);
int
(
*
set_jack
)(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_jack
*
jack
,
void
*
data
);
/* codec IO */
struct
regmap
*
(
*
get_regmap
)(
struct
device
*
);
...
...
sound/soc/codecs/rt5665.c
View file @
cce9b271
This diff is collapsed.
Click to expand it.
sound/soc/codecs/rt5665.h
View file @
cce9b271
...
...
@@ -1984,7 +1984,5 @@ enum {
int
rt5665_sel_asrc_clk_src
(
struct
snd_soc_codec
*
codec
,
unsigned
int
filter_mask
,
unsigned
int
clk_src
);
int
rt5665_set_jack_detect
(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_jack
*
hs_jack
);
#endif
/* __RT5665_H__ */
sound/soc/soc-jack.c
View file @
cce9b271
...
...
@@ -19,8 +19,27 @@
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/suspend.h>
#include <trace/events/asoc.h>
/**
* snd_soc_codec_set_jack - configure codec jack.
* @codec: CODEC
* @jack: structure to use for the jack
* @data: can be used if codec driver need extra data for configuring jack
*
* Configures and enables jack detection function.
*/
int
snd_soc_codec_set_jack
(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_jack
*
jack
,
void
*
data
)
{
if
(
codec
->
driver
->
set_jack
)
return
codec
->
driver
->
set_jack
(
codec
,
jack
,
data
);
else
return
-
EINVAL
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_codec_set_jack
);
/**
* snd_soc_card_jack_new - Create a new jack
* @card: ASoC card
...
...
@@ -293,6 +312,27 @@ static void gpio_work(struct work_struct *work)
snd_soc_jack_gpio_detect
(
gpio
);
}
static
int
snd_soc_jack_pm_notifier
(
struct
notifier_block
*
nb
,
unsigned
long
action
,
void
*
data
)
{
struct
snd_soc_jack_gpio
*
gpio
=
container_of
(
nb
,
struct
snd_soc_jack_gpio
,
pm_notifier
);
switch
(
action
)
{
case
PM_POST_SUSPEND
:
case
PM_POST_HIBERNATION
:
case
PM_POST_RESTORE
:
/*
* Use workqueue so we do not have to care about running
* concurrently with work triggered by the interrupt handler.
*/
queue_delayed_work
(
system_power_efficient_wq
,
&
gpio
->
work
,
0
);
break
;
}
return
NOTIFY_DONE
;
}
/**
* snd_soc_jack_add_gpios - Associate GPIO pins with an ASoC jack
*
...
...
@@ -369,6 +409,13 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
i
,
ret
);
}
/*
* Register PM notifier so we do not miss state transitions
* happening while system is asleep.
*/
gpios
[
i
].
pm_notifier
.
notifier_call
=
snd_soc_jack_pm_notifier
;
register_pm_notifier
(
&
gpios
[
i
].
pm_notifier
);
/* Expose GPIO value over sysfs for diagnostic purposes */
gpiod_export
(
gpios
[
i
].
desc
,
false
);
...
...
@@ -428,6 +475,7 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
for
(
i
=
0
;
i
<
count
;
i
++
)
{
gpiod_unexport
(
gpios
[
i
].
desc
);
unregister_pm_notifier
(
&
gpios
[
i
].
pm_notifier
);
free_irq
(
gpiod_to_irq
(
gpios
[
i
].
desc
),
&
gpios
[
i
]);
cancel_delayed_work_sync
(
&
gpios
[
i
].
work
);
gpiod_put
(
gpios
[
i
].
desc
);
...
...
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