/* * Note: the function does not clear the masks before filling them. * * Return value: * 0: success * -EINVAL: invalid id in <req> array */ static int msm_rpm_fill_sel_masks( uint32_t *sel_masks, struct msm_rpm_iv_pair *req, int count) { uint32_t sel; int i; for (i = 0; i < count; i++) { sel = msm_rpm_map_id_to_sel(req[i].id); if (sel > MSM_RPM_SEL_LAST) return -EINVAL; sel_masks[msm_rpm_get_sel_mask_reg(sel)] |= msm_rpm_get_sel_mask(sel); } return 0; }
/* * Note: the function does not clear the masks before filling them. * * Return value: * 0: success * -EINVAL: invalid id in <req> array */ static int msm_rpm_fill_sel_masks( uint32_t *sel_masks, struct msm_rpm_iv_pair *req, int count) { uint32_t sel; int i; for (i = 0; i < count; i++) { sel = msm_rpm_map_id_to_sel(req[i].id); if (sel > msm_rpm_data.sel_last) { pr_err("%s(): RPM ID %d not defined for target\n", __func__, req[i].id); return -EINVAL; } sel_masks[msm_rpm_get_sel_mask_reg(sel)] |= msm_rpm_get_sel_mask(sel); } return 0; }