/* This function (re)sets the GTM timer so that it counts up to the requested interval value, and fires the interrupt when the value is reached. This function will reduce the precision of the timer as needed in order for the requested timeout to fit in a 16-bit register.  */
int gtm_set_timer16(struct gtm_timer *tmr, unsigned long usec, bool reload)
/* This function (re)sets the GTM timer so that it counts up to the requested interval value, and fires the interrupt when the value is reached. This function will reduce the precision of the timer as needed in order for the requested timeout to fit in a 16-bit register.  */
int gtm_set_timer16(struct gtm_timer *tmr, unsigned long usec, bool reload)
{
	int freq = 1000000;
	unsigned int bit;
	bit = fls_long(usec);
	if (bit > 15) {
		freq >>= bit - 15;
		usec >>= bit - 15;
	}
	if (!freq)
		return -EINVAL;
	return gtm_set_ref_timer16(tmr, freq, usec, reload);
}