media: cx23885: Add analog support for AVerMedia H789-C PCIe card
Commit Message
This card has the following ICs: Hybrid tuner TDA18271, CX23888 PCIe bridge/demodulator/decoder (and DVB-T demodulator AF9013S, which is not within the scope of this patch). It has the following inputs: Tuner, S-Video, Composite (shared with the luma input of S-Video) and Audio L/R RCA. VID:PID is 1461:e139. When the patch is applied and the cx23885 kernel module is built and loaded, the following dmesg can be seen:
[ 749.677298] cx23885: cx23885 driver version 0.0.4 loaded
[ 749.677554] cx23885: CORE cx23885[0]: subsystem: 1461:e139, board: AVerMedia H789-C [card=63,autodetected]
[ 749.831841] cx25840 8-0044: cx23888 A/V decoder found @ 0x88 (cx23885[0])
[ 750.451676] cx25840 8-0044: loaded v4l-cx23885-avcore-01.fw firmware (16382 bytes)
[ 750.488064] tuner: 7-0063: Tuner -1 found with type(s) Radio TV.
[ 750.488115] tda18271 7-0063: creating new instance
[ 750.490153] tda18271: TDA18271HD/C2 detected @ 7-0063
[ 750.805043] cx23885: cx23885[0]: registered device video2 [v4l2]
[ 750.805151] cx23885: cx23885[0]: registered device vbi2
[ 750.808682] cx23885: cx23885[0]: alsa: registered ALSA audio device
[ 750.808693] cx23885: cx23885_dev_checkrevision() Hardware revision = 0xd0
[ 750.808700] cx23885: cx23885[0]/0: found at 0000:02:00.0, rev: 4, irq: 18, latency: 0, mmio: 0xddc00000
The card has to be defined in cx23885-cards.c (firmware also has to be loaded) and cx23885.h. Moreover, audio routing is configured in cx23885-video.c. Analog tuning, composite, s-video and stereo audio inputs have been successfully tested with PAL B/G.
Signed-off-by: Plamen Atanasov <tigerment@mail.bg>
---
drivers/media/pci/cx23885/cx23885-cards.c | 30 ++++++++++++++++++++++++++++++
drivers/media/pci/cx23885/cx23885-video.c | 3 ++-
drivers/media/pci/cx23885/cx23885.h | 1 +
3 files changed, 33 insertions(+), 1 deletion(-)
@@ -860,6 +860,31 @@ struct cx23885_board cx23885_boards[] = {
.amux = CX25840_AUDIO7,
} },
},
+ [CX23885_BOARD_AVERMEDIA_H789C] = {
+ .name = "AVerMedia H789-C",
+ .porta = CX23885_ANALOG_VIDEO,
+ .tuner_type = TUNER_NXP_TDA18271,
+ .tuner_addr = 0x63, /* 0xc0 >> 1 */
+ .tuner_bus = 1,
+ .input = {{
+ .type = CX23885_VMUX_TELEVISION,
+ .vmux = CX25840_VIN7_CH3 |
+ CX25840_VIN5_CH2 |
+ CX25840_VIN2_CH1 |
+ CX25840_DIF_ON,
+ .amux = CX25840_AUDIO8,
+ }, {
+ .type = CX23885_VMUX_COMPOSITE1,
+ .vmux = CX25840_VIN8_CH1,
+ .amux = CX25840_AUDIO7,
+ }, {
+ .type = CX23885_VMUX_SVIDEO,
+ .vmux = CX25840_VIN8_CH1 |
+ CX25840_VIN7_CH3 |
+ CX25840_SVIDEO_ON,
+ .amux = CX25840_AUDIO7,
+ }, },
+ },
};
const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
@@ -1187,6 +1212,10 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0x1461,
.subdevice = 0x3100,
.card = CX23885_BOARD_AVERMEDIA_CE310B,
+ }, {
+ .subvendor = 0x1461,
+ .subdevice = 0xe139,
+ .card = CX23885_BOARD_AVERMEDIA_H789C,
},
};
const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -2413,6 +2442,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_VIEWCAST_260E:
case CX23885_BOARD_VIEWCAST_460E:
case CX23885_BOARD_AVERMEDIA_CE310B:
+ case CX23885_BOARD_AVERMEDIA_H789C:
dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
&dev->i2c_bus[2].i2c_adap,
"cx25840", 0x88 >> 1, NULL);
@@ -261,7 +261,8 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input)
(dev->board == CX23885_BOARD_AVERMEDIA_HC81R) ||
(dev->board == CX23885_BOARD_VIEWCAST_260E) ||
(dev->board == CX23885_BOARD_VIEWCAST_460E) ||
- (dev->board == CX23885_BOARD_AVERMEDIA_CE310B)) {
+ (dev->board == CX23885_BOARD_AVERMEDIA_CE310B) ||
+ (dev->board == CX23885_BOARD_AVERMEDIA_H789C)) {
/* Configure audio routing */
v4l2_subdev_call(dev->sd_cx25840, audio, s_routing,
INPUT(input)->amux, 0, 0);
@@ -102,6 +102,7 @@
#define CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885 60
#define CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885 61
#define CX23885_BOARD_AVERMEDIA_CE310B 62
+#define CX23885_BOARD_AVERMEDIA_H789C 63
#define GPIO_0 0x00000001
#define GPIO_1 0x00000002