PRCM: OMAP3: Fix to wrongly modified omap2_clk_wait_ready
[linux-ginger.git] / arch / arm / mach-omap2 / board-apollon-mmc.c
blobf77167e1af004440e74e524120c331c7f4420ea0
1 /*
2 * linux/arch/arm/mach-omap2/board-apollon-mmc.c
4 * Copyright (C) 2005-2007 Samsung Electronics
5 * Author: Kyungmin Park <kyungmin.park@samsung.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/kernel.h>
14 #include <asm/arch/gpio.h>
15 #include <asm/arch/mmc.h>
17 #ifdef CONFIG_MMC_OMAP
19 static struct device *mmc_device;
21 static int apollon_mmc_set_power(struct device *dev, int slot, int power_on,
22 int vdd)
24 #ifdef CONFIG_MMC_DEBUG
25 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
26 power_on ? "on" : "off", vdd);
27 #endif
28 if (slot != 0) {
29 dev_err(dev, "No such slot %d\n", slot + 1);
30 return -ENODEV;
33 return 0;
36 static int apollon_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
38 #ifdef CONFIG_MMC_DEBUG
39 dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1,
40 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
41 #endif
42 if (slot != 0) {
43 dev_err(dev, "No such slot %d\n", slot + 1);
44 return -ENODEV;
47 return 0;
50 static int apollon_mmc_late_init(struct device *dev)
52 mmc_device = dev;
54 return 0;
57 static void apollon_mmc_cleanup(struct device *dev)
61 static struct omap_mmc_platform_data apollon_mmc_data = {
62 .nr_slots = 1,
63 .switch_slot = NULL,
64 .init = apollon_mmc_late_init,
65 .cleanup = apollon_mmc_cleanup,
66 .slots[0] = {
67 .set_power = apollon_mmc_set_power,
68 .set_bus_mode = apollon_mmc_set_bus_mode,
69 .get_ro = NULL,
70 .get_cover_state = NULL,
71 .ocr_mask = MMC_VDD_30_31 | MMC_VDD_31_32 |
72 MMC_VDD_32_33 | MMC_VDD_33_34,
73 .name = "mmcblk",
77 void __init apollon_mmc_init(void)
79 omap_set_mmc_info(1, &apollon_mmc_data);
82 #else /* !CONFIG_MMC_OMAP */
84 void __init apollon_mmc_init(void)
88 #endif /* CONFIG_MMC_OMAP */