blob: 15b3c1296a064de8aab69e4c2ec0ccacfe9e0325 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
2-- Copyright (C) 2015-2016 secunet Security Networks AG
3--
4-- This program is free software; you can redistribute it and/or modify
5-- it under the terms of the GNU General Public License as published by
Nico Huber125a29e2016-10-18 00:23:54 +02006-- the Free Software Foundation; either version 2 of the License, or
7-- (at your option) any later version.
Nico Huber83693c82016-10-08 22:17:55 +02008--
9-- This program is distributed in the hope that it will be useful,
10-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-- GNU General Public License for more details.
13--
14
15with HW.GFX.GMA.Config;
16with HW.GFX.GMA.Panel;
17with HW.GFX.GMA.Connectors.DDI;
18
19with HW.Debug;
20with GNAT.Source_Info;
21
22package body HW.GFX.GMA.Connectors is
23
24 procedure Pre_On
Nico Huber6e327c92016-12-21 14:45:45 +010025 (Pipe : in Pipe_Index;
26 Port_Cfg : in Port_Config;
27 PLL_Hint : in Word32;
28 Success : out Boolean)
Nico Huber83693c82016-10-08 22:17:55 +020029 is
30 begin
31 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
32
33 DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
34 end Pre_On;
35
36 procedure Post_On
37 (Port_Cfg : in Port_Config;
38 PLL_Hint : in Word32;
39 Success : out Boolean)
40 is
41 begin
42 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
43
44 DDI.Post_On (Port_Cfg);
45
46 if Port_Cfg.Port = DIGI_A then
47 Panel.Backlight_On;
48 end if;
49
50 Success := True;
51 end Post_On;
52
53 ----------------------------------------------------------------------------
54
55 procedure Pre_Off (Port_Cfg : Port_Config)
56 is
57 begin
58 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
59
60 if Port_Cfg.Port = DIGI_A then
61 Panel.Backlight_Off;
62 Panel.Off;
63 end if;
64 end Pre_Off;
65
66 procedure Post_Off (Port_Cfg : Port_Config)
67 is
68 begin
69 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
70
71 DDI.Off (Port_Cfg.Port);
72 end Post_Off;
73
74 ----------------------------------------------------------------------------
75
76 procedure Pre_All_Off
77 is
78 begin
79 Panel.Backlight_Off;
80 Panel.Off;
81 end Pre_All_Off;
82
83 procedure Post_All_Off
84 is
85 begin
86 for Port in Digital_Port range DIGI_A .. DIGI_D loop
87 DDI.Off (Port);
88 end loop;
Nico Huber3c544ee2016-11-20 04:56:58 +010089 if Config.Is_FDI_Port (Analog) then
Nico Huber83693c82016-10-08 22:17:55 +020090 DDI.Off (DIGI_E);
91 end if;
92 end Post_All_Off;
93
94end HW.GFX.GMA.Connectors;