I.MX6 SD卡热插拔的识别过程

3 篇文章 0 订阅

前言

内核版本:3.0,35


识别流程

**arch/arm/mach-mx6/board-mx6q_sabresd.c **

	imx6q_add_sdhci_usdhc_imx(2, &mx6q_sabresd_sd3_data);
		static const struct esdhc_platform_data mx6q_sabresd_sd3_data __initconst = {                                                                                       
		    .cd_gpio = SABRESD_SD3_CD,
		    //.wp_gpio = SABRESD_SD3_WP,
		    .wp_gpio = -EINVAL,
		    .keep_power_at_suspend = 1,
		    .support_8bit = 0,
		    .delay_line = 0,
		    .cd_type = ESDHC_CD_GPIO,
		    .runtime_pm = 1,
		};
#define SABRESD_SD3_CD      IMX_GPIO_NR(7, 1)	

需要将cd_gpio配置成GPIO模式

 arch/arm/mach-mx6/board-mx6q_sabresd.h
		MX6Q_PAD_SD3_DAT4__GPIO_7_1,            /* SD3_CD */
    流程:
            mmc/host/sdhci-esdhc-imx.c		//插入SD卡 就会触发中断cd_irq
                esdhc_pltfm_init()->request_irq(gpio_to_irq(boarddata->cd_gpio), cd_irq.....)-> cd_irq()->tasklet_schedule(&sdhost->card_tasklet)
            mmc/host/sdhci.c
                tasklet_init(&host->card_tasklet,sdhci_tasklet_card, (unsigned long)host) -> sdhci_tasklet_card() -> mmc_detect_change()
            mmc/core/core.c
                mmc_detect_change() -> mmc_schedule_delayed_work(&host->detect, delay)
            mmc/core/host.c
                mmc_alloc_host()-> INIT_DELAYED_WORK(&host->detect, mmc_rescan)
            mmc/core/core.c
                mmc_rescan()-> mmc_rescan_try_freq()-> mmc_attach_sd(host)
            mmc/core/sd.c
                mmc_attach_sd()->mmc_add_card()
            mmc/core/bus.c
                mmc_add_card()-> printk(KERN_INFO "%s: new %s%s%s card at address %04x\n"
                                mmc1: new high speed SDHC card at address 0001

android 自动挂载

device/fsl/sabresd_6dq/fstab.freescale

/devices/platform/sdhci-esdhc-imx.2/mmc_host/mmc1 /mnt/media_rw/extsd exfat defaults voldmanaged=extsd:auto
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值