]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-arm/arch-omap/mmc.h
OMAP: MMC: Introduce new multislot structure and change driver to use it
[linux-2.6-omap-h63xx.git] / include / asm-arm / arch-omap / mmc.h
1 /*
2  * MMC definitions for OMAP2
3  *
4  * Copyright (C) 2006 Nokia Corporation
5  *
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  */
10
11 #ifndef __OMAP2_MMC_H
12 #define __OMAP2_MMC_H
13
14 #include <linux/types.h>
15 #include <linux/device.h>
16 #include <linux/mmc/host.h>
17
18 #define OMAP_MMC_MAX_SLOTS      2
19
20 struct omap_mmc_platform_data {
21         struct omap_mmc_conf    conf;
22
23         unsigned enabled:1;
24         /* number of slots on board */
25         unsigned nr_slots:2;
26         /* nomux means "standard" muxing is wrong on this board, and that
27          * board-specific code handled it before common init logic.
28          */
29         unsigned nomux:1;
30         /* 4 wire signaling is optional, and is only used for SD/SDIO and
31          * MMCv4 */
32         unsigned wire4:1;
33         /* set if your board has components or wiring that limits the
34          * maximum frequency on the MMC bus */
35         unsigned int max_freq;
36
37         /* switch the bus to a new slot */
38         int (* switch_slot)(struct device *dev, int slot);
39         /* initialize board-specific MMC functionality, can be NULL if
40          * not supported */
41         int (* init)(struct device *dev);
42         void (* cleanup)(struct device *dev);
43
44         struct omap_mmc_slot_data {
45                 int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
46                 int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
47                 int (* get_ro)(struct device *dev, int slot);
48
49                 /* return MMC cover switch state, can be NULL if not supported.
50                  *
51                  * possible return values:
52                  *   0 - open
53                  *   1 - closed
54                  */
55                 int (* get_cover_state)(struct device *dev, int slot);
56
57                 const char *name;
58                 u32 ocr_mask;
59         } slots[OMAP_MMC_MAX_SLOTS];
60 };
61
62 extern void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info);
63
64 /* called from board-specific card detection service routine */
65 extern void omap_mmc_notify_card_detect(struct device *dev, int slot, int detected);
66 extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
67
68 #endif