gpio interrupt of omap beagle board

Hello,

I put the Ethernet network device on Omap beagle board, which runs
Linux 2.6.22.18.
I want to use GPIO 17 as an interrupt source from the network device.
I added the code in probe function of the network device as
followings;
ks8851_probe()
{
#define GPIO17 17
        u32 irq;
        omap_request_gpio( GPIO17 );
        irq = gpio_to_irq( GPIO17 );
        gpio_direction_input( GPIO17 );
        request_irq(lp->irq,
ks8851_interrupt,IRQF_TRIGGER_LOW,"ks8851isr", dev);
        :
        (omitted)

}

After compile the Linux kernel including the code above, I loaded the
new kernel on the omap beagle board.

When the kenel starts to work, there is endless interrupt

Rdx,
David J. Choi

2.6.22 is so 3 years ago

Hello Koen,

I am sorry for late response but I have been out-of country until yesterday.

I have the omap beagle board source tree. But I can not catch you. Please give me more detail information.
Again sorry and thank you for your help in advance.

Regards,
David J. Choi

2009/8/17 Koen Kooi <koen@beagleboard.org>

Hello Koen,

Last night, I found the solution. Here is my solution.

ks8851_probe()
{
#define GPIO17 17
#define CONTROL_PADCONF_ETK_D2 (void __iomem *)0x480025E0

u32 u,irq;

u32 u;
//set GPIO 17 as a input, GPIO_17 is bit 17 in the register

//Set PAD pull up/down enable, pull up mode for GPIO17, input enable

u=__raw_readl(IO_ADDRESS(CONTROL_PADCONF_ETK_D2));
u= u & (~(0x7<<16)); //clean bit 16,17,18
u = u | (0x04<<16); // set mode 4
u = u | ( 0x100 << 16 ); //input enable
__raw_writel(u,IO_ADDRESS(CONTROL_PADCONF_ETK_D2));

omap_request_gpio( GPIO17 );
irq = gpio_to_irq( GPIO17 ); //
gpio_direction_input( GPIO17 );
request_irq(irq,ks8851_interrupt,IRQF_TRIGGER_LOW,“ks8851isr”, dev); //LOW Level trigger

:
(omitted)

}

Regards,
David J. Choi

    u=\_\_raw\_readl\(IO\_ADDRESS\(CONTROL\_PADCONF\_ETK\_D2\)\);

David,

Can you point me to the include files where IO_ADDRESS is defined,
and some docs on __raw_readl and similar routines? I've been looking
all over, and am not up to speed yet on how to find things yet.

Thanks,

Jon

From: beagleboard@googlegroups.com
[mailto:beagleboard@googlegroups.com] On Behalf Of jmelson
Sent: Saturday, August 29, 2009 8:23 PM
To: Beagle Board
Subject: [beagleboard] Re: gpio interrupt of omap beagle board

> u=__raw_readl(IO_ADDRESS(CONTROL_PADCONF_ETK_D2));
David,

Can you point me to the include files where IO_ADDRESS is defined,
and some docs on __raw_readl and similar routines? I've been looking
all over, and am not up to speed yet on how to find things yet.

If you are getting the kernel source using GIT, then you can find anything
you want by doing
git grep IO_ADDRESS

Dear,
Thanks for your message.
I'm tried the PAD Control and success.