rpms/kernel/F-13 linux-2.6-v4l-dvb-add-kworld-a340-support.patch, NONE, 1.1 linux-2.6-v4l-dvb-add-lgdt3304-support.patch, NONE, 1.1 hdpvr-ir-enable.patch, 1.6, 1.7 kernel.spec, 1.2030, 1.2031

Jarod Wilson jwilson at fedoraproject.org
Thu May 13 04:45:01 UTC 2010


Author: jwilson

Update of /cvs/pkgs/rpms/kernel/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv30382

Modified Files:
	hdpvr-ir-enable.patch kernel.spec 
Added Files:
	linux-2.6-v4l-dvb-add-kworld-a340-support.patch 
	linux-2.6-v4l-dvb-add-lgdt3304-support.patch 
Log Message:
* Thu May 13 2010 Jarod Wilson <jarod at redhat.com> 2.6.33.4-95
- Enable support for kworld ub435-q and 340u usb atsc tuners


linux-2.6-v4l-dvb-add-kworld-a340-support.patch:
 em28xx-cards.c |   28 ++++++++++++++++++++++++++++
 em28xx-dvb.c   |   33 +++++++++++++++++++++++++++++++++
 em28xx.h       |    1 +
 3 files changed, 62 insertions(+)

--- NEW FILE linux-2.6-v4l-dvb-add-kworld-a340-support.patch ---
[PATCH] dvb: add support for kworld 340u and ub435-q to em28xx-dvb

This adds support for the KWorld PlusTV 340U and KWorld UB345-Q ATSC
sticks, which are really the same device. The sticks have an eMPIA
em2870 usb bridge chipset, an LG Electronics LGDT3304 ATSC/QAM
demodulator and an NXP TDA18271HD tuner -- early versions of the 340U
have a a TDA18271HD/C1, later models and the UB435-Q have a C2.

The stick has been tested succesfully with both VSB_8 and QAM_256 signals.
Its using lgdt3304 support added to the lgdt3305 driver by a prior patch,
rather than the current lgdt3304 driver, as its severely lacking in
functionality by comparison (see said patch for details).

Signed-off-by: Jarod Wilson <jarod at redhat.com>

---
diff -r 14021dfc00f3 drivers/media/video/em28xx/em28xx-cards.c
--- a/drivers/media/video/em28xx/em28xx-cards.c	Thu Feb 11 23:11:30 2010 -0200
+++ b/drivers/media/video/em28xx/em28xx-cards.c	Thu Feb 18 16:47:17 2010 -0500
@@ -170,6 +170,22 @@
 	{ -1,			-1,	-1,		-1},
 };
 
+/*
+ * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
+ * EM_GPIO_0 - currently unknown
+ * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
+ * EM_GPIO_2 - currently unknown
+ * EM_GPIO_3 - currently unknown
+ * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
+ * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
+ * EM_GPIO_6 - currently unknown
+ * EM_GPIO_7 - currently unknown
+ */
+static struct em28xx_reg_seq kworld_a340_digital[] = {
+	{EM28XX_R08_GPIO,	0x6d,		~EM_GPIO_4,	10},
+	{ -1,			-1,		-1,		-1},
+};
+
 /* Pinnacle Hybrid Pro eb1a:2881 */
 static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
 	{EM28XX_R08_GPIO,	0xfd,   ~EM_GPIO_4,	10},
@@ -1703,6 +1719,16 @@
 		.tuner_gpio    = reddo_dvb_c_usb_box,
 		.has_dvb       = 1,
 	},
+	/* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
+	 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
+	 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
+	[EM2870_BOARD_KWORLD_A340] = {
+		.name       = "KWorld PlusTV 340U or UB435-Q (ATSC)",
+		.tuner_type = TUNER_ABSENT,	/* Digital-only TDA18271HD */
+		.has_dvb    = 1,
+		.dvb_gpio   = kworld_a340_digital,
+		.tuner_gpio = default_tuner_gpio,
+	},
 };
 const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
 
@@ -1826,6 +1852,8 @@
 			.driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
 	{ USB_DEVICE(0xeb1a, 0x50a6),
 			.driver_info = EM2860_BOARD_GADMEI_UTV330 },
+	{ USB_DEVICE(0x1b80, 0xa340),
+			.driver_info = EM2870_BOARD_KWORLD_A340 },
 	{ },
 };
 MODULE_DEVICE_TABLE(usb, em28xx_id_table);
diff -r 14021dfc00f3 drivers/media/video/em28xx/em28xx-dvb.c
--- a/drivers/media/video/em28xx/em28xx-dvb.c	Thu Feb 11 23:11:30 2010 -0200
+++ b/drivers/media/video/em28xx/em28xx-dvb.c	Thu Feb 18 16:47:17 2010 -0500
@@ -30,11 +30,13 @@
 #include "tuner-simple.h"
 
 #include "lgdt330x.h"
+#include "lgdt3305.h"
 #include "zl10353.h"
 #include "s5h1409.h"
 #include "mt352.h"
 #include "mt352_priv.h" /* FIXME */
 #include "tda1002x.h"
+#include "tda18271.h"
 
 MODULE_DESCRIPTION("driver for em28xx based DVB cards");
 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab at infradead.org>");
@@ -231,6 +233,18 @@
 	.demod_chip = LGDT3303,
 };
 
+static struct lgdt3305_config em2870_lgdt3304_dev = {
+	.i2c_addr           = 0x0e,
+	.demod_chip         = LGDT3304,
+	.spectral_inversion = 1,
+	.deny_i2c_rptr      = 1,
+	.mpeg_mode          = LGDT3305_MPEG_PARALLEL,
+	.tpclk_edge         = LGDT3305_TPCLK_FALLING_EDGE,
+	.tpvalid_polarity   = LGDT3305_TP_VALID_HIGH,
+	.vsb_if_khz         = 3250,
+	.qam_if_khz         = 4000,
+};
+
 static struct zl10353_config em28xx_zl10353_with_xc3028 = {
 	.demod_address = (0x1e >> 1),
 	.no_tuner = 1,
@@ -247,6 +261,17 @@
 	.mpeg_timing   = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
 };
 
+static struct tda18271_std_map kworld_a340_std_map = {
+	.atsc_6   = { .if_freq = 3250, .agc_mode = 3, .std = 0,
+		      .if_lvl = 1, .rfagc_top = 0x37, },
+	.qam_6    = { .if_freq = 4000, .agc_mode = 3, .std = 1,
+		      .if_lvl = 1, .rfagc_top = 0x37, },
+};
+
+static struct tda18271_config kworld_a340_config = {
+	.std_map           = &kworld_a340_std_map,
+};
+
 static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = {
 	.demod_address = (0x1e >> 1),
 	.no_tuner = 1,
@@ -569,6 +594,14 @@
 			}
 		}
 		break;
+	case EM2870_BOARD_KWORLD_A340:
+		dvb->frontend = dvb_attach(lgdt3305_attach,
+					   &em2870_lgdt3304_dev,
+					   &dev->i2c_adap);
+		if (dvb->frontend != NULL)
+			dvb_attach(tda18271_attach, dvb->frontend, 0x60,
+				   &dev->i2c_adap, &kworld_a340_config);
+		break;
 	default:
 		em28xx_errdev("/2: The frontend of your DVB/ATSC card"
 				" isn't supported yet\n");
diff -r 14021dfc00f3 drivers/media/video/em28xx/em28xx.h
--- a/drivers/media/video/em28xx/em28xx.h	Thu Feb 11 23:11:30 2010 -0200
+++ b/drivers/media/video/em28xx/em28xx.h	Thu Feb 18 16:47:17 2010 -0500
@@ -112,6 +112,7 @@
 #define EM2861_BOARD_GADMEI_UTV330PLUS           72
 #define EM2870_BOARD_REDDO_DVB_C_USB_BOX          73
 #define EM2800_BOARD_VC211A			  74
+#define EM2870_BOARD_KWORLD_A340		  76
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4

linux-2.6-v4l-dvb-add-lgdt3304-support.patch:
 lgdt3305.c |  206 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 lgdt3305.h |    7 +-
 2 files changed, 203 insertions(+), 10 deletions(-)

--- NEW FILE linux-2.6-v4l-dvb-add-lgdt3304-support.patch ---
>From b71e18093e2e7f240797875c50c49552722f8825 Mon Sep 17 00:00:00 2001
From: Jarod Wilson <jarod at redhat.com>
Date: Mon, 15 Feb 2010 17:13:25 -0500
Subject: [PATCH 1/2] dvb: add lgdt3304 support to lgdt3305 driver

There's a currently-unused lgdt3304 demod driver, which leaves a lot to
be desired as far as functionality. The 3304 is unsurprisingly quite
similar to the 3305, and empirical testing yeilds far better results
and more complete functionality by merging 3304 support into the 3305
driver. (For example, the current lgdt3304 driver lacks support for
signal strength, snr, ucblocks, etc., which we get w/the lgdt3305).

For the moment, not dropping the lgdt3304 driver, and its still up to
a given device's config setup to choose which demod driver to use, but
I'd suggest dropping the 3304 driver entirely.

As a follow-up to this patch, I've got another patch that adds support
for the KWorld PlusTV 340U (ATSC) em2870-based tuner stick, driving
its lgdt3304 demod via this lgdt3305 driver, which is what I used to
successfully test this patch with both VSB_8 and QAM_256 signals.

A few pieces are still a touch crude, but I think its a solid start,
as well as much cleaner and more feature-complete than the existing
lgdt3304 driver.

Signed-off-by: Jarod Wilson <jarod at redhat.com>
---
 drivers/media/dvb/frontends/lgdt3305.c |  206 ++++++++++++++++++++++++++++++--
 drivers/media/dvb/frontends/lgdt3305.h |    6 +
 2 files changed, 203 insertions(+), 9 deletions(-)

diff --git a/drivers/media/dvb/frontends/lgdt3305.c b/drivers/media/dvb/frontends/lgdt3305.c
index fde8c59..40695e6 100644
--- a/drivers/media/dvb/frontends/lgdt3305.c
+++ b/drivers/media/dvb/frontends/lgdt3305.c
@@ -1,5 +1,5 @@
 /*
- *    Support for LGDT3305 - VSB/QAM
+ *    Support for LG Electronics LGDT3304 and LGDT3305 - VSB/QAM
  *
  *    Copyright (C) 2008, 2009 Michael Krufky <mkrufky at linuxtv.org>
  *
@@ -357,7 +357,10 @@ static int lgdt3305_rfagc_loop(struct lgdt3305_state *state,
 	case QAM_256:
 		agcdelay = 0x046b;
 		rfbw     = 0x8889;
-		ifbw     = 0x8888;
+		if (state->cfg->demod_chip == LGDT3305)
+			ifbw = 0x8888;
+		else
+			ifbw = 0x6666;
 		break;
 	default:
 		return -EINVAL;
@@ -409,8 +412,18 @@ static int lgdt3305_agc_setup(struct lgdt3305_state *state,
 	lg_dbg("lockdten = %d, acqen = %d\n", lockdten, acqen);
 
 	/* control agc function */
-	lgdt3305_write_reg(state, LGDT3305_AGC_CTRL_4, 0xe1 | lockdten << 1);
-	lgdt3305_set_reg_bit(state, LGDT3305_AGC_CTRL_1, 2, acqen);
+	switch (state->cfg->demod_chip) {
+	case LGDT3304:
+		lgdt3305_write_reg(state, 0x0314, 0xe1 | lockdten << 1);
+		lgdt3305_set_reg_bit(state, 0x030e, 2, acqen);
+		break;
+	case LGDT3305:
+		lgdt3305_write_reg(state, LGDT3305_AGC_CTRL_4, 0xe1 | lockdten << 1);
+		lgdt3305_set_reg_bit(state, LGDT3305_AGC_CTRL_1, 2, acqen);
+		break;
+	default:
+		return -EINVAL;
+	}
 
 	return lgdt3305_rfagc_loop(state, param);
 }
@@ -543,6 +556,11 @@ static int lgdt3305_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
 				    enable ? 0 : 1);
 }
 
+static int lgdt3304_sleep(struct dvb_frontend *fe)
+{
+	return 0;
+}
+
 static int lgdt3305_sleep(struct dvb_frontend *fe)
 {
 	struct lgdt3305_state *state = fe->demodulator_priv;
@@ -571,6 +589,55 @@ static int lgdt3305_sleep(struct dvb_frontend *fe)
 	return 0;
 }
 
+static int lgdt3304_init(struct dvb_frontend *fe)
+{
+	struct lgdt3305_state *state = fe->demodulator_priv;
+	int ret;
+
+	static struct lgdt3305_reg lgdt3304_init_data[] = {
+		{ .reg = LGDT3305_GEN_CTRL_1,     .val = 0x03, },
+		{ .reg = 0x000d,                  .val = 0x02, },
+		{ .reg = 0x000e,                  .val = 0x02, },
+		{ .reg = LGDT3305_DGTL_AGC_REF_1, .val = 0x32, },
+		{ .reg = LGDT3305_DGTL_AGC_REF_2, .val = 0xc4, },
+		{ .reg = LGDT3305_CR_CTR_FREQ_1,  .val = 0x00, },
+		{ .reg = LGDT3305_CR_CTR_FREQ_2,  .val = 0x00, },
+		{ .reg = LGDT3305_CR_CTR_FREQ_3,  .val = 0x00, },
+		{ .reg = LGDT3305_CR_CTR_FREQ_4,  .val = 0x00, },
+		{ .reg = LGDT3305_CR_CTRL_7,      .val = 0xf9, },
+		{ .reg = 0x0112,                  .val = 0x17, },
+		{ .reg = 0x0113,                  .val = 0x15, },
+		{ .reg = 0x0114,                  .val = 0x18, },
+		{ .reg = 0x0115,                  .val = 0xff, },
+		{ .reg = 0x0116,                  .val = 0x3c, },
+		{ .reg = 0x0214,                  .val = 0x67, },
+		{ .reg = 0x0424,                  .val = 0x8d, },
+		{ .reg = 0x0427,                  .val = 0x12, },
+		{ .reg = 0x0428,                  .val = 0x4f, },
+		{ .reg = LGDT3305_IFBW_1,         .val = 0x80, },
+		{ .reg = LGDT3305_IFBW_2,         .val = 0x00, },
+		{ .reg = 0x030a,                  .val = 0x08, },
+		{ .reg = 0x030b,                  .val = 0x9b, },
+		{ .reg = 0x030d,                  .val = 0x00, },
+		{ .reg = 0x030e,                  .val = 0x1c, },
+		{ .reg = 0x0314,                  .val = 0xe1, },
+		{ .reg = 0x000d,                  .val = 0x82, },
+		{ .reg = LGDT3305_TP_CTRL_1,      .val = 0x5b, },
+		{ .reg = LGDT3305_TP_CTRL_1,      .val = 0x5b, },
+	};
+
+	lg_dbg("\n");
+
+	ret = lgdt3305_write_regs(state, lgdt3304_init_data,
+				  ARRAY_SIZE(lgdt3304_init_data));
+	if (lg_fail(ret))
+		goto fail;
+
+	ret = lgdt3305_soft_reset(state);
+fail:
+	return ret;
+}
+
 static int lgdt3305_init(struct dvb_frontend *fe)
 {
 	struct lgdt3305_state *state = fe->demodulator_priv;
@@ -639,6 +706,88 @@ fail:
 	return ret;
 }
 
+static int lgdt3304_set_parameters(struct dvb_frontend *fe,
+				   struct dvb_frontend_parameters *param)
+{
+	struct lgdt3305_state *state = fe->demodulator_priv;
+	int ret;
+
+	lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation);
+
+	if (fe->ops.tuner_ops.set_params) {
+		ret = fe->ops.tuner_ops.set_params(fe, param);
+		if (fe->ops.i2c_gate_ctrl)
+			fe->ops.i2c_gate_ctrl(fe, 0);
+		if (lg_fail(ret))
+			goto fail;
+		state->current_frequency = param->frequency;
+	}
+
+	ret = lgdt3305_set_modulation(state, param);
+	if (lg_fail(ret))
+		goto fail;
+
+	ret = lgdt3305_passband_digital_agc(state, param);
+	if (lg_fail(ret))
+		goto fail;
+
+	ret = lgdt3305_agc_setup(state, param);
+	if (lg_fail(ret))
+		goto fail;
+
+	/* reg 0x030d is 3304-only... seen in vsb and qam usbsnoops... */
+	switch (param->u.vsb.modulation) {
+	case VSB_8:
+		lgdt3305_write_reg(state, 0x030d, 0x00);
+#if 1
+		lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_1, 0x4f);
+		lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_2, 0x0c);
+		lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_3, 0xac);
+		lgdt3305_write_reg(state, LGDT3305_CR_CTR_FREQ_4, 0xba);
+#endif
+		break;
+	case QAM_64:
+	case QAM_256:
+		lgdt3305_write_reg(state, 0x030d, 0x14);
+#if 1
+		ret = lgdt3305_set_if(state, param);
+		if (lg_fail(ret))
+			goto fail;
+#endif
+		break;
+	default:
+		return -EINVAL;
+	}
+
+#if 0
+	/* the set_if vsb formula doesn't work for the 3304, we end up sending
+	 * 0x40851e07 instead of 0x4f0cacba (which works back to 94050, rather
+	 * than 3250, in the case of the kworld 340u) */
+	ret = lgdt3305_set_if(state, param);
+	if (lg_fail(ret))
+		goto fail;
+#endif
+
+	ret = lgdt3305_spectral_inversion(state, param,
+					  state->cfg->spectral_inversion
+					  ? 1 : 0);
+	if (lg_fail(ret))
+		goto fail;
+
+	state->current_modulation = param->u.vsb.modulation;
+
+	ret = lgdt3305_mpeg_mode(state, state->cfg->mpeg_mode);
+	if (lg_fail(ret))
+		goto fail;
+
+	/* lgdt3305_mpeg_mode_polarity calls lgdt3305_soft_reset */
+	ret = lgdt3305_mpeg_mode_polarity(state,
+					  state->cfg->tpclk_edge,
+					  state->cfg->tpvalid_polarity);
+fail:
+	return ret;
+}
+
 static int lgdt3305_set_parameters(struct dvb_frontend *fe,
 				   struct dvb_frontend_parameters *param)
 {
@@ -847,6 +996,10 @@ static int lgdt3305_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	switch (state->current_modulation) {
 	case QAM_256:
 	case QAM_64:
+#if 0 /* needed w/3304 to set FE_HAS_SIGNAL */
+		if (cr_lock)
+			*status |= FE_HAS_SIGNAL;
+#endif
 		ret = lgdt3305_read_fec_lock_status(state, &fec_lock);
 		if (lg_fail(ret))
 			goto fail;
@@ -992,6 +1145,7 @@ static void lgdt3305_release(struct dvb_frontend *fe)
 	kfree(state);
 }
 
+static struct dvb_frontend_ops lgdt3304_ops;
 static struct dvb_frontend_ops lgdt3305_ops;
 
 struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
@@ -1012,11 +1166,21 @@ struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
 	state->cfg = config;
 	state->i2c_adap = i2c_adap;
 
-	memcpy(&state->frontend.ops, &lgdt3305_ops,
-	       sizeof(struct dvb_frontend_ops));
+	switch (config->demod_chip) {
+	case LGDT3304:
+		memcpy(&state->frontend.ops, &lgdt3304_ops,
+		       sizeof(struct dvb_frontend_ops));
+		break;
+	case LGDT3305:
+		memcpy(&state->frontend.ops, &lgdt3305_ops,
+		       sizeof(struct dvb_frontend_ops));
+		break;
+	default:
+		goto fail;
+	}
 	state->frontend.demodulator_priv = state;
 
-	/* verify that we're talking to a lg dt3305 */
+	/* verify that we're talking to a lg dt3304/5 */
 	ret = lgdt3305_read_reg(state, LGDT3305_GEN_CTRL_2, &val);
 	if ((lg_fail(ret)) | (val == 0))
 		goto fail;
@@ -1035,12 +1199,36 @@ struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
 
 	return &state->frontend;
 fail:
-	lg_warn("unable to detect LGDT3305 hardware\n");
+	lg_warn("unable to detect %s hardware\n",
+		config->demod_chip ? "LGDT3304" : "LGDT3305");
 	kfree(state);
 	return NULL;
 }
 EXPORT_SYMBOL(lgdt3305_attach);
 
+static struct dvb_frontend_ops lgdt3304_ops = {
+	.info = {
+		.name = "LG Electronics LGDT3304 VSB/QAM Frontend",
+		.type               = FE_ATSC,
+		.frequency_min      = 54000000,
+		.frequency_max      = 858000000,
+		.frequency_stepsize = 62500,
+		.caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
+	},
+	.i2c_gate_ctrl        = lgdt3305_i2c_gate_ctrl,
+	.init                 = lgdt3304_init,
+	.sleep                = lgdt3304_sleep,
+	.set_frontend         = lgdt3304_set_parameters,
+	.get_frontend         = lgdt3305_get_frontend,
+	.get_tune_settings    = lgdt3305_get_tune_settings,
+	.read_status          = lgdt3305_read_status,
+	.read_ber             = lgdt3305_read_ber,
+	.read_signal_strength = lgdt3305_read_signal_strength,
+	.read_snr             = lgdt3305_read_snr,
+	.read_ucblocks        = lgdt3305_read_ucblocks,
+	.release              = lgdt3305_release,
+};
+
 static struct dvb_frontend_ops lgdt3305_ops = {
 	.info = {
 		.name = "LG Electronics LGDT3305 VSB/QAM Frontend",
@@ -1064,7 +1252,7 @@ static struct dvb_frontend_ops lgdt3305_ops = {
 	.release              = lgdt3305_release,
 };
 
-MODULE_DESCRIPTION("LG Electronics LGDT3305 ATSC/QAM-B Demodulator Driver");
+MODULE_DESCRIPTION("LG Electronics LGDT3304/5 ATSC/QAM-B Demodulator Driver");
 MODULE_AUTHOR("Michael Krufky <mkrufky at linuxtv.org>");
 MODULE_LICENSE("GPL");
 MODULE_VERSION("0.1");
diff --git a/drivers/media/dvb/frontends/lgdt3305.h b/drivers/media/dvb/frontends/lgdt3305.h
index 9cb11c9..a7f30c2 100644
--- a/drivers/media/dvb/frontends/lgdt3305.h
+++ b/drivers/media/dvb/frontends/lgdt3305.h
@@ -41,6 +41,11 @@ enum lgdt3305_tp_valid_polarity {
 	LGDT3305_TP_VALID_HIGH = 1,
 };
 
+enum lgdt_demod_chip_type {
+	LGDT3305 = 0,
+	LGDT3304 = 1,
+};
+
 struct lgdt3305_config {
 	u8 i2c_addr;
 
@@ -65,6 +70,7 @@ struct lgdt3305_config {
 	enum lgdt3305_mpeg_mode mpeg_mode;
 	enum lgdt3305_tp_clock_edge tpclk_edge;
 	enum lgdt3305_tp_valid_polarity tpvalid_polarity;
+	enum lgdt_demod_chip_type demod_chip;
 };
 
 #if defined(CONFIG_DVB_LGDT3305) || (defined(CONFIG_DVB_LGDT3305_MODULE) && \
-- 
1.6.6


hdpvr-ir-enable.patch:
 Makefile     |    4 +---
 hdpvr-core.c |    7 +++----
 hdpvr-i2c.c  |   40 +++++++++++++++++++++++++++++++++-------
 3 files changed, 37 insertions(+), 14 deletions(-)

Index: hdpvr-ir-enable.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-13/hdpvr-ir-enable.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- hdpvr-ir-enable.patch	28 Sep 2009 05:09:48 -0000	1.6
+++ hdpvr-ir-enable.patch	13 May 2010 04:45:00 -0000	1.7
@@ -0,0 +1,158 @@
+From http://hg.jannau.net/hdpvr/, pending v4l-dvb pull request
+
+---
+ drivers/media/video/hdpvr/Makefile     |    4 +--
+ drivers/media/video/hdpvr/hdpvr-core.c |    7 ++---
+ drivers/media/video/hdpvr/hdpvr-i2c.c  |   40 ++++++++++++++++++++++++++-----
+ 3 files changed, 37 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/media/video/hdpvr/Makefile b/drivers/media/video/hdpvr/Makefile
+index e0230fc..79ad2e1 100644
+--- a/drivers/media/video/hdpvr/Makefile
++++ b/drivers/media/video/hdpvr/Makefile
+@@ -1,6 +1,4 @@
+-hdpvr-objs	:= hdpvr-control.o hdpvr-core.o hdpvr-video.o
+-
+-hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o
++hdpvr-objs	:= hdpvr-control.o hdpvr-core.o hdpvr-i2c.o hdpvr-video.o
+ 
+ obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o
+ 
+diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
+index 188bd5a..779f907 100644
+--- a/drivers/media/video/hdpvr/hdpvr-core.c
++++ b/drivers/media/video/hdpvr/hdpvr-core.c
+@@ -362,9 +362,8 @@ static int hdpvr_probe(struct usb_interface *interface,
+ 		goto error;
+ 	}
+ 
+-#ifdef CONFIG_I2C
+-	/* until i2c is working properly */
+-	retval = 0; /* hdpvr_register_i2c_adapter(dev); */
++#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
++	retval = hdpvr_register_i2c_adapter(dev);
+ 	if (retval < 0) {
+ 		v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n");
+ 		goto error;
+@@ -414,7 +413,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
+ 	mutex_unlock(&dev->io_mutex);
+ 
+ 	/* deregister I2C adapter */
+-#ifdef CONFIG_I2C
++#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ 	mutex_lock(&dev->i2c_mutex);
+ 	if (dev->i2c_adapter)
+ 		i2c_del_adapter(dev->i2c_adapter);
+diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
+index c4b5d15..e0ae619 100644
+--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
++++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
+@@ -10,6 +10,8 @@
+  *
+  */
+ 
++#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
++
+ #include <linux/i2c.h>
+ 
+ #include "hdpvr.h"
+@@ -22,7 +24,7 @@
+ #define REQTYPE_I2C_WRITE_STATT	0xd0
+ 
+ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
+-			  char *data, int len)
++			  char *data, int len, int bus)
+ {
+ 	int ret;
+ 	char *buf = kmalloc(len, GFP_KERNEL);
+@@ -32,7 +34,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
+ 	ret = usb_control_msg(dev->udev,
+ 			      usb_rcvctrlpipe(dev->udev, 0),
+ 			      REQTYPE_I2C_READ, CTRL_READ_REQUEST,
+-			      0x100|addr, 0, buf, len, 1000);
++			      bus<<8 | addr, 0, buf, len, 1000);
+ 
+ 	if (ret == len) {
+ 		memcpy(data, buf, len);
+@@ -46,7 +48,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
+ }
+ 
+ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
+-			   char *data, int len)
++			   char *data, int len, int bus)
+ {
+ 	int ret;
+ 	char *buf = kmalloc(len, GFP_KERNEL);
+@@ -57,7 +59,7 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
+ 	ret = usb_control_msg(dev->udev,
+ 			      usb_sndctrlpipe(dev->udev, 0),
+ 			      REQTYPE_I2C_WRITE, CTRL_WRITE_REQUEST,
+-			      0x100|addr, 0, buf, len, 1000);
++			      bus<<8 | addr, 0, buf, len, 1000);
+ 
+ 	if (ret < 0)
+ 		goto error;
+@@ -67,7 +69,7 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
+ 			      REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST,
+ 			      0, 0, buf, 2, 1000);
+ 
+-	if (ret == 2)
++	if (ret == 2 && buf[1] == (len - 1))
+ 		ret = 0;
+ 	else if (ret >= 0)
+ 		ret = -EIO;
+@@ -93,10 +95,10 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs,
+ 
+ 		if (msgs[i].flags & I2C_M_RD)
+ 			retval = hdpvr_i2c_read(dev, addr, msgs[i].buf,
+-						msgs[i].len);
++						msgs[i].len, 1);
+ 		else
+ 			retval = hdpvr_i2c_write(dev, addr, msgs[i].buf,
+-						 msgs[i].len);
++						 msgs[i].len, 1);
+ 	}
+ 
+ 	mutex_unlock(&dev->i2c_mutex);
+@@ -114,6 +116,26 @@ static struct i2c_algorithm hdpvr_algo = {
+ 	.functionality = hdpvr_functionality,
+ };
+ 
++static int hdpvr_activate_ir(struct hdpvr_device *dev)
++{
++	char buffer[8];
++
++	mutex_lock(&dev->i2c_mutex);
++
++	hdpvr_i2c_read(dev, 0x54, buffer, 1, 0);
++
++	buffer[0] = 0;
++	buffer[1] = 0x8;
++	hdpvr_i2c_write(dev, 0x54, buffer, 2, 1);
++
++	buffer[1] = 0x18;
++	hdpvr_i2c_write(dev, 0x54, buffer, 2, 1);
++
++	mutex_unlock(&dev->i2c_mutex);
++	return 0;
++}
++
++
+ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
+ {
+ 	struct i2c_adapter *i2c_adap;
+@@ -123,6 +145,8 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
+ 	if (i2c_adap == NULL)
+ 		goto error;
+ 
++	hdpvr_activate_ir(dev);
++
+ 	strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",
+ 		sizeof(i2c_adap->name));
+ 	i2c_adap->algo  = &hdpvr_algo;
+@@ -143,3 +167,5 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
+ error:
+ 	return retval;
+ }
++
++#endif /* CONFIG_I2C */


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-13/kernel.spec,v
retrieving revision 1.2030
retrieving revision 1.2031
diff -u -p -r1.2030 -r1.2031
--- kernel.spec	13 May 2010 00:14:48 -0000	1.2030
+++ kernel.spec	13 May 2010 04:45:00 -0000	1.2031
@@ -771,6 +771,11 @@ Patch2904: linux-2.6-v4l-dvb-rebase-gspc
 # Some cherry picked fixes from v4l-dvb-next
 Patch2905: linux-2.6-v4l-dvb-gspca-fixes.patch
 
+# kworld ub435-q/340u usb atsc tuner support (still lingering
+# in one of mkrufky's trees, pending push to v4l-dvb proper)
+Patch2906: linux-2.6-v4l-dvb-add-kworld-a340-support.patch
+Patch2907: linux-2.6-v4l-dvb-add-lgdt3304-support.patch
+
 # fs fixes
 Patch3000: linux-2.6-btrfs-update.patch
 Patch3010: fs-explicitly-pass-in-whether-sb-is-pinned-or-not.patch
@@ -1477,6 +1482,9 @@ ApplyOptionalPatch linux-2.6-v4l-dvb-exp
 ApplyPatch linux-2.6-v4l-dvb-rebase-gspca-to-latest.patch
 ApplyPatch linux-2.6-v4l-dvb-gspca-fixes.patch
 
+ApplyPatch linux-2.6-v4l-dvb-add-kworld-a340-support.patch
+ApplyPatch linux-2.6-v4l-dvb-add-lgdt3304-support.patch
+
 # Patches headed upstream
 ApplyPatch linux-2.6-rfkill-all.patch
 
@@ -2177,6 +2185,9 @@ fi
 # and build.
 
 %changelog
+* Thu May 13 2010 Jarod Wilson <jarod at redhat.com> 2.6.33.4-95
+- Enable support for kworld ub435-q and 340u usb atsc tuners
+
 * Thu May 13 2010 Peter Hutterer <peter.hutterer at redhat.com>
 - linux-2.6-input-clickpad-support.patch: add support for ClickPad
   touchpads (#590835)



More information about the scm-commits mailing list