blob: ff689bbacc0ef68d9e5aea3750d6f6df47d3ac0c [file] [log] [blame]
Arthur Heymans73ea0322018-03-28 17:17:07 +02001--
2-- Copyright (C) 2015-2016 secunet Security Networks AG
3-- Copyright (C) 2016 Nico Huber <nico.h@gmx.de>
4--
5-- This program is free software; you can redistribute it and/or modify
6-- it under the terms of the GNU General Public License as published by
7-- the Free Software Foundation; either version 2 of the License, or
8-- (at your option) any later version.
9--
10-- This program is distributed in the hope that it will be useful,
11-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-- GNU General Public License for more details.
14--
15
16with HW.GFX.GMA.Config;
17with HW.GFX.GMA.Panel;
18with HW.GFX.GMA.GMCH.VGA;
19with HW.GFX.GMA.GMCH.LVDS;
20with HW.GFX.GMA.GMCH.HDMI;
21with HW.GFX.GMA.GMCH.DP;
22
23with HW.Debug;
24with GNAT.Source_Info;
25
26package body HW.GFX.GMA.Connectors
27is
28
29 procedure Post_Reset_Off is null;
30 procedure Initialize is null;
31
Arthur Heymans73ea0322018-03-28 17:17:07 +020032 ----------------------------------------------------------------------------
33
34 procedure Pre_On
35 (Pipe : in Pipe_Index;
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 Success := True;
43 end Pre_On;
44
45 procedure Post_On
46 (Pipe : in Pipe_Index;
47 Port_Cfg : in Port_Config;
48 PLL_Hint : in Word32;
49 Success : out Boolean)
50 is
51 begin
52 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
53 Success := True;
54 if Port_Cfg.Port = LVDS then
55 GMCH.LVDS.On (Port_Cfg, Pipe);
56 elsif Port_Cfg.Port = VGA then
57 GMCH.VGA.On (Pipe, Port_Cfg.Mode);
58 elsif Port_Cfg.Port in Digital_Port then
59 if Port_Cfg.Display = DP and Port_Cfg.Port in GMCH_DP_Port then
60 GMCH.DP.On (Port_Cfg, Pipe, Success);
61 elsif Port_Cfg.Display = HDMI and Port_Cfg.Port in GMCH_HDMI_Port then
62 GMCH.HDMI.On (Port_Cfg, Pipe);
63 end if;
64 end if;
65
Nico Huber2bbd6e72020-01-07 18:22:59 +010066 Panel.On (Port_Cfg.Panel, Wait => False);
67 Panel.Backlight_On (Port_Cfg.Panel);
Arthur Heymans73ea0322018-03-28 17:17:07 +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);
Arthur Heymans73ea0322018-03-28 17:17:07 +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));
85 if Port_Cfg.Port = LVDS then
86 GMCH.LVDS.Off;
87 elsif Port_Cfg.Port = VGA then
88 GMCH.VGA.Off;
89 elsif Port_Cfg.Display = DP and Port_Cfg.Port in GMCH_DP_Port then
90 GMCH.DP.Off (Port_Cfg.Port);
91 elsif Port_Cfg.Display = HDMI and Port_Cfg.Port in GMCH_HDMI_Port then
92 GMCH.HDMI.Off (Port_Cfg.Port);
93 end if;
94 end Post_Off;
95
96 ----------------------------------------------------------------------------
97
98 procedure Pre_All_Off
99 is
100 begin
101 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
102
Nico Huber2bbd6e72020-01-07 18:22:59 +0100103 for P in Valid_Panels loop
104 Panel.Backlight_Off (P);
105 Panel.Off (P);
106 end loop;
Arthur Heymans73ea0322018-03-28 17:17:07 +0200107 end Pre_All_Off;
108
109 procedure Post_All_Off
110 is
111 begin
112 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
113 GMCH.LVDS.Off;
114 GMCH.VGA.Off;
115 GMCH.DP.All_Off;
116 GMCH.HDMI.All_Off;
117 end Post_All_Off;
118
119end HW.GFX.GMA.Connectors;