/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2saa7115.h - definition for saa7111/3/4/5 inputs and frequency flags34Copyright (C) 2006 Hans Verkuil ([email protected])56*/78#ifndef _SAA7115_H_9#define _SAA7115_H_1011/* s_routing inputs, outputs, and config */1213/* SAA7111/3/4/5 HW inputs */14#define SAA7115_COMPOSITE0 015#define SAA7115_COMPOSITE1 116#define SAA7115_COMPOSITE2 217#define SAA7115_COMPOSITE3 318#define SAA7115_COMPOSITE4 4 /* not available for the saa7111/3 */19#define SAA7115_COMPOSITE5 5 /* not available for the saa7111/3 */20#define SAA7115_SVIDEO0 621#define SAA7115_SVIDEO1 722#define SAA7115_SVIDEO2 823#define SAA7115_SVIDEO3 92425/* outputs */26#define SAA7115_IPORT_ON 127#define SAA7115_IPORT_OFF 02829/* SAA7111 specific outputs. */30#define SAA7111_VBI_BYPASS 231#define SAA7111_FMT_YUV422 0x0032#define SAA7111_FMT_RGB 0x4033#define SAA7111_FMT_CCIR 0x8034#define SAA7111_FMT_YUV411 0xc03536/* config flags */37/*38* Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit39* controls the IDQ signal polarity which is set to 'inverted' if the bit40* it 1 and to 'default' if it is 0.41*/42#define SAA7115_IDQ_IS_DEFAULT (1 << 0)4344/* s_crystal_freq values and flags */4546/* SAA7115 v4l2_crystal_freq frequency values */47#define SAA7115_FREQ_32_11_MHZ 32110000 /* 32.11 MHz crystal, SAA7114/5 only */48#define SAA7115_FREQ_24_576_MHZ 24576000 /* 24.576 MHz crystal */4950/* SAA7115 v4l2_crystal_freq audio clock control flags */51#define SAA7115_FREQ_FL_UCGC (1 << 0) /* SA 3A[7], UCGC, SAA7115 only */52#define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */53#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */54#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */5556/* ===== SAA7113 Config enums ===== */5758/* Register 0x08 "Horizontal time constant" [Bit 3..4]:59* Should be set to "Fast Locking Mode" according to the datasheet,60* and that is the default setting in the gm7113c_init table.61* saa7113_init sets this value to "VTR Mode". */62enum saa7113_r08_htc {63SAA7113_HTC_TV_MODE = 0x00,64SAA7113_HTC_VTR_MODE, /* Default for saa7113_init */65SAA7113_HTC_FAST_LOCKING_MODE = 0x03 /* Default for gm7113c_init */66};6768/* Register 0x10 "Output format selection" [Bit 6..7]:69* Defaults to ITU_656 as specified in datasheet. */70enum saa7113_r10_ofts {71SAA7113_OFTS_ITU_656 = 0x0, /* Default */72SAA7113_OFTS_VFLAG_BY_VREF,73SAA7113_OFTS_VFLAG_BY_DATA_TYPE74};7576/*77* Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:78* This is used to select what data is output on the RTS0 and RTS1 pins.79* RTS1 [Bit 4..7] Defaults to DOT_IN. (This value can not be set for RTS0)80* RTS0 [Bit 0..3] Defaults to VIPB in gm7113c_init as specified81* in the datasheet, but is set to HREF_HS in the saa7113_init table.82*/83enum saa7113_r12_rts {84SAA7113_RTS_DOT_IN = 0, /* OBS: Only for RTS1 (Default RTS1) */85SAA7113_RTS_VIPB, /* Default RTS0 For gm7113c_init */86SAA7113_RTS_GPSW,87SAA7115_RTS_HL,88SAA7113_RTS_VL,89SAA7113_RTS_DL,90SAA7113_RTS_PLIN,91SAA7113_RTS_HREF_HS, /* Default RTS0 For saa7113_init */92SAA7113_RTS_HS,93SAA7113_RTS_HQ,94SAA7113_RTS_ODD,95SAA7113_RTS_VS,96SAA7113_RTS_V123,97SAA7113_RTS_VGATE,98SAA7113_RTS_VREF,99SAA7113_RTS_FID100};101102/**103* struct saa7115_platform_data - Allow overriding default initialization104*105* @saa7113_force_gm7113c_init: Force the use of the gm7113c_init table106* instead of saa7113_init table107* (saa7113 only)108* @saa7113_r08_htc: [R_08 - Bit 3..4]109* @saa7113_r10_vrln: [R_10 - Bit 3]110* default: Disabled for gm7113c_init111* Enabled for saa7113c_init112* @saa7113_r10_ofts: [R_10 - Bit 6..7]113* @saa7113_r12_rts0: [R_12 - Bit 0..3]114* @saa7113_r12_rts1: [R_12 - Bit 4..7]115* @saa7113_r13_adlsb: [R_13 - Bit 7] - default: disabled116*/117struct saa7115_platform_data {118bool saa7113_force_gm7113c_init;119enum saa7113_r08_htc *saa7113_r08_htc;120bool *saa7113_r10_vrln;121enum saa7113_r10_ofts *saa7113_r10_ofts;122enum saa7113_r12_rts *saa7113_r12_rts0;123enum saa7113_r12_rts *saa7113_r12_rts1;124bool *saa7113_r13_adlsb;125};126127#endif128129130