Path: blob/master/arch/arm/mach-omap1/board-h2-mmc.c
10817 views
/*1* linux/arch/arm/mach-omap1/board-h2-mmc.c2*3* Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT4* Author: Felipe Balbi <[email protected]>5*6* This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:7* Copyright (C) 2006 Nokia Corporation8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License version 2 as11* published by the Free Software Foundation.12*/1314#include <linux/platform_device.h>1516#include <linux/i2c/tps65010.h>1718#include <plat/mmc.h>19#include <mach/gpio.h>2021#include "board-h2.h"2223#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)2425static int mmc_set_power(struct device *dev, int slot, int power_on,26int vdd)27{28gpio_set_value(H2_TPS_GPIO_MMC_PWR_EN, power_on);29return 0;30}3132static int mmc_late_init(struct device *dev)33{34int ret = gpio_request(H2_TPS_GPIO_MMC_PWR_EN, "MMC power");35if (ret < 0)36return ret;3738gpio_direction_output(H2_TPS_GPIO_MMC_PWR_EN, 0);3940return ret;41}4243static void mmc_cleanup(struct device *dev)44{45gpio_free(H2_TPS_GPIO_MMC_PWR_EN);46}4748/*49* H2 could use the following functions tested:50* - mmc_get_cover_state that uses OMAP_MPUIO(1)51* - mmc_get_wp that uses OMAP_MPUIO(3)52*/53static struct omap_mmc_platform_data mmc1_data = {54.nr_slots = 1,55.init = mmc_late_init,56.cleanup = mmc_cleanup,57.dma_mask = 0xffffffff,58.slots[0] = {59.set_power = mmc_set_power,60.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,61.name = "mmcblk",62},63};6465static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];6667void __init h2_mmc_init(void)68{69mmc_data[0] = &mmc1_data;70omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC);71}7273#else7475void __init h2_mmc_init(void)76{77}7879#endif808182