summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2018-07-30media: em28xx: disable null packet filter for WinTVdualHDRobert Schlabbach
This patch disables the null packet filter for the Hauppauge WinTV-dualHD. There are applications which require the unfiltered transport stream (e.g. DOCSIS segment load analyzers). Tests showed that the device is capable of delivering two unfiltered EuroDOCSIS 3.0 transport streams simultaneously, i.e. over 100 Mbit/s worth of data, without any losses. Signed-off-by: Robert Schlabbach <Robert.Schlabbach@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: dvb-frontends/tda18271c2dd: fix handling of DVB-T parametersDaniel Scheller
Add a break statement in set_params() for the SYS_DVBT(2). As reported by gcc: drivers/media/dvb-frontends/tda18271c2dd.c:1144:3: warning: this statement may fall through [-Wimplicit-fallthrough=] There is a nested switch() inside the code with sets the tuner to the right standard. Without the break, the code will always set to DVB-C mode, with can be sub-optimal for DVB-T. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: add SX8 I/Q mode remark and remove DIAG CMD definesDaniel Scheller
Take note that the SX8 IQ mode is only available on a single tuner, and remove the MCI/SX8 DIAG CMD defines. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/sx8: enable modulation selection in set_parameters()Daniel Scheller
Allow for tuning to transponders with specific modulations in set_parameters(). Setting a specific modulation will also enable lower modulations. Picked up from the upstream dddvb GIT. Upstream also has support for APSK64/128/256 modulations which aren't supported yet by the DVB API, so comment them out until support for them is added. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/sx8: disable automatic PLS code searchDaniel Scheller
The SX8 cards by default do an automatic search for the PLS code. This is not necessarily wanted as this can eventually be detected wrong, so disable this. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: add more MCI status codes, improve MCI_SUCCESS macroDaniel Scheller
The MCI can report the command status more finegrained, so, add more status code defines and update the MCI_SUCCESS macro. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: split MaxSX8 specific code off to ddbridge-sx8.cDaniel Scheller
Split off all code specific to the MaxSX8 cards to a separate ddbridge-sx8 module and hook it up in the Makefile. This also adds evaluation of the mci_type to allow for using different attach handling for different cards. As different cards can implement things differently (ie. support differing frontend_ops, and have different base structs being put ontop of the common mci_base struct), this introduces the mci_cfg struct which is initially used to hold a few specifics to the -sx8 submodule. While at it, the handling of the i/q mode is adjusted slightly. Besides this and handling mci_base and sx8_base struct pointers where needed, all code is copied unmodified from ddbridge-mci.c. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: make ddb_mci_cmd() and ddb_mci_config() publicDaniel Scheller
In preparation for splitting all MaxSX8 related code parts from the common MCI code, prefix both mci_cmd() and mci_config() functions with ddb_, remove the static marking and add matching function prototypes to ddbridge-mci.h so these functions can be reused from other files within the ddbridge driver. As this requires the mci-related structs to be defined in ddbridge-mci.h, move struct mci and struct mci_base there and clean them up. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: store mci type and number of ports in the hwinfoDaniel Scheller
For better support for future MCI based cards, rename the mci struct member to mci_ports to carry the number of ports on the cards, and add a mci_type member to identify the card type to handle differing hardware. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: extend mci_command and mci_result structsDaniel Scheller
Recent FPGA firmware reports more data and values in sent command responses. Adjust the mci_command and mci_result structs including it's unions to match these changes and add a few comments explaining things. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: rename defines and fix i/q var typesDaniel Scheller
Adjustments to match the FPGA firmware, and the signal I/Q values are reported as s16 types from the card firmware. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: read and report signal strength and SNRDaniel Scheller
Implement querying signal statistics from the MCI and report this data in read_status() as DVBv5 statistics. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge/mci: update copyright year in headersDaniel Scheller
Update the copyright year information in the MCI headers to 2017-2018. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge: change MCI base ID and define a SX8 IDDaniel Scheller
Change the start of the MCI ID range (internally used only) to 48 and define an ID for the SX8 card type. Use this new ID to handle device attachment. This change is done in preparation for support of more MCI based cards. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge: link structure access cosmetics in ddb_port_probe()Daniel Scheller
Throughout the function, dev->link[l] is used several times. Unclutter this a bit by declaring a ddb_link var at the top of the function, assign the address of dev->link[l] to it and use that var to access the link[] struct member. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge: remove unused MDIO defines and hwinfo memberDaniel Scheller
ddbridge has a few MDIO related remainders (defines, hwinfo struct) which aren't of any use for the in-kernel driver at all (they're only used in conjunction with the OctoNet SAT>IP boxes which the kernel driver doesn't have any support for), so clean this up. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge: report I2C bus errorsDaniel Scheller
The I2C_COMMAND response reports an error in the I2C bus communication using bit 17. Evaluate the response more thoroughly and log an error if an I2C problem was detected. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge: evaluate the actual link when setting up the dummy tunerDaniel Scheller
Devices supporting dummy tuner operation can exist on any link, not only on link 0, so fix this accordingly. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: ddbridge: probe for LNBH25 chips before attachingDaniel Scheller
In demod_attach_stv0910(), the LNBH25 IC is being blindly attached and, if the result is bad, blindly attached on another possible I2C address. The LNBH25 uses it's set_voltage function to test for the IC and will print an error to the kernel log on failure. Prevent this by probing the possible I2C address and use this (and only this) to attach the LNBH25 I2C driver. This also allows the stv0910 attach function to be a bit cleaner. Picked up from the upstream dddvb GIT and adapted for the LNBH25 driver variant from the kernel tree. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: dvb-frontends/stv0910: cast the BER denominator shift exp to ULLDaniel Scheller
To avoid miscalculations related to the BER denominator, the shift expression needs to be casted as ULL. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: em28xx: explicitly disable TS packet filterRobert Schlabbach
The em28xx driver never touched the EM2874 register bits that control the transport stream packet filters, leaving them at whatever default the firmware has set. E.g. the Pinnacle 290e disables them by default, while the Hauppauge WinTV dualHD enables discarding NULL packets by default. However, some applications require NULL packets, e.g. to determine the load in DOCSIS segments, so discarding NULL packets is undesired for such applications. This patch simply extends the bit mask when starting or stopping the transport stream packet capture, so that the filter bits are cleared. It has been verified that this makes the Hauppauge WinTV dualHD pass an unfiltered DVB-C stream including NULL packets, which it didn't before. Signed-off-by: Robert Schlabbach <Robert.Schlabbach@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: pci/pt1: suppress compiler warning in xtensa archAkihiro Tsukada
Found and reported by kbuild test robot: Message ID: <201805052003.MC007f9h%fengguang.wu@intel.com> and holding an address of an empty struct in .driver.pm does no harm when CONFIG_PM_SLEEP is not defined. Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: dvb-frontends/dvb-pll: fix module ref-countingAkihiro Tsukada
dvb-pll module was 'put' twice on exit: once by dvb_frontend_detach() and another by dvb_module_release(). Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-30media: dvb-usb/friio, dvb-usb-v2/gl861: decompose friio and merge with gl861Akihiro Tsukada
Friio device contains "gl861" bridge and "tc90522" demod, for which the separate drivers are already in the kernel. But friio driver was monolithic and did not use them, practically copying those features. This patch decomposes friio driver into sub drivers and re-uses existing ones, thus reduces some code. It adds some features to gl861, to support the friio-specific init/config of the devices and implement i2c communications to the tuner via demod with USB vendor requests. [mchehab+samsung@kernel.org: fix merge conflicts] Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} ↵Sylwester Nawrocki
functions Look up of buffers in s5p_mfc_handle_frame_new, s5p_mfc_handle_frame_copy_time functions is not working properly for DMA addresses above 2 GiB. As a result flags and timestamp of returned buffers are not set correctly and it breaks operation of GStreamer/OMX plugins which rely on the CAPTURE buffer queue flags. Due to improper return type of the get_dec_y_adr, get_dspl_y_adr callbacks and sign bit extension these callbacks return incorrect address values, e.g. 0xfffffffffefc0000 instead of 0x00000000fefc0000. Then the statement: "if (vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0) == dec_y_addr)" is always false, which breaks looking up capture queue buffers. To ensure proper matching by address u32 type is used for the DMA addresses. This should work on all related SoCs, since the MFC DMA address width is not larger than 32-bit. Changes done in this patch are minimal as there is a larger patch series pending refactoring the whole driver. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: v4l2-mem2mem: Fix missing v4l2_m2m_try_run callEzequiel Garcia
Commit 34dbb848d5e4 ("media: mem2mem: Remove excessive try_run call") removed a redundant call to v4l2_m2m_try_run but instead introduced a bug. Consider the following case: 1) Context A schedules, queues and runs job A. 2) While the m2m device is running, context B schedules and queues job B. Job B cannot run, because it has to wait for job A. 3) Job A completes, calls v4l2_m2m_job_finish, and tries to queue a job for context A, but since the context is empty it won't do anything. In this scenario, queued job B will never run. Fix this by calling v4l2_m2m_try_run from v4l2_m2m_try_schedule. While here, add more documentation to these functions. Fixes: 34dbb848d5e4 ("media: mem2mem: Remove excessive try_run call") Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: split >80 cols line] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: imx274: add cropping support via SELECTION APILuca Ceresoli
Currently this driver does not support cropping. The supported modes are the following, all capturing the entire area: - 3840x2160, 1:1 binning (native sensor resolution) - 1920x1080, 2:1 binning - 1280x720, 3:1 binning The VIDIOC_SUBDEV_S_FMT ioctl chooses among these 3 configurations the one that matches the requested format. Add cropping support via VIDIOC_SUBDEV_S_SELECTION: with target V4L2_SEL_TGT_CROP to choose the captured area, with V4L2_SEL_TGT_COMPOSE to choose the output resolution. To maintain backward compatibility we also allow setting the compose format via VIDIOC_SUBDEV_S_FMT. To obtain this, compose rect and output format are computed in the common helper function __imx274_change_compose(), which sets both to the same width/height values. Cropping also calls __imx274_change_compose() whenever cropping rect size changes in order to reset the compose rect (and output format size) for 1:1 binning. Also rename enum imx274_mode to imx274_binning (and its values from IMX274_MODE_BINNING_* to IMX274_BINNING_*). Without cropping, the two naming are equivalent. With cropping, the resolution could be different, e.g. using 2:1 binning mode to crop 1200x960 and output a 600x480 format. Using binning in the names avoids any misunderstanding. For the same reason, replace the 'size' field in struct imx274_frmfmt with 'bin_ratio'. [Sakari Ailus: Remove leftover condition in imx274_apply_trimming] Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: imx274: use regmap_bulk_write to write multybyte registersLuca Ceresoli
Currently 2-bytes and 3-bytes registers are set by very similar functions doing the needed shift & mask manipulation, followed by very similar for loops setting one byte at a time over I2C. Replace all of this code by a unique helper function that calls regmap_bulk_write(), which has two advantages: - sets all the bytes in a unique I2C transaction - removes lots of now unused code. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: ov2680: Add Omnivision OV2680 sensor driverRui Miguel Silva
This patch adds V4L2 sub-device driver for OV2680 image sensor. The OV2680 is a 1/5" CMOS color sensor from Omnivision. Supports output format: 10-bit Raw RGB. The OV2680 has a single lane MIPI interface. The driver exposes following V4L2 controls: - auto/manual exposure, - exposure, - auto/manual gain, - gain, - horizontal/vertical flip, - test pattern menu. Supported resolution are only: QUXGA, 720P, UXGA. [Sakari Ailus: Drop "-level" from Kconfig help text] Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: i2c: Add driver for Aptina MT9V111Jacopo Mondi
Add V4L2 sensor driver for Aptina MT9V111 CMOS image sensor. The MT9V111 is a 1/4-Inch CMOS image sensor based on MT9V011 with an integrated Image Flow Processor. Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: dw9807-vcm: Recognise this is just the VCM bit of the deviceSakari Ailus
The dw9807 contains a voice coil lens driver as well as an EEPROM. This driver is just for the VCM. Reflect this in the driver's name --- this is already the case for the compatible string, for instance. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: rcar-csi2: update stream start for V3MNiklas Söderlund
Latest errata document updates the start procedure for V3M. This change in addition to adhering to the datasheet update fixes capture on early revisions of V3M. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: ivtv: Replace GFP_ATOMIC with GFP_KERNELJia-Ju Bai
ivtv_probe() and ivtvfb_init_card() are never called in atomic context. They call kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cx88: Replace mdelay() with msleep() in dvb_register()Jia-Ju Bai
dvb_register() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cx88: Replace mdelay() with msleep() in cx88_card_setup_pre_i2c()Jia-Ju Bai
cx88_card_setup_pre_i2c() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cx25821: Replace mdelay() with msleep()Jia-Ju Bai
cx25821_gpio_init(), cx25821_initialize() and cx25821_registers_init() are never called in atomic context. They call mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cx23885: Replace mdelay() with msleep() in cx23885_reset()Jia-Ju Bai
cx23885_reset() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cx23885: Replace mdelay() with msleep() and usleep_range() in ↵Jia-Ju Bai
cx23885_gpio_setup() cx23885_gpio_setup() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cx23885: Replace mdelay() with msleep() and usleep_range() in ↵Jia-Ju Bai
altera_ci_slot_reset() altera_ci_slot_reset() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: pci: cobalt: Replace GFP_ATOMIC with GFP_KERNEL in cobalt_probe()Jia-Ju Bai
cobalt_probe() is never called in atomic context. It calls kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: i2c: vs6624: Replace mdelay() with msleep() and usleep_range() in ↵Jia-Ju Bai
vs6624_probe() vs6624_probe() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: i2c: adv7842: Replace mdelay() with msleep() and usleep_range() in ↵Jia-Ju Bai
adv7842_ddr_ram_test() adv7842_ddr_ram_test() is never called in atomic context. It only calls from: adv7842_ddr_ram_test() <- adv7842_command_ram_test() <- adv7842_ioctl() adv7842_ddr_ram_test() calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep() and usleep_range(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: video-i2c: hwmon: fix return value from amg88xx_hwmon_init()Matt Ranostay
PTR_ERR was making any pointer passed an error pointer, and should be replaced with PTR_ERR_OR_ZERO which checks if is an actual error condition. Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: adv7180: add g_frame_interval supportNiklas Söderlund
Implement g_frame_interval to return the current standard's frame interval. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: adv7180: fix field type to V4L2_FIELD_ALTERNATENiklas Söderlund
The ADV7180 and ADV7182 transmit whole fields, bottom field followed by top (or vice-versa, depending on detected video standard). So for chips that do not have support for explicitly setting the field mode via I2P, set the field mode to V4L2_FIELD_ALTERNATE. I2P converts fields into frames using an edge adaptive algorithm. The frame rate is the same as the 'field rate': e.g. X fields per second are now X frames per second. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: rockchip/rga: Fix bad dma_free_attrs() parameterEzequiel Garcia
In rga_remove(), dma_free_attrs is being passed the wrong cpu address, which triggers an exception if the driver is removed. Fix it. Tested on a RK3399 platform, with a bind/unbind cycle. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: media.h: remove linux/version.h includeHans Verkuil
The media.h public header is one of only three public headers that include linux/version.h. Drop it from media.h. It was only used for an obsolete define. It has to be added to media-device.c, since that source relied on media.h to include it. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: vivid: Fix V4L2_FIELD_ALTERNATE new frame checkNicolas Dufresne
The vivid driver will overlay stream time on generated frames. Though, in interlacing mode V4L2_FIELD_ALTERNATE, each field is separate and must have the same time to ensure proper render. Though, this time was only updated every 2 frames as the code was checking against the wrong counter (frame counter rather then field counter). Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: coda: add SPS fixup code for frame sizes that are not multiples of 16Philipp Zabel
The CODA7541 firmware does not set the SPS frame cropping fields to properly describe coded h.264 streams with frame sizes that are not a multiple of the macroblock size. This adds RBSP parsing code and a SPS fixup routine to manually replace the cropping information in the headers produced by the firmware with the correct values. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> [hans.verkuil@cisco.com: added explanation of SPS RBSP to comment] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: coda: let CODA960 firmware set frame cropping in SPS headerPhilipp Zabel
When encoding h.264, if visible resolution is not aligned to macroblock size, frame cropping has to be set in the SPS header to produce correct streams. The CODA960 firmware can do this on its own if asked to. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>