/* ACPI 2.0 chapter 13 access of registers of the EC  */
static unsigned int amd_ec_wait_write(struct amd_smbus *smbus)
/* ACPI 2.0 chapter 13 access of registers of the EC  */
static unsigned int amd_ec_wait_write(struct amd_smbus *smbus)
{
	int timeout = 500;
	while ((inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_IBF) && --timeout)
		udelay(1);
	if (!timeout) {
		dev_warn(&smbus->dev->dev,
			 "Timeout while waiting for IBF to clear\n");
		return -ETIMEDOUT;
	}
	return 0;
}