Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2007  Luc Verhaegen <lverhaegen@novell.com>
  3.  * Copyright 2007  Matthias Hopf <mhopf@novell.com>
  4.  * Copyright 2007  Egbert Eich   <eich@novell.com>
  5.  * Copyright 2007  Advanced Micro Devices, Inc.
  6.  *
  7.  * Permission is hereby granted, free of charge, to any person obtaining a
  8.  * copy of this software and associated documentation files (the "Software"),
  9.  * to deal in the Software without restriction, including without limitation
  10.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11.  * and/or sell copies of the Software, and to permit persons to whom the
  12.  * Software is furnished to do so, subject to the following conditions:
  13.  *
  14.  * The above copyright notice and this permission notice shall be included in
  15.  * all copies or substantial portions of the Software.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  20.  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  21.  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  22.  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23.  * OTHER DEALINGS IN THE SOFTWARE.
  24.  */
  25.  
  26. #ifndef _RHD_PLL_H
  27. #define _RHD_PLL_H
  28.  
  29. struct rhdPLL {
  30.     int scrnIndex;
  31.  
  32. #define PLL_NAME_PLL1 "PLL 1"
  33. #define PLL_NAME_PLL2 "PLL 2"
  34.     char *Name;
  35.  
  36. /* also used as an index to rhdPtr->PLLs */
  37. #define PLL_ID_PLL1  0
  38. #define PLL_ID_PLL2  1
  39. #define PLL_ID_NONE -1
  40.     int Id;
  41.  
  42.     CARD32 CurrentClock;
  43.     Bool Active;
  44.  
  45.     /* from defaults or from atom */
  46.     CARD32 RefClock;
  47.     CARD32 IntMin;
  48.     CARD32 IntMax;
  49.     CARD32 PixMin;
  50.     CARD32 PixMax;
  51.  
  52.     ModeStatus (*Valid) (struct rhdPLL *PLL, CARD32 Clock);
  53.     void (*Set) (struct rhdPLL *PLL, int PixelClock, CARD16 ReferenceDivider,
  54.                  CARD16 FeedbackDivider, CARD8 PostDivider);
  55.     void (*Power) (struct rhdPLL *PLL, int Power);
  56.     void (*Save) (struct rhdPLL *PLL);
  57.     void (*Restore) (struct rhdPLL *PLL);
  58.  
  59.     /* For save/restore: Move to a Private */
  60.     Bool Stored;
  61.  
  62.     void *Private;
  63.  
  64.     Bool StoreActive;
  65.     Bool StoreCrtc1Owner;
  66.     Bool StoreCrtc2Owner;
  67.     CARD32 StoreRefDiv;
  68.     CARD32 StoreFBDiv;
  69.     CARD32 StorePostDiv;
  70.     CARD32 StoreControl;
  71.     CARD32 StoreSpreadSpectrum;
  72.  
  73.     /* RV620/RV635/RS780 */
  74.     Bool StoreDCCGCLKOwner;
  75.     CARD32 StoreDCCGCLK;
  76.     CARD8 StoreScalerPostDiv;
  77.     CARD8 StoreSymPostDiv;
  78.     CARD32 StorePostDivSrc;
  79.     Bool StoreGlitchReset;
  80. };
  81.  
  82. Bool RHDPLLsInit(RHDPtr rhdPtr);
  83. ModeStatus RHDPLLValid(struct rhdPLL *PLL, CARD32 Clock);
  84. void RHDPLLSet(struct rhdPLL *PLL, CARD32 Clock);
  85. void RHDPLLPower(struct rhdPLL *PLL, int Power);
  86. void RHDPLLsPowerAll(RHDPtr rhdPtr, int Power);
  87. void RHDPLLsShutdownInactive(RHDPtr rhdPtr);
  88. void RHDPLLsSave(RHDPtr rhdPtr);
  89. void RHDPLLsRestore(RHDPtr rhdPtr);
  90. void RHDPLLsDestroy(RHDPtr rhdPtr);
  91.  
  92. void RHDSetupLimits(RHDPtr rhdPtr, CARD32 *RefClock,
  93.                     CARD32 *IntMin, CARD32 *IntMax,
  94.                     CARD32 *PixMin, CARD32 *PixMax);
  95. Bool RHDAtomPLLsInit(RHDPtr rhdPtr);
  96.  
  97. #endif /* _RHD_PLL_H */
  98.