new file mode 100644
@@ -0,0 +1,104 @@
+/*
+ * linux/arch/arm/mach-omap1/htc-mmc.c
+ *
+ * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT
+ * Author: Felipe Balbi <felipe.lima@indt.org.br>
+ *
+ * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:
+ * 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.
+ */
+
+#include <plat/mmc.h>
+#include <asm/mach-types.h>
+
+#include <linux/gpio.h>
+#include <linux/delay.h>
+
+#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
+
+#define OMAP_MMC_REG_SYSC (0xfffb7800 + 0x32)
+#define OMAP_MMC_REG_SYSS (0xfffb7800 + 0x34)
+
+static int slot_cover_open;
+static struct device *mmc_device;
+
+static int htc_mmc_set_power(struct device *dev, int slot, int power_on,
+ int vdd)
+{
+#ifdef CONFIG_MMC_DEBUG
+ dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
+ power_on ? "on" : "off", vdd);
+#endif
+ if (slot != 0) {
+ dev_err(dev, "No such slot %d\n", slot + 1);
+ return -ENODEV;
+ }
+
+ return 0;
+}
+
+static int htc_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
+{
+#ifdef CONFIG_MMC_DEBUG
+ dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1,
+ bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
+#endif
+ if (slot != 0) {
+ dev_err(dev, "No such slot %d\n", slot + 1);
+ return -ENODEV;
+ }
+
+ /* Treated on upper level */
+
+ return bus_mode;
+}
+
+static int htc_mmc_get_cover_state(struct device *dev, int slot)
+{
+ BUG_ON(slot != 0);
+ return slot_cover_open;
+}
+
+static int htc_mmc_late_init(struct device *dev)
+{
+ mmc_device = dev;
+ return 0;
+}
+
+static void htc_mmc_cleanup(struct device *dev)
+{
+}
+
+static struct omap_mmc_platform_data htc_mmc1_data = {
+ .nr_slots = 1,
+ .switch_slot = NULL,
+ .init = htc_mmc_late_init,
+ .cleanup = htc_mmc_cleanup,
+ .slots[0] = {
+ .set_power = htc_mmc_set_power,
+ .set_bus_mode = htc_mmc_set_bus_mode,
+ .get_ro = NULL,
+ .get_cover_state = htc_mmc_get_cover_state,
+ .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 |
+ MMC_VDD_32_33 | MMC_VDD_33_34,
+ .name = "mmcblk",
+ .nomux = 1,
+ .wires = 4,
+ .switch_pin = -1,
+ },
+};
+
+static struct omap_mmc_platform_data *htc_mmc_data[1];
+
+void __init htc_mmc_init(void)
+{
+ /* register it */
+ htc_mmc_data[0] = &htc_mmc1_data;
+ omap1_init_mmc(htc_mmc_data, 1);
+}
+#endif
+
new file mode 100644
@@ -0,0 +1,26 @@
+/*
+ * linux/arch/arm/mach-omap1/htc-mmc.h
+ *
+ * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT
+ * Author: Felipe Balbi <felipe.lima@indt.org.br>
+ *
+ * This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:
+ * 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.
+ */
+#ifndef __HTC_MMC_H
+#define __HTC_MMC_H
+
+#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
+extern void htc_mmc_init(void);
+#else
+static inline void htc_mmc_init(void)
+{
+}
+#endif
+
+#endif /* __HTC_MMC_H */
+