Linux设备驱动程序架构分析之MMC/SD(二)
作者:刘昊昱
发布日期:2015-04-29
宏DEFINE_RES_MEM定义在include/linux/ioport.h文件中:
宏DEFINE_RES_IRQ宏定义在include/linux/ioport.h文件中:
宏S3C24XX_PA_SDI定义在arch/arm/mach-s3c24xx/include/mach/map.h文件中:
宏S3C2410_PA_SDI定义在arch/arm/mach-s3c24xx/include/mach/map.h文件中:
0x5A000000是S3C2440 SDICON寄存器的地址。
宏S3C24XX_SZ_SDI定义在arch/arm/mach-s3c24xx/include/mach/map.h文件中:
宏SZ_1M定义在include/linux/sizes.h文件中:
宏IRQ_SDI定义在arch/arm/mach-s3c24xx/include/mach/irqs.h文件中:
至此,我们知道了Mini2440的platform_device s3c_device_sdi的定义,下面就是要注册这个平台设备,在arch/arm/mach-s3c24xx/mach-mini2440.c文件中:
platform_add_devices定义在drivers/base/platform.c文件中:
149行,通过调用platform_device_register完成对平台设备的注册,其中包括s3c_device_sdi。