/* Set the watchdog time interval. Counter is 32 bit.  */
static int designware_wdt_settimeout(unsigned int timeout)
/* Set the watchdog time interval. Counter is 32 bit.  */
static int designware_wdt_settimeout(unsigned int timeout)
{
	signed int i;
	i = (log_2_n_round_up(timeout * CONFIG_DW_WDT_CLOCK_KHZ)) - 16;
	if (i > 15)
		i = 15;
	if (i < 0)
		i = 0;
	writel((i | (i << 4)), (CONFIG_DW_WDT_BASE + DW_WDT_TORR));
	return 0;
}