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