diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 3 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mcbsp.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 43 |
3 files changed, 15 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 43b9ccffba9e..de3457d750ff 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -141,6 +141,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) | |||
141 | pdata->buffer_size = 0x80; | 141 | pdata->buffer_size = 0x80; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (oh->class->rev >= MCBSP_CONFIG_TYPE3) | ||
145 | pdata->has_wakeup = true; | ||
146 | |||
144 | oh_device[0] = oh; | 147 | oh_device[0] = oh; |
145 | 148 | ||
146 | if (oh->dev_attr) { | 149 | if (oh->dev_attr) { |
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index 14bc1cbe43d9..ac48d836ab38 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h | |||
@@ -317,6 +317,9 @@ struct omap_mcbsp_platform_data { | |||
317 | u16 buffer_size; | 317 | u16 buffer_size; |
318 | u8 reg_size; | 318 | u8 reg_size; |
319 | u8 reg_step; | 319 | u8 reg_step; |
320 | |||
321 | /* McBSP platform and instance specific features */ | ||
322 | bool has_wakeup; /* Wakeup capability */ | ||
320 | }; | 323 | }; |
321 | 324 | ||
322 | struct omap_mcbsp_st_data { | 325 | struct omap_mcbsp_st_data { |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index 623f2c1e9d4a..0338ad07eb71 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -659,35 +659,7 @@ int omap_mcbsp_get_dma_op_mode(unsigned int id) | |||
659 | } | 659 | } |
660 | EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode); | 660 | EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode); |
661 | 661 | ||
662 | static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) | ||
663 | { | ||
664 | /* | ||
665 | * Enable wakup behavior, smart idle and all wakeups | ||
666 | * REVISIT: some wakeups may be unnecessary | ||
667 | */ | ||
668 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | ||
669 | MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN); | ||
670 | } | ||
671 | } | ||
672 | |||
673 | static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) | ||
674 | { | ||
675 | /* | ||
676 | * Disable wakup behavior, smart idle and all wakeups | ||
677 | */ | ||
678 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | ||
679 | /* | ||
680 | * HW bug workaround - If no_idle mode is taken, we need to | ||
681 | * go to smart_idle before going to always_idle, or the | ||
682 | * device will not hit retention anymore. | ||
683 | */ | ||
684 | |||
685 | MCBSP_WRITE(mcbsp, WAKEUPEN, 0); | ||
686 | } | ||
687 | } | ||
688 | #else | 662 | #else |
689 | static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) {} | ||
690 | static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) {} | ||
691 | static inline void omap_st_start(struct omap_mcbsp *mcbsp) {} | 663 | static inline void omap_st_start(struct omap_mcbsp *mcbsp) {} |
692 | static inline void omap_st_stop(struct omap_mcbsp *mcbsp) {} | 664 | static inline void omap_st_stop(struct omap_mcbsp *mcbsp) {} |
693 | #endif | 665 | #endif |
@@ -726,8 +698,9 @@ int omap_mcbsp_request(unsigned int id) | |||
726 | 698 | ||
727 | pm_runtime_get_sync(mcbsp->dev); | 699 | pm_runtime_get_sync(mcbsp->dev); |
728 | 700 | ||
729 | /* Do procedure specific to omap34xx arch, if applicable */ | 701 | /* Enable wakeup behavior */ |
730 | omap34xx_mcbsp_request(mcbsp); | 702 | if (mcbsp->pdata->has_wakeup) |
703 | MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN); | ||
731 | 704 | ||
732 | /* | 705 | /* |
733 | * Make sure that transmitter, receiver and sample-rate generator are | 706 | * Make sure that transmitter, receiver and sample-rate generator are |
@@ -764,8 +737,9 @@ err_clk_disable: | |||
764 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) | 737 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) |
765 | mcbsp->pdata->ops->free(id); | 738 | mcbsp->pdata->ops->free(id); |
766 | 739 | ||
767 | /* Do procedure specific to omap34xx arch, if applicable */ | 740 | /* Disable wakeup behavior */ |
768 | omap34xx_mcbsp_free(mcbsp); | 741 | if (mcbsp->pdata->has_wakeup) |
742 | MCBSP_WRITE(mcbsp, WAKEUPEN, 0); | ||
769 | 743 | ||
770 | pm_runtime_put_sync(mcbsp->dev); | 744 | pm_runtime_put_sync(mcbsp->dev); |
771 | 745 | ||
@@ -794,8 +768,9 @@ void omap_mcbsp_free(unsigned int id) | |||
794 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) | 768 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) |
795 | mcbsp->pdata->ops->free(id); | 769 | mcbsp->pdata->ops->free(id); |
796 | 770 | ||
797 | /* Do procedure specific to omap34xx arch, if applicable */ | 771 | /* Disable wakeup behavior */ |
798 | omap34xx_mcbsp_free(mcbsp); | 772 | if (mcbsp->pdata->has_wakeup) |
773 | MCBSP_WRITE(mcbsp, WAKEUPEN, 0); | ||
799 | 774 | ||
800 | pm_runtime_put_sync(mcbsp->dev); | 775 | pm_runtime_put_sync(mcbsp->dev); |
801 | 776 | ||