MMC: AU1xMMC: Allow platforms to disable host capabilities
authorManuel Lauss <manuel.lauss@googlemail.com>
Wed, 14 Oct 2009 07:38:06 +0000 (09:38 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 27 Feb 2010 11:53:19 +0000 (12:53 +0100)
Although the hardware supports a 4/8bit SD interface and the driver
unconditionally advertises all hardware caps to the MMC core, not all
datalines may actually be wired up.  This patch introduces another
field to au1xmmc platform data allowing platforms to disable certain
advanced host controller features.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
To: linux-mmc@vger.kernel.org
CC: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: http://patchwork.linux-mips.org/patch/460/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/mach-au1x00/au1100_mmc.h
drivers/mmc/host/au1xmmc.c

index 58fbe173ecde1a686f7b2842143d638942d3463c..94000a3b6f0b7c7e07feab37f33a74c82c40d535 100644 (file)
@@ -46,6 +46,7 @@ struct au1xmmc_platform_data {
        int(*card_readonly)(void *mmc_host);
        void(*set_power)(void *mmc_host, int state);
        struct led_classdev *led;
+       unsigned long mask_host_caps;
 };
 
 #define SD0_BASE       0xB0600000
index c8649dfb2d0c7760f90019dd0a2c49b5ec61a244..57b21198828fbd18ad8ac980b667b7e9dc41b2a6 100644 (file)
@@ -1017,6 +1017,10 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev)
        } else
                mmc->caps |= MMC_CAP_NEEDS_POLL;
 
+       /* platform may not be able to use all advertised caps */
+       if (host->platdata)
+               mmc->caps &= ~(host->platdata->mask_host_caps);
+
        tasklet_init(&host->data_task, au1xmmc_tasklet_data,
                        (unsigned long)host);