aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-driver.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-11-16 21:33:41 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:09 -0500
commit3f75c6161f28e6a17c547daf552c1127c805c5e7 (patch)
tree1e4db5013c05946832221bfdca743720091f6582 /drivers/media/video/cx18/cx18-driver.c
parent72a4f8081af1c53a1673c173ce0fdd85c4b7d403 (diff)
V4L/DVB (9724): cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy
cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy so that write retries always occur and read retries never occur (as they never help). Remove MMIO statistics logging to speed up MMIO accesses. Deprecate & ignore retry_mmio and mmio_ndelay module parameters, to essentially force retry_mmio=1 and mmio_ndelay=0. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.c')
-rw-r--r--drivers/media/video/cx18/cx18-driver.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 752ca908ccb1..88ce1e831221 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -78,14 +78,9 @@ static int radio[CX18_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
78 -1, -1, -1, -1, -1, -1, -1, -1, 78 -1, -1, -1, -1, -1, -1, -1, -1,
79 -1, -1, -1, -1, -1, -1, -1, -1, 79 -1, -1, -1, -1, -1, -1, -1, -1,
80 -1, -1, -1, -1, -1, -1, -1, -1 }; 80 -1, -1, -1, -1, -1, -1, -1, -1 };
81static int mmio_ndelay[CX18_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
82 -1, -1, -1, -1, -1, -1, -1, -1,
83 -1, -1, -1, -1, -1, -1, -1, -1,
84 -1, -1, -1, -1, -1, -1, -1, -1 };
85static unsigned cardtype_c = 1; 81static unsigned cardtype_c = 1;
86static unsigned tuner_c = 1; 82static unsigned tuner_c = 1;
87static unsigned radio_c = 1; 83static unsigned radio_c = 1;
88static unsigned mmio_ndelay_c = 1;
89static char pal[] = "--"; 84static char pal[] = "--";
90static char secam[] = "--"; 85static char secam[] = "--";
91static char ntsc[] = "-"; 86static char ntsc[] = "-";
@@ -99,18 +94,20 @@ static int enc_pcm_buffers = CX18_DEFAULT_ENC_PCM_BUFFERS;
99 94
100static int cx18_pci_latency = 1; 95static int cx18_pci_latency = 1;
101 96
102int cx18_retry_mmio = 1; 97static int mmio_ndelay;
98static int retry_mmio = 1;
99
103int cx18_debug; 100int cx18_debug;
104 101
105module_param_array(tuner, int, &tuner_c, 0644); 102module_param_array(tuner, int, &tuner_c, 0644);
106module_param_array(radio, bool, &radio_c, 0644); 103module_param_array(radio, bool, &radio_c, 0644);
107module_param_array(cardtype, int, &cardtype_c, 0644); 104module_param_array(cardtype, int, &cardtype_c, 0644);
108module_param_array(mmio_ndelay, int, &mmio_ndelay_c, 0644);
109module_param_string(pal, pal, sizeof(pal), 0644); 105module_param_string(pal, pal, sizeof(pal), 0644);
110module_param_string(secam, secam, sizeof(secam), 0644); 106module_param_string(secam, secam, sizeof(secam), 0644);
111module_param_string(ntsc, ntsc, sizeof(ntsc), 0644); 107module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
112module_param_named(debug, cx18_debug, int, 0644); 108module_param_named(debug, cx18_debug, int, 0644);
113module_param_named(retry_mmio, cx18_retry_mmio, int, 0644); 109module_param(mmio_ndelay, int, 0644);
110module_param(retry_mmio, int, 0644);
114module_param(cx18_pci_latency, int, 0644); 111module_param(cx18_pci_latency, int, 0644);
115module_param(cx18_first_minor, int, 0644); 112module_param(cx18_first_minor, int, 0644);
116 113
@@ -155,13 +152,11 @@ MODULE_PARM_DESC(cx18_pci_latency,
155 "Change the PCI latency to 64 if lower: 0 = No, 1 = Yes,\n" 152 "Change the PCI latency to 64 if lower: 0 = No, 1 = Yes,\n"
156 "\t\t\tDefault: Yes"); 153 "\t\t\tDefault: Yes");
157MODULE_PARM_DESC(retry_mmio, 154MODULE_PARM_DESC(retry_mmio,
158 "Check and retry memory mapped IO accesses\n" 155 "(Deprecated) MMIO writes are now always checked and retried\n"
159 "\t\t\tDefault: 1 [Yes]"); 156 "\t\t\tEffectively: 1 [Yes]");
160MODULE_PARM_DESC(mmio_ndelay, 157MODULE_PARM_DESC(mmio_ndelay,
161 "Delay (ns) for each CX23418 memory mapped IO access.\n" 158 "(Deprecated) MMIO accesses are now never purposely delayed\n"
162 "\t\t\tTry larger values that are close to a multiple of the\n" 159 "\t\t\tEffectively: 0 ns");
163 "\t\t\tPCI clock period, 30.3 ns, if your card doesn't work.\n"
164 "\t\t\tDefault: " __stringify(CX18_DEFAULT_MMIO_NDELAY));
165MODULE_PARM_DESC(enc_mpg_buffers, 160MODULE_PARM_DESC(enc_mpg_buffers,
166 "Encoder MPG Buffers (in MB)\n" 161 "Encoder MPG Buffers (in MB)\n"
167 "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_MPG_BUFFERS)); 162 "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_MPG_BUFFERS));
@@ -378,11 +373,6 @@ static void cx18_process_options(struct cx18 *cx)
378 cx->options.tuner = tuner[cx->num]; 373 cx->options.tuner = tuner[cx->num];
379 cx->options.radio = radio[cx->num]; 374 cx->options.radio = radio[cx->num];
380 375
381 if (mmio_ndelay[cx->num] < 0)
382 cx->options.mmio_ndelay = CX18_DEFAULT_MMIO_NDELAY;
383 else
384 cx->options.mmio_ndelay = mmio_ndelay[cx->num];
385
386 cx->std = cx18_parse_std(cx); 376 cx->std = cx18_parse_std(cx);
387 if (cx->options.cardtype == -1) { 377 if (cx->options.cardtype == -1) {
388 CX18_INFO("Ignore card\n"); 378 CX18_INFO("Ignore card\n");