I think i solve it using
static struct i2c_board_info __initdata inv_mpu_i2c2_board_info[] = {
{
I2C_BOARD_INFO("mpu9150", 0x69),
/*.irq = MPU_IRQ,*/
.platform_data = &mpu_gyro_data,
},
{
I2C_BOARD_INFO("ak8975", 0x0E),
.platform_data = &mpu_compass_data,
},
};
static void __init sun7i_init(void)
{
pr_info("%s: enter\n", __func__);
sw_pdev_init();
i2c_register_board_info(2, __rtc_i2c_board_info,
ARRAY_SIZE(__rtc_i2c_board_info));
inv_mpu_i2c2_board_info[0].irq = __gpio_to_irq(176);
i2c_register_board_info(2, inv_mpu_i2c2_board_info,
ARRAY_SIZE(inv_mpu_i2c2_board_info));
}
On Saturday, March 12, 2016 at 2:38:42 PM UTC+1, ION GROZEA wrote:
>
> Hi,
>
> Thank you for your reply.
> I forgot to mention thet the question is valid for A20.
>
> The only reference i can find is EINT0 for pin PH00, unfortunately i cant
> assign this value in the driver and the only clue i got so far is the use
> of gpio_to_irq function
> but this doesn't work or i don't know how to use it.
>
> On Saturday, March 12, 2016 at 1:48:55 PM UTC+1, Priit Laes wrote:
>>
>> On Sat, 2016-03-12 at 01:18 -0800, ION GROZEA wrote:
>> > Hello all,
>> >
>> > I am trying to add the MPU9150 driver in to kernel 3.4.39
>> >
>> > In the mach-sun71/core.c i have
>> >
>> > #define MPU_IRQ gpio_to_irq(176) - i need the IRQ for PH00
>> >
>> > static struct i2c_board_info __initdata inv_mpu_i2c2_board_info[] = {
>> > {
>> > I2C_BOARD_INFO("mpu9150", 0x69),
>> > .irq = MPU_IRQ,
>> > .platform_data = &mpu_gyro_data,
>> > },
>> > {
>> > I2C_BOARD_INFO("ak8975", 0x0E),
>> > .platform_data = &mpu_compass_data,
>> > },
>> > };
>> >
>> > the call of gpio_to_irq or __gpio_to_irq gives me the following error
>> >
>> > arch/arm/mach-sun7i/core.c:225:3: error: implicit declaration of
>> > function ‘gpio_to_irq’ [-Werror=implicit-function-declaration]
>> > arch/arm/mach-sun7i/core.c:225:3: error: initializer element is not
>> > constant
>> > arch/arm/mach-sun7i/core.c:225:3: error: (near initialization for
>> > ‘inv_mpu_i2c2_board_info[0].irq’)
>> > cc1: some warnings being treated as errors
>> >
>> > How can i find out the IRQ number for PH pins? (to avoid the use of
>> > gpio_to_irq function)
>>
>> This info is either in User Manuals (with errors) or in our wiki (for
>> example A20):
>>
>> https://linux-sunxi.org/A20/PIO
>>
>> >
>> > Thank you,
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "linux-sunxi" group.
>> > To unsubscribe from this group and stop receiving emails from it,
>> > send an email to [email protected].
>> > For more options, visit https://groups.google.com/d/optout.
>>
>
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.