Path: blob/master/drivers/media/video/cx18/cx18-cards.h
17745 views
/*1* cx18 functions to query card hardware2*3* Derived from ivtv-cards.c4*5* Copyright (C) 2007 Hans Verkuil <[email protected]>6* Copyright (C) 2008 Andy Walls <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223/* hardware flags */24#define CX18_HW_TUNER (1 << 0)25#define CX18_HW_TVEEPROM (1 << 1)26#define CX18_HW_CS5345 (1 << 2)27#define CX18_HW_DVB (1 << 3)28#define CX18_HW_418_AV (1 << 4)29#define CX18_HW_GPIO_MUX (1 << 5)30#define CX18_HW_GPIO_RESET_CTRL (1 << 6)31#define CX18_HW_Z8F0811_IR_TX_HAUP (1 << 7)32#define CX18_HW_Z8F0811_IR_RX_HAUP (1 << 8)33#define CX18_HW_Z8F0811_IR_HAUP (CX18_HW_Z8F0811_IR_RX_HAUP | \34CX18_HW_Z8F0811_IR_TX_HAUP)3536#define CX18_HW_IR_ANY (CX18_HW_Z8F0811_IR_RX_HAUP | \37CX18_HW_Z8F0811_IR_TX_HAUP)3839/* video inputs */40#define CX18_CARD_INPUT_VID_TUNER 141#define CX18_CARD_INPUT_SVIDEO1 242#define CX18_CARD_INPUT_SVIDEO2 343#define CX18_CARD_INPUT_COMPOSITE1 444#define CX18_CARD_INPUT_COMPOSITE2 545#define CX18_CARD_INPUT_COMPONENT1 64647/* audio inputs */48#define CX18_CARD_INPUT_AUD_TUNER 149#define CX18_CARD_INPUT_LINE_IN1 250#define CX18_CARD_INPUT_LINE_IN2 35152#define CX18_CARD_MAX_VIDEO_INPUTS 653#define CX18_CARD_MAX_AUDIO_INPUTS 354#define CX18_CARD_MAX_TUNERS 25556/* V4L2 capability aliases */57#define CX18_CAP_ENCODER (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | \58V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | \59V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE)6061struct cx18_card_video_input {62u8 video_type; /* video input type */63u8 audio_index; /* index in cx18_card_audio_input array */64u32 video_input; /* hardware video input */65};6667struct cx18_card_audio_input {68u8 audio_type; /* audio input type */69u32 audio_input; /* hardware audio input */70u16 muxer_input; /* hardware muxer input for boards with a71multiplexer chip */72};7374struct cx18_card_pci_info {75u16 device;76u16 subsystem_vendor;77u16 subsystem_device;78};7980/* GPIO definitions */8182/* The mask is the set of bits used by the operation */8384struct cx18_gpio_init { /* set initial GPIO DIR and OUT values */85u32 direction; /* DIR setting. Leave to 0 if no init is needed */86u32 initial_value;87};8889struct cx18_gpio_i2c_slave_reset {90u32 active_lo_mask; /* GPIO outputs that reset i2c chips when low */91u32 active_hi_mask; /* GPIO outputs that reset i2c chips when high */92int msecs_asserted; /* time period reset must remain asserted */93int msecs_recovery; /* time after deassert for chips to be ready */94u32 ir_reset_mask; /* GPIO to reset the Zilog Z8F0811 IR contoller */95};9697struct cx18_gpio_audio_input { /* select tuner/line in input */98u32 mask; /* leave to 0 if not supported */99u32 tuner;100u32 linein;101u32 radio;102};103104struct cx18_card_tuner {105v4l2_std_id std; /* standard for which the tuner is suitable */106int tuner; /* tuner ID (from tuner.h) */107};108109struct cx18_card_tuner_i2c {110unsigned short radio[2];/* radio tuner i2c address to probe */111unsigned short demod[3];/* demodulator i2c address to probe */112unsigned short tv[4]; /* tv tuner i2c addresses to probe */113};114115struct cx18_ddr { /* DDR config data */116u32 chip_config;117u32 refresh;118u32 timing1;119u32 timing2;120u32 tune_lane;121u32 initial_emrs;122};123124/* for card information/parameters */125struct cx18_card {126int type;127char *name;128char *comment;129u32 v4l2_capabilities;130u32 hw_audio_ctrl; /* hardware used for the V4L2 controls (only1311 dev allowed currently) */132u32 hw_muxer; /* hardware used to multiplex audio input */133u32 hw_all; /* all hardware used by the board */134struct cx18_card_video_input video_inputs[CX18_CARD_MAX_VIDEO_INPUTS];135struct cx18_card_audio_input audio_inputs[CX18_CARD_MAX_AUDIO_INPUTS];136struct cx18_card_audio_input radio_input;137138/* GPIO card-specific settings */139u8 xceive_pin; /* XCeive tuner GPIO reset pin */140struct cx18_gpio_init gpio_init;141struct cx18_gpio_i2c_slave_reset gpio_i2c_slave_reset;142struct cx18_gpio_audio_input gpio_audio_input;143144struct cx18_card_tuner tuners[CX18_CARD_MAX_TUNERS];145struct cx18_card_tuner_i2c *i2c;146147struct cx18_ddr ddr;148149/* list of device and subsystem vendor/devices that150correspond to this card type. */151const struct cx18_card_pci_info *pci_list;152};153154int cx18_get_input(struct cx18 *cx, u16 index, struct v4l2_input *input);155int cx18_get_audio_input(struct cx18 *cx, u16 index, struct v4l2_audio *input);156const struct cx18_card *cx18_get_card(u16 index);157158159