Commit ebef13d4 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (9589): Properly support capture start on em2874

Properly support capture start on em2874

The transport stream enable register moved in the em2874, so make it work
properly.

Thanks for Ray Lu from Empia for providing the em2874 datasheet.
Signed-off-by: default avatarDevin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 24a613e4
...@@ -373,6 +373,24 @@ int em28xx_colorlevels_set_default(struct em28xx *dev) ...@@ -373,6 +373,24 @@ int em28xx_colorlevels_set_default(struct em28xx *dev)
int em28xx_capture_start(struct em28xx *dev, int start) int em28xx_capture_start(struct em28xx *dev, int start)
{ {
int rc; int rc;
if (dev->chip_id == CHIP_ID_EM2874) {
/* The Transport Stream Enable Register moved in em2874 */
if (!start) {
rc = em28xx_write_reg_bits(dev, EM2874_R5F_TS_ENABLE,
0x00,
EM2874_TS1_CAPTURE_ENABLE);
return rc;
}
/* Enable Transport Stream */
rc = em28xx_write_reg_bits(dev, EM2874_R5F_TS_ENABLE,
EM2874_TS1_CAPTURE_ENABLE,
EM2874_TS1_CAPTURE_ENABLE);
return rc;
}
/* FIXME: which is the best order? */ /* FIXME: which is the best order? */
/* video registers are sampled by VREF */ /* video registers are sampled by VREF */
rc = em28xx_write_reg_bits(dev, EM28XX_R0C_USBSUSP, rc = em28xx_write_reg_bits(dev, EM28XX_R0C_USBSUSP,
......
...@@ -77,8 +77,17 @@ ...@@ -77,8 +77,17 @@
#define EM28XX_R14_VIDEO_AC97 0x14 #define EM28XX_R14_VIDEO_AC97 0x14
/* em2874 registers */ /* em2874 registers */
#define EM2874_R5F_TS_ENABLE 0x5f
#define EM2874_R80_GPIO 0x80 #define EM2874_R80_GPIO 0x80
/* em2874 Transport Stream Enable Register (0x5f) */
#define EM2874_TS1_CAPTURE_ENABLE (1 << 0)
#define EM2874_TS1_FILTER_ENABLE (1 << 1)
#define EM2874_TS1_NULL_DISCARD (1 << 2)
#define EM2874_TS2_CAPTURE_ENABLE (1 << 4)
#define EM2874_TS2_FILTER_ENABLE (1 << 5)
#define EM2874_TS2_NULL_DISCARD (1 << 6)
/* register settings */ /* register settings */
#define EM2800_AUDIO_SRC_TUNER 0x0d #define EM2800_AUDIO_SRC_TUNER 0x0d
#define EM2800_AUDIO_SRC_LINE 0x0c #define EM2800_AUDIO_SRC_LINE 0x0c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment