| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 1 | -- |
| Nico Huber | 01b680f | 2017-06-09 16:24:22 +0200 | [diff] [blame] | 2 | -- Copyright (C) 2015-2017 secunet Security Networks AG |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 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 |
| Nico Huber | 125a29e | 2016-10-18 00:23:54 +0200 | [diff] [blame] | 6 | -- the Free Software Foundation; either version 2 of the License, or |
| 7 | -- (at your option) any later version. |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 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.Connectors.DDI; |
| 18 | |
| 19 | with HW.Debug; |
| 20 | with GNAT.Source_Info; |
| 21 | |
| 22 | package body HW.GFX.GMA.Connectors is |
| 23 | |
| Nico Huber | 3a0e2a0 | 2017-07-19 14:41:46 +0200 | [diff] [blame] | 24 | procedure Post_Reset_Off |
| 25 | is |
| 26 | begin |
| 27 | DDI.Post_Reset_Off; |
| 28 | end Post_Reset_Off; |
| 29 | |
| Nico Huber | 0923b79 | 2017-06-09 15:28:41 +0200 | [diff] [blame] | 30 | procedure Initialize |
| 31 | is |
| 32 | begin |
| Nico Huber | 01b680f | 2017-06-09 16:24:22 +0200 | [diff] [blame] | 33 | DDI.Initialize; |
| Nico Huber | 0923b79 | 2017-06-09 15:28:41 +0200 | [diff] [blame] | 34 | end Initialize; |
| 35 | |
| Nico Huber | a825448 | 2024-07-03 12:23:00 +0200 | [diff] [blame] | 36 | ---------------------------------------------------------------------------- |
| 37 | |
| 38 | procedure Prepare |
| 39 | (Port : in Active_Port_Type; |
| 40 | Port_Cfg : in out Port_Config; |
| 41 | Success : out Boolean) |
| 42 | is |
| 43 | begin |
| 44 | Success := True; |
| 45 | end Prepare; |
| 46 | |
| 47 | ---------------------------------------------------------------------------- |
| 48 | |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 49 | procedure Pre_On |
| Nico Huber | 6e327c9 | 2016-12-21 14:45:45 +0100 | [diff] [blame] | 50 | (Pipe : in Pipe_Index; |
| 51 | Port_Cfg : in Port_Config; |
| 52 | PLL_Hint : in Word32; |
| 53 | Success : out Boolean) |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 54 | is |
| 55 | begin |
| 56 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| Arthur Heymans | 5d08a93 | 2018-03-28 17:00:18 +0200 | [diff] [blame] | 57 | if Port_Cfg.Port in Digital_Port then |
| 58 | DDI.Pre_On (Port_Cfg, PLL_Hint, Success); |
| 59 | else |
| 60 | Success := False; -- Should not happen |
| 61 | end if; |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 62 | end Pre_On; |
| 63 | |
| 64 | procedure Post_On |
| Arthur Heymans | 60d0e5f | 2018-03-28 17:08:27 +0200 | [diff] [blame] | 65 | (Pipe : in Pipe_Index; |
| 66 | Port_Cfg : in Port_Config; |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 67 | PLL_Hint : in Word32; |
| 68 | Success : out Boolean) |
| 69 | is |
| 70 | begin |
| 71 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 72 | |
| Arthur Heymans | 5d08a93 | 2018-03-28 17:00:18 +0200 | [diff] [blame] | 73 | if Port_Cfg.Port in Digital_Port then |
| 74 | DDI.Post_On (Port_Cfg); |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 75 | |
| Nico Huber | 2bbd6e7 | 2020-01-07 18:22:59 +0100 | [diff] [blame] | 76 | Panel.Backlight_On (Port_Cfg.Panel); |
| Arthur Heymans | 5d08a93 | 2018-03-28 17:00:18 +0200 | [diff] [blame] | 77 | Success := True; |
| 78 | else |
| 79 | Success := False; -- Should not happen |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 80 | end if; |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 81 | end Post_On; |
| 82 | |
| 83 | ---------------------------------------------------------------------------- |
| 84 | |
| 85 | procedure Pre_Off (Port_Cfg : Port_Config) |
| 86 | is |
| 87 | begin |
| 88 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 89 | |
| Nico Huber | 2bbd6e7 | 2020-01-07 18:22:59 +0100 | [diff] [blame] | 90 | Panel.Backlight_Off (Port_Cfg.Panel); |
| 91 | Panel.Off (Port_Cfg.Panel); |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 92 | end Pre_Off; |
| 93 | |
| 94 | procedure Post_Off (Port_Cfg : Port_Config) |
| 95 | is |
| 96 | begin |
| 97 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| Arthur Heymans | 5d08a93 | 2018-03-28 17:00:18 +0200 | [diff] [blame] | 98 | if Port_Cfg.Port in Digital_Port then |
| 99 | DDI.Off (Port_Cfg.Port); |
| 100 | end if; |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 101 | end Post_Off; |
| 102 | |
| 103 | ---------------------------------------------------------------------------- |
| 104 | |
| 105 | procedure Pre_All_Off |
| 106 | is |
| 107 | begin |
| Nico Huber | 2bbd6e7 | 2020-01-07 18:22:59 +0100 | [diff] [blame] | 108 | for P in Valid_Panels loop |
| 109 | Panel.Backlight_Off (P); |
| 110 | Panel.Off (P); |
| 111 | end loop; |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 112 | end Pre_All_Off; |
| 113 | |
| 114 | procedure Post_All_Off |
| 115 | is |
| 116 | begin |
| Nico Huber | ac455ad | 2017-02-14 14:41:19 +0100 | [diff] [blame] | 117 | for Port in Digital_Port range DIGI_A .. Config.Last_Digital_Port loop |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 118 | DDI.Off (Port); |
| 119 | end loop; |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 120 | end Post_All_Off; |
| 121 | |
| 122 | end HW.GFX.GMA.Connectors; |