gma panel: Introduce `Panel_Control` type

For now, `Panel_Control` only distinguishes `Panel_1` from `No_Panel`,
i.e. if a port has a panel attached or not. To ease future addition of
support for more than one panel, we already add loops and arrays around
it, though.

With the information, if a port has a panel attached, in `Port_Config`,
we can pass that on into Panel.* procedures and let those decide what
to do (e.g. do nothing if no panel is attached).

Change-Id: I83864bc86b48f65d9ba43e083b805ca09497cbb0
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/38243
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/common/ironlake/hw-gfx-gma-connectors.adb b/common/ironlake/hw-gfx-gma-connectors.adb
index 21eca97..5970ea5 100644
--- a/common/ironlake/hw-gfx-gma-connectors.adb
+++ b/common/ironlake/hw-gfx-gma-connectors.adb
@@ -70,7 +70,7 @@
 
       if Port_Cfg.Port = DIGI_A then
          EDP.Pre_Training;
-         Panel.On (Wait => True);
+         Panel.On (Port_Cfg.Panel, Wait => True);
          EDP.Post_On (Port_Cfg.DP, Success);
       elsif Port_Cfg.Port in FDI.GPU_FDI_Port then
          declare
@@ -97,8 +97,8 @@
       end if;
 
       if Success and Is_Internal (Port_Cfg) then
-         Panel.On (Wait => False);
-         Panel.Backlight_On;
+         Panel.On (Port_Cfg.Panel, Wait => False);
+         Panel.Backlight_On (Port_Cfg.Panel);
       end if;
    end Post_On;
 
@@ -110,8 +110,8 @@
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
 
       if Is_Internal (Port_Cfg) then
-         Panel.Backlight_Off;
-         Panel.Off;
+         Panel.Backlight_Off (Port_Cfg.Panel);
+         Panel.Off (Port_Cfg.Panel);
       end if;
    end Pre_Off;
 
@@ -154,8 +154,10 @@
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
 
-      Panel.Backlight_Off;
-      Panel.Off;
+      for P in Valid_Panels loop
+         Panel.Backlight_Off (P);
+         Panel.Off (P);
+      end loop;
    end Pre_All_Off;
 
    procedure Post_All_Off