blob: e53902b923a8504672e2812913a65ae1bde0bdee [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
6-- the Free Software Foundation; version 2 of the License.
7--
8-- This program is distributed in the hope that it will be useful,
9-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-- GNU General Public License for more details.
12--
13
14with HW.GFX.GMA.Config;
15with HW.GFX.GMA.Panel;
16with HW.GFX.GMA.Connectors.DDI;
17
18with HW.Debug;
19with GNAT.Source_Info;
20
21package body HW.GFX.GMA.Connectors is
22
23 procedure Pre_On
24 (Port_Cfg : in Port_Config;
25 PLL_Hint : in Word32;
26 Pipe_Hint : in Word32;
27 Success : out Boolean)
28 is
29 begin
30 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
31
32 DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
33 end Pre_On;
34
35 procedure Post_On
36 (Port_Cfg : in Port_Config;
37 PLL_Hint : in Word32;
38 Success : out Boolean)
39 is
40 begin
41 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
42
43 DDI.Post_On (Port_Cfg);
44
45 if Port_Cfg.Port = DIGI_A then
46 Panel.Backlight_On;
47 end if;
48
49 Success := True;
50 end Post_On;
51
52 ----------------------------------------------------------------------------
53
54 procedure Pre_Off (Port_Cfg : Port_Config)
55 is
56 begin
57 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
58
59 if Port_Cfg.Port = DIGI_A then
60 Panel.Backlight_Off;
61 Panel.Off;
62 end if;
63 end Pre_Off;
64
65 procedure Post_Off (Port_Cfg : Port_Config)
66 is
67 begin
68 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
69
70 DDI.Off (Port_Cfg.Port);
71 end Post_Off;
72
73 ----------------------------------------------------------------------------
74
75 procedure Pre_All_Off
76 is
77 begin
78 Panel.Backlight_Off;
79 Panel.Off;
80 end Pre_All_Off;
81
82 procedure Post_All_Off
83 is
84 begin
85 for Port in Digital_Port range DIGI_A .. DIGI_D loop
86 DDI.Off (Port);
87 end loop;
88 if Config.FDI_Port (DIGI_E) then
89 DDI.Off (DIGI_E);
90 end if;
91 end Post_All_Off;
92
93end HW.GFX.GMA.Connectors;