Commit Graph

321480 Commits

Author SHA1 Message Date
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
Antti Palosaari
3676403764 [media] dvb_usb_v2: add .bInterfaceNumber match
There is no USB match flag for used USB interface. It is rather
common there is multiple interfaces offering different services.
For example one for television and one for remote controller.

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
Antti Palosaari
6b8c8c4089 [media] dvb_usb_v2: rename device_init/device_exit to probe/disconnect
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
Antti Palosaari
a177c72bf5 [media] dvb_usb_v2: move I2C adapter code to different file
No worth to keep it on own file as it is only 30 LOC.

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
Antti Palosaari
23d8e63a90 [media] dvb_usb_v2: use Kernel logging (pr_debug/pr_err/pr_info)
Use Kernel logging insteads of own macros.
Get rid of old debugs and use dynamic debug.

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
Antti Palosaari
cce99cf933 [media] dvb_usb_v2: unregister all frontends in error case
Unregister all if there is any error meet during
frontend initialization.

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
Antti Palosaari
96ffea88cd [media] dvb_usb_v2: remove usb_clear_halt()
Calling usb_clear_halt() during device init is not correct.
2 of 7 AF9015 devices I have timeouts next USB control message
after usb_clear_halt(). It was originally performed between
tuner_attach() and rc_query() and likely not causing problems
since rc_query() is repeated continously. None could see it when
first rc_query() failed...

Secondly it was not called for .generic_bulk_ctrl_endpoint_response.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari
4f208d4e2d [media] dvb_usb_v2: refactor delayed init
Move work to the struct dvb_usb_device that we can access
it inside .disconnect().

Also many other minor changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari
0a8673569f [media] dvb_usb_v2: ensure driver_info is not null
It could be null in case of driver does not set it
properly, like missing dynamic ID handling.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari
e48b2a6861 [media] dvb_usb_v2: frontend switching changes
Some error checking changes and refactoring.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari
e80e9af308 [media] dvb_usb_v2: remove various unneeded variables
Adapter priv is not really needed, use device priv instead.
There is only driver or two using that.

Device caps are not needed. There was only "has I2C adapter"
capability defined. It is useless as we can see same just
checking existence of i2c_algo callback.

And also remove some totally not used at all variables.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari
19ec2728d7 [media] dvb_usb_v2: use dynamic debugs
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:26 -03:00
Antti Palosaari
0359b5fa9e [media] dvb_usb_v2: add macro for filling usb_device_id table entry
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari
a0d72d246d [media] dvb_usb_v2: clean firmware downloading routines
Remove Cypress USB-interface firmware downloading routines.
That is common module and having single vendor chip routines
in common module is wrong. Just move those elsewhere.

Move single function out from the dvb_usb_firmware.c and
remove that file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari
21f5a32e1f [media] dvb_usb_v2: delay firmware download as it blocks module init
Delay firmware download and whole driver initialization using
workqueue. udev causes problems when blocking firmware download
was done during module init. This will likely resolve all
DVB USB firmware downloading issues we have had during recent years.

Fixes bug in case of DVB USB driver:
https://bugzilla.redhat.com/show_bug.cgi?id=827538

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00
Antti Palosaari
1c9c73b7db [media] dvb_usb_v2: remove .num_frontends
It is no longer needed because all frontends are attached as a one go.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-04 07:56:25 -03:00