| Arthur Heymans | 960e239 | 2026-03-03 19:45:24 +0100 | [diff] [blame] | 1 | -- |
| 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 | |
| 15 | with HW.GFX.GMA.Config; |
| 16 | with HW.GFX.GMA.Panel; |
| 17 | with HW.GFX.GMA.GMCH.VGA; |
| 18 | with HW.GFX.GMA.GMCH.LVDS; |
| 19 | |
| 20 | with HW.Debug; |
| 21 | with GNAT.Source_Info; |
| 22 | |
| 23 | package body HW.GFX.GMA.Connectors |
| 24 | is |
| 25 | |
| 26 | procedure Post_Reset_Off is null; |
| 27 | procedure Initialize is null; |
| 28 | |
| 29 | ---------------------------------------------------------------------------- |
| 30 | |
| Nico Huber | a825448 | 2024-07-03 12:23:00 +0200 | [diff] [blame] | 31 | procedure Prepare |
| 32 | (Port : in Active_Port_Type; |
| 33 | Port_Cfg : in out Port_Config; |
| 34 | Success : out Boolean) |
| 35 | is |
| 36 | begin |
| 37 | Success := True; |
| 38 | end Prepare; |
| 39 | |
| 40 | ---------------------------------------------------------------------------- |
| 41 | |
| Arthur Heymans | 960e239 | 2026-03-03 19:45:24 +0100 | [diff] [blame] | 42 | procedure Pre_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 | end Pre_On; |
| 52 | |
| 53 | procedure Post_On |
| 54 | (Pipe : in Pipe_Index; |
| 55 | Port_Cfg : in Port_Config; |
| 56 | PLL_Hint : in Word32; |
| 57 | Success : out Boolean) |
| 58 | is |
| 59 | begin |
| 60 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 61 | Success := True; |
| 62 | if Port_Cfg.Port = LVDS then |
| 63 | GMCH.LVDS.On (Port_Cfg, Pipe); |
| 64 | elsif Port_Cfg.Port = VGA then |
| 65 | GMCH.VGA.On (Pipe, Port_Cfg.Mode); |
| 66 | end if; |
| 67 | |
| 68 | Panel.On (Port_Cfg.Panel, Wait => False); |
| 69 | Panel.Backlight_On (Port_Cfg.Panel); |
| 70 | end Post_On; |
| 71 | |
| 72 | ---------------------------------------------------------------------------- |
| 73 | |
| 74 | procedure Pre_Off (Port_Cfg : Port_Config) |
| 75 | is |
| 76 | begin |
| 77 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 78 | |
| 79 | Panel.Backlight_Off (Port_Cfg.Panel); |
| 80 | Panel.Off (Port_Cfg.Panel); |
| 81 | end Pre_Off; |
| 82 | |
| 83 | procedure Post_Off (Port_Cfg : Port_Config) |
| 84 | is |
| 85 | begin |
| 86 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 87 | if Port_Cfg.Port = LVDS then |
| 88 | GMCH.LVDS.Off; |
| 89 | elsif Port_Cfg.Port = VGA then |
| 90 | GMCH.VGA.Off; |
| 91 | end if; |
| 92 | end Post_Off; |
| 93 | |
| 94 | ---------------------------------------------------------------------------- |
| 95 | |
| 96 | procedure Pre_All_Off |
| 97 | is |
| 98 | begin |
| 99 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 100 | |
| 101 | for P in Valid_Panels loop |
| 102 | Panel.Backlight_Off (P); |
| 103 | Panel.Off (P); |
| 104 | end loop; |
| 105 | end Pre_All_Off; |
| 106 | |
| 107 | procedure Post_All_Off |
| 108 | is |
| 109 | begin |
| 110 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 111 | GMCH.LVDS.Off; |
| 112 | GMCH.VGA.Off; |
| 113 | end Post_All_Off; |
| 114 | |
| 115 | end HW.GFX.GMA.Connectors; |