aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJemma Denson <jdenson@gmail.com>2015-05-30 14:10:06 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-09 19:57:56 -0400
commitd3525b632a0b5e113fb78b7db84598e082cf903b (patch)
tree7cc11afb150470043ff303ff21e424d513470507
parent25e057fdde3b33c0d18605ed27b59336a3441925 (diff)
[media] b2c2: Add option to skip the first 6 pid filters
The flexcop bridge chip has two banks of hardware pid filters - an initial 6, and on some chip revisions an additional bank of 32. A bug is present on the initial 6 - when changing transponders one of two PAT packets from the old transponder would be included in the initial packets from the new transponder. This usually transpired with userspace programs complaining about services missing, because they are seeing a PAT that they would not be expecting. Running in full TS mode does not exhibit this problem, neither does using just the additional 32. This patch adds in an option to not use the inital 6 and solely use just the additional 32, and enables this option for the SkystarS2 card. Other cards can be added as required if they also have this bug. Signed-off-by: Jemma Denson <jdenson@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/common/b2c2/flexcop-common.h1
-rw-r--r--drivers/media/common/b2c2/flexcop-fe-tuner.c3
-rw-r--r--drivers/media/common/b2c2/flexcop-hw-filter.c16
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/media/common/b2c2/flexcop-common.h b/drivers/media/common/b2c2/flexcop-common.h
index 437912e49824..2b2460e9e6b4 100644
--- a/drivers/media/common/b2c2/flexcop-common.h
+++ b/drivers/media/common/b2c2/flexcop-common.h
@@ -91,6 +91,7 @@ struct flexcop_device {
91 int feedcount; 91 int feedcount;
92 int pid_filtering; 92 int pid_filtering;
93 int fullts_streaming_state; 93 int fullts_streaming_state;
94 int skip_6_hw_pid_filter;
94 95
95 /* bus specific callbacks */ 96 /* bus specific callbacks */
96 flexcop_ibi_value(*read_ibi_reg) (struct flexcop_device *, 97 flexcop_ibi_value(*read_ibi_reg) (struct flexcop_device *,
diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c
index b4e545956c2d..9c59f4306883 100644
--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
@@ -652,6 +652,9 @@ static int skystarS2_rev33_attach(struct flexcop_device *fc,
652 } 652 }
653 info("ISL6421 successfully attached."); 653 info("ISL6421 successfully attached.");
654 654
655 if (fc->has_32_hw_pid_filter)
656 fc->skip_6_hw_pid_filter = 1;
657
655 return 1; 658 return 1;
656} 659}
657#else 660#else
diff --git a/drivers/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c
index 77e45475f4c7..8220257903ef 100644
--- a/drivers/media/common/b2c2/flexcop-hw-filter.c
+++ b/drivers/media/common/b2c2/flexcop-hw-filter.c
@@ -117,6 +117,10 @@ static void flexcop_pid_control(struct flexcop_device *fc,
117 deb_ts("setting pid: %5d %04x at index %d '%s'\n", 117 deb_ts("setting pid: %5d %04x at index %d '%s'\n",
118 pid, pid, index, onoff ? "on" : "off"); 118 pid, pid, index, onoff ? "on" : "off");
119 119
120 /* First 6 can be buggy - skip over them if option set */
121 if (fc->skip_6_hw_pid_filter)
122 index += 6;
123
120 /* We could use bit magic here to reduce source code size. 124 /* We could use bit magic here to reduce source code size.
121 * I decided against it, but to use the real register names */ 125 * I decided against it, but to use the real register names */
122 switch (index) { 126 switch (index) {
@@ -170,7 +174,10 @@ static int flexcop_toggle_fullts_streaming(struct flexcop_device *fc, int onoff)
170int flexcop_pid_feed_control(struct flexcop_device *fc, 174int flexcop_pid_feed_control(struct flexcop_device *fc,
171 struct dvb_demux_feed *dvbdmxfeed, int onoff) 175 struct dvb_demux_feed *dvbdmxfeed, int onoff)
172{ 176{
173 int max_pid_filter = 6 + fc->has_32_hw_pid_filter*32; 177 int max_pid_filter = 6;
178
179 max_pid_filter -= 6 * fc->skip_6_hw_pid_filter;
180 max_pid_filter += 32 * fc->has_32_hw_pid_filter;
174 181
175 fc->feedcount += onoff ? 1 : -1; /* the number of PIDs/Feed currently requested */ 182 fc->feedcount += onoff ? 1 : -1; /* the number of PIDs/Feed currently requested */
176 if (dvbdmxfeed->index >= max_pid_filter) 183 if (dvbdmxfeed->index >= max_pid_filter)
@@ -217,7 +224,12 @@ void flexcop_hw_filter_init(struct flexcop_device *fc)
217{ 224{
218 int i; 225 int i;
219 flexcop_ibi_value v; 226 flexcop_ibi_value v;
220 for (i = 0; i < 6 + 32*fc->has_32_hw_pid_filter; i++) 227 int max_pid_filter = 6;
228
229 max_pid_filter -= 6 * fc->skip_6_hw_pid_filter;
230 max_pid_filter += 32 * fc->has_32_hw_pid_filter;
231
232 for (i = 0; i < max_pid_filter; i++)
221 flexcop_pid_control(fc, i, 0x1fff, 0); 233 flexcop_pid_control(fc, i, 0x1fff, 0);
222 234
223 flexcop_pid_group_filter(fc, 0, 0x1fe0); 235 flexcop_pid_group_filter(fc, 0, 0x1fe0);