diff options
author | Tony Lindgren <tony@atomide.com> | 2012-10-15 19:24:23 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-10-15 19:24:23 -0400 |
commit | 27615a97b2dc7e98b925973b78d1cdc3ee288ab0 (patch) | |
tree | 5927469d78c404faff52ffc4c11220c7f480a2d7 | |
parent | a656a06bbf01bca460764a5f9be860d2b29c4863 (diff) |
ARM: OMAP: Trivial driver changes to remove include plat/cpu.h
Drivers should not use cpu_is_omap or cpu_class_is_omap macros,
they should be private to the platform init code. And we'll be
removing plat/cpu.h and only have a private soc.h for the
arch/arm/*omap* code.
This patch is intended as preparation for the core omap changes
and removes the need to include plat/cpu.h from several drivers.
This is needed for the ARM common zImage support.
These changes are OK to do because:
- omap-rng.c does not need plat/cpu.h
- omap-aes.c and omap-sham.c get the proper platform_data
passed to them so they don't need extra checks in the driver
- omap-dma.c and omap-pcm.c can test the arch locally as
omap1 and omap2 cannot be compiled together because of
conflicting compiler flags
Cc: Deepak Saxena <dsaxena@plexity.net>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
[tony@atomide.com: mmc changes folded in to an earlier patch]
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | drivers/char/hw_random/omap-rng.c | 2 | ||||
-rw-r--r-- | drivers/crypto/omap-aes.c | 6 | ||||
-rw-r--r-- | drivers/crypto/omap-sham.c | 8 | ||||
-rw-r--r-- | drivers/dma/omap-dma.c | 9 | ||||
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 9 |
5 files changed, 14 insertions, 20 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index a5effd813abd..45e467dcc8c8 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c | |||
@@ -27,8 +27,6 @@ | |||
27 | 27 | ||
28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
29 | 29 | ||
30 | #include <plat/cpu.h> | ||
31 | |||
32 | #define RNG_OUT_REG 0x00 /* Output register */ | 30 | #define RNG_OUT_REG 0x00 /* Output register */ |
33 | #define RNG_STAT_REG 0x04 /* Status register | 31 | #define RNG_STAT_REG 0x04 /* Status register |
34 | [0] = STAT_BUSY */ | 32 | [0] = STAT_BUSY */ |
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index 093a8af59cbe..db3115d16cde 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <crypto/scatterwalk.h> | 29 | #include <crypto/scatterwalk.h> |
30 | #include <crypto/aes.h> | 30 | #include <crypto/aes.h> |
31 | 31 | ||
32 | #include <plat/cpu.h> | ||
33 | #include <plat/dma.h> | 32 | #include <plat/dma.h> |
34 | 33 | ||
35 | /* OMAP TRM gives bitfields as start:end, where start is the higher bit | 34 | /* OMAP TRM gives bitfields as start:end, where start is the higher bit |
@@ -941,11 +940,6 @@ static int __init omap_aes_mod_init(void) | |||
941 | { | 940 | { |
942 | pr_info("loading %s driver\n", "omap-aes"); | 941 | pr_info("loading %s driver\n", "omap-aes"); |
943 | 942 | ||
944 | if (!cpu_class_is_omap2() || omap_type() != OMAP2_DEVICE_TYPE_SEC) { | ||
945 | pr_err("Unsupported cpu\n"); | ||
946 | return -ENODEV; | ||
947 | } | ||
948 | |||
949 | return platform_driver_register(&omap_aes_driver); | 943 | return platform_driver_register(&omap_aes_driver); |
950 | } | 944 | } |
951 | 945 | ||
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index a3fd6fc504b1..f50387c4ef89 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <crypto/hash.h> | 37 | #include <crypto/hash.h> |
38 | #include <crypto/internal/hash.h> | 38 | #include <crypto/internal/hash.h> |
39 | 39 | ||
40 | #include <plat/cpu.h> | ||
41 | #include <plat/dma.h> | 40 | #include <plat/dma.h> |
42 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
43 | 42 | ||
@@ -1289,13 +1288,6 @@ static int __init omap_sham_mod_init(void) | |||
1289 | { | 1288 | { |
1290 | pr_info("loading %s driver\n", "omap-sham"); | 1289 | pr_info("loading %s driver\n", "omap-sham"); |
1291 | 1290 | ||
1292 | if (!cpu_class_is_omap2() || | ||
1293 | (omap_type() != OMAP2_DEVICE_TYPE_SEC && | ||
1294 | omap_type() != OMAP2_DEVICE_TYPE_EMU)) { | ||
1295 | pr_err("Unsupported cpu\n"); | ||
1296 | return -ENODEV; | ||
1297 | } | ||
1298 | |||
1299 | return platform_driver_register(&omap_sham_driver); | 1291 | return platform_driver_register(&omap_sham_driver); |
1300 | } | 1292 | } |
1301 | 1293 | ||
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index bb2d8e7029eb..30abe7b36aaa 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
@@ -19,9 +19,14 @@ | |||
19 | 19 | ||
20 | #include "virt-dma.h" | 20 | #include "virt-dma.h" |
21 | 21 | ||
22 | #include <plat/cpu.h> | ||
23 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
24 | 23 | ||
24 | #ifdef CONFIG_ARCH_OMAP2PLUS | ||
25 | #define dma_omap2plus() 1 | ||
26 | #else | ||
27 | #define dma_omap2plus() 0 | ||
28 | #endif | ||
29 | |||
25 | struct omap_dmadev { | 30 | struct omap_dmadev { |
26 | struct dma_device ddev; | 31 | struct dma_device ddev; |
27 | spinlock_t lock; | 32 | spinlock_t lock; |
@@ -438,7 +443,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic( | |||
438 | omap_disable_dma_irq(c->dma_ch, OMAP_DMA_BLOCK_IRQ); | 443 | omap_disable_dma_irq(c->dma_ch, OMAP_DMA_BLOCK_IRQ); |
439 | } | 444 | } |
440 | 445 | ||
441 | if (!cpu_class_is_omap1()) { | 446 | if (dma_omap2plus()) { |
442 | omap_set_dma_src_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16); | 447 | omap_set_dma_src_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16); |
443 | omap_set_dma_dest_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16); | 448 | omap_set_dma_dest_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16); |
444 | } | 449 | } |
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 340874ebf9ae..52977aa30355 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -32,9 +32,14 @@ | |||
32 | #include <sound/dmaengine_pcm.h> | 32 | #include <sound/dmaengine_pcm.h> |
33 | #include <sound/soc.h> | 33 | #include <sound/soc.h> |
34 | 34 | ||
35 | #include <plat/cpu.h> | ||
36 | #include "omap-pcm.h" | 35 | #include "omap-pcm.h" |
37 | 36 | ||
37 | #ifdef CONFIG_ARCH_OMAP1 | ||
38 | #define pcm_omap1510() cpu_is_omap1510() | ||
39 | #else | ||
40 | #define pcm_omap1510() 0 | ||
41 | #endif | ||
42 | |||
38 | static const struct snd_pcm_hardware omap_pcm_hardware = { | 43 | static const struct snd_pcm_hardware omap_pcm_hardware = { |
39 | .info = SNDRV_PCM_INFO_MMAP | | 44 | .info = SNDRV_PCM_INFO_MMAP | |
40 | SNDRV_PCM_INFO_MMAP_VALID | | 45 | SNDRV_PCM_INFO_MMAP_VALID | |
@@ -159,7 +164,7 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream) | |||
159 | { | 164 | { |
160 | snd_pcm_uframes_t offset; | 165 | snd_pcm_uframes_t offset; |
161 | 166 | ||
162 | if (cpu_is_omap1510()) | 167 | if (pcm_omap1510()) |
163 | offset = snd_dmaengine_pcm_pointer_no_residue(substream); | 168 | offset = snd_dmaengine_pcm_pointer_no_residue(substream); |
164 | else | 169 | else |
165 | offset = snd_dmaengine_pcm_pointer(substream); | 170 | offset = snd_dmaengine_pcm_pointer(substream); |