From aa3a807912611ace92eb12328a9f99d6c2f17437 Mon Sep 17 00:00:00 2001 From: tbslucy Date: Wed, 3 Jul 2024 16:58:16 +0800 Subject: [PATCH] add to support tbs6312x --- drivers/media/pci/tbsecp3/tbsecp3-cards.c | 63 +++++++++++++++++++++++ drivers/media/pci/tbsecp3/tbsecp3-core.c | 1 + drivers/media/pci/tbsecp3/tbsecp3-dvb.c | 6 +++ drivers/media/pci/tbsecp3/tbsecp3.h | 5 +- 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/tbsecp3/tbsecp3-cards.c b/drivers/media/pci/tbsecp3/tbsecp3-cards.c index e03900e9a8b9..09fc0850743d 100755 --- a/drivers/media/pci/tbsecp3/tbsecp3-cards.c +++ b/drivers/media/pci/tbsecp3/tbsecp3-cards.c @@ -841,6 +841,69 @@ struct tbsecp3_board tbsecp3_boards[] = { .ts_in = 7, .i2c_bus_nr = 0, + } + } + }, + [TBSECP3_BOARD_TBS6312X] = { + .board_id = TBSECP3_BOARD_TBS6312X, + .name = "TurboSight TBS 6312X HDMI Capture", + .adapters = 12, + .i2c_speed = 39, + .eeprom_i2c = 1, + .eeprom_addr = 0x10, + .adap_config = { + { + .ts_in = 0, + .i2c_bus_nr = 0, + }, + { + .ts_in = 1, + .i2c_bus_nr = 0, + }, + { + .ts_in = 2, + .i2c_bus_nr = 0, + }, + { + .ts_in = 3, + .i2c_bus_nr = 0, + }, + { + .ts_in = 4, + .i2c_bus_nr = 0, + }, + { + .ts_in = 5, + .i2c_bus_nr = 0, + }, + { + .ts_in = 6, + .i2c_bus_nr = 0, + }, + { + .ts_in = 7, + .i2c_bus_nr = 0, + + }, + { + .ts_in = 8, + .i2c_bus_nr = 0, + + }, + { + .ts_in = 9, + .i2c_bus_nr = 0, + + }, + { + .ts_in = 10, + .i2c_bus_nr = 0, + + }, + { + .ts_in = 11, + .i2c_bus_nr = 0, + } } }, diff --git a/drivers/media/pci/tbsecp3/tbsecp3-core.c b/drivers/media/pci/tbsecp3/tbsecp3-core.c index a8a192378669..ca9a63efe8a5 100755 --- a/drivers/media/pci/tbsecp3/tbsecp3-core.c +++ b/drivers/media/pci/tbsecp3/tbsecp3-core.c @@ -366,6 +366,7 @@ static const struct pci_device_id tbsecp3_id_table[] = { TBSECP3_ID(TBSECP3_BOARD_TBS6304,0x6304,0x0001), TBSECP3_ID(TBSECP3_BOARD_TBS6308,0x6308,0x0001), TBSECP3_ID(TBSECP3_BOARD_TBS6308X,0x6308,0x0010), + TBSECP3_ID(TBSECP3_BOARD_TBS6312X,0x6312,0x0010), TBSECP3_ID(TBSECP3_BOARD_TBS6909X,0x6909,0x0010), TBSECP3_ID(TBSECP3_BOARD_TBS6909X,0x6909,0x0009), TBSECP3_ID(TBSECP3_BOARD_TBS6909X,0x6909,0x0019), diff --git a/drivers/media/pci/tbsecp3/tbsecp3-dvb.c b/drivers/media/pci/tbsecp3/tbsecp3-dvb.c index 95a1f712fd77..877496fbb4a3 100644 --- a/drivers/media/pci/tbsecp3/tbsecp3-dvb.c +++ b/drivers/media/pci/tbsecp3/tbsecp3-dvb.c @@ -1872,6 +1872,12 @@ static int tbsecp3_frontend_attach(struct tbsecp3_adapter *adapter) if (adapter->fe == NULL) goto frontend_atach_fail; + break; + case TBSECP3_BOARD_TBS6312X: + adapter->fe = dvb_attach(tas2971_attach, &tbs6308_demod_cfg, i2c); + if (adapter->fe == NULL) + goto frontend_atach_fail; + break; case TBSECP3_BOARD_TBS6304: adapter->fe = dvb_attach(tas2971_attach, &tbs6304_demod_cfg[adapter->nr], i2c); diff --git a/drivers/media/pci/tbsecp3/tbsecp3.h b/drivers/media/pci/tbsecp3/tbsecp3.h index 1257163f689f..05d924962431 100755 --- a/drivers/media/pci/tbsecp3/tbsecp3.h +++ b/drivers/media/pci/tbsecp3/tbsecp3.h @@ -88,7 +88,8 @@ #define TBSECP3_BOARD_TBS6504H 44 #define TBSECP3_BOARD_TBS6590SE 45 #define TBSECP3_BOARD_TBS6308X 46 -#define TBSECP3_BOARD_TBS6916 47 +#define TBSECP3_BOARD_TBS6916 47 +#define TBSECP3_BOARD_TBS6312X 48 #define TBSECP3_MAX_ADAPTERS (16) @@ -208,7 +209,7 @@ struct tbsecp3_dev { bool msi; /* dvb adapters */ - struct tbsecp3_adapter adapter[16]; + struct tbsecp3_adapter adapter[TBSECP3_MAX_ADAPTERS]; /* i2c */ struct tbsecp3_i2c i2c_bus[TBSECP3_MAX_I2C_BUS];