blob: e774227992528a00087bd5fbb0fc6585b0c9ab56 [file] [log] [blame]
Arthur Heymans960e2392026-03-03 19:45:24 +01001--
2-- Copyright (C) 2026 Arthur Heymans <arthur@aheymans.xyz>
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; either version 2 of the License, or
7-- (at your option) any later version.
8--
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.GMCH.VGA;
18with HW.GFX.GMA.GMCH.LVDS;
19
20with HW.Debug;
21with GNAT.Source_Info;
22
23package body HW.GFX.GMA.Connectors
24is
25
26 procedure Post_Reset_Off is null;
27 procedure Initialize is null;
28
29 ----------------------------------------------------------------------------
30
31 procedure Pre_On
32 (Pipe : in Pipe_Index;
33 Port_Cfg : in Port_Config;
34 PLL_Hint : in Word32;
35 Success : out Boolean)
36 is
37 begin
38 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
39 Success := True;
40 end Pre_On;
41
42 procedure Post_On
43 (Pipe : in Pipe_Index;
44 Port_Cfg : in Port_Config;
45 PLL_Hint : in Word32;
46 Success : out Boolean)
47 is
48 begin
49 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
50 Success := True;
51 if Port_Cfg.Port = LVDS then
52 GMCH.LVDS.On (Port_Cfg, Pipe);
53 elsif Port_Cfg.Port = VGA then
54 GMCH.VGA.On (Pipe, Port_Cfg.Mode);
55 end if;
56
57 Panel.On (Port_Cfg.Panel, Wait => False);
58 Panel.Backlight_On (Port_Cfg.Panel);
59 end Post_On;
60
61 ----------------------------------------------------------------------------
62
63 procedure Pre_Off (Port_Cfg : Port_Config)
64 is
65 begin
66 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
67
68 Panel.Backlight_Off (Port_Cfg.Panel);
69 Panel.Off (Port_Cfg.Panel);
70 end Pre_Off;
71
72 procedure Post_Off (Port_Cfg : Port_Config)
73 is
74 begin
75 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
76 if Port_Cfg.Port = LVDS then
77 GMCH.LVDS.Off;
78 elsif Port_Cfg.Port = VGA then
79 GMCH.VGA.Off;
80 end if;
81 end Post_Off;
82
83 ----------------------------------------------------------------------------
84
85 procedure Pre_All_Off
86 is
87 begin
88 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
89
90 for P in Valid_Panels loop
91 Panel.Backlight_Off (P);
92 Panel.Off (P);
93 end loop;
94 end Pre_All_Off;
95
96 procedure Post_All_Off
97 is
98 begin
99 pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
100 GMCH.LVDS.Off;
101 GMCH.VGA.Off;
102 end Post_All_Off;
103
104end HW.GFX.GMA.Connectors;