All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antti Seppälä" <a.seppala+linux-dvb@gmail.com>
To: Linux DVB <linux-dvb@linuxtv.org>
Subject: [linux-dvb] [PATCH] Cablestar 2 i2c retries
Date: Wed, 26 Nov 2008 20:34:19 +0200	[thread overview]
Message-ID: <492D96AB.9020009@gmail.com> (raw)

Hello.

At some point the Flexcop driver was changed to support newer Flexcop cards.
These modifications however broke the detection of Cablestar 2 DVB-C cards.

The reason is that the earlier version of the driver used to retry
unsuccessful i2c operations. The demodulator of Cablestar 2 cards (stv0297)
seems to be very dependent on these retries and adding them back fixes
Cablestar detection.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>

diff -r 8aabdabb517c linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
--- a/linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c	Tue Nov 25 14:10:14 2008 -0200
+++ b/linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c	Wed Nov 26 20:05:36 2008 +0200
@@ -628,12 +628,14 @@
 	}
 
 	/* try the cable dvb (stv0297) */
+	fc->fc_i2c_adap[0].no_base_addr = 1;
 	fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, i2c);
 	if (fc->fe != NULL) {
 		fc->dev_type = FC_CABLE;
 		fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params;
 		goto fe_found;
 	}
+	fc->fc_i2c_adap[0].no_base_addr = 0;
 
 	/* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
 	fc->fe = dvb_attach(mt312_attach,
diff -r 8aabdabb517c linux/drivers/media/dvb/b2c2/flexcop-i2c.c
--- a/linux/drivers/media/dvb/b2c2/flexcop-i2c.c	Tue Nov 25 14:10:14 2008 -0200
+++ b/linux/drivers/media/dvb/b2c2/flexcop-i2c.c	Wed Nov 26 20:05:36 2008 +0200
@@ -47,8 +47,12 @@
 	int len = r100.tw_sm_c_100.total_bytes, /* remember total_bytes is buflen-1 */
 		ret;
 
-	r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr;
 	ret = flexcop_i2c_operation(i2c->fc, &r100);
+	if (ret != 0) {
+		deb_i2c("Retrying operation\n");
+		r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr;
+		ret = flexcop_i2c_operation(i2c->fc, &r100);
+	}
 	if (ret != 0) {
 		deb_i2c("read failed. %d\n", ret);
 		return ret;

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

             reply	other threads:[~2008-11-26 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26 18:34 Antti Seppälä [this message]
2008-12-01 11:26 ` [linux-dvb] [PATCH] Cablestar 2 i2c retries Patrick Boettcher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492D96AB.9020009@gmail.com \
    --to=a.seppala+linux-dvb@gmail.com \
    --cc=linux-dvb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.