2 * linux/arch/arm/mach-omap1/board-h3-mmc.c
4 * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT
5 * Author: Felipe Balbi <felipe.lima@indt.org.br>
7 * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:
8 * Copyright (C) 2006 Nokia Corporation
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
16 #include <mach/gpio.h>
19 #ifdef CONFIG_MMC_OMAP
20 static int slot_cover_open;
21 static struct device *mmc_device;
23 static int h3_mmc_set_power(struct device *dev, int slot, int power_on,
26 #ifdef CONFIG_MMC_DEBUG
27 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
28 power_on ? "on" : "off", vdd);
31 dev_err(dev, "No such slot %d\n", slot + 1);
38 static int h3_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
42 #ifdef CONFIG_MMC_DEBUG
43 dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1,
44 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
47 dev_err(dev, "No such slot %d\n", slot + 1);
51 /* Treated on upper level */
56 static int h3_mmc_get_cover_state(struct device *dev, int slot)
60 return slot_cover_open;
63 void h3_mmc_slot_cover_handler(void *arg, int state)
65 if (mmc_device == NULL)
68 slot_cover_open = state;
69 omap_mmc_notify_cover_event(mmc_device, 0, state);
72 static int h3_mmc_late_init(struct device *dev)
81 static void h3_mmc_cleanup(struct device *dev)
85 static struct omap_mmc_platform_data h3_mmc_data = {
88 .init = h3_mmc_late_init,
89 .cleanup = h3_mmc_cleanup,
93 .set_power = h3_mmc_set_power,
94 .set_bus_mode = h3_mmc_set_bus_mode,
96 .get_cover_state = h3_mmc_get_cover_state,
97 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 |
98 MMC_VDD_32_33 | MMC_VDD_33_34,
103 void __init h3_mmc_init(void)
105 omap1_init_mmc(&h3_mmc_data);
110 void __init h3_mmc_init(void)
114 void h3_mmc_slot_cover_handler(void *arg, int state)