| 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 | 0923b79 | 2017-06-09 15:28:41 +0200 | [diff] [blame] | 24 | procedure Initialize |
| 25 | is |
| 26 | begin |
| Nico Huber | 01b680f | 2017-06-09 16:24:22 +0200 | [diff] [blame] | 27 | DDI.Initialize; |
| Nico Huber | 0923b79 | 2017-06-09 15:28:41 +0200 | [diff] [blame] | 28 | end Initialize; |
| 29 | |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 30 | procedure Pre_On |
| Nico Huber | 6e327c9 | 2016-12-21 14:45:45 +0100 | [diff] [blame] | 31 | (Pipe : in Pipe_Index; |
| 32 | Port_Cfg : in Port_Config; |
| 33 | PLL_Hint : in Word32; |
| 34 | Success : out Boolean) |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 35 | is |
| 36 | begin |
| 37 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 38 | |
| 39 | DDI.Pre_On (Port_Cfg, PLL_Hint, Success); |
| 40 | end Pre_On; |
| 41 | |
| 42 | procedure Post_On |
| 43 | (Port_Cfg : in Port_Config; |
| 44 | PLL_Hint : in Word32; |
| 45 | Success : out Boolean) |
| 46 | is |
| 47 | begin |
| 48 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 49 | |
| 50 | DDI.Post_On (Port_Cfg); |
| 51 | |
| 52 | if Port_Cfg.Port = DIGI_A then |
| 53 | Panel.Backlight_On; |
| 54 | end if; |
| 55 | |
| 56 | Success := True; |
| 57 | end Post_On; |
| 58 | |
| 59 | ---------------------------------------------------------------------------- |
| 60 | |
| 61 | procedure Pre_Off (Port_Cfg : Port_Config) |
| 62 | is |
| 63 | begin |
| 64 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 65 | |
| 66 | if Port_Cfg.Port = DIGI_A then |
| 67 | Panel.Backlight_Off; |
| 68 | Panel.Off; |
| 69 | end if; |
| 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 | |
| 77 | DDI.Off (Port_Cfg.Port); |
| 78 | end Post_Off; |
| 79 | |
| 80 | ---------------------------------------------------------------------------- |
| 81 | |
| 82 | procedure Pre_All_Off |
| 83 | is |
| 84 | begin |
| 85 | Panel.Backlight_Off; |
| 86 | Panel.Off; |
| 87 | end Pre_All_Off; |
| 88 | |
| 89 | procedure Post_All_Off |
| 90 | is |
| 91 | begin |
| Nico Huber | ac455ad | 2017-02-14 14:41:19 +0100 | [diff] [blame] | 92 | 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] | 93 | DDI.Off (Port); |
| 94 | end loop; |
| Nico Huber | 3c544ee | 2016-11-20 04:56:58 +0100 | [diff] [blame] | 95 | if Config.Is_FDI_Port (Analog) then |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 96 | DDI.Off (DIGI_E); |
| 97 | end if; |
| 98 | end Post_All_Off; |
| 99 | |
| 100 | end HW.GFX.GMA.Connectors; |