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
c76a507b
Commit
c76a507b
authored
Jun 17, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/mxs' into asoc-next
parents
ff868b22
62477adf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
68 deletions
+12
-68
Documentation/devicetree/bindings/sound/mxs-saif.txt
Documentation/devicetree/bindings/sound/mxs-saif.txt
+11
-6
sound/soc/mxs/mxs-pcm.c
sound/soc/mxs/mxs-pcm.c
+0
-18
sound/soc/mxs/mxs-pcm.h
sound/soc/mxs/mxs-pcm.h
+0
-7
sound/soc/mxs/mxs-saif.c
sound/soc/mxs/mxs-saif.c
+1
-36
sound/soc/mxs/mxs-saif.h
sound/soc/mxs/mxs-saif.h
+0
-1
No files found.
Documentation/devicetree/bindings/sound/mxs-saif.txt
View file @
c76a507b
...
@@ -3,8 +3,11 @@
...
@@ -3,8 +3,11 @@
Required properties:
Required properties:
- compatible: Should be "fsl,<chip>-saif"
- compatible: Should be "fsl,<chip>-saif"
- reg: Should contain registers location and length
- reg: Should contain registers location and length
- interrupts: Should contain ERROR and DMA interrupts
- interrupts: Should contain ERROR interrupt number
- fsl,saif-dma-channel: APBX DMA channel for the SAIF
- dmas: DMA specifier, consisting of a phandle to DMA controller node
and SAIF DMA channel ID.
Refer to dma.txt and fsl-mxs-dma.txt for details.
- dma-names: Must be "rx-tx".
Optional properties:
Optional properties:
- fsl,saif-master: phandle to the master SAIF. It's only required for
- fsl,saif-master: phandle to the master SAIF. It's only required for
...
@@ -23,14 +26,16 @@ aliases {
...
@@ -23,14 +26,16 @@ aliases {
saif0: saif@80042000 {
saif0: saif@80042000 {
compatible = "fsl,imx28-saif";
compatible = "fsl,imx28-saif";
reg = <0x80042000 2000>;
reg = <0x80042000 2000>;
interrupts = <59 80>;
interrupts = <59>;
fsl,saif-dma-channel = <4>;
dmas = <&dma_apbx 4>;
dma-names = "rx-tx";
};
};
saif1: saif@80046000 {
saif1: saif@80046000 {
compatible = "fsl,imx28-saif";
compatible = "fsl,imx28-saif";
reg = <0x80046000 2000>;
reg = <0x80046000 2000>;
interrupts = <58 81>;
interrupts = <58>;
fsl,saif-dma-channel = <5>;
dmas = <&dma_apbx 5>;
dma-names = "rx-tx";
fsl,saif-master = <&saif0>;
fsl,saif-master = <&saif0>;
};
};
sound/soc/mxs/mxs-pcm.c
View file @
c76a507b
...
@@ -49,24 +49,8 @@ static const struct snd_pcm_hardware snd_mxs_hardware = {
...
@@ -49,24 +49,8 @@ static const struct snd_pcm_hardware snd_mxs_hardware = {
.
fifo_size
=
32
,
.
fifo_size
=
32
,
};
};
static
bool
filter
(
struct
dma_chan
*
chan
,
void
*
param
)
{
struct
mxs_pcm_dma_params
*
dma_params
=
param
;
if
(
!
mxs_dma_is_apbx
(
chan
))
return
false
;
if
(
chan
->
chan_id
!=
dma_params
->
chan_num
)
return
false
;
chan
->
private
=
&
dma_params
->
dma_data
;
return
true
;
}
static
const
struct
snd_dmaengine_pcm_config
mxs_dmaengine_pcm_config
=
{
static
const
struct
snd_dmaengine_pcm_config
mxs_dmaengine_pcm_config
=
{
.
pcm_hardware
=
&
snd_mxs_hardware
,
.
pcm_hardware
=
&
snd_mxs_hardware
,
.
compat_filter_fn
=
filter
,
.
prealloc_buffer_size
=
64
*
1024
,
.
prealloc_buffer_size
=
64
*
1024
,
};
};
...
@@ -74,8 +58,6 @@ int mxs_pcm_platform_register(struct device *dev)
...
@@ -74,8 +58,6 @@ int mxs_pcm_platform_register(struct device *dev)
{
{
return
snd_dmaengine_pcm_register
(
dev
,
&
mxs_dmaengine_pcm_config
,
return
snd_dmaengine_pcm_register
(
dev
,
&
mxs_dmaengine_pcm_config
,
SND_DMAENGINE_PCM_FLAG_NO_RESIDUE
|
SND_DMAENGINE_PCM_FLAG_NO_RESIDUE
|
SND_DMAENGINE_PCM_FLAG_NO_DT
|
SND_DMAENGINE_PCM_FLAG_COMPAT
|
SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX
);
SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX
);
}
}
EXPORT_SYMBOL_GPL
(
mxs_pcm_platform_register
);
EXPORT_SYMBOL_GPL
(
mxs_pcm_platform_register
);
...
...
sound/soc/mxs/mxs-pcm.h
View file @
c76a507b
...
@@ -19,13 +19,6 @@
...
@@ -19,13 +19,6 @@
#ifndef _MXS_PCM_H
#ifndef _MXS_PCM_H
#define _MXS_PCM_H
#define _MXS_PCM_H
#include <linux/fsl/mxs-dma.h>
struct
mxs_pcm_dma_params
{
struct
mxs_dma_data
dma_data
;
int
chan_num
;
};
int
mxs_pcm_platform_register
(
struct
device
*
dev
);
int
mxs_pcm_platform_register
(
struct
device
*
dev
);
void
mxs_pcm_platform_unregister
(
struct
device
*
dev
);
void
mxs_pcm_platform_unregister
(
struct
device
*
dev
);
...
...
sound/soc/mxs/mxs-saif.c
View file @
c76a507b
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
#include <linux/clk.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/fsl/mxs-dma.h>
#include <linux/pinctrl/consumer.h>
#include <sound/core.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/pcm_params.h>
...
@@ -605,8 +603,6 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai)
...
@@ -605,8 +603,6 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai)
struct
mxs_saif
*
saif
=
dev_get_drvdata
(
dai
->
dev
);
struct
mxs_saif
*
saif
=
dev_get_drvdata
(
dai
->
dev
);
snd_soc_dai_set_drvdata
(
dai
,
saif
);
snd_soc_dai_set_drvdata
(
dai
,
saif
);
dai
->
playback_dma_data
=
&
saif
->
dma_param
;
dai
->
capture_dma_data
=
&
saif
->
dma_param
;
return
0
;
return
0
;
}
}
...
@@ -665,9 +661,8 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
...
@@ -665,9 +661,8 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
static
int
mxs_saif_probe
(
struct
platform_device
*
pdev
)
static
int
mxs_saif_probe
(
struct
platform_device
*
pdev
)
{
{
struct
device_node
*
np
=
pdev
->
dev
.
of_node
;
struct
device_node
*
np
=
pdev
->
dev
.
of_node
;
struct
resource
*
iores
,
*
dmares
;
struct
resource
*
iores
;
struct
mxs_saif
*
saif
;
struct
mxs_saif
*
saif
;
struct
pinctrl
*
pinctrl
;
int
ret
=
0
;
int
ret
=
0
;
struct
device_node
*
master
;
struct
device_node
*
master
;
...
@@ -707,12 +702,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
...
@@ -707,12 +702,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
mxs_saif
[
saif
->
id
]
=
saif
;
mxs_saif
[
saif
->
id
]
=
saif
;
pinctrl
=
devm_pinctrl_get_select_default
(
&
pdev
->
dev
);
if
(
IS_ERR
(
pinctrl
))
{
ret
=
PTR_ERR
(
pinctrl
);
return
ret
;
}
saif
->
clk
=
devm_clk_get
(
&
pdev
->
dev
,
NULL
);
saif
->
clk
=
devm_clk_get
(
&
pdev
->
dev
,
NULL
);
if
(
IS_ERR
(
saif
->
clk
))
{
if
(
IS_ERR
(
saif
->
clk
))
{
ret
=
PTR_ERR
(
saif
->
clk
);
ret
=
PTR_ERR
(
saif
->
clk
);
...
@@ -727,22 +716,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
...
@@ -727,22 +716,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
if
(
IS_ERR
(
saif
->
base
))
if
(
IS_ERR
(
saif
->
base
))
return
PTR_ERR
(
saif
->
base
);
return
PTR_ERR
(
saif
->
base
);
dmares
=
platform_get_resource
(
pdev
,
IORESOURCE_DMA
,
0
);
if
(
!
dmares
)
{
/*
* TODO: This is a temporary solution and should be changed
* to use generic DMA binding later when the helplers get in.
*/
ret
=
of_property_read_u32
(
np
,
"fsl,saif-dma-channel"
,
&
saif
->
dma_param
.
chan_num
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"failed to get dma channel
\n
"
);
return
ret
;
}
}
else
{
saif
->
dma_param
.
chan_num
=
dmares
->
start
;
}
saif
->
irq
=
platform_get_irq
(
pdev
,
0
);
saif
->
irq
=
platform_get_irq
(
pdev
,
0
);
if
(
saif
->
irq
<
0
)
{
if
(
saif
->
irq
<
0
)
{
ret
=
saif
->
irq
;
ret
=
saif
->
irq
;
...
@@ -759,14 +732,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
...
@@ -759,14 +732,6 @@ static int mxs_saif_probe(struct platform_device *pdev)
return
ret
;
return
ret
;
}
}
saif
->
dma_param
.
dma_data
.
chan_irq
=
platform_get_irq
(
pdev
,
1
);
if
(
saif
->
dma_param
.
dma_data
.
chan_irq
<
0
)
{
ret
=
saif
->
dma_param
.
dma_data
.
chan_irq
;
dev_err
(
&
pdev
->
dev
,
"failed to get dma irq resource: %d
\n
"
,
ret
);
return
ret
;
}
platform_set_drvdata
(
pdev
,
saif
);
platform_set_drvdata
(
pdev
,
saif
);
ret
=
snd_soc_register_component
(
&
pdev
->
dev
,
&
mxs_saif_component
,
ret
=
snd_soc_register_component
(
&
pdev
->
dev
,
&
mxs_saif_component
,
...
...
sound/soc/mxs/mxs-saif.h
View file @
c76a507b
...
@@ -117,7 +117,6 @@ struct mxs_saif {
...
@@ -117,7 +117,6 @@ struct mxs_saif {
unsigned
int
mclk_in_use
;
unsigned
int
mclk_in_use
;
void
__iomem
*
base
;
void
__iomem
*
base
;
int
irq
;
int
irq
;
struct
mxs_pcm_dma_params
dma_param
;
unsigned
int
id
;
unsigned
int
id
;
unsigned
int
master_id
;
unsigned
int
master_id
;
unsigned
int
cur_rate
;
unsigned
int
cur_rate
;
...
...
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