Epit interrupt on i.MX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Epit interrupt on i.MX6

2,496 Views
nluca
Contributor III

Hi all,

I'm developing in Linux on a custom board with i.MX6S.

Based on the i.MX6 Linux RM, I found the reference code for the Epit module at arch/arm/mach-imx/epit.c.

First question:

What does the __init keyword in front of epit_timer_init function? Is this function called at the kernel boot up, so I don't have to call it again within my code? Or do I have still to call it in my code?

Second question:

What I'm really trying to do is to take an action (e.g. change the value of a GPIO pin) once the Epit interrupt occurs, let's say every 25 ms. Is the function to modify the epit_timer_interrupt? How should i modify clockevent_epit to achieve my aim?

Thanks and best regards,

Luca

Labels (2)
Tags (3)
0 Kudos
Reply
2 Replies

1,407 Views
igorpadykov
NXP Employee
NXP Employee

HI Luca

I think one can put gpio code to function epit_timer_interrupt,

__init keyword tells compiler to handle these functions in special way

c - What does __init mean in the Linux kernel code? - Stack Overflow

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,407 Views
nluca
Contributor III

Hi Igor,

Actually the code at arch/arm/mach-imx/epit.c is not a module and is even not part of the Linux build. So I had to copy all that code into my code in order to declare and define the functions. The problem I have now is that once I try to insert my module and the following initialization code is called, I get the "i.MX epit: unable to get clk" error.


timer_clk = clk_get_sys("imx-epit.0", NULL);

  if (IS_ERR(timer_clk)) {

    pr_err("i.MX epit: unable to get clk\n");

    return;

  }

Any suggestion?

Thanks,

Luca

0 Kudos
Reply