Path: blob/master/arch/arm/mach-omap1/board-h3-mmc.c
10817 views
/*1* linux/arch/arm/mach-omap1/board-h3-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-h3.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(H3_TPS_GPIO_MMC_PWR_EN, power_on);29return 0;30}3132/*33* H3 could use the following functions tested:34* - mmc_get_cover_state that uses OMAP_MPUIO(1)35* - mmc_get_wp that maybe uses OMAP_MPUIO(3)36*/37static struct omap_mmc_platform_data mmc1_data = {38.nr_slots = 1,39.dma_mask = 0xffffffff,40.slots[0] = {41.set_power = mmc_set_power,42.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,43.name = "mmcblk",44},45};4647static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];4849void __init h3_mmc_init(void)50{51int ret;5253ret = gpio_request(H3_TPS_GPIO_MMC_PWR_EN, "MMC power");54if (ret < 0)55return;56gpio_direction_output(H3_TPS_GPIO_MMC_PWR_EN, 0);5758mmc_data[0] = &mmc1_data;59omap1_init_mmc(mmc_data, OMAP16XX_NR_MMC);60}6162#else6364void __init h3_mmc_init(void)65{66}6768#endif697071