Commit graph

321395 commits

Author SHA1 Message Date
Antti Palosaari
5cd983200a [media] dvb_usb_v2: remove num_adapters_initialized variable
We can live easily without it so remove it, make code and binary
few bytes smaller.

>From struct dvb_usb_device variable int num_adapters_initialized.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:37 -03:00
Antti Palosaari
a0921af7eb [media] dvb_usb_v2: use identify_state() to resolve firmware name
Merge get_firmware_name() to identify_state().

It is wise to resolve firmware name in that routine as it does
decision wether or not to load firmware at all. It is one very
rarely needed callback less.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari
b905a2a133 [media] dvb_usb_v2: merge get_ts_config() to get_usb_stream_config()
Piggypag TS type callback to USB stream callback and change
callback name slightly to fit better.
Both of those are rather rare callback and has a relation. Transport
Stream, TS, is input stream and USB stream is output stream of
DVB USB bridge.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari
ec0dd2f20c [media] dvb_usb_v2: use container_of() for adapter to device
We dont need that pointer as we can use container_of() macro thus
remove it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari
2731d4ed77 [media] ec168: use DVB UDB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari
232b6968b1 [media] ce6230: use DVB USB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:36 -03:00
Antti Palosaari
a1da814642 [media] au6610: use DVB USB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari
05cd62e0f8 [media] anysee: use DVB USB macros
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari
4edcf22bf2 [media] dvb_usb_v2: git rid of dvb_usb_adapter state variable
We can live without it easily.

Also USB data stream complete callback checks for feedcount
seems to be quite redundant so remove those also.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari
5da2aecb46 [media] af9035: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari
191f79a4d7 [media] dvb_usb_v2: use lock to sync feed and frontend control
There was synchronization problem when streaming was stopped.
Frontend was ran down before stream which causes problems.
Use mutex to synchronization. Now it looks like that:
LOCK
start frontend
UNLOCK
LOCK
start streaming
[...]
stop streaming
UNLOCK
LOCK
stop frontend
UNLOCK

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari
e80896616c [media] af9015: use helper macros for some pointers
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:35 -03:00
Antti Palosaari
f89f9ff883 [media] dvb_usb_v2: helper macros for device/adapter/frontend pointers
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari
1a590010a2 [media] af9015: update USB streaming configuration logic
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari
6400a8c5af [media] dvb_usb_v2: change USB stream config logic
Initial / default USB stream configuration is now set always as a
dvb_usb_device_properties. Dynamic configuration is done top of
that if callback .get_usb_stream_config() exists. Default values
are set when callback is called so callback needs only change
values that are different than default.

In addition of that define two macros DVB_USB_STREAM_BULK() and
DVB_USB_STREAM_ISOC() for filling struct usb_data_stream_properties

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari
12077a3aa4 [media] dvb_usb_v2: add macros to fill USB stream properties
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari
ddee56943a [media] dvb_usb_v2: .read_mac_address() callback changes
Give DVB adapter as a parameter for callback. MAC address is
adapter property and it could be (at least in theory) there
is devices having multiple adapters and all has own MAC.

Also add error handling. If callback fails error is returned
which leads device unregister.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari
dd5e52cdf9 [media] dvb_usb_v2: remove num_frontends_initialized from dvb_usb_adapter
We can live easily without that variable.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:34 -03:00
Antti Palosaari
6dca4ea3ec [media] dvb_usb_v2: move fe_ioctl_override() callback
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari
d70521a396 [media] dvb_usb_v2: get rid of dvb_usb_device state
Remove state from struct dvb_usb_device as we can live without.
Add some debug logs.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari
ad26183931 [media] dvb_usb_v2: simplify remote init/exit logic
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari
6e3a5daa6e [media] dvb_usb_v2: try to remove all adapters on exit
It did not removed adapter on error case as .num_adapters_initialized
was set after success adapter initialization. It should be safe to
try remove all possible adapters in any-case.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:33 -03:00
Antti Palosaari
ffe4ac92ee [media] dvb_usb_v2: do not release USB interface when device reconnects
USB core will call disconnect and remove driver for us as device
will disconnect itself. After that it is loaded again as a new
device but it is warm and no firmware loading needed.

Reported-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Malcolm Priestley
c65bcb95be [media] dvb_usb_v2: return the download ret in dvb_usb_download_firmware
The first being this patch, no return value from dvb_usb_download_firmware
causes system wide dead lock with COLD disconnect as system attempts to continue
to warm state.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari
a4e7c51edd [media] anysee: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari
2cc53dc828 [media] dvb_usb_v2: attach tuners later
It is more than nice to have all those frontend pointers when
attaching tuner to the frontend in question. Make that possible
attaching tuners after dvb_register_frontend()

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari
ec04745790 [media] ce6230: various small changes
Small changes like log writings. No functionality changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari
ab84f182f0 [media] ce6230: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:32 -03:00
Antti Palosaari
877e0aa790 [media] dvb_usb_v2: move remote controller to the main file
It is only three functions so move it to the main.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari
cb4f77a385 [media] au6610: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari
77e28ec279 [media] ec168: re-implement firmware loading
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari
d32be21800 [media] dvb_usb_v2: do not check active fe when stop streaming
Do not check active frontend as it could be already shutdown.
Add some more debugs.

It turns out that device is put sleep earlier than streaming
is stopped in some cases. That is because streaming is running
different task and there is no locking.

Maybe some locking could be good idea to force stop streaming
before device is shut down. I can guess there could be problems
in someday cases like chip is sleep but streaming control is
requested after that...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari
ce6ea9a942 [media] ec168: switch Kernel pr_* logging
Change logging.
Some minor text and error number changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari
3eee04722f [media] ec168: convert to new DVB USB
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:31 -03:00
Antti Palosaari
f093c388ef [media] dvb_usb_v2: use pointers to properties
Use pointers to properties as device and adapter properties are
constant. No need to embed and copy those structures.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari
53dc194f0c [media] af9015: suspend/resume
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari
acaec14f3e [media] dvb_usb_v2: use keyword const for USB ID table
Let optimize that code to the text segment.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari
2d2b37c75a [media] dvb_usb_v2: move few callbacks one level up
Move frontend_attach, tuner_attach, frontend_ctrl and streaming_ctrl
from adapter to device.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari
b00a901801 [media] dvb_usb_v2: Cypress firmware download module
Firmware handling routines for various Cypress chips.
Cypress AN2135
Cypress AN2235
Cypress FX2

These were split out from general DVB USB module by
Patrick Boettcher. I did only small changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:30 -03:00
Antti Palosaari
ef81e9ebbe [media] dvb_usb_v2: suspend/resume stop/start USB streaming
Stop remote polling and USB streaming before suspend and resume
those when back to normal operation.

It is far away from complete implementation, but at least it does
not hang system anymore on suspend while streaming is ongoing.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari
5b6a63cc2f [media] dvb_usb_v2: add .disconnect() callback
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari
823eebac89 [media] dvb_usb_v2: probe/disconnect error handling
In my understanding we never call .disconnect() when .probe()
returns error. Change .probe() to return error all cases it cannot
handle given interface and simplify .disconnect() handling.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari
d496eb8ae4 [media] dvb_usb_v2: misc cleanup changes
Error handling, remove unneeded stuff, renaming, etc.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:29 -03:00
Antti Palosaari
0fba999f13 [media] dvb_usb_v2: I2C adapter cleanup changes
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari
77f54517fd [media] af9015: use USB core soft_unbind
I think it is better to allow driver finish pending operations and
disconnect device. Killing all ongoing USB transfers could have very
bad effect, even break hardware in worst case.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari
a3645e5430 [media] af9015: switch to new DVB-USB
Almost all hacks are now removed and much less code.
Reducing af9015 driver code from 2084 to 1609, it is almost
500 LOC less!

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari
597843435c [media] dvb_usb_v2: enable compile
Compilation was disabled as it was failing with allyesconfig.
Rename duplicate functions and enable building.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari
3238aafbc3 [media] dvb_usb_v2: do not free resources until delayed init is done
It was possible to free resources by unloading module while
initialization was still ongoing on delayed work.

Use PID to make decision on .disconnect() if caller is our
work or some other as work also calls .disconnect() in error
case. There could be better solution still...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari
36a5c2bded [media] dvb_usb_v2: fix dvb_usb_generic_rw() debug
Debug prints write operation data instead of read data was
intention.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:28 -03:00
Antti Palosaari
65de8f978f [media] dvb_usb_v2: add missing new line for log writings
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:27 -03:00