/* Description: calculate number of SCLK cycles to meet minimum timing  */
static unsigned short num_clocks_min(unsigned long tmin, unsigned long fsclk)
/* Description: calculate number of SCLK cycles to meet minimum timing  */
static unsigned short num_clocks_min(unsigned long tmin, unsigned long fsclk)
{
	unsigned long tmp ;
	unsigned short result;
	tmp = tmin * (fsclk/1000/1000) / 1000;
	result = (unsigned short)tmp;
	if ((tmp*1000*1000) < (tmin*(fsclk/1000))) {
		result++;
	}
	return result;
}