History

ARM: OMAP2+: Drop unused sdma functions

We still have lots of legacy code for sdma, but some of it is now unused. To simplify phasing out the old legacy sdma code, let's first remove all currently unused functions: omap_enable_dma_irq omap_set_dma_write_mode omap_set_dma_params omap_dma_link_lch omap_set_dma_callback omap_dma_set_global_params And with this, omap_dma_set_global_params now becomes static.

Tony Lindgren committed 6 years ago

Commit 28b5afc1 parent bfab07e2 files · +1 −160Browse files

Unified · Split

2 files
  1. arch/arm/plat-omap/dma.c +1 −148
  2. include/linux/omap-dma.h +0 −12
arch/arm/plat-omap/dma.c+1−148
@@ -65,8 +65,6 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED }; · 64 unmodified lines
6565 static struct omap_system_dma_plat_info *p;
6666 static struct omap_dma_dev_attr *d;
6767 static void omap_clear_dma(int lch);
68−static int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
69− unsigned char write_prio);
7068 static int enable_1510_mode;
7169 static u32 errata;
7270
@@ -95,20 +93,6 @@ static struct dma_link_info *dma_linked_lch; · 22 unmodified lines
9593 #ifndef CONFIG_ARCH_OMAP1
9694
9795 /* Chain handling macros */
98−#define OMAP_DMA_CHAIN_QINIT(chain_id) \
99− do { \
100− dma_linked_lch[chain_id].q_head = \
101− dma_linked_lch[chain_id].q_tail = \
102− dma_linked_lch[chain_id].q_count = 0; \
103− } while (0)
104−#define OMAP_DMA_CHAIN_QFULL(chain_id) \
105− (dma_linked_lch[chain_id].no_of_lchs_linked == \
106− dma_linked_lch[chain_id].q_count)
107−#define OMAP_DMA_CHAIN_QLAST(chain_id) \
108− do { \
109− ((dma_linked_lch[chain_id].no_of_lchs_linked-1) == \
110− dma_linked_lch[chain_id].q_count) \
111− } while (0)
11296 #define OMAP_DMA_CHAIN_QEMPTY(chain_id) \
11397 (0 == dma_linked_lch[chain_id].q_count)
11498 #define __OMAP_DMA_CHAIN_INCQ(end) \
@@ -118,12 +102,6 @@ static struct dma_link_info *dma_linked_lch; · 3 unmodified lines
118102 __OMAP_DMA_CHAIN_INCQ(dma_linked_lch[chain_id].q_head); \
119103 dma_linked_lch[chain_id].q_count--; \
120104 } while (0)
121−
122−#define OMAP_DMA_CHAIN_INCQTAIL(chain_id) \
123− do { \
124− __OMAP_DMA_CHAIN_INCQ(dma_linked_lch[chain_id].q_tail); \
125− dma_linked_lch[chain_id].q_count++; \
126− } while (0)
127105 #endif
128106
129107 static int dma_lch_count;
@@ -137,9 +115,6 @@ static inline void disable_lnk(int lch); · 7 unmodified lines
137115 static void omap_disable_channel_irq(int lch);
138116 static inline void omap_enable_channel_irq(int lch);
139117
140−#define REVISIT_24XX() printk(KERN_ERR "FIXME: no %s on 24xx\n", \
141− __func__);
142−
143118 #ifdef CONFIG_ARCH_OMAP15XX
144119 /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
145120 static int omap_dma_in_1510_mode(void)
@@ -278,19 +253,6 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, · 132 unmodified lines
278253 }
279254 EXPORT_SYMBOL(omap_set_dma_transfer_params);
280255
281−void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode)
282−{
283− if (dma_omap2plus()) {
284− u32 csdp;
285−
286− csdp = p->dma_read(CSDP, lch);
287− csdp &= ~(0x3 << 16);
288− csdp |= (mode << 16);
289− p->dma_write(csdp, CSDP, lch);
290− }
291−}
292−EXPORT_SYMBOL(omap_set_dma_write_mode);
293−
294256 void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode)
295257 {
296258 if (dma_omap1() && !dma_omap15xx()) {
@@ -332,25 +294,6 @@ void omap_set_dma_src_params(int lch, int src_port, int src_amode, · 35 unmodified lines
332294 }
333295 EXPORT_SYMBOL(omap_set_dma_src_params);
334296
335−void omap_set_dma_params(int lch, struct omap_dma_channel_params *params)
336−{
337− omap_set_dma_transfer_params(lch, params->data_type,
338− params->elem_count, params->frame_count,
339− params->sync_mode, params->trigger,
340− params->src_or_dst_synch);
341− omap_set_dma_src_params(lch, params->src_port,
342− params->src_amode, params->src_start,
343− params->src_ei, params->src_fi);
344−
345− omap_set_dma_dest_params(lch, params->dst_port,
346− params->dst_amode, params->dst_start,
347− params->dst_ei, params->dst_fi);
348− if (params->read_prio || params->write_prio)
349− omap_dma_set_prio_lch(lch, params->read_prio,
350− params->write_prio);
351−}
352−EXPORT_SYMBOL(omap_set_dma_params);
353−
354297 void omap_set_dma_src_data_pack(int lch, int enable)
355298 {
356299 u32 l;
@@ -507,12 +450,6 @@ static inline void omap_disable_channel_irq(int lch) · 150 unmodified lines
507450 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
508451 }
509452
510−void omap_enable_dma_irq(int lch, u16 bits)
511−{
512− dma_chan[lch].enabled_irqs |= bits;
513−}
514−EXPORT_SYMBOL(omap_enable_dma_irq);
515−
516453 void omap_disable_dma_irq(int lch, u16 bits)
517454 {
518455 dma_chan[lch].enabled_irqs &= ~bits;
@@ -721,7 +658,7 @@ EXPORT_SYMBOL(omap_free_dma); · 202 unmodified lines
721658 * DMA_THREAD_RESERVE_TWOT
722659 * DMA_THREAD_RESERVE_THREET
723660 */
724−void
661+static void
725662 omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams)
726663 {
727664 u32 reg;
@@ -742,39 +679,6 @@ omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams) · 14 unmodified lines
742679
743680 p->dma_write(reg, GCR, 0);
744681 }
745−EXPORT_SYMBOL(omap_dma_set_global_params);
746−
747−/**
748− * @brief omap_dma_set_prio_lch : Set channel wise priority settings
749− *
750− * @param lch
751− * @param read_prio - Read priority
752− * @param write_prio - Write priority
753− * Both of the above can be set with one of the following values :
754− * DMA_CH_PRIO_HIGH/DMA_CH_PRIO_LOW
755− */
756−static int
757−omap_dma_set_prio_lch(int lch, unsigned char read_prio,
758− unsigned char write_prio)
759−{
760− u32 l;
761−
762− if (unlikely((lch < 0 || lch >= dma_lch_count))) {
763− printk(KERN_ERR "Invalid channel id\n");
764− return -EINVAL;
765− }
766− l = p->dma_read(CCR, lch);
767− l &= ~((1 << 6) | (1 << 26));
768− if (d->dev_caps & IS_RW_PRIORITY)
769− l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
770− else
771− l |= ((read_prio & 0x1) << 6);
772−
773− p->dma_write(l, CCR, lch);
774−
775− return 0;
776−}
777−
778682
779683 /*
780684 * Clears any DMA state so the DMA engine is ready to restart with new buffers
@@ -926,29 +830,6 @@ EXPORT_SYMBOL(omap_stop_dma); · 145 unmodified lines
926830 * Allows changing the DMA callback function or data. This may be needed if
927831 * the driver shares a single DMA channel for multiple dma triggers.
928832 */
929−int omap_set_dma_callback(int lch,
930− void (*callback)(int lch, u16 ch_status, void *data),
931− void *data)
932−{
933− unsigned long flags;
934−
935− if (lch < 0)
936− return -ENODEV;
937−
938− spin_lock_irqsave(&dma_chan_lock, flags);
939− if (dma_chan[lch].dev_id == -1) {
940− printk(KERN_ERR "DMA callback for not set for free channel\n");
941− spin_unlock_irqrestore(&dma_chan_lock, flags);
942− return -EINVAL;
943− }
944− dma_chan[lch].callback = callback;
945− dma_chan[lch].data = data;
946− spin_unlock_irqrestore(&dma_chan_lock, flags);
947−
948− return 0;
949−}
950−EXPORT_SYMBOL(omap_set_dma_callback);
951−
952833 /*
953834 * Returns current physical source address for the given DMA channel.
954835 * If the channel is running the caller must disable interrupts prior calling
@@ -1048,34 +929,6 @@ int omap_dma_running(void) · 93 unmodified lines
1048929 return 0;
1049930 }
1050931
1051−/*
1052− * lch_queue DMA will start right after lch_head one is finished.
1053− * For this DMA link to start, you still need to start (see omap_start_dma)
1054− * the first one. That will fire up the entire queue.
1055− */
1056−void omap_dma_link_lch(int lch_head, int lch_queue)
1057−{
1058− if (omap_dma_in_1510_mode()) {
1059− if (lch_head == lch_queue) {
1060− p->dma_write(p->dma_read(CCR, lch_head) | (3 << 8),
1061− CCR, lch_head);
1062− return;
1063− }
1064− printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
1065− BUG();
1066− return;
1067− }
1068−
1069− if ((dma_chan[lch_head].dev_id == -1) ||
1070− (dma_chan[lch_queue].dev_id == -1)) {
1071− pr_err("omap_dma: trying to link non requested channels\n");
1072− dump_stack();
1073− }
1074−
1075− dma_chan[lch_head].next_lch = lch_queue;
1076−}
1077−EXPORT_SYMBOL(omap_dma_link_lch);
1078−
1079932 /*----------------------------------------------------------------------------*/
1080933
1081934 #ifdef CONFIG_ARCH_OMAP1
include/linux/omap-dma.h+0−12
@@ -303,7 +303,6 @@ extern void omap_set_dma_priority(int lch, int dst_port, int priority); · 302 unmodified lines
303303 extern int omap_request_dma(int dev_id, const char *dev_name,
304304 void (*callback)(int lch, u16 ch_status, void *data),
305305 void *data, int *dma_ch);
306−extern void omap_enable_dma_irq(int ch, u16 irq_bits);
307306 extern void omap_disable_dma_irq(int ch, u16 irq_bits);
308307 extern void omap_free_dma(int ch);
309308 extern void omap_start_dma(int lch);
@@ -312,7 +311,6 @@ extern void omap_set_dma_transfer_params(int lch, int data_type, · 2 unmodified lines
312311 int elem_count, int frame_count,
313312 int sync_mode,
314313 int dma_trigger, int src_or_dst_synch);
315−extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
316314 extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
317315
318316 extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
@@ -329,20 +327,10 @@ extern void omap_set_dma_dest_data_pack(int lch, int enable); · 10 unmodified lines
329327 extern void omap_set_dma_dest_burst_mode(int lch,
330328 enum omap_dma_burst_mode burst_mode);
331329
332−extern void omap_set_dma_params(int lch,
333− struct omap_dma_channel_params *params);
334−
335−extern void omap_dma_link_lch(int lch_head, int lch_queue);
336−
337−extern int omap_set_dma_callback(int lch,
338− void (*callback)(int lch, u16 ch_status, void *data),
339− void *data);
340330 extern dma_addr_t omap_get_dma_src_pos(int lch);
341331 extern dma_addr_t omap_get_dma_dst_pos(int lch);
342332 extern int omap_get_dma_active_status(int lch);
343333 extern int omap_dma_running(void);
344−extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
345− int tparams);
346334 void omap_dma_global_context_save(void);
347335 void omap_dma_global_context_restore(void);
348336