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
e6c6fd89
Commit
e6c6fd89
authored
Dec 12, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/dapm-pin' into asoc-next
parents
c0f2302a
1b4d9c22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
219 additions
and
0 deletions
+219
-0
include/sound/soc.h
include/sound/soc.h
+20
-0
sound/soc/soc-utils.c
sound/soc/soc-utils.c
+199
-0
No files found.
include/sound/soc.h
View file @
e6c6fd89
...
...
@@ -1698,4 +1698,24 @@ static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
mutex_unlock
(
&
dapm
->
card
->
dapm_mutex
);
}
int
snd_soc_component_enable_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_enable_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_disable_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_disable_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_nc_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_nc_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_get_pin_status
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_force_enable_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
int
snd_soc_component_force_enable_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
);
#endif
sound/soc/soc-utils.c
View file @
e6c6fd89
...
...
@@ -58,6 +58,205 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params)
}
EXPORT_SYMBOL_GPL
(
snd_soc_params_to_bclk
);
int
snd_soc_component_enable_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_enable_pin
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_enable_pin
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_enable_pin
);
int
snd_soc_component_enable_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_enable_pin_unlocked
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_enable_pin_unlocked
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_enable_pin_unlocked
);
int
snd_soc_component_disable_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_disable_pin
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_disable_pin
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_disable_pin
);
int
snd_soc_component_disable_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_disable_pin_unlocked
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_disable_pin_unlocked
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_disable_pin_unlocked
);
int
snd_soc_component_nc_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_nc_pin
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_nc_pin
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_nc_pin
);
int
snd_soc_component_nc_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_nc_pin_unlocked
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_nc_pin_unlocked
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_nc_pin_unlocked
);
int
snd_soc_component_get_pin_status
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_get_pin_status
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_get_pin_status
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_get_pin_status
);
int
snd_soc_component_force_enable_pin
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_force_enable_pin
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_force_enable_pin
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_force_enable_pin
);
int
snd_soc_component_force_enable_pin_unlocked
(
struct
snd_soc_component
*
component
,
const
char
*
pin
)
{
struct
snd_soc_dapm_context
*
dapm
=
snd_soc_component_get_dapm
(
component
);
char
*
full_name
;
int
ret
;
if
(
!
component
->
name_prefix
)
return
snd_soc_dapm_force_enable_pin_unlocked
(
dapm
,
pin
);
full_name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
component
->
name_prefix
,
pin
);
if
(
!
full_name
)
return
-
ENOMEM
;
ret
=
snd_soc_dapm_force_enable_pin_unlocked
(
dapm
,
full_name
);
kfree
(
full_name
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_component_force_enable_pin_unlocked
);
static
const
struct
snd_pcm_hardware
dummy_dma_hardware
=
{
/* Random values to keep userspace happy when checking constraints */
.
info
=
SNDRV_PCM_INFO_INTERLEAVED
|
...
...
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