From e8e64239b997913fb60fb8e39e82b949809e4217 Mon Sep 17 00:00:00 2001 From: David Cohen Date: Fri, 25 Jan 2008 14:59:35 -0400 Subject: [PATCH] OMAP: MMC: Add menelaus_enable_slot on menelaus.c. Adding menelaus_enable_slot() function on menelaus driver. This function enables/disables the mmc slots on menelaus. Signed-off-by: David Cohen Acked-by: Anderson Lizardo Signed-off-by: Tony Lindgren --- drivers/i2c/chips/menelaus.c | 28 ++++++++++++++++++++++++++++ include/asm-arm/arch-omap/menelaus.h | 1 + 2 files changed, 29 insertions(+) diff --git a/drivers/i2c/chips/menelaus.c b/drivers/i2c/chips/menelaus.c index 77b3342c78c..1d7482ae9b1 100644 --- a/drivers/i2c/chips/menelaus.c +++ b/drivers/i2c/chips/menelaus.c @@ -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; diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h index 69ed7ee4017..e1012c1c54a 100644 --- a/include/asm-arm/arch-omap/menelaus.h +++ b/include/asm-arm/arch-omap/menelaus.h @@ -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); -- 2.41.1