aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-01-11[media] media: convert links from array to listMauro Carvalho Chehab1-6/+3
The entire logic that represent graph links were developed on a time where there were no needs to dynamic remove links. So, although links are created/removed one by one via some functions, they're stored as an array inside the entity struct. As the array may grow, there's a logic inside the code that checks if the amount of space is not enough to store the needed links. If it isn't the core uses krealloc() to change the size of the link, with is bad, as it leaves the memory fragmented. So, convert links into a list. Also, currently, both source and sink entities need the link at the graph traversal logic inside media_entity. So there's a logic duplicating all links. That makes it to spend twice the memory needed. This is not a big deal for today's usage, where the number of links are not big. Yet, if during the MC workshop discussions, it was said that IIO graphs could have up to 4,000 entities. So, we may want to remove the duplication on some future. The problem is that it would require a separate linked list to store the backlinks inside the entity, or to use a more complex algorithm to do graph backlink traversal, with is something that the current graph traversal inside the core can't cope with. So, let's postpone a such change if/when it is actually needed. It should also be noticed that the media_link structure uses 44 bytes on 32-bit architectures and 84 bytes on 64-bit architecture. It will thus be allocated out of the 64-bytes and 96-bytes pools respectively. That's a 12.5% memory waste on 64-bit architectures and 31.25% on 32-bit architecture. A linked list is less efficient than an array in this case, but this could later be optimized if we can get rid of the reverse links (with would reduce memory allocation by 50%). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: rename the function that create pad linksMauro Carvalho Chehab1-4/+4
With the new API, a link can be either between two PADs or between an interface and an entity. So, we need to use a better name for the function that create links between two pads. So, rename the such function to media_create_pad_link(). No functional changes. This patch was created via this shell script: for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a $i; done Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11[media] media: get rid of unused "extra_links" param on media_entity_init()Mauro Carvalho Chehab1-1/+1
Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] fix dvb_frontend_sleep_until() logicMauro Carvalho Chehab1-4/+3
As pointed by Laurent Navet: "Calling ktime_add_us() seems useless as is only useful for it's return value which is ignored." That's reported by coverity CID 1309761. Laurent proposed to just remove ktime_add_us, but the fact is that the logic of this function is broken. Instead, we need to use the value of the timeout, and ensure that it will work on the loops to emulate the legacy DiSEqC ioctl (FE_DISHNETWORK_SEND_LEGACY_CMD). Please notice that the logic was also broken if, for any reason, msleep() would sleep a little less than what it was expected, as newdelta would be smaller than delta, and udelay() would not be called. It should also be noticed that nobody noticed that trouble before likely because the FE_DISHNETWORK_SEND_LEGACY_CMD is not used anymore by modern DVB applications. Reported-by: Laurent Navet <laurent.navet@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-19[media] Add support for dvb usb stick Hauppauge WinTV-soloHDArno Bauernöppel1-0/+1
This patch adds support for the DVB-T/C/T2 usb stick WinTV-soloHD from Hauppauge. It adds the usb ID 2040:0264 Hauppauge to the cards of the driver em28xx. I successfully tested DVB-T/C and the IR remote control with the firmware dvb-demod-si2168-b40-01.fw. Signed-off-by: Arno Bauernoeppel <arno@aziraphale.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-18[media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot modeMalcolm Priestley1-3/+3
When in FE_TUNE_MODE_ONESHOT the frontend must report the actual capabilities so user can take appropriate action. With frontends that can't do auto inversion this is done by dvb-core automatically so CAN_INVERSION_AUTO is valid. However, when in FE_TUNE_MODE_ONESHOT this is not true. So only set FE_CAN_INVERSION_AUTO in modes other than FE_TUNE_MODE_ONESHOT Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend.h: improve documentation for struct dvb_tuner_opsMauro Carvalho Chehab1-15/+25
Improve the comments at the header, removing kernel-doc tag from where it doesn't belong, grouping the legacy tuner functions, and improving the text. No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend: get rid of set_state ops & related dataMauro Carvalho Chehab1-23/+0
The get_state()/set_state and the corresponding data types (struct tuner_state and enum tuner_param) are old DVB interfaces that came from the DVBv3 time. Nowadays, set_params() provide a better way to set the tuner and demod parameters. So, no need to keep those legacy stuff, as all drivers that were using it got converted. With this patch, all kABI elements at dvb_frontend.h are now documented. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend.h: get rid of unused tuner params/statesMauro Carvalho Chehab1-10/+1
There are several tuner_param values that aren't by any driver or core: DVBFE_TUNER_TUNERSTEP DVBFE_TUNER_IFFREQ DVBFE_TUNER_REFCLOCK DVBFE_TUNER_IQSENSE DVBFE_TUNER_DUMMY Several of those correspond to the values at the tuner_state struct with is also only initialized by not used anyware: u32 tunerstep; u32 ifreq; u32 refclock; It doesn't make sense to keep anything at the kABI that it is not used. So, get rid of them. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend.h: Document suspend/resume functionsMauro Carvalho Chehab1-2/+38
Those functions should be implemented on all drivers. So, document them. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend: resume tone and voltageMauro Carvalho Chehab1-0/+5
As SEC tone and voltage could have changed during suspend(), restore them to their previous values at resume(). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] demux.h: Some documentation fixups for the headerMauro Carvalho Chehab1-13/+13
The DocBook description of this header has two issues: - It calls the Kernel ABI as API, instead of kABI; - It mentions that the DVB frontend kABI is not described within the document. As this will actually generate a single DocBook, this is actually not true, now that the documentation for the frontend was added. So, fix both issues. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend.h: Add a description for the headerMauro Carvalho Chehab1-0/+23
This header file provides the kABI functions used by the Digital TV Frontend core support. Add a description for this kABI, to add at the device_drivers Kernel DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb_frontend: document the most used functionsMauro Carvalho Chehab1-3/+40
Documents the most used functions at the Digital TV kABI: dvb_frontend_register(), dvb_frontend_unregister() and dvb_frontend_detach(). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] Document the obscure dvb_frontend_reinitialise()Mauro Carvalho Chehab1-1/+14
The dvb_frontend_reinitialise() function is a special case used by just one frontend. Document it, for completeness. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-17[media] dvb: document dvb_frontend_sleep_until()Mauro Carvalho Chehab2-5/+34
This function is used mainly at the DVB core, in order to provide emulation for a legacy ioctl. The only current exception is the stv0299 driver, with takes more than 8ms to switch voltage, breaking the emulation for FE_DISHNETWORK_SEND_LEGACY_CMD. Document that. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-16[media] device-drivers.tmpl: better organize DVB function callsMauro Carvalho Chehab1-2/+2
Classify the functions at the DVB core per API. That makes easier to understand how they're related to the userspace API. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-11-16[media] demux.h: move documentation overview from device-drivers.tmplMauro Carvalho Chehab1-2/+65
It is better to keep the documentation overview at the header file, as this makes easier for developers to remember to fix when needed. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-10[media] demux.h: Convert MPEG-TS demux caps to an enumMauro Carvalho Chehab1-11/+15
While we can't document #defines, documenting enums are well supported by kernel-doc. So, convert the bitmap defines into an enum. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-10[media] demux.h: Convert TS filter type into enumMauro Carvalho Chehab1-20/+16
The usage of #define at the kABI is fine, but it doesn't allow adding a proper description. As those defines deserve a proper documentation, let's convert them into an enum and document them at device-drivers DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-10[media] DocBook: document typedef dmx_section_cb at demux.hMauro Carvalho Chehab1-1/+36
The dvb/kdapi.tmpl has already an extensive documentation about this callback. Now that we've added function typedefs at kernel-doc, add such documentation at demux.h, for it to appear at device-drivers DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-10[media] DocBook: document typedef dmx_ts_cb at demux.hMauro Carvalho Chehab1-0/+55
The dvb/kdapi.tmpl has already an extensive documentation about this callback. Now that we've added function typedefs at kernel-doc, add such documentation at demux.h, for it to appear at device-drivers DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-10[media] demux.h: make checkpatch.ph happyMauro Carvalho Chehab1-92/+107
There are lots of CodingStyle violations here. Now that we're touching a log on this header files, adding the documentation here, make sure that this will follow the Kernel CodingStyle. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-10[media] DocBook: document the other structs/enums of demux.hMauro Carvalho Chehab1-9/+88
Document the following data types: struct dmx_ts_feed struct dmx_section_filter struct dmx_section_feed enum dmx_frontend_source struct dmx_frontend Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-07[media] dvb: Remove unused frontend sources at demux.h and sync docMauro Carvalho Chehab1-7/+0
The DVB core has a provision for other frontend sources, but no drivers use it. The kdapi.xml contains provision for some other frontend source types, but it is not in sync with the code. So, remove the unused types and sync both files. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] dvb: get rid of enum dmx_successMauro Carvalho Chehab4-32/+11
This enum is not actually used anymore. The only value used from the enum is DMX_OK, passed as a parameter on two callbacks. Yet, this value is not used anywhere. So, just remove it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] DocBook: finish documenting struct dmx_demuxMauro Carvalho Chehab1-1/+15
There are two callbacks still not documented: .//drivers/media/dvb-core/demux.h:422: warning: No description found for parameter 'get_pes_pids' .//drivers/media/dvb-core/demux.h:422: warning: No description found for parameter 'get_stc' The purpose of first one is clear. The second one is used only on the obsolete av7110 driver, and its purpose is not clear, as it just returns a 64-bit word from the firmware to userspace. Let's document get_pes_pids and mark get_stc as private, adding a comment to not use it, while this is not documented. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] dvb: don't keep support for undocumented featuresMauro Carvalho Chehab2-2/+8
There are two DVB demux callbacks and ioctls that aren't documented and aren't used at all by the DVB core or by any DVB driver upstream. Let's comment out the code for those two ioctls and remove on some future version. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] DocBook: update documented fields at struct dmx_demuxMauro Carvalho Chehab1-29/+23
There are a few inconsistencies between the old documentation that got imported into the header and the current status. Update them, and use the proper doc-nano nomenclature for struct artuments "@", instead of foo(). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] DocBook: Move struct dmx_demux kABI doc to demux.hMauro Carvalho Chehab1-3/+190
The DocBook/media/dvb/kdapi.xml contains the description of the kABI for DVB. The problem is that, by being maintained on a separate file and not being updated for years, it got outdated. So, for example, some callback parameters were changed, but the DocBook were still using the old stuff. As a first step to fix it, let's move the documentation of struct dmx_demux into demux.h and fix the parameters used there. For now, don't document any other field nor touch the descriptions that got moved, letting this job to other patches. That makes easier to review the patch. PS.: Please notice that an additional patch will be needed in order to fix the return values (some uses non-existent return codes) and to the functions and callbacks mentioned at the descriptions. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] dvb_ca_en50221.h: Make checkpatch.pl happyMauro Carvalho Chehab1-33/+29
There are several CodingStyle violations at the DVB code. While we won't be fixing them as a hole, let's fix at least the headers, as we're touching on them already in order to properly document them. No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-06[media] DocBook: document struct dvb_ca_en50221Mauro Carvalho Chehab1-17/+20
This struct is already documented at the header file, but it is not using Kernel doc-nano format. Convert to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-03[media] Add Terratec H7 Revision 4 to DVBSky driverErik Andresen1-0/+1
Adds Terratec H7 Rev. 4 with USB id 0ccd:10a5 to DVBSky driver. Signed-off-by: Erik Andresen <erik@vontaene.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01[media] dvbdev: Remove two cut-and-paste errorsMauro Carvalho Chehab1-4/+0
Those two came from dvb_register_adapter cut-and-paste: .//drivers/media/dvb-core/dvbdev.h:199: warning: Excess function parameter 'device' description in 'dvb_register_device' .//drivers/media/dvb-core/dvbdev.h:199: warning: Excess function parameter 'adapter_nums' description in 'dvb_register_device' Remove them. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-08-22[media] dvbdev: document most of the functions/data structsMauro Carvalho Chehab1-17/+99
Document the most relevant functions and data structs for developers that are working with the DVB subsystem. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb_frontend.h: document the struct dvb_frontendMauro Carvalho Chehab1-0/+19
That struct is used on every DVB Front End driver, as it contains what's needed to register/use a frontend at the Kernel. Document it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb-frontend.h: document struct dtv_frontend_propertiesMauro Carvalho Chehab1-14/+91
Most of the parameters here are already well defined at the userspace documentation. Yet, it is good to add some documentation, for the developers to be sure that they are the same as the ones at userspace API. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb-frontend.h: document struct dvb_frontend_opsMauro Carvalho Chehab1-1/+85
This is one of the most important functions of the DVB frontend, containing the logic needed to set the parameters at the demux and to send commands via SEC. Document it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb: Use DVBFE_ALGO_HW where applicableMauro Carvalho Chehab1-1/+0
The dvb_frontend.c core defines a FE_ALGO_HW symbol that it is never used. Also, both cx24123 returns 1 to get_algo() callback instead of using DVBFE_ALGO_HW. Probably, those are some left overs from some code cleanup. Let's stop returning magic numbers and use the proper macro value. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb_frontend.h: document struct analog_demod_opsMauro Carvalho Chehab1-0/+27
Add documentation for struct analog_demod_info and struct analog_demod_ops. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb_frontend.h: Document struct dvb_tuner_opsMauro Carvalho Chehab1-1/+47
The struct dvb_tuner_ops contains lots of callbacks used by tuners. Document them. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] Docbook: Document struct analog_parametersMauro Carvalho Chehab1-4/+18
That struct inside dvb-frontend.h stores some parameters from V4L2 API (videodev2.h), in order to be used by the hybrid analog/digital TV tuners. Document it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb_frontend.h: get rid of dvbfe_modcodMauro Carvalho Chehab1-36/+0
This enum is not used anymore, as drivers use the modulation definitions from the public API. It is probably a left over from some DVB core cleanup. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] add documentation for struct dvb_tuner_infoMauro Carvalho Chehab1-0/+14
Despite being used everywhere at DVB frontends, the struct dvb_tuner_info were never documented. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] dvb_frontend: document dvb_frontend_tune_settingsMauro Carvalho Chehab1-0/+9
Add Documentation for dvb_frontend_tune_settings struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] DocBook: add dvb_ringbuffer.h to documentationMauro Carvalho Chehab1-60/+75
There are already some comments at dvb_ringbuffer.h that are ready for DocBook, although not properly formatted. Convert them, fix some issues and add this file to the device-drivers DocBook. While here, put multi-line comments on the right format. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] DocBook: add dvb_math.h to documentationMauro Carvalho Chehab1-6/+9
There are already some comments at dvb_math.h that are ready for DocBook, although not properly formatted. Convert them, fix some issues and add this file to the device-drivers DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] DocBook: add dvb_frontend.h to documentationMauro Carvalho Chehab1-35/+33
There are already some comments at dvb_frontend.h that are ready for DocBook, although not properly formatted. Convert them, and add this file to the device-drivers DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] DocBook: add dvb_ca_en50221.h to documentationMauro Carvalho Chehab2-100/+101
There are already some tags at dvb_ca_en50221.h, but using a different format. Convert them, fix a few entries and add to the device-drivers DocBook. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>
2015-08-22[media] DocBook/device-drivers: Add drivers/media core stuffMauro Carvalho Chehab1-4/+6
There are lots of docbook marks at the media subsystem, but those aren't used. Add the core headers/code in order to start generating docs. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Jonathan Corbet <corbet@lwn.net>