aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-05-30[media] DocBook: reformat FE_GET_INFO ioctl documentationMauro Carvalho Chehab1-107/+267
The DVB part of the docbook has a completely different format than the V4L2 part, as it was written as a separate document. As the V4L2 documentation is on better shape, and its format allows adding more information, let's use it for FE_GET_INFO and gradually update the non-legacy DVB ioctls using the new format. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] dvb: split enum from typedefs at frontend.hMauro Carvalho Chehab1-4/+8
Using typedefs is already bad enough, but doing it together with enum declaration is even worse. Also, it breaks the scripts at DocBook that would be generating reference pointers for the enums. Well, we can't get rid of typedef right now, but let's at least declare it on a separate line, and let the scripts to generate the cross-reference, as this is needed for the next DocBook patches. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook: move DVBv3 frontend bits to a separate sectionMauro Carvalho Chehab2-590/+618
Although the recommended usage is the DVBv5 API calls, the documentation doesn't make it clear about what's the recommended calls and what's legacy. So, move the legacy API bits to a separate xml, putting them into a new section. Please notice that more changes are needed, since some of the bits there are cross-referenced elsewhere. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook: Improve DVB frontend descriptionMauro Carvalho Chehab1-17/+29
The DVB frontend API got bitrotten. Update it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook: fix emphasis at the DVB documentationMauro Carvalho Chehab8-34/+34
Currently, it is using 'role="tt"', but this is not defined at the DocBook 4.5 spec. The net result is that no emphasis happens. So, replace them to bold emphasis. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook: add drawing with a typical media deviceMauro Carvalho Chehab4-2/+45
An illustration of what's considered a typical media device may help people to better understand the contents of the media infrastructure API docbook. So, add it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook: add a note about the ALSA APIMauro Carvalho Chehab1-0/+3
The Docbook mistakenly makes to believe that all needed APIs for media devices are there. Add a note there pointing that some sub-devices are actually be controlled via ALSA API. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] DocBook: Update DVB supported standards at introductionMauro Carvalho Chehab1-2/+3
The list of standards at the media docbook is incomplete, and it is mentioning that the DVB-S2 & friends is "currently being updated". That's wrong, as such update occurred back in 2008. So, provide a more complete list of supported standards and add a reference to the actual list. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-30[media] cx24120: Assume ucb registers is a counterJemma Denson1-4/+7
The ucblocks register is probably a counter and not a rate; assume it is so and change the calculations as required. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] dvb-core: fix 32-bit overflow during bandwidth calculationAntti Palosaari1-1/+1
Frontend bandwidth calculation overflows on very high DVB-S/S2 symbol rates. Use mult_frac() macro in order to keep calculation correct. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] e4000: Fix rangehigh valueMauro Carvalho Chehab1-1/+1
As reported by smatch: drivers/media/tuners/e4000.c:287:32: warning: constant 2208000000 is so big it is long long drivers/media/tuners/e4000.c:287:32: warning: decimal constant 2208000000 is between LONG_MAX and ULONG_MAX. For C99 that means long long, C90 compilers are very likely to produce unsigned long (and a warning) here drivers/media/tuners/e4000.c:287:3: warning: this decimal constant is unsigned only in ISO C90 .rangehigh = 2208000000, ^ Cc: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] e4000: implement V4L2 subdevice tuner and core opsAntti Palosaari2-36/+182
Implement V4L2 subdevice tuner and core ops. After that this driver is hybrid driver implementing both V4L2 and DVB ops. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] e4000: various small changesAntti Palosaari3-186/+178
* Rename device state from 's' to 'dev'. * Move single include to driver private header. * Change error handling type of each function to one I tend use nowadays. * Remove dummy register write from init. Even Windows driver does this multiple times remove it as I have never seen any I2C errors. * Define I2C client pointer for each function and use it. * Do not clean tuner ops during driver remove - not needed. * Disable sysfs device bind / unbind. We are not allowed manually bind / unbind device from the driver currently. * Rename some other variables. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] e4000: revise synthesizer calculationAntti Palosaari2-15/+33
Update synthesizer calculation to model I prefer nowadays. It is mostly just renaming some variables to ones I think are most standard. Also add 'schematic' of synthesizer following my current understanding. Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] rtl2832_sdr: cleanup some set_bit() callsDan Carpenter1-5/+5
This code works fine but static checkers complain. The test_bit() function takes the bit number and not a mask. Then the other issue is that we were using USB_STATE_URB_BUF which is BIT(0) instead of URB_BUF. Also we were open coding that instead of using the test/clear/set_bit() functions. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cobalt: add new driverHans Verkuil30-0/+5435
The cobalt device is a PCIe card with 4 HDMI inputs (adv7604) and a connector that can be used to hook up an adv7511 transmitter or an adv7842 receiver daughterboard. This device is used within Cisco but is sadly not available outside of Cisco. Nevertheless it is a very interesting driver that can serve as an example of how to support HDMI hardware and how to use the popular adv devices. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] adv7604/adv7842: replace FMT_CHANGED by V4L2_DEVICE_NOTIFY_EVENTHans Verkuil4-9/+18
This makes it easier for the bridge driver to just passthrough such events to the corresponding device node. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] v4l2-subdev: allow subdev to send an event to the v4l2_device notify ↵[email protected]2-0/+6
function All drivers use custom notifications, in particular when source changes. The bridge only has to map the subdev that sends it to whatever video node it is connected to. Signed-off-by: Jean-Michel Hautbois <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] vb2: allow requeuing buffers while streamingHans Verkuil1-3/+8
vb2_buffer_done() already allows STATE_QUEUED, but currently only when not streaming. It is useful to allow it while streaming as well, as this makes it possible for drivers to requeue buffers while waiting for a stable video signal. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] adv7842: Make output format configurable through pad format operationsHans Verkuil2-82/+276
Replace the dummy video format operations by pad format operations that configure the output format. Copied from the adv7604 driver. Note: while arch/blackfin/mach-bf609/boards/ezkit.c uses adv7842_platform_data this source has not been updated because it is broken since the very beginning. It depends on a struct adv7842_output_format that does not exist. And besides that gcc has no support for bf609 so nobody can compile it except by installing a toolchain from ADI. Signed-off-by: Hans Verkuil <[email protected]> Cc: Scott Jiang <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: fix minor checkpatch-errorPatrick Boettcher1-1/+1
Remove multiple blank likes. Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: Update comment & fix typoJemma Denson1-1/+1
These state vars are used for more than just ber calculation, also fix typo. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: Check for lock before updating BER & UCBJemma Denson1-0/+9
BER & UCB aren't available unless we're locked; don't update dvbv5 stats when not locked and mark these counters as unavailable. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: Convert ucblocks to dvbv5 statsJemma Denson1-11/+38
DVBv3 is a legacy API. Drivers should use DVBv5, in order to support modern applications. So, implement UCB using dvbv5. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: Convert read_ber to retrieve from cacheJemma Denson1-8/+14
Instead of reading BER again for DVBv3 call, use the value from the cache. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: Add in dvbv5 stats for bit error rateJemma Denson1-8/+63
DVBv3 is a legacy API. Drivers should use DVBv5, in order to support modern applications. So, implement BER using dvbv5. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-20[media] cx24120: constify static dataMauro Carvalho Chehab1-6/+12
Use const on the static data, as gcc may optimize better the code. Also, would prevent that some code would override the data there. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]>
2015-05-20[media] cx24120: declare cx24120_init() as staticMauro Carvalho Chehab1-1/+1
drivers/media/dvb-frontends/cx24120.c:1182:5: warning: no previous prototype for 'cx24120_init' [-Wmissing-prototypes] int cx24120_init(struct dvb_frontend *fe) ^ Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]>
2015-05-20[media] cx24120: don't initialize a var that won't be usedMauro Carvalho Chehab1-5/+5
As reported by smatch: drivers/media/dvb-frontends/cx24120.c: In function 'cx24120_message_send': drivers/media/dvb-frontends/cx24120.c:368:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret, ficus; ^ The values written by cx24120 are never checked. So, remove the check here too. That's said, the best would be to do the reverse, but globally: to properly handle the error codes. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]>
2015-05-19[media] cx24120: Complete modfec_tableJemma Denson1-20/+24
Add in all the likely values for setting fec on tuning. Some values yet to be tested but very likely to be correct. In the very unlikely event that these are wrong tuning with FEC_AUTO will still work. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] b2c2: Reset no_base_addr on skystarS2 attach failureJemma Denson1-4/+5
If set, all the other drivers reset no_base_addr on failure to attach - git commit for this being added to some of them seems to be eccd15aad72f774b2059f708bc422dbb8493bb30 This driver has been floating around outside the mainline for so long it hasn't had this fix, so add it in. Whilst here tidy surrounding code to fix style issues. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: More tidying in cx24120_initJemma Denson1-14/+12
Remove reg1 by refactoring for loops Change ret into an int as it's only used for return values now, and remove reset_result by using ret instead. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Tidy cx24120_initJemma Denson1-18/+18
Use reg instead of ret for all calls to readreg, remove ret_EA as it doesn't need to be a separate var anymore. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Remove unneccesary assignments in cx24120_initJemma Denson1-37/+37
Probably a remnant of this driver being reverse engineered, cx24120_init assigned ret on each call to writereg - they're not used for anything so remove them to clear up the codebase. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Tidy up calls to dev_dbgJemma Denson1-85/+53
Remove __func__ from calls to dev_dbg as dynamic debug can add in the function name anyway. Remove debug call in dvbv3 read_signal_strength as userspace has this value anyway. Reword some strings to make them simpler / more obvious. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Move CNR to DVBv5 statsJemma Denson1-6/+23
Better to report CNR via DVBv5 stats, as scale can be used. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Fix disecq_send_burst commandJemma Denson1-2/+1
Previous version of this driver had a memset before every call to cmd. This meant the default value of cmd.arg[1] was zero unless burst is set. Make sure it remains zero. Also fe_sec_mini_cmd_t is an enum, so test against it. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: More coding style fixesJemma Denson1-8/+14
Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Improve cooked signal strength valueJemma Denson1-10/+10
Algorithm copied from cx24117.c - it seems to work. Showing 95% on a signal I know to be somewhere around 74dBuV. [[email protected]: merged two patches, to avoid breaking compilation] Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Return DVBv3 signal strength from cacheJemma Denson1-23/+27
This patch changes DVBv3 signal strength to read from the cache by moving the signal strength reading routine into get_stat, and reducing read_signal_strength to just returning the cached value. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Remove additional calls to read_statusJemma Denson1-6/+7
get_frontend was making a call to read_status, which is being called periodically anyway. Have read_status store fe_status in the state struct instead and use that within get_frontend. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Enable DVBv5 signal strength statsJemma Denson1-0/+5
Previous patch added in collection, this patch enables them by signalling they are available. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Add DVBv5 signal strength statsJemma Denson1-0/+28
Add new get_stats function, called from read_status, for collecting DVBv5 stats into the frontend cache. Only signal strength for now, can add others later. Not currently marked as available, future patch will enable. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Rework vco function to remove xxyyzz variableJemma Denson1-34/+29
Change calculate_vco function to send_vco to tidy up cx24120_init function. xxyyzz variable is remnants of a manual div & remainder codepath to perform a u64 rounded div; replace with kernel macro DIV_ROUND_CLOSEST_ULL Hex values provided to the message are mainly variables calculated within this function, replace with these to remove hardcoding. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Fix hexdump length in writeregsJemma Denson1-1/+1
msg.len has been ++'d so msg.len is one too many. Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Add missing command to cx24120_check_cmdJemma Denson1-0/+1
This patch adds in a missing command to cx24120_check_cmd. This part of the old reverse engineered driver was quite hard to follow - it's presumed the compiler did some neat optimisation that wasn't easy to decode. This command was checked for in that version but not copied across to the new switch statement. For reference, old reverse engineered code: xxzz = cmd->id - 0x11; // look for specific message id if ( xxzz <= 0x13 ) { msg_cmd_mask = 1 << xxzz; //0x0F8021 // if cmd_id 17 or 22 or 33-36, 42, 47, 57-61 etc. disable mpeg output if ( msg_cmd_mask & 0x0F8021 ) { // 000011111000000000100001b cx24120_msg_mpeg_output_global_config(state, 0); msleep(100); state->dvb_s2_mode &= 0xFD; // reset mpeg out enable flag } } Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Move clock set to read_statusJemma Denson1-64/+23
This patch removes the requirement of waiting for tune in set_frontend by moving the clock set call into read_status Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: Fix minor style typo in KconfigJemma Denson1-1/+1
This patch changes DVB-S/DVB-S2 to the more commonly used DVB-S/S2 in the description for DVB_CX24120 Signed-off-by: Jemma Denson <[email protected]> Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: fix strict checkpatch-errorsPatrick Boettcher2-119/+59
This patches fixes all checkpatch-errors. Even the ones created --strict. Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2015-05-18[media] cx24120: fix codingstyle issue first roundPatrick Boettcher1-152/+135
Mauro pointed out some coding style issues in his review. This patch fixes them. Signed-off-by: Patrick Boettcher <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>