diff options
Diffstat (limited to 'arch/arm/plat-omap/include/mach/mcbsp.h')
-rw-r--r-- | arch/arm/plat-omap/include/mach/mcbsp.h | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h index bb154ea76769..e0d6eca222cc 100644 --- a/arch/arm/plat-omap/include/mach/mcbsp.h +++ b/arch/arm/plat-omap/include/mach/mcbsp.h | |||
@@ -53,6 +53,11 @@ | |||
53 | #define OMAP34XX_MCBSP4_BASE 0x49026000 | 53 | #define OMAP34XX_MCBSP4_BASE 0x49026000 |
54 | #define OMAP34XX_MCBSP5_BASE 0x48096000 | 54 | #define OMAP34XX_MCBSP5_BASE 0x48096000 |
55 | 55 | ||
56 | #define OMAP44XX_MCBSP1_BASE 0x49022000 | ||
57 | #define OMAP44XX_MCBSP2_BASE 0x49024000 | ||
58 | #define OMAP44XX_MCBSP3_BASE 0x49026000 | ||
59 | #define OMAP44XX_MCBSP4_BASE 0x48074000 | ||
60 | |||
56 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) | 61 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) |
57 | 62 | ||
58 | #define OMAP_MCBSP_REG_DRR2 0x00 | 63 | #define OMAP_MCBSP_REG_DRR2 0x00 |
@@ -98,7 +103,8 @@ | |||
98 | #define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX | 103 | #define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX |
99 | #define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX | 104 | #define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX |
100 | 105 | ||
101 | #elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 106 | #elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ |
107 | defined(CONFIG_ARCH_OMAP4) | ||
102 | 108 | ||
103 | #define OMAP_MCBSP_REG_DRR2 0x00 | 109 | #define OMAP_MCBSP_REG_DRR2 0x00 |
104 | #define OMAP_MCBSP_REG_DRR1 0x04 | 110 | #define OMAP_MCBSP_REG_DRR1 0x04 |
@@ -134,6 +140,11 @@ | |||
134 | #define OMAP_MCBSP_REG_XCERG 0x74 | 140 | #define OMAP_MCBSP_REG_XCERG 0x74 |
135 | #define OMAP_MCBSP_REG_XCERH 0x78 | 141 | #define OMAP_MCBSP_REG_XCERH 0x78 |
136 | #define OMAP_MCBSP_REG_SYSCON 0x8C | 142 | #define OMAP_MCBSP_REG_SYSCON 0x8C |
143 | #define OMAP_MCBSP_REG_THRSH2 0x90 | ||
144 | #define OMAP_MCBSP_REG_THRSH1 0x94 | ||
145 | #define OMAP_MCBSP_REG_IRQST 0xA0 | ||
146 | #define OMAP_MCBSP_REG_IRQEN 0xA4 | ||
147 | #define OMAP_MCBSP_REG_WAKEUPEN 0xA8 | ||
137 | #define OMAP_MCBSP_REG_XCCR 0xAC | 148 | #define OMAP_MCBSP_REG_XCCR 0xAC |
138 | #define OMAP_MCBSP_REG_RCCR 0xB0 | 149 | #define OMAP_MCBSP_REG_RCCR 0xB0 |
139 | 150 | ||
@@ -249,8 +260,27 @@ | |||
249 | #define RDISABLE 0x0001 | 260 | #define RDISABLE 0x0001 |
250 | 261 | ||
251 | /********************** McBSP SYSCONFIG bit definitions ********************/ | 262 | /********************** McBSP SYSCONFIG bit definitions ********************/ |
263 | #define CLOCKACTIVITY(value) ((value)<<8) | ||
264 | #define SIDLEMODE(value) ((value)<<3) | ||
265 | #define ENAWAKEUP 0x0004 | ||
252 | #define SOFTRST 0x0002 | 266 | #define SOFTRST 0x0002 |
253 | 267 | ||
268 | /********************** McBSP DMA operating modes **************************/ | ||
269 | #define MCBSP_DMA_MODE_ELEMENT 0 | ||
270 | #define MCBSP_DMA_MODE_THRESHOLD 1 | ||
271 | #define MCBSP_DMA_MODE_FRAME 2 | ||
272 | |||
273 | /********************** McBSP WAKEUPEN bit definitions *********************/ | ||
274 | #define XEMPTYEOFEN 0x4000 | ||
275 | #define XRDYEN 0x0400 | ||
276 | #define XEOFEN 0x0200 | ||
277 | #define XFSXEN 0x0100 | ||
278 | #define XSYNCERREN 0x0080 | ||
279 | #define RRDYEN 0x0008 | ||
280 | #define REOFEN 0x0004 | ||
281 | #define RFSREN 0x0002 | ||
282 | #define RSYNCERREN 0x0001 | ||
283 | |||
254 | /* we don't do multichannel for now */ | 284 | /* we don't do multichannel for now */ |
255 | struct omap_mcbsp_reg_cfg { | 285 | struct omap_mcbsp_reg_cfg { |
256 | u16 spcr2; | 286 | u16 spcr2; |
@@ -344,6 +374,9 @@ struct omap_mcbsp_platform_data { | |||
344 | u8 dma_rx_sync, dma_tx_sync; | 374 | u8 dma_rx_sync, dma_tx_sync; |
345 | u16 rx_irq, tx_irq; | 375 | u16 rx_irq, tx_irq; |
346 | struct omap_mcbsp_ops *ops; | 376 | struct omap_mcbsp_ops *ops; |
377 | #ifdef CONFIG_ARCH_OMAP34XX | ||
378 | u16 buffer_size; | ||
379 | #endif | ||
347 | }; | 380 | }; |
348 | 381 | ||
349 | struct omap_mcbsp { | 382 | struct omap_mcbsp { |
@@ -377,6 +410,11 @@ struct omap_mcbsp { | |||
377 | struct omap_mcbsp_platform_data *pdata; | 410 | struct omap_mcbsp_platform_data *pdata; |
378 | struct clk *iclk; | 411 | struct clk *iclk; |
379 | struct clk *fclk; | 412 | struct clk *fclk; |
413 | #ifdef CONFIG_ARCH_OMAP34XX | ||
414 | int dma_op_mode; | ||
415 | u16 max_tx_thres; | ||
416 | u16 max_rx_thres; | ||
417 | #endif | ||
380 | }; | 418 | }; |
381 | extern struct omap_mcbsp **mcbsp_ptr; | 419 | extern struct omap_mcbsp **mcbsp_ptr; |
382 | extern int omap_mcbsp_count; | 420 | extern int omap_mcbsp_count; |
@@ -385,10 +423,25 @@ int omap_mcbsp_init(void); | |||
385 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | 423 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, |
386 | int size); | 424 | int size); |
387 | void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); | 425 | void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); |
426 | #ifdef CONFIG_ARCH_OMAP34XX | ||
427 | void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold); | ||
428 | void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold); | ||
429 | u16 omap_mcbsp_get_max_tx_threshold(unsigned int id); | ||
430 | u16 omap_mcbsp_get_max_rx_threshold(unsigned int id); | ||
431 | int omap_mcbsp_get_dma_op_mode(unsigned int id); | ||
432 | #else | ||
433 | static inline void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold) | ||
434 | { } | ||
435 | static inline void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold) | ||
436 | { } | ||
437 | static inline u16 omap_mcbsp_get_max_tx_threshold(unsigned int id) { return 0; } | ||
438 | static inline u16 omap_mcbsp_get_max_rx_threshold(unsigned int id) { return 0; } | ||
439 | static inline int omap_mcbsp_get_dma_op_mode(unsigned int id) { return 0; } | ||
440 | #endif | ||
388 | int omap_mcbsp_request(unsigned int id); | 441 | int omap_mcbsp_request(unsigned int id); |
389 | void omap_mcbsp_free(unsigned int id); | 442 | void omap_mcbsp_free(unsigned int id); |
390 | void omap_mcbsp_start(unsigned int id); | 443 | void omap_mcbsp_start(unsigned int id, int tx, int rx); |
391 | void omap_mcbsp_stop(unsigned int id); | 444 | void omap_mcbsp_stop(unsigned int id, int tx, int rx); |
392 | void omap_mcbsp_xmit_word(unsigned int id, u32 word); | 445 | void omap_mcbsp_xmit_word(unsigned int id, u32 word); |
393 | u32 omap_mcbsp_recv_word(unsigned int id); | 446 | u32 omap_mcbsp_recv_word(unsigned int id); |
394 | 447 | ||