/* Calculate value to be loaded into the STP register for a given period in ns. Returns a value suitable for REG_STP.  */
static int fas216_syncperiod(FAS216_Info *info, int ns)
/* Calculate value to be loaded into the STP register for a given period in ns. Returns a value suitable for REG_STP.  */
static int fas216_syncperiod(FAS216_Info *info, int ns)
{
	int value = (info->ifcfg.clockrate * ns) / 1000;
	fas216_checkmagic(info);
	if (value < 4)
		value = 4;
	else if (value > 35)
		value = 35;
	return value & 31;
}