This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1808 GPIO IRQ interrupt definition

Other Parts Discussed in Thread: AM1808

Hi,

I am using LogicPD AM1808, linux-03.20.00.14 kernel. I am trying to registering my module using i2c interface. While defining my platform driver details, I have to configure my GPIO2_7 pin as interrupt irq handler.

I want to read the interrupt pin from I2C slave Keypad (INT) device to AM1808 GPIO pin(GPIO2_7).  While I am giving this statement it is giving error.

static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {

                {

                                I2C_BOARD_INFO("tps6507x", 0x48),

                                .platform_data = &tps_board,

                },

                {

                                I2C_BOARD_INFO(KEYPAD, 0x68),

                                .flags = I2C_CLIENT_WAKE,

                                .irq = gpio_to_irq(40), // GPIO2_7

                                .platform_data =&keypad_data,

                },

}

Instead of doing .irq = gpio_to_irq(40), Is there any way to define it. And what are the files need to be change.  Please give me your comments

 

Regards

Francis Kumar

 

  • Hello.

    gpio_to_irq() - is a function;

    static struct i2c_board_info __initdata da850_evm_i2c_devices[] ... - is a static struct definition with initialisation. This initialisation processing deu to compilation, in other words - not in run-time.  So you can not use a function.

    Try to pass initialisation of .irq field, somthing like .irq = -1, and init it later in run-time before platform_device_register call.