| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 1 | -- |
| 2 | -- Copyright (C) 2015-2016 secunet Security Networks AG |
| 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 | |
| 24 | procedure Pre_On |
| Nico Huber | 6e327c9 | 2016-12-21 14:45:45 +0100 | [diff] [blame] | 25 | (Pipe : in Pipe_Index; |
| 26 | Port_Cfg : in Port_Config; |
| 27 | PLL_Hint : in Word32; |
| 28 | Success : out Boolean) |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 29 | is |
| 30 | begin |
| 31 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 32 | |
| 33 | DDI.Pre_On (Port_Cfg, PLL_Hint, Success); |
| 34 | end Pre_On; |
| 35 | |
| 36 | procedure Post_On |
| 37 | (Port_Cfg : in Port_Config; |
| 38 | PLL_Hint : in Word32; |
| 39 | Success : out Boolean) |
| 40 | is |
| 41 | begin |
| 42 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 43 | |
| 44 | DDI.Post_On (Port_Cfg); |
| 45 | |
| 46 | if Port_Cfg.Port = DIGI_A then |
| 47 | Panel.Backlight_On; |
| 48 | end if; |
| 49 | |
| 50 | Success := True; |
| 51 | end Post_On; |
| 52 | |
| 53 | ---------------------------------------------------------------------------- |
| 54 | |
| 55 | procedure Pre_Off (Port_Cfg : Port_Config) |
| 56 | is |
| 57 | begin |
| 58 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 59 | |
| 60 | if Port_Cfg.Port = DIGI_A then |
| 61 | Panel.Backlight_Off; |
| 62 | Panel.Off; |
| 63 | end if; |
| 64 | end Pre_Off; |
| 65 | |
| 66 | procedure Post_Off (Port_Cfg : Port_Config) |
| 67 | is |
| 68 | begin |
| 69 | pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); |
| 70 | |
| 71 | DDI.Off (Port_Cfg.Port); |
| 72 | end Post_Off; |
| 73 | |
| 74 | ---------------------------------------------------------------------------- |
| 75 | |
| 76 | procedure Pre_All_Off |
| 77 | is |
| 78 | begin |
| 79 | Panel.Backlight_Off; |
| 80 | Panel.Off; |
| 81 | end Pre_All_Off; |
| 82 | |
| 83 | procedure Post_All_Off |
| 84 | is |
| 85 | begin |
| 86 | for Port in Digital_Port range DIGI_A .. DIGI_D loop |
| 87 | DDI.Off (Port); |
| 88 | end loop; |
| Nico Huber | 3c544ee | 2016-11-20 04:56:58 +0100 | [diff] [blame] | 89 | if Config.Is_FDI_Port (Analog) then |
| Nico Huber | 83693c8 | 2016-10-08 22:17:55 +0200 | [diff] [blame] | 90 | DDI.Off (DIGI_E); |
| 91 | end if; |
| 92 | end Post_All_Off; |
| 93 | |
| 94 | end HW.GFX.GMA.Connectors; |