Commit 5add9a6f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (6659): Convert MTS to bitfield

Xc2028.3028 has two type of firmwares: audio-standard specific ones and
baseband MTS firmwares. MTS firmwares provide stereo decoding for 6 MHz
BTSC/EIAJ and for monoaural audio decoding on 8 MHz firmwares.

It seems that the option to use MTS or a standard-specific audio decoding
depends on the way xc2028/3028 is connected.

Instead of wasting 32 (or 64 bits) to signalize if the driver needs to use MTS
firmware, this patch converts it to a bitfield that can be shared with other
proprieties of xc2028/3028.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent a5e9fe14
...@@ -513,7 +513,6 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -513,7 +513,6 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
.callback = dvico_bluebird_xc2028_callback, .callback = dvico_bluebird_xc2028_callback,
}; };
static struct xc2028_ctrl ctl = { static struct xc2028_ctrl ctl = {
.type = XC2028_FIRM_NORMAL,
.fname = "xc3028-dvico-au-01.fw", .fname = "xc3028-dvico-au-01.fw",
.max_len = 64, .max_len = 64,
.scode_table = ZARLINK456, .scode_table = ZARLINK456,
......
...@@ -154,7 +154,7 @@ struct em28xx_board em28xx_boards[] = { ...@@ -154,7 +154,7 @@ struct em28xx_board em28xx_boards[] = {
.tda9887_conf = TDA9887_PRESENT, .tda9887_conf = TDA9887_PRESENT,
.tuner_type = TUNER_XC2028, .tuner_type = TUNER_XC2028,
.has_tuner = 1, .has_tuner = 1,
.xc2028_type = XC2028_FIRM_MTS, .mts_firmware = 1,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.input = {{ .input = {{
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
...@@ -476,7 +476,7 @@ static void em28xx_config_tuner (struct em28xx *dev) ...@@ -476,7 +476,7 @@ static void em28xx_config_tuner (struct em28xx *dev)
ctl.fname = XC2028_DEFAULT_FIRMWARE; ctl.fname = XC2028_DEFAULT_FIRMWARE;
ctl.max_len = 64; ctl.max_len = 64;
ctl.type = em28xx_boards[dev->model].xc2028_type; ctl.mts = em28xx_boards[dev->model].mts_firmware;
xc2028_cfg.tuner = TUNER_XC2028; xc2028_cfg.tuner = TUNER_XC2028;
xc2028_cfg.priv = &ctl; xc2028_cfg.priv = &ctl;
......
...@@ -176,9 +176,9 @@ struct em28xx_board { ...@@ -176,9 +176,9 @@ struct em28xx_board {
unsigned int has_tuner:1; unsigned int has_tuner:1;
unsigned int has_msp34xx:1; unsigned int has_msp34xx:1;
unsigned int mts_firmware:1;
enum em28xx_decoder decoder; enum em28xx_decoder decoder;
int xc2028_type;
struct em28xx_input input[MAX_EM28XX_INPUT]; struct em28xx_input input[MAX_EM28XX_INPUT];
}; };
......
...@@ -631,7 +631,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, ...@@ -631,7 +631,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode,
return rc; return rc;
} }
if (priv->ctrl.type == XC2028_FIRM_MTS) if (priv->ctrl.mts)
type |= MTS; type |= MTS;
if (bandwidth == BANDWIDTH_7_MHZ || bandwidth == BANDWIDTH_8_MHZ) if (bandwidth == BANDWIDTH_7_MHZ || bandwidth == BANDWIDTH_8_MHZ)
type |= F8MHZ; type |= F8MHZ;
......
...@@ -11,17 +11,12 @@ ...@@ -11,17 +11,12 @@
#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw" #define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
enum xc2028_firm_type {
XC2028_FIRM_NORMAL,
XC2028_FIRM_MTS,
};
struct xc2028_ctrl { struct xc2028_ctrl {
enum xc2028_firm_type type;
char *fname; char *fname;
int max_len; int max_len;
int d2633:1;
unsigned int scode_table; unsigned int scode_table;
unsigned int mts :1;
unsigned int d2633:1;
}; };
struct xc2028_config { struct xc2028_config {
......
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