- 論壇徽章:
- 0
|
static struct resource s3c_rtc_resource[] = {
[0] = {
.start = S3C2410_PA_RTC, //IO設(shè)備的物理地址
.end = S3C2410_PA_RTC + 0xff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_RTC,
.end = IRQ_RTC,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_TICK,
.end = IRQ_TICK,
.flags = IORESOURCE_IRQ
}
};
struct resource *platform_get_resource(struct platform_device *dev, unsigned int type,
unsigned int num)
{
int i;
for (i = 0; i < dev->num_resources; i++) { //num_resource 的個數(shù)
struct resource *r = &dev->resource[ i ]; //resource[ i ]應(yīng)該s3c2410_rtc_resource是通過下標(biāo)來對resource賦值
if ((r->flags & (IORESOURCE_IO|IORESOURCE_MEM|
IORESOURCE_IRQ|IORESOURCE_DMA))
== type)
if (num-- == 0)//控制循環(huán)
return r;
}
return NULL;
}
set_irq()傳入了個type.
擦了我提的現(xiàn)在挺讓我含羞的問題,得到的指導(dǎo)及結(jié)果從新編輯回本頁了,所有結(jié)果都在本頁了,感謝rock1972!
[ 本帖最后由 jn200002 于 2008-6-12 17:45 編輯 ] |
|