|
@@ -48,8 +48,10 @@ static void sde_power_event_trigger_locked(struct sde_power_handle *phandle,
|
|
struct sde_power_event *event;
|
|
struct sde_power_event *event;
|
|
|
|
|
|
list_for_each_entry(event, &phandle->event_list, list) {
|
|
list_for_each_entry(event, &phandle->event_list, list) {
|
|
- if (event->event_type & event_type)
|
|
|
|
|
|
+ if (event->event_type & event_type) {
|
|
event->cb_fnc(event_type, event->usr);
|
|
event->cb_fnc(event_type, event->usr);
|
|
|
|
+ phandle->last_event_handled = event_type;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -768,6 +770,15 @@ int sde_power_clk_set_rate(struct sde_power_handle *phandle, char *clock_name,
|
|
pr_err("invalid input power handle\n");
|
|
pr_err("invalid input power handle\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ mutex_lock(&phandle->phandle_lock);
|
|
|
|
+ if (phandle->last_event_handled & SDE_POWER_EVENT_POST_DISABLE) {
|
|
|
|
+ pr_debug("invalid power state %u\n",
|
|
|
|
+ phandle->last_event_handled);
|
|
|
|
+ mutex_unlock(&phandle->phandle_lock);
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
|
|
+
|
|
mp = &phandle->mp;
|
|
mp = &phandle->mp;
|
|
|
|
|
|
for (i = 0; i < mp->num_clk; i++) {
|
|
for (i = 0; i < mp->num_clk; i++) {
|
|
@@ -781,6 +792,7 @@ int sde_power_clk_set_rate(struct sde_power_handle *phandle, char *clock_name,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ mutex_unlock(&phandle->phandle_lock);
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|