i am using msecs_to_jiffies(msecs) to get delay. I need a delay of 16 ms. But the problem is the function return 1 for input 1-10, 2 for 11-20, 3 for 21-30 and son on. Hence i am unable to set proper delay. I can set delay only in factors of 10 ms. I can't change the HZ value and the function cant sleep also.
Kindly suggest solution to this problem. Thanks
It seems your system HZ value is set to 100.
If you wish to suspend execution for a period of time in a resolution lower then the system HZ, you need to use high resolution timers (which use nsec resolution, not jiffies) supported in your board and enabled in the kernel. See here for the interface of how to use them: http://lwn.net/Articles/167897/
So, either change the system HZ to 1000 and get a jiffie resolution of 1 msec or use a high resolution timer.