mmc core中的mmc_start_host调用mmc_gpiod_request_cd_irq来为host定义自己的cd-detect引脚,也就是对应上面连接到卡座上的CD引脚的GPIO。 mmc_gpiod_request_cd_irq具体实现如下: void mmc_gpiod_request_cd_irq(struct mmc_host *host) { // struct mmc_gpio用来表示连接卡槽的一些GPIO的状态 struc...
interr);void(*pre_req)(structmmc_host *,structmmc_request *,boolis_first_req);void(*request)(structmmc_host *host,structmmc_request *req);void(*set_ios)(structmmc_host *,structmmc_ios *);int(*get_ro)(structmmc_host *);int(*get_cd)(structmmc_host *);void(*enable_sdio_irq)(st...
mmc_gpiod_request_cd_irq(host); //core/slot-gpio.c _mmc_detect_change(host, 0, false); //core/core.c host->detect_change = 1; mmc_schedule_delayed_work(&host->detect, delay); //core/core.c queue_delayed_work(system_freezable_wq, work, delay); //include/linux/workqueue.h mmc_...
当卡插入时,产生中断,就会调用中断处理函数mmc_gpio_cd_irqt staticirqreturn_tmmc_gpio_cd_irqt(intirq,void*dev_id){/* Schedule a card detection after a debounce timeout */structmmc_host*host=dev_id;structmmc_gpio*ctx=host->slot.handler_priv; host->trigger_card_event =true; mmc_detect_cha...
mmc_gpiod_request_cd_irq(host); _mmc_detect_change(host, 0, false); } //此处开始mmc设备的探测,也就是说将host控制器添加到系统后,再探测host下挂的mmc static void _mmc_detect_change(struct mmc_host *host, unsigned long delay, bool cd_irq) ...
/* drivers/mmc/core/host.c *//* mmc_add_host - initialise host hardware */intmmc_add_host(structmmc_host*host){interr;WARN_ON((host->caps&MMC_CAP_SDIO_IRQ)&&!host->ops->enable_sdio_irq);err=device_add(&host->class_dev);if(err)returnerr;led_trigger_register_simple(dev_name(&ho...
.request = omap_hsmmc_request, .set_ios = omap_hsmmc_set_ios, .get_cd = omap_hsmmc_get_cd, .get_cd = mmc_gpio_get_cd, .get_ro = mmc_gpio_get_ro, .init_card = omap_hsmmc_init_card, .enable_sdio_irq = omap_hsmmc_enable_sdio_irq, ...
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts [ 0.000000] OMAP clockevent source: timer2 at 25000000 Hz [ 0.000034] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 85899345900ns [ 0.000082] clocksource timer1: mask: 0xffffffff max_cycles:...
struct resource *r, *dmarx, *dmatx; struct pxad_param param_rx, param_tx; int ret, irq, gpio_cd = -1, gpio_ro = -1, gpio_power = -1; dma_cap_mask_t mask;ret = pxamci_of_init(pdev); if (ret) @@ -671,7 +694,6 @@ static int pxamci_probe(struct platform_device *p...
int irq;/* Device IRQ */// sdhci的中断void__iomem*ioaddr;/* Mapped address */// sdhci寄存器的基地址conststruct sdhci_ops*ops;/* Low level hw interface */// 底层硬件的操作接口struct regulator*vmmc;/* Power regulator (vmmc) */// sdhci core的LDOstruct regulator*vqmmc;/* Signaling ...