Commit db0fefc5 authored by Adrian Hunter's avatar Adrian Hunter Committed by Tony Lindgren

omap_hsmmc: Move gpio and regulator control from board file

This patch moves the setup code for GPIO's and Voltage
Regulators from the board file mmc-twl4030.c to the
driver omap_hsmmc.c.  PBIAS and other system control
configuration remains in the board file.

Moving GPIO code to the driver makes the board initialisation
code independent of when GPIO's are defined.  That makes the
board initialisation now entirely independent of its original
twl4030 roots.

Moving Voltage Regulator code to the driver allows for further
development of regulator support in the core MMC code.  It also
permits the MMC core to be compiled as a module, because the
board code no longer calls MMC core functions.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 88c8460a
...@@ -1354,7 +1354,7 @@ CONFIG_USB_OTG_UTILS=y ...@@ -1354,7 +1354,7 @@ CONFIG_USB_OTG_UTILS=y
# CONFIG_USB_GPIO_VBUS is not set # CONFIG_USB_GPIO_VBUS is not set
# CONFIG_ISP1301_OMAP is not set # CONFIG_ISP1301_OMAP is not set
CONFIG_TWL4030_USB=y CONFIG_TWL4030_USB=y
CONFIG_MMC=y CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set # CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set # CONFIG_MMC_UNSAFE_RESUME is not set
...@@ -1362,7 +1362,7 @@ CONFIG_MMC=y ...@@ -1362,7 +1362,7 @@ CONFIG_MMC=y
# MMC/SD/SDIO Card Drivers # MMC/SD/SDIO Card Drivers
# #
CONFIG_MMC_BLOCK=m CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_BOUNCE=y # CONFIG_MMC_BLOCK_BOUNCE is not set
# CONFIG_SDIO_UART is not set # CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set # CONFIG_MMC_TEST is not set
......
This diff is collapsed.
...@@ -21,9 +21,7 @@ struct twl4030_hsmmc_info { ...@@ -21,9 +21,7 @@ struct twl4030_hsmmc_info {
int ocr_mask; /* temporary HACK */ int ocr_mask; /* temporary HACK */
}; };
#if defined(CONFIG_REGULATOR) && \ #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
(defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE))
void twl4030_mmc_init(struct twl4030_hsmmc_info *); void twl4030_mmc_init(struct twl4030_hsmmc_info *);
......
...@@ -55,12 +55,12 @@ struct omap_mmc_platform_data { ...@@ -55,12 +55,12 @@ struct omap_mmc_platform_data {
unsigned int max_freq; unsigned int max_freq;
/* switch the bus to a new slot */ /* switch the bus to a new slot */
int (* switch_slot)(struct device *dev, int slot); int (*switch_slot)(struct device *dev, int slot);
/* initialize board-specific MMC functionality, can be NULL if /* initialize board-specific MMC functionality, can be NULL if
* not supported */ * not supported */
int (* init)(struct device *dev); int (*init)(struct device *dev);
void (* cleanup)(struct device *dev); void (*cleanup)(struct device *dev);
void (* shutdown)(struct device *dev); void (*shutdown)(struct device *dev);
/* To handle board related suspend/resume functionality for MMC */ /* To handle board related suspend/resume functionality for MMC */
int (*suspend)(struct device *dev, int slot); int (*suspend)(struct device *dev, int slot);
...@@ -99,11 +99,18 @@ struct omap_mmc_platform_data { ...@@ -99,11 +99,18 @@ struct omap_mmc_platform_data {
int switch_pin; /* gpio (card detect) */ int switch_pin; /* gpio (card detect) */
int gpio_wp; /* gpio (write protect) */ int gpio_wp; /* gpio (write protect) */
int (* set_bus_mode)(struct device *dev, int slot, int bus_mode); int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
int (* set_power)(struct device *dev, int slot, int power_on, int vdd); int (*set_power)(struct device *dev, int slot,
int (* get_ro)(struct device *dev, int slot); int power_on, int vdd);
int (*get_ro)(struct device *dev, int slot);
int (*set_sleep)(struct device *dev, int slot, int sleep, int (*set_sleep)(struct device *dev, int slot, int sleep,
int vdd, int cardsleep); int vdd, int cardsleep);
/* Call back before enabling / disabling regulators */
void (*before_set_reg)(struct device *dev, int slot,
int power_on, int vdd);
/* Call back after enabling / disabling regulators */
void (*after_set_reg)(struct device *dev, int slot,
int power_on, int vdd);
/* return MMC cover switch state, can be NULL if not supported. /* return MMC cover switch state, can be NULL if not supported.
* *
...@@ -111,14 +118,14 @@ struct omap_mmc_platform_data { ...@@ -111,14 +118,14 @@ struct omap_mmc_platform_data {
* 0 - closed * 0 - closed
* 1 - open * 1 - open
*/ */
int (* get_cover_state)(struct device *dev, int slot); int (*get_cover_state)(struct device *dev, int slot);
const char *name; const char *name;
u32 ocr_mask; u32 ocr_mask;
/* Card detection IRQs */ /* Card detection IRQs */
int card_detect_irq; int card_detect_irq;
int (* card_detect)(int irq); int (*card_detect)(struct device *dev, int slot);
unsigned int ban_openended:1; unsigned int ban_openended:1;
...@@ -126,7 +133,8 @@ struct omap_mmc_platform_data { ...@@ -126,7 +133,8 @@ struct omap_mmc_platform_data {
}; };
/* called from board-specific card detection service routine */ /* called from board-specific card detection service routine */
extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed); extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
int is_closed);
#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment