/* bsec_power_safmem() - Activate or deactivate safmem power @base: base address of bsec IP @power: true to power up , false to power down Return: 0 if succeed  */
static int bsec_power_safmem(u32 base, bool power)
/* bsec_power_safmem() - Activate or deactivate safmem power @base: base address of bsec IP @power: true to power up , false to power down Return: 0 if succeed  */
static int bsec_power_safmem(u32 base, bool power)
{
	u32 val;
	u32 mask;
	if (power) {
		setbits_le32(base + BSEC_OTP_CONF_OFF, BSEC_CONF_POWER_UP);
		mask = BSEC_MODE_PWR_MASK;
	} else {
		clrbits_le32(base + BSEC_OTP_CONF_OFF, BSEC_CONF_POWER_UP);
		mask = 0;
	}
	return readl_poll_timeout(base + BSEC_OTP_STATUS_OFF,
				  val, (val & BSEC_MODE_PWR_MASK) == mask,
				  BSEC_TIMEOUT_US);
}