diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2010-05-16 05:07:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:20:14 -0400 |
commit | 5a2a1848a7d744a437f96b79a655c13b8090e74d (patch) | |
tree | fd29215d133ba34a32e8c111a2e6fdeb35f36d4c | |
parent | 4387418129895fd9aa2e2f6368ea69e9c4ddd0f2 (diff) |
V4L/DVB: ngene: Make command timeout workaround configurable
Make command timeout workaround configurable,
activate it for firmware version <= 17.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/ngene/ngene-core.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb/ngene/ngene-dvb.c | 14 | ||||
-rw-r--r-- | drivers/media/dvb/ngene/ngene.h | 1 |
3 files changed, 8 insertions, 16 deletions
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index 35bed6095b1e..2bdcf59829d1 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
@@ -53,8 +53,6 @@ MODULE_PARM_DESC(debug, "Print debugging information."); | |||
53 | 53 | ||
54 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 54 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
55 | 55 | ||
56 | #define COMMAND_TIMEOUT_WORKAROUND | ||
57 | |||
58 | #define dprintk if (debug) printk | 56 | #define dprintk if (debug) printk |
59 | 57 | ||
60 | #define ngwriteb(dat, adr) writeb((dat), (char *)(dev->iomem + (adr))) | 58 | #define ngwriteb(dat, adr) writeb((dat), (char *)(dev->iomem + (adr))) |
@@ -1252,14 +1250,17 @@ static int ngene_load_firm(struct ngene *dev) | |||
1252 | version = 15; | 1250 | version = 15; |
1253 | size = 23466; | 1251 | size = 23466; |
1254 | fw_name = "ngene_15.fw"; | 1252 | fw_name = "ngene_15.fw"; |
1253 | dev->cmd_timeout_workaround = true; | ||
1255 | break; | 1254 | break; |
1256 | case 16: | 1255 | case 16: |
1257 | size = 23498; | 1256 | size = 23498; |
1258 | fw_name = "ngene_16.fw"; | 1257 | fw_name = "ngene_16.fw"; |
1258 | dev->cmd_timeout_workaround = true; | ||
1259 | break; | 1259 | break; |
1260 | case 17: | 1260 | case 17: |
1261 | size = 24446; | 1261 | size = 24446; |
1262 | fw_name = "ngene_17.fw"; | 1262 | fw_name = "ngene_17.fw"; |
1263 | dev->cmd_timeout_workaround = true; | ||
1263 | break; | 1264 | break; |
1264 | } | 1265 | } |
1265 | 1266 | ||
@@ -1410,10 +1411,8 @@ static void release_channel(struct ngene_channel *chan) | |||
1410 | struct ngene_info *ni = dev->card_info; | 1411 | struct ngene_info *ni = dev->card_info; |
1411 | int io = ni->io_type[chan->number]; | 1412 | int io = ni->io_type[chan->number]; |
1412 | 1413 | ||
1413 | #ifdef COMMAND_TIMEOUT_WORKAROUND | 1414 | if (chan->dev->cmd_timeout_workaround && chan->running) |
1414 | if (chan->running) | ||
1415 | set_transfer(chan, 0); | 1415 | set_transfer(chan, 0); |
1416 | #endif | ||
1417 | 1416 | ||
1418 | tasklet_kill(&chan->demux_tasklet); | 1417 | tasklet_kill(&chan->demux_tasklet); |
1419 | 1418 | ||
diff --git a/drivers/media/dvb/ngene/ngene-dvb.c b/drivers/media/dvb/ngene/ngene-dvb.c index 96013eb353cd..61a932c1cfff 100644 --- a/drivers/media/dvb/ngene/ngene-dvb.c +++ b/drivers/media/dvb/ngene/ngene-dvb.c | |||
@@ -44,8 +44,6 @@ | |||
44 | 44 | ||
45 | #include "ngene.h" | 45 | #include "ngene.h" |
46 | 46 | ||
47 | #define COMMAND_TIMEOUT_WORKAROUND | ||
48 | |||
49 | 47 | ||
50 | /****************************************************************************/ | 48 | /****************************************************************************/ |
51 | /* COMMAND API interface ****************************************************/ | 49 | /* COMMAND API interface ****************************************************/ |
@@ -69,9 +67,7 @@ void *tsin_exchange(void *priv, void *buf, u32 len, u32 clock, u32 flags) | |||
69 | struct ngene_channel *chan = priv; | 67 | struct ngene_channel *chan = priv; |
70 | 68 | ||
71 | 69 | ||
72 | #ifdef COMMAND_TIMEOUT_WORKAROUND | ||
73 | if (chan->users > 0) | 70 | if (chan->users > 0) |
74 | #endif | ||
75 | dvb_dmx_swfilter(&chan->demux, buf, len); | 71 | dvb_dmx_swfilter(&chan->demux, buf, len); |
76 | return NULL; | 72 | return NULL; |
77 | } | 73 | } |
@@ -106,11 +102,8 @@ int ngene_start_feed(struct dvb_demux_feed *dvbdmxfeed) | |||
106 | struct ngene_channel *chan = dvbdmx->priv; | 102 | struct ngene_channel *chan = dvbdmx->priv; |
107 | 103 | ||
108 | if (chan->users == 0) { | 104 | if (chan->users == 0) { |
109 | #ifdef COMMAND_TIMEOUT_WORKAROUND | 105 | if (!chan->dev->cmd_timeout_workaround || !chan->running) |
110 | if (!chan->running) | ||
111 | #endif | ||
112 | set_transfer(chan, 1); | 106 | set_transfer(chan, 1); |
113 | /* msleep(10); */ | ||
114 | } | 107 | } |
115 | 108 | ||
116 | return ++chan->users; | 109 | return ++chan->users; |
@@ -124,9 +117,8 @@ int ngene_stop_feed(struct dvb_demux_feed *dvbdmxfeed) | |||
124 | if (--chan->users) | 117 | if (--chan->users) |
125 | return chan->users; | 118 | return chan->users; |
126 | 119 | ||
127 | #ifndef COMMAND_TIMEOUT_WORKAROUND | 120 | if (!chan->dev->cmd_timeout_workaround) |
128 | set_transfer(chan, 0); | 121 | set_transfer(chan, 0); |
129 | #endif | ||
130 | 122 | ||
131 | return 0; | 123 | return 0; |
132 | } | 124 | } |
diff --git a/drivers/media/dvb/ngene/ngene.h b/drivers/media/dvb/ngene/ngene.h index b951d59e3617..8fb4200f83f8 100644 --- a/drivers/media/dvb/ngene/ngene.h +++ b/drivers/media/dvb/ngene/ngene.h | |||
@@ -726,6 +726,7 @@ struct ngene { | |||
726 | u32 fw_interface_version; | 726 | u32 fw_interface_version; |
727 | u32 icounts; | 727 | u32 icounts; |
728 | bool msi_enabled; | 728 | bool msi_enabled; |
729 | bool cmd_timeout_workaround; | ||
729 | 730 | ||
730 | u8 *CmdDoneByte; | 731 | u8 *CmdDoneByte; |
731 | int BootFirmware; | 732 | int BootFirmware; |