summaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)Author
2017-06-24media: Replace initalized ->initializedMauro Carvalho Chehab
While committing a change on em28xx, I got a warning of a typo there. So, fix it on em28xx and on two other media drivers with the same typo. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: em28xx: add support for new of Terratec H6Mauro Carvalho Chehab
There's a new version of Terratec H6 with uses USB ID 0ccd:10b2. This version is similar to the old one (with is supported via the HTC entry), except that this one has the eeprom on the second bus. On this board, one side of this board is labeled with: dvbc v2.0 The other side with: 94V-0, MO2, RK-4221 with huge digits: 1107 With those patches, the board is properly detected: em28xx 1-1.5:1.0: New device TERRATEC TERRATCE H5 MKII @ 480 Mbps (0ccd:10b2, interface 0, class 0) em28xx 1-1.5:1.0: Audio interface 0 found (Vendor Class) em28xx 1-1.5:1.0: Video interface 0 found: isoc em28xx 1-1.5:1.0: DVB interface 0 found: isoc em28xx 1-1.5:1.0: chip ID is em2884 em28xx eeprom 00000000: 26 00 00 00 02 0b 0f e5 f5 64 01 60 09 e5 f5 64 &........d.`...d em28xx eeprom 00000010: 09 60 03 c2 c6 22 e5 f7 b4 03 13 e5 f6 b4 87 03 .`...".......... em28xx eeprom 00000020: 02 0a b9 e5 f6 b4 93 03 02 09 46 c2 c6 22 c2 c6 ..........F..".. em28xx eeprom 00000030: 22 00 60 00 ef 70 08 85 3d 82 85 3c 83 93 ff ef ".`..p..=..<.... em28xx eeprom 00000040: 60 19 85 3d 82 85 3c 83 e4 93 12 07 a3 12 0a fe `..=..<......... em28xx eeprom 00000050: 05 3d e5 3d 70 02 05 3c 1f 80 e4 22 12 0b 06 02 .=.=p..<...".... em28xx eeprom 00000060: 07 e2 01 00 1a eb 67 95 cd 0c b2 10 f0 13 6b 03 ......g.......k. em28xx eeprom 00000070: 98 22 6a 1c 86 12 27 57 4e 16 29 00 60 00 00 00 ."j...'WN.).`... em28xx eeprom 00000080: 02 00 00 00 5e 00 13 00 f0 10 44 82 82 00 00 00 ....^.....D..... em28xx eeprom 00000090: 5b 81 c0 00 00 00 20 40 20 80 02 20 10 01 00 00 [..... @ .. .... em28xx eeprom 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ em28xx eeprom 000000b0: c6 40 00 00 81 00 00 00 00 00 00 00 00 c4 00 00 .@.............. em28xx eeprom 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1c 03 ................ em28xx eeprom 000000d0: 31 00 32 00 33 00 34 00 35 00 36 00 37 00 38 00 1.2.3.4.5.6.7.8. em28xx eeprom 000000e0: 39 00 41 00 42 00 43 00 44 00 12 03 54 00 45 00 9.A.B.C.D...T.E. em28xx eeprom 000000f0: 52 00 52 00 41 00 54 00 45 00 43 00 22 03 54 00 R.R.A.T.E.C.".T. em28xx 1-1.5:1.0: eeprom 000100: ... (skipped) em28xx 1-1.5:1.0: EEPROM ID = 26 00 00 00, EEPROM hash = 0xbcd5a8cf em28xx 1-1.5:1.0: EEPROM info: em28xx 1-1.5:1.0: microcode start address = 0x0004, boot configuration = 0x00 em28xx 1-1.5:1.0: I2S audio, 5 sample rates em28xx 1-1.5:1.0: 500mA max power em28xx 1-1.5:1.0: Table at offset 0x27, strings=0x2298, 0x1c6a, 0x1286 em28xx 1-1.5:1.0: Identified as Terratec Cinergy H6 rev. 2 (card=101) em28xx 1-1.5:1.0: Currently, V4L2 is not supported on this model em28xx 1-1.5:1.0: dvb set to isoc mode. usbcore: registered new interface driver em28xx em28xx 1-1.5:1.0: Binding audio extension em28xx 1-1.5:1.0: em28xx-audio.c: Copyright (C) 2006 Markus Rechberger em28xx 1-1.5:1.0: em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab em28xx 1-1.5:1.0: Endpoint 0x83 high-speed on intf 0 alt 7 interval = 8, size 196 em28xx 1-1.5:1.0: Number of URBs: 1, with 64 packets and 192 size em28xx 1-1.5:1.0: Audio extension successfully initialized em28xx: Registered (Em28xx Audio Extension) extension em28xx 1-1.5:1.0: Binding DVB extension drxk: status = 0x639260d9 drxk: detected a drx-3926k, spin A3, xtal 20.250 MHz drxk: DRXK driver version 0.9.4300 drxk: frontend initialized. tda18271 4-0060: creating new instance tda18271: TDA18271HD/C2 detected @ 4-0060 dvbdev: DVB: registering new adapter (1-1.5:1.0) em28xx 1-1.5:1.0: DVB: registering adapter 0 frontend 0 (DRXK DVB-C DVB-T)... dvbdev: dvb_create_media_entity: media entity 'DRXK DVB-C DVB-T' registered. dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered. em28xx 1-1.5:1.0: DVB extension successfully initialized em28xx: Registered (Em28xx dvb Extension) extension em28xx 1-1.5:1.0: Registering input extension rc rc0: 1-1.5:1.0 IR as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/rc/rc0 Registered IR keymap rc-nec-terratec-cinergy-xs input: 1-1.5:1.0 IR as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/rc/rc0/input0 em28xx 1-1.5:1.0: Input extension successfully initalized em28xx: Registered (Em28xx Input Extension) extension tda18271: performing RF tracking filter calibration tda18271: RF tracking filter calibration complete Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: em28xx: Ignore errors while reading from eepromMauro Carvalho Chehab
While testing support for Terratec H6 rev. 2, it was noticed that reading from eeprom there causes a timeout error. Apparently, this is due to the need of properly setting GPIOs. In any case, the driver doesn't really require eeprom reading to succeed, as this is currently used only for debug. So, Ignore such errors. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: dib0700: fix error handling in dib0700_i2c_xfer_legacy()Dan Carpenter
Mostly this adds some unlocks to error paths. But, if you see where there were "break;" statements before, I changed those paths to return error codes instead of returning success. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: dib0700: fix locking in dib0700_i2c_xfer_new()Dan Carpenter
This patch mostly adds unlocks to error paths. But one additional small change is that I made the first "break;" a "goto unlock;" which means that now we return failure instead of success on that path. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: tuners: mxl5005s: remove useless variable assignmentsGustavo A. R. Silva
Values assigned to variables Fmax and Fmin at lines 2740 and 2741 are overwritten at lines 2754 and 2755 before they can be used. This makes such variable assignments useless. Addresses-Coverity-ID: 1226952 Addresses-Coverity-ID: 1226953 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: dvb-frontends/stv0367: deduplicate DDB dvb_frontend_ops capsDaniel Scheller
Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: ddbridge: use dev_* macros in favor of printkDaniel Scheller
Side effect: KERN_DEBUG messages aren't written to the kernel log anymore. This also improves the tda18212_ping reporting a bit so users know that if pinging wasn't successful, bad things will happen. Since in module_init_ddbridge() there's no dev yet, pr_info is used instead. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: ddbridge: make (ddb)readl in while-loops fail-safeDaniel Scheller
Reported by smatch: drivers/media/pci/ddbridge/ddbridge-core.c:1246 input_tasklet() warn: this loop depends on readl() succeeding drivers/media/pci/ddbridge/ddbridge-core.c:1768 flashio() warn: this loop depends on readl() succeeding drivers/media/pci/ddbridge/ddbridge-core.c:1788 flashio() warn: this loop depends on readl() succeeding Fix this by introducing safe_ddbreadl() which will wrap ddbreadl and checks for all bits set in the return which indicates failure, and return 0 in that case. Usable as drop-in-replacement in all affected while loops w/o having to change the logic. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: coda: rename the picture run timeout error handlerPhilipp Zabel
I would have liked the the picture run timeout error handler to be renamed to something a bit more descriptive in the original commit fb2be08f8cb3 ("[media] coda: first step at error recovery"). Somehow v1 [1] was merged instead of v2 [2]. [1] https://patchwork.kernel.org/patch/9663965/ [2] https://patchwork.kernel.org/patch/9774239/ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: venus: fix loop wrap in cleanup of clksColin Ian King
The current pre-decrement is incorrect and should be replaced with a post-decrement. Consider the case where the very first clk_prepare_enable fails when i is 0; in this case the error clean up will decrement the unsigned int which wraps to the largest unsigned int value causing an array out of bounds read on core->clks[i]. Detected by CoverityScan, CID#1446590 ("Out-of-bounds read") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: radio: wl1273: add check on core->write() return valueGustavo A. R. Silva
Check return value from call to core->write(), so in case of error print error message, jump to goto label fail and eventually return. Addresses-Coverity-ID: 1226943 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: rainshadow-cec: avoid -Wmaybe-uninitialized warning againArnd Bergmann
Back in April I created a patch to address a false-positive warning: drivers/media/usb/rainshadow-cec/rainshadow-cec.c: In function 'rain_irq_work_handler': drivers/media/usb/rainshadow-cec/rainshadow-cec.c:171:31: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized] My patch was totally wrong and introduced a real bug, and Colin Ian King thankfully noticed it now and fixed my mistake. Unfortunately, fixing the actual uninitialized data in this case brought back the original bogus warning. This is a new version of the patch, which simplifies the code to the point where gcc notices the behavior is correct. Fixes: ca33784ba494 ("[media] rainshadow-cec: ensure exit_loop is intialized") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning") Cc: Colin Ian King <colin.king@canonical.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: tuner-core: Remove unused #define PREFIXJoe Perches
Commit 680d87c0a9e3 ("[media] tuner-core: use pr_foo, instead of internal printk macros") removed the use of PREFIX, remove the #define Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: stkwebcam: Use more common logging stylesJoe Perches
Convert STK_<LEVEL> to pr_<level> to use the typical kernel logging. Add a define for pr_fmt. No change in logging output. Miscellanea: o Remove now unused PREFIX and STK_<LEVEL> macros o Realign arguments o Use pr_<level>_ratelimited o Add a few missing newlines to formats Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: coda: ctx->codec is not NULL in coda_alloc_framebuffersPhilipp Zabel
This fixes a smatch warning: drivers/media/platform/coda/coda-bit.c:415 coda_alloc_framebuffers() error: we previously assumed 'ctx->codec' could be null (see line 396) coda_alloc_framebuffers() is called from coda_start_encoding() and __coda_start_decoding(). Both dereference ctx->codec before calling coda_alloc_framebuffers() in lines 935 and 1649, so ctx->codec can not be NULL. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: Revert "[media] et8ek8: Export OF device ID as module aliases"Arnd Bergmann
This one got applied twice, causing a build error with clang: drivers/media/i2c/et8ek8/et8ek8_driver.c:1499:1: error: redefinition of '__mod_of__et8ek8_of_table_device_table' Fixes: 9ae05fd1e791 ("[media] et8ek8: Export OF device ID as module aliases") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: bdisp-debug: Replace a seq_puts() call by seq_putc() in seven functionsMarkus Elfring
Seven single characters (line breaks) should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] media: entity: Catch unbalanced media_pipeline_stop callsKieran Bingham
Drivers must not perform unbalanced calls to stop the entity pipeline, however if they do they will fault in the core media code, as the entity->pipe will be set as NULL. We handle this gracefully in the core with a WARN for the developer. Replace the erroneous check on zero streaming counts, with a check on NULL pipe elements instead, as this is the symptom of unbalanced media_pipeline_stop calls. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pincharts@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] v4l2-ioctl/exynos: fix G/S_SELECTION's type handlingHans Verkuil
The type field in struct v4l2_selection is supposed to never use the _MPLANE variants. E.g. if the driver supports V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, then userspace should still pass V4L2_BUF_TYPE_VIDEO_CAPTURE. The reasons for this are lost in the mists of time, but it is really annoying. In addition, the exynos drivers didn't follow this rule and instead expected the _MPLANE type. To fix that code is added to the v4l2 core that maps the _MPLANE buffer types to their regular equivalents before calling the driver. Effectively this allows for userspace to use either _MPLANE or the regular buffer type. This keeps backwards compatibility while making things easier for userspace. Since drivers now never see the _MPLANE buffer types the exynos drivers had to be adapted as well. Signed-off-by: Hans Verkuil <hansverk@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: sen: Declare vimc_sen_video_ops as staticHelen Fornazier
Declare vimc_sen_video_ops as static, remove warning from sparse tool Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: sca: Add scalerHelen Fornazier
Implement scaler and integrated with the core Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: deb: Add debayer filterHelen Fornazier
Implement the debayer filter and integrate it with the core Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: Subdevices as modulesHelen Fornazier
Change the core structure for adding subdevices in the topology. Instead of calling the specific create function for each subdevice, inject a child platform_device with the driver's name. Each type of node in the topology (sensor, capture, debayer, scaler) will register a platform_driver with the corresponding name through the component subsystem. Implementing a new subdevice type doesn't require vimc-core to be altered. This facilitates future implementation of dynamic entities, where hotpluging an entity in the topology is just a matter of registering/unregistering a platform_device in the system. It also facilitates other implementations of different nodes without touching the core code and remove the need of a header file for each type of node. Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: cap: Support several image formatsHelen Fornazier
Allow user space to change the image format as the frame size, the pixel format, colorspace, quantization, field YCbCr encoding and the transfer function Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: sen: Support several image formatsHelen Fornazier
Allow user space to change the image format as the frame size, the media bus pixel format, colorspace, quantization, field YCbCr encoding and the transfer function Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: common: Add vimc_colorimetry_clampHelen Fornazier
Colorimetry value will always be checked in the same way. Adding a helper macro for that Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: common: Add vimc_link_validateHelen Fornazier
All links will be checked in the same way. Adding a helper function for that Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: common: Add vimc_pipeline_s_stream helperHelen Fornazier
Move the vimc_cap_pipeline_s_stream from the vimc-cap.c to vimc-common.c as this core will be reused by other subdevices to activate the stream in their directly connected nodes Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: common: Add vimc_ent_sd_* helperHelen Fornazier
As all the subdevices in the topology will be initialized in the same way, to avoid code repetition the vimc_ent_sd_{register, unregister} helper functions were created Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: Move common code from the coreHelen Fornazier
Remove helper functions from vimc-core and add it in vimc-common to clean up the core. Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] vimc: sen: Integrate the tpg on the sensorHelen Fornazier
Initialize the test pattern generator on the sensor Generate a colored bar image instead of a grey one Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-23[media] media: i2c: ov772x: Force use of SCCB protocolJacopo Mondi
Commit e78902976150 ("i2c: sh_mobile: don't send a stop condition by default inside transfers") makes the i2c_sh_mobile I2C-adapter emit a stop/start sequence between messages in a single transfer only when explicitly requested with I2C_M_STOP. This breaks the ov772x driver in the SH4 Migo-R board as the Omnivision sensor uses the I2C-like SCCB protocol that doesn't support repeated starts: i2c-sh_mobile i2c-sh_mobile.0: Transfer request timed out ov772x 0-0021: Product ID error 92:92 Fix it by marking the client as SCCB, forcing the emission of a stop/start sequence between all messages. As I2C_M_STOP requires the I2C adapter to support protocol mangling, ensure that the I2C_FUNC_PROTOCOL_MANGLING functionality is available. Tested on SH4 Migo-R board, with OV772x now successfully probing soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0 ov772x 0-0021: ov7725 Product ID 77:21 Manufacturer ID 7f:a2 Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] media: venus: enable building with COMPILE_TESTStanimir Varbanov
We want all media drivers to build with COMPILE_TEST, as the Coverity instance we use on Kernel works only for x86. Also, our test workflow relies on it, in order to identify git bisect breakages. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
2017-06-20[media] af9013: refactor power controlAntti Palosaari
Move power-up and power-down functionality to init/sleep ops and get rid of old function. Fixes and simplifies power-up functionality slightly. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: refactor firmware download routineAntti Palosaari
Refactor firmware download routine. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9015: move 2nd demod power-up wait different locationAntti Palosaari
We need to wait 2nd demod power-up before download firmware. Move that wait to more correct location. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: remove unneeded register writesAntti Palosaari
Removed register writes are already chip defaults, are not required, are set later or belong to AF9015 USB interface. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: add configurable TS output pinAntti Palosaari
On serial TS mode output pin could be selected from D0 or D7. Add configuration option to for it. Rename TS mode config option prefix from AF9013_TS_ to AF9013_TS_MODE_. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9015: enable 2nd TS flow control when dual modeAntti Palosaari
It needs to be enabled in order to get stream from slave af9013 demod. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9015: fix and refactor i2c adapter algo logicAntti Palosaari
* fix write+read when write has more than one byte * remove lock, not needed on that case * remove useless i2c msg send loop, as we support only write, read and write+read as one go and nothing more Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: add dvbv5 cnrAntti Palosaari
Add support for DVBv5 CNR. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: fix error handlingAntti Palosaari
Use typical (return 0/goto err/return err) error handling everywhere. Add missing error handling where missing. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: convert to regmap apiAntti Palosaari
Use regmap for register access. Own low level i2c read and write routines for regmap is still needed because chip uses single command byte in addition to typical i2c register access. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: fix loggingAntti Palosaari
We can simplify logging as we now have a proper i2c client to pass for kernel dev_* logging functions. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: use kernel 64-bit divisionAntti Palosaari
Replace own binary division with 64-bit multiply and division. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: add i2c client bindingsAntti Palosaari
Add kernel i2c driver bindings. That allows dev_* logging, regmap and more. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: move config values directly under driver stateAntti Palosaari
It shorten, as typed chars, access to config values as there is one pointer less. Also, when config/platform data is passed to driver there could be some values that are not relevant to store state as such or not needed to store at all. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9015: use correct 7-bit i2c addressesAntti Palosaari
Driver was using wrong "8-bit" i2c addresses for demods and tuners. Internal demod i2c address was not set at all. These are needed to be fixed before proper i2c client binding is used. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] af9013: add check on af9013_wr_regs() return valueGustavo A. R. Silva
Check return value from call to af9013_wr_regs(), so in case of error print debug message and return. Addresses-Coverity-ID: 1227035 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>