这些函数都是基于2.6.24.4内核。
1、
platform_get_resource
出处 drivers/base/platform.c
原型
struct resource *
platform_get_resource(struct platform_device *dev, unsigned int type,
unsigned int num)
platform_get_resource(struct platform_device *dev, unsigned int type,
unsigned int num)
说明:
/**
* platform_get_resource - get a resource for a device
* @dev: platform device
* @type: resource type
* @num: resource index
*/
* platform_get_resource - get a resource for a device
* @dev: platform device
* @type: resource type
* @num: resource index
*/
2、
request_mem_region
出处 include/linux/ioport.h
原型 #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
kernel/resource.c中有如下函数:
/**
* __request_region - create a new busy resource region
* @parent: parent resource descriptor
* @start: resource start address
* @n: resource region size
* @name: reserving caller's ID string
*/
struct resource * __request_region(struct resource *parent,
resource_size_t start, resource_size_t n,
const char *name)
* __request_region - create a new busy resource region
* @parent: parent resource descriptor
* @start: resource start address
* @n: resource region size
* @name: reserving caller's ID string
*/
struct resource * __request_region(struct resource *parent,
resource_size_t start, resource_size_t n,
const char *name)
3、
request_region
出处 include/linux/ioport.h
原型 #define release_region(start,n) __release_region(&ioport_resource, (start), (n))
4、
ioremap及其相关函数
#define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
#define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
#define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
#define iounmap(cookie) __iounmap(cookie)
#define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
#define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
#define iounmap(cookie) __iounmap(cookie)
出处 include/asm-arm/io.h
__arm_ioremap的定义位于arch/arm/mm/ioremap.h中
void __iomem *
__arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
__arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
5、
clk_get
出处 arch/arm/plat-s3c24xx/clock.h
原型 struct clk *clk_get(struct device *dev, const char *id)
6、
clk_enable clk_disable
出处 arch/arm/plat-s3c24xx/clock.h
原型 int clk_enable(struct clk *clk) void clk_disable(struct clk *clk)