|
From: David G. <dga...@gm...> - 2018-05-18 08:57:18
|
Hello! I'd like to add a delay function for nanoseconds for driver to use, similar to udelay() and mdelay(). The problem is that the count loop calculation takes probably the time the driver needs to wait or may be more in our machines. So I was thinking to use another approach, adding two functions, one than calculates the loops given a number of nanoseconds, getloops4ns( ), then in the loading part of the driver code the driver gets the loops for the delays it needs, for example if it needs 150 ns and 500 ns it will do: delay_150ns = getloops4ns(150) delay_500ns = getloops4ns(500) and then when the delay is need it, it will call the second function that loops directly. ndelay_loops(delay_150ns) ndelay_loops(delay_500ns) so we don't have the loop calculation overhead in the use moment. The ndelay() function still will be available. I've attached the patch for you to take a look in case you want to comment anything. |