Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: omap: dma: make usb support optional

Most of the plat-omap/dma.c code is specific to the USB
driver. Hide that code when it is not in use, to make it
clearer which parts are actually still required.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+27 -25
+22 -23
arch/arm/plat-omap/dma.c
··· 66 66 67 67 static struct omap_system_dma_plat_info *p; 68 68 static struct omap_dma_dev_attr *d; 69 - static void omap_clear_dma(int lch); 70 69 static int enable_1510_mode; 71 70 static u32 errata; 72 71 ··· 89 90 static DEFINE_SPINLOCK(dma_chan_lock); 90 91 static struct omap_dma_lch *dma_chan; 91 92 92 - static inline void disable_lnk(int lch); 93 - static void omap_disable_channel_irq(int lch); 94 - static inline void omap_enable_channel_irq(int lch); 95 - 96 - #ifdef CONFIG_ARCH_OMAP15XX 97 - /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ 98 - static int omap_dma_in_1510_mode(void) 93 + static inline void omap_disable_channel_irq(int lch) 99 94 { 100 - return enable_1510_mode; 95 + /* disable channel interrupts */ 96 + p->dma_write(0, CICR, lch); 97 + /* Clear CSR */ 98 + if (dma_omap1()) 99 + p->dma_read(CSR, lch); 100 + else 101 + p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); 101 102 } 102 - #else 103 - #define omap_dma_in_1510_mode() 0 104 - #endif 105 103 106 104 #ifdef CONFIG_ARCH_OMAP1 107 105 static inline void set_gdma_dev(int req, int dev) ··· 164 168 } 165 169 #endif 166 170 EXPORT_SYMBOL(omap_set_dma_priority); 171 + 172 + #if IS_ENABLED(CONFIG_USB_OMAP) 173 + #ifdef CONFIG_ARCH_OMAP15XX 174 + /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ 175 + static int omap_dma_in_1510_mode(void) 176 + { 177 + return enable_1510_mode; 178 + } 179 + #else 180 + #define omap_dma_in_1510_mode() 0 181 + #endif 167 182 168 183 void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, 169 184 int frame_count, int sync_mode, ··· 425 418 p->dma_write(dma_chan[lch].enabled_irqs, CICR, lch); 426 419 } 427 420 428 - static inline void omap_disable_channel_irq(int lch) 429 - { 430 - /* disable channel interrupts */ 431 - p->dma_write(0, CICR, lch); 432 - /* Clear CSR */ 433 - if (dma_omap1()) 434 - p->dma_read(CSR, lch); 435 - else 436 - p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); 437 - } 438 - 439 421 void omap_disable_dma_irq(int lch, u16 bits) 440 422 { 441 423 dma_chan[lch].enabled_irqs &= ~bits; ··· 469 473 p->dma_write(l, CLNK_CTRL, lch); 470 474 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE; 471 475 } 476 + #endif 472 477 473 478 int omap_request_dma(int dev_id, const char *dev_name, 474 479 void (*callback)(int lch, u16 ch_status, void *data), ··· 569 572 local_irq_restore(flags); 570 573 } 571 574 575 + #if IS_ENABLED(CONFIG_USB_OMAP) 572 576 void omap_start_dma(int lch) 573 577 { 574 578 u32 l; ··· 790 792 return (p->dma_read(CCR, lch) & OMAP_DMA_CCR_EN) != 0; 791 793 } 792 794 EXPORT_SYMBOL(omap_get_dma_active_status); 795 + #endif 793 796 794 797 int omap_dma_running(void) 795 798 {
+1 -1
drivers/usb/gadget/udc/Kconfig
··· 128 128 129 129 config USB_OMAP 130 130 tristate "OMAP USB Device Controller" 131 - depends on ARCH_OMAP1 || (ARCH_OMAP && COMPILE_TEST) 131 + depends on ARCH_OMAP1 132 132 depends on ISP1301_OMAP || !(MACH_OMAP_H2 || MACH_OMAP_H3) 133 133 help 134 134 Many Texas Instruments OMAP processors have flexible full
+4 -1
include/linux/omap-dma.h
··· 299 299 extern int omap_request_dma(int dev_id, const char *dev_name, 300 300 void (*callback)(int lch, u16 ch_status, void *data), 301 301 void *data, int *dma_ch); 302 - extern void omap_disable_dma_irq(int ch, u16 irq_bits); 303 302 extern void omap_free_dma(int ch); 303 + #if IS_ENABLED(CONFIG_USB_OMAP) 304 + extern void omap_disable_dma_irq(int ch, u16 irq_bits); 304 305 extern void omap_start_dma(int lch); 305 306 extern void omap_stop_dma(int lch); 306 307 extern void omap_set_dma_transfer_params(int lch, int data_type, ··· 327 326 extern dma_addr_t omap_get_dma_src_pos(int lch); 328 327 extern dma_addr_t omap_get_dma_dst_pos(int lch); 329 328 extern int omap_get_dma_active_status(int lch); 329 + #endif 330 + 330 331 extern int omap_dma_running(void); 331 332 332 333 #if IS_ENABLED(CONFIG_FB_OMAP)