From 5253757b29d1cd54ddd9d2f874794c907430acc8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 17 Apr 2008 18:48:00 -0300 Subject: em28xx: Provide the proper support for switching between analog/digital From: Mauro Carvalho Chehab Before this patch, HVR900/HVR950 were incorreclty going back to analog. The result is that only digital were working. This patch provides the proper setup for analog/digital and tuner callback. It also properly resets analog into a sane state at open(). Thanks to Steven Toth and Michael Krufky for helping to set the proper parameters to GPO/GPIO em2883 ports. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/em28xx/em28xx.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'linux/drivers/media/video/em28xx/em28xx.h') diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h index 9350ca2ee..f2bd9aa30 100644 --- a/linux/drivers/media/video/em28xx/em28xx.h +++ b/linux/drivers/media/video/em28xx/em28xx.h @@ -113,6 +113,7 @@ #define EM2800_I2C_WRITE_TIMEOUT 20 enum em28xx_mode { + EM28XX_MODE_UNDEFINED, EM28XX_ANALOG_MODE, EM28XX_DIGITAL_MODE, }; @@ -231,7 +232,7 @@ enum em28xx_decoder { struct em28xx_reg_seq { int reg; - unsigned char val; + unsigned char val, mask; int sleep; }; @@ -277,12 +278,6 @@ enum em28xx_dev_state { DEV_MISCONFIGURED = 0x04, }; -enum em28xx_capture_mode { - EM28XX_CAPTURE_OFF = 0, - EM28XX_ANALOG_CAPTURE, - EM28XX_DIGITAL_CAPTURE, -}; - #define EM28XX_AUDIO_BUFS 5 #define EM28XX_NUM_AUDIO_PACKETS 64 #define EM28XX_AUDIO_MAX_PACKET_SIZE 196 /* static value */ @@ -346,9 +341,12 @@ struct em28xx { /* Some older em28xx chips needs a waiting time after writing */ unsigned int wait_after_write; - /* GPIO sequences for tuner callback */ + /* GPIO sequences for analog and digital mode */ struct em28xx_reg_seq *analog_gpio, *digital_gpio; + /* GPIO sequences for tuner callbacks */ + struct em28xx_reg_seq *tun_analog_gpio, *tun_digital_gpio; + int video_inputs; /* number of video inputs */ struct list_head devlist; @@ -430,6 +428,9 @@ struct em28xx { enum em28xx_mode mode; + /* Caches GPO and GPIO registers */ + unsigned char reg_gpo, reg_gpio; + struct em28xx_dvb *dvb; }; @@ -470,9 +471,10 @@ int em28xx_resolution_set(struct em28xx *dev); int em28xx_set_alternate(struct em28xx *dev); int em28xx_init_isoc(struct em28xx *dev, int max_packets, int num_bufs, int max_pkt_size, - int (*isoc_copy) (struct em28xx *dev, struct urb *urb), - int cap_type); + int (*isoc_copy) (struct em28xx *dev, struct urb *urb)); void em28xx_uninit_isoc(struct em28xx *dev); +int em28xx_set_mode(struct em28xx *dev, enum em28xx_mode set_mode); +int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio); /* Provided by em28xx-video.c */ int em28xx_register_extension(struct em28xx_ops *dev); -- cgit v1.2.3