duovero: invert sense of card detect signal
authorSteve Sakoman <steve@sakoman.com>
Tue, 22 Jan 2013 23:16:14 +0000 (15:16 -0800)
committerSteve Sakoman <steve@sakoman.com>
Tue, 22 Jan 2013 23:16:14 +0000 (15:16 -0800)
drivers/mfd/twl6030-irq.c

index b76902f..34f667f 100644 (file)
@@ -31,6 +31,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <asm/mach-types.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/interrupt.h>
@@ -343,6 +344,11 @@ int twl6030_mmc_card_detect(struct device *dev, int slot)
                                                TWL6030_MMCCTRL);
        if (ret >= 0)
                ret = read_reg & STS_MMC;
+
+       /* on duovero cd sense is inverted */
+       if (machine_is_duovero())
+               ret = (ret == 0) ? 1 : 0;
+
        return ret;
 }
 EXPORT_SYMBOL(twl6030_mmc_card_detect);