]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-arm/arch-omap/mmc.h
ARM: OMAP: HSMMC: enable use as a module
[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 #include <asm/arch/board.h>
19
20 #define OMAP_MMC_MAX_SLOTS      2
21
22 struct omap_mmc_platform_data {
23         struct omap_mmc_conf    conf;
24
25         /* number of slots on board */
26         unsigned nr_slots:2;
27
28         /* set if your board has components or wiring that limits the
29          * maximum frequency on the MMC bus */
30         unsigned int max_freq;
31
32         /* switch the bus to a new slot */
33         int (* switch_slot)(struct device *dev, int slot);
34         /* initialize board-specific MMC functionality, can be NULL if
35          * not supported */
36         int (* init)(struct device *dev);
37         void (* cleanup)(struct device *dev);
38
39         /* To handle board related suspend/resume functionality for MMC */
40         int (*suspend)(struct device *dev, int slot);
41         int (*resume)(struct device *dev, int slot);
42
43         struct omap_mmc_slot_data {
44                 int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
45                 int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
46                 int (* get_ro)(struct device *dev, int slot);
47
48                 /* return MMC cover switch state, can be NULL if not supported.
49                  *
50                  * possible return values:
51                  *   0 - open
52                  *   1 - closed
53                  */
54                 int (* get_cover_state)(struct device *dev, int slot);
55
56                 const char *name;
57                 u32 ocr_mask;
58
59                 /* Card detection IRQs */
60                 int card_detect_irq;
61                 int (* card_detect)(int irq);
62         } slots[OMAP_MMC_MAX_SLOTS];
63 };
64
65 extern void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info);
66
67 /* called from board-specific card detection service routine */
68 extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
69
70 #endif