Adding menelaus_enable_slot() function on menelaus driver. This function enables/disables the mmc slots on menelaus. Signed-off-by: David Cohen <david.cohen@xxxxxxxxxxx> Acked-by: Anderson Lizardo <anderson.lizardo@xxxxxxxxxxx> --- drivers/i2c/chips/menelaus.c | 28 ++++++++++++++++++++++++++++ include/asm-arm/arch-omap/menelaus.h | 1 + 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/chips/menelaus.c b/drivers/i2c/chips/menelaus.c index 9d75964..9fe78d2 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 69ed7ee..e1012c1 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); -- 1.5.3.5 - To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html