mfd: Adding twl6030 mmc card detect support for MMC1

Adding card detect callback function and card detect configuration
function for MMC1 Controller on OMAP4.

Card detect configuration function does initial configuration of the
MMC Control & PullUp-PullDown registers of Phoenix.

For MMC1 Controller, card detect interrupt source is
twl6030 which is non-gpio. The card detect call back function provides
card present/absent status by reading MMC Control register present
on twl6030.

Since OMAP4 doesn't use any GPIO line as used in OMAP3 for card detect,
the suspend/resume initialization which was done in omap_hsmmc_gpio_init
previously is moved to the probe thus making it generic for both OMAP3 &
OMAP4.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
kishore kadiyala 2010-09-24 17:13:20 +00:00 committed by Samuel Ortiz
parent 8e00593557
commit 72f2e2c763
4 changed files with 112 additions and 3 deletions

View file

@ -141,6 +141,16 @@
#define TWL6030_CHARGER_CTRL_INT_MASK 0x10
#define TWL6030_CHARGER_FAULT_INT_MASK 0x60
#define TWL6030_MMCCTRL 0xEE
#define VMMC_AUTO_OFF (0x1 << 3)
#define SW_FC (0x1 << 2)
#define STS_MMC 0x1
#define TWL6030_CFG_INPUT_PUPD3 0xF2
#define MMC_PU (0x1 << 3)
#define MMC_PD (0x1 << 2)
#define TWL4030_CLASS_ID 0x4030
#define TWL6030_CLASS_ID 0x6030
@ -173,6 +183,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
/* Card detect Configuration for MMC1 Controller on OMAP4 */
#ifdef CONFIG_TWL4030_CORE
int twl6030_mmc_card_detect_config(void);
#else
static inline int twl6030_mmc_card_detect_config(void)
{
pr_debug("twl6030_mmc_card_detect_config not supported\n");
return 0;
}
#endif
/* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */
#ifdef CONFIG_TWL4030_CORE
int twl6030_mmc_card_detect(struct device *dev, int slot);
#else
static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
{
pr_debug("Call back twl6030_mmc_card_detect not supported\n");
return -EIO;
}
#endif
/*----------------------------------------------------------------------*/
/*