Re: [PATCH 09.5/16] mmc: omap: Remove cpu_is_omap usage from the driver

2012-10-16 Thread Tony Lindgren
* Chris Ball c...@laptop.org [121005 11:24]:
 On Fri, Oct 05 2012, Tony Lindgren wrote:
 
  Chris, I can set up a minimal immutable branch with omap
  header changes that you can also pull into MMC tree if these
  two MMC patches look ackable to you.
 
 Thanks, sounds good.

Chris, I've now pushed out branch omap-for-v3.8/cleanup-headers-mmc
based on -rc1. The branch is located at:

git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git

It contains two omap MMC related patches that you can also merge
into the MMC tree if needed as now include plat/mmc.h is gone for
omaps.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09.5/16] mmc: omap: Remove cpu_is_omap usage from the driver

2012-10-05 Thread Chris Ball
Hi Tony,

On Fri, Oct 05 2012, Tony Lindgren wrote:
 This is needed for the ARM common zImage support.

 We can use the existing slot features to pass omap1
 specific options to the driver. For omap2 we don't
 want to pass anything new as that will be eventually
 moved to use device tree based init.

 Note that this patch depends on earlier patch that
 moves plat/mmc.h into include/linux/platform_data.

 Cc: Chris Ball c...@laptop.org
 Cc: Venkatraman S svenk...@ti.com
 Cc: linux-...@vger.kernel.org
 Signed-off-by: Tony Lindgren t...@atomide.com

 ---

 Chris, I can set up a minimal immutable branch with omap
 header changes that you can also pull into MMC tree if these
 two MMC patches look ackable to you.

Thanks, sounds good.

Acked-by: Chris Ball c...@laptop.org

- Chris.
-- 
Chris Ball   c...@laptop.org   http://printf.net/
One Laptop Per Child
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09.5/16] mmc: omap: Remove cpu_is_omap usage from the driver

2012-10-05 Thread Tony Lindgren
* Chris Ball c...@laptop.org [121005 11:24]:
 Hi Tony,
 
 On Fri, Oct 05 2012, Tony Lindgren wrote:
  This is needed for the ARM common zImage support.
 
  We can use the existing slot features to pass omap1
  specific options to the driver. For omap2 we don't
  want to pass anything new as that will be eventually
  moved to use device tree based init.
 
  Note that this patch depends on earlier patch that
  moves plat/mmc.h into include/linux/platform_data.
 
  Cc: Chris Ball c...@laptop.org
  Cc: Venkatraman S svenk...@ti.com
  Cc: linux-...@vger.kernel.org
  Signed-off-by: Tony Lindgren t...@atomide.com
 
  ---
 
  Chris, I can set up a minimal immutable branch with omap
  header changes that you can also pull into MMC tree if these
  two MMC patches look ackable to you.
 
 Thanks, sounds good.
 
 Acked-by: Chris Ball c...@laptop.org

Thanks will do when -rc1 is available.

Looks like I posted a version before running stg refresh
that was missing two compile fixes: MMC_OMAP7XXX should be
MMC_OMAP7XX and !mmc_omap1 should be !mmc_omap1().
Updated patch below.

Regards,

Tony


From: Tony Lindgren t...@atomide.com
Date: Thu, 4 Oct 2012 19:01:53 -0700
Subject: [PATCH] mmc: omap: Remove cpu_is_omap usage from the driver

This is needed for the ARM common zImage support.

We can use the existing slot features to pass omap1
specific options to the driver. For omap2 we don't
want to pass anything new as that will be eventually
moved to use device tree based init.

Note that this patch depends on earlier patch that
moves plat/mmc.h into include/linux/platform_data.

Cc: linux-...@vger.kernel.org
Cc: Venkatraman S svenk...@ti.com
Acked-by: Chris Ball c...@laptop.org
Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 1cc4e18..f9c4fb9 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -177,6 +177,13 @@ static int __init omap_mmc_add(const char *name, int id, 
unsigned long base,
res[3].name = tx;
res[3].flags = IORESOURCE_DMA;
 
+   if (cpu_is_omap7xx())
+   data-slots[0].features = MMC_OMAP7XX;
+   if (cpu_is_omap15xx())
+   data-slots[0].features = MMC_OMAP15XX;
+   if (cpu_is_omap16xx())
+   data-slots[0].features = MMC_OMAP16XX;
+
ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
if (ret == 0)
ret = platform_device_add_data(pdev, data, sizeof(*data));
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index e7c61b9..9f0e26f 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -30,7 +30,6 @@
 #include linux/slab.h
 #include linux/platform_data/mmc-omap.h
 
-#include plat/cpu.h
 #include plat/dma.h
 
 #defineOMAP_MMC_REG_CMD0x00
@@ -73,6 +72,13 @@
 #defineOMAP_MMC_STAT_CARD_BUSY (1   2)
 #defineOMAP_MMC_STAT_END_OF_CMD(1   0)
 
+#define mmc_omap7xx()  (host-features  MMC_OMAP7XX)
+#define mmc_omap15xx() (host-features  MMC_OMAP15XX)
+#define mmc_omap16xx() (host-features  MMC_OMAP16XX)
+#define MMC_OMAP1_MASK (MMC_OMAP7XX | MMC_OMAP15XX | MMC_OMAP16XX)
+#define mmc_omap1()(host-features  MMC_OMAP1_MASK)
+#define mmc_omap2()(!mmc_omap1())
+
 #define OMAP_MMC_REG(host, reg)(OMAP_MMC_REG_##reg  
(host)-reg_shift)
 #define OMAP_MMC_READ(host, reg)   __raw_readw((host)-virt_base + 
OMAP_MMC_REG(host, reg))
 #define OMAP_MMC_WRITE(host, reg, val) __raw_writew((val), (host)-virt_base + 
OMAP_MMC_REG(host, reg))
@@ -148,6 +154,7 @@ struct mmc_omap_host {
u32 buffer_bytes_left;
u32 total_bytes_left;
 
+   unsignedfeatures;
unsigneduse_dma:1;
unsignedbrs_received:1, dma_done:1;
unsigneddma_in_use:1;
@@ -989,7 +996,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct 
mmc_request *req)
 * blocksize is at least that large. Blocksize is
 * usually 512 bytes; but not for some SD reads.
 */
-   burst = cpu_is_omap15xx() ? 32 : 64;
+   burst = mmc_omap15xx() ? 32 : 64;
if (burst  data-blksz)
burst = data-blksz;
 
@@ -1105,8 +1112,7 @@ static void mmc_omap_set_power(struct mmc_omap_slot 
*slot, int power_on,
if (slot-pdata-set_power != NULL)
slot-pdata-set_power(mmc_dev(slot-mmc), slot-id, power_on,
vdd);
-
-   if (cpu_is_omap24xx()) {
+   if (mmc_omap2()) {
u16 w;
 
if (power_on) {
@@ -1240,7 +1246,7 @@ static int __devinit mmc_omap_new_slot(struct 
mmc_omap_host *host, int id)
mmc-ops = mmc_omap_ops;
mmc-f_min = 40;
 
-   if (cpu_class_is_omap2())
+   if (mmc_omap2())
mmc-f_max = 4800;