diff options
-rw-r--r-- | arch/arm/plat-omap/include/mach/mcbsp.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 52 |
2 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h index 57249bb1e9bc..b85e6e600ed6 100644 --- a/arch/arm/plat-omap/include/mach/mcbsp.h +++ b/arch/arm/plat-omap/include/mach/mcbsp.h | |||
@@ -389,6 +389,8 @@ int omap_mcbsp_request(unsigned int id); | |||
389 | void omap_mcbsp_free(unsigned int id); | 389 | void omap_mcbsp_free(unsigned int id); |
390 | void omap_mcbsp_start(unsigned int id, int tx, int rx); | 390 | void omap_mcbsp_start(unsigned int id, int tx, int rx); |
391 | void omap_mcbsp_stop(unsigned int id, int tx, int rx); | 391 | void omap_mcbsp_stop(unsigned int id, int tx, int rx); |
392 | void omap_mcbsp_xmit_enable(unsigned int id, u8 enable); | ||
393 | void omap_mcbsp_recv_enable(unsigned int id, u8 enable); | ||
392 | void omap_mcbsp_xmit_word(unsigned int id, u32 word); | 394 | void omap_mcbsp_xmit_word(unsigned int id, u32 word); |
393 | u32 omap_mcbsp_recv_word(unsigned int id); | 395 | u32 omap_mcbsp_recv_word(unsigned int id); |
394 | 396 | ||
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index a3d2313460b3..0aa2524186fb 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -412,6 +412,58 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx) | |||
412 | } | 412 | } |
413 | EXPORT_SYMBOL(omap_mcbsp_stop); | 413 | EXPORT_SYMBOL(omap_mcbsp_stop); |
414 | 414 | ||
415 | void omap_mcbsp_xmit_enable(unsigned int id, u8 enable) | ||
416 | { | ||
417 | struct omap_mcbsp *mcbsp; | ||
418 | void __iomem *io_base; | ||
419 | u16 w; | ||
420 | |||
421 | if (!(cpu_is_omap2430() || cpu_is_omap34xx())) | ||
422 | return; | ||
423 | |||
424 | if (!omap_mcbsp_check_valid_id(id)) { | ||
425 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
426 | return; | ||
427 | } | ||
428 | |||
429 | mcbsp = id_to_mcbsp_ptr(id); | ||
430 | io_base = mcbsp->io_base; | ||
431 | |||
432 | w = OMAP_MCBSP_READ(io_base, XCCR); | ||
433 | |||
434 | if (enable) | ||
435 | OMAP_MCBSP_WRITE(io_base, XCCR, w & ~(XDISABLE)); | ||
436 | else | ||
437 | OMAP_MCBSP_WRITE(io_base, XCCR, w | XDISABLE); | ||
438 | } | ||
439 | EXPORT_SYMBOL(omap_mcbsp_xmit_enable); | ||
440 | |||
441 | void omap_mcbsp_recv_enable(unsigned int id, u8 enable) | ||
442 | { | ||
443 | struct omap_mcbsp *mcbsp; | ||
444 | void __iomem *io_base; | ||
445 | u16 w; | ||
446 | |||
447 | if (!(cpu_is_omap2430() || cpu_is_omap34xx())) | ||
448 | return; | ||
449 | |||
450 | if (!omap_mcbsp_check_valid_id(id)) { | ||
451 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
452 | return; | ||
453 | } | ||
454 | |||
455 | mcbsp = id_to_mcbsp_ptr(id); | ||
456 | io_base = mcbsp->io_base; | ||
457 | |||
458 | w = OMAP_MCBSP_READ(io_base, RCCR); | ||
459 | |||
460 | if (enable) | ||
461 | OMAP_MCBSP_WRITE(io_base, RCCR, w & ~(RDISABLE)); | ||
462 | else | ||
463 | OMAP_MCBSP_WRITE(io_base, RCCR, w | RDISABLE); | ||
464 | } | ||
465 | EXPORT_SYMBOL(omap_mcbsp_recv_enable); | ||
466 | |||
415 | /* polled mcbsp i/o operations */ | 467 | /* polled mcbsp i/o operations */ |
416 | int omap_mcbsp_pollwrite(unsigned int id, u16 buf) | 468 | int omap_mcbsp_pollwrite(unsigned int id, u16 buf) |
417 | { | 469 | { |