diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-27 19:28:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-27 19:28:18 -0500 |
commit | 174eef11a2c452cfa0c1e5bc6f759251fbc74d79 (patch) | |
tree | 6f2149ab42eaadab0fc4a33dce9034588af8a08c | |
parent | 5cf8cf4146de03de67d1a8aefbece66b65f255cc (diff) | |
parent | b391d0f08fb0858f7d2cc034ddcca6cd0545bd7d (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
V4L/DVB (10696): Remove outdated README for the flexcop-driver
V4L/DVB (10695): Update Technisat card documentation
V4L/DVB (10694): [PATCH] software IRQ watchdog for Flexcop B2C2 DVB PCI cards
V4L/DVB (10663): soc-camera: fix S_CROP breakage on PXA and SuperH
V4L/DVB (10659): em28xx: register device to soundcard for sysfs
-rw-r--r-- | Documentation/dvb/README.flexcop | 205 | ||||
-rw-r--r-- | Documentation/dvb/technisat.txt | 34 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-hw-filter.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-pci.c | 65 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop.c | 3 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 2 | ||||
-rw-r--r-- | drivers/media/video/pxa_camera.c | 26 | ||||
-rw-r--r-- | drivers/media/video/sh_mobile_ceu_camera.c | 13 |
8 files changed, 84 insertions, 265 deletions
diff --git a/Documentation/dvb/README.flexcop b/Documentation/dvb/README.flexcop deleted file mode 100644 index 5515469de7cf..000000000000 --- a/Documentation/dvb/README.flexcop +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | This README escorted the skystar2-driver rewriting procedure. It describes the | ||
2 | state of the new flexcop-driver set and some internals are written down here | ||
3 | too. | ||
4 | |||
5 | This document hopefully describes things about the flexcop and its | ||
6 | device-offsprings. Goal was to write an easy-to-write and easy-to-read set of | ||
7 | drivers based on the skystar2.c and other information. | ||
8 | |||
9 | Remark: flexcop-pci.c was a copy of skystar2.c, but every line has been | ||
10 | touched and rewritten. | ||
11 | |||
12 | History & News | ||
13 | ============== | ||
14 | 2005-04-01 - correct USB ISOC transfers (thanks to Vadim Catana) | ||
15 | |||
16 | |||
17 | |||
18 | |||
19 | General coding processing | ||
20 | ========================= | ||
21 | |||
22 | We should proceed as follows (as long as no one complains): | ||
23 | |||
24 | 0) Think before start writing code! | ||
25 | |||
26 | 1) rewriting the skystar2.c with the help of the flexcop register descriptions | ||
27 | and splitting up the files to a pci-bus-part and a flexcop-part. | ||
28 | The new driver will be called b2c2-flexcop-pci.ko/b2c2-flexcop-usb.ko for the | ||
29 | device-specific part and b2c2-flexcop.ko for the common flexcop-functions. | ||
30 | |||
31 | 2) Search for errors in the leftover of flexcop-pci.c (compare with pluto2.c | ||
32 | and other pci drivers) | ||
33 | |||
34 | 3) make some beautification (see 'Improvements when rewriting (refactoring) is | ||
35 | done') | ||
36 | |||
37 | 4) Testing the new driver and maybe substitute the skystar2.c with it, to reach | ||
38 | a wider tester audience. | ||
39 | |||
40 | 5) creating an usb-bus-part using the already written flexcop code for the pci | ||
41 | card. | ||
42 | |||
43 | Idea: create a kernel-object for the flexcop and export all important | ||
44 | functions. This option saves kernel-memory, but maybe a lot of functions have | ||
45 | to be exported to kernel namespace. | ||
46 | |||
47 | |||
48 | Current situation | ||
49 | ================= | ||
50 | |||
51 | 0) Done :) | ||
52 | 1) Done (some minor issues left) | ||
53 | 2) Done | ||
54 | 3) Not ready yet, more information is necessary | ||
55 | 4) next to be done (see the table below) | ||
56 | 5) USB driver is working (yes, there are some minor issues) | ||
57 | |||
58 | What seems to be ready? | ||
59 | ----------------------- | ||
60 | |||
61 | 1) Rewriting | ||
62 | 1a) i2c is cut off from the flexcop-pci.c and seems to work | ||
63 | 1b) moved tuner and demod stuff from flexcop-pci.c to flexcop-tuner-fe.c | ||
64 | 1c) moved lnb and diseqc stuff from flexcop-pci.c to flexcop-tuner-fe.c | ||
65 | 1e) eeprom (reading MAC address) | ||
66 | 1d) sram (no dynamic sll size detection (commented out) (using default as JJ told me)) | ||
67 | 1f) misc. register accesses for reading parameters (e.g. resetting, revision) | ||
68 | 1g) pid/mac filter (flexcop-hw-filter.c) | ||
69 | 1i) dvb-stuff initialization in flexcop.c (done) | ||
70 | 1h) dma stuff (now just using the size-irq, instead of all-together, to be done) | ||
71 | 1j) remove flexcop initialization from flexcop-pci.c completely (done) | ||
72 | 1l) use a well working dma IRQ method (done, see 'Known bugs and problems and TODO') | ||
73 | 1k) cleanup flexcop-files (remove unused EXPORT_SYMBOLs, make static from | ||
74 | non-static where possible, moved code to proper places) | ||
75 | |||
76 | 2) Search for errors in the leftover of flexcop-pci.c (partially done) | ||
77 | 5a) add MAC address reading | ||
78 | 5c) feeding of ISOC data to the software demux (format of the isochronous data | ||
79 | and speed optimization, no real error) (thanks to Vadim Catana) | ||
80 | |||
81 | What to do in the near future? | ||
82 | -------------------------------------- | ||
83 | (no special order here) | ||
84 | |||
85 | 5) USB driver | ||
86 | 5b) optimize isoc-transfer (submitting/killing isoc URBs when transfer is starting) | ||
87 | |||
88 | Testing changes | ||
89 | --------------- | ||
90 | |||
91 | O = item is working | ||
92 | P = item is partially working | ||
93 | X = item is not working | ||
94 | N = item does not apply here | ||
95 | <empty field> = item need to be examined | ||
96 | |||
97 | | PCI | USB | ||
98 | item | mt352 | nxt2002 | stv0299 | mt312 | mt352 | nxt2002 | stv0299 | mt312 | ||
99 | -------+-------+---------+---------+-------+-------+---------+---------+------- | ||
100 | 1a) | O | | | | N | N | N | N | ||
101 | 1b) | O | | | | | | O | | ||
102 | 1c) | N | N | | | N | N | O | | ||
103 | 1d) | O | O | ||
104 | 1e) | O | O | ||
105 | 1f) | P | ||
106 | 1g) | O | ||
107 | 1h) | P | | ||
108 | 1i) | O | N | ||
109 | 1j) | O | N | ||
110 | 1l) | O | N | ||
111 | 2) | O | N | ||
112 | 5a) | N | O | ||
113 | 5b)* | N | | ||
114 | 5c) | N | O | ||
115 | |||
116 | * - not done yet | ||
117 | |||
118 | Known bugs and problems and TODO | ||
119 | -------------------------------- | ||
120 | |||
121 | 1g/h/l) when pid filtering is enabled on the pci card | ||
122 | |||
123 | DMA usage currently: | ||
124 | The DMA is splitted in 2 equal-sized subbuffers. The Flexcop writes to first | ||
125 | address and triggers an IRQ when it's full and starts writing to the second | ||
126 | address. When the second address is full, the IRQ is triggered again, and | ||
127 | the flexcop writes to first address again, and so on. | ||
128 | The buffersize of each address is currently 640*188 bytes. | ||
129 | |||
130 | Problem is, when using hw-pid-filtering and doing some low-bandwidth | ||
131 | operation (like scanning) the buffers won't be filled enough to trigger | ||
132 | the IRQ. That's why: | ||
133 | |||
134 | When PID filtering is activated, the timer IRQ is used. Every 1.97 ms the IRQ | ||
135 | is triggered. Is the current write address of DMA1 different to the one | ||
136 | during the last IRQ, then the data is passed to the demuxer. | ||
137 | |||
138 | There is an additional DMA-IRQ-method: packet count IRQ. This isn't | ||
139 | implemented correctly yet. | ||
140 | |||
141 | The solution is to disable HW PID filtering, but I don't know how the DVB | ||
142 | API software demux behaves on slow systems with 45MBit/s TS. | ||
143 | |||
144 | Solved bugs :) | ||
145 | -------------- | ||
146 | 1g) pid-filtering (somehow pid index 4 and 5 (EMM_PID and ECM_PID) aren't | ||
147 | working) | ||
148 | SOLUTION: also index 0 was affected, because net_translation is done for | ||
149 | these indexes by default | ||
150 | |||
151 | 5b) isochronous transfer does only work in the first attempt (for the Sky2PC | ||
152 | USB, Air2PC is working) SOLUTION: the flexcop was going asleep and never really | ||
153 | woke up again (don't know if this need fixes, see | ||
154 | flexcop-fe-tuner.c:flexcop_sleep) | ||
155 | |||
156 | NEWS: when the driver is loaded and unloaded and loaded again (w/o doing | ||
157 | anything in the while the driver is loaded the first time), no transfers take | ||
158 | place anymore. | ||
159 | |||
160 | Improvements when rewriting (refactoring) is done | ||
161 | ================================================= | ||
162 | |||
163 | - split sleeping of the flexcop (misc_204.ACPI3_sig = 1;) from lnb_control | ||
164 | (enable sleeping for other demods than dvb-s) | ||
165 | - add support for CableStar (stv0297 Microtune 203x/ALPS) (almost done, incompatibilities with the Nexus-CA) | ||
166 | |||
167 | Debugging | ||
168 | --------- | ||
169 | - add verbose debugging to skystar2.c (dump the reg_dw_data) and compare it | ||
170 | with this flexcop, this is important, because i2c is now using the | ||
171 | flexcop_ibi_value union from flexcop-reg.h (do you have a better idea for | ||
172 | that, please tell us so). | ||
173 | |||
174 | Everything which is identical in the following table, can be put into a common | ||
175 | flexcop-module. | ||
176 | |||
177 | PCI USB | ||
178 | ------------------------------------------------------------------------------- | ||
179 | Different: | ||
180 | Register access: accessing IO memory USB control message | ||
181 | I2C bus: I2C bus of the FC USB control message | ||
182 | Data transfer: DMA isochronous transfer | ||
183 | EEPROM transfer: through i2c bus not clear yet | ||
184 | |||
185 | Identical: | ||
186 | Streaming: accessing registers | ||
187 | PID Filtering: accessing registers | ||
188 | Sram destinations: accessing registers | ||
189 | Tuner/Demod: I2C bus | ||
190 | DVB-stuff: can be written for common use | ||
191 | |||
192 | Acknowledgements (just for the rewriting part) | ||
193 | ================ | ||
194 | |||
195 | Bjarne Steinsbo thought a lot in the first place of the pci part for this code | ||
196 | sharing idea. | ||
197 | |||
198 | Andreas Oberritter for providing a recent PCI initialization template | ||
199 | (pluto2.c). | ||
200 | |||
201 | Boleslaw Ciesielski for pointing out a problem with firmware loader. | ||
202 | |||
203 | Vadim Catana for correcting the USB transfer. | ||
204 | |||
205 | comments, critics and ideas to linux-dvb@linuxtv.org. | ||
diff --git a/Documentation/dvb/technisat.txt b/Documentation/dvb/technisat.txt index cdf6ee4b2da1..3f435ffb289c 100644 --- a/Documentation/dvb/technisat.txt +++ b/Documentation/dvb/technisat.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | How to set up the Technisat devices | 1 | How to set up the Technisat/B2C2 Flexcop devices |
2 | =================================== | 2 | ================================================ |
3 | 3 | ||
4 | 1) Find out what device you have | 4 | 1) Find out what device you have |
5 | ================================ | 5 | ================================ |
@@ -16,54 +16,60 @@ DVB: registering frontend 0 (Conexant CX24123/CX24109)... | |||
16 | 16 | ||
17 | If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one: | 17 | If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one: |
18 | "Multimedia devices" => "Customise analog and hybrid tuner modules to build" | 18 | "Multimedia devices" => "Customise analog and hybrid tuner modules to build" |
19 | In this directory uncheck every driver which is activated there. | 19 | In this directory uncheck every driver which is activated there (except "Simple tuner support" for case 9 only). |
20 | 20 | ||
21 | Then please activate: | 21 | Then please activate: |
22 | 2a) Main module part: | 22 | 2a) Main module part: |
23 | 23 | ||
24 | a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" | 24 | a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" |
25 | b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card OR | 25 | b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card |
26 | OR | ||
26 | c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter | 27 | c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter |
27 | d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers" | 28 | d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers" |
28 | Notice: d.) is helpful for troubleshooting | 29 | Notice: d.) is helpful for troubleshooting |
29 | 30 | ||
30 | 2b) Frontend module part: | 31 | 2b) Frontend module part: |
31 | 32 | ||
32 | 1.) Revision 2.3: | 33 | 1.) SkyStar DVB-S Revision 2.3: |
33 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 34 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
34 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based" | 35 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based" |
35 | 36 | ||
36 | 2.) Revision 2.6: | 37 | 2.) SkyStar DVB-S Revision 2.6: |
37 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 38 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
38 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based" | 39 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based" |
39 | 40 | ||
40 | 3.) Revision 2.7: | 41 | 3.) SkyStar DVB-S Revision 2.7: |
41 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 42 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
42 | b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based" | 43 | b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based" |
43 | c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS" | 44 | c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS" |
44 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" | 45 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" |
45 | 46 | ||
46 | 4.) Revision 2.8: | 47 | 4.) SkyStar DVB-S Revision 2.8: |
47 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 48 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
48 | b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS" | 49 | b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS" |
49 | c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based" | 50 | c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based" |
50 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" | 51 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" |
51 | 52 | ||
52 | 5.) DVB-T card: | 53 | 5.) AirStar DVB-T card: |
53 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 54 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
54 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based" | 55 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based" |
55 | 56 | ||
56 | 6.) DVB-C card: | 57 | 6.) CableStar DVB-C card: |
57 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 58 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
58 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based" | 59 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based" |
59 | 60 | ||
60 | 7.) ATSC card 1st generation: | 61 | 7.) AirStar ATSC card 1st generation: |
61 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 62 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
62 | b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510" | 63 | b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510" |
63 | 64 | ||
64 | 8.) ATSC card 2nd generation: | 65 | 8.) AirStar ATSC card 2nd generation: |
65 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 66 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
66 | b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based" | 67 | b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based" |
67 | c.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based" | 68 | c.)"Multimedia devices" => "Customise DVB frontends" => "Generic I2C PLL based tuners" |
68 | 69 | ||
69 | Author: Uwe Bugla <uwe.bugla@gmx.de> December 2008 | 70 | 9.) AirStar ATSC card 3rd generation: |
71 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
72 | b.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based" | ||
73 | c.)"Multimedia devices" => "Customise analog and hybrid tuner modules to build" => "Simple tuner support" | ||
74 | |||
75 | Author: Uwe Bugla <uwe.bugla@gmx.de> February 2009 | ||
diff --git a/drivers/media/dvb/b2c2/flexcop-hw-filter.c b/drivers/media/dvb/b2c2/flexcop-hw-filter.c index b386cc66c6b3..451974ba32f3 100644 --- a/drivers/media/dvb/b2c2/flexcop-hw-filter.c +++ b/drivers/media/dvb/b2c2/flexcop-hw-filter.c | |||
@@ -192,6 +192,7 @@ int flexcop_pid_feed_control(struct flexcop_device *fc, struct dvb_demux_feed *d | |||
192 | 192 | ||
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | EXPORT_SYMBOL(flexcop_pid_feed_control); | ||
195 | 196 | ||
196 | void flexcop_hw_filter_init(struct flexcop_device *fc) | 197 | void flexcop_hw_filter_init(struct flexcop_device *fc) |
197 | { | 198 | { |
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c index 5b30dfc7846b..76e37fd96bb6 100644 --- a/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/drivers/media/dvb/b2c2/flexcop-pci.c | |||
@@ -13,9 +13,9 @@ static int enable_pid_filtering = 1; | |||
13 | module_param(enable_pid_filtering, int, 0444); | 13 | module_param(enable_pid_filtering, int, 0444); |
14 | MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1"); | 14 | MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1"); |
15 | 15 | ||
16 | static int irq_chk_intv; | 16 | static int irq_chk_intv = 100; |
17 | module_param(irq_chk_intv, int, 0644); | 17 | module_param(irq_chk_intv, int, 0644); |
18 | MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently just debugging)."); | 18 | MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog."); |
19 | 19 | ||
20 | #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG | 20 | #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG |
21 | #define dprintk(level,args...) \ | 21 | #define dprintk(level,args...) \ |
@@ -34,7 +34,9 @@ MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently jus | |||
34 | 34 | ||
35 | static int debug; | 35 | static int debug; |
36 | module_param(debug, int, 0644); | 36 | module_param(debug, int, 0644); |
37 | MODULE_PARM_DESC(debug, "set debug level (1=info,2=regs,4=TS,8=irqdma (|-able))." DEBSTATUS); | 37 | MODULE_PARM_DESC(debug, |
38 | "set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))." | ||
39 | DEBSTATUS); | ||
38 | 40 | ||
39 | #define DRIVER_VERSION "0.1" | 41 | #define DRIVER_VERSION "0.1" |
40 | #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" | 42 | #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" |
@@ -58,6 +60,8 @@ struct flexcop_pci { | |||
58 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ | 60 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ |
59 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ | 61 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ |
60 | int count; | 62 | int count; |
63 | int count_prev; | ||
64 | int stream_problem; | ||
61 | 65 | ||
62 | spinlock_t irq_lock; | 66 | spinlock_t irq_lock; |
63 | 67 | ||
@@ -103,18 +107,32 @@ static void flexcop_pci_irq_check_work(struct work_struct *work) | |||
103 | container_of(work, struct flexcop_pci, irq_check_work.work); | 107 | container_of(work, struct flexcop_pci, irq_check_work.work); |
104 | struct flexcop_device *fc = fc_pci->fc_dev; | 108 | struct flexcop_device *fc = fc_pci->fc_dev; |
105 | 109 | ||
106 | flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); | 110 | if (fc->feedcount) { |
107 | 111 | ||
108 | flexcop_dump_reg(fc_pci->fc_dev,dma1_000,4); | 112 | if (fc_pci->count == fc_pci->count_prev) { |
109 | 113 | deb_chk("no IRQ since the last check\n"); | |
110 | if (v.sram_dest_reg_714.net_ovflow_error) | 114 | if (fc_pci->stream_problem++ == 3) { |
111 | deb_chk("sram net_ovflow_error\n"); | 115 | struct dvb_demux_feed *feed; |
112 | if (v.sram_dest_reg_714.media_ovflow_error) | 116 | |
113 | deb_chk("sram media_ovflow_error\n"); | 117 | spin_lock_irq(&fc->demux.lock); |
114 | if (v.sram_dest_reg_714.cai_ovflow_error) | 118 | list_for_each_entry(feed, &fc->demux.feed_list, |
115 | deb_chk("sram cai_ovflow_error\n"); | 119 | list_head) { |
116 | if (v.sram_dest_reg_714.cai_ovflow_error) | 120 | flexcop_pid_feed_control(fc, feed, 0); |
117 | deb_chk("sram cai_ovflow_error\n"); | 121 | } |
122 | |||
123 | list_for_each_entry(feed, &fc->demux.feed_list, | ||
124 | list_head) { | ||
125 | flexcop_pid_feed_control(fc, feed, 1); | ||
126 | } | ||
127 | spin_unlock_irq(&fc->demux.lock); | ||
128 | |||
129 | fc_pci->stream_problem = 0; | ||
130 | } | ||
131 | } else { | ||
132 | fc_pci->stream_problem = 0; | ||
133 | fc_pci->count_prev = fc_pci->count; | ||
134 | } | ||
135 | } | ||
118 | 136 | ||
119 | schedule_delayed_work(&fc_pci->irq_check_work, | 137 | schedule_delayed_work(&fc_pci->irq_check_work, |
120 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | 138 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); |
@@ -216,16 +234,12 @@ static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff) | |||
216 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,1); | 234 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,1); |
217 | deb_irq("IRQ enabled\n"); | 235 | deb_irq("IRQ enabled\n"); |
218 | 236 | ||
237 | fc_pci->count_prev = fc_pci->count; | ||
238 | |||
219 | // fc_pci->active_dma1_addr = 0; | 239 | // fc_pci->active_dma1_addr = 0; |
220 | // flexcop_dma_control_size_irq(fc,FC_DMA_1,1); | 240 | // flexcop_dma_control_size_irq(fc,FC_DMA_1,1); |
221 | 241 | ||
222 | if (irq_chk_intv > 0) | ||
223 | schedule_delayed_work(&fc_pci->irq_check_work, | ||
224 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | ||
225 | } else { | 242 | } else { |
226 | if (irq_chk_intv > 0) | ||
227 | cancel_delayed_work(&fc_pci->irq_check_work); | ||
228 | |||
229 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,0); | 243 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,0); |
230 | deb_irq("IRQ disabled\n"); | 244 | deb_irq("IRQ disabled\n"); |
231 | 245 | ||
@@ -299,8 +313,6 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) | |||
299 | IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) | 313 | IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) |
300 | goto err_pci_iounmap; | 314 | goto err_pci_iounmap; |
301 | 315 | ||
302 | |||
303 | |||
304 | fc_pci->init_state |= FC_PCI_INIT; | 316 | fc_pci->init_state |= FC_PCI_INIT; |
305 | return ret; | 317 | return ret; |
306 | 318 | ||
@@ -375,6 +387,10 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
375 | 387 | ||
376 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); | 388 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); |
377 | 389 | ||
390 | if (irq_chk_intv > 0) | ||
391 | schedule_delayed_work(&fc_pci->irq_check_work, | ||
392 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | ||
393 | |||
378 | return ret; | 394 | return ret; |
379 | 395 | ||
380 | err_fc_exit: | 396 | err_fc_exit: |
@@ -393,6 +409,9 @@ static void flexcop_pci_remove(struct pci_dev *pdev) | |||
393 | { | 409 | { |
394 | struct flexcop_pci *fc_pci = pci_get_drvdata(pdev); | 410 | struct flexcop_pci *fc_pci = pci_get_drvdata(pdev); |
395 | 411 | ||
412 | if (irq_chk_intv > 0) | ||
413 | cancel_delayed_work(&fc_pci->irq_check_work); | ||
414 | |||
396 | flexcop_pci_dma_exit(fc_pci); | 415 | flexcop_pci_dma_exit(fc_pci); |
397 | flexcop_device_exit(fc_pci->fc_dev); | 416 | flexcop_device_exit(fc_pci->fc_dev); |
398 | flexcop_pci_exit(fc_pci); | 417 | flexcop_pci_exit(fc_pci); |
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c index 676413a915b4..91068952b502 100644 --- a/drivers/media/dvb/b2c2/flexcop.c +++ b/drivers/media/dvb/b2c2/flexcop.c | |||
@@ -212,8 +212,7 @@ void flexcop_reset_block_300(struct flexcop_device *fc) | |||
212 | v210.sw_reset_210.Block_reset_enable = 0xb2; | 212 | v210.sw_reset_210.Block_reset_enable = 0xb2; |
213 | 213 | ||
214 | fc->write_ibi_reg(fc,sw_reset_210,v210); | 214 | fc->write_ibi_reg(fc,sw_reset_210,v210); |
215 | msleep(1); | 215 | udelay(1000); |
216 | |||
217 | fc->write_ibi_reg(fc,ctrl_208,v208_save); | 216 | fc->write_ibi_reg(fc,ctrl_208,v208_save); |
218 | } | 217 | } |
219 | 218 | ||
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 5d882a44e3ee..2ac738fa6a07 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -463,6 +463,8 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
463 | pcm->info_flags = 0; | 463 | pcm->info_flags = 0; |
464 | pcm->private_data = dev; | 464 | pcm->private_data = dev; |
465 | strcpy(pcm->name, "Empia 28xx Capture"); | 465 | strcpy(pcm->name, "Empia 28xx Capture"); |
466 | |||
467 | snd_card_set_dev(card, &dev->udev->dev); | ||
466 | strcpy(card->driver, "Empia Em28xx Audio"); | 468 | strcpy(card->driver, "Empia Em28xx Audio"); |
467 | strcpy(card->shortname, "Em28xx Audio"); | 469 | strcpy(card->shortname, "Em28xx Audio"); |
468 | strcpy(card->longname, "Empia Em28xx Audio"); | 470 | strcpy(card->longname, "Empia Em28xx Audio"); |
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index a1d6008efcbb..07c334f25aae 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c | |||
@@ -1155,23 +1155,23 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, | |||
1155 | { | 1155 | { |
1156 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1156 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
1157 | struct pxa_camera_dev *pcdev = ici->priv; | 1157 | struct pxa_camera_dev *pcdev = ici->priv; |
1158 | const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL; | 1158 | const struct soc_camera_data_format *cam_fmt = NULL; |
1159 | const struct soc_camera_format_xlate *xlate; | 1159 | const struct soc_camera_format_xlate *xlate = NULL; |
1160 | struct soc_camera_sense sense = { | 1160 | struct soc_camera_sense sense = { |
1161 | .master_clock = pcdev->mclk, | 1161 | .master_clock = pcdev->mclk, |
1162 | .pixel_clock_max = pcdev->ciclk / 4, | 1162 | .pixel_clock_max = pcdev->ciclk / 4, |
1163 | }; | 1163 | }; |
1164 | int ret, buswidth; | 1164 | int ret; |
1165 | 1165 | ||
1166 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 1166 | if (pixfmt) { |
1167 | if (!xlate) { | 1167 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); |
1168 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); | 1168 | if (!xlate) { |
1169 | return -EINVAL; | 1169 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); |
1170 | } | 1170 | return -EINVAL; |
1171 | } | ||
1171 | 1172 | ||
1172 | buswidth = xlate->buswidth; | 1173 | cam_fmt = xlate->cam_fmt; |
1173 | host_fmt = xlate->host_fmt; | 1174 | } |
1174 | cam_fmt = xlate->cam_fmt; | ||
1175 | 1175 | ||
1176 | /* If PCLK is used to latch data from the sensor, check sense */ | 1176 | /* If PCLK is used to latch data from the sensor, check sense */ |
1177 | if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) | 1177 | if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) |
@@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, | |||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | if (pixfmt && !ret) { | 1203 | if (pixfmt && !ret) { |
1204 | icd->buswidth = buswidth; | 1204 | icd->buswidth = xlate->buswidth; |
1205 | icd->current_fmt = host_fmt; | 1205 | icd->current_fmt = xlate->host_fmt; |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | return ret; | 1208 | return ret; |
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 9a2586b07a05..ddcb81d0b81a 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c | |||
@@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd, | |||
603 | const struct soc_camera_format_xlate *xlate; | 603 | const struct soc_camera_format_xlate *xlate; |
604 | int ret; | 604 | int ret; |
605 | 605 | ||
606 | if (!pixfmt) | ||
607 | return icd->ops->set_fmt(icd, pixfmt, rect); | ||
608 | |||
606 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 609 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); |
607 | if (!xlate) { | 610 | if (!xlate) { |
608 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); | 611 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); |
609 | return -EINVAL; | 612 | return -EINVAL; |
610 | } | 613 | } |
611 | 614 | ||
612 | switch (pixfmt) { | 615 | ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect); |
613 | case 0: /* Only geometry change */ | ||
614 | ret = icd->ops->set_fmt(icd, pixfmt, rect); | ||
615 | break; | ||
616 | default: | ||
617 | ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect); | ||
618 | } | ||
619 | 616 | ||
620 | if (pixfmt && !ret) { | 617 | if (!ret) { |
621 | icd->buswidth = xlate->buswidth; | 618 | icd->buswidth = xlate->buswidth; |
622 | icd->current_fmt = xlate->host_fmt; | 619 | icd->current_fmt = xlate->host_fmt; |
623 | pcdev->camera_fmt = xlate->cam_fmt; | 620 | pcdev->camera_fmt = xlate->cam_fmt; |