/* This function reserves GTM timer for later use. It returns gtm_timer structure to use with the rest of GTM API, you should use timer->irq to manage timer interrupt.  */
struct gtm_timer* gtm_get_specific_timer16(struct gtm *gtm, unsigned int timer)
/* This function reserves GTM timer for later use. It returns gtm_timer structure to use with the rest of GTM API, you should use timer->irq to manage timer interrupt.  */
struct gtm_timer* gtm_get_specific_timer16(struct gtm *gtm, unsigned int timer)
{
	struct gtm_timer *ret = ERR_PTR(-EBUSY);
	if (timer > 3)
		return ERR_PTR(-EINVAL);
	spin_lock_irq(&gtm->lock);
	if (gtm->timers[timer].requested)
		goto out;
	ret = &gtm->timers[timer];
	ret->requested = true;
out:
	spin_unlock_irq(&gtm->lock);
	return ret;
}