]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
ARM: OMAP: Trivial driver changes to remove include plat/cpu.h
authorTony Lindgren <tony@atomide.com>
Mon, 15 Oct 2012 23:24:23 +0000 (16:24 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 15 Oct 2012 23:24:23 +0000 (16:24 -0700)
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>
drivers/char/hw_random/omap-rng.c
drivers/crypto/omap-aes.c
drivers/crypto/omap-sham.c
drivers/dma/omap-dma.c
sound/soc/omap/omap-pcm.c

index a5effd813abddbcdb6a0603148caa822b7dd36f6..45e467dcc8c886996966a2488c148b68d7f792b2 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <asm/io.h>
 
-#include <plat/cpu.h>
-
 #define RNG_OUT_REG            0x00            /* Output register */
 #define RNG_STAT_REG           0x04            /* Status register
                                                        [0] = STAT_BUSY */
index 093a8af59cbe46711fd0e750552598eb26f04d85..db3115d16cdeb6b739239ff3bf385c996826a5a6 100644 (file)
@@ -29,7 +29,6 @@
 #include <crypto/scatterwalk.h>
 #include <crypto/aes.h>
 
-#include <plat/cpu.h>
 #include <plat/dma.h>
 
 /* 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)
 {
        pr_info("loading %s driver\n", "omap-aes");
 
-       if (!cpu_class_is_omap2() || omap_type() != OMAP2_DEVICE_TYPE_SEC) {
-               pr_err("Unsupported cpu\n");
-               return -ENODEV;
-       }
-
        return  platform_driver_register(&omap_aes_driver);
 }
 
index a3fd6fc504b136d8e44d4435bbeb5c833dd194b1..f50387c4ef892fe88260e63676ccbf2a1d5bc11f 100644 (file)
@@ -37,7 +37,6 @@
 #include <crypto/hash.h>
 #include <crypto/internal/hash.h>
 
-#include <plat/cpu.h>
 #include <plat/dma.h>
 #include <mach/irqs.h>
 
@@ -1289,13 +1288,6 @@ static int __init omap_sham_mod_init(void)
 {
        pr_info("loading %s driver\n", "omap-sham");
 
-       if (!cpu_class_is_omap2() ||
-               (omap_type() != OMAP2_DEVICE_TYPE_SEC &&
-                       omap_type() != OMAP2_DEVICE_TYPE_EMU)) {
-               pr_err("Unsupported cpu\n");
-               return -ENODEV;
-       }
-
        return platform_driver_register(&omap_sham_driver);
 }
 
index bb2d8e7029eb638c8d18f9ed3a9db01d795aef2c..30abe7b36aaa75e758370f36bfdc8d97100a23d0 100644 (file)
 
 #include "virt-dma.h"
 
-#include <plat/cpu.h>
 #include <plat/dma.h>
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#define dma_omap2plus()        1
+#else
+#define dma_omap2plus()        0
+#endif
+
 struct omap_dmadev {
        struct dma_device ddev;
        spinlock_t lock;
@@ -438,7 +443,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
                omap_disable_dma_irq(c->dma_ch, OMAP_DMA_BLOCK_IRQ);
        }
 
-       if (!cpu_class_is_omap1()) {
+       if (dma_omap2plus()) {
                omap_set_dma_src_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16);
                omap_set_dma_dest_burst_mode(c->dma_ch, OMAP_DMA_DATA_BURST_16);
        }
index 340874ebf9ae79cb550cbfe54e81850802448e16..52977aa303554d54113530805e421f450db68e33 100644 (file)
 #include <sound/dmaengine_pcm.h>
 #include <sound/soc.h>
 
-#include <plat/cpu.h>
 #include "omap-pcm.h"
 
+#ifdef CONFIG_ARCH_OMAP1
+#define pcm_omap1510() cpu_is_omap1510()
+#else
+#define pcm_omap1510() 0
+#endif
+
 static const struct snd_pcm_hardware omap_pcm_hardware = {
        .info                   = SNDRV_PCM_INFO_MMAP |
                                  SNDRV_PCM_INFO_MMAP_VALID |
@@ -159,7 +164,7 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream)
 {
        snd_pcm_uframes_t offset;
 
-       if (cpu_is_omap1510())
+       if (pcm_omap1510())
                offset = snd_dmaengine_pcm_pointer_no_residue(substream);
        else
                offset = snd_dmaengine_pcm_pointer(substream);