Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / include / asm-arm / arch-omap / mmc.h
blobb70e37b6124244ee8e8142f965bd85f03827fb45
1 /*
2 * MMC definitions for OMAP2
4 * Copyright (C) 2006 Nokia Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #ifndef __OMAP2_MMC_H
12 #define __OMAP2_MMC_H
14 #include <linux/types.h>
15 #include <linux/device.h>
16 #include <linux/mmc/host.h>
18 #define OMAP_MMC_MAX_SLOTS 2
20 struct omap_mmc_platform_data {
21 unsigned enabled:1;
22 /* number of slots on board */
23 unsigned nr_slots:2;
24 /* nomux means "standard" muxing is wrong on this board, and that
25 * board-specific code handled it before common init logic.
27 unsigned nomux:1;
28 /* 4 wire signaling is optional, and is only used for SD/SDIO and
29 * MMCv4 */
30 unsigned wire4:1;
31 /* set if your board has components or wiring that limits the
32 * maximum frequency on the MMC bus */
33 unsigned int max_freq;
35 /* switch the bus to a new slot */
36 int (* switch_slot)(struct device *dev, int slot);
37 /* initialize board-specific MMC functionality, can be NULL if
38 * not supported */
39 int (* init)(struct device *dev);
40 void (* cleanup)(struct device *dev);
42 struct omap_mmc_slot_data {
43 int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
44 int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
45 int (* get_ro)(struct device *dev, int slot);
47 /* return MMC cover switch state, can be NULL if not supported.
49 * possible return values:
50 * 0 - open
51 * 1 - closed
53 int (* get_cover_state)(struct device *dev, int slot);
55 const char *name;
56 u32 ocr_mask;
57 } slots[OMAP_MMC_MAX_SLOTS];
60 extern void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info);
62 /* called from board-specific card detection service routine */
63 extern void omap_mmc_notify_card_detect(struct device *dev, int slot, int detected);
64 extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
66 #endif