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
99a0ea2d
Commit
99a0ea2d
authored
Nov 08, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/devm' into asoc-next
parents
ac97d4e0
4fa8dbc1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
108 additions
and
52 deletions
+108
-52
include/sound/soc.h
include/sound/soc.h
+4
-0
sound/soc/Makefile
sound/soc/Makefile
+1
-1
sound/soc/fsl/fsl_spdif.c
sound/soc/fsl/fsl_spdif.c
+3
-11
sound/soc/fsl/imx-sgtl5000.c
sound/soc/fsl/imx-sgtl5000.c
+1
-2
sound/soc/fsl/imx-spdif.c
sound/soc/fsl/imx-spdif.c
+1
-3
sound/soc/fsl/imx-wm8962.c
sound/soc/fsl/imx-wm8962.c
+1
-2
sound/soc/mid-x86/mfld_machine.c
sound/soc/mid-x86/mfld_machine.c
+1
-9
sound/soc/mxs/mxs-saif.c
sound/soc/mxs/mxs-saif.c
+3
-9
sound/soc/omap/omap-mcpdm.c
sound/soc/omap/omap-mcpdm.c
+3
-9
sound/soc/omap/omap-twl4030.c
sound/soc/omap/omap-twl4030.c
+2
-3
sound/soc/pxa/mmp-sspa.c
sound/soc/pxa/mmp-sspa.c
+2
-3
sound/soc/soc-devres.c
sound/soc/soc-devres.c
+86
-0
No files found.
include/sound/soc.h
View file @
99a0ea2d
...
...
@@ -365,6 +365,7 @@ int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
int
snd_soc_register_card
(
struct
snd_soc_card
*
card
);
int
snd_soc_unregister_card
(
struct
snd_soc_card
*
card
);
int
devm_snd_soc_register_card
(
struct
device
*
dev
,
struct
snd_soc_card
*
card
);
int
snd_soc_suspend
(
struct
device
*
dev
);
int
snd_soc_resume
(
struct
device
*
dev
);
int
snd_soc_poweroff
(
struct
device
*
dev
);
...
...
@@ -382,6 +383,9 @@ void snd_soc_unregister_codec(struct device *dev);
int
snd_soc_register_component
(
struct
device
*
dev
,
const
struct
snd_soc_component_driver
*
cmpnt_drv
,
struct
snd_soc_dai_driver
*
dai_drv
,
int
num_dai
);
int
devm_snd_soc_register_component
(
struct
device
*
dev
,
const
struct
snd_soc_component_driver
*
cmpnt_drv
,
struct
snd_soc_dai_driver
*
dai_drv
,
int
num_dai
);
void
snd_soc_unregister_component
(
struct
device
*
dev
);
int
snd_soc_codec_volatile_register
(
struct
snd_soc_codec
*
codec
,
unsigned
int
reg
);
...
...
sound/soc/Makefile
View file @
99a0ea2d
snd-soc-core-objs
:=
soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
snd-soc-core-objs
+=
soc-pcm.o soc-compress.o soc-io.o
snd-soc-core-objs
+=
soc-pcm.o soc-compress.o soc-io.o
soc-devres.o
ifneq
($(CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM),)
snd-soc-core-objs
+=
soc-generic-dmaengine-pcm.o
...
...
sound/soc/fsl/fsl_spdif.c
View file @
99a0ea2d
...
...
@@ -1172,23 +1172,16 @@ static int fsl_spdif_probe(struct platform_device *pdev)
/* Register with ASoC */
dev_set_drvdata
(
&
pdev
->
dev
,
spdif_priv
);
ret
=
snd_soc_register_component
(
&
pdev
->
dev
,
&
fsl_spdif_component
,
&
spdif_priv
->
cpu_dai_drv
,
1
);
ret
=
devm_
snd_soc_register_component
(
&
pdev
->
dev
,
&
fsl_spdif_component
,
&
spdif_priv
->
cpu_dai_drv
,
1
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"failed to register DAI: %d
\n
"
,
ret
);
return
ret
;
}
ret
=
imx_pcm_dma_init
(
pdev
);
if
(
ret
)
{
if
(
ret
)
dev_err
(
&
pdev
->
dev
,
"imx_pcm_dma_init failed: %d
\n
"
,
ret
);
goto
error_component
;
}
return
ret
;
error_component:
snd_soc_unregister_component
(
&
pdev
->
dev
);
return
ret
;
}
...
...
@@ -1196,7 +1189,6 @@ static int fsl_spdif_probe(struct platform_device *pdev)
static
int
fsl_spdif_remove
(
struct
platform_device
*
pdev
)
{
imx_pcm_dma_exit
(
pdev
);
snd_soc_unregister_component
(
&
pdev
->
dev
);
return
0
;
}
...
...
sound/soc/fsl/imx-sgtl5000.c
View file @
99a0ea2d
...
...
@@ -159,7 +159,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
data
->
card
.
dapm_widgets
=
imx_sgtl5000_dapm_widgets
;
data
->
card
.
num_dapm_widgets
=
ARRAY_SIZE
(
imx_sgtl5000_dapm_widgets
);
ret
=
snd_soc_register_card
(
&
data
->
card
);
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
data
->
card
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed (%d)
\n
"
,
ret
);
goto
fail
;
...
...
@@ -186,7 +186,6 @@ static int imx_sgtl5000_remove(struct platform_device *pdev)
{
struct
imx_sgtl5000_data
*
data
=
platform_get_drvdata
(
pdev
);
snd_soc_unregister_card
(
&
data
->
card
);
clk_put
(
data
->
codec_clk
);
return
0
;
...
...
sound/soc/fsl/imx-spdif.c
View file @
99a0ea2d
...
...
@@ -87,7 +87,7 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
if
(
ret
)
goto
error_dir
;
ret
=
snd_soc_register_card
(
&
data
->
card
);
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
data
->
card
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed: %d
\n
"
,
ret
);
goto
error_dir
;
...
...
@@ -119,8 +119,6 @@ static int imx_spdif_audio_remove(struct platform_device *pdev)
if
(
data
->
txdev
)
platform_device_unregister
(
data
->
txdev
);
snd_soc_unregister_card
(
&
data
->
card
);
return
0
;
}
...
...
sound/soc/fsl/imx-wm8962.c
View file @
99a0ea2d
...
...
@@ -266,7 +266,7 @@ static int imx_wm8962_probe(struct platform_device *pdev)
data
->
card
.
late_probe
=
imx_wm8962_late_probe
;
data
->
card
.
set_bias_level
=
imx_wm8962_set_bias_level
;
ret
=
snd_soc_register_card
(
&
data
->
card
);
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
data
->
card
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed (%d)
\n
"
,
ret
);
goto
clk_fail
;
...
...
@@ -296,7 +296,6 @@ static int imx_wm8962_remove(struct platform_device *pdev)
if
(
!
IS_ERR
(
data
->
codec_clk
))
clk_disable_unprepare
(
data
->
codec_clk
);
snd_soc_unregister_card
(
&
data
->
card
);
return
0
;
}
...
...
sound/soc/mid-x86/mfld_machine.c
View file @
99a0ea2d
...
...
@@ -400,7 +400,7 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
}
/* register the soc card */
snd_soc_card_mfld
.
dev
=
&
pdev
->
dev
;
ret_val
=
snd_soc_register_card
(
&
snd_soc_card_mfld
);
ret_val
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
snd_soc_card_mfld
);
if
(
ret_val
)
{
pr_debug
(
"snd_soc_register_card failed %d
\n
"
,
ret_val
);
return
ret_val
;
...
...
@@ -410,20 +410,12 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
return
0
;
}
static
int
snd_mfld_mc_remove
(
struct
platform_device
*
pdev
)
{
pr_debug
(
"snd_mfld_mc_remove called
\n
"
);
snd_soc_unregister_card
(
&
snd_soc_card_mfld
);
return
0
;
}
static
struct
platform_driver
snd_mfld_mc_driver
=
{
.
driver
=
{
.
owner
=
THIS_MODULE
,
.
name
=
"msic_audio"
,
},
.
probe
=
snd_mfld_mc_probe
,
.
remove
=
snd_mfld_mc_remove
,
};
module_platform_driver
(
snd_mfld_mc_driver
);
...
...
sound/soc/mxs/mxs-saif.c
View file @
99a0ea2d
...
...
@@ -768,8 +768,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
dev_warn
(
&
pdev
->
dev
,
"failed to init clocks
\n
"
);
}
ret
=
snd_soc_register_component
(
&
pdev
->
dev
,
&
mxs_saif_component
,
&
mxs_saif_dai
,
1
);
ret
=
devm_
snd_soc_register_component
(
&
pdev
->
dev
,
&
mxs_saif_component
,
&
mxs_saif_dai
,
1
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"register DAI failed
\n
"
);
return
ret
;
...
...
@@ -778,21 +778,15 @@ static int mxs_saif_probe(struct platform_device *pdev)
ret
=
mxs_pcm_platform_register
(
&
pdev
->
dev
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"register PCM failed: %d
\n
"
,
ret
);
goto
failed_pdev_alloc
;
return
ret
;
}
return
0
;
failed_pdev_alloc:
snd_soc_unregister_component
(
&
pdev
->
dev
);
return
ret
;
}
static
int
mxs_saif_remove
(
struct
platform_device
*
pdev
)
{
mxs_pcm_platform_unregister
(
&
pdev
->
dev
);
snd_soc_unregister_component
(
&
pdev
->
dev
);
return
0
;
}
...
...
sound/soc/omap/omap-mcpdm.c
View file @
99a0ea2d
...
...
@@ -490,14 +490,9 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
mcpdm
->
dev
=
&
pdev
->
dev
;
return
snd_soc_register_component
(
&
pdev
->
dev
,
&
omap_mcpdm_component
,
&
omap_mcpdm_dai
,
1
);
}
static
int
asoc_mcpdm_remove
(
struct
platform_device
*
pdev
)
{
snd_soc_unregister_component
(
&
pdev
->
dev
);
return
0
;
return
devm_snd_soc_register_component
(
&
pdev
->
dev
,
&
omap_mcpdm_component
,
&
omap_mcpdm_dai
,
1
);
}
static
const
struct
of_device_id
omap_mcpdm_of_match
[]
=
{
...
...
@@ -514,7 +509,6 @@ static struct platform_driver asoc_mcpdm_driver = {
},
.
probe
=
asoc_mcpdm_probe
,
.
remove
=
asoc_mcpdm_remove
,
};
module_platform_driver
(
asoc_mcpdm_driver
);
...
...
sound/soc/omap/omap-twl4030.c
View file @
99a0ea2d
...
...
@@ -338,9 +338,9 @@ static int omap_twl4030_probe(struct platform_device *pdev)
}
snd_soc_card_set_drvdata
(
card
,
priv
);
ret
=
snd_soc_register_card
(
card
);
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
card
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card() failed: %d
\n
"
,
dev_err
(
&
pdev
->
dev
,
"
devm_
snd_soc_register_card() failed: %d
\n
"
,
ret
);
return
ret
;
}
...
...
@@ -357,7 +357,6 @@ static int omap_twl4030_remove(struct platform_device *pdev)
snd_soc_jack_free_gpios
(
&
priv
->
hs_jack
,
ARRAY_SIZE
(
hs_jack_gpios
),
hs_jack_gpios
);
snd_soc_unregister_card
(
card
);
return
0
;
}
...
...
sound/soc/pxa/mmp-sspa.c
View file @
99a0ea2d
...
...
@@ -455,8 +455,8 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
priv
->
dai_fmt
=
(
unsigned
int
)
-
1
;
platform_set_drvdata
(
pdev
,
priv
);
return
snd_soc_register_component
(
&
pdev
->
dev
,
&
mmp_sspa_component
,
&
mmp_sspa_dai
,
1
);
return
devm_
snd_soc_register_component
(
&
pdev
->
dev
,
&
mmp_sspa_component
,
&
mmp_sspa_dai
,
1
);
}
static
int
asoc_mmp_sspa_remove
(
struct
platform_device
*
pdev
)
...
...
@@ -466,7 +466,6 @@ static int asoc_mmp_sspa_remove(struct platform_device *pdev)
clk_disable
(
priv
->
audio_clk
);
clk_put
(
priv
->
audio_clk
);
clk_put
(
priv
->
sysclk
);
snd_soc_unregister_component
(
&
pdev
->
dev
);
return
0
;
}
...
...
sound/soc/soc-devres.c
0 → 100644
View file @
99a0ea2d
/*
* soc-devres.c -- ALSA SoC Audio Layer devres functions
*
* Copyright (C) 2013 Linaro Ltd
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <sound/soc.h>
static
void
devm_component_release
(
struct
device
*
dev
,
void
*
res
)
{
snd_soc_unregister_component
(
*
(
struct
device
**
)
res
);
}
/**
* devm_snd_soc_register_component - resource managed component registration
* @dev: Device used to manage component
* @cmpnt_drv: Component driver
* @dai_drv: DAI driver
* @num_dai: Number of DAIs to register
*
* Register a component with automatic unregistration when the device is
* unregistered.
*/
int
devm_snd_soc_register_component
(
struct
device
*
dev
,
const
struct
snd_soc_component_driver
*
cmpnt_drv
,
struct
snd_soc_dai_driver
*
dai_drv
,
int
num_dai
)
{
struct
device
**
ptr
;
int
ret
;
ptr
=
devres_alloc
(
devm_component_release
,
sizeof
(
*
ptr
),
GFP_KERNEL
);
if
(
!
ptr
)
return
-
ENOMEM
;
ret
=
snd_soc_register_component
(
dev
,
cmpnt_drv
,
dai_drv
,
num_dai
);
if
(
ret
==
0
)
{
*
ptr
=
dev
;
devres_add
(
dev
,
ptr
);
}
else
{
devres_free
(
ptr
);
}
return
ret
;
}
EXPORT_SYMBOL_GPL
(
devm_snd_soc_register_component
);
static
void
devm_card_release
(
struct
device
*
dev
,
void
*
res
)
{
snd_soc_unregister_card
(
*
(
struct
snd_soc_card
**
)
res
);
}
/**
* devm_snd_soc_register_card - resource managed card registration
* @dev: Device used to manage card
* @card: Card to register
*
* Register a card with automatic unregistration when the device is
* unregistered.
*/
int
devm_snd_soc_register_card
(
struct
device
*
dev
,
struct
snd_soc_card
*
card
)
{
struct
device
**
ptr
;
int
ret
;
ptr
=
devres_alloc
(
devm_card_release
,
sizeof
(
*
ptr
),
GFP_KERNEL
);
if
(
!
ptr
)
return
-
ENOMEM
;
ret
=
snd_soc_register_card
(
card
);
if
(
ret
==
0
)
{
*
ptr
=
dev
;
devres_add
(
dev
,
ptr
);
}
else
{
devres_free
(
ptr
);
}
return
ret
;
}
EXPORT_SYMBOL_GPL
(
devm_snd_soc_register_card
);
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