]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP: MMC: Add menelaus_enable_slot on menelaus.c.
authorDavid Cohen <david.cohen@indt.org.br>
Fri, 25 Jan 2008 18:59:35 +0000 (14:59 -0400)
committerTony Lindgren <tony@atomide.com>
Fri, 25 Jan 2008 22:56:00 +0000 (14:56 -0800)
Adding menelaus_enable_slot() function on menelaus driver.
This function enables/disables the mmc slots on menelaus.

Signed-off-by: David Cohen <david.cohen@indt.org.br>
Acked-by: Anderson Lizardo <anderson.lizardo@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/i2c/chips/menelaus.c
include/asm-arm/arch-omap/menelaus.h

index 77b3342c78ceb4b7d4b3d7524cf3b5fc68e9d3e8..1d7482ae9b102f5380e7e8d6d0a2f05576fc0e94 100644 (file)
@@ -314,6 +314,34 @@ out:
 }
 EXPORT_SYMBOL(menelaus_set_slot_sel);
 
+int menelaus_enable_slot(int slot, int enable)
+{
+       int ret, val;
+
+       mutex_lock(&the_menelaus->lock);
+       ret = menelaus_read_reg(MENELAUS_MCT_CTRL3);
+       if (ret < 0)
+               goto out;
+       val = ret;
+       if (slot == 1) {
+               if (enable)
+                       val |= 1 << 0;
+               else
+                       val &= ~(1 << 0);
+       } else {
+               if (enable)
+                       val |= 1 << 1;
+               else
+                       val &= ~(1 << 1);
+       }
+       ret = menelaus_write_reg(MENELAUS_MCT_CTRL3, val);
+
+out:
+       mutex_unlock(&the_menelaus->lock);
+       return ret;
+}
+EXPORT_SYMBOL(menelaus_enable_slot);
+
 int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_en)
 {
        int ret, val;
index 69ed7ee40179e4bf83ef0649c7072af6d93fae22..e1012c1c54a91d7bedd61109c8661f84c2f57dec 100644 (file)
@@ -18,6 +18,7 @@ extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_m
 extern void menelaus_unregister_mmc_callback(void);
 extern int menelaus_set_mmc_opendrain(int slot, int enable);
 extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on);
+extern int menelaus_enable_slot(int slot, int enable);
 
 extern int menelaus_set_vmem(unsigned int mV);
 extern int menelaus_set_vio(unsigned int mV);