mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-17 02:21:15 +00:00
gma: Rework power handling in Update_Outputs()
We should also reevaluate power settings, when we only disabled pipes and didn't enable any new outputs. Change-Id: Ia81454bdeb770359b1d95e02f6f3d75e76584857 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/18121 Tested-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
@@ -201,8 +201,19 @@ is
|
||||
end if;
|
||||
end Check_HPD;
|
||||
|
||||
Did_Power_Up : Boolean := False;
|
||||
Power_Changed : Boolean := False;
|
||||
Old_Configs : Pipe_Configs;
|
||||
|
||||
-- Only called when we actually tried to change something
|
||||
-- so we don't congest the log with unnecessary messages.
|
||||
procedure Update_Power
|
||||
is
|
||||
begin
|
||||
if not Power_Changed then
|
||||
Power_And_Clocks.Power_Up (Old_Configs, Configs);
|
||||
Power_Changed := True;
|
||||
end if;
|
||||
end Update_Power;
|
||||
begin
|
||||
Old_Configs := Cur_Configs;
|
||||
|
||||
@@ -222,6 +233,7 @@ is
|
||||
then
|
||||
Disable_Output (Pipe, Cur_Config);
|
||||
Cur_Config.Port := Disabled;
|
||||
Update_Power;
|
||||
end if;
|
||||
end if;
|
||||
end;
|
||||
@@ -246,10 +258,7 @@ is
|
||||
end if;
|
||||
|
||||
if Success then
|
||||
if not Did_Power_Up then
|
||||
Power_And_Clocks.Power_Up (Old_Configs, Configs);
|
||||
Did_Power_Up := True;
|
||||
end if;
|
||||
Update_Power;
|
||||
Enable_Output (Pipe, New_Config, Success);
|
||||
end if;
|
||||
|
||||
@@ -267,7 +276,7 @@ is
|
||||
end;
|
||||
end loop;
|
||||
|
||||
if Did_Power_Up then
|
||||
if Power_Changed then
|
||||
Power_And_Clocks.Power_Down (Old_Configs, Configs, Cur_Configs);
|
||||
end if;
|
||||
end Update_Outputs;
|
||||
|
||||
Reference in New Issue
Block a user