📄 mmc_s3c24a0.c
字号:
/* * 2002 (C) Copyrigt SAMSUMNG ELECTRONICS * SW.LEE <hitchcar@sec.samsung.com> * * Low-level MMC functions for the S3CXX * * Copyright 2002 Hewlett-Packard Company * * Modified for the S3C24A0 by Naushad naushad@samsung.com: * Copyright (c) 2005 Samsung Electronics. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * Use consistent with the GNU GPL is permitted, * provided that this copyright notice is * preserved in its entirety in all copies and derived works. * * HEWLETT-PACKARD COMPANY MAKES NO WARRANTIES, EXPRESSED OR IMPLIED, * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS * FITNESS FOR ANY PARTICULAR PURPOSE. * * Many thanks to Alessandro Rubini and Jonathan Corbet! * * Author: Andrew Christian * 6 May 2002 */#include <linux/module.h>#include <linux/version.h>#include <linux/init.h>#include <linux/sched.h>#include <linux/interrupt.h>#include <linux/proc_fs.h>#include <linux/delay.h>#include <asm/irq.h> #include <asm/io.h> #include <asm/unaligned.h>#include <asm/arch/hardware.h>#include <linux/mmc/mmc_ll.h>#include "s3c_mmc.h"#define SD_GPIO_CD GPIO_11#define SD_IRQ_CD IRQ_EINT11static __inline__ void mmc_delay(void) {mdelay(100);}/******* * Prototype * static int mmc_s3c_slot_is_empty (int slot) * Purpose: * Entry * Exit * 1 : slot is empty * 0 : occupied * Exceptions: *****************************************************/static int mmc_s3c2410_slot_is_empty (struct s3c_mmc_lowlevel *lowlevel){ int retval; set_gpio_ctrl(SD_GPIO_CD | GPIO_PULLUP_DIS | GPIO_MODE_IN); mmc_delay(); /* I amn' sure of how long time to*/ retval = read_gpio_bit(SD_GPIO_CD); set_gpio_ctrl(SD_GPIO_CD | GPIO_PULLUP_DIS | GPIO_MODE_EINT); return retval;}struct s3c_mmc_lowlevel s3c24a0_mmc_lowlevel = { .name = "s3c24a0_mmc", .sdi_irq = IRQ_SDI, .detect_irq = SD_IRQ_CD, .detect_irq_edge = EINT_BOTH_EDGES, .detect_irq_pullup = EINT_PULLUP_DIS, .sdi_gpio_cd = SD_GPIO_CD, .sdi_clock = CLKCON_SD, .slot_is_empty = mmc_s3c2410_slot_is_empty};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -