diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-10-08 13:40:19 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-10-08 13:40:19 -0400 |
commit | d13586574d373ef40acd4725c9a269daa355e412 (patch) | |
tree | 93e4a7c46fa0c2e1cccea572ef995dbde5c1fd19 /arch/arm/plat-omap | |
parent | cf4c87abe238ec17cd0255b4e21abd949d7f811e (diff) |
OMAP: McBSP: implement functional clock switching via clock framework
Previously the OMAP McBSP ASoC driver implemented CLKS switching by
using omap_ctrl_{read,write}l() directly. This is against policy; the OMAP
System Control Module functions are not intended to be exported to drivers.
These symbols are no longer exported, so as a result, the OMAP McBSP ASoC
driver does not build as a module.
Resolve the CLKS clock changing portion of this problem by creating a
clock parent changing function that lives in
arch/arm/mach-omap2/mcbsp.c, and modify the ASoC driver to use it.
Due to the unfortunate way that McBSP support is implemented in ASoC
and the OMAP tree, this symbol must be exported for use by
sound/soc/omap/omap-mcbsp.c.
Going forward, the McBSP device driver should be moved from
arch/arm/*omap* into drivers/ or sound/soc/* and the CPU DAI driver
should be implemented as a platform_driver as many other ASoC CPU DAI
drivers are. These two steps should resolve many of the layering
problems, which will rapidly reappear during a McBSP hwmod/PM runtime
conversions.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/mcbsp.h | 11 | ||||
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index 886d0e610aa7..4da6f94ae8e8 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h | |||
@@ -320,6 +320,10 @@ | |||
320 | #define FSR_SRC_FSR 0 | 320 | #define FSR_SRC_FSR 0 |
321 | #define FSR_SRC_FSX 1 | 321 | #define FSR_SRC_FSX 1 |
322 | 322 | ||
323 | /* McBSP functional clock sources */ | ||
324 | #define MCBSP_CLKS_PAD_SRC 0 | ||
325 | #define MCBSP_CLKS_PRCM_SRC 1 | ||
326 | |||
323 | /* we don't do multichannel for now */ | 327 | /* we don't do multichannel for now */ |
324 | struct omap_mcbsp_reg_cfg { | 328 | struct omap_mcbsp_reg_cfg { |
325 | u16 spcr2; | 329 | u16 spcr2; |
@@ -406,6 +410,7 @@ struct omap_mcbsp_spi_cfg { | |||
406 | struct omap_mcbsp_ops { | 410 | struct omap_mcbsp_ops { |
407 | void (*request)(unsigned int); | 411 | void (*request)(unsigned int); |
408 | void (*free)(unsigned int); | 412 | void (*free)(unsigned int); |
413 | int (*set_clks_src)(u8, u8); | ||
409 | }; | 414 | }; |
410 | 415 | ||
411 | struct omap_mcbsp_platform_data { | 416 | struct omap_mcbsp_platform_data { |
@@ -472,6 +477,9 @@ struct omap_mcbsp { | |||
472 | extern struct omap_mcbsp **mcbsp_ptr; | 477 | extern struct omap_mcbsp **mcbsp_ptr; |
473 | extern int omap_mcbsp_count, omap_mcbsp_cache_size; | 478 | extern int omap_mcbsp_count, omap_mcbsp_cache_size; |
474 | 479 | ||
480 | #define omap_mcbsp_check_valid_id(id) (id < omap_mcbsp_count) | ||
481 | #define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; | ||
482 | |||
475 | int omap_mcbsp_init(void); | 483 | int omap_mcbsp_init(void); |
476 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | 484 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, |
477 | int size); | 485 | int size); |
@@ -509,6 +517,9 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int leng | |||
509 | int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word); | 517 | int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word); |
510 | int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word); | 518 | int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word); |
511 | 519 | ||
520 | |||
521 | /* McBSP functional clock source changing function */ | ||
522 | extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id); | ||
512 | /* SPI specific API */ | 523 | /* SPI specific API */ |
513 | void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); | 524 | void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); |
514 | 525 | ||
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index 9836fb5dc013..09f8c2871334 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -81,9 +81,6 @@ static int omap_mcbsp_st_read(struct omap_mcbsp *mcbsp, u16 reg) | |||
81 | #define MCBSP_READ_CACHE(mcbsp, reg) \ | 81 | #define MCBSP_READ_CACHE(mcbsp, reg) \ |
82 | omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 1) | 82 | omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 1) |
83 | 83 | ||
84 | #define omap_mcbsp_check_valid_id(id) (id < omap_mcbsp_count) | ||
85 | #define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; | ||
86 | |||
87 | #define MCBSP_ST_READ(mcbsp, reg) \ | 84 | #define MCBSP_ST_READ(mcbsp, reg) \ |
88 | omap_mcbsp_st_read(mcbsp, OMAP_ST_REG_##reg) | 85 | omap_mcbsp_st_read(mcbsp, OMAP_ST_REG_##reg) |
89 | #define MCBSP_ST_WRITE(mcbsp, reg, val) \ | 86 | #define MCBSP_ST_WRITE(mcbsp, reg, val) \ |