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
97473630
Commit
97473630
authored
Aug 22, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/mxs' into asoc-next
parents
0995df3b
d66a5b9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
sound/soc/mxs/Kconfig
sound/soc/mxs/Kconfig
+2
-1
sound/soc/mxs/mxs-saif.c
sound/soc/mxs/mxs-saif.c
+0
-1
sound/soc/mxs/mxs-sgtl5000.c
sound/soc/mxs/mxs-sgtl5000.c
+23
-7
No files found.
sound/soc/mxs/Kconfig
View file @
97473630
menuconfig SND_MXS_SOC
tristate "SoC Audio for Freescale MXS CPUs"
depends on ARCH_MXS
depends on ARCH_MXS || COMPILE_TEST
depends on COMMON_CLK
select SND_SOC_GENERIC_DMAENGINE_PCM
help
Say Y or M if you want to add support for codecs attached to
...
...
sound/soc/mxs/mxs-saif.c
View file @
97473630
...
...
@@ -31,7 +31,6 @@
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <asm/mach-types.h>
#include "mxs-saif.h"
...
...
sound/soc/mxs/mxs-sgtl5000.c
View file @
97473630
...
...
@@ -25,7 +25,6 @@
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/soc-dapm.h>
#include <asm/mach-types.h>
#include "../codecs/sgtl5000.h"
#include "mxs-saif.h"
...
...
@@ -51,18 +50,27 @@ static int mxs_sgtl5000_hw_params(struct snd_pcm_substream *substream,
}
/* Sgtl5000 sysclk should be >= 8MHz and <= 27M */
if
(
mclk
<
8000000
||
mclk
>
27000000
)
if
(
mclk
<
8000000
||
mclk
>
27000000
)
{
dev_err
(
codec_dai
->
dev
,
"Invalid mclk frequency: %u.%03uMHz
\n
"
,
mclk
/
1000000
,
mclk
/
1000
%
1000
);
return
-
EINVAL
;
}
/* Set SGTL5000's SYSCLK (provided by SAIF MCLK) */
ret
=
snd_soc_dai_set_sysclk
(
codec_dai
,
SGTL5000_SYSCLK
,
mclk
,
0
);
if
(
ret
)
if
(
ret
)
{
dev_err
(
codec_dai
->
dev
,
"Failed to set sysclk to %u.%03uMHz
\n
"
,
mclk
/
1000000
,
mclk
/
1000
%
1000
);
return
ret
;
}
/* The SAIF MCLK should be the same as SGTL5000_SYSCLK */
ret
=
snd_soc_dai_set_sysclk
(
cpu_dai
,
MXS_SAIF_MCLK
,
mclk
,
0
);
if
(
ret
)
if
(
ret
)
{
dev_err
(
cpu_dai
->
dev
,
"Failed to set sysclk to %u.%03uMHz
\n
"
,
mclk
/
1000000
,
mclk
/
1000
%
1000
);
return
ret
;
}
/* set codec to slave mode */
dai_format
=
SND_SOC_DAIFMT_I2S
|
SND_SOC_DAIFMT_NB_NF
|
...
...
@@ -70,13 +78,19 @@ static int mxs_sgtl5000_hw_params(struct snd_pcm_substream *substream,
/* set codec DAI configuration */
ret
=
snd_soc_dai_set_fmt
(
codec_dai
,
dai_format
);
if
(
ret
)
if
(
ret
)
{
dev_err
(
codec_dai
->
dev
,
"Failed to set dai format to %08x
\n
"
,
dai_format
);
return
ret
;
}
/* set cpu DAI configuration */
ret
=
snd_soc_dai_set_fmt
(
cpu_dai
,
dai_format
);
if
(
ret
)
if
(
ret
)
{
dev_err
(
cpu_dai
->
dev
,
"Failed to set dai format to %08x
\n
"
,
dai_format
);
return
ret
;
}
return
0
;
}
...
...
@@ -154,8 +168,10 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
* should be >= 8MHz and <= 27M.
*/
ret
=
mxs_saif_get_mclk
(
0
,
44100
*
256
,
44100
);
if
(
ret
)
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"failed to get mclk
\n
"
);
return
ret
;
}
card
->
dev
=
&
pdev
->
dev
;
platform_set_drvdata
(
pdev
,
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