所以后续就可以通过读取 mmc_host->slot.handler_priv->cd_gpio的电平状态来判断当前card的插入状态。 1. 通过GPIO获取当前sd card的插入状态 在上述通过mmc_gpiod_request_cd_irq注册完成cd gpio之后,就可以通过mmc_gpio_get_cd来获取card的插入状态。当其返回1时,表示当前有card插入,当其返回0是,表示...
return mmc_gpio_get_cd(host->mmc); }static int omap_hsmmc_enable_supply(struct mmc_host *mmc) { int ret; @@ -467,29 +457,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) return 0; }static int omap_hsmmc_gpio_init(struct mmc_host *mmc,...
//配置控制器的函数.get_ro = s3cmci_get_ro,//判断是否写保护,其实就是读写保护的gpio.get_cd = s3cmci_card_present,//判断是否卡存在,其实就是读卡侦测的gpio.enable_sdio_irq = s3cmci_enable_sdio_irq,//和sdio相关,暂时忽略};
card layer与Linux的块设备子系统对接,实现块设备驱动以及完成请求,具体协议经过core layer的接口,最终通过host layer完成传输,对 MMC设备进行实际的操作。和 MMC设备硬件相对应,host和card可以分别理解为 MMC device的两个子设备:MMC主设备和MMC从设备,其中host为集成于MMC设备内部的MMC controller,card为MMC设备内部实...
.get_cd = sunxi_mmc_gpio_get_cd, .enable_sdio_irq = sunxi_mmc_enable_sdio_irq, .hw_reset = sunxi_mmc_hw_reset, .start_signal_voltage_switch = sunxi_mmc_signal_voltage_switch, .card_busy = sunxi_mmc_card_busy, }; 1. 2.
第一组 pin 脚的 GPIO 配置 bus-width bus-width cd-gpios 卡检测的 GPIO 配置 non-removable 不可移除 broken-cd sd 卡检测方式:轮训 cd-inverted 卡检测的高电平有效还是低电平有效 data3-detect data3 线检测卡 cap-sd-highspeed SD 卡的 High speed sd-uhs-sdr50 SD 卡的 uhs-sdr50 sd-uhs-ddr...
当卡插入时,产生中断,就会调用中断处理函数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; ...
probe最重要的作用是host的注册,那么首先必须构造出一个host,这个host就是通过mmc_alloc_host函数来构造出来的,初始化host的时钟,设置host的gpio等等其他参数初始化,最后通过mmc_add_host函数来注册host,下面看下这两个函数的具体内容。 1.mmc_alloc_host ...
{cd_cap_invert=of_property_read_bool(np,"cd-inverted");if(of_property_read_bool(np,"broken-cd"))host->caps|=MMC_CAP_NEEDS_POLL;ret=mmc_gpiod_request_cd(host,"cd",0,true,0,&cd_gpio_invert);if(!ret)dev_info(host->parent,"Got CD GPIO\n");elseif(ret!=-ENOENT&&ret!=-ENO...
.gpio_cd = -EINVAL, //GPIO_TO_PIN(2, 2); .gpio_wp = -EINVAL, //GPIO_TO_PIN(1, 29); .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,// | MMC_VDD_165_195, } 问题:Kernel能识别iNAND(启动伴随与此相关的警告),但进入文件系统,/dev下没有该设备 ...