Merge tag 'media/v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Jun 2018 19:34:37 +0000 (12:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Jun 2018 19:34:37 +0000 (12:34 -0700)
Pull media updates from Mauro Carvalho Chehab:

 - remove of atomisp driver from staging, as nobody would have time to
   dedicate huge efforts to fix all the problems there. Also, we have a
   feeling that the driver may not even run the way it is.

 - move Zoran driver to staging, in order to be either fixed to use VB2
   and the proper media kAPIs or to be removed

 - remove videobuf-dvb driver, with is unused for a while

 - some V4L2 documentation fixes/improvements

 - new sensor drivers: imx258 and ov7251

 - a new driver was added to allow using I2C transparent drivers

 - several improvements at the ddbridge driver

 - several improvements at the ISDB pt1 driver, making it more coherent
   with the DVB framework

 - added a new platform driver for MIPI CSI-2 RX: cadence

 - now, all media drivers can be compiled on x86 with COMPILE_TEST

 - almost all media drivers now build on non-x86 architectures with
   COMPILE_TEST

 - lots of other random stuff: cleanups, support for new board models,
   bug fixes, etc

* tag 'media/v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (464 commits)
  media: omap2: fix compile-testing with FB_OMAP2=m
  media: media/radio/Kconfig: add back RADIO_ISA
  media: v4l2-ioctl.c: fix missing unlock in __video_do_ioctl()
  media: pxa_camera: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power
  media: arch: sh: migor: Fix TW9910 PDN gpio
  media: staging: tegra-vde: Reset VDE regardless of memory client resetting failure
  media: marvel-ccic: mmp: select VIDEOBUF2_VMALLOC/DMA_CONTIG
  media: marvel-ccic: allow ccic and mmp drivers to coexist
  media: uvcvideo: Prevent setting unavailable flags
  media: ddbridge: conditionally enable fast TS for stv0910-equipped bridges
  media: dvb-frontends/stv0910: make TS speed configurable
  media: ddbridge/mci: add identifiers to function definition arguments
  media: ddbridge/mci: protect against out-of-bounds array access in stop()
  media: rc: ensure input/lirc device can be opened after register
  media: rc: nuvoton: Keep device enabled during reg init
  media: rc: nuvoton: Keep track of users on CIR enable/disable
  media: rc: nuvoton: Tweak the interrupt enabling dance
  media: uvcvideo: Support realtek's UVC 1.5 device
  media: uvcvideo: Fix driver reference counting
  media: gspca_zc3xx: Enable short exposure times for OV7648
  ...

1  2 
MAINTAINERS
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_crtc.h
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
drivers/media/i2c/tda1997x.c
drivers/media/rc/Kconfig
drivers/media/rc/lirc_dev.c
drivers/media/rc/rc-core-priv.h
drivers/media/rc/rc-ir-raw.c
drivers/staging/media/zoran/videocodec.c

diff --combined MAINTAINERS
@@@ -137,9 -137,9 +137,9 @@@ Maintainers List (try to look for most 
                -----------------------------------
  
  3C59X NETWORK DRIVER
 -M:    Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
 +M:    Steffen Klassert <klassert@kernel.org>
  L:    netdev@vger.kernel.org
 -S:    Maintained
 +S:    Odd Fixes
  F:    Documentation/networking/vortex.txt
  F:    drivers/net/ethernet/3com/3c59x.c
  
@@@ -767,14 -767,12 +767,14 @@@ F:      drivers/gpu/drm/amd/amdgpu/amdgpu_am
  F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
  F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
  F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
 +F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
  F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
  F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
  F:    drivers/gpu/drm/amd/amdkfd/
  F:    drivers/gpu/drm/amd/include/cik_structs.h
  F:    drivers/gpu/drm/amd/include/kgd_kfd_interface.h
  F:    drivers/gpu/drm/amd/include/vi_structs.h
 +F:    drivers/gpu/drm/amd/include/v9_structs.h
  F:    include/uapi/linux/kfd_ioctl.h
  
  AMD SEATTLE DEVICE TREE SUPPORT
@@@ -2333,16 -2331,8 +2333,16 @@@ S:    Maintaine
  F:    drivers/gpio/gpio-ath79.c
  F:    Documentation/devicetree/bindings/gpio/gpio-ath79.txt
  
 +ATHEROS 71XX/9XXX USB PHY DRIVER
 +M:    Alban Bedel <albeu@free.fr>
 +W:    https://github.com/AlbanBedel/linux
 +T:    git git://github.com/AlbanBedel/linux
 +S:    Maintained
 +F:    drivers/phy/qualcomm/phy-ath79-usb.c
 +F:    Documentation/devicetree/bindings/phy/phy-ath79-usb.txt
 +
  ATHEROS ATH GENERIC UTILITIES
 -M:    "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
 +M:    Kalle Valo <kvalo@codeaurora.org>
  L:    linux-wireless@vger.kernel.org
  S:    Supported
  F:    drivers/net/wireless/ath/*
@@@ -2357,7 -2347,7 +2357,7 @@@ S:      Maintaine
  F:    drivers/net/wireless/ath/ath5k/
  
  ATHEROS ATH6KL WIRELESS DRIVER
 -M:    Kalle Valo <kvalo@qca.qualcomm.com>
 +M:    Kalle Valo <kvalo@codeaurora.org>
  L:    linux-wireless@vger.kernel.org
  W:    http://wireless.kernel.org/en/users/Drivers/ath6kl
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
@@@ -2732,13 -2722,13 +2732,13 @@@ L:   netdev@vger.kernel.or
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
 +Q:    https://patchwork.ozlabs.org/project/netdev/list/?delegate=77147
  S:    Supported
  F:    arch/x86/net/bpf_jit*
  F:    Documentation/networking/filter.txt
  F:    Documentation/bpf/
  F:    include/linux/bpf*
  F:    include/linux/filter.h
 -F:    include/trace/events/bpf.h
  F:    include/trace/events/xdp.h
  F:    include/uapi/linux/bpf*
  F:    include/uapi/linux/filter.h
@@@ -2751,7 -2741,6 +2751,7 @@@ F:      net/sched/act_bpf.
  F:    net/sched/cls_bpf.c
  F:    samples/bpf/
  F:    tools/bpf/
 +F:    tools/lib/bpf/
  F:    tools/testing/selftests/bpf/
  
  BROADCOM B44 10/100 ETHERNET DRIVER
@@@ -3147,6 -3136,13 +3147,13 @@@ S:    Supporte
  F:    Documentation/filesystems/caching/cachefiles.txt
  F:    fs/cachefiles/
  
+ CADENCE MIPI-CSI2 BRIDGES
+ M:    Maxime Ripard <maxime.ripard@bootlin.com>
+ L:    linux-media@vger.kernel.org
+ S:    Maintained
+ F:    Documentation/devicetree/bindings/media/cdns,*.txt
+ F:    drivers/media/platform/cadence/cdns-csi2*
  CADET FM/AM RADIO RECEIVER DRIVER
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -3442,12 -3438,6 +3449,12 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/input/touchscreen/chipone_icn8318.txt
  F:    drivers/input/touchscreen/chipone_icn8318.c
  
 +CHIPONE ICN8505 I2C TOUCHSCREEN DRIVER
 +M:    Hans de Goede <hdegoede@redhat.com>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    drivers/input/touchscreen/chipone_icn8505.c
 +
  CHROME HARDWARE PLATFORM SUPPORT
  M:    Benson Leung <bleung@chromium.org>
  M:    Olof Johansson <olof@lixom.net>
@@@ -3708,6 -3698,7 +3715,6 @@@ F:      drivers/cpufreq/arm_big_little_dt.
  
  CPU POWER MONITORING SUBSYSTEM
  M:    Thomas Renninger <trenn@suse.com>
 -M:    Shuah Khan <shuahkh@osg.samsung.com>
  M:    Shuah Khan <shuah@kernel.org>
  L:    linux-pm@vger.kernel.org
  S:    Maintained
@@@ -4326,7 -4317,7 +4333,7 @@@ F:      Documentation/driver-api/dma-buf.rs
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  
  DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
 -M:    Vinod Koul <vinod.koul@intel.com>
 +M:    Vinod Koul <vkoul@kernel.org>
  L:    dmaengine@vger.kernel.org
  Q:    https://patchwork.kernel.org/project/linux-dmaengine/list/
  S:    Maintained
@@@ -4347,14 -4338,12 +4354,14 @@@ W:   http://git.infradead.org/users/hch/d
  S:    Supported
  F:    lib/dma-debug.c
  F:    lib/dma-direct.c
 +F:    lib/dma-noncoherent.c
  F:    lib/dma-virt.c
  F:    drivers/base/dma-mapping.c
  F:    drivers/base/dma-coherent.c
  F:    include/asm-generic/dma-mapping.h
  F:    include/linux/dma-direct.h
  F:    include/linux/dma-mapping.h
 +F:    include/linux/dma-noncoherent.h
  
  DME1737 HARDWARE MONITOR DRIVER
  M:    Juerg Haefliger <juergh@gmail.com>
@@@ -4688,7 -4677,7 +4695,7 @@@ F:      Documentation/devicetree/bindings/di
  
  DRM DRIVERS FOR FREESCALE DCU
  M:    Stefan Agner <stefan@agner.ch>
 -M:    Alison Wang <alison.wang@freescale.com>
 +M:    Alison Wang <alison.wang@nxp.com>
  L:    dri-devel@lists.freedesktop.org
  S:    Supported
  F:    drivers/gpu/drm/fsl-dcu/
@@@ -4799,14 -4788,6 +4806,14 @@@ S:    Maintaine
  F:    drivers/gpu/drm/omapdrm/
  F:    Documentation/devicetree/bindings/display/ti/
  
 +DRM DRIVERS FOR V3D
 +M:    Eric Anholt <eric@anholt.net>
 +S:    Supported
 +F:    drivers/gpu/drm/v3d/
 +F:    include/uapi/drm/v3d_drm.h
 +F:    Documentation/devicetree/bindings/display/brcm,bcm-v3d.txt
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +
  DRM DRIVERS FOR VC4
  M:    Eric Anholt <eric@anholt.net>
  T:    git git://github.com/anholt/linux
@@@ -4853,15 -4834,6 +4860,15 @@@ S:    Maintaine
  F:    drivers/gpu/drm/tinydrm/
  F:    include/drm/tinydrm/
  
 +DRM DRIVERS FOR XEN
 +M:    Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +L:    dri-devel@lists.freedesktop.org
 +L:    xen-devel@lists.xen.org
 +S:    Supported
 +F:    drivers/gpu/drm/xen/
 +F:    Documentation/gpu/xen-front.rst
 +
  DRM TTM SUBSYSTEM
  M:    Christian Koenig <christian.koenig@amd.com>
  M:    Roger He <Hongbo.He@amd.com>
@@@ -5353,6 -5325,7 +5360,6 @@@ F:      include/linux/*mdio*.
  F:    include/linux/of_net.h
  F:    include/linux/phy.h
  F:    include/linux/phy_fixed.h
 -F:    include/linux/platform_data/mdio-gpio.h
  F:    include/linux/platform_data/mdio-bcm-unimac.h
  F:    include/trace/events/mdio.h
  F:    include/uapi/linux/mdio.h
@@@ -5423,6 -5396,7 +5430,6 @@@ S:      Maintaine
  F:    drivers/iommu/exynos-iommu.c
  
  EZchip NPS platform support
 -M:    Elad Kanfi <eladkan@mellanox.com>
  M:    Vineet Gupta <vgupta@synopsys.com>
  S:    Supported
  F:    arch/arc/plat-eznps
@@@ -5448,19 -5422,6 +5455,19 @@@ S:    Maintaine
  F:    Documentation/hwmon/f71805f
  F:    drivers/hwmon/f71805f.c
  
 +FADDR2LINE
 +M:    Josh Poimboeuf <jpoimboe@redhat.com>
 +S:    Maintained
 +F:    scripts/faddr2line
 +
 +FAILOVER MODULE
 +M:    Sridhar Samudrala <sridhar.samudrala@intel.com>
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +F:    net/core/failover.c
 +F:    include/net/failover.h
 +F:    Documentation/networking/failover.rst
 +
  FANOTIFY
  M:    Jan Kara <jack@suse.cz>
  R:    Amir Goldstein <amir73il@gmail.com>
@@@ -5613,7 -5574,6 +5620,7 @@@ S:      Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga.git
  Q:    http://patchwork.kernel.org/project/linux-fpga/list/
  F:    Documentation/fpga/
 +F:    Documentation/driver-api/fpga/
  F:    Documentation/devicetree/bindings/fpga/
  F:    drivers/fpga/
  F:    include/linux/fpga/
@@@ -5671,6 -5631,7 +5678,6 @@@ M:      Claudiu Manoil <claudiu.manoil@nxp.c
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/freescale/gianfar*
 -X:    drivers/net/ethernet/freescale/gianfar_ptp.c
  F:    Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
  
  FREESCALE GPMI NAND DRIVER
@@@ -5717,14 -5678,6 +5724,14 @@@ S:    Maintaine
  F:    drivers/net/ethernet/freescale/fman
  F:    Documentation/devicetree/bindings/powerpc/fsl/fman.txt
  
 +FREESCALE QORIQ PTP CLOCK DRIVER
 +M:    Yangbo Lu <yangbo.lu@nxp.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    drivers/ptp/ptp_qoriq.c
 +F:    include/linux/fsl/ptp_qoriq.h
 +F:    Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
 +
  FREESCALE QUAD SPI DRIVER
  M:    Han Xu <han.xu@nxp.com>
  L:    linux-mtd@lists.infradead.org
@@@ -6004,8 -5957,8 +6011,8 @@@ S:      Maintaine
  F:    scripts/get_maintainer.pl
  
  GFS2 FILE SYSTEM
 -M:    Steven Whitehouse <swhiteho@redhat.com>
  M:    Bob Peterson <rpeterso@redhat.com>
 +M:    Andreas Gruenbacher <agruenba@redhat.com>
  L:    cluster-devel@redhat.com
  W:    http://sources.redhat.com/cluster/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
@@@ -6273,7 -6226,6 +6280,7 @@@ L:      linux-hwmon@vger.kernel.or
  W:    http://hwmon.wiki.kernel.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/hwmon/
  F:    Documentation/hwmon/
  F:    drivers/hwmon/
  F:    include/linux/hwmon*.h
@@@ -6560,15 -6512,9 +6567,15 @@@ F:    Documentation/networking/hinic.tx
  F:    drivers/net/ethernet/huawei/hinic/
  
  HUGETLB FILESYSTEM
 -M:    Nadia Yvette Chambers <nyc@holomorphy.com>
 +M:    Mike Kravetz <mike.kravetz@oracle.com>
 +L:    linux-mm@kvack.org
  S:    Maintained
  F:    fs/hugetlbfs/
 +F:    mm/hugetlb.c
 +F:    include/linux/hugetlb.h
 +F:    Documentation/admin-guide/mm/hugetlbpage.rst
 +F:    Documentation/vm/hugetlbfs_reserv.rst
 +F:    Documentation/ABI/testing/sysfs-kernel-mm-hugepages
  
  HVA ST MEDIA DRIVER
  M:    Jean-Christophe Trotin <jean-christophe.trotin@st.com>
@@@ -6808,12 -6754,6 +6815,12 @@@ L:    linux-scsi@vger.kernel.or
  S:    Supported
  F:    drivers/scsi/ibmvscsi/ibmvfc*
  
 +IBM Power Virtual Management Channel Driver
 +M:    Bryant G. Ly <bryantly@linux.vnet.ibm.com>
 +M:    Steven Royer <seroyer@linux.vnet.ibm.com>
 +S:    Supported
 +F:    drivers/misc/ibmvmc.*
 +
  IBM Power Virtual SCSI Device Drivers
  M:    Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
  L:    linux-scsi@vger.kernel.org
@@@ -7097,13 -7037,14 +7104,13 @@@ L:   linux-fbdev@vger.kernel.or
  S:    Maintained
  F:    drivers/video/fbdev/i810/
  
 -INTEL ASoC BDW/HSW DRIVERS
 +INTEL ASoC DRIVERS
 +M:    Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
 +M:    Liam Girdwood <liam.r.girdwood@linux.intel.com>
  M:    Jie Yang <yang.jie@linux.intel.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  S:    Supported
 -F:    sound/soc/intel/common/sst-dsp*
 -F:    sound/soc/intel/common/sst-firmware.c
 -F:    sound/soc/intel/boards/broadwell.c
 -F:    sound/soc/intel/haswell/
 +F:    sound/soc/intel/
  
  INTEL C600 SERIES SAS CONTROLLER DRIVER
  M:    Intel SCU Linux support <intel-linux-scu@intel.com>
@@@ -7138,8 -7079,8 +7145,8 @@@ Q:      http://patchwork.ozlabs.org/project/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
  S:    Supported
 -F:    Documentation/networking/e100.txt
 -F:    Documentation/networking/e1000.txt
 +F:    Documentation/networking/e100.rst
 +F:    Documentation/networking/e1000.rst
  F:    Documentation/networking/e1000e.txt
  F:    Documentation/networking/igb.txt
  F:    Documentation/networking/igbvf.txt
@@@ -7699,9 -7640,8 +7706,9 @@@ M:      Masahiro Yamada <yamada.masahiro@soc
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig
  L:    linux-kbuild@vger.kernel.org
  S:    Maintained
 -F:    Documentation/kbuild/kconfig-language.txt
 +F:    Documentation/kbuild/kconfig*
  F:    scripts/kconfig/
 +F:    scripts/Kconfig.include
  
  KDUMP
  M:    Dave Young <dyoung@redhat.com>
@@@ -7763,10 -7703,10 +7770,10 @@@ F:   include/linux/sunrpc
  F:    include/uapi/linux/sunrpc/
  
  KERNEL SELFTEST FRAMEWORK
 -M:    Shuah Khan <shuahkh@osg.samsung.com>
  M:    Shuah Khan <shuah@kernel.org>
  L:    linux-kselftest@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
 +Q:    https://patchwork.kernel.org/project/linux-kselftest/list/
  S:    Maintained
  F:    tools/testing/selftests/
  F:    Documentation/dev-tools/kselftest*
@@@ -8272,7 -8212,7 +8279,7 @@@ F:      drivers/misc/lkdtm/
  
  LINUX KERNEL MEMORY CONSISTENCY MODEL (LKMM)
  M:    Alan Stern <stern@rowland.harvard.edu>
 -M:    Andrea Parri <parri.andrea@gmail.com>
 +M:    Andrea Parri <andrea.parri@amarulasolutions.com>
  M:    Will Deacon <will.deacon@arm.com>
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Boqun Feng <boqun.feng@gmail.com>
@@@ -8379,7 -8319,6 +8386,7 @@@ F:      Documentation/admin-guide/LSM/LoadPi
  LOCKING PRIMITIVES
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Ingo Molnar <mingo@redhat.com>
 +M:    Will Deacon <will.deacon@arm.com>
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
  S:    Maintained
@@@ -8536,7 -8475,6 +8543,7 @@@ M:      Vivien Didelot <vivien.didelot@savoi
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/dsa/mv88e6xxx/
 +F:    linux/platform_data/mv88e6xxx.h
  F:    Documentation/devicetree/bindings/net/dsa/marvell.txt
  
  MARVELL ARMADA DRM SUPPORT
@@@ -8894,6 -8832,7 +8901,7 @@@ L:      linux-media@vger.kernel.or
  L:    linux-renesas-soc@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
  S:    Supported
+ F:    Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
  F:    Documentation/devicetree/bindings/media/rcar_vin.txt
  F:    drivers/media/platform/rcar-vin/
  
@@@ -9090,18 -9029,18 +9098,18 @@@ W:   http://www.mellanox.co
  Q:    http://patchwork.ozlabs.org/project/netdev/list/
  F:    drivers/net/ethernet/mellanox/mlx5/core/en_*
  
 -MELLANOX ETHERNET INNOVA DRIVER
 -M:    Ilan Tayari <ilant@mellanox.com>
 +MELLANOX ETHERNET INNOVA DRIVERS
  R:    Boris Pismenny <borisp@mellanox.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  W:    http://www.mellanox.com
  Q:    http://patchwork.ozlabs.org/project/netdev/list/
 +F:    drivers/net/ethernet/mellanox/mlx5/core/en_accel/*
 +F:    drivers/net/ethernet/mellanox/mlx5/core/accel/*
  F:    drivers/net/ethernet/mellanox/mlx5/core/fpga/*
  F:    include/linux/mlx5/mlx5_ifc_fpga.h
  
  MELLANOX ETHERNET INNOVA IPSEC DRIVER
 -M:    Ilan Tayari <ilant@mellanox.com>
  R:    Boris Pismenny <borisp@mellanox.com>
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -9157,6 -9096,7 +9165,6 @@@ F:      include/uapi/rdma/mlx4-abi.
  
  MELLANOX MLX5 core VPI driver
  M:    Saeed Mahameed <saeedm@mellanox.com>
 -M:    Matan Barak <matanb@mellanox.com>
  M:    Leon Romanovsky <leonro@mellanox.com>
  L:    netdev@vger.kernel.org
  L:    linux-rdma@vger.kernel.org
@@@ -9167,6 -9107,7 +9175,6 @@@ F:      drivers/net/ethernet/mellanox/mlx5/c
  F:    include/linux/mlx5/
  
  MELLANOX MLX5 IB driver
 -M:    Matan Barak <matanb@mellanox.com>
  M:    Leon Romanovsky <leonro@mellanox.com>
  L:    linux-rdma@vger.kernel.org
  W:    http://www.mellanox.com
@@@ -9357,12 -9298,6 +9365,12 @@@ F:    include/linux/cciss*.
  F:    include/uapi/linux/cciss*.h
  F:    Documentation/scsi/smartpqi.txt
  
 +MICROSEMI ETHERNET SWITCH DRIVER
 +M:    Alexandre Belloni <alexandre.belloni@bootlin.com>
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +F:    drivers/net/ethernet/mscc/
 +
  MICROSOFT SURFACE PRO 3 BUTTON DRIVER
  M:    Chen Yu <yu.c.chen@intel.com>
  L:    platform-driver-x86@vger.kernel.org
@@@ -9712,14 -9647,6 +9720,14 @@@ S:    Maintaine
  F:    Documentation/hwmon/nct6775
  F:    drivers/hwmon/nct6775.c
  
 +NET_FAILOVER MODULE
 +M:    Sridhar Samudrala <sridhar.samudrala@intel.com>
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +F:    driver/net/net_failover.c
 +F:    include/net/net_failover.h
 +F:    Documentation/networking/net_failover.rst
 +
  NETEFFECT IWARP RNIC DRIVER (IW_NES)
  M:    Faisal Latif <faisal.latif@intel.com>
  L:    linux-rdma@vger.kernel.org
@@@ -9781,7 -9708,7 +9789,7 @@@ S:      Maintaine
  F:    drivers/net/ethernet/netronome/
  
  NETWORK BLOCK DEVICE (NBD)
 -M:    Josef Bacik <jbacik@fb.com>
 +M:    Josef Bacik <josef@toxicpanda.com>
  S:    Maintained
  L:    linux-block@vger.kernel.org
  L:    nbd@other.debian.org
@@@ -9913,21 -9840,8 +9921,21 @@@ F:    net/ipv6/calipso.
  F:    net/netfilter/xt_CONNSECMARK.c
  F:    net/netfilter/xt_SECMARK.c
  
 +NETWORKING [TCP]
 +M:    Eric Dumazet <edumazet@google.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    net/ipv4/tcp*.c
 +F:    net/ipv4/syncookies.c
 +F:    net/ipv6/tcp*.c
 +F:    net/ipv6/syncookies.c
 +F:    include/uapi/linux/tcp.h
 +F:    include/net/tcp.h
 +F:    include/linux/tcp.h
 +F:    include/trace/events/tcp.h
 +
  NETWORKING [TLS]
 -M:    Ilya Lesokhin <ilyal@mellanox.com>
 +M:    Boris Pismenny <borisp@mellanox.com>
  M:    Aviad Yehezkel <aviadye@mellanox.com>
  M:    Dave Watson <davejwatson@fb.com>
  L:    netdev@vger.kernel.org
@@@ -9967,7 -9881,7 +9975,7 @@@ F:      include/linux/platform_data/nxp-nci.
  F:    Documentation/devicetree/bindings/net/nfc/
  
  NFS, SUNRPC, AND LOCKD CLIENTS
 -M:    Trond Myklebust <trond.myklebust@primarydata.com>
 +M:    Trond Myklebust <trond.myklebust@hammerspace.com>
  M:    Anna Schumaker <anna.schumaker@netapp.com>
  L:    linux-nfs@vger.kernel.org
  W:    http://client.linux-nfs.org
@@@ -10450,6 -10364,7 +10458,7 @@@ T:   git git://linuxtv.org/media_tree.gi
  S:    Odd fixes
  F:    drivers/media/i2c/ov772x.c
  F:    include/media/i2c/ov772x.h
+ F:    Documentation/devicetree/bindings/media/i2c/ov772x.txt
  
  OMNIVISION OV7740 SENSOR DRIVER
  M:    Wenyou Yang <wenyou.yang@microchip.com>
@@@ -11347,7 -11262,6 +11356,7 @@@ M:   Sebastian Reichel <sre@kernel.org
  L:    linux-pm@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
  S:    Maintained
 +F:    Documentation/ABI/testing/sysfs-class-power
  F:    Documentation/devicetree/bindings/power/supply/
  F:    include/linux/power_supply.h
  F:    drivers/power/supply/
@@@ -11493,6 -11407,7 +11502,6 @@@ S:   Maintaine
  W:    http://linuxptp.sourceforge.net/
  F:    Documentation/ABI/testing/sysfs-ptp
  F:    Documentation/ptp/*
 -F:    drivers/net/ethernet/freescale/gianfar_ptp.c
  F:    drivers/net/phy/dp83640*
  F:    drivers/ptp/*
  F:    include/linux/ptp_cl*
@@@ -11727,7 -11642,7 +11736,7 @@@ S:   Maintaine
  F:    drivers/media/tuners/qt1010*
  
  QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
 -M:    Kalle Valo <kvalo@qca.qualcomm.com>
 +M:    Kalle Valo <kvalo@codeaurora.org>
  L:    ath10k@lists.infradead.org
  W:    http://wireless.kernel.org/en/users/Drivers/ath10k
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
@@@ -11749,13 -11664,6 +11758,13 @@@ F: Documentation/devicetree/bindings/me
  F:    Documentation/media/v4l-drivers/qcom_camss.rst
  F:    drivers/media/platform/qcom/camss-8x16/
  
 +QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096
 +M:  Ilia Lin <ilia.lin@gmail.com>
 +L:  linux-pm@vger.kernel.org
 +S:  Maintained
 +F:  Documentation/devicetree/bindings/opp/kryo-cpufreq.txt
 +F:  drivers/cpufreq/qcom-cpufreq-kryo.c
 +
  QUALCOMM EMAC GIGABIT ETHERNET DRIVER
  M:    Timur Tabi <timur@codeaurora.org>
  L:    netdev@vger.kernel.org
@@@ -11785,7 -11693,7 +11794,7 @@@ S:   Maintaine
  F:    drivers/media/platform/qcom/venus/
  
  QUALCOMM WCN36XX WIRELESS DRIVER
 -M:    Eugene Krasnikov <k.eugene.e@gmail.com>
 +M:    Kalle Valo <kvalo@codeaurora.org>
  L:    wcn36xx@lists.infradead.org
  W:    http://wireless.kernel.org/en/users/Drivers/wcn36xx
  T:    git git://github.com/KrasnikovEugene/wcn36xx.git
@@@ -11980,7 -11888,7 +11989,7 @@@ F:   include/linux/rtc.
  F:    include/uapi/linux/rtc.h
  F:    include/linux/rtc/
  F:    include/linux/platform_data/rtc-*
 -F:    tools/testing/selftests/timers/rtctest.c
 +F:    tools/testing/selftests/rtc/
  
  REALTEK AUDIO CODECS
  M:    Bard Liao <bardliao@realtek.com>
@@@ -12323,7 -12231,7 +12332,7 @@@ F:   Documentation/s390/vfio-ccw.tx
  F:    include/uapi/linux/vfio_ccw.h
  
  S390 ZCRYPT DRIVER
 -M:    Harald Freudenberger <freude@de.ibm.com>
 +M:    Harald Freudenberger <freude@linux.ibm.com>
  L:    linux-s390@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
  S:    Supported
@@@ -13163,6 -13071,13 +13172,13 @@@ S: Maintaine
  F:    drivers/ssb/
  F:    include/linux/ssb/
  
+ SONY IMX258 SENSOR DRIVER
+ M:    Sakari Ailus <sakari.ailus@linux.intel.com>
+ L:    linux-media@vger.kernel.org
+ T:    git git://linuxtv.org/media_tree.git
+ S:    Maintained
+ F:    drivers/media/i2c/imx258.c
  SONY IMX274 SENSOR DRIVER
  M:    Leon Luo <leonl@leopardimaging.com>
  L:    linux-media@vger.kernel.org
@@@ -13207,7 -13122,7 +13223,7 @@@ F:   include/uapi/sound
  F:    sound/
  
  SOUND - COMPRESSED AUDIO
 -M:    Vinod Koul <vinod.koul@intel.com>
 +M:    Vinod Koul <vkoul@kernel.org>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
  S:    Supported
@@@ -13367,25 -13282,12 +13383,18 @@@ M:        Jan-Benedict Glaw <jbglaw@lug-owl.de
  S:    Maintained
  F:    arch/alpha/kernel/srm_env.c
  
 +ST STM32 I2C/SMBUS DRIVER
 +M:    Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
 +L:    linux-i2c@vger.kernel.org
 +S:    Maintained
 +F:    drivers/i2c/busses/i2c-stm32*
 +
  STABLE BRANCH
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  L:    stable@vger.kernel.org
  S:    Supported
  F:    Documentation/process/stable-kernel-rules.rst
  
- STAGING - ATOMISP DRIVER
- M:    Alan Cox <alan@linux.intel.com>
- M:    Sakari Ailus <sakari.ailus@linux.intel.com>
- L:    linux-media@vger.kernel.org
- S:    Maintained
- F:    drivers/staging/media/atomisp/
  STAGING - COMEDI
  M:    Ian Abbott <abbotti@mev.co.uk>
  M:    H Hartley Sweeten <hsweeten@visionengravers.com>
@@@ -13503,7 -13405,6 +13512,7 @@@ F:   drivers/media/usb/stk1160
  STMMAC ETHERNET DRIVER
  M:    Giuseppe Cavallaro <peppe.cavallaro@st.com>
  M:    Alexandre Torgue <alexandre.torgue@st.com>
 +M:    Jose Abreu <joabreu@synopsys.com>
  L:    netdev@vger.kernel.org
  W:    http://www.stlinux.com
  S:    Supported
@@@ -14474,15 -14375,6 +14483,15 @@@ S: Maintaine
  F:    drivers/tc/
  F:    include/linux/tc.h
  
 +TURBOSTAT UTILITY
 +M:    "Len Brown" <lenb@kernel.org>
 +L:    linux-pm@vger.kernel.org
 +B:    https://bugzilla.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-pm/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git turbostat
 +S:    Supported
 +F:    tools/power/x86/turbostat/
 +
  TW5864 VIDEO4LINUX DRIVER
  M:    Bluecherry Maintainers <maintainers@bluecherrydvr.com>
  M:    Anton Sviridenko <anton@corp.bluecherry.net>
@@@ -14729,9 -14621,7 +14738,9 @@@ M:   Woojung Huh <woojung.huh@microchip.c
  M:    Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/net/microchip,lan78xx.txt
  F:    drivers/net/usb/lan78xx.*
 +F:    include/dt-bindings/net/microchip-lan78xx.h
  
  USB MASS STORAGE DRIVER
  M:    Alan Stern <stern@rowland.harvard.edu>
@@@ -14769,13 -14659,13 +14778,13 @@@ F:        drivers/usb/common/usb-otg-fsm.
  
  USB OVER IP DRIVER
  M:    Valentina Manea <valentina.manea.m@gmail.com>
 -M:    Shuah Khan <shuahkh@osg.samsung.com>
  M:    Shuah Khan <shuah@kernel.org>
  L:    linux-usb@vger.kernel.org
  S:    Maintained
  F:    Documentation/usb/usbip_protocol.txt
  F:    drivers/usb/usbip/
  F:    tools/usb/usbip/
 +F:    tools/testing/selftests/drivers/usb/usbip/
  
  USB PEGASUS DRIVER
  M:    Petko Manolov <petkan@nucleusys.com>
@@@ -15048,6 -14938,12 +15057,12 @@@ L: linux-media@vger.kernel.or
  S:    Maintained
  F:    drivers/media/platform/video-mux.c
  
+ VIDEO I2C POLLING DRIVER
+ M:    Matt Ranostay <matt.ranostay@konsulko.com>
+ L:    linux-media@vger.kernel.org
+ S:    Maintained
+ F:    drivers/media/i2c/video-i2c.c
  VIDEOBUF2 FRAMEWORK
  M:    Pawel Osciak <pawel@osciak.com>
  M:    Marek Szyprowski <m.szyprowski@samsung.com>
@@@ -15520,14 -15416,6 +15535,14 @@@ T: git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/tuners/tuner-xc2028.*
  
 +XDP SOCKETS (AF_XDP)
 +M:    Björn Töpel <bjorn.topel@intel.com>
 +M:    Magnus Karlsson <magnus.karlsson@intel.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    kernel/bpf/xskmap.c
 +F:    net/xdp/
 +
  XEN BLOCK SUBSYSTEM
  M:    Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  M:    Roger Pau Monné <roger.pau@citrix.com>
@@@ -15598,13 -15486,6 +15613,13 @@@ S: Supporte
  F:    arch/x86/xen/*swiotlb*
  F:    drivers/xen/*swiotlb*
  
 +XEN SOUND FRONTEND DRIVER
 +M:    Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
 +L:    xen-devel@lists.xenproject.org (moderated for non-subscribers)
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Supported
 +F:    sound/xen/*
 +
  XFS FILESYSTEM
  M:    Darrick J. Wong <darrick.wong@oracle.com>
  M:    linux-xfs@vger.kernel.org
@@@ -15643,14 -15524,6 +15658,14 @@@ L: linux-kernel@vger.kernel.or
  S:    Supported
  F:    drivers/char/xillybus/
  
 +XLP9XX I2C DRIVER
 +M:    George Cherian <george.cherian@cavium.com>
 +M:    Jan Glauber <jglauber@cavium.com>
 +L:    linux-i2c@vger.kernel.org
 +W:    http://www.cavium.com
 +S:    Supported
 +F:    drivers/i2c/busses/i2c-xlp9xx.c
 +
  XRA1403 GPIO EXPANDER
  M:    Nandor Han <nandor.han@ge.com>
  M:    Semi Malinen <semi.malinen@ge.com>
@@@ -15745,7 -15618,7 +15760,7 @@@ L:   linux-media@vger.kernel.or
  W:    http://mjpeg.sourceforge.net/driver-zoran/
  T:    hg https://linuxtv.org/hg/v4l-dvb
  S:    Odd Fixes
- F:    drivers/media/pci/zoran/
+ F:    drivers/staging/media/zoran/
  
  ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
  M:    Minchan Kim <minchan@kernel.org>
@@@ -15769,7 -15642,7 +15784,7 @@@ L:   linux-mm@kvack.or
  S:    Maintained
  F:    mm/zsmalloc.c
  F:    include/linux/zsmalloc.h
 -F:    Documentation/vm/zsmalloc.txt
 +F:    Documentation/vm/zsmalloc.rst
  
  ZSWAP COMPRESSED SWAP CACHING
  M:    Seth Jennings <sjenning@redhat.com>
@@@ -691,6 -691,52 +691,52 @@@ static const struct drm_crtc_helper_fun
        .atomic_disable = rcar_du_crtc_atomic_disable,
  };
  
+ static struct drm_crtc_state *
+ rcar_du_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
+ {
+       struct rcar_du_crtc_state *state;
+       struct rcar_du_crtc_state *copy;
+       if (WARN_ON(!crtc->state))
+               return NULL;
+       state = to_rcar_crtc_state(crtc->state);
+       copy = kmemdup(state, sizeof(*state), GFP_KERNEL);
+       if (copy == NULL)
+               return NULL;
+       __drm_atomic_helper_crtc_duplicate_state(crtc, &copy->state);
+       return &copy->state;
+ }
+ static void rcar_du_crtc_atomic_destroy_state(struct drm_crtc *crtc,
+                                             struct drm_crtc_state *state)
+ {
+       __drm_atomic_helper_crtc_destroy_state(state);
+       kfree(to_rcar_crtc_state(state));
+ }
+ static void rcar_du_crtc_reset(struct drm_crtc *crtc)
+ {
+       struct rcar_du_crtc_state *state;
+       if (crtc->state) {
+               rcar_du_crtc_atomic_destroy_state(crtc, crtc->state);
+               crtc->state = NULL;
+       }
+       state = kzalloc(sizeof(*state), GFP_KERNEL);
+       if (state == NULL)
+               return;
+       state->crc.source = VSP1_DU_CRC_NONE;
+       state->crc.index = 0;
+       crtc->state = &state->state;
+       crtc->state->crtc = crtc;
+ }
  static int rcar_du_crtc_enable_vblank(struct drm_crtc *crtc)
  {
        struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
@@@ -710,15 -756,111 +756,111 @@@ static void rcar_du_crtc_disable_vblank
        rcrtc->vblank_enable = false;
  }
  
- static const struct drm_crtc_funcs crtc_funcs = {
-       .reset = drm_atomic_helper_crtc_reset,
+ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,
+                                      const char *source_name,
+                                      size_t *values_cnt)
+ {
+       struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+       struct drm_modeset_acquire_ctx ctx;
+       struct drm_crtc_state *crtc_state;
+       struct drm_atomic_state *state;
+       enum vsp1_du_crc_source source;
+       unsigned int index = 0;
+       unsigned int i;
+       int ret;
+       /*
+        * Parse the source name. Supported values are "plane%u" to compute the
+        * CRC on an input plane (%u is the plane ID), and "auto" to compute the
+        * CRC on the composer (VSP) output.
+        */
+       if (!source_name) {
+               source = VSP1_DU_CRC_NONE;
+       } else if (!strcmp(source_name, "auto")) {
+               source = VSP1_DU_CRC_OUTPUT;
+       } else if (strstarts(source_name, "plane")) {
+               source = VSP1_DU_CRC_PLANE;
+               ret = kstrtouint(source_name + strlen("plane"), 10, &index);
+               if (ret < 0)
+                       return ret;
+               for (i = 0; i < rcrtc->vsp->num_planes; ++i) {
+                       if (index == rcrtc->vsp->planes[i].plane.base.id) {
+                               index = i;
+                               break;
+                       }
+               }
+               if (i >= rcrtc->vsp->num_planes)
+                       return -EINVAL;
+       } else {
+               return -EINVAL;
+       }
+       *values_cnt = 1;
+       /* Perform an atomic commit to set the CRC source. */
+       drm_modeset_acquire_init(&ctx, 0);
+       state = drm_atomic_state_alloc(crtc->dev);
+       if (!state) {
+               ret = -ENOMEM;
+               goto unlock;
+       }
+       state->acquire_ctx = &ctx;
+ retry:
+       crtc_state = drm_atomic_get_crtc_state(state, crtc);
+       if (!IS_ERR(crtc_state)) {
+               struct rcar_du_crtc_state *rcrtc_state;
+               rcrtc_state = to_rcar_crtc_state(crtc_state);
+               rcrtc_state->crc.source = source;
+               rcrtc_state->crc.index = index;
+               ret = drm_atomic_commit(state);
+       } else {
+               ret = PTR_ERR(crtc_state);
+       }
+       if (ret == -EDEADLK) {
+               drm_atomic_state_clear(state);
+               drm_modeset_backoff(&ctx);
+               goto retry;
+       }
+       drm_atomic_state_put(state);
+ unlock:
+       drm_modeset_drop_locks(&ctx);
+       drm_modeset_acquire_fini(&ctx);
+       return 0;
+ }
+ static const struct drm_crtc_funcs crtc_funcs_gen2 = {
+       .reset = rcar_du_crtc_reset,
+       .destroy = drm_crtc_cleanup,
+       .set_config = drm_atomic_helper_set_config,
+       .page_flip = drm_atomic_helper_page_flip,
+       .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,
+       .atomic_destroy_state = rcar_du_crtc_atomic_destroy_state,
+       .enable_vblank = rcar_du_crtc_enable_vblank,
+       .disable_vblank = rcar_du_crtc_disable_vblank,
+ };
+ static const struct drm_crtc_funcs crtc_funcs_gen3 = {
+       .reset = rcar_du_crtc_reset,
        .destroy = drm_crtc_cleanup,
        .set_config = drm_atomic_helper_set_config,
        .page_flip = drm_atomic_helper_page_flip,
-       .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
-       .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+       .atomic_duplicate_state = rcar_du_crtc_atomic_duplicate_state,
+       .atomic_destroy_state = rcar_du_crtc_atomic_destroy_state,
        .enable_vblank = rcar_du_crtc_enable_vblank,
        .disable_vblank = rcar_du_crtc_disable_vblank,
+       .set_crc_source = rcar_du_crtc_set_crc_source,
  };
  
  /* -----------------------------------------------------------------------------
@@@ -767,8 -909,7 +909,8 @@@ static irqreturn_t rcar_du_crtc_irq(in
   * Initialization
   */
  
 -int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
 +int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,
 +                      unsigned int hwindex)
  {
        static const unsigned int mmio_offsets[] = {
                DU0_REG_OFFSET, DU1_REG_OFFSET, DU2_REG_OFFSET, DU3_REG_OFFSET
  
        struct rcar_du_device *rcdu = rgrp->dev;
        struct platform_device *pdev = to_platform_device(rcdu->dev);
 -      struct rcar_du_crtc *rcrtc = &rcdu->crtcs[index];
 +      struct rcar_du_crtc *rcrtc = &rcdu->crtcs[swindex];
        struct drm_crtc *crtc = &rcrtc->crtc;
        struct drm_plane *primary;
        unsigned int irqflags;
  
        /* Get the CRTC clock and the optional external clock. */
        if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CRTC_IRQ_CLOCK)) {
 -              sprintf(clk_name, "du.%u", index);
 +              sprintf(clk_name, "du.%u", hwindex);
                name = clk_name;
        } else {
                name = NULL;
  
        rcrtc->clock = devm_clk_get(rcdu->dev, name);
        if (IS_ERR(rcrtc->clock)) {
 -              dev_err(rcdu->dev, "no clock for CRTC %u\n", index);
 +              dev_err(rcdu->dev, "no clock for DU channel %u\n", hwindex);
                return PTR_ERR(rcrtc->clock);
        }
  
 -      sprintf(clk_name, "dclkin.%u", index);
 +      sprintf(clk_name, "dclkin.%u", hwindex);
        clk = devm_clk_get(rcdu->dev, clk_name);
        if (!IS_ERR(clk)) {
                rcrtc->extclock = clk;
        } else if (PTR_ERR(rcrtc->clock) == -EPROBE_DEFER) {
 -              dev_info(rcdu->dev, "can't get external clock %u\n", index);
 +              dev_info(rcdu->dev, "can't get external clock %u\n", hwindex);
                return -EPROBE_DEFER;
        }
  
        spin_lock_init(&rcrtc->vblank_lock);
  
        rcrtc->group = rgrp;
 -      rcrtc->mmio_offset = mmio_offsets[index];
 -      rcrtc->index = index;
 +      rcrtc->mmio_offset = mmio_offsets[hwindex];
 +      rcrtc->index = hwindex;
  
        if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE))
                primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe].plane;
        else
 -              primary = &rgrp->planes[index % 2].plane;
 +              primary = &rgrp->planes[swindex % 2].plane;
  
-       ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, primary,
-                                       NULL, &crtc_funcs, NULL);
+       ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, primary, NULL,
+                                       rcdu->info->gen <= 2 ?
+                                       &crtc_funcs_gen2 : &crtc_funcs_gen3,
+                                       NULL);
        if (ret < 0)
                return ret;
  
  
        /* Register the interrupt handler. */
        if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CRTC_IRQ_CLOCK)) {
 -              irq = platform_get_irq(pdev, index);
 +              /* The IRQ's are associated with the CRTC (sw)index. */
 +              irq = platform_get_irq(pdev, swindex);
                irqflags = 0;
        } else {
                irq = platform_get_irq(pdev, 0);
        }
  
        if (irq < 0) {
 -              dev_err(rcdu->dev, "no IRQ for CRTC %u\n", index);
 +              dev_err(rcdu->dev, "no IRQ for CRTC %u\n", swindex);
                return irq;
        }
  
                               dev_name(rcdu->dev), rcrtc);
        if (ret < 0) {
                dev_err(rcdu->dev,
 -                      "failed to register IRQ for CRTC %u\n", index);
 +                      "failed to register IRQ for CRTC %u\n", swindex);
                return ret;
        }
  
@@@ -21,6 -21,8 +21,8 @@@
  #include <drm/drmP.h>
  #include <drm/drm_crtc.h>
  
+ #include <media/vsp1.h>
  struct rcar_du_group;
  struct rcar_du_vsp;
  
@@@ -69,6 -71,19 +71,19 @@@ struct rcar_du_crtc 
  
  #define to_rcar_crtc(c)       container_of(c, struct rcar_du_crtc, crtc)
  
+ /**
+  * struct rcar_du_crtc_state - Driver-specific CRTC state
+  * @state: base DRM CRTC state
+  * @crc: CRC computation configuration
+  */
+ struct rcar_du_crtc_state {
+       struct drm_crtc_state state;
+       struct vsp1_du_crc_config crc;
+ };
+ #define to_rcar_crtc_state(s) container_of(s, struct rcar_du_crtc_state, state)
  enum rcar_du_output {
        RCAR_DU_OUTPUT_DPAD0,
        RCAR_DU_OUTPUT_DPAD1,
@@@ -80,8 -95,7 +95,8 @@@
        RCAR_DU_OUTPUT_MAX,
  };
  
 -int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index);
 +int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,
 +                      unsigned int hwindex);
  void rcar_du_crtc_suspend(struct rcar_du_crtc *rcrtc);
  void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc);
  
@@@ -17,7 -17,6 +17,7 @@@
  #include <drm/drm_crtc_helper.h>
  #include <drm/drm_fb_cma_helper.h>
  #include <drm/drm_gem_cma_helper.h>
 +#include <drm/drm_gem_framebuffer_helper.h>
  #include <drm/drm_plane_helper.h>
  
  #include <linux/bitops.h>
@@@ -32,7 -31,7 +32,7 @@@
  #include "rcar_du_kms.h"
  #include "rcar_du_vsp.h"
  
- static void rcar_du_vsp_complete(void *private, bool completed)
+ static void rcar_du_vsp_complete(void *private, bool completed, u32 crc)
  {
        struct rcar_du_crtc *crtc = private;
  
@@@ -41,6 -40,8 +41,8 @@@
  
        if (completed)
                rcar_du_crtc_finish_page_flip(crtc);
+       drm_crtc_add_crc_entry(&crtc->crtc, false, 0, &crc);
  }
  
  void rcar_du_vsp_enable(struct rcar_du_crtc *crtc)
@@@ -55,7 -56,6 +57,7 @@@
        };
        struct rcar_du_plane_state state = {
                .state = {
 +                      .alpha = DRM_BLEND_ALPHA_OPAQUE,
                        .crtc = &crtc->crtc,
                        .dst.x1 = 0,
                        .dst.y1 = 0,
@@@ -69,6 -69,7 +71,6 @@@
                },
                .format = rcar_du_format_info(DRM_FORMAT_ARGB8888),
                .source = RCAR_DU_PLANE_VSPD1,
 -              .alpha = 255,
                .colorkey = 0,
        };
  
@@@ -103,7 -104,13 +105,13 @@@ void rcar_du_vsp_atomic_begin(struct rc
  
  void rcar_du_vsp_atomic_flush(struct rcar_du_crtc *crtc)
  {
-       vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe);
+       struct vsp1_du_atomic_pipe_config cfg = { { 0, } };
+       struct rcar_du_crtc_state *state;
+       state = to_rcar_crtc_state(crtc->crtc.state);
+       cfg.crc = state->crc;
+       vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg);
  }
  
  /* Keep the two tables in sync. */
@@@ -174,7 -181,7 +182,7 @@@ static void rcar_du_vsp_plane_setup(str
        struct vsp1_du_atomic_config cfg = {
                .pixelformat = 0,
                .pitch = fb->pitches[0],
 -              .alpha = state->alpha,
 +              .alpha = state->state.alpha >> 8,
                .zpos = state->state.zpos,
        };
        unsigned int i;
@@@ -238,10 -245,6 +246,10 @@@ static int rcar_du_vsp_plane_prepare_fb
                }
        }
  
 +      ret = drm_gem_fb_prepare_fb(plane, state);
 +      if (ret)
 +              goto fail;
 +
        return 0;
  
  fail:
@@@ -304,12 -307,14 +312,12 @@@ static const struct drm_plane_helper_fu
  static struct drm_plane_state *
  rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane)
  {
 -      struct rcar_du_vsp_plane_state *state;
        struct rcar_du_vsp_plane_state *copy;
  
        if (WARN_ON(!plane->state))
                return NULL;
  
 -      state = to_rcar_vsp_plane_state(plane->state);
 -      copy = kmemdup(state, sizeof(*state), GFP_KERNEL);
 +      copy = kzalloc(sizeof(*copy), GFP_KERNEL);
        if (copy == NULL)
                return NULL;
  
@@@ -338,13 -343,44 +346,13 @@@ static void rcar_du_vsp_plane_reset(str
        if (state == NULL)
                return;
  
 -      state->alpha = 255;
 +      state->state.alpha = DRM_BLEND_ALPHA_OPAQUE;
        state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1;
  
        plane->state = &state->state;
        plane->state->plane = plane;
  }
  
 -static int rcar_du_vsp_plane_atomic_set_property(struct drm_plane *plane,
 -      struct drm_plane_state *state, struct drm_property *property,
 -      uint64_t val)
 -{
 -      struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(state);
 -      struct rcar_du_device *rcdu = to_rcar_vsp_plane(plane)->vsp->dev;
 -
 -      if (property == rcdu->props.alpha)
 -              rstate->alpha = val;
 -      else
 -              return -EINVAL;
 -
 -      return 0;
 -}
 -
 -static int rcar_du_vsp_plane_atomic_get_property(struct drm_plane *plane,
 -      const struct drm_plane_state *state, struct drm_property *property,
 -      uint64_t *val)
 -{
 -      const struct rcar_du_vsp_plane_state *rstate =
 -              container_of(state, const struct rcar_du_vsp_plane_state, state);
 -      struct rcar_du_device *rcdu = to_rcar_vsp_plane(plane)->vsp->dev;
 -
 -      if (property == rcdu->props.alpha)
 -              *val = rstate->alpha;
 -      else
 -              return -EINVAL;
 -
 -      return 0;
 -}
 -
  static const struct drm_plane_funcs rcar_du_vsp_plane_funcs = {
        .update_plane = drm_atomic_helper_update_plane,
        .disable_plane = drm_atomic_helper_disable_plane,
        .destroy = drm_plane_cleanup,
        .atomic_duplicate_state = rcar_du_vsp_plane_atomic_duplicate_state,
        .atomic_destroy_state = rcar_du_vsp_plane_atomic_destroy_state,
 -      .atomic_set_property = rcar_du_vsp_plane_atomic_set_property,
 -      .atomic_get_property = rcar_du_vsp_plane_atomic_get_property,
  };
  
  int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
                if (type == DRM_PLANE_TYPE_PRIMARY)
                        continue;
  
 -              drm_object_attach_property(&plane->plane.base,
 -                                         rcdu->props.alpha, 255);
 +              drm_plane_create_alpha_property(&plane->plane);
                drm_plane_create_zpos_property(&plane->plane, 1, 1,
                                               vsp->num_planes - 1);
        }
@@@ -2444,7 -2444,7 +2444,7 @@@ static int tda1997x_pcm_startup(struct 
                                struct snd_soc_dai *dai)
  {
        struct tda1997x_state *state = snd_soc_dai_get_drvdata(dai);
 -      struct snd_soc_codec *codec = dai->codec;
 +      struct snd_soc_component *component = dai->component;
        struct snd_pcm_runtime *rtd = substream->runtime;
        int rate, err;
  
        err = snd_pcm_hw_constraint_minmax(rtd, SNDRV_PCM_HW_PARAM_RATE,
                                           rate, rate);
        if (err < 0) {
 -              dev_err(codec->dev, "failed to constrain samplerate to %dHz\n",
 +              dev_err(component->dev, "failed to constrain samplerate to %dHz\n",
                        rate);
                return err;
        }
 -      dev_info(codec->dev, "set samplerate constraint to %dHz\n", rate);
 +      dev_info(component->dev, "set samplerate constraint to %dHz\n", rate);
  
        return 0;
  }
@@@ -2479,22 -2479,20 +2479,22 @@@ static struct snd_soc_dai_driver tda199
        .ops = &tda1997x_dai_ops,
  };
  
 -static int tda1997x_codec_probe(struct snd_soc_codec *codec)
 +static int tda1997x_codec_probe(struct snd_soc_component *component)
  {
        return 0;
  }
  
 -static int tda1997x_codec_remove(struct snd_soc_codec *codec)
 +static void tda1997x_codec_remove(struct snd_soc_component *component)
  {
 -      return 0;
  }
  
 -static struct snd_soc_codec_driver tda1997x_codec_driver = {
 -      .probe = tda1997x_codec_probe,
 -      .remove = tda1997x_codec_remove,
 -      .reg_word_size = sizeof(u16),
 +static struct snd_soc_component_driver tda1997x_codec_driver = {
 +      .probe                  = tda1997x_codec_probe,
 +      .remove                 = tda1997x_codec_remove,
 +      .idle_bias_on           = 1,
 +      .use_pmdown_time        = 1,
 +      .endianness             = 1,
 +      .non_legacy_dai_naming  = 1,
  };
  
  static int tda1997x_probe(struct i2c_client *client,
        snprintf(sd->name, sizeof(sd->name), "%s %d-%04x",
                 id->name, i2c_adapter_id(client->adapter),
                 client->addr);
-       sd->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
+       sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
        sd->entity.function = MEDIA_ENT_F_DTV_DECODER;
        sd->entity.ops = &tda1997x_media_ops;
  
                state->pads);
        if (ret) {
                v4l_err(client, "failed entity_init: %d", ret);
-               goto err_free_mutex;
+               goto err_free_handler;
        }
  
        ret = v4l2_async_register_subdev(sd);
                else
                        formats = SNDRV_PCM_FMTBIT_S16_LE;
                tda1997x_audio_dai.capture.formats = formats;
 -              ret = snd_soc_register_codec(&state->client->dev,
 +              ret = devm_snd_soc_register_component(&state->client->dev,
                                             &tda1997x_codec_driver,
                                             &tda1997x_audio_dai, 1);
                if (ret) {
@@@ -2784,6 -2782,7 +2784,6 @@@ static int tda1997x_remove(struct i2c_c
        struct tda1997x_platform_data *pdata = &state->pdata;
  
        if (pdata->audout_format) {
 -              snd_soc_unregister_codec(&client->dev);
                mutex_destroy(&state->audio_lock);
        }
  
diff --combined drivers/media/rc/Kconfig
@@@ -25,19 -25,6 +25,19 @@@ config LIR
           passes raw IR to and from userspace, which is needed for
           IR transmitting (aka "blasting") and for the lirc daemon.
  
 +config BPF_LIRC_MODE2
 +      bool "Support for eBPF programs attached to lirc devices"
 +      depends on BPF_SYSCALL
 +      depends on RC_CORE=y
 +      depends on LIRC
 +      help
 +         Allow attaching eBPF programs to a lirc device using the bpf(2)
 +         syscall command BPF_PROG_ATTACH. This is supported for raw IR
 +         receivers.
 +
 +         These eBPF programs can be used to decode IR into scancodes, for
 +         IR protocols not supported by the kernel decoders.
 +
  menuconfig RC_DECODERS
        bool "Remote controller decoders"
        depends on RC_CORE
@@@ -162,7 -149,7 +162,7 @@@ config RC_ATI_REMOT
  
  config IR_ENE
        tristate "ENE eHome Receiver/Transceiver (pnp id: ENE0100/ENE02xxx)"
-       depends on PNP
+       depends on PNP || COMPILE_TEST
        depends on RC_CORE
        ---help---
           Say Y here to enable support for integrated infrared receiver
@@@ -223,7 -210,7 +223,7 @@@ config IR_MCEUS
  
  config IR_ITE_CIR
        tristate "ITE Tech Inc. IT8712/IT8512 Consumer Infrared Transceiver"
-       depends on PNP
+       depends on PNP || COMPILE_TEST
        depends on RC_CORE
        ---help---
           Say Y here to enable support for integrated infrared receivers
  
  config IR_FINTEK
        tristate "Fintek Consumer Infrared Transceiver"
-       depends on PNP
+       depends on PNP || COMPILE_TEST
        depends on RC_CORE
        ---help---
           Say Y here to enable support for integrated infrared receiver
@@@ -270,7 -257,7 +270,7 @@@ config IR_MT
  
  config IR_NUVOTON
        tristate "Nuvoton w836x7hg Consumer Infrared Transceiver"
-       depends on PNP
+       depends on PNP || COMPILE_TEST
        depends on RC_CORE
        ---help---
           Say Y here to enable support for integrated infrared receiver
@@@ -318,7 -305,7 +318,7 @@@ config IR_STREAMZA
  
  config IR_WINBOND_CIR
        tristate "Winbond IR remote control"
-       depends on X86 && PNP
+       depends on (X86 && PNP) || COMPILE_TEST
        depends on RC_CORE
        select NEW_LEDS
        select LEDS_CLASS
@@@ -20,7 -20,6 +20,7 @@@
  #include <linux/module.h>
  #include <linux/mutex.h>
  #include <linux/device.h>
 +#include <linux/file.h>
  #include <linux/idr.h>
  #include <linux/poll.h>
  #include <linux/sched.h>
@@@ -105,12 -104,6 +105,12 @@@ void ir_lirc_raw_event(struct rc_dev *d
                        TO_US(ev.duration), TO_STR(ev.pulse));
        }
  
 +      /*
 +       * bpf does not care about the gap generated above; that exists
 +       * for backwards compatibility
 +       */
 +      lirc_bpf_run(dev, sample);
 +
        spin_lock_irqsave(&dev->lirc_fh_lock, flags);
        list_for_each_entry(fh, &dev->lirc_fh, list) {
                if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports)
@@@ -582,10 -575,17 +582,17 @@@ static long ir_lirc_ioctl(struct file *
                }
                break;
  
-       case LIRC_SET_REC_TIMEOUT_REPORTS:
+       case LIRC_GET_REC_TIMEOUT:
                if (!dev->timeout)
                        ret = -ENOTTY;
                else
+                       val = DIV_ROUND_UP(dev->timeout, 1000);
+               break;
+       case LIRC_SET_REC_TIMEOUT_REPORTS:
+               if (dev->driver_type != RC_DRIVER_IR_RAW)
+                       ret = -ENOTTY;
+               else
                        fh->send_timeout_reports = !!val;
                break;
  
@@@ -742,6 -742,7 +749,7 @@@ static void lirc_release_device(struct 
  
  int ir_lirc_register(struct rc_dev *dev)
  {
+       const char *rx_type, *tx_type;
        int err, minor;
  
        minor = ida_simple_get(&lirc_ida, 0, RC_DEV_MAX, GFP_KERNEL);
  
        get_device(&dev->dev);
  
-       dev_info(&dev->dev, "lirc_dev: driver %s registered at minor = %d",
-                dev->driver_name, minor);
+       switch (dev->driver_type) {
+       case RC_DRIVER_SCANCODE:
+               rx_type = "scancode";
+               break;
+       case RC_DRIVER_IR_RAW:
+               rx_type = "raw IR";
+               break;
+       default:
+               rx_type = "no";
+               break;
+       }
+       if (dev->tx_ir)
+               tx_type = "raw IR";
+       else
+               tx_type = "no";
+       dev_info(&dev->dev, "lirc_dev: driver %s registered at minor = %d, %s receiver, %s transmitter",
+                dev->driver_name, minor, rx_type, tx_type);
  
        return 0;
  
@@@ -823,27 -841,4 +848,27 @@@ void __exit lirc_dev_exit(void
        unregister_chrdev_region(lirc_base_dev, RC_DEV_MAX);
  }
  
 +struct rc_dev *rc_dev_get_from_fd(int fd)
 +{
 +      struct fd f = fdget(fd);
 +      struct lirc_fh *fh;
 +      struct rc_dev *dev;
 +
 +      if (!f.file)
 +              return ERR_PTR(-EBADF);
 +
 +      if (f.file->f_op != &lirc_fops) {
 +              fdput(f);
 +              return ERR_PTR(-EINVAL);
 +      }
 +
 +      fh = f.file->private_data;
 +      dev = fh->rc;
 +
 +      get_device(&dev->dev);
 +      fdput(f);
 +
 +      return dev;
 +}
 +
  MODULE_ALIAS("lirc_dev");
@@@ -13,7 -13,6 +13,7 @@@
  #define       MAX_IR_EVENT_SIZE       512
  
  #include <linux/slab.h>
 +#include <uapi/linux/bpf.h>
  #include <media/rc-core.h>
  
  /**
@@@ -38,6 -37,7 +38,7 @@@ struct ir_raw_handler 
        int (*encode)(enum rc_proto protocol, u32 scancode,
                      struct ir_raw_event *events, unsigned int max);
        u32 carrier;
+       u32 min_timeout;
  
        /* These two should only be used by the mce kbd decoder */
        int (*raw_register)(struct rc_dev *dev);
@@@ -58,11 -58,6 +59,11 @@@ struct ir_raw_event_ctrl 
        /* raw decoder state follows */
        struct ir_raw_event prev_ev;
        struct ir_raw_event this_ev;
 +
 +#ifdef CONFIG_BPF_LIRC_MODE2
 +      u32                             bpf_sample;
 +      struct bpf_prog_array __rcu     *progs;
 +#endif
        struct nec_dec {
                int state;
                unsigned count;
        } sharp;
        struct mce_kbd_dec {
                struct input_dev *idev;
+               /* locks key up timer */
+               spinlock_t keylock;
                struct timer_list rx_timeout;
                char name[64];
                char phys[64];
                int count;
                int last_chk;
                unsigned int bits;
+               bool stick_keyboard;
+               struct input_dev *idev;
+               char name[64];
        } imon;
  };
  
 +/* Mutex for locking raw IR processing and handler change */
 +extern struct mutex ir_raw_handler_lock;
 +
  /* macros for IR decoders */
  static inline bool geq_margin(unsigned d1, unsigned d2, unsigned margin)
  {
@@@ -297,7 -294,6 +303,7 @@@ void ir_lirc_raw_event(struct rc_dev *d
  void ir_lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc);
  int ir_lirc_register(struct rc_dev *dev);
  void ir_lirc_unregister(struct rc_dev *dev);
 +struct rc_dev *rc_dev_get_from_fd(int fd);
  #else
  static inline int lirc_dev_init(void) { return 0; }
  static inline void lirc_dev_exit(void) {}
@@@ -309,15 -305,4 +315,15 @@@ static inline int ir_lirc_register(stru
  static inline void ir_lirc_unregister(struct rc_dev *dev) { }
  #endif
  
 +/*
 + * bpf interface
 + */
 +#ifdef CONFIG_BPF_LIRC_MODE2
 +void lirc_bpf_free(struct rc_dev *dev);
 +void lirc_bpf_run(struct rc_dev *dev, u32 sample);
 +#else
 +static inline void lirc_bpf_free(struct rc_dev *dev) { }
 +static inline void lirc_bpf_run(struct rc_dev *dev, u32 sample) { }
 +#endif
 +
  #endif /* _RC_CORE_PRIV */
@@@ -14,7 -14,7 +14,7 @@@
  static LIST_HEAD(ir_raw_client_list);
  
  /* Used to handle IR raw handler extensions */
 -static DEFINE_MUTEX(ir_raw_handler_lock);
 +DEFINE_MUTEX(ir_raw_handler_lock);
  static LIST_HEAD(ir_raw_handler_list);
  static atomic64_t available_protocols = ATOMIC64_INIT(0);
  
@@@ -22,16 -22,27 +22,27 @@@ static int ir_raw_event_thread(void *da
  {
        struct ir_raw_event ev;
        struct ir_raw_handler *handler;
-       struct ir_raw_event_ctrl *raw = (struct ir_raw_event_ctrl *)data;
+       struct ir_raw_event_ctrl *raw = data;
+       struct rc_dev *dev = raw->dev;
  
        while (1) {
                mutex_lock(&ir_raw_handler_lock);
                while (kfifo_out(&raw->kfifo, &ev, 1)) {
+                       if (is_timing_event(ev)) {
+                               if (ev.duration == 0)
+                                       dev_err(&dev->dev, "nonsensical timing event of duration 0");
+                               if (is_timing_event(raw->prev_ev) &&
+                                   !is_transition(&ev, &raw->prev_ev))
+                                       dev_err(&dev->dev, "two consecutive events of type %s",
+                                               TO_STR(ev.pulse));
+                               if (raw->prev_ev.reset && ev.pulse == 0)
+                                       dev_err(&dev->dev, "timing event after reset should be pulse");
+                       }
                        list_for_each_entry(handler, &ir_raw_handler_list, list)
-                               if (raw->dev->enabled_protocols &
+                               if (dev->enabled_protocols &
                                    handler->protocols || !handler->protocols)
-                                       handler->decode(raw->dev, ev);
-                       ir_lirc_raw_event(raw->dev, ev);
+                                       handler->decode(dev, ev);
+                       ir_lirc_raw_event(dev, ev);
                        raw->prev_ev = ev;
                }
                mutex_unlock(&ir_raw_handler_lock);
@@@ -233,7 -244,49 +244,49 @@@ ir_raw_get_allowed_protocols(void
  
  static int change_protocol(struct rc_dev *dev, u64 *rc_proto)
  {
-       /* the caller will update dev->enabled_protocols */
+       struct ir_raw_handler *handler;
+       u32 timeout = 0;
+       mutex_lock(&ir_raw_handler_lock);
+       list_for_each_entry(handler, &ir_raw_handler_list, list) {
+               if (!(dev->enabled_protocols & handler->protocols) &&
+                   (*rc_proto & handler->protocols) && handler->raw_register)
+                       handler->raw_register(dev);
+               if ((dev->enabled_protocols & handler->protocols) &&
+                   !(*rc_proto & handler->protocols) &&
+                   handler->raw_unregister)
+                       handler->raw_unregister(dev);
+       }
+       mutex_unlock(&ir_raw_handler_lock);
+       if (!dev->max_timeout)
+               return 0;
+       mutex_lock(&ir_raw_handler_lock);
+       list_for_each_entry(handler, &ir_raw_handler_list, list) {
+               if (handler->protocols & *rc_proto) {
+                       if (timeout < handler->min_timeout)
+                               timeout = handler->min_timeout;
+               }
+       }
+       mutex_unlock(&ir_raw_handler_lock);
+       if (timeout == 0)
+               timeout = IR_DEFAULT_TIMEOUT;
+       else
+               timeout += MS_TO_NS(10);
+       if (timeout < dev->min_timeout)
+               timeout = dev->min_timeout;
+       else if (timeout > dev->max_timeout)
+               timeout = dev->max_timeout;
+       if (dev->s_timeout)
+               dev->s_timeout(dev, timeout);
+       else
+               dev->timeout = timeout;
        return 0;
  }
  
@@@ -569,6 -622,7 +622,7 @@@ int ir_raw_event_prepare(struct rc_dev 
  
        dev->raw->dev = dev;
        dev->change_protocol = change_protocol;
+       dev->idle = true;
        spin_lock_init(&dev->raw->edge_spinlock);
        timer_setup(&dev->raw->edge_handle, ir_raw_edge_handle, 0);
        INIT_KFIFO(dev->raw->kfifo);
  
  int ir_raw_event_register(struct rc_dev *dev)
  {
-       struct ir_raw_handler *handler;
        struct task_struct *thread;
  
        thread = kthread_run(ir_raw_event_thread, dev->raw, "rc%u", dev->minor);
  
        mutex_lock(&ir_raw_handler_lock);
        list_add_tail(&dev->raw->list, &ir_raw_client_list);
-       list_for_each_entry(handler, &ir_raw_handler_list, list)
-               if (handler->raw_register)
-                       handler->raw_register(dev);
        mutex_unlock(&ir_raw_handler_lock);
  
        return 0;
@@@ -619,19 -669,12 +669,20 @@@ void ir_raw_event_unregister(struct rc_
        mutex_lock(&ir_raw_handler_lock);
        list_del(&dev->raw->list);
        list_for_each_entry(handler, &ir_raw_handler_list, list)
-               if (handler->raw_unregister)
+               if (handler->raw_unregister &&
+                   (handler->protocols & dev->enabled_protocols))
                        handler->raw_unregister(dev);
 -      mutex_unlock(&ir_raw_handler_lock);
 +
 +      lirc_bpf_free(dev);
  
        ir_raw_event_free(dev);
 +
 +      /*
 +       * A user can be calling bpf(BPF_PROG_{QUERY|ATTACH|DETACH}), so
 +       * ensure that the raw member is null on unlock; this is how
 +       * "device gone" is checked.
 +       */
 +      mutex_unlock(&ir_raw_handler_lock);
  }
  
  /*
  
  int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler)
  {
-       struct ir_raw_event_ctrl *raw;
        mutex_lock(&ir_raw_handler_lock);
        list_add_tail(&ir_raw_handler->list, &ir_raw_handler_list);
-       if (ir_raw_handler->raw_register)
-               list_for_each_entry(raw, &ir_raw_client_list, list)
-                       ir_raw_handler->raw_register(raw->dev);
        atomic64_or(ir_raw_handler->protocols, &available_protocols);
        mutex_unlock(&ir_raw_handler_lock);
  
@@@ -662,9 -700,10 +708,10 @@@ void ir_raw_handler_unregister(struct i
        mutex_lock(&ir_raw_handler_lock);
        list_del(&ir_raw_handler->list);
        list_for_each_entry(raw, &ir_raw_client_list, list) {
-               ir_raw_disable_protocols(raw->dev, protocols);
-               if (ir_raw_handler->raw_unregister)
+               if (ir_raw_handler->raw_unregister &&
+                   (raw->dev->enabled_protocols & protocols))
                        ir_raw_handler->raw_unregister(raw->dev);
+               ir_raw_disable_protocols(raw->dev, protocols);
        }
        atomic64_andnot(protocols, &available_protocols);
        mutex_unlock(&ir_raw_handler_lock);
@@@ -344,6 -344,19 +344,6 @@@ static int proc_videocodecs_show(struc
  
        return 0;
  }
 -
 -static int proc_videocodecs_open(struct inode *inode, struct file *file)
 -{
 -      return single_open(file, proc_videocodecs_show, NULL);
 -}
 -
 -static const struct file_operations videocodecs_proc_fops = {
 -      .owner          = THIS_MODULE,
 -      .open           = proc_videocodecs_open,
 -      .read           = seq_read,
 -      .llseek         = seq_lseek,
 -      .release        = single_release,
 -};
  #endif
  
  /* ===================== */
@@@ -360,8 -373,7 +360,8 @@@ videocodec_init (void
               VIDEOCODEC_VERSION);
  
  #ifdef CONFIG_PROC_FS
 -      videocodec_proc_entry = proc_create("videocodecs", 0, NULL, &videocodecs_proc_fops);
 +      videocodec_proc_entry = proc_create_single("videocodecs", 0, NULL,
 +                      proc_videocodecs_show);
        if (!videocodec_proc_entry) {
                dprintk(1, KERN_ERR "videocodec: can't init procfs.\n");
        }