summaryrefslogtreecommitdiffstats
path: root/drivers/media
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'media/v4.10-1' of ↵Linus Torvalds2016-12-16541-8690/+24110
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new Mediatek drivers: mtk-mdp and mtk-vcodec - some additions at the media documentation - the CEC core and drivers were promoted from staging to mainstream - some cleanups at the DVB core - the LIRC serial driver got promoted from staging to mainstream - added a driver for Renesas R-Car FDP1 driver - add DVBv5 statistics support to mn88473 driver - several fixes related to printk continuation lines - add support for HSV encoding formats - lots of other cleanups, fixups and driver improvements. * tag 'media/v4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (496 commits) [media] v4l: tvp5150: Add missing break in set control handler [media] v4l: tvp5150: Don't inline the tvp5150_selmux() function [media] v4l: tvp5150: Compile tvp5150_link_setup out if !CONFIG_MEDIA_CONTROLLER [media] em28xx: don't store usb_device at struct em28xx [media] em28xx: use usb_interface for dev_foo() calls [media] em28xx: don't change the device's name [media] mn88472: fix chip id check on probe [media] mn88473: fix chip id check on probe [media] lirc: fix error paths in lirc_cdev_add() [media] s5p-mfc: Add support for MFC v8 available in Exynos 5433 SoCs [media] s5p-mfc: Rework clock handling [media] s5p-mfc: Don't keep clock prepared all the time [media] s5p-mfc: Kill all IS_ERR_OR_NULL in clocks management code [media] s5p-mfc: Remove dead conditional code [media] s5p-mfc: Ensure that clock is disabled before turning power off [media] s5p-mfc: Remove special clock rate management [media] s5p-mfc: Use printk_ratelimited for reporting ioctl errors [media] s5p-mfc: Set DMA_ATTR_ALLOC_SINGLE_PAGES [media] vivid: Set color_enc on HSV formats [media] v4l2-tpg: Init hv_enc field with a valid value ...
| * Merge branch 'patchwork' into v4l_for_linusMauro Carvalho Chehab2016-12-15541-8690/+24110
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * patchwork: (496 commits) [media] v4l: tvp5150: Add missing break in set control handler [media] v4l: tvp5150: Don't inline the tvp5150_selmux() function [media] v4l: tvp5150: Compile tvp5150_link_setup out if !CONFIG_MEDIA_CONTROLLER [media] em28xx: don't store usb_device at struct em28xx [media] em28xx: use usb_interface for dev_foo() calls [media] em28xx: don't change the device's name [media] mn88472: fix chip id check on probe [media] mn88473: fix chip id check on probe [media] lirc: fix error paths in lirc_cdev_add() [media] s5p-mfc: Add support for MFC v8 available in Exynos 5433 SoCs [media] s5p-mfc: Rework clock handling [media] s5p-mfc: Don't keep clock prepared all the time [media] s5p-mfc: Kill all IS_ERR_OR_NULL in clocks management code [media] s5p-mfc: Remove dead conditional code [media] s5p-mfc: Ensure that clock is disabled before turning power off [media] s5p-mfc: Remove special clock rate management [media] s5p-mfc: Use printk_ratelimited for reporting ioctl errors [media] s5p-mfc: Set DMA_ATTR_ALLOC_SINGLE_PAGES [media] vivid: Set color_enc on HSV formats [media] v4l2-tpg: Init hv_enc field with a valid value ...
| | * [media] v4l: tvp5150: Add missing break in set control handlerLaurent Pinchart2016-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A break is missing resulting in the hue control enabling or disabling the decode completely. Fix it. Fixes: c43875f66140 ("[media] tvp5150: replace MEDIA_ENT_F_CONN_TEST by a control") Cc: stable@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: tvp5150: Don't inline the tvp5150_selmux() functionLaurent Pinchart2016-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The function is large and called in several places, don't inline it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: tvp5150: Compile tvp5150_link_setup out if !CONFIG_MEDIA_CONTROLLERLaurent Pinchart2016-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function is only referenced as a handler in the tvp5150_sd_media_ops structure, which is only used when CONFIG_MEDIA_CONTROLLER is set. Don't define the function and the structure when the configuration option is unset to avoid an unused function warning. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] em28xx: don't store usb_device at struct em28xxMauro Carvalho Chehab2016-12-127-37/+52
| | | | | | | | | | | | | | | | | | | | | | | | Now that we're storing usb_interface at em28xx struct, there's no good reason to keep storing usb_device, as we can get it from usb_interface. So, get rid of it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] em28xx: use usb_interface for dev_foo() callsMauro Carvalho Chehab2016-12-1210-213/+216
| | | | | | | | | | | | | | | | | | | | | | | | The usb_device->dev is not the right device for dev_foo() calls. Instead, it should use usb_interface->dev. Tested-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] em28xx: don't change the device's nameMauro Carvalho Chehab2016-12-121-10/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing the device name, causes it to be unable to remove the sysfs file, causing troubles if a device is removed and then re-inserted. [ 1010.310320] WARNING: CPU: 3 PID: 119 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x7b/0x90 [ 1010.310323] sysfs: cannot create duplicate filename '/bus/usb/devices/1-3.3' [ 1010.310325] Modules linked in: lgdt330x em28xx_dvb dvb_core em28xx_alsa tuner_xc2028 tuner tvp5150 em28xx_v4l videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core em28xx tveeprom v4l2_common videodev media xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables x_tables cmac bnep cpufreq_powersave cpufreq_conservative cpufreq_userspace binfmt_misc parport_pc ppdev lp parport snd_hda_codec_hdmi iTCO_wdt snd_hda_codec_realtek iTCO_vendor_support snd_hda_codec_generic arc4 intel_rapl x86_pkg_temp_thermal iwlmvm intel_powerclamp coretemp kvm_intel mac80211 kvm i915 [ 1010.310383] irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel iwlwifi pl2303 aesni_intel btusb aes_x86_64 usbserial lrw btrtl gf128mul glue_helper btbcm ablk_helper cryptd btintel bluetooth drm_kms_helper cfg80211 drm psmouse pcspkr i2c_i801 e1000e serio_raw snd_hda_intel snd_soc_rt5640 snd_hda_codec snd_soc_rl6231 snd_soc_ssm4567 mei_me i2c_smbus rfkill snd_hda_core ptp mei snd_soc_core ehci_pci sg lpc_ich shpchp mfd_core ehci_hcd pps_core snd_hwdep i2c_algo_bit snd_compress snd_pcm sdhci_acpi snd_timer battery snd sdhci elan_i2c snd_soc_sst_acpi mmc_core fjes dw_dmac i2c_hid soundcore snd_soc_sst_match i2c_designware_platform video i2c_designware_core acpi_pad acpi_als kfifo_buf tpm_tis button industrialio tpm_tis_core tpm ext4 crc16 jbd2 fscrypto mbcache dm_mod joydev evdev hid_logitech_hidpp [ 1010.310449] sd_mod hid_logitech_dj usbhid hid ahci libahci crc32c_intel libata xhci_pci xhci_hcd scsi_mod usbcore fan thermal [ 1010.310464] CPU: 3 PID: 119 Comm: kworker/3:2 Not tainted 4.9.0-rc8+ #14 [ 1010.310466] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015 [ 1010.310487] Workqueue: usb_hub_wq hub_event [usbcore] [ 1010.310490] 0000000000000000 ffffffff848f56c5 ffff8803b1f7f858 0000000000000000 [ 1010.310496] ffffffff8414f8f8 ffff88030000001f ffffed00763eff07 ffff8803b1f7f8f0 [ 1010.310501] ffff8803b3ea1e60 0000000000000001 ffffffffffffffef ffff8803b45c6840 [ 1010.310505] Call Trace: [ 1010.310517] [<ffffffff848f56c5>] ? dump_stack+0x5c/0x77 [ 1010.310522] [<ffffffff8414f8f8>] ? __warn+0x168/0x1a0 [ 1010.310526] [<ffffffff8414f9e4>] ? warn_slowpath_fmt+0xb4/0xf0 [ 1010.310529] [<ffffffff8414f930>] ? __warn+0x1a0/0x1a0 [ 1010.310534] [<ffffffff845436c6>] ? kasan_kmalloc+0xa6/0xd0 [ 1010.310539] [<ffffffff846ec2fa>] ? kernfs_path_from_node+0x4a/0x60 [ 1010.310543] [<ffffffff846f66eb>] ? sysfs_warn_dup+0x7b/0x90 [ 1010.310547] [<ffffffff846f6f26>] ? sysfs_do_create_link_sd.isra.2+0xb6/0xd0 [ 1010.310553] [<ffffffff84cd5a08>] ? bus_add_device+0x318/0x6b0 [ 1010.310557] [<ffffffff846f8693>] ? sysfs_create_groups+0x83/0x110 [ 1010.310562] [<ffffffff84ccff87>] ? device_add+0x777/0x1350 [ 1010.310567] [<ffffffff84ccf810>] ? device_private_init+0x180/0x180 [ 1010.310583] [<ffffffffc00c0f77>] ? usb_new_device+0x707/0x1030 [usbcore] [ 1010.310598] [<ffffffffc00c58c5>] ? hub_event+0x1d65/0x3280 [usbcore] [ 1010.310604] [<ffffffff841eb4ab>] ? account_entity_dequeue+0x30b/0x4a0 [ 1010.310618] [<ffffffffc00c3b60>] ? hub_port_debounce+0x280/0x280 [usbcore] [ 1010.310624] [<ffffffff8407ccd0>] ? compat_start_thread+0x80/0x80 [ 1010.310629] [<ffffffff851f5cb4>] ? __schedule+0x704/0x1770 [ 1010.310633] [<ffffffff851f55b0>] ? io_schedule_timeout+0x390/0x390 [ 1010.310638] [<ffffffff84541783>] ? cache_reap+0x173/0x200 [ 1010.310642] [<ffffffff84197bed>] ? process_one_work+0x4ed/0xe60 [ 1010.310646] [<ffffffff84198642>] ? worker_thread+0xe2/0xfd0 [ 1010.310650] [<ffffffff8421f76c>] ? __wake_up_common+0xbc/0x160 [ 1010.310654] [<ffffffff84198560>] ? process_one_work+0xe60/0xe60 [ 1010.310658] [<ffffffff841a837c>] ? kthread+0x1cc/0x220 [ 1010.310663] [<ffffffff841a81b0>] ? kthread_park+0x80/0x80 [ 1010.310667] [<ffffffff841a81b0>] ? kthread_park+0x80/0x80 [ 1010.310671] [<ffffffff841a81b0>] ? kthread_park+0x80/0x80 [ 1010.310675] [<ffffffff852016f5>] ? ret_from_fork+0x25/0x30 Tested-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] mn88472: fix chip id check on probeAntti Palosaari2016-12-011-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A register used to identify chip during probe was overwritten during firmware download and due to that later probe's for warm chip were failing. Detect chip from the another register, which is located on different register bank 2. Fixes: 94d0eaa41987 ("[media] mn88472: move out of staging to media") Cc: <stable@vger.kernel.org> # v4.8+ Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] mn88473: fix chip id check on probeAntti Palosaari2016-12-011-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A register used to identify chip during probe was overwritten during firmware download and due to that later probe's for warm chip were failing. Detect chip from the another register, which is located on different register bank 2. Fixes: 7908fad99a6c ("[media] mn88473: finalize driver") Cc: <stable@vger.kernel.org> # v4.8+ Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] lirc: fix error paths in lirc_cdev_add()Sean Young2016-12-011-5/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "c77d17c0 [media] lirc: use-after free" introduces two problems: cdev_del() can be called with a NULL argument, and the kobject_put() path will cause a double free. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Add support for MFC v8 available in Exynos 5433 SoCsMarek Szyprowski2016-11-301-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Exynos5433 SoC has MFC v8 hardware module, but it has more complex clock hierarchy, so a new compatible is added. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Rework clock handlingMarek Szyprowski2016-11-303-59/+56Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the code for handling clocks. Now clocks are defined per each device variant, what is a preparation for adding support for Exynos 5433 MFC V8, which has more clocks than all previous versions. Also use devm_clk_get() to simplify cleanup path. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Don't keep clock prepared all the timeMarek Szyprowski2016-11-301-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves preparation of clocks from s5p_mfc_init_pm() (driver probe) to s5p_mfc_power_on() (start of device operation). This change will allow to use runtime power usage optimization on newer Samsung Exynos platforms (for example Exynos 5433). Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Kill all IS_ERR_OR_NULL in clocks management codeMarek Szyprowski2016-11-301-9/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit "s5p-mfc: Fix clock management in s5p_mfc_release function" all clocks related functions are called only when MFC device is really available, so there is no additional check needed for NULL gate clocks. This patch simplifies the code and kills IS_ERR_OR_NULL macro usage. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Remove dead conditional codeMarek Szyprowski2016-11-303-48/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_PM is always enabled on Exynos platforms, so remove dead code related to early development of MFC driver on platform without PM support. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Ensure that clock is disabled before turning power offMarek Szyprowski2016-11-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move clock disabling before turning power off. This will enable later to add calls to clk_prepare/unprepare in the s5p_mfc_power_off() function to avoid keeping clocks prepared all the time when driver is bound. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Remove special clock rate managementMarek Szyprowski2016-11-301-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The maximum rate of special clock depends on SoC variant and should be set in device tree via assigned-clock-rates property, so remove the code which forces special clock to 200MHz. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Use printk_ratelimited for reporting ioctl errorsMarek Szyprowski2016-11-303-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some applications don't check error codes from QBUF/DQBUF ioctls, so don't spam kernel log with errors if they fall into endless loop trying to queue next buffer after a failure. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] s5p-mfc: Set DMA_ATTR_ALLOC_SINGLE_PAGESDouglas Anderson2016-11-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do video allocation all the time and we need it to be fast. Plus TLB efficiency isn't terribly important for video. That means we want to set DMA_ATTR_ALLOC_SINGLE_PAGES. See also the previous change (commit 14d3ae2efeed "ARM: dma-mapping: Use DMA_ATTR_ALLOC_SINGLE_PAGES hint to optimize allocation"). [m.szyprowski: rebased patch onto v4.9-rc1 and adapted changes to latest videbuf2 changes, this simplifies code changes to only set proper dma attribute flag and comment the reason for it, added commit id of arch/arm/mm patch] Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] vivid: Set color_enc on HSV formatsRicardo Ribalda2016-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | HSV formats were missing the color encoding, which leads to an invalid ycbcr_enc value during get_fmt and try_fmt. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l2-tpg: Init hv_enc field with a valid valueRicardo Ribalda2016-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zero is not a valid value for hsv_enc. Set the field to a valid initial value. This is not a problem for vivid, because it sets the field to 180 via tpg_s_hsv_enc() on the control initialization, but it might be a source of errors for other drivers that use this code. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] cec: pass parent device in register(), not allocate()Hans Verkuil2016-11-299-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cec_allocate_adapter function doesn't need the parent device, only the cec_register_adapter function needs it. Drop the cec_devnode parent field, since devnode.dev.parent can be used instead. This change makes the framework consistent with other frameworks where the parent device is not used until the device is registered. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] uvcvideo: freeing an error pointerDan Carpenter2016-11-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent cleanup introduced a potential dereference of -EFAULT when we call kfree(map->menu_info). Fixes: 4cc5bed1caeb ("[media] uvcvideo: Use memdup_user() rather than duplicating its implementation") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] DaVinci-VPFE-Capture: fix error handlingArnd Bergmann2016-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent cleanup had the right idea to remove the initialization of the error variable, but missed the actual benefit of that, which is that we get warnings if there is a bug in it. Now we get a warning about a bug that was introduced by this cleanup: drivers/media/platform/davinci/vpfe_capture.c: In function 'vpfe_probe': drivers/media/platform/davinci/vpfe_capture.c:1992:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds the missing initialization that the warning is about, and another one that was preexisting and that we did not get a warning for. That second bug has existed since the driver was first added. Fixes: efb74461f5a6 ("[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_probe()") Fixes: 7da8a6cb3e5b ("V4L/DVB (12248): v4l: vpfe capture bridge driver for DM355 and DM6446") [mchehab@s-opensource.com: fix a merge conflict] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] cx88: make checkpatch.pl happyMauro Carvalho Chehab2016-11-2516-872/+975
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually, I don't like fixing coding style issues on non-staging drivers, as it could be a mess pretty easy, and could become like a snow ball. That's the case of recent changes on two changesets: they disalign some statements. Yet, a care a lot with cx88 driver, as it was the first driver I touched at the Kernel, and I've been maintaining it since 2005. So, several of the coding style issues were due to my code. Per Andrey's suggestion, I ran checkpatch.pl in strict mode, with fixed several other issues, did some function alinments, but broke other alinments. So, I had to manually apply another round of manual fixes to make sure that everything is ok, and to make checkpatch happy with this patch. With this patch, checkpatch.pl is now happy when called with: ./scripts/checkpatch.pl -f --max-line-length=998 --ignore PREFER_PR_LEVEL Also, the 80-cols violations that made sense were fixed. Checkpatch would be happier if we convert it to use dev_foo(), but this is a more complex change. NOTE: there are some places with msleep(1). As this driver was written at the time that the default was to sleep at least 10ms on such calls (e. g. CONFIG_HZ=100), I replaced those calls by usleep_range(10000, 20000), with should be safe to avoid breakages. Fixes: 65bc2fe86e66 ("[media] cx88: convert it to use pr_foo() macros") Fixes: 7b61ba8ff838 ("[media] cx88: make checkpatch happier") Suggested-by: Andrey Utkin <andrey_utkin@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Reviewed-by: Andrey Utkin <andrey_utkin@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: rcar_fdp1: add FCP dependencyArnd Bergmann2016-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4710b752e029 ("[media] v4l: Add Renesas R-Car FDP1 Driver") in the v4l-dvb tree adds CONFIG_VIDEO_RENESAS_FDP1. It calls into the FCP driver, but when there is no dependency, FCP might be a module while FDP1 is built-in. We have the same logic in VIDEO_RENESAS_VSP1, which also depends on FCP not being a module when it is built-in itself. drivers/media/platform/rcar_fdp1.o: In function `fdp1_pm_runtime_resume': rcar_fdp1.c:(.text.fdp1_pm_runtime_resume+0x78): undefined reference to `rcar_fcp_enable' drivers/media/platform/rcar_fdp1.o: In function `fdp1_pm_runtime_suspend': rcar_fdp1.c:(.text.fdp1_pm_runtime_suspend+0x14): undefined reference to `rcar_fcp_disable' drivers/media/platform/rcar_fdp1.o: In function `fdp1_probe': rcar_fdp1.c:(.text.fdp1_probe+0x15c): undefined reference to `rcar_fcp_get' Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: rcar_fdp1: mark PM functions as __maybe_unusedArnd Bergmann2016-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new driver produces a warning when CONFIG_PM is disabled: platform/rcar_fdp1.c:2408:12: error: 'fdp1_pm_runtime_resume' defined but not used [-Werror=unused-function] platform/rcar_fdp1.c:2399:12: error: 'fdp1_pm_runtime_suspend' defined but not used [-Werror=unused-function] This marks the two functions as __maybe_unused. Fixes: 4710b752e029 ("[media] v4l: Add Renesas R-Car FDP1 Driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] media: remove obsolete Media Device Managed resource interfacesShuah Khan2016-11-251-26/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove obsolete media_device_get_devres(), media_device_find_devres(), and media_device_release_devres() interfaces. These interfaces are now obsolete. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] dvb-net: split the logic at dvb_net_ule() into other functionsMauro Carvalho Chehab2016-11-251-361/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is too big and too complex, making really hard to understand what's there. Split it into sub-routines, in order to make it easier to be understood, and to allow gcc to better parse it. As a bonus, it gets rid of a goto in the middle of a routine. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] dvb_net: prepare to split a very complex functionMauro Carvalho Chehab2016-11-251-220/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dvb_net code has a really complex function, meant to handle DVB network packages: it is long, has several loops and ifs inside, and even cause warnings with gcc5. Prepare it to be split into smaller functions by storing all arguments and internal vars inside a struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] uvcvideo: Use memdup_user() rather than duplicating its implementationMarkus Elfring2016-11-231-8/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] uvcvideo: Add bayer 16-bit format patternsEdgar Thier2016-11-232-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those formats are implemented by The DFK 23UP1300, DFK 23UX249 and DFK 23UX250 USB 3.0 industrial cameras from The Imaging Source. Signed-off-by: Edgar Thier <info@edgarthier.net> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: Add description of the Y8I, Y12I and Z16 formatsLaurent Pinchart2016-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | The formats have been added without a description, fix that. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: Add 16-bit raw bayer pixel formatsSakari Ailus2016-11-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formats added by this patch are: V4L2_PIX_FMT_SBGGR16 V4L2_PIX_FMT_SGBRG16 V4L2_PIX_FMT_SGRBG16 V4L2_PIX_FMT_SRGGB16 already existed before the patch. Rework the documentation to match that of the other sample depths. Also align the description of V4L2_PIX_FMT_SRGGB16 to match with other similar formats. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] saa7146: Fix for while releasing video buffersAndrey Utkin2016-11-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix this bug: "[BUG] process stuck when closing saa7146 [dvb_ttpci]" Release queued DMA buffers when ending streaming, so that videobuf_waiton() doesn't block forever. As reported, this fixes avoids occasional lockup of process reading from video device, which manifests in such log: INFO: task ffmpeg:9864 blocked for more than 120 seconds. Tainted: P O 4.6.7 #3 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. ffmpeg D ffff880177cc7b00 0 9864 1 0x00000000 ffff880177cc7b00 0000000000000202 0000000000000202 ffffffff8180b4c0 ffff88019d79e4c0 ffffffff81064050 ffff880177cc7ae0 ffff880177cc8000 ffff880177cc7b18 ffff8801fd41d648 ffff8802307acca0 ffff8802307acc70 Call Trace: [<ffffffff81064050>] ? preempt_count_add+0x89/0xab [<ffffffff81477215>] schedule+0x86/0x9e [<ffffffff81477215>] ? schedule+0x86/0x9e [<ffffffffa0fe1c96>] videobuf_waiton+0x131/0x15e [videobuf_core] [<ffffffff8107727b>] ? wait_woken+0x6d/0x6d [<ffffffffa1017be9>] saa7146_dma_free+0x39/0x5b [saa7146_vv] [<ffffffffa10186c4>] buffer_release+0x2a/0x3e [saa7146_vv] [<ffffffffa0fee4a8>] videobuf_vm_close+0xd8/0x103 [videobuf_dma_sg] [<ffffffff8112049e>] remove_vma+0x25/0x4d [<ffffffff81121a32>] exit_mmap+0xce/0xf7 [<ffffffff8104381d>] mmput+0x4e/0xe2 [<ffffffff810491fd>] do_exit+0x372/0x920 [<ffffffff81049813>] do_group_exit+0x3c/0x98 [<ffffffff810522ef>] get_signal+0x4e8/0x56e [<ffffffff810710a5>] ? task_dead_fair+0xd/0xf [<ffffffff81017020>] do_signal+0x23/0x521 [<ffffffff81479e82>] ? _raw_spin_unlock_irqrestore+0x13/0x25 [<ffffffff8109710d>] ? hrtimer_try_to_cancel+0xd7/0x104 [<ffffffff8109b306>] ? ktime_get+0x4c/0xa1 [<ffffffff81096ea6>] ? update_rmtp+0x46/0x5b [<ffffffff81097ce0>] ? hrtimer_nanosleep+0xe4/0x10e [<ffffffff81096e3c>] ? hrtimer_init+0xeb/0xeb [<ffffffff810014f8>] exit_to_usermode_loop+0x4f/0x93 [<ffffffff810019fe>] syscall_return_slowpath+0x3b/0x46 [<ffffffff8147a355>] entry_SYSCALL_64_fastpath+0x8d/0x8f Reported-by: Philipp Matthias Hahn <pmhahn+video@pmhahn.de> Tested-by: Philipp Matthias Hahn <pmhahn+video@pmhahn.de> Signed-off-by: Andrey Utkin <andrey_utkin@fastmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] mceusb: remove pointless mce_flush_rx_buffer functionSean Young2016-11-231-46/+31Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function just submits the urb much like mceusb_dev_resume; removing it simplifies mce_request_packet. Also add missing usb_kill_urb to mce_dev_probe. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] mceusb: remove useless debug messageSean Young2016-11-231-20/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | Such debug message has a logic to track the IR status, but it doesn't provide much info. So, get rid of it. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] Raise adapter number limitБуди Романто, AreMa Inc2016-11-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The current limit is too low for latest cards with 8+ tuners on a single slot. IMHO, the most appropriate minimum default is 16. Signed-off-by: Буди Романто, AreMa Inc <knightrider@are.ma> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] em28xx: only use mt9v011 if camera support is enabledArnd Bergmann2016-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In randconfig builds that select VIDEO_EM28XX_V4L2 and MEDIA_SUBDRV_AUTOSELECT, but not MEDIA_CAMERA_SUPPORT, we get a Kconfig warning: warning: (VIDEO_EM28XX_V4L2) selects VIDEO_MT9V011 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT) This avoids the warning by making that 'select' conditional on MEDIA_CAMERA_SUPPORT. Alternatively we could mark EM28XX as 'depends on MEDIA_CAMERA_SUPPORT', but it does not seem to have any real dependency on that itself. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] go7007: add MEDIA_CAMERA_SUPPORT dependencyArnd Bergmann2016-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT, so we get a Kconfig warning if that is disabled: warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT) This adds another dependency so we don't accidentally select it when it is unavailable. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] dvb: remove unused systime() functionArnd Bergmann2016-11-232-12/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The systime function uses struct timespec, which we want to stop using in the kernel because it overflows in 2038. Fortunately, this use in dibx000_common is in a function that is never called, so we can just remove it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] stv090x: use lookup tables for carrier/noise ratioJoerg Riechardt2016-11-231-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stv090x driver uses the lookup table for signal strength already, with this patch we use the lookup tables for carrier/noise ratio as well. This has the advantage, that values for DVB-S and DVB-S2 are now corresponding, while before they were way off. The values are now proportional to real carrier/noise ratio, while before they were corresponding to register values. So now applications are able to give the user real carrier/noise ratio. Because the output has to be within 0x0000...0xFFFF the three negative values for DVB-S2 are omitted. This is no significant loss, because reception is lost at 7.5 dB already (TT S2-1600, Cine S2), so the negative values are not really important, and also for DVB-S they don´t exist. Signed-off-by: Joerg Riechardt <j.riechardt@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] netup_unidvb: use module_pci_driverGeliang Tang2016-11-221-12/+1Star
| | | | | | | | | | | | | | | | | | | | | Use module_pci_driver() helper to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] stk-webcam: fix an endian bug in stk_camera_read_reg()Dan Carpenter2016-11-223-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | We pass an int pointer to stk_camera_read_reg() but only write to the highest byte. It's a bug on big endian systems and generally a nasty thing to do and doesn't match the write function either. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] ir-hix5hd2: make hisilicon,power-syscon property deprecatedRuqiang Ju2016-11-221-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clock of IR can be provided by the clock provider and controlled by common clock framework APIs. Signed-off-by: Ruqiang Ju <juruqiang@huawei.com> Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] mn88473: refactor and fix statisticsAntti Palosaari2016-11-222-400/+161Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove DVB-T2 BER as it does not work at all and I didn't find how to fix. Fix DVB-T and DVB-C BER. It seems to return new some realistic looking values. Use (1 << 24) base for CNR calculations to keep it in line with dvb logarithm functions. Move all statistic logic to mn88473_read_status() function. Use regmap_bulk_read() for reading multiple registers as a one go. Many more and less minor changes. Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] mn88473: add DVBv5 statistics supportMartin Blumenstingl2016-11-222-41/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement DVBv5 statistics support for DVB-T, DVB-T2 and DVB-C. All information was taken from the LinuxTV wiki, where Benjamin Larsson has documented all registers: https://www.linuxtv.org/wiki/index.php/Panasonic_MN88472 Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] sanyo decoder: address was being truncatedSean Young2016-11-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The address is 13 bits but it was stuffed in an u8, so 5 bits are missing from the scancode. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| | * [media] v4l: compat: Prevent allocating excessive amounts of memorySakari Ailus2016-11-221-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_v4l2_ext_controls32() is used to convert the 32-bit compat struct into native 64-bit representation. The function multiplies the array length by the entry length before validating size. Perform the size validation first. Also use unsigned values for size computation. Make similar changes to get_v4l2_buffer32() for multi-plane buffers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>