2007-01-26 21:14:34 +00:00
|
|
|
/*
|
|
|
|
* MMC definitions for OMAP2
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Nokia Corporation
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define OMAP_MMC_MAX_SLOTS 2
|
|
|
|
|
2012-10-15 19:09:43 +00:00
|
|
|
struct mmc_card;
|
|
|
|
|
2007-01-26 21:14:34 +00:00
|
|
|
struct omap_mmc_platform_data {
|
2009-03-24 01:23:47 +00:00
|
|
|
/* back-link to device */
|
|
|
|
struct device *dev;
|
2008-03-26 20:08:57 +00:00
|
|
|
|
2008-12-11 01:37:16 +00:00
|
|
|
/* number of slots per controller */
|
2007-01-26 21:14:34 +00:00
|
|
|
unsigned nr_slots:2;
|
2008-05-08 22:30:33 +00:00
|
|
|
|
2007-01-26 21:14:34 +00: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-15 18:03:34 +00:00
|
|
|
int (*switch_slot)(struct device *dev, int slot);
|
2007-01-26 21:14:34 +00:00
|
|
|
/* initialize board-specific MMC functionality, can be NULL if
|
|
|
|
* not supported */
|
2010-02-15 18:03:34 +00:00
|
|
|
int (*init)(struct device *dev);
|
|
|
|
void (*cleanup)(struct device *dev);
|
|
|
|
void (*shutdown)(struct device *dev);
|
2008-05-08 22:30:33 +00:00
|
|
|
|
2009-09-22 23:44:40 +00:00
|
|
|
/* Return context loss count due to PM states changing */
|
|
|
|
int (*get_context_loss_count)(struct device *dev);
|
|
|
|
|
2011-03-01 21:12:56 +00:00
|
|
|
/* Integrating attributes from the omap_hwmod layer */
|
|
|
|
u8 controller_flags;
|
|
|
|
|
2010-10-01 23:35:28 +00:00
|
|
|
/* Register offset deviation */
|
|
|
|
u16 reg_offset;
|
|
|
|
|
2007-01-26 21:14:34 +00:00
|
|
|
struct omap_mmc_slot_data {
|
2008-12-11 01:37:16 +00:00
|
|
|
|
2010-10-04 23:58:01 +00: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 14:02:18 +00:00
|
|
|
u32 pm_caps; /* PM capabilities of the mmc */
|
2008-12-11 01:37:17 +00:00
|
|
|
|
2008-12-11 01:37:16 +00: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 01:37:17 +00:00
|
|
|
|
2009-09-22 23:44:48 +00:00
|
|
|
/* nonremovable e.g. eMMC */
|
|
|
|
unsigned nonremovable:1;
|
|
|
|
|
2009-09-22 23:44:49 +00:00
|
|
|
/* Try to sleep or power off when possible */
|
|
|
|
unsigned power_saving:1;
|
|
|
|
|
2010-02-15 18:03:34 +00:00
|
|
|
/* If using power_saving and the MMC power is not to go off */
|
|
|
|
unsigned no_off:1;
|
|
|
|
|
2011-05-30 14:25:34 +00:00
|
|
|
/* eMMC does not handle power off when not in sleep state */
|
|
|
|
unsigned no_regulator_off_init:1;
|
|
|
|
|
2010-02-15 18:03:34 +00:00
|
|
|
/* Regulator off remapped to sleep */
|
|
|
|
unsigned vcc_aux_disable_is_sleep:1;
|
|
|
|
|
2010-05-13 12:39:31 +00:00
|
|
|
/* we can put the features above into this variable */
|
2012-12-12 19:45:16 +00:00
|
|
|
#define MMC_OMAP7XX (1 << 3)
|
|
|
|
#define MMC_OMAP15XX (1 << 4)
|
|
|
|
#define MMC_OMAP16XX (1 << 5)
|
2010-05-13 12:39:31 +00:00
|
|
|
unsigned features;
|
|
|
|
|
2008-12-11 01:37:17 +00:00
|
|
|
int switch_pin; /* gpio (card detect) */
|
|
|
|
int gpio_wp; /* gpio (write protect) */
|
2008-12-11 01:37:16 +00:00
|
|
|
|
2010-02-15 18:03:34 +00: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-15 18:03:34 +00:00
|
|
|
void (*remux)(struct device *dev, int slot, int power_on);
|
2010-02-15 18:03:34 +00: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 01:01:52 +00:00
|
|
|
/* if we have special card, init it using this callback */
|
|
|
|
void (*init_card)(struct mmc_card *card);
|
2007-01-26 21:14:34 +00:00
|
|
|
|
|
|
|
/* return MMC cover switch state, can be NULL if not supported.
|
|
|
|
*
|
|
|
|
* possible return values:
|
2008-12-11 01:37:16 +00:00
|
|
|
* 0 - closed
|
|
|
|
* 1 - open
|
2007-01-26 21:14:34 +00:00
|
|
|
*/
|
2010-02-15 18:03:34 +00:00
|
|
|
int (*get_cover_state)(struct device *dev, int slot);
|
2007-01-26 21:14:34 +00:00
|
|
|
|
|
|
|
const char *name;
|
|
|
|
u32 ocr_mask;
|
2008-05-08 22:30:33 +00:00
|
|
|
|
|
|
|
/* Card detection IRQs */
|
|
|
|
int card_detect_irq;
|
2010-02-15 18:03:34 +00:00
|
|
|
int (*card_detect)(struct device *dev, int slot);
|
2008-05-08 22:30:33 +00:00
|
|
|
|
|
|
|
unsigned int ban_openended:1;
|
|
|
|
|
2007-01-26 21:14:34 +00:00
|
|
|
} slots[OMAP_MMC_MAX_SLOTS];
|
|
|
|
};
|