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
30010a27
Commit
30010a27
authored
Jan 02, 2014
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/fix/fsl' into asoc-linus
parents
802eee95
14c3aa98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
64 deletions
+21
-64
sound/soc/fsl/Kconfig
sound/soc/fsl/Kconfig
+0
-1
sound/soc/fsl/imx-spdif.c
sound/soc/fsl/imx-spdif.c
+21
-63
No files found.
sound/soc/fsl/Kconfig
View file @
30010a27
...
@@ -197,7 +197,6 @@ config SND_SOC_IMX_SPDIF
...
@@ -197,7 +197,6 @@ config SND_SOC_IMX_SPDIF
tristate "SoC Audio support for i.MX boards with S/PDIF"
tristate "SoC Audio support for i.MX boards with S/PDIF"
select SND_SOC_IMX_PCM_DMA
select SND_SOC_IMX_PCM_DMA
select SND_SOC_FSL_SPDIF
select SND_SOC_FSL_SPDIF
select SND_SOC_SPDIF
select REGMAP_MMIO
select REGMAP_MMIO
help
help
SoC Audio support for i.MX boards with S/PDIF
SoC Audio support for i.MX boards with S/PDIF
...
...
sound/soc/fsl/imx-spdif.c
View file @
30010a27
...
@@ -14,17 +14,15 @@
...
@@ -14,17 +14,15 @@
#include <sound/soc.h>
#include <sound/soc.h>
struct
imx_spdif_data
{
struct
imx_spdif_data
{
struct
snd_soc_dai_link
dai
[
2
]
;
struct
snd_soc_dai_link
dai
;
struct
snd_soc_card
card
;
struct
snd_soc_card
card
;
struct
platform_device
*
txdev
;
struct
platform_device
*
rxdev
;
};
};
static
int
imx_spdif_audio_probe
(
struct
platform_device
*
pdev
)
static
int
imx_spdif_audio_probe
(
struct
platform_device
*
pdev
)
{
{
struct
device_node
*
spdif_np
,
*
np
=
pdev
->
dev
.
of_node
;
struct
device_node
*
spdif_np
,
*
np
=
pdev
->
dev
.
of_node
;
struct
imx_spdif_data
*
data
;
struct
imx_spdif_data
*
data
;
int
ret
=
0
,
num_links
=
0
;
int
ret
=
0
;
spdif_np
=
of_parse_phandle
(
np
,
"spdif-controller"
,
0
);
spdif_np
=
of_parse_phandle
(
np
,
"spdif-controller"
,
0
);
if
(
!
spdif_np
)
{
if
(
!
spdif_np
)
{
...
@@ -40,69 +38,42 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
...
@@ -40,69 +38,42 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
goto
end
;
goto
end
;
}
}
if
(
of_property_read_bool
(
np
,
"spdif-out"
))
{
data
->
dai
.
name
=
"S/PDIF PCM"
;
data
->
dai
[
num_links
].
name
=
"S/PDIF TX"
;
data
->
dai
.
stream_name
=
"S/PDIF PCM"
;
data
->
dai
[
num_links
].
stream_name
=
"S/PDIF PCM Playback"
;
data
->
dai
.
codec_dai_name
=
"snd-soc-dummy-dai"
;
data
->
dai
[
num_links
].
codec_dai_name
=
"dit-hifi"
;
data
->
dai
.
codec_name
=
"snd-soc-dummy"
;
data
->
dai
[
num_links
].
codec_name
=
"spdif-dit"
;
data
->
dai
.
cpu_of_node
=
spdif_np
;
data
->
dai
[
num_links
].
cpu_of_node
=
spdif_np
;
data
->
dai
.
platform_of_node
=
spdif_np
;
data
->
dai
[
num_links
].
platform_of_node
=
spdif_np
;
data
->
dai
.
playback_only
=
true
;
num_links
++
;
data
->
dai
.
capture_only
=
true
;
data
->
txdev
=
platform_device_register_simple
(
"spdif-dit"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
data
->
txdev
))
{
ret
=
PTR_ERR
(
data
->
txdev
);
dev_err
(
&
pdev
->
dev
,
"register dit failed: %d
\n
"
,
ret
);
goto
end
;
}
}
if
(
of_property_read_bool
(
np
,
"spdif-in"
))
{
if
(
of_property_read_bool
(
np
,
"spdif-out"
))
data
->
dai
[
num_links
].
name
=
"S/PDIF RX"
;
data
->
dai
.
capture_only
=
false
;
data
->
dai
[
num_links
].
stream_name
=
"S/PDIF PCM Capture"
;
data
->
dai
[
num_links
].
codec_dai_name
=
"dir-hifi"
;
if
(
of_property_read_bool
(
np
,
"spdif-in"
))
data
->
dai
[
num_links
].
codec_name
=
"spdif-dir"
;
data
->
dai
.
playback_only
=
false
;
data
->
dai
[
num_links
].
cpu_of_node
=
spdif_np
;
data
->
dai
[
num_links
].
platform_of_node
=
spdif_np
;
num_links
++
;
data
->
rxdev
=
platform_device_register_simple
(
"spdif-dir"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
data
->
rxdev
))
{
ret
=
PTR_ERR
(
data
->
rxdev
);
dev_err
(
&
pdev
->
dev
,
"register dir failed: %d
\n
"
,
ret
);
goto
error_dit
;
}
}
if
(
!
num_links
)
{
if
(
data
->
dai
.
playback_only
&&
data
->
dai
.
capture_only
)
{
dev_err
(
&
pdev
->
dev
,
"no enabled S/PDIF DAI link
\n
"
);
dev_err
(
&
pdev
->
dev
,
"no enabled S/PDIF DAI link
\n
"
);
goto
e
rror_dir
;
goto
e
nd
;
}
}
data
->
card
.
dev
=
&
pdev
->
dev
;
data
->
card
.
dev
=
&
pdev
->
dev
;
data
->
card
.
num_links
=
num_links
;
data
->
card
.
dai_link
=
&
data
->
dai
;
data
->
card
.
dai_link
=
data
->
dai
;
data
->
card
.
num_links
=
1
;
ret
=
snd_soc_of_parse_card_name
(
&
data
->
card
,
"model"
);
ret
=
snd_soc_of_parse_card_name
(
&
data
->
card
,
"model"
);
if
(
ret
)
if
(
ret
)
goto
e
rror_dir
;
goto
e
nd
;
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
data
->
card
);
ret
=
devm_snd_soc_register_card
(
&
pdev
->
dev
,
&
data
->
card
);
if
(
ret
)
{
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed: %d
\n
"
,
ret
);
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed: %d
\n
"
,
ret
);
goto
e
rror_dir
;
goto
e
nd
;
}
}
platform_set_drvdata
(
pdev
,
data
);
platform_set_drvdata
(
pdev
,
data
);
goto
end
;
error_dir:
if
(
data
->
rxdev
)
platform_device_unregister
(
data
->
rxdev
);
error_dit:
if
(
data
->
txdev
)
platform_device_unregister
(
data
->
txdev
);
end:
end:
if
(
spdif_np
)
if
(
spdif_np
)
of_node_put
(
spdif_np
);
of_node_put
(
spdif_np
);
...
@@ -110,18 +81,6 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
...
@@ -110,18 +81,6 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
return
ret
;
return
ret
;
}
}
static
int
imx_spdif_audio_remove
(
struct
platform_device
*
pdev
)
{
struct
imx_spdif_data
*
data
=
platform_get_drvdata
(
pdev
);
if
(
data
->
rxdev
)
platform_device_unregister
(
data
->
rxdev
);
if
(
data
->
txdev
)
platform_device_unregister
(
data
->
txdev
);
return
0
;
}
static
const
struct
of_device_id
imx_spdif_dt_ids
[]
=
{
static
const
struct
of_device_id
imx_spdif_dt_ids
[]
=
{
{
.
compatible
=
"fsl,imx-audio-spdif"
,
},
{
.
compatible
=
"fsl,imx-audio-spdif"
,
},
{
/* sentinel */
}
{
/* sentinel */
}
...
@@ -135,7 +94,6 @@ static struct platform_driver imx_spdif_driver = {
...
@@ -135,7 +94,6 @@ static struct platform_driver imx_spdif_driver = {
.
of_match_table
=
imx_spdif_dt_ids
,
.
of_match_table
=
imx_spdif_dt_ids
,
},
},
.
probe
=
imx_spdif_audio_probe
,
.
probe
=
imx_spdif_audio_probe
,
.
remove
=
imx_spdif_audio_remove
,
};
};
module_platform_driver
(
imx_spdif_driver
);
module_platform_driver
(
imx_spdif_driver
);
...
...
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