/***
 *** main SVGA clock programming functions for SVGATextMode
 *** Written by Koen Gadeyne (kmg@barco.be)
 ***
 ***/

#ifndef _SETCLOCK_H
#define _SETCLOCK_H

#include "parse_clock.h"

/* max TEXTMODE clocks for each chipset */
#define CLOCK_LIMITS        { 45.00,   /* VGA */\
                              70.00,   /* S3 */\
                              55.00,   /* Cirrus */\
                              95.00,   /* ET4000 */\
                              50.00,   /* TVGA8900 */\
                              45.00,   /* TVGA9000 */\
                              45.00,   /* PAVGA1 */\
                              50.00,   /* WDC90C0X */\
                              50.00,   /* WDC90C1X */\
                              50.00,   /* WDC90C2X */\
                              50.00,   /* WDC90C3X */\
                              55.00,   /* ATI */\
                              55.00,   /* ATIMACH32 */\
                              45.00    /* VIDEO7 */\
                            }


/*
 * Clock selection error codes (MUST be negative !!!)
 */

#define CLKSEL_OUT_OF_BOUNDS    -4
#define CLKSEL_DONOTHING        -3
#define CLKSEL_ILLEGAL_NUM      -2
#define CLKSEL_NULLCLOCK        -1


int GetClock(int chipset, float* clocks, int num_clocks, float freq, float *closestfreq, int optmask, int report_error);

void SetClock(int chipset, float* clocks, int num_clocks, float freq, int optmask);

void do_clock(int chipset, t_clockdef* ck, float clock, int clockindex, int optionmask);


#endif

