Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
b9b5cc26
Commit
b9b5cc26
authored
Aug 07, 2009
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-2.6.31' into for-2.6.32
parents
6a90d536
c12abc01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
25 deletions
+39
-25
arch/arm/plat-omap/include/mach/mcbsp.h
arch/arm/plat-omap/include/mach/mcbsp.h
+2
-2
arch/arm/plat-omap/mcbsp.c
arch/arm/plat-omap/mcbsp.c
+32
-18
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-mcbsp.c
+5
-5
No files found.
arch/arm/plat-omap/include/mach/mcbsp.h
View file @
b9b5cc26
...
@@ -387,8 +387,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
...
@@ -387,8 +387,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
void
omap_mcbsp_config
(
unsigned
int
id
,
const
struct
omap_mcbsp_reg_cfg
*
config
);
void
omap_mcbsp_config
(
unsigned
int
id
,
const
struct
omap_mcbsp_reg_cfg
*
config
);
int
omap_mcbsp_request
(
unsigned
int
id
);
int
omap_mcbsp_request
(
unsigned
int
id
);
void
omap_mcbsp_free
(
unsigned
int
id
);
void
omap_mcbsp_free
(
unsigned
int
id
);
void
omap_mcbsp_start
(
unsigned
int
id
);
void
omap_mcbsp_start
(
unsigned
int
id
,
int
tx
,
int
rx
);
void
omap_mcbsp_stop
(
unsigned
int
id
);
void
omap_mcbsp_stop
(
unsigned
int
id
,
int
tx
,
int
rx
);
void
omap_mcbsp_xmit_word
(
unsigned
int
id
,
u32
word
);
void
omap_mcbsp_xmit_word
(
unsigned
int
id
,
u32
word
);
u32
omap_mcbsp_recv_word
(
unsigned
int
id
);
u32
omap_mcbsp_recv_word
(
unsigned
int
id
);
...
...
arch/arm/plat-omap/mcbsp.c
View file @
b9b5cc26
...
@@ -328,14 +328,15 @@ void omap_mcbsp_free(unsigned int id)
...
@@ -328,14 +328,15 @@ void omap_mcbsp_free(unsigned int id)
EXPORT_SYMBOL
(
omap_mcbsp_free
);
EXPORT_SYMBOL
(
omap_mcbsp_free
);
/*
/*
* Here we start the McBSP, by enabling t
he sample
* Here we start the McBSP, by enabling t
ransmitter, receiver or both.
*
generator, both transmitter and receivers,
*
If no transmitter or receiver is active prior calling, then sample-rate
*
and the frame sync
.
*
generator and frame sync are started
.
*/
*/
void
omap_mcbsp_start
(
unsigned
int
id
)
void
omap_mcbsp_start
(
unsigned
int
id
,
int
tx
,
int
rx
)
{
{
struct
omap_mcbsp
*
mcbsp
;
struct
omap_mcbsp
*
mcbsp
;
void
__iomem
*
io_base
;
void
__iomem
*
io_base
;
int
idle
;
u16
w
;
u16
w
;
if
(
!
omap_mcbsp_check_valid_id
(
id
))
{
if
(
!
omap_mcbsp_check_valid_id
(
id
))
{
...
@@ -348,32 +349,40 @@ void omap_mcbsp_start(unsigned int id)
...
@@ -348,32 +349,40 @@ void omap_mcbsp_start(unsigned int id)
mcbsp
->
rx_word_length
=
(
OMAP_MCBSP_READ
(
io_base
,
RCR1
)
>>
5
)
&
0x7
;
mcbsp
->
rx_word_length
=
(
OMAP_MCBSP_READ
(
io_base
,
RCR1
)
>>
5
)
&
0x7
;
mcbsp
->
tx_word_length
=
(
OMAP_MCBSP_READ
(
io_base
,
XCR1
)
>>
5
)
&
0x7
;
mcbsp
->
tx_word_length
=
(
OMAP_MCBSP_READ
(
io_base
,
XCR1
)
>>
5
)
&
0x7
;
/* Start the sample generator */
idle
=
!
((
OMAP_MCBSP_READ
(
io_base
,
SPCR2
)
|
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_READ
(
io_base
,
SPCR1
))
&
1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
6
));
if
(
idle
)
{
/* Start the sample generator */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
6
));
}
/* Enable transmitter and receiver */
/* Enable transmitter and receiver */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
tx
&
1
)
);
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR1
);
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
|
1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
|
(
rx
&
1
)
);
udelay
(
100
);
udelay
(
100
);
/* Start frame sync */
if
(
idle
)
{
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
/* Start frame sync */
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
7
));
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
|
(
1
<<
7
));
}
/* Dump McBSP Regs */
/* Dump McBSP Regs */
omap_mcbsp_dump_reg
(
id
);
omap_mcbsp_dump_reg
(
id
);
}
}
EXPORT_SYMBOL
(
omap_mcbsp_start
);
EXPORT_SYMBOL
(
omap_mcbsp_start
);
void
omap_mcbsp_stop
(
unsigned
int
id
)
void
omap_mcbsp_stop
(
unsigned
int
id
,
int
tx
,
int
rx
)
{
{
struct
omap_mcbsp
*
mcbsp
;
struct
omap_mcbsp
*
mcbsp
;
void
__iomem
*
io_base
;
void
__iomem
*
io_base
;
int
idle
;
u16
w
;
u16
w
;
if
(
!
omap_mcbsp_check_valid_id
(
id
))
{
if
(
!
omap_mcbsp_check_valid_id
(
id
))
{
...
@@ -386,15 +395,20 @@ void omap_mcbsp_stop(unsigned int id)
...
@@ -386,15 +395,20 @@ void omap_mcbsp_stop(unsigned int id)
/* Reset transmitter */
/* Reset transmitter */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
1
));
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
tx
&
1
));
/* Reset receiver */
/* Reset receiver */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR1
);
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
&
~
(
1
));
OMAP_MCBSP_WRITE
(
io_base
,
SPCR1
,
w
&
~
(
rx
&
1
));
/* Reset the sample rate generator */
idle
=
!
((
OMAP_MCBSP_READ
(
io_base
,
SPCR2
)
|
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_READ
(
io_base
,
SPCR1
))
&
1
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
1
<<
6
));
if
(
idle
)
{
/* Reset the sample rate generator */
w
=
OMAP_MCBSP_READ
(
io_base
,
SPCR2
);
OMAP_MCBSP_WRITE
(
io_base
,
SPCR2
,
w
&
~
(
1
<<
6
));
}
}
}
EXPORT_SYMBOL
(
omap_mcbsp_stop
);
EXPORT_SYMBOL
(
omap_mcbsp_stop
);
...
...
sound/soc/omap/omap-mcbsp.c
View file @
b9b5cc26
...
@@ -183,21 +183,21 @@ static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
...
@@ -183,21 +183,21 @@ static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
dai
->
cpu_dai
;
struct
snd_soc_dai
*
cpu_dai
=
rtd
->
dai
->
cpu_dai
;
struct
omap_mcbsp_data
*
mcbsp_data
=
to_mcbsp
(
cpu_dai
->
private_data
);
struct
omap_mcbsp_data
*
mcbsp_data
=
to_mcbsp
(
cpu_dai
->
private_data
);
int
err
=
0
;
int
err
=
0
,
play
=
(
substream
->
stream
==
SNDRV_PCM_STREAM_PLAYBACK
)
;
switch
(
cmd
)
{
switch
(
cmd
)
{
case
SNDRV_PCM_TRIGGER_START
:
case
SNDRV_PCM_TRIGGER_START
:
case
SNDRV_PCM_TRIGGER_RESUME
:
case
SNDRV_PCM_TRIGGER_RESUME
:
case
SNDRV_PCM_TRIGGER_PAUSE_RELEASE
:
case
SNDRV_PCM_TRIGGER_PAUSE_RELEASE
:
if
(
!
mcbsp_data
->
active
++
)
mcbsp_data
->
active
++
;
omap_mcbsp_start
(
mcbsp_data
->
bus_id
);
omap_mcbsp_start
(
mcbsp_data
->
bus_id
,
play
,
!
play
);
break
;
break
;
case
SNDRV_PCM_TRIGGER_STOP
:
case
SNDRV_PCM_TRIGGER_STOP
:
case
SNDRV_PCM_TRIGGER_SUSPEND
:
case
SNDRV_PCM_TRIGGER_SUSPEND
:
case
SNDRV_PCM_TRIGGER_PAUSE_PUSH
:
case
SNDRV_PCM_TRIGGER_PAUSE_PUSH
:
if
(
!--
mcbsp_data
->
active
)
omap_mcbsp_stop
(
mcbsp_data
->
bus_id
,
play
,
!
play
);
omap_mcbsp_stop
(
mcbsp_data
->
bus_id
)
;
mcbsp_data
->
active
--
;
break
;
break
;
default:
default:
err
=
-
EINVAL
;
err
=
-
EINVAL
;
...
...
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