45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef __BT829_H__
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __BT829_H__
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "xf86i2c.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int tunertype; /* Must be set before init */
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Private variables */
45e9809aff7304721fddb95654901b32195c9c7avboxsync I2CDevRec d;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 brightness;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 ccmode;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 code;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 contrast;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 format;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int height;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 hue;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 len;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 mux;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 out_en;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 p_io;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 sat_u;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 sat_v;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 vbien;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 vbifmt;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int width;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 hdelay;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 hscale;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 vactive;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 vdelay;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 vscale;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD16 htotal;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 id;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 svideo_mux;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} BT829Rec, *BT829Ptr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_Detect bt829_Detect
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT BT829Ptr bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* ATI card specific initialization */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_ATI_ADDR_1 0x8A
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_ATI_ADDR_2 0x88
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_ATIInit bt829_ATIInit
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int bt829_ATIInit(BT829Ptr bt);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_NTSC 1 /* NTSC-M */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_NTSC_JAPAN 2 /* NTSC-Japan */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_PAL 3 /* PAL-B,D,G,H,I */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_PAL_M 4 /* PAL-M */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_PAL_N 5 /* PAL-N */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_SECAM 6 /* SECAM */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_PAL_N_COMB 7 /* PAL-N combination */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetFormat bt829_SetFormat
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int bt829_SetFormat(BT829Ptr bt, CARD8 format);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_MUX2 1 /* ATI -> composite video */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_MUX0 2 /* ATI -> tv tuner */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829_MUX1 3 /* ATI -> s-video */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetMux bt829_SetMux
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int bt829_SetMux(BT829Ptr bt, CARD8 mux);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetCaptSize bt829_SetCaptSize
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int bt829_SetCaptSize(BT829Ptr bt, int width, int height);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetBrightness bt829_SetBrightness
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void bt829_SetBrightness(BT829Ptr bt, int brightness);
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetContrast bt829_SetContrast
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void bt829_SetContrast(BT829Ptr bt, int contrast);
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetSaturation bt829_SetSaturation
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void bt829_SetSaturation(BT829Ptr bt, int saturation);
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetTint bt829_SetTint
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void bt829_SetTint(BT829Ptr bt, int hue); /* Hue */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetOUT_EN bt829_SetOUT_EN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void bt829_SetOUT_EN(BT829Ptr bt, BOOL out_en);/* VPOLE register */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define xf86_bt829_SetP_IO bt829_SetP_IO
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void bt829_SetP_IO(BT829Ptr bt, CARD8 p_io); /* P_IO register */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT int bt829_SetCC(BT829Ptr bt);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BT829SymbolsList \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_Detect", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_ATIInit", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetFormat", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetMux", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetBrightness", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetContrast", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetSaturation", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetTint", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetCaptSize", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetOUT_EN", \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "bt829_SetP_IO"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif