2019-06-04 16:11:33 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2007-01-27 05:14:34 +08:00
|
|
|
/*
|
|
|
|
* MMC definitions for OMAP2
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Nokia Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define OMAP_MMC_MAX_SLOTS 2
|
|
|
|
|
2012-10-16 03:09:43 +08:00
|
|
|
struct mmc_card;
|
|
|
|
|
2007-01-27 05:14:34 +08:00
|
|
|
struct omap_mmc_platform_data {
|
2009-03-24 09:23:47 +08:00
|
|
|
/* back-link to device */
|
|
|
|
struct device *dev;
|
2008-03-27 04:08:57 +08:00
|
|
|
|
2008-12-11 09:37:16 +08:00
|
|
|
/* number of slots per controller */
|
2007-01-27 05:14:34 +08:00
|
|
|
unsigned nr_slots:2;
|
2008-05-09 06:30:33 +08:00
|
|
|
|
2007-01-27 05:14:34 +08:00
|
|
|
/* set if your board has components or wiring that limits the
|
|
|
|
* maximum frequency on the MMC bus */
|
|
|
|
unsigned int max_freq;
|
|
|
|
|
|
|
|
/* switch the bus to a new slot */
|
2010-02-16 02:03:34 +08:00
|
|
|
int (*switch_slot)(struct device *dev, int slot);
|
2007-01-27 05:14:34 +08:00
|
|
|
/* initialize board-specific MMC functionality, can be NULL if
|
|
|
|
* not supported */
|
2010-02-16 02:03:34 +08:00
|
|
|
int (*init)(struct device *dev);
|
|
|
|
void (*cleanup)(struct device *dev);
|
|
|
|
void (*shutdown)(struct device *dev);
|
2008-05-09 06:30:33 +08:00
|
|
|
|
2009-09-23 07:44:40 +08:00
|
|
|
/* Return context loss count due to PM states changing */
|
|
|
|
int (*get_context_loss_count)(struct device *dev);
|
|
|
|
|
2011-03-02 05:12:56 +08:00
|
|
|
/* Integrating attributes from the omap_hwmod layer */
|
|
|
|
u8 controller_flags;
|
|
|
|
|
2010-10-02 07:35:28 +08:00
|
|
|
/* Register offset deviation */
|
|
|
|
u16 reg_offset;
|
|
|
|
|
2007-01-27 05:14:34 +08:00
|
|
|
struct omap_mmc_slot_data {
|
2008-12-11 09:37:16 +08:00
|
|
|
|
2010-10-05 07:58:01 +08:00
|
|
|
/*
|
|
|
|
* 4/8 wires and any additional host capabilities
|
|
|
|
* need to OR'd all capabilities (ref. linux/mmc/host.h)
|
|
|
|
*/
|
|
|
|
u8 wires; /* Used for the MMC driver on omap1 and 2420 */
|
|
|
|
u32 caps; /* Used for the MMC driver on 2430 and later */
|
2011-11-22 22:02:18 +08:00
|
|
|
u32 pm_caps; /* PM capabilities of the mmc */
|
2008-12-11 09:37:17 +08:00
|
|
|
|
2008-12-11 09:37:16 +08:00
|
|
|
/*
|
|
|
|
* nomux means "standard" muxing is wrong on this board, and
|
|
|
|
* that board-specific code handled it before common init logic.
|
|
|
|
*/
|
|
|
|
unsigned nomux:1;
|
|
|
|
|
|
|
|
/* switch pin can be for card detect (default) or card cover */
|
|
|
|
unsigned cover:1;
|
|
|
|
|
|
|
|
/* use the internal clock */
|
|
|
|
unsigned internal_clock:1;
|
2008-12-11 09:37:17 +08:00
|
|
|
|
2009-09-23 07:44:48 +08:00
|
|
|
/* nonremovable e.g. eMMC */
|
|
|
|
unsigned nonremovable:1;
|
|
|
|
|
2009-09-23 07:44:49 +08:00
|
|
|
/* Try to sleep or power off when possible */
|
|
|
|
unsigned power_saving:1;
|
|
|
|
|
2010-02-16 02:03:34 +08:00
|
|
|
/* If using power_saving and the MMC power is not to go off */
|
|
|
|
unsigned no_off:1;
|
|
|
|
|
2011-05-30 22:25:34 +08:00
|
|
|
/* eMMC does not handle power off when not in sleep state */
|
|
|
|
unsigned no_regulator_off_init:1;
|
|
|
|
|
2010-02-16 02:03:34 +08:00
|
|
|
/* Regulator off remapped to sleep */
|
|
|
|
unsigned vcc_aux_disable_is_sleep:1;
|
|
|
|
|
2010-05-13 20:39:31 +08:00
|
|
|
/* we can put the features above into this variable */
|
2012-12-13 03:45:16 +08:00
|
|
|
#define MMC_OMAP7XX (1 << 3)
|
|
|
|
#define MMC_OMAP15XX (1 << 4)
|
|
|
|
#define MMC_OMAP16XX (1 << 5)
|
2010-05-13 20:39:31 +08:00
|
|
|
unsigned features;
|
|
|
|
|
2008-12-11 09:37:17 +08:00
|
|
|
int switch_pin; /* gpio (card detect) */
|
|
|
|
int gpio_wp; /* gpio (write protect) */
|
2008-12-11 09:37:16 +08:00
|
|
|
|
2010-02-16 02:03:34 +08:00
|
|
|
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 (*get_ro)(struct device *dev, int slot);
|
2010-02-16 02:03:34 +08:00
|
|
|
void (*remux)(struct device *dev, int slot, int power_on);
|
2010-02-16 02:03:34 +08:00
|
|
|
/* 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);
|
2010-08-11 09:01:52 +08:00
|
|
|
/* if we have special card, init it using this callback */
|
|
|
|
void (*init_card)(struct mmc_card *card);
|
2007-01-27 05:14:34 +08:00
|
|
|
|
|
|
|
/* return MMC cover switch state, can be NULL if not supported.
|
|
|
|
*
|
|
|
|
* possible return values:
|
2008-12-11 09:37:16 +08:00
|
|
|
* 0 - closed
|
|
|
|
* 1 - open
|
2007-01-27 05:14:34 +08:00
|
|
|
*/
|
2010-02-16 02:03:34 +08:00
|
|
|
int (*get_cover_state)(struct device *dev, int slot);
|
2007-01-27 05:14:34 +08:00
|
|
|
|
|
|
|
const char *name;
|
|
|
|
u32 ocr_mask;
|
2008-05-09 06:30:33 +08:00
|
|
|
|
|
|
|
/* Card detection IRQs */
|
|
|
|
int card_detect_irq;
|
2010-02-16 02:03:34 +08:00
|
|
|
int (*card_detect)(struct device *dev, int slot);
|
2008-05-09 06:30:33 +08:00
|
|
|
|
|
|
|
unsigned int ban_openended:1;
|
|
|
|
|
2007-01-27 05:14:34 +08:00
|
|
|
} slots[OMAP_MMC_MAX_SLOTS];
|
|
|
|
};
|