All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror
@ 2010-09-07 15:50 pboettcher
  2010-09-07 15:50 ` [PATCH 2/2] V4L/DVB: dib7000p: add disable sample and hold, and diversity delay parameter pboettcher
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: pboettcher @ 2010-09-07 15:50 UTC (permalink / raw)
  To: linux-media; +Cc: Olivier Grenie, stable, Patrick Boettcher

From: Olivier Grenie <olivier.grenie@dibcom.fr>

To improve performance on DiB7770-devices enabling the current mirror
is needed.

This patch adds an option to the dib7000p-driver to do that and it
creates a separate device-entry in dib0700-device to use those changes
on hardware which is using the DiB7770.

Cc: stable@kernel.org

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
---
 drivers/media/dvb/dvb-usb/dib0700_devices.c |   53 ++++++++++++++++++++++++++-
 drivers/media/dvb/frontends/dib7000p.c      |    2 +
 drivers/media/dvb/frontends/dib7000p.h      |    3 ++
 3 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index f634d2e..f9766c7 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -940,6 +940,57 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
 	return adap->fe == NULL ? -ENODEV : 0;
 }
 
+/* STK7770P */
+static struct dib7000p_config dib7770p_dib7000p_config = {
+	.output_mpeg2_in_188_bytes = 1,
+
+	.agc_config_count = 1,
+	.agc = &dib7070_agc_config,
+	.bw  = &dib7070_bw_config_12_mhz,
+	.tuner_is_baseband = 1,
+	.spur_protect = 1,
+
+	.gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
+	.gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
+	.gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
+
+	.hostbus_diversity = 1,
+	.enable_current_mirror = 1,
+};
+
+static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
+{
+	struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
+	if (p->idVendor  == cpu_to_le16(USB_VID_PINNACLE) &&
+	    p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
+		dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
+	else
+		dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
+	msleep(10);
+	dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
+	dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
+	dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
+	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
+
+	dib0700_ctrl_clock(adap->dev, 72, 1);
+
+	msleep(10);
+	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
+	msleep(10);
+	dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
+
+	if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
+				     &dib7770p_dib7000p_config) != 0) {
+		err("%s: dib7000p_i2c_enumeration failed.  Cannot continue\n",
+		    __func__);
+		return -ENODEV;
+	}
+
+	adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
+		&dib7770p_dib7000p_config);
+	return adap->fe == NULL ? -ENODEV : 0;
+}
+
 /* DIB807x generic */
 static struct dibx000_agc_config dib807x_agc_config[2] = {
 	{
@@ -2406,7 +2457,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
 				.pid_filter_count = 32,
 				.pid_filter       = stk70x0p_pid_filter,
 				.pid_filter_ctrl  = stk70x0p_pid_filter_ctrl,
-				.frontend_attach  = stk7070p_frontend_attach,
+				.frontend_attach  = stk7770p_frontend_attach,
 				.tuner_attach     = dib7770p_tuner_attach,
 
 				DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index 2e28b97..73f59ab 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -260,6 +260,8 @@ static void dib7000p_set_adc_state(struct dib7000p_state *state, enum dibx000_ad
 
 //	dprintk( "908: %x, 909: %x\n", reg_908, reg_909);
 
+	reg_908 |= (state->cfg.enable_current_mirror & 1) << 7;
+
 	dib7000p_write_word(state, 908, reg_908);
 	dib7000p_write_word(state, 909, reg_909);
 }
diff --git a/drivers/media/dvb/frontends/dib7000p.h b/drivers/media/dvb/frontends/dib7000p.h
index 805dd13..04a7449 100644
--- a/drivers/media/dvb/frontends/dib7000p.h
+++ b/drivers/media/dvb/frontends/dib7000p.h
@@ -33,6 +33,9 @@ struct dib7000p_config {
 	int (*agc_control) (struct dvb_frontend *, u8 before);
 
 	u8 output_mode;
+
+	u8 enable_current_mirror : 1;
+
 };
 
 #define DEFAULT_DIB7000P_I2C_ADDRESS 18
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] V4L/DVB: dib7000p: add disable sample and hold, and diversity delay parameter
  2010-09-07 15:50 [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror pboettcher
@ 2010-09-07 15:50 ` pboettcher
  2010-09-07 15:58 ` [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror Patrick Boettcher
  2010-10-19 23:52 ` [stable] " Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: pboettcher @ 2010-09-07 15:50 UTC (permalink / raw)
  To: linux-media; +Cc: Olivier Grenie, Patrick Boettcher

From: Olivier Grenie <olivier.grenie@dibcom.fr>

This patch improves the overall driver performance in
diversity-reception scenarios.

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
---
 drivers/media/dvb/dvb-usb/dib0700_devices.c |    1 +
 drivers/media/dvb/frontends/dib7000p.c      |    6 +++++-
 drivers/media/dvb/frontends/dib7000p.h      |    2 ++
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index f9766c7..6015cfd 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -956,6 +956,7 @@ static struct dib7000p_config dib7770p_dib7000p_config = {
 
 	.hostbus_diversity = 1,
 	.enable_current_mirror = 1,
+	.disable_sample_and_hold = 0,
 };
 
 static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index 73f59ab..3aed0d4 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -260,6 +260,7 @@ static void dib7000p_set_adc_state(struct dib7000p_state *state, enum dibx000_ad
 
 //	dprintk( "908: %x, 909: %x\n", reg_908, reg_909);
 
+	reg_909 |= (state->cfg.disable_sample_and_hold & 1) << 4;
 	reg_908 |= (state->cfg.enable_current_mirror & 1) << 7;
 
 	dib7000p_write_word(state, 908, reg_908);
@@ -780,7 +781,10 @@ static void dib7000p_set_channel(struct dib7000p_state *state, struct dvb_fronte
 		default:
 		case GUARD_INTERVAL_1_32: value *= 1; break;
 	}
-	state->div_sync_wait = (value * 3) / 2 + 32; // add 50% SFN margin + compensate for one DVSY-fifo TODO
+	if (state->cfg.diversity_delay == 0)
+		state->div_sync_wait = (value * 3) / 2 + 48; // add 50% SFN margin + compensate for one DVSY-fifo
+	else
+		state->div_sync_wait = (value * 3) / 2 + state->cfg.diversity_delay; // add 50% SFN margin + compensate for one DVSY-fifo
 
 	/* deactive the possibility of diversity reception if extended interleaver */
 	state->div_force_off = !1 && ch->u.ofdm.transmission_mode != TRANSMISSION_MODE_8K;
diff --git a/drivers/media/dvb/frontends/dib7000p.h b/drivers/media/dvb/frontends/dib7000p.h
index 04a7449..da17345 100644
--- a/drivers/media/dvb/frontends/dib7000p.h
+++ b/drivers/media/dvb/frontends/dib7000p.h
@@ -33,8 +33,10 @@ struct dib7000p_config {
 	int (*agc_control) (struct dvb_frontend *, u8 before);
 
 	u8 output_mode;
+	u8 disable_sample_and_hold : 1;
 
 	u8 enable_current_mirror : 1;
+	u8 diversity_delay;
 
 };
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror
  2010-09-07 15:50 [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror pboettcher
  2010-09-07 15:50 ` [PATCH 2/2] V4L/DVB: dib7000p: add disable sample and hold, and diversity delay parameter pboettcher
@ 2010-09-07 15:58 ` Patrick Boettcher
  2010-09-08 23:16   ` Mauro Carvalho Chehab
  2010-10-19 23:52 ` [stable] " Greg KH
  2 siblings, 1 reply; 6+ messages in thread
From: Patrick Boettcher @ 2010-09-07 15:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media

Hi Mauro,

On Tuesday 07 September 2010 17:50:45 pboettcher@kernellabs.com wrote:
> From: Olivier Grenie <olivier.grenie@dibcom.fr>
> 
> To improve performance on DiB7770-devices enabling the current mirror
> is needed.
> 
> This patch adds an option to the dib7000p-driver to do that and it
> creates a separate device-entry in dib0700-device to use those changes
> on hardware which is using the DiB7770.
> 
> Cc: stable@kernel.org
> 
> Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
> ---
>  drivers/media/dvb/dvb-usb/dib0700_devices.c |   53
> ++++++++++++++++++++++++++- drivers/media/dvb/frontends/dib7000p.c      | 
>   2 +
>  drivers/media/dvb/frontends/dib7000p.h      |    3 ++
>  3 files changed, 57 insertions(+), 1 deletions(-)

This is the patch I was talking to you about in my last Email. This one needs 
to be quickly applied to 2.6.35. Well ... quickly ... as soon as possible in  
sense of when you have a free time slot.

This patch help to optimize the performance of the DiB7770-chip which can be 
found in several devices out there right now.

It was tested and applied on 2.6.36-rc3, It should apply cleanly on 2.6.35.

Thanks in advance for your help,

Patrick.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror
  2010-09-07 15:58 ` [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror Patrick Boettcher
@ 2010-09-08 23:16   ` Mauro Carvalho Chehab
  2010-09-09  7:32     ` Patrick Boettcher
  0 siblings, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2010-09-08 23:16 UTC (permalink / raw)
  To: Patrick Boettcher; +Cc: linux-media

Em 07-09-2010 12:58, Patrick Boettcher escreveu:
> Hi Mauro,
> 
> On Tuesday 07 September 2010 17:50:45 pboettcher@kernellabs.com wrote:
>> From: Olivier Grenie <olivier.grenie@dibcom.fr>
>>
>> To improve performance on DiB7770-devices enabling the current mirror
>> is needed.
>>
>> This patch adds an option to the dib7000p-driver to do that and it
>> creates a separate device-entry in dib0700-device to use those changes
>> on hardware which is using the DiB7770.
>>
>> Cc: stable@kernel.org
>>
>> Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
>> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
>> ---
>>  drivers/media/dvb/dvb-usb/dib0700_devices.c |   53
>> ++++++++++++++++++++++++++- drivers/media/dvb/frontends/dib7000p.c      | 
>>   2 +
>>  drivers/media/dvb/frontends/dib7000p.h      |    3 ++
>>  3 files changed, 57 insertions(+), 1 deletions(-)
> 
> This is the patch I was talking to you about in my last Email. This one needs 
> to be quickly applied to 2.6.35. Well ... quickly ... as soon as possible in  
> sense of when you have a free time slot.
> 
> This patch help to optimize the performance of the DiB7770-chip which can be 
> found in several devices out there right now.
> 
> It was tested and applied on 2.6.36-rc3, It should apply cleanly on 2.6.35.

Ok. Patch 2/2 is also important for -stable?

> 
> Thanks in advance for your help,
> 
> Patrick.

Cheers,
Mauro

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror
  2010-09-08 23:16   ` Mauro Carvalho Chehab
@ 2010-09-09  7:32     ` Patrick Boettcher
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick Boettcher @ 2010-09-09  7:32 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media

On Thursday 09 September 2010 01:16:09 Mauro Carvalho Chehab wrote:
> Em 07-09-2010 12:58, Patrick Boettcher escreveu:
> > Hi Mauro,
> > 
> > On Tuesday 07 September 2010 17:50:45 pboettcher@kernellabs.com wrote:
> >> From: Olivier Grenie <olivier.grenie@dibcom.fr>
> >> 
> >> To improve performance on DiB7770-devices enabling the current mirror
> >> is needed.
> >> 
> >> This patch adds an option to the dib7000p-driver to do that and it
> >> creates a separate device-entry in dib0700-device to use those changes
> >> on hardware which is using the DiB7770.
> >> 
> >> Cc: stable@kernel.org
> >> 
> >> Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
> >> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
> >> ---
> >> 
> >>  drivers/media/dvb/dvb-usb/dib0700_devices.c |   53
> >> 
> >> ++++++++++++++++++++++++++- drivers/media/dvb/frontends/dib7000p.c     
> >> |
> >> 
> >>   2 +
> >>  
> >>  drivers/media/dvb/frontends/dib7000p.h      |    3 ++
> >>  3 files changed, 57 insertions(+), 1 deletions(-)
> > 
> > This is the patch I was talking to you about in my last Email. This one
> > needs to be quickly applied to 2.6.35. Well ... quickly ... as soon as
> > possible in sense of when you have a free time slot.
> > 
> > This patch help to optimize the performance of the DiB7770-chip which can
> > be found in several devices out there right now.
> > 
> > It was tested and applied on 2.6.36-rc3, It should apply cleanly on
> > 2.6.35.
> 
> Ok. Patch 2/2 is also important for -stable?

No. Only 1/2 is needed.

Thanks for your response.

Patrick.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable] [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror
  2010-09-07 15:50 [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror pboettcher
  2010-09-07 15:50 ` [PATCH 2/2] V4L/DVB: dib7000p: add disable sample and hold, and diversity delay parameter pboettcher
  2010-09-07 15:58 ` [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror Patrick Boettcher
@ 2010-10-19 23:52 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2010-10-19 23:52 UTC (permalink / raw)
  To: pboettcher; +Cc: linux-media, Olivier Grenie, stable, Patrick Boettcher

On Tue, Sep 07, 2010 at 05:50:45PM +0200, pboettcher@kernellabs.com wrote:
> From: Olivier Grenie <olivier.grenie@dibcom.fr>
> 
> To improve performance on DiB7770-devices enabling the current mirror
> is needed.
> 
> This patch adds an option to the dib7000p-driver to do that and it
> creates a separate device-entry in dib0700-device to use those changes
> on hardware which is using the DiB7770.
> 
> Cc: stable@kernel.org
> 
> Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>

This does not seem like -stable material, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-20  0:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-07 15:50 [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror pboettcher
2010-09-07 15:50 ` [PATCH 2/2] V4L/DVB: dib7000p: add disable sample and hold, and diversity delay parameter pboettcher
2010-09-07 15:58 ` [PATCH 1/2] V4L/DVB: dib7770: enable the current mirror Patrick Boettcher
2010-09-08 23:16   ` Mauro Carvalho Chehab
2010-09-09  7:32     ` Patrick Boettcher
2010-10-19 23:52 ` [stable] " Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.