aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* [media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()Lad, Prabhakar2015-03-03
| | | | | | | | | | | | | | The vbi_buffer_filled() and buffer_filled() did the same functionality except for incrementing the buffer sequence, this patch drops the vbi_buffer_filled() and re-uses buffer_filled() for vbi buffers as well by adding the check for vb2-queue type while incrementing the sequence numbers. Along side this patch aligns the input parameters of buffer_filled() function appropriately. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] drivers: media: i2c : s5c73m3: Replace dev_err with pr_errTapasweni Pathak2015-03-03
| | | | | | | | | | Replace dev_err statement with pr_err to fix null dereference. Found by Coccinelle. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] saa7164: free_irq before pci_disable_deviceOlli Salonen2015-03-03
| | | | | | | | | | | | | Free the IRQ before disabling the device. Otherwise errors like this when unloading the module: [21135.458560] ------------[ cut here ]------------ [21135.458569] WARNING: CPU: 4 PID: 1696 at /home/apw/COD/linux/fs/proc/generic.c:521 remove_proc_entry+0x1a1/0x1b0() [21135.458572] remove_proc_entry: removing non-empty directory 'irq/47', leaking at least 'saa7164[0]' Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] saa7146: replace current->state by set_current_state()Fabian Frederick2015-03-03
| | | | | | | | | | | | | | | Use helper functions to access current->state. Direct assignments are prone to races and therefore buggy. current->state = TASK_RUNNING can be replaced by __set_current_state() Thanks to Peter Zijlstra for the exact definition of the problem. Suggested-By: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tunerOlli Salonen2015-03-03
| | | | | | | | | Hauppauge HVR-955Q is a ATSC/QAM USB tuner with LGDT3306A demodulator and SiLabs Si2157-A30 tuner. Only digital TV has been tested (both ATSC and QAM256). Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] si2157: IF frequency for ATSC and QAMOlli Salonen2015-03-03
| | | | | | | For supporting ATSC and QAM modes the driver should use a smaller IF frequency than 5 MHz. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: Minor source code cleanupsMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | Fix a few minor CodingStyle issues at the source code: - Use proper multi-line comments; - Align the log tables; - Remove the .type from dvb_frontend_ops, since this is not needed anymore (since the drivers conversion to DVBv5); - Remove emacs format macro. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: Break long linesMauro Carvalho Chehab2015-03-03
| | | | | | | Fix most of checkpatch warnings like: WARNING: line over 80 characters Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: constify log tablesMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | Ideally, we should be replacing this function by intlog10(). While we don't do that, let's at least constify the tables, in order to remove its code footfrint, and get rid of nelems. This also fixes a few 80-cols CodingStyle warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lbdt3306a: remove uneeded bracesMauro Carvalho Chehab2015-03-03
| | | | | | | | | | WARNING: braces {} are not necessary for any arm of this statement + if (ret == 0) { [...] + } else { [...] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: Don't use else were not neededMauro Carvalho Chehab2015-03-03
| | | | | | | Get rid of the remaining checkpatch.pl warnings: WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lbdt3306a: simplify the lock status checkMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | | | | | | | | | The logic there is too complex and it looks like an inifite loop. So, simplify the logic and implement it as a for loop. This gets rid of the following checkpatch.pl warnings: WARNING: else is not generally useful after a break or return + return LG3306_UNLOCK; + } else { WARNING: else is not generally useful after a break or return + return LG3306_UNLOCK; + } else { Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lbdt3306a: rework at printk macrosMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | | | | | | | | | | | | | | Use pr_foo() where there's a direct replacement. For debug, use custom-made macros, for now, as there are 3 different debug levels. We should get rid of those some day, specially since several such macros can be just removed, as Kernel trace would provide about the same output. This gets rid of some checkpatch errors: WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... +#define lg_info(fmt, arg...) printk(KERN_INFO "lgdt3306a: " fmt, ##arg) ERROR: Macros with complex values should be enclosed in parentheses +#define lg_dbg(fmt, arg...) if (debug & DBG_INFO) \ + lg_printk(KERN_DEBUG, fmt, ##arg) ERROR: Macros with complex values should be enclosed in parentheses +#define lg_reg(fmt, arg...) if (debug & DBG_REG) \ + lg_printk(KERN_DEBUG, fmt, ##arg) Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: Remove FSF addressMauro Carvalho Chehab2015-03-03
| | | | | | | | | | Fix this CodingStyle error: ERROR: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so ag$ #56: FILE: drivers/media/dvb-frontends/lgdt3306a.c:19: + * along with this program; if not, write to the Free Software$ Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: properly handle I/O errorsMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following smatch errors: drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_set_if': drivers/media/dvb-frontends/lgdt3306a.c:695:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_monitor_vsb': drivers/media/dvb-frontends/lgdt3306a.c:1033:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_oper_mode': drivers/media/dvb-frontends/lgdt3306a.c:1082:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_lock_status': drivers/media/dvb-frontends/lgdt3306a.c:1109:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_check_neverlock_status': drivers/media/dvb-frontends/lgdt3306a.c:1185:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_pre_monitoring': drivers/media/dvb-frontends/lgdt3306a.c:1199:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ drivers/media/dvb-frontends/lgdt3306a.c: In function 'lgdt3306a_get_packet_error': drivers/media/dvb-frontends/lgdt3306a.c:1310:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] int ret; ^ Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: don't go past the bufferMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | | As warned by smatch: drivers/media/dvb-frontends/lgdt3306a.c:1354 log10_x1000() error: buffer overflow 'valx_x10' 14 <= 14 drivers/media/dvb-frontends/lgdt3306a.c:1355 log10_x1000() error: buffer overflow 'log10x_x1000' 14 <= 14 There's a potential of returning a value out of the buffer. Fix it. While here, remove the ugly braced block. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: one bit fields should be unsignedMauro Carvalho Chehab2015-03-03
| | | | | | | | Fix two smatch warnings: drivers/media/dvb-frontends/lgdt3306a.h:53:28: error: dubious one-bit signed bitfield drivers/media/dvb-frontends/lgdt3306a.h:56:33: error: dubious one-bit signed bitfield Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: Use IS_ENABLED() for attach functionMauro Carvalho Chehab2015-03-03
| | | | | | | Simplify the check if CONFIG_DVB_LGDT3306A is enabled, use the IS_ENABLED() macro, just like the other frontend modules. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: Use hexadecimal values in lowercaseMauro Carvalho Chehab2015-03-03
| | | | | | | | | | | While this is not a mandatory rule at the CodingStyle, we prefer hexadecimal values in lowercase. Currently, there's a mix of lowercase and uppercase ons at lgdt3306a. So, convert all to lowercase with this small script: perl -ne 'if (m,0x([\dA-F]+),) { $o=$1; $n=lc $1; s,0x($o),0x$n, } print $_' Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: more small whitespace cleanupsMichael Ira Krufky2015-03-03
| | | | | | | Just CodingStyle. No functional changes. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: typo fixMichael Ira Krufky2015-03-03
| | | | | | | fix WARNING: 'supress' may be misspelled - perhaps 'suppress'? Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: fix WARNING: please, no spaces at the start of a lineMichael Ira Krufky2015-03-03
| | | | | | | Properly indent register initialization tables. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: fix ERROR: do not use C99 // commentsMichael Ira Krufky2015-03-03
| | | | | | | Replace C99 comments by /* */ blocks. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: do not add new typedefsMichael Ira Krufky2015-03-03
| | | | | | | | We should not be using typedefs at the Kernel, as this makes harder for reviewers to understand the code. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: fix ERROR: do not use assignment in if conditionMichael Ira Krufky2015-03-03
| | | | | | | Just CodingStyle fix. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: move EXPORT_SYMBOL to be just after functionMichael Ira Krufky2015-03-03
| | | | | | | | Fixes CodingStyle error: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: remove unnecessary 'else'Michael Ira Krufky2015-03-03
| | | | | | | No need for an else, as the previous if will return. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] lgdt3306a: clean up whitespace & unneeded bracketsMichael Ira Krufky2015-03-03
| | | | | | | No functional changes. Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] DVB: add support for LG Electronics LGDT3306A ATSC/QAM-B DemodulatorFred Richter2015-03-03
| | | | | | | | | | This ATSC/QAM-B demodulator is used by several new devices. Add support for it. Other patches will fix CodingStyle issues. Signed-off-by: Fred Richter <frichter@hauppauge.com> Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] DocBook media: fix xvYCC601 documentationHans Verkuil2015-03-03
| | | | | | | | | | | The documentation of the xvYCC601 Y'CbCr encoding was part of the SMPTE 170M (SDTV) colorspace, but it should have been part of the Rec. 709 (HDTV) colorspace as per the xvYCC standard. This change only affects the documentation and not any code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-core: drop g/s_priority opsHans Verkuil2015-03-02
| | | | | | | | | | | | The handling of VIDIOC_G/S_PRIORITY is now entirely done by the V4L2 core, so we can drop the g/s_priority ioctl ops. We do have to make sure though that when S_PRIORITY is called we check that the driver used struct v4l2_fh. This check can be removed once all drivers are converted to that structure. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pvrusb2: use struct v4l2_fhHans Verkuil2015-03-02
| | | | | | | | | | By using struct v4l2_fh both the prio handling and the linked list implementation in pvrusb2 can be removed since both are now done in the v4l2 core if you use struct v4l2_fh. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-core: remove the old .ioctl BKL replacementHans Verkuil2015-03-02
| | | | | | | | | | | To keep V4L2 drivers that did not yet convert to unlocked_ioctl happy, the v4l2 core had a .ioctl file operation that took a V4L2 lock. The last drivers are now converted to unlocked_ioctl, so all this old code can now be removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] uvc gadget: set device_caps in querycapHans Verkuil2015-03-02
| | | | | | | | | The V4L2 core will warn if this is not done. Unfortunately this driver wasn't updated. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] uvc gadget: switch to unlocked_ioctlHans Verkuil2015-03-02
| | | | | | | | | Instead of .ioctl use unlocked_ioctl. This allows us to finally remove the old .ioctl op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] uvc gadget: switch to v4l2 core lockingHans Verkuil2015-03-02
| | | | | | | | | | | | | | | | | | | | | Switch this driver over to the V4L2 core locking mechanism in preparation for switching to unlocked_ioctl. Suggested by Laurent Pinchart. This patch introduces a new mutex at the struct uvc_video level and drops the old mutex at the queue level. The new lock is now used for all ioctl locking and in the release file operation (the driver always has to take care of locking in file operations, the core only serializes ioctls). Note that the mmap and get_unmapped_area file operations no longer take a lock. Commit f035eb4e976ef5a059e30bc91cfd310ff030a7d3 fixed a AB-BA deadlock by moving all the locking down into vb2, so the mmap and get_unmapped_area file operations should no longer do any locking before calling into vb2. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] radio-bcm2048: use unlocked_ioctl instead of ioctlHans Verkuil2015-03-02
| | | | | | | | | This driver does its own locking, so there is no need to use ioctl instead of unlocked_ioctl. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pvrusb2: replace .ioctl by .unlocked_ioctlHans Verkuil2015-03-02
| | | | | | | | As far as I can tell pvrusb2 does its own locking, so there is no need to use .ioctl. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: i2c: ADV7604: Rename adv7604 prefixesPablo Anton2015-03-02
| | | | | | | | | | | | | | It is confusing which parts of the driver are adv7604 specific, adv7611 specific or common for both. This patch renames any adv7604 prefixes (both for functions and defines) to adv76xx whenever they are common. Signed-off-by: Pablo Anton <pablo.anton@vodalys-labs.com> Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> [hans.verkuil@cisco.com: rebased and renamed ADV76xx_fsc to ADV76XX_FSC] [hans.verkuil@cisco.com: kept the existing adv7604 driver name] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: radio: handle timeoutsNicholas Mc Guire2015-03-02
| | | | | | | | Add handling for timeout case. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: radio: assign wait_for_completion_timeout to appropriately ↵Nicholas Mc Guire2015-03-02
| | | | | | | | | | | | typed var wait_for_completion_timeout() returns unsigned long not int. This assigns the return value to an appropriately typed variable (also helps keep static code checkers happy). Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: adv7604: CP CSC uses a different register on adv7604 and adv7611jean-michel.hautbois@vodalys.com2015-03-02
| | | | | | | | | The bits are the same, but register is 0xf4 on ADV7611 instead of 0xfc. When reading back the value in log_status, differentiate both. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] si470x: fixup wait_for_completion_timeout return handlingNicholas Mc Guire2015-03-02
| | | | | | | | | | return type of wait_for_completion_timeout is unsigned long not int. A appropriately named variable of type unsigned long is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: bcm2048: remove unused return of functionLuis de Bethencourt2015-03-02
| | | | | | | | | | Integer return of bcm2048_parse_rds_rt () is never used, changing the return type to void. Signed-off-by: Luis de Bethencourt <luis.bg@samsung.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: i2c: ADV7604: In free run mode, signal is lockedjean-michel.hautbois@vodalys.com2015-03-02
| | | | | | | | | | | The CP_NON_STD_VIDEO bit indicates an input not aligned with DV timings. If there is no input, and chip is in free run mode, consider we are locked. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> [hans.verkuil@cisco.com: put both conditions in one 'if'] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] au0828: Delete unnecessary checks before the function call ↵Markus Elfring2015-03-02
| | | | | | | | | | | | | "video_unregister_device" The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] stk-webcam: Delete an unnecessary check before the function call "vfree"Markus Elfring2015-03-02
| | | | | | | | | | | The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid sdr: fix broken sine tone generated for sdr FMPrashant Laddha2015-03-02
| | | | | | | | | | | | | | | | FM (frequency modulated) signal for SDR is generated by varying the phase, where phase variation is proportional to input signal. It is seen that, the larger phase increments leads to discontinuities in the signal recovered after demodulation. Reducing the extent of phase variation with respect to input signal, equivalent to reducing the modulation index. Tested using FM receiver flow graph in gnuradio-companion. Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid sdr: Use LUT based implementation for sin/cos()Prashant Laddha2015-03-02
| | | | | | | | | | | | | | | | | | | The common implementation for sin/cos in include/linux/fixp-arith.h has been improved recently to provide higher precision. Replacing native implementation of sin/cos in vivid sdr with common implementation. This serves two purposes: 1. Improved accuracy: the native implementation based on the Taylor series is more prone to rounding errors. 2. Reuse of common function: this is better compared to maintaining native versions for each driver. Suggested by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] fixp-arith: replace sin/cos table by a better precision oneMauro Carvalho Chehab2015-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cos table used at fixp-arith.h has only 8 bits of precision. That causes problems if it is reused on other drivers. As some media drivers require a higher precision sin/cos implementation, replace the current implementation by one that will provide 32 bits precision. The values generated by the new implementation matches the 32 bit precision of glibc's sin for an angle measured in integer degrees. It also provides support for fractional angles via linear interpolation. On experimental calculus, when used a table with a 0.001 degree angle, the maximum error for sin is 0.000038, which is likely good enough for practical purposes. There are some logic there that seems to be specific to the usage inside ff-memless.c. Move those logic to there, as they're not needed elsewhere. Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>