/* Checks if the provided clock is the MPU clock or not, if not, return immediately. If MPU clock is provided, maps the provided MPU frequency towards an MPU OPP, and programs the voltage to the regulator. Return 0 on success, negative error value on failure.  */
int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq)
/* Checks if the provided clock is the MPU clock or not, if not, return immediately. If MPU clock is provided, maps the provided MPU frequency towards an MPU OPP, and programs the voltage to the regulator. Return 0 on success, negative error value on failure.  */
int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq)
{
	int opp_id;
	struct k3_avs_privdata *priv = k3_avs_priv;
	struct vd_data *vd;
	for (vd = priv->vd_config->vds; vd->id >= 0; vd++) {
		if (vd->dev_id != dev_id || vd->clk_id != clk_id)
			continue;
		opp_id = match_opp(vd, freq);
		if (opp_id < 0)
			return opp_id;
		vd->opp = opp_id;
		return k3_avs_program_voltage(priv, vd, opp_id);
	}
	return -EINVAL;
}