Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf2920aa authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Tony Lindgren
Browse files

ARM: OMAP1: Remove duplicated DMA channel definitions



Similarly than with OMAP2 there are many DMA channel definitions that have
been moved or redefined in drivers using them and we can remove them from
dma.h.

There is exception with MMC that arch/arm/mach-omap1/devices.c is using
MMC DMA channel definitions for setting platform data but those can be well
replaced with numeric values.

Remove dma.h include from arch/arm/mach-omap1/devices.c and use a script
below for dropping duplicated definitions and for replacing definitions
with DMA channel numbers.

grep '#define OMAP_DMA' arch/arm/mach-omap1/dma.h | while read -r i; do \
		DDEF=`echo $i |cut -d ' ' -f 1-2`; \
		DEF=`echo $DDEF |cut -d ' ' -f 2`; \
		CH=`echo $i |cut -d ' ' -f 3`; \
		if [ `git grep -c "$DDEF" |wc -l` -gt 1 ]; then \
			echo "removing" $DEF; \
			sed -i "s/${DEF}/${CH}/" arch/arm/mach-omap1/devices.c; \
			sed -i "/${DDEF}/d" arch/arm/mach-omap1/dma.h; \
		fi; \
	done

Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent c821c462
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@


#include "common.h"
#include "common.h"
#include "clock.h"
#include "clock.h"
#include "dma.h"
#include "mmc.h"
#include "mmc.h"
#include "sram.h"
#include "sram.h"


@@ -223,16 +222,16 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
		case 0:
		case 0:
			base = OMAP1_MMC1_BASE;
			base = OMAP1_MMC1_BASE;
			irq = INT_MMC;
			irq = INT_MMC;
			rx_req = OMAP_DMA_MMC_RX;
			rx_req = 22;
			tx_req = OMAP_DMA_MMC_TX;
			tx_req = 21;
			break;
			break;
		case 1:
		case 1:
			if (!cpu_is_omap16xx())
			if (!cpu_is_omap16xx())
				return;
				return;
			base = OMAP1_MMC2_BASE;
			base = OMAP1_MMC2_BASE;
			irq = INT_1610_MMC2;
			irq = INT_1610_MMC2;
			rx_req = OMAP_DMA_MMC2_RX;
			rx_req = 55;
			tx_req = OMAP_DMA_MMC2_TX;
			tx_req = 54;
			break;
			break;
		default:
		default:
			continue;
			continue;
+0 −8
Original line number Original line Diff line number Diff line
@@ -20,17 +20,9 @@
#define __OMAP1_DMA_CHANNEL_H
#define __OMAP1_DMA_CHANNEL_H


/* DMA channels for omap1 */
/* DMA channels for omap1 */
#define OMAP_DMA_NO_DEVICE		0
#define OMAP_DMA_UART3_TX		18
#define OMAP_DMA_UART3_TX		18
#define OMAP_DMA_UART3_RX		19
#define OMAP_DMA_UART3_RX		19
#define OMAP_DMA_CAMERA_IF_RX		20
#define OMAP_DMA_MMC_TX			21
#define OMAP_DMA_MMC_RX			22
#define OMAP_DMA_USB_W2FC_RX0		26
#define OMAP_DMA_USB_W2FC_TX0		29


/* These are only for 1610 */
/* These are only for 1610 */
#define OMAP_DMA_MMC2_TX		54
#define OMAP_DMA_MMC2_RX		55


#endif /* __OMAP1_DMA_CHANNEL_H */
#endif /* __OMAP1_DMA_CHANNEL_H */