Commit 752ec2f2 authored by Jorge Eduardo Candelaria's avatar Jorge Eduardo Candelaria Committed by Liam Girdwood

ARM: McBSP: Add support for omap4 in McBSP driver

McBSP module in OMAP4 needs to be able to set its tx/rx threshold
and enable the transmitter/receiver when starting an audio stream.
Signed-off-by: default avatarJorge Eduardo Candelaria <jorge.candelaria@ti.com>
Signed-off-by: default avatarMargarita Olaya Cabrera <magi.olaya@ti.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 9319b9da
...@@ -488,7 +488,7 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold) ...@@ -488,7 +488,7 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)
{ {
struct omap_mcbsp *mcbsp; struct omap_mcbsp *mcbsp;
if (!cpu_is_omap34xx()) if (!cpu_is_omap34xx() && !cpu_is_omap44xx())
return; return;
if (!omap_mcbsp_check_valid_id(id)) { if (!omap_mcbsp_check_valid_id(id)) {
...@@ -510,7 +510,7 @@ void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold) ...@@ -510,7 +510,7 @@ void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
{ {
struct omap_mcbsp *mcbsp; struct omap_mcbsp *mcbsp;
if (!cpu_is_omap34xx()) if (!cpu_is_omap34xx() && !cpu_is_omap44xx())
return; return;
if (!omap_mcbsp_check_valid_id(id)) { if (!omap_mcbsp_check_valid_id(id)) {
...@@ -641,7 +641,7 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) ...@@ -641,7 +641,7 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
* Enable wakup behavior, smart idle and all wakeups * Enable wakup behavior, smart idle and all wakeups
* REVISIT: some wakeups may be unnecessary * REVISIT: some wakeups may be unnecessary
*/ */
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
u16 syscon; u16 syscon;
syscon = MCBSP_READ(mcbsp, SYSCON); syscon = MCBSP_READ(mcbsp, SYSCON);
...@@ -664,7 +664,7 @@ static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) ...@@ -664,7 +664,7 @@ static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp)
/* /*
* Disable wakup behavior, smart idle and all wakeups * Disable wakup behavior, smart idle and all wakeups
*/ */
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
u16 syscon; u16 syscon;
syscon = MCBSP_READ(mcbsp, SYSCON); syscon = MCBSP_READ(mcbsp, SYSCON);
...@@ -913,7 +913,7 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx) ...@@ -913,7 +913,7 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx)
MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7)); MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7));
} }
if (cpu_is_omap2430() || cpu_is_omap34xx()) { if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
/* Release the transmitter and receiver */ /* Release the transmitter and receiver */
w = MCBSP_READ_CACHE(mcbsp, XCCR); w = MCBSP_READ_CACHE(mcbsp, XCCR);
w &= ~(tx ? XDISABLE : 0); w &= ~(tx ? XDISABLE : 0);
...@@ -943,7 +943,7 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx) ...@@ -943,7 +943,7 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx)
/* Reset transmitter */ /* Reset transmitter */
tx &= 1; tx &= 1;
if (cpu_is_omap2430() || cpu_is_omap34xx()) { if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
w = MCBSP_READ_CACHE(mcbsp, XCCR); w = MCBSP_READ_CACHE(mcbsp, XCCR);
w |= (tx ? XDISABLE : 0); w |= (tx ? XDISABLE : 0);
MCBSP_WRITE(mcbsp, XCCR, w); MCBSP_WRITE(mcbsp, XCCR, w);
...@@ -953,7 +953,7 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx) ...@@ -953,7 +953,7 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx)
/* Reset receiver */ /* Reset receiver */
rx &= 1; rx &= 1;
if (cpu_is_omap2430() || cpu_is_omap34xx()) { if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
w = MCBSP_READ_CACHE(mcbsp, RCCR); w = MCBSP_READ_CACHE(mcbsp, RCCR);
w |= (rx ? RDISABLE : 0); w |= (rx ? RDISABLE : 0);
MCBSP_WRITE(mcbsp, RCCR, w); MCBSP_WRITE(mcbsp, RCCR, w);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment