diff mbox

[OpenWrt-Devel,1/1,kernel] Fix kmod-v4l2 modules have missing symbols due to lack of clk support

Message ID 20150810153018.6240123A1534@danielcent.thecshore.com
State RFC
Headers show

Commit Message

Daniel Dickinson Aug. 2, 2015, 2:34 p.m. UTC
The v4l kernel modules fail to compile on latest kernels due to a new
dependency on a clock source.  Since most routers won't have a suitable
clock source, I have added a kernel config option that omits the functionality
that requires the clock source.  

That means v4l modules in OpenWrt can't support DV devices (DV requires
the clock source support) but unless clock source support was addded to
OpenWrt the other alternative is to drop v4l altogether).

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
---
 package/kernel/linux/modules/video.mk              |   3 +-
 ...avoid-clk-for-devices-that-do-not-need-it.patch | 348 +++++++++++++++++++++
 2 files changed, 350 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch

Comments

Hauke Mehrtens Aug. 15, 2015, 2:34 p.m. UTC | #1
On 08/02/2015 04:34 PM, Daniel Dickinson wrote:
> The v4l kernel modules fail to compile on latest kernels due to a new
> dependency on a clock source.  Since most routers won't have a suitable
> clock source, I have added a kernel config option that omits the functionality
> that requires the clock source.  
> 
> That means v4l modules in OpenWrt can't support DV devices (DV requires
> the clock source support) but unless clock source support was addded to
> OpenWrt the other alternative is to drop v4l altogether).
> 
> Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
> ---
>  package/kernel/linux/modules/video.mk              |   3 +-
>  ...avoid-clk-for-devices-that-do-not-need-it.patch | 348 +++++++++++++++++++++
>  2 files changed, 350 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
> 

The build problem of ar71xx was fixed here:
https://dev.openwrt.org/changeset/46572

The arch code did not export all the clk functions needed, but claimed
to do so. Is your patch needed with r46572 any more? When an arch really
does not support clocks it a driver would use the static inline
functions doing nothing instead.

Hauke
Daniel Dickinson Aug. 19, 2015, 11:30 p.m. UTC | #2
Your patch resolves the issue of compiling - I have not yet tested the 
functionality of the resulting v4l module.  I suspect the disadvantage 
of this patch is that it will silently fail to work for the types of 
devices (DV primarily) that depend on clock support whereas my patch 
omits building code/modules for devices that depend on clock support a 
kernel config option that prevents building useless modules (although I 
realized the DV_SUPPORT should depend on CLK_COMMON since that's the 
whole reason for making that a config option) and (and of course 
#ifdef's out the code and dependencies on clk support when it's not 
present).

Regards,

Daniel

On 2015-08-15 10:34 AM, Hauke Mehrtens wrote:
> On 08/02/2015 04:34 PM, Daniel Dickinson wrote:
>> The v4l kernel modules fail to compile on latest kernels due to a new
>> dependency on a clock source.  Since most routers won't have a suitable
>> clock source, I have added a kernel config option that omits the functionality
>> that requires the clock source.
>>
>> That means v4l modules in OpenWrt can't support DV devices (DV requires
>> the clock source support) but unless clock source support was addded to
>> OpenWrt the other alternative is to drop v4l altogether).
>>
>> Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
>> ---
>>   package/kernel/linux/modules/video.mk              |   3 +-
>>   ...avoid-clk-for-devices-that-do-not-need-it.patch | 348 +++++++++++++++++++++
>>   2 files changed, 350 insertions(+), 1 deletion(-)
>>   create mode 100644 target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
>>
>
> The build problem of ar71xx was fixed here:
> https://dev.openwrt.org/changeset/46572
>
> The arch code did not export all the clk functions needed, but claimed
> to do so. Is your patch needed with r46572 any more? When an arch really
> does not support clocks it a driver would use the static inline
> functions doing nothing instead.
>
> Hauke
>
Hauke Mehrtens Aug. 21, 2015, 6:03 p.m. UTC | #3
On 08/20/2015 01:30 AM, Daniel Dickinson wrote:
> Your patch resolves the issue of compiling - I have not yet tested the
> functionality of the resulting v4l module.  I suspect the disadvantage
> of this patch is that it will silently fail to work for the types of
> devices (DV primarily) that depend on clock support whereas my patch
> omits building code/modules for devices that depend on clock support a
> kernel config option that prevents building useless modules (although I
> realized the DV_SUPPORT should depend on CLK_COMMON since that's the
> whole reason for making that a config option) and (and of course
> #ifdef's out the code and dependencies on clk support when it's not
> present).
> 
> Regards,
> 
> Daniel

Hi Daniel,

I do not know if they will still work, but if some driver has to change
some clock of the SoC and the SoC does not support this it should fail.
The problem not only exist with ar71xx, but with all SoC in the mainline
kernel, so I assume that this is already handled. If we return the wrong
number in the ar71xx code it should be changed, different SoC code
returned different values in the same cases so I was unsure.

Have you experienced any runtime problems with the clocks with the
current trunk version?

Hauke
Hauke Mehrtens Aug. 21, 2015, 6:04 p.m. UTC | #4
On 08/20/2015 01:30 AM, Daniel Dickinson wrote:
> Your patch resolves the issue of compiling - I have not yet tested the
> functionality of the resulting v4l module.  I suspect the disadvantage
> of this patch is that it will silently fail to work for the types of
> devices (DV primarily) that depend on clock support whereas my patch
> omits building code/modules for devices that depend on clock support a
> kernel config option that prevents building useless modules (although I
> realized the DV_SUPPORT should depend on CLK_COMMON since that's the
> whole reason for making that a config option) and (and of course
> #ifdef's out the code and dependencies on clk support when it's not
> present).
> 
> Regards,
> 
> Daniel

Hi Daniel,

I do not know if they will still work, but if some driver has to change
some clock of the SoC and the SoC does not support this it should fail.
The problem not only exist with ar71xx, but with all SoC in the mainline
kernel, so I assume that this is already handled. If we return the wrong
number in the ar71xx code it should be changed, different SoC code
returned different values in the same cases so I was unsure.

Have you experienced any runtime problems with the clocks with the
current trunk version?

Hauke
diff mbox

Patch

diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk
index 3b06a14..ba99c3c 100644
--- a/package/kernel/linux/modules/video.mk
+++ b/package/kernel/linux/modules/video.mk
@@ -92,7 +92,8 @@  define KernelPackage/video-core
 	CONFIG_V4L_USB_DRIVERS=y \
 	CONFIG_V4L_PCI_DRIVERS=y \
 	CONFIG_V4L_PLATFORM_DRIVERS=y \
-	CONFIG_V4L_ISA_PARPORT_DRIVERS=y
+	CONFIG_V4L_ISA_PARPORT_DRIVERS=y \
+	CONFIG_VIDEO_V4L2_DV_SUPPORT=n
   FILES:= \
 	$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-common.ko \
 	$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videodev.ko
diff --git a/target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch b/target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
new file mode 100644
index 0000000..6d84adf
--- /dev/null
+++ b/target/linux/generic/patches-4.1/273-v4l-avoid-clk-for-devices-that-do-not-need-it.patch
@@ -0,0 +1,348 @@ 
+Index: linux-4.1.3/drivers/media/i2c/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/i2c/Kconfig
++++ linux-4.1.3/drivers/media/i2c/Kconfig
+@@ -196,7 +196,7 @@ config VIDEO_ADV7183
+ 
+ config VIDEO_ADV7604
+ 	tristate "Analog Devices ADV7604 decoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Analog Devices ADV7604 video decoder.
+ 
+@@ -208,7 +208,7 @@ config VIDEO_ADV7604
+ 
+ config VIDEO_ADV7842
+ 	tristate "Analog Devices ADV7842 decoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	select HDMI
+ 	---help---
+ 	  Support for the Analog Devices ADV7842 video decoder.
+@@ -306,7 +306,7 @@ config VIDEO_TVP5150
+ 	  module will be called tvp5150.
+ 
+ config VIDEO_TVP7002
+ 	tristate "Texas Instruments TVP7002 video decoder"
+-	depends on VIDEO_V4L2 && I2C
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Texas Instruments TVP7002 video decoder.
+@@ -423,7 +423,7 @@ config VIDEO_ADV7393
+ 
+ config VIDEO_ADV7511
+ 	tristate "Analog Devices ADV7511 encoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Analog Devices ADV7511 video encoder.
+ 
+@@ -434,7 +434,7 @@ config VIDEO_ADV7511
+ 
+ config VIDEO_AD9389B
+ 	tristate "Analog Devices AD9389B encoder"
+-	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Analog Devices AD9389B video encoder.
+ 
+@@ -451,7 +451,7 @@ config VIDEO_AK881X
+ 
+ config VIDEO_THS8200
+ 	tristate "Texas Instruments THS8200 video encoder"
+-	depends on VIDEO_V4L2 && I2C
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  Support for the Texas Instruments THS8200 video encoder.
+ 
+@@ -692,7 +692,7 @@ comment "Miscellaneous helper chips"
+ 
+ config VIDEO_THS7303
+ 	tristate "THS7303/53 Video Amplifier"
+-	depends on VIDEO_V4L2 && I2C
++	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	help
+ 	  Support for TI THS7303/53 video amplifier
+ 
+Index: linux-4.1.3/drivers/media/platform/blackfin/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/blackfin/Kconfig
++++ linux-4.1.3/drivers/media/platform/blackfin/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_BLACKFIN_CAPTURE
+ 	tristate "Blackfin Video Capture Driver"
+-	depends on VIDEO_V4L2 && BLACKFIN && I2C
++	depends on VIDEO_V4L2 && BLACKFIN && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+ 	help
+Index: linux-4.1.3/drivers/media/platform/davinci/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/davinci/Kconfig
++++ linux-4.1.3/drivers/media/platform/davinci/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_DAVINCI_VPIF_DISPLAY
+ 	tristate "TI DaVinci VPIF V4L2-Display driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+@@ -16,7 +16,7 @@ config VIDEO_DAVINCI_VPIF_DISPLAY
+ 
+ config VIDEO_DAVINCI_VPIF_CAPTURE
+ 	tristate "TI DaVinci VPIF video capture driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+@@ -30,7 +30,7 @@ config VIDEO_DAVINCI_VPIF_CAPTURE
+ 
+ config VIDEO_DM6446_CCDC
+ 	tristate "TI DM6446 CCDC video capture driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF_DMA_CONTIG
+@@ -46,7 +46,7 @@ config VIDEO_DM6446_CCDC
+ 
+ config VIDEO_DM355_CCDC
+ 	tristate "TI DM355 CCDC video capture driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on ARCH_DAVINCI || COMPILE_TEST
+ 	depends on HAS_DMA
+ 	select VIDEOBUF_DMA_CONTIG
+@@ -62,7 +62,7 @@ config VIDEO_DM355_CCDC
+ 
+ config VIDEO_DM365_ISIF
+ 	tristate "TI DM365 ISIF video capture driver"
+-	depends on VIDEO_V4L2 && ARCH_DAVINCI
++	depends on VIDEO_V4L2 && ARCH_DAVINCI && VIDEO_V4L2_DV_SUPPORT
+ 	depends on HAS_DMA
+ 	select VIDEOBUF_DMA_CONTIG
+ 	help
+@@ -75,7 +75,7 @@ config VIDEO_DM365_ISIF
+ 
+ config VIDEO_DAVINCI_VPBE_DISPLAY
+ 	tristate "TI DaVinci VPBE V4L2-Display driver"
+-	depends on VIDEO_V4L2 && ARCH_DAVINCI
++	depends on VIDEO_V4L2 && ARCH_DAVINCI && VIDEO_V4L2_DV_SUPPORT
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+ 	help
+Index: linux-4.1.3/drivers/media/platform/s5p-tv/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/s5p-tv/Kconfig
++++ linux-4.1.3/drivers/media/platform/s5p-tv/Kconfig
+@@ -19,7 +19,7 @@ if VIDEO_SAMSUNG_S5P_TV
+ 
+ config VIDEO_SAMSUNG_S5P_HDMI
+ 	tristate "Samsung HDMI Driver"
+-	depends on VIDEO_V4L2
++	depends on VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on I2C
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	select VIDEO_SAMSUNG_S5P_HDMIPHY
+@@ -39,7 +39,7 @@ config VIDEO_SAMSUNG_S5P_HDMI_DEBUG
+ 
+ config VIDEO_SAMSUNG_S5P_HDMIPHY
+ 	tristate "Samsung HDMIPHY Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2 && I2C
++	depends on VIDEO_DEV && VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	help
+ 	  Say Y here if you want support for the physical HDMI
+@@ -49,7 +49,7 @@ config VIDEO_SAMSUNG_S5P_HDMIPHY
+ 
+ config VIDEO_SAMSUNG_S5P_SII9234
+ 	tristate "Samsung SII9234 Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2 && I2C
++	depends on VIDEO_DEV && VIDEO_V4L2 && I2C && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	help
+ 	  Say Y here if you want support for the MHL interface
+@@ -59,7 +59,7 @@ config VIDEO_SAMSUNG_S5P_SII9234
+ 
+ config VIDEO_SAMSUNG_S5P_SDO
+ 	tristate "Samsung Analog TV Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2
++	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	help
+ 	  Say Y here if you want support for the analog TV output
+@@ -70,7 +70,7 @@ config VIDEO_SAMSUNG_S5P_SDO
+ 
+ config VIDEO_SAMSUNG_S5P_MIXER
+ 	tristate "Samsung Mixer and Video Processor Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2
++	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	depends on VIDEO_SAMSUNG_S5P_TV
+ 	depends on HAS_DMA
+ 	select VIDEOBUF2_DMA_CONTIG
+Index: linux-4.1.3/drivers/media/platform/vivid/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/platform/vivid/Kconfig
++++ linux-4.1.3/drivers/media/platform/vivid/Kconfig
+@@ -1,6 +1,6 @@
+ config VIDEO_VIVID
+ 	tristate "Virtual Video Test Driver"
+-	depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64 && FB
++	depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64 && FB && VIDEO_V4L2_DV_SUPPORT
+ 	select FONT_SUPPORT
+ 	select FONT_8x16
+ 	select FB_CFB_FILLRECT
+Index: linux-4.1.3/drivers/media/usb/hdpvr/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/usb/hdpvr/Kconfig
++++ linux-4.1.3/drivers/media/usb/hdpvr/Kconfig
+@@ -1,7 +1,7 @@
+ 
+ config VIDEO_HDPVR
+ 	tristate "Hauppauge HD PVR support"
+-	depends on VIDEO_DEV && VIDEO_V4L2
++	depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_DV_SUPPORT
+ 	---help---
+ 	  This is a video4linux driver for Hauppauge's HD PVR USB device.
+ 
+Index: linux-4.1.3/drivers/media/v4l2-core/Kconfig
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/Kconfig
++++ linux-4.1.3/drivers/media/v4l2-core/Kconfig
+@@ -8,6 +8,11 @@ config VIDEO_V4L2
+ 	depends on (I2C || I2C=n) && VIDEO_DEV
+ 	default (I2C || I2C=n) && VIDEO_DEV
+ 
++config VIDEO_V4L2_DV_SUPPORT
++	bool "Enable support for DV devices"
++	depends on VIDEO_V4L2
++	default y
++
+ config VIDEO_ADV_DEBUG
+ 	bool "Enable advanced debug functionality on V4L2 drivers"
+ 	default n
+@@ -96,3 +101,4 @@ config VIDEOBUF2_DMA_SG
+ config VIDEOBUF2_DVB
+ 	tristate
+ 	select VIDEOBUF2_CORE
++	depends on VIDEO_V4L2_DV_SUPPORT
+Index: linux-4.1.3/drivers/media/v4l2-core/Makefile
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/Makefile
++++ linux-4.1.3/drivers/media/v4l2-core/Makefile
+@@ -5,18 +5,21 @@
+ tuner-objs	:=	tuner-core.o
+ 
+ videodev-objs	:=	v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \
+-			v4l2-event.o v4l2-ctrls.o v4l2-subdev.o v4l2-clk.o \
++			v4l2-event.o v4l2-ctrls.o v4l2-subdev.o \
+ 			v4l2-async.o
+ ifeq ($(CONFIG_COMPAT),y)
+   videodev-objs += v4l2-compat-ioctl32.o
+ endif
+ ifeq ($(CONFIG_OF),y)
+-  videodev-objs += v4l2-of.o
++  videodev-objs += v4l2-of.o v4l2-clk.o
+ endif
+ 
+ obj-$(CONFIG_VIDEO_V4L2) += videodev.o
+ obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
+-obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
++
++ifeq ($(CONFIG_VIDEO_V4L2_DV_SUPPORT),y)
++obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o v4l2-clk.o
++endif
+ 
+ obj-$(CONFIG_VIDEO_TUNER) += tuner.o
+ 
+Index: linux-4.1.3/drivers/media/v4l2-core/v4l2-dev.c
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/v4l2-dev.c
++++ linux-4.1.3/drivers/media/v4l2-core/v4l2-dev.c
+@@ -676,7 +676,9 @@ static void determine_valid_ioctls(struc
+ 			SET_VALID_IOCTL(ops, VIDIOC_ENUMAUDIO, vidioc_enumaudio);
+ 			SET_VALID_IOCTL(ops, VIDIOC_G_AUDIO, vidioc_g_audio);
+ 			SET_VALID_IOCTL(ops, VIDIOC_S_AUDIO, vidioc_s_audio);
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 			SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings);
++#endif
+ 			SET_VALID_IOCTL(ops, VIDIOC_S_EDID, vidioc_s_edid);
+ 		}
+ 		if (is_tx) {
+@@ -691,10 +693,12 @@ static void determine_valid_ioctls(struc
+ 					ops->vidioc_g_std))
+ 			set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls);
+ 		SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm);
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 		SET_VALID_IOCTL(ops, VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings);
+ 		SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings);
+ 		SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings);
+ 		SET_VALID_IOCTL(ops, VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap);
++#endif
+ 		SET_VALID_IOCTL(ops, VIDIOC_G_EDID, vidioc_g_edid);
+ 	}
+ 	if (is_tx && (is_radio || is_sdr)) {
+Index: linux-4.1.3/drivers/media/v4l2-core/v4l2-ioctl.c
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/v4l2-ioctl.c
++++ linux-4.1.3/drivers/media/v4l2-core/v4l2-ioctl.c
+@@ -676,6 +676,7 @@ static void v4l_print_dbg_register(const
+ 			p->reg, p->val);
+ }
+ 
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ static void v4l_print_dv_timings(const void *arg, bool write_only)
+ {
+ 	const struct v4l2_dv_timings *p = arg;
+@@ -731,6 +732,7 @@ static void v4l_print_dv_timings_cap(con
+ 		break;
+ 	}
+ }
++#endif
+ 
+ static void v4l_print_frmsizeenum(const void *arg, bool write_only)
+ {
+@@ -2257,16 +2259,20 @@ static struct v4l2_ioctl_info v4l2_ioctl
+ 	IOCTL_INFO_FNC(VIDIOC_DBG_S_REGISTER, v4l_dbg_s_register, v4l_print_dbg_register, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_DBG_G_REGISTER, v4l_dbg_g_register, v4l_print_dbg_register, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_S_HW_FREQ_SEEK, v4l_s_hw_freq_seek, v4l_print_hw_freq_seek, INFO_FL_PRIO),
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 	IOCTL_INFO_STD(VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings, v4l_print_dv_timings, INFO_FL_PRIO),
+ 	IOCTL_INFO_STD(VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings, v4l_print_dv_timings, 0),
++#endif
+ 	IOCTL_INFO_FNC(VIDIOC_DQEVENT, v4l_dqevent, v4l_print_event, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_SUBSCRIBE_EVENT, v4l_subscribe_event, v4l_print_event_subscription, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_UNSUBSCRIBE_EVENT, v4l_unsubscribe_event, v4l_print_event_subscription, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_CREATE_BUFS, v4l_create_bufs, v4l_print_create_buffers, INFO_FL_PRIO | INFO_FL_QUEUE),
+ 	IOCTL_INFO_FNC(VIDIOC_PREPARE_BUF, v4l_prepare_buf, v4l_print_buffer, INFO_FL_QUEUE),
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 	IOCTL_INFO_STD(VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings, v4l_print_enum_dv_timings, 0),
+ 	IOCTL_INFO_STD(VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings, v4l_print_dv_timings, 0),
+ 	IOCTL_INFO_STD(VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap, v4l_print_dv_timings_cap, INFO_FL_CLEAR(v4l2_dv_timings_cap, type)),
++#endif
+ 	IOCTL_INFO_FNC(VIDIOC_ENUM_FREQ_BANDS, v4l_enum_freq_bands, v4l_print_freq_band, 0),
+ 	IOCTL_INFO_FNC(VIDIOC_DBG_G_CHIP_INFO, v4l_dbg_g_chip_info, v4l_print_dbg_chip_info, INFO_FL_CLEAR(v4l2_dbg_chip_info, match)),
+ 	IOCTL_INFO_FNC(VIDIOC_QUERY_EXT_CTRL, v4l_query_ext_ctrl, v4l_print_query_ext_ctrl, INFO_FL_CTRL | INFO_FL_CLEAR(v4l2_query_ext_ctrl, id)),
+Index: linux-4.1.3/drivers/media/v4l2-core/v4l2-subdev.c
+===================================================================
+--- linux-4.1.3.orig/drivers/media/v4l2-core/v4l2-subdev.c
++++ linux-4.1.3/drivers/media/v4l2-core/v4l2-subdev.c
+@@ -419,6 +419,7 @@ static long subdev_do_ioctl(struct file
+ 		return v4l2_subdev_call(sd, pad, set_edid, edid);
+ 	}
+ 
++#ifdef CONFIG_VIDEO_V4L2_DV_SUPPORT
+ 	case VIDIOC_SUBDEV_DV_TIMINGS_CAP: {
+ 		struct v4l2_dv_timings_cap *cap = arg;
+ 
+@@ -446,6 +447,7 @@ static long subdev_do_ioctl(struct file
+ 	case VIDIOC_SUBDEV_S_DV_TIMINGS:
+ 		return v4l2_subdev_call(sd, video, s_dv_timings, arg);
+ #endif
++#endif
+ 	default:
+ 		return v4l2_subdev_call(sd, core, ioctl, cmd, arg);
+ 	}