blob: e81322e13b8068221eef180299907b434da744b9 [file] [log] [blame]
Nico Huber83693c82016-10-08 22:17:55 +02001--
Nico Huber01b680f2017-06-09 16:24:22 +02002-- Copyright (C) 2015-2017 secunet Security Networks AG
Nico Huber83693c82016-10-08 22:17:55 +02003--
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
Nico Huber3a0e2a02017-07-19 14:41:46 +020024 procedure Post_Reset_Off
25 is
26 begin
27 DDI.Post_Reset_Off;
28 end Post_Reset_Off;
29
Nico Huber0923b792017-06-09 15:28:41 +020030 procedure Initialize
31 is
32 begin
Nico Huber01b680f2017-06-09 16:24:22 +020033 DDI.Initialize;
Nico Huber0923b792017-06-09 15:28:41 +020034 end Initialize;
35
Nico Huber83693c82016-10-08 22:17:55 +020036 procedure Pre_On
Nico Huber6e327c92016-12-21 14:45:45 +010037 (Pipe : in Pipe_Index;
38 Port_Cfg : in Port_Config;
39 PLL_Hint : in Word32;
40 Success : out Boolean)
Nico Huber83693c82016-10-08 22:17:55 +020041 is
42 begin
43 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
Arthur Heymans5d08a932018-03-28 17:00:18 +020044 if Port_Cfg.Port in Digital_Port then
45 DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
46 else
47 Success := False; -- Should not happen
48 end if;
Nico Huber83693c82016-10-08 22:17:55 +020049 end Pre_On;
50
51 procedure Post_On
Arthur Heymans60d0e5f2018-03-28 17:08:27 +020052 (Pipe : in Pipe_Index;
53 Port_Cfg : in Port_Config;
Nico Huber83693c82016-10-08 22:17:55 +020054 PLL_Hint : in Word32;
55 Success : out Boolean)
56 is
57 begin
58 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
59
Arthur Heymans5d08a932018-03-28 17:00:18 +020060 if Port_Cfg.Port in Digital_Port then
61 DDI.Post_On (Port_Cfg);
Nico Huber83693c82016-10-08 22:17:55 +020062
Nico Huber2bbd6e72020-01-07 18:22:59 +010063 Panel.Backlight_On (Port_Cfg.Panel);
Arthur Heymans5d08a932018-03-28 17:00:18 +020064 Success := True;
65 else
66 Success := False; -- Should not happen
Nico Huber83693c82016-10-08 22:17:55 +020067 end if;
Nico Huber83693c82016-10-08 22:17:55 +020068 end Post_On;
69
70 ----------------------------------------------------------------------------
71
72 procedure Pre_Off (Port_Cfg : Port_Config)
73 is
74 begin
75 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
76
Nico Huber2bbd6e72020-01-07 18:22:59 +010077 Panel.Backlight_Off (Port_Cfg.Panel);
78 Panel.Off (Port_Cfg.Panel);
Nico Huber83693c82016-10-08 22:17:55 +020079 end Pre_Off;
80
81 procedure Post_Off (Port_Cfg : Port_Config)
82 is
83 begin
84 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
Arthur Heymans5d08a932018-03-28 17:00:18 +020085 if Port_Cfg.Port in Digital_Port then
86 DDI.Off (Port_Cfg.Port);
87 end if;
Nico Huber83693c82016-10-08 22:17:55 +020088 end Post_Off;
89
90 ----------------------------------------------------------------------------
91
92 procedure Pre_All_Off
93 is
94 begin
Nico Huber2bbd6e72020-01-07 18:22:59 +010095 for P in Valid_Panels loop
96 Panel.Backlight_Off (P);
97 Panel.Off (P);
98 end loop;
Nico Huber83693c82016-10-08 22:17:55 +020099 end Pre_All_Off;
100
101 procedure Post_All_Off
102 is
103 begin
Nico Huberac455ad2017-02-14 14:41:19 +0100104 for Port in Digital_Port range DIGI_A .. Config.Last_Digital_Port loop
Nico Huber83693c82016-10-08 22:17:55 +0200105 DDI.Off (Port);
106 end loop;
Nico Huber83693c82016-10-08 22:17:55 +0200107 end Post_All_Off;
108
109end HW.GFX.GMA.Connectors;