Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f271a3af authored by istvan_v@mailbox.hu's avatar istvan_v@mailbox.hu Committed by Mauro Carvalho Chehab
Browse files

[media] cx88: added support for Leadtek WinFast DTV2000 H Plus



This patch implements support for the Leadtek WinFast DTV2000 H Plus card
with XC4000 tuner (107d:6f42).

Signed-off-by: default avatarIstvan Varga <istvan_v@mailbox.hu>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c21973e8
Loading
Loading
Loading
Loading
+81 −0
Original line number Original line Diff line number Diff line
@@ -2120,6 +2120,58 @@ static const struct cx88_board cx88_boards[] = {
		},
		},
		.mpeg           = CX88_MPEG_DVB,
		.mpeg           = CX88_MPEG_DVB,
	},
	},
	[CX88_BOARD_WINFAST_DTV2000H_PLUS] = {
		.name		= "Leadtek WinFast DTV2000 H PLUS",
		.tuner_type	= TUNER_XC4000,
		.radio_type	= TUNER_XC4000,
		.tuner_addr	= 0x61,
		.radio_addr	= 0x61,
		/*
		 * GPIO
		 *   2: 1: mute audio
		 *  12: 0: reset XC4000
		 *  13: 1: audio input is line in (0: tuner)
		 *  14: 0: FM radio
		 *  16: 0: RF input is cable
		 */
		.input		= {{
			.type	= CX88_VMUX_TELEVISION,
			.vmux	= 0,
			.gpio0	= 0x0403,
			.gpio1	= 0xF0D7,
			.gpio2	= 0x0101,
			.gpio3	= 0x0000,
		}, {
			.type	= CX88_VMUX_CABLE,
			.vmux	= 0,
			.gpio0	= 0x0403,
			.gpio1	= 0xF0D7,
			.gpio2	= 0x0100,
			.gpio3	= 0x0000,
		}, {
			.type	= CX88_VMUX_COMPOSITE1,
			.vmux	= 1,
			.gpio0	= 0x0403,	/* was 0x0407 */
			.gpio1	= 0xF0F7,
			.gpio2	= 0x0101,
			.gpio3	= 0x0000,
		}, {
			.type	= CX88_VMUX_SVIDEO,
			.vmux	= 2,
			.gpio0	= 0x0403,	/* was 0x0407 */
			.gpio1	= 0xF0F7,
			.gpio2	= 0x0101,
			.gpio3	= 0x0000,
		}},
		.radio = {
			.type	= CX88_RADIO,
			.gpio0	= 0x0403,
			.gpio1	= 0xF097,
			.gpio2	= 0x0100,
			.gpio3	= 0x0000,
		},
		.mpeg		= CX88_MPEG_DVB,
	},
	[CX88_BOARD_PROF_7301] = {
	[CX88_BOARD_PROF_7301] = {
		.name           = "Prof 7301 DVB-S/S2",
		.name           = "Prof 7301 DVB-S/S2",
		.tuner_type     = UNSET,
		.tuner_type     = UNSET,
@@ -2581,6 +2633,10 @@ static const struct cx88_subid cx88_subids[] = {
		.subvendor = 0x107d,
		.subvendor = 0x107d,
		.subdevice = 0x6654,
		.subdevice = 0x6654,
		.card      = CX88_BOARD_WINFAST_DTV1800H,
		.card      = CX88_BOARD_WINFAST_DTV1800H,
	}, {
		.subvendor = 0x107d,
		.subdevice = 0x6f42,
		.card      = CX88_BOARD_WINFAST_DTV2000H_PLUS,
	}, {
	}, {
		/* PVR2000 PAL Model [107d:6630] */
		/* PVR2000 PAL Model [107d:6630] */
		.subvendor = 0x107d,
		.subvendor = 0x107d,
@@ -2847,6 +2903,23 @@ static int cx88_xc3028_winfast1800h_callback(struct cx88_core *core,
	return -EINVAL;
	return -EINVAL;
}
}


static int cx88_xc4000_winfast2000h_plus_callback(struct cx88_core *core,
						  int command, int arg)
{
	switch (command) {
	case XC4000_TUNER_RESET:
		/* GPIO 12 (xc4000 tuner reset) */
		cx_set(MO_GP1_IO, 0x1010);
		mdelay(50);
		cx_clear(MO_GP1_IO, 0x10);
		mdelay(75);
		cx_set(MO_GP1_IO, 0x10);
		mdelay(75);
		return 0;
	}
	return -EINVAL;
}

/* ------------------------------------------------------------------- */
/* ------------------------------------------------------------------- */
/* some Divco specific stuff                                           */
/* some Divco specific stuff                                           */
static int cx88_pv_8000gt_callback(struct cx88_core *core,
static int cx88_pv_8000gt_callback(struct cx88_core *core,
@@ -2954,6 +3027,9 @@ static int cx88_xc4000_tuner_callback(struct cx88_core *core,
{
{
	/* Board-specific callbacks */
	/* Board-specific callbacks */
	switch (core->boardnr) {
	switch (core->boardnr) {
	case CX88_BOARD_WINFAST_DTV2000H_PLUS:
		return cx88_xc4000_winfast2000h_plus_callback(core,
							      command, arg);
	}
	}
	return -EINVAL;
	return -EINVAL;
}
}
@@ -3131,6 +3207,11 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core)
		mdelay(50);
		mdelay(50);
		break;
		break;


	case CX88_BOARD_WINFAST_DTV2000H_PLUS:
		cx88_xc4000_winfast2000h_plus_callback(core,
						       XC4000_TUNER_RESET, 0);
		break;

	case CX88_BOARD_TWINHAN_VP1027_DVBS:
	case CX88_BOARD_TWINHAN_VP1027_DVBS:
		cx_write(MO_GP0_IO, 0x00003230);
		cx_write(MO_GP0_IO, 0x00003230);
		cx_write(MO_GP0_IO, 0x00003210);
		cx_write(MO_GP0_IO, 0x00003210);
+23 −1
Original line number Original line Diff line number Diff line
@@ -1328,6 +1328,23 @@ static int dvb_register(struct cx8802_dev *dev)
				goto frontend_detach;
				goto frontend_detach;
		}
		}
		break;
		break;
	case CX88_BOARD_WINFAST_DTV2000H_PLUS:
		fe0->dvb.frontend = dvb_attach(zl10353_attach,
					       &cx88_pinnacle_hybrid_pctv,
					       &core->i2c_adap);
		if (fe0->dvb.frontend) {
			struct xc4000_config cfg = {
				.i2c_address	  = 0x61,
				.default_pm	  = 0,
				.dvb_amplitude	  = 134,
				.set_smoothedcvbs = 1,
				.if_khz		  = 4560
			};
			fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
			if (attach_xc4000(dev, &cfg) < 0)
				goto frontend_detach;
		}
		break;
	case CX88_BOARD_GENIATECH_X8000_MT:
	case CX88_BOARD_GENIATECH_X8000_MT:
		dev->ts_gen_cntrl = 0x00;
		dev->ts_gen_cntrl = 0x00;


@@ -1611,6 +1628,11 @@ static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv)
		udelay(1000);
		udelay(1000);
		break;
		break;


	case CX88_BOARD_WINFAST_DTV2000H_PLUS:
		/* set RF input to AIR for DVB-T (GPIO 16) */
		cx_write(MO_GP2_IO, 0x0101);
		break;

	default:
	default:
		err = -ENODEV;
		err = -ENODEV;
	}
	}
+2 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
		break;
		break;
	case CX88_BOARD_WINFAST_DTV1000:
	case CX88_BOARD_WINFAST_DTV1000:
	case CX88_BOARD_WINFAST_DTV1800H:
	case CX88_BOARD_WINFAST_DTV1800H:
	case CX88_BOARD_WINFAST_DTV2000H_PLUS:
	case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
	case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
		gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900);
		gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900);
		auxgpio = gpio;
		auxgpio = gpio;
@@ -289,6 +290,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
	case CX88_BOARD_WINFAST_DTV2000H:
	case CX88_BOARD_WINFAST_DTV2000H:
	case CX88_BOARD_WINFAST_DTV2000H_J:
	case CX88_BOARD_WINFAST_DTV2000H_J:
	case CX88_BOARD_WINFAST_DTV1800H:
	case CX88_BOARD_WINFAST_DTV1800H:
	case CX88_BOARD_WINFAST_DTV2000H_PLUS:
		ir_codes = RC_MAP_WINFAST;
		ir_codes = RC_MAP_WINFAST;
		ir->gpio_addr = MO_GP0_IO;
		ir->gpio_addr = MO_GP0_IO;
		ir->mask_keycode = 0x8f8;
		ir->mask_keycode = 0x8f8;
+1 −0
Original line number Original line Diff line number Diff line
@@ -242,6 +242,7 @@ extern const struct sram_channel const cx88_sram_channels[];
#define CX88_BOARD_SAMSUNG_SMT_7020        84
#define CX88_BOARD_SAMSUNG_SMT_7020        84
#define CX88_BOARD_TWINHAN_VP1027_DVBS     85
#define CX88_BOARD_TWINHAN_VP1027_DVBS     85
#define CX88_BOARD_TEVII_S464              86
#define CX88_BOARD_TEVII_S464              86
#define CX88_BOARD_WINFAST_DTV2000H_PLUS   87


enum cx88_itype {
enum cx88_itype {
	CX88_VMUX_COMPOSITE1 = 1,
	CX88_VMUX_COMPOSITE1 = 1,