/* Calculate the new values for the banks in @iot based on the new frequency information in @cfg. This is then used by s3c2410_iotiming_set() to update the timing when necessary.  */
int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *iot)
/* Calculate the new values for the banks in @iot based on the new frequency information in @cfg. This is then used by s3c2410_iotiming_set() to update the timing when necessary.  */
int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *iot)
{
	struct s3c2410_iobank_timing *bt;
	unsigned long bankcon;
	int bank;
	int ret;
	for (bank = 0; bank < MAX_BANKS; bank++) {
		bankcon = __raw_readl(bank_reg(bank));
		bt = iot->bank[bank].io_2410;
		if (!bt)
			continue;
		bt->bankcon = bankcon;
		ret = s3c2410_calc_bank(cfg, bt);
		if (ret) {
			printk(KERN_ERR "%s: cannot calculate bank %d io\n",
			       __func__, bank);
			goto err;
		}
		s3c_freq_iodbg("%s: bank %d: con=%08lx\n",
			       __func__, bank, bt->bankcon);
	}
	return 0;
 err:
	return ret;
}