[Armadeus-commitlog] armadeus branch, master, updated. armadeus-6.0-423-g8a52d62f1
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2018-06-21 13:07:37
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 8a52d62f1ce933abc0065aa17ac07cf5fda36917 (commit)
from 13bc33e185ea13b0b817c4a03041d46e39aa088a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8a52d62f1ce933abc0065aa17ac07cf5fda36917
Author: Sébastien Szymanski <seb...@ar...>
Date: Thu Jun 21 14:42:39 2018 +0200
[BSP] add opos6ullegacy-4.9_defconfig
-----------------------------------------------------------------------
Summary of changes:
...y-4.1_defconfig => opos6ullegacy-4.9_defconfig} | 24 ++-
...15-armadeus-logo-add_armadeus-project_tux.patch | 0
...50-armadeus-add_custom_drivers_to_kconfig.patch | 0
..._star_completion_for_source_in_menuconfig.patch | 0
...-add-apf6q-and-apf6dl-device-trees.patch.tofix} | 0
...0452-Input-sx8654-support-inverted-y-prop.patch | 0
...500-mxc_ipuv3_fb-unblank-displays-at-init.patch | 0
..._fb-move-fb_blank-call-after-registration.patch | 0
...able-overflow-interrupt-after-initializat.patch | 0
.../0503-Add-support-for-DVI-monitors.patch | 0
...and-simple-assumptions-in-imx6sll-support.patch | 0
...ernel-config-fragment-to-imx-v7-defconfig.patch | 0
...s-remove-spidev-oops-warning-at-load-time.patch | 8 +-
.../0515-armadeus-imx6ull-include-input-h.patch | 12 ++
...516-armadeus-imx6ull-rename-flexcan-nodes.patch | 33 +++
...ia-ov7670-call-v4l2_async_register_subdev.patch | 50 +++++
.../0518-media-ov7670-fix-g-s_parm.patch | 41 ++++
.../0519-media-ov7670-get-xclk.patch | 80 ++++++++
.../0520-media-ov7670-add-devicetree-support.patch | 108 ++++++++++
...1-media-ov7670-Return-the-real-error-code.patch | 31 +++
...0-Check-the-return-value-from-clk_prepare.patch | 34 ++++
...dia-ov7670-Add-entity-pads-initialization.patch | 70 +++++++
...524-media-ov7670-Add-the-get_fmt-callback.patch | 170 ++++++++++++++++
...ia-ov7670-Add-the-ov7670_s_power-function.patch | 95 +++++++++
...a-ov7670-use-v4l2_async_unregister_subdev.patch | 34 ++++
...-ov7670-add-V4L2_CID_TEST_PATTERN-control.patch | 111 ++++++++++
...-media-replace-all-spaces-tab-occurrences.patch | 96 +++++++++
...y-Add-a-nop-variant-of-media_entity_clean.patch | 63 ++++++
...rt-g-s_parm-to-g-s_frame_interval-in-subd.patch | 72 +++++++
.../0700-armadeus-pcie_clk_defined_in_uboot.patch | 10 +-
...pos6ul-and-opos6uldev-add-initial-support.patch | 224 ++++++++++++++++++---
...s-dts-fixes-imx6ul-pwm-clocks-declaration.patch | 30 +++
...xsfb-fixes-multi-display-timings-handling.patch | 0
...mx6s_caputre-add-subdev-complete-callback.patch | 29 +++
...rmadeus-media-mx6s_capture-define-tvnorms.patch | 21 ++
35 files changed, 1404 insertions(+), 42 deletions(-)
copy buildroot/configs/{opos6ullegacy-4.1_defconfig => opos6ullegacy-4.9_defconfig} (92%)
copy patches/linux/{3.14.mx6_legacy => 4.9.mx6_legacy}/0015-armadeus-logo-add_armadeus-project_tux.patch (100%)
copy patches/linux/{3.14.mx6_legacy => 4.9.mx6_legacy}/0050-armadeus-add_custom_drivers_to_kconfig.patch (100%)
copy patches/linux/{3.14.mx6_legacy => 4.9.mx6_legacy}/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch (100%)
copy patches/linux/{4.1.mx6_legacy/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch => 4.9.mx6_legacy/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch.tofix} (100%)
copy patches/linux/{3.14.mx6_legacy => 4.9.mx6_legacy}/0452-Input-sx8654-support-inverted-y-prop.patch (100%)
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0500-mxc_ipuv3_fb-unblank-displays-at-init.patch (100%)
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0501-mxc_ipuv3_fb-move-fb_blank-call-after-registration.patch (100%)
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0502-mxc_hdmi-enable-overflow-interrupt-after-initializat.patch (100%)
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0503-Add-support-for-DVI-monitors.patch (100%)
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0504-linux-fslc-imx-4.1-2.0.x-imx-imx-fix-typo-and-simple-assumptions-in-imx6sll-support.patch (100%)
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0513-armadeus-add-apf6-kernel-config-fragment-to-imx-v7-defconfig.patch (100%)
copy patches/linux/{4.8 => 4.9.mx6_legacy}/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch (69%)
create mode 100644 patches/linux/4.9.mx6_legacy/0515-armadeus-imx6ull-include-input-h.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0516-armadeus-imx6ull-rename-flexcan-nodes.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0517-media-ov7670-call-v4l2_async_register_subdev.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0518-media-ov7670-fix-g-s_parm.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0519-media-ov7670-get-xclk.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0520-media-ov7670-add-devicetree-support.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0521-media-ov7670-Return-the-real-error-code.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0522-media-ov7670-Check-the-return-value-from-clk_prepare.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0523-media-ov7670-Add-entity-pads-initialization.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0524-media-ov7670-Add-the-get_fmt-callback.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0525-media-ov7670-Add-the-ov7670_s_power-function.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0526-media-ov7670-use-v4l2_async_unregister_subdev.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0527-media-ov7670-add-V4L2_CID_TEST_PATTERN-control.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0528-media-replace-all-spaces-tab-occurrences.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0529-media-entity-Add-a-nop-variant-of-media_entity_clean.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0530-media-convert-g-s_parm-to-g-s_frame_interval-in-subd.patch
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0700-armadeus-pcie_clk_defined_in_uboot.patch (72%)
copy patches/linux/{4.9 => 4.9.mx6_legacy}/0800-ARM-dts-opos6ul-and-opos6uldev-add-initial-support.patch (70%)
create mode 100644 patches/linux/4.9.mx6_legacy/0805-armadeus-dts-fixes-imx6ul-pwm-clocks-declaration.patch
copy patches/linux/{4.1.mx6_legacy => 4.9.mx6_legacy}/0806-armadeus-mxsfb-fixes-multi-display-timings-handling.patch (100%)
create mode 100644 patches/linux/4.9.mx6_legacy/0807-armadeus-media-mx6s_caputre-add-subdev-complete-callback.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0808-armadeus-media-mx6s_capture-define-tvnorms.patch
diff --git a/buildroot/configs/opos6ullegacy-4.1_defconfig b/buildroot/configs/opos6ullegacy-4.9_defconfig
similarity index 92%
copy from buildroot/configs/opos6ullegacy-4.1_defconfig
copy to buildroot/configs/opos6ullegacy-4.9_defconfig
index d05518d8f..6055ce973 100644
--- a/buildroot/configs/opos6ullegacy-4.1_defconfig
+++ b/buildroot/configs/opos6ullegacy-4.9_defconfig
@@ -5,9 +5,8 @@ BR2_DL_DIR="$(BASE_DIR)/../downloads"
BR2_BACKUP_SITE="ftp://ftp2.armadeus.com/armadeusw/download"
BR2_CCACHE=y
BR2_CCACHE_DIR="$(TOPDIR)/.$(BR2_BOARD_NAME)-buildroot-ccache"
-# Needed to have FSL 4.1 custom kernel includes:
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_PACKAGE_HOST_GDB_TUI=y
@@ -29,13 +28,17 @@ BR2_TARGET_ARMADEUS_SDRAM_SIZE="256"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.freescale.com/imx/linux-imx.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="imx_4.1.15_2.0.0_ga"
-BR2_LINUX_KERNEL_PATCH="../patches/linux/4.1.mx6_legacy"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="imx_4.9.11_1.0.0_ga"
+BR2_LINUX_KERNEL_PATCH="../patches/linux/4.9.mx6_legacy"
BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="target/device/armadeus/opos6ul/opos6ul-linux-4.1.legacy.config.fragment"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6ul-opos6uldev imx6ull-opos6ulldev"
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6ul-opos6uldev imx6ull-opos6uldev"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_PACKAGE_LINUX_TOOLS_CPUPOWER=y
+BR2_PACKAGE_LINUX_TOOLS_GPIO=y
+BR2_PACKAGE_LINUX_TOOLS_IIO=y
+BR2_PACKAGE_LINUX_TOOLS_TMON=y
BR2_PACKAGE_BUSYBOX_CONFIG="$(ARMADEUS_PATH)/busybox.config"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_DEMOS=y
@@ -73,7 +76,6 @@ BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_VIDEOMIXER=y
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_V4L2=y
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_V4L2_PROBE=y
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_GDKPIXBUF=y
-BR2_PACKAGE_GST1_PLUGINS_BAD=y
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_COMPOSITOR=y
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_CAMERABIN2=y
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FBDEV=y
@@ -81,6 +83,10 @@ BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_OPENH264=y
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_X265=y
BR2_PACKAGE_GST1_PLUGINS_UGLY=y
BR2_PACKAGE_GST1_PLUGINS_UGLY_PLUGIN_X264=y
+BR2_PACKAGE_GST1_IMX=y
+BR2_PACKAGE_GST1_IMX_PXP=y
+BR2_PACKAGE_GST1_IMX_V4L2VIDEOSRC=y
+BR2_PACKAGE_GST1_IMX_V4L2VIDEOSINK=y
BR2_PACKAGE_GST1_LIBAV=y
BR2_PACKAGE_V4L2LOOPBACK=y
BR2_PACKAGE_GDB=y
@@ -91,7 +97,6 @@ BR2_PACKAGE_RT_TESTS=y
BR2_PACKAGE_SPIDEV_TEST=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_STRESS_NG=y
-BR2_PACKAGE_HWDATA=y
BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FATLABEL=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y
@@ -106,10 +111,10 @@ BR2_PACKAGE_FBV=y
BR2_PACKAGE_LINUX_FIRMWARE=y
BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX=y
BR2_PACKAGE_APF_CONFIG=y
-BR2_PACKAGE_DBUS_PYTHON=y
BR2_PACKAGE_EVTEST=y
BR2_PACKAGE_FREESCALE_IMX=y
BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL=y
+BR2_PACKAGE_HWDATA=y
BR2_PACKAGE_I2C_TOOLS=y
BR2_PACKAGE_IMX_TEST=y
BR2_PACKAGE_KBD=y
@@ -128,7 +133,7 @@ BR2_PACKAGE_HAVEGED=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_OBEX=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
-BR2_PACKAGE_BLUEZ5_UTILS_GATTTOOL=y
+BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL=y
BR2_PACKAGE_CAN_UTILS=y
BR2_PACKAGE_DNSMASQ=y
@@ -156,6 +161,7 @@ BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_LABEL="ROOTFS"
+BR2_TARGET_ROOTFS_EXT2_SIZE="200M"
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
diff --git a/patches/linux/3.14.mx6_legacy/0015-armadeus-logo-add_armadeus-project_tux.patch b/patches/linux/4.9.mx6_legacy/0015-armadeus-logo-add_armadeus-project_tux.patch
similarity index 100%
copy from patches/linux/3.14.mx6_legacy/0015-armadeus-logo-add_armadeus-project_tux.patch
copy to patches/linux/4.9.mx6_legacy/0015-armadeus-logo-add_armadeus-project_tux.patch
diff --git a/patches/linux/3.14.mx6_legacy/0050-armadeus-add_custom_drivers_to_kconfig.patch b/patches/linux/4.9.mx6_legacy/0050-armadeus-add_custom_drivers_to_kconfig.patch
similarity index 100%
copy from patches/linux/3.14.mx6_legacy/0050-armadeus-add_custom_drivers_to_kconfig.patch
copy to patches/linux/4.9.mx6_legacy/0050-armadeus-add_custom_drivers_to_kconfig.patch
diff --git a/patches/linux/3.14.mx6_legacy/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch b/patches/linux/4.9.mx6_legacy/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
similarity index 100%
copy from patches/linux/3.14.mx6_legacy/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
copy to patches/linux/4.9.mx6_legacy/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
diff --git a/patches/linux/4.1.mx6_legacy/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch b/patches/linux/4.9.mx6_legacy/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch.tofix
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
copy to patches/linux/4.9.mx6_legacy/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch.tofix
diff --git a/patches/linux/3.14.mx6_legacy/0452-Input-sx8654-support-inverted-y-prop.patch b/patches/linux/4.9.mx6_legacy/0452-Input-sx8654-support-inverted-y-prop.patch
similarity index 100%
copy from patches/linux/3.14.mx6_legacy/0452-Input-sx8654-support-inverted-y-prop.patch
copy to patches/linux/4.9.mx6_legacy/0452-Input-sx8654-support-inverted-y-prop.patch
diff --git a/patches/linux/4.1.mx6_legacy/0500-mxc_ipuv3_fb-unblank-displays-at-init.patch b/patches/linux/4.9.mx6_legacy/0500-mxc_ipuv3_fb-unblank-displays-at-init.patch
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0500-mxc_ipuv3_fb-unblank-displays-at-init.patch
copy to patches/linux/4.9.mx6_legacy/0500-mxc_ipuv3_fb-unblank-displays-at-init.patch
diff --git a/patches/linux/4.1.mx6_legacy/0501-mxc_ipuv3_fb-move-fb_blank-call-after-registration.patch b/patches/linux/4.9.mx6_legacy/0501-mxc_ipuv3_fb-move-fb_blank-call-after-registration.patch
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0501-mxc_ipuv3_fb-move-fb_blank-call-after-registration.patch
copy to patches/linux/4.9.mx6_legacy/0501-mxc_ipuv3_fb-move-fb_blank-call-after-registration.patch
diff --git a/patches/linux/4.1.mx6_legacy/0502-mxc_hdmi-enable-overflow-interrupt-after-initializat.patch b/patches/linux/4.9.mx6_legacy/0502-mxc_hdmi-enable-overflow-interrupt-after-initializat.patch
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0502-mxc_hdmi-enable-overflow-interrupt-after-initializat.patch
copy to patches/linux/4.9.mx6_legacy/0502-mxc_hdmi-enable-overflow-interrupt-after-initializat.patch
diff --git a/patches/linux/4.1.mx6_legacy/0503-Add-support-for-DVI-monitors.patch b/patches/linux/4.9.mx6_legacy/0503-Add-support-for-DVI-monitors.patch
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0503-Add-support-for-DVI-monitors.patch
copy to patches/linux/4.9.mx6_legacy/0503-Add-support-for-DVI-monitors.patch
diff --git a/patches/linux/4.1.mx6_legacy/0504-linux-fslc-imx-4.1-2.0.x-imx-imx-fix-typo-and-simple-assumptions-in-imx6sll-support.patch b/patches/linux/4.9.mx6_legacy/0504-linux-fslc-imx-4.1-2.0.x-imx-imx-fix-typo-and-simple-assumptions-in-imx6sll-support.patch
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0504-linux-fslc-imx-4.1-2.0.x-imx-imx-fix-typo-and-simple-assumptions-in-imx6sll-support.patch
copy to patches/linux/4.9.mx6_legacy/0504-linux-fslc-imx-4.1-2.0.x-imx-imx-fix-typo-and-simple-assumptions-in-imx6sll-support.patch
diff --git a/patches/linux/4.1.mx6_legacy/0513-armadeus-add-apf6-kernel-config-fragment-to-imx-v7-defconfig.patch b/patches/linux/4.9.mx6_legacy/0513-armadeus-add-apf6-kernel-config-fragment-to-imx-v7-defconfig.patch
similarity index 100%
copy from patches/linux/4.1.mx6_legacy/0513-armadeus-add-apf6-kernel-config-fragment-to-imx-v7-defconfig.patch
copy to patches/linux/4.9.mx6_legacy/0513-armadeus-add-apf6-kernel-config-fragment-to-imx-v7-defconfig.patch
diff --git a/patches/linux/4.8/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch b/patches/linux/4.9.mx6_legacy/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch
similarity index 69%
copy from patches/linux/4.8/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch
copy to patches/linux/4.9.mx6_legacy/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch
index 2cad3fd2d..ec8158fa6 100644
--- a/patches/linux/4.8/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch
+++ b/patches/linux/4.9.mx6_legacy/0514-armadeus-remove-spidev-oops-warning-at-load-time.patch
@@ -3,14 +3,14 @@ kernels with device tree support.
Signed-off-by: Julien Boibessot <jul...@ar...>
-Index: linux/drivers/spi/spidev.c
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/spi/spidev.c
===================================================================
---- linux.orig/drivers/spi/spidev.c
-+++ linux/drivers/spi/spidev.c
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/spi/spidev.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/spi/spidev.c
@@ -696,6 +696,7 @@ static struct class *spidev_class;
static const struct of_device_id spidev_dt_ids[] = {
{ .compatible = "rohm,dh2228fv" },
- { .compatible = "lineartechnology,ltc2488" },
+ { .compatible = "lineartechnology,ltc2488" },
+ { .compatible = "spidev" },
{},
};
diff --git a/patches/linux/4.9.mx6_legacy/0515-armadeus-imx6ull-include-input-h.patch b/patches/linux/4.9.mx6_legacy/0515-armadeus-imx6ull-include-input-h.patch
new file mode 100644
index 000000000..71c0a78cb
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0515-armadeus-imx6ull-include-input-h.patch
@@ -0,0 +1,12 @@
+Index: linux-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6ull.dtsi
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/arch/arm/boot/dts/imx6ull.dtsi
++++ linux-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6ull.dtsi
+@@ -9,6 +9,7 @@
+
+ #include <dt-bindings/clock/imx6ul-clock.h>
+ #include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include "imx6ull-pinfunc.h"
+ #include "imx6ull-pinfunc-snvs.h"
diff --git a/patches/linux/4.9.mx6_legacy/0516-armadeus-imx6ull-rename-flexcan-nodes.patch b/patches/linux/4.9.mx6_legacy/0516-armadeus-imx6ull-rename-flexcan-nodes.patch
new file mode 100644
index 000000000..6b455ca30
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0516-armadeus-imx6ull-rename-flexcan-nodes.patch
@@ -0,0 +1,33 @@
+Index: linux-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6ull.dtsi
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/arch/arm/boot/dts/imx6ull.dtsi
++++ linux-imx_4.9.11_1.0.0_ga/arch/arm/boot/dts/imx6ull.dtsi
+@@ -17,8 +17,8 @@
+
+ / {
+ aliases {
+- can0 = &flexcan1;
+- can1 = &flexcan2;
++ can0 = &can1;
++ can1 = &can2;
+ ethernet0 = &fec1;
+ ethernet1 = &fec2;
+ gpio0 = &gpio1;
+@@ -473,7 +473,7 @@
+ #pwm-cells = <2>;
+ };
+
+- flexcan1: can@02090000 {
++ can1: can@02090000 {
+ compatible = "fsl,imx6ul-flexcan", "fsl,imx6q-flexcan";
+ reg = <0x02090000 0x4000>;
+ interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+@@ -484,7 +484,7 @@
+ status = "disabled";
+ };
+
+- flexcan2: can@02094000 {
++ can2: can@02094000 {
+ compatible = "fsl,imx6ul-flexcan", "fsl,imx6q-flexcan";
+ reg = <0x02094000 0x4000>;
+ interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/patches/linux/4.9.mx6_legacy/0517-media-ov7670-call-v4l2_async_register_subdev.patch b/patches/linux/4.9.mx6_legacy/0517-media-ov7670-call-v4l2_async_register_subdev.patch
new file mode 100644
index 000000000..6414cdfdc
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0517-media-ov7670-call-v4l2_async_register_subdev.patch
@@ -0,0 +1,50 @@
+From 7d1b8619eaefc7a1288273964a04cf640f3af33f Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <han...@ci...>
+Date: Tue, 16 Aug 2016 15:55:58 -0300
+Subject: [PATCH 517/531] [media] ov7670: call v4l2_async_register_subdev
+
+Add v4l2-async support for this driver.
+
+Signed-off-by: Hans Verkuil <han...@ci...>
+Acked-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 56cfb5ca9c95..9af8d3b8f848 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1636,10 +1636,9 @@ static int ov7670_probe(struct i2c_client *client,
+ V4L2_EXPOSURE_AUTO);
+ sd->ctrl_handler = &info->hdl;
+ if (info->hdl.error) {
+- int err = info->hdl.error;
++ ret = info->hdl.error;
+
+- v4l2_ctrl_handler_free(&info->hdl);
+- return err;
++ goto hdl_free;
+ }
+ /*
+ * We have checked empirically that hw allows to read back the gain
+@@ -1651,7 +1650,15 @@ static int ov7670_probe(struct i2c_client *client,
+ v4l2_ctrl_cluster(2, &info->saturation);
+ v4l2_ctrl_handler_setup(&info->hdl);
+
++ ret = v4l2_async_register_subdev(&info->sd);
++ if (ret < 0)
++ goto hdl_free;
++
+ return 0;
++
++hdl_free:
++ v4l2_ctrl_handler_free(&info->hdl);
++ return ret;
+ }
+
+
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0518-media-ov7670-fix-g-s_parm.patch b/patches/linux/4.9.mx6_legacy/0518-media-ov7670-fix-g-s_parm.patch
new file mode 100644
index 000000000..ceca23352
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0518-media-ov7670-fix-g-s_parm.patch
@@ -0,0 +1,41 @@
+From d569e90bb74c7f69dc56a808effc49c1da055427 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <han...@ci...>
+Date: Tue, 16 Aug 2016 15:57:46 -0300
+Subject: [PATCH 518/531] [media] ov7670: fix g/s_parm
+
+Drop unnecesary memset. Drop the unnecessary extendedmode check and
+set the V4L2_CAP_TIMEPERFRAME capability.
+
+Signed-off-by: Hans Verkuil <han...@ci...>
+Acked-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 9af8d3b8f848..50e4466a2b37 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1046,7 +1046,6 @@ static int ov7670_g_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
+ if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+- memset(cp, 0, sizeof(struct v4l2_captureparm));
+ cp->capability = V4L2_CAP_TIMEPERFRAME;
+ info->devtype->get_framerate(sd, &cp->timeperframe);
+
+@@ -1061,9 +1060,8 @@ static int ov7670_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
+
+ if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+- if (cp->extendedmode != 0)
+- return -EINVAL;
+
++ cp->capability = V4L2_CAP_TIMEPERFRAME;
+ return info->devtype->set_framerate(sd, tpf);
+ }
+
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0519-media-ov7670-get-xclk.patch b/patches/linux/4.9.mx6_legacy/0519-media-ov7670-get-xclk.patch
new file mode 100644
index 000000000..e27a9fa80
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0519-media-ov7670-get-xclk.patch
@@ -0,0 +1,80 @@
+From 0a024d634cee94e9f3e3d16d90b049522845c238 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <han...@ci...>
+Date: Tue, 16 Aug 2016 16:00:57 -0300
+Subject: [PATCH 519/531] [media] ov7670: get xclk
+
+Get the clock for this sensor.
+
+Signed-off-by: Hans Verkuil <han...@ci...>
+Acked-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 50e4466a2b37..912ff09c6100 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -10,6 +10,7 @@
+ * This file may be distributed under the terms of the GNU General
+ * Public License, version 2.
+ */
++#include <linux/clk.h>
+ #include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/slab.h>
+@@ -227,6 +228,7 @@ struct ov7670_info {
+ struct v4l2_ctrl *hue;
+ };
+ struct ov7670_format_struct *fmt; /* Current format */
++ struct clk *clk;
+ int min_width; /* Filter out smaller sizes */
+ int min_height; /* Filter out smaller sizes */
+ int clock_speed; /* External clock speed (MHz) */
+@@ -1587,13 +1589,24 @@ static int ov7670_probe(struct i2c_client *client,
+ info->pclk_hb_disable = true;
+ }
+
++ info->clk = devm_clk_get(&client->dev, "xclk");
++ if (IS_ERR(info->clk))
++ return -EPROBE_DEFER;
++ clk_prepare_enable(info->clk);
++
++ info->clock_speed = clk_get_rate(info->clk) / 1000000;
++ if (info->clock_speed < 10 || info->clock_speed > 48) {
++ ret = -EINVAL;
++ goto clk_disable;
++ }
++
+ /* Make sure it's an ov7670 */
+ ret = ov7670_detect(sd);
+ if (ret) {
+ v4l_dbg(1, debug, client,
+ "chip found @ 0x%x (%s) is not an ov7670 chip.\n",
+ client->addr << 1, client->adapter->name);
+- return ret;
++ goto clk_disable;
+ }
+ v4l_info(client, "chip found @ 0x%02x (%s)\n",
+ client->addr << 1, client->adapter->name);
+@@ -1656,6 +1669,8 @@ static int ov7670_probe(struct i2c_client *client,
+
+ hdl_free:
+ v4l2_ctrl_handler_free(&info->hdl);
++clk_disable:
++ clk_disable_unprepare(info->clk);
+ return ret;
+ }
+
+@@ -1667,6 +1682,7 @@ static int ov7670_remove(struct i2c_client *client)
+
+ v4l2_device_unregister_subdev(sd);
+ v4l2_ctrl_handler_free(&info->hdl);
++ clk_disable_unprepare(info->clk);
+ return 0;
+ }
+
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0520-media-ov7670-add-devicetree-support.patch b/patches/linux/4.9.mx6_legacy/0520-media-ov7670-add-devicetree-support.patch
new file mode 100644
index 000000000..3e778bebd
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0520-media-ov7670-add-devicetree-support.patch
@@ -0,0 +1,108 @@
+From a0c4164e0ec04a0a0d947285a923864b405ce96b Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <han...@ci...>
+Date: Mon, 12 Dec 2016 12:08:18 -0200
+Subject: [PATCH 520/531] [media] ov7670: add devicetree support
+
+Add DT support. Use it to get the reset and pwdn pins (if there are any).
+Tested with one sensor requiring reset/pwdn and one sensor that doesn't
+have reset/pwdn pins.
+
+Signed-off-by: Hans Verkuil <han...@ci...>
+Acked-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 40 ++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 38 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 912ff09c6100..7270c68ed18a 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -17,6 +17,8 @@
+ #include <linux/i2c.h>
+ #include <linux/delay.h>
+ #include <linux/videodev2.h>
++#include <linux/gpio.h>
++#include <linux/gpio/consumer.h>
+ #include <media/v4l2-device.h>
+ #include <media/v4l2-ctrls.h>
+ #include <media/v4l2-mediabus.h>
+@@ -229,6 +231,8 @@ struct ov7670_info {
+ };
+ struct ov7670_format_struct *fmt; /* Current format */
+ struct clk *clk;
++ struct gpio_desc *resetb_gpio;
++ struct gpio_desc *pwdn_gpio;
+ int min_width; /* Filter out smaller sizes */
+ int min_height; /* Filter out smaller sizes */
+ int clock_speed; /* External clock speed (MHz) */
+@@ -591,8 +595,6 @@ static int ov7670_init(struct v4l2_subdev *sd, u32 val)
+ return ov7670_write_array(sd, ov7670_default_regs);
+ }
+
+-
+-
+ static int ov7670_detect(struct v4l2_subdev *sd)
+ {
+ unsigned char v;
+@@ -1549,6 +1551,27 @@ static const struct ov7670_devtype ov7670_devdata[] = {
+ },
+ };
+
++static int ov7670_init_gpio(struct i2c_client *client, struct ov7670_info *info)
++{
++ info->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
++ GPIOD_OUT_LOW);
++ if (IS_ERR(info->pwdn_gpio)) {
++ dev_info(&client->dev, "can't get %s GPIO\n", "powerdown");
++ return PTR_ERR(info->pwdn_gpio);
++ }
++
++ info->resetb_gpio = devm_gpiod_get_optional(&client->dev, "reset",
++ GPIOD_OUT_LOW);
++ if (IS_ERR(info->resetb_gpio)) {
++ dev_info(&client->dev, "can't get %s GPIO\n", "reset");
++ return PTR_ERR(info->resetb_gpio);
++ }
++
++ usleep_range(3000, 5000);
++
++ return 0;
++}
++
+ static int ov7670_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+ {
+@@ -1594,6 +1617,10 @@ static int ov7670_probe(struct i2c_client *client,
+ return -EPROBE_DEFER;
+ clk_prepare_enable(info->clk);
+
++ ret = ov7670_init_gpio(client, info);
++ if (ret)
++ goto clk_disable;
++
+ info->clock_speed = clk_get_rate(info->clk) / 1000000;
+ if (info->clock_speed < 10 || info->clock_speed > 48) {
+ ret = -EINVAL;
+@@ -1693,9 +1720,18 @@ static const struct i2c_device_id ov7670_id[] = {
+ };
+ MODULE_DEVICE_TABLE(i2c, ov7670_id);
+
++#if IS_ENABLED(CONFIG_OF)
++static const struct of_device_id ov7670_of_match[] = {
++ { .compatible = "ovti,ov7670", },
++ { /* sentinel */ },
++};
++MODULE_DEVICE_TABLE(of, ov7670_of_match);
++#endif
++
+ static struct i2c_driver ov7670_driver = {
+ .driver = {
+ .name = "ov7670",
++ .of_match_table = of_match_ptr(ov7670_of_match),
+ },
+ .probe = ov7670_probe,
+ .remove = ov7670_remove,
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0521-media-ov7670-Return-the-real-error-code.patch b/patches/linux/4.9.mx6_legacy/0521-media-ov7670-Return-the-real-error-code.patch
new file mode 100644
index 000000000..eedfafe43
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0521-media-ov7670-Return-the-real-error-code.patch
@@ -0,0 +1,31 @@
+From 011dfab80543019d01f66665734f50f5a4b26e6d Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <fab...@nx...>
+Date: Tue, 18 Jul 2017 23:34:18 -0400
+Subject: [PATCH 521/531] media: ov7670: Return the real error code
+
+When devm_clk_get() fails the real error code should be propagated,
+instead of always returning -EPROBE_DEFER.
+
+Signed-off-by: Fabio Estevam <fab...@nx...>
+Signed-off-by: Hans Verkuil <han...@ci...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 7270c68ed18a..552a881e24da 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1614,7 +1614,7 @@ static int ov7670_probe(struct i2c_client *client,
+
+ info->clk = devm_clk_get(&client->dev, "xclk");
+ if (IS_ERR(info->clk))
+- return -EPROBE_DEFER;
++ return PTR_ERR(info->clk);
+ clk_prepare_enable(info->clk);
+
+ ret = ov7670_init_gpio(client, info);
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0522-media-ov7670-Check-the-return-value-from-clk_prepare.patch b/patches/linux/4.9.mx6_legacy/0522-media-ov7670-Check-the-return-value-from-clk_prepare.patch
new file mode 100644
index 000000000..117f2be53
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0522-media-ov7670-Check-the-return-value-from-clk_prepare.patch
@@ -0,0 +1,34 @@
+From 1fc86ad052fc051639df1f60faeb619dbe567e07 Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <fab...@nx...>
+Date: Tue, 18 Jul 2017 23:34:19 -0400
+Subject: [PATCH 522/531] media: ov7670: Check the return value from
+ clk_prepare_enable()
+
+clk_prepare_enable() may fail, so we should better check its return value
+and propagate it in the case of error.
+
+Signed-off-by: Fabio Estevam <fab...@nx...>
+Signed-off-by: Hans Verkuil <han...@ci...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 552a881e24da..e88549f0e704 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1615,7 +1615,9 @@ static int ov7670_probe(struct i2c_client *client,
+ info->clk = devm_clk_get(&client->dev, "xclk");
+ if (IS_ERR(info->clk))
+ return PTR_ERR(info->clk);
+- clk_prepare_enable(info->clk);
++ ret = clk_prepare_enable(info->clk);
++ if (ret)
++ return ret;
+
+ ret = ov7670_init_gpio(client, info);
+ if (ret)
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0523-media-ov7670-Add-entity-pads-initialization.patch b/patches/linux/4.9.mx6_legacy/0523-media-ov7670-Add-entity-pads-initialization.patch
new file mode 100644
index 000000000..abb047a36
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0523-media-ov7670-Add-entity-pads-initialization.patch
@@ -0,0 +1,70 @@
+From d94a26f05b017d93513d176959c49996768f446f Mon Sep 17 00:00:00 2001
+From: Wenyou Yang <wen...@mi...>
+Date: Mon, 16 Oct 2017 05:14:25 +0200
+Subject: [PATCH 523/531] media: ov7670: Add entity pads initialization
+
+Add the media entity pads initialization.
+
+Signed-off-by: Wenyou Yang <wen...@mi...>
+Signed-off-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@os...>
+---
+ drivers/media/i2c/ov7670.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index e88549f0e704..553945d4ca28 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -213,6 +213,9 @@ struct ov7670_devtype {
+ struct ov7670_format_struct; /* coming later */
+ struct ov7670_info {
+ struct v4l2_subdev sd;
++#if defined(CONFIG_MEDIA_CONTROLLER)
++ struct media_pad pad;
++#endif
+ struct v4l2_ctrl_handler hdl;
+ struct {
+ /* gain cluster */
+@@ -1688,14 +1691,27 @@ static int ov7670_probe(struct i2c_client *client,
+ v4l2_ctrl_auto_cluster(2, &info->auto_exposure,
+ V4L2_EXPOSURE_MANUAL, false);
+ v4l2_ctrl_cluster(2, &info->saturation);
++
++#if defined(CONFIG_MEDIA_CONTROLLER)
++ info->pad.flags = MEDIA_PAD_FL_SOURCE;
++ info->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
++ ret = media_entity_pads_init(&info->sd.entity, 1, &info->pad);
++ if (ret < 0)
++ goto hdl_free;
++#endif
++
+ v4l2_ctrl_handler_setup(&info->hdl);
+
+ ret = v4l2_async_register_subdev(&info->sd);
+ if (ret < 0)
+- goto hdl_free;
++ goto entity_cleanup;
+
+ return 0;
+
++entity_cleanup:
++#if defined(CONFIG_MEDIA_CONTROLLER)
++ media_entity_cleanup(&info->sd.entity);
++#endif
+ hdl_free:
+ v4l2_ctrl_handler_free(&info->hdl);
+ clk_disable:
+@@ -1712,6 +1728,9 @@ static int ov7670_remove(struct i2c_client *client)
+ v4l2_device_unregister_subdev(sd);
+ v4l2_ctrl_handler_free(&info->hdl);
+ clk_disable_unprepare(info->clk);
++#if defined(CONFIG_MEDIA_CONTROLLER)
++ media_entity_cleanup(&info->sd.entity);
++#endif
+ return 0;
+ }
+
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0524-media-ov7670-Add-the-get_fmt-callback.patch b/patches/linux/4.9.mx6_legacy/0524-media-ov7670-Add-the-get_fmt-callback.patch
new file mode 100644
index 000000000..3cb8c8650
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0524-media-ov7670-Add-the-get_fmt-callback.patch
@@ -0,0 +1,170 @@
+From c0662dd4e7a407a5ac79cc6ca4d1116bf03d3731 Mon Sep 17 00:00:00 2001
+From: Wenyou Yang <wen...@mi...>
+Date: Mon, 16 Oct 2017 05:14:26 +0200
+Subject: [PATCH 524/531] media: ov7670: Add the get_fmt callback
+
+Add the get_fmt callback, also enable V4L2_SUBDEV_FL_HAS_DEVNODE flag
+to make this subdev has device node.
+
+Signed-off-by: Wenyou Yang <wen...@mi...>
+Signed-off-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@os...>
+---
+ drivers/media/i2c/ov7670.c | 77 +++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 76 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 553945d4ca28..73ceec63a8ca 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -232,6 +232,7 @@ struct ov7670_info {
+ struct v4l2_ctrl *saturation;
+ struct v4l2_ctrl *hue;
+ };
++ struct v4l2_mbus_framefmt format;
+ struct ov7670_format_struct *fmt; /* Current format */
+ struct clk *clk;
+ struct gpio_desc *resetb_gpio;
+@@ -975,6 +976,9 @@ static int ov7670_try_fmt_internal(struct v4l2_subdev *sd,
+ fmt->width = wsize->width;
+ fmt->height = wsize->height;
+ fmt->colorspace = ov7670_formats[index].colorspace;
++
++ info->format = *fmt;
++
+ return 0;
+ }
+
+@@ -988,6 +992,9 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd,
+ struct ov7670_format_struct *ovfmt;
+ struct ov7670_win_size *wsize;
+ struct ov7670_info *info = to_state(sd);
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++ struct v4l2_mbus_framefmt *mbus_fmt;
++#endif
+ unsigned char com7;
+ int ret;
+
+@@ -998,8 +1005,13 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd,
+ ret = ov7670_try_fmt_internal(sd, &format->format, NULL, NULL);
+ if (ret)
+ return ret;
+- cfg->try_fmt = format->format;
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++ mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
++ *mbus_fmt = format->format;
+ return 0;
++#else
++ return -ENOTTY;
++#endif
+ }
+
+ ret = ov7670_try_fmt_internal(sd, &format->format, &ovfmt, &wsize);
+@@ -1041,6 +1053,30 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd,
+ return 0;
+ }
+
++static int ov7670_get_fmt(struct v4l2_subdev *sd,
++ struct v4l2_subdev_pad_config *cfg,
++ struct v4l2_subdev_format *format)
++{
++ struct ov7670_info *info = to_state(sd);
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++ struct v4l2_mbus_framefmt *mbus_fmt;
++#endif
++
++ if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++ mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, 0);
++ format->format = *mbus_fmt;
++ return 0;
++#else
++ return -ENOTTY;
++#endif
++ } else {
++ format->format = info->format;
++ }
++
++ return 0;
++}
++
+ /*
+ * Implement G/S_PARM. There is a "high quality" mode we could try
+ * to do someday; for now, we just do the frame rate tweak.
+@@ -1508,6 +1544,30 @@ static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis
+ }
+ #endif
+
++static void ov7670_get_default_format(struct v4l2_subdev *sd,
++ struct v4l2_mbus_framefmt *format)
++{
++ struct ov7670_info *info = to_state(sd);
++
++ format->width = info->devtype->win_sizes[0].width;
++ format->height = info->devtype->win_sizes[0].height;
++ format->colorspace = info->fmt->colorspace;
++ format->code = info->fmt->mbus_code;
++ format->field = V4L2_FIELD_NONE;
++}
++
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++static int ov7670_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
++{
++ struct v4l2_mbus_framefmt *format =
++ v4l2_subdev_get_try_format(sd, fh->pad, 0);
++
++ ov7670_get_default_format(sd, format);
++
++ return 0;
++}
++#endif
++
+ /* ----------------------------------------------------------------------- */
+
+ static const struct v4l2_subdev_core_ops ov7670_core_ops = {
+@@ -1528,6 +1588,7 @@ static const struct v4l2_subdev_pad_ops ov7670_pad_ops = {
+ .enum_frame_interval = ov7670_enum_frame_interval,
+ .enum_frame_size = ov7670_enum_frame_size,
+ .enum_mbus_code = ov7670_enum_mbus_code,
++ .get_fmt = ov7670_get_fmt,
+ .set_fmt = ov7670_set_fmt,
+ };
+
+@@ -1537,6 +1598,12 @@ static const struct v4l2_subdev_ops ov7670_ops = {
+ .pad = &ov7670_pad_ops,
+ };
+
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++static const struct v4l2_subdev_internal_ops ov7670_subdev_internal_ops = {
++ .open = ov7670_open,
++};
++#endif
++
+ /* ----------------------------------------------------------------------- */
+
+ static const struct ov7670_devtype ov7670_devdata[] = {
+@@ -1589,6 +1656,11 @@ static int ov7670_probe(struct i2c_client *client,
+ sd = &info->sd;
+ v4l2_i2c_subdev_init(sd, client, &ov7670_ops);
+
++#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
++ sd->internal_ops = &ov7670_subdev_internal_ops;
++ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
++#endif
++
+ info->clock_speed = 30; /* default: a guess */
+ if (client->dev.platform_data) {
+ struct ov7670_config *config = client->dev.platform_data;
+@@ -1645,6 +1717,9 @@ static int ov7670_probe(struct i2c_client *client,
+
+ info->devtype = &ov7670_devdata[id->driver_data];
+ info->fmt = &ov7670_formats[0];
++
++ ov7670_get_default_format(sd, &info->format);
++
+ info->clkrc = 0;
+
+ /* Set default frame rate to 30 fps */
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0525-media-ov7670-Add-the-ov7670_s_power-function.patch b/patches/linux/4.9.mx6_legacy/0525-media-ov7670-Add-the-ov7670_s_power-function.patch
new file mode 100644
index 000000000..024533bcd
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0525-media-ov7670-Add-the-ov7670_s_power-function.patch
@@ -0,0 +1,95 @@
+From 71862f63f351078560a7ce35c6c2e2ca16750374 Mon Sep 17 00:00:00 2001
+From: Wenyou Yang <wen...@mi...>
+Date: Mon, 16 Oct 2017 05:14:27 +0200
+Subject: [PATCH 525/531] media: ov7670: Add the ov7670_s_power function
+
+Add the ov7670_s_power function which is responsible for
+manipulating the power dowm mode through the PWDN pin and the reset
+operation through the RESET pin, and keep it powered at all times.
+
+[sak...@li...: set pwdn_gpio direction only once]
+Signed-off-by: Wenyou Yang <wen...@mi...>
+Signed-off-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@os...>
+---
+ drivers/media/i2c/ov7670.c | 31 ++++++++++++++++++++++++++-----
+ 1 file changed, 26 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 73ceec63a8ca..950a0acf85fb 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1544,6 +1544,22 @@ static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis
+ }
+ #endif
+
++static int ov7670_s_power(struct v4l2_subdev *sd, int on)
++{
++ struct ov7670_info *info = to_state(sd);
++
++ if (info->pwdn_gpio)
++ gpiod_set_value(info->pwdn_gpio, !on);
++ if (on && info->resetb_gpio) {
++ gpiod_set_value(info->resetb_gpio, 1);
++ usleep_range(500, 1000);
++ gpiod_set_value(info->resetb_gpio, 0);
++ usleep_range(3000, 5000);
++ }
++
++ return 0;
++}
++
+ static void ov7670_get_default_format(struct v4l2_subdev *sd,
+ struct v4l2_mbus_framefmt *format)
+ {
+@@ -1694,23 +1710,25 @@ static int ov7670_probe(struct i2c_client *client,
+ if (ret)
+ return ret;
+
+- ret = ov7670_init_gpio(client, info);
+- if (ret)
+- goto clk_disable;
+-
+ info->clock_speed = clk_get_rate(info->clk) / 1000000;
+ if (info->clock_speed < 10 || info->clock_speed > 48) {
+ ret = -EINVAL;
+ goto clk_disable;
+ }
+
++ ret = ov7670_init_gpio(client, info);
++ if (ret)
++ goto clk_disable;
++
++ ov7670_s_power(sd, 1);
++
+ /* Make sure it's an ov7670 */
+ ret = ov7670_detect(sd);
+ if (ret) {
+ v4l_dbg(1, debug, client,
+ "chip found @ 0x%x (%s) is not an ov7670 chip.\n",
+ client->addr << 1, client->adapter->name);
+- goto clk_disable;
++ goto power_off;
+ }
+ v4l_info(client, "chip found @ 0x%02x (%s)\n",
+ client->addr << 1, client->adapter->name);
+@@ -1789,6 +1807,8 @@ static int ov7670_probe(struct i2c_client *client,
+ #endif
+ hdl_free:
+ v4l2_ctrl_handler_free(&info->hdl);
++power_off:
++ ov7670_s_power(sd, 0);
+ clk_disable:
+ clk_disable_unprepare(info->clk);
+ return ret;
+@@ -1806,6 +1826,7 @@ static int ov7670_remove(struct i2c_client *client)
+ #if defined(CONFIG_MEDIA_CONTROLLER)
+ media_entity_cleanup(&info->sd.entity);
+ #endif
++ ov7670_s_power(sd, 0);
+ return 0;
+ }
+
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0526-media-ov7670-use-v4l2_async_unregister_subdev.patch b/patches/linux/4.9.mx6_legacy/0526-media-ov7670-use-v4l2_async_unregister_subdev.patch
new file mode 100644
index 000000000..0a3dfd46d
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0526-media-ov7670-use-v4l2_async_unregister_subdev.patch
@@ -0,0 +1,34 @@
+From 344aa836e813a6b097c23f2e0633dd17f62c2ed7 Mon Sep 17 00:00:00 2001
+From: Akinobu Mita <aki...@gm...>
+Date: Fri, 24 Nov 2017 09:40:44 -0500
+Subject: [PATCH 526/531] media: ov7670: use v4l2_async_unregister_subdev()
+
+The sub-device for ov7670 is registered by v4l2_async_register_subdev().
+So it should be unregistered by v4l2_async_unregister_subdev() instead of
+v4l2_device_unregister_subdev().
+
+Cc: Jonathan Corbet <co...@lw...>
+Signed-off-by: Akinobu Mita <aki...@gm...>
+Reviewed-by: Kieran Bingham <kie...@id...>
+Signed-off-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 950a0acf85fb..b61d88e7f3eb 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1820,7 +1820,7 @@ static int ov7670_remove(struct i2c_client *client)
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct ov7670_info *info = to_state(sd);
+
+- v4l2_device_unregister_subdev(sd);
++ v4l2_async_unregister_subdev(sd);
+ v4l2_ctrl_handler_free(&info->hdl);
+ clk_disable_unprepare(info->clk);
+ #if defined(CONFIG_MEDIA_CONTROLLER)
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0527-media-ov7670-add-V4L2_CID_TEST_PATTERN-control.patch b/patches/linux/4.9.mx6_legacy/0527-media-ov7670-add-V4L2_CID_TEST_PATTERN-control.patch
new file mode 100644
index 000000000..204accee0
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0527-media-ov7670-add-V4L2_CID_TEST_PATTERN-control.patch
@@ -0,0 +1,111 @@
+From b48d908d2b04e5c11bf0f9035bf52f7c0c988603 Mon Sep 17 00:00:00 2001
+From: Akinobu Mita <aki...@gm...>
+Date: Fri, 24 Nov 2017 09:40:45 -0500
+Subject: [PATCH 527/531] media: ov7670: add V4L2_CID_TEST_PATTERN control
+
+The ov7670 has the test pattern generator features. This makes use of
+it through V4L2_CID_TEST_PATTERN control.
+
+Cc: Jonathan Corbet <co...@lw...>
+Signed-off-by: Akinobu Mita <aki...@gm...>
+Signed-off-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 45 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index b61d88e7f3eb..c6c32f649777 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -163,6 +163,11 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
+ #define DBLV_X6 0x10 /* clock x6 */
+ #define DBLV_X8 0x11 /* clock x8 */
+
++#define REG_SCALING_XSC 0x70 /* Test pattern and horizontal scale factor */
++#define TEST_PATTTERN_0 0x80
++#define REG_SCALING_YSC 0x71 /* Test pattern and vertical scale factor */
++#define TEST_PATTTERN_1 0x80
++
+ #define REG_REG76 0x76 /* OV's name */
+ #define R76_BLKPCOR 0x80 /* Black pixel correction enable */
+ #define R76_WHTPCOR 0x40 /* White pixel correction enable */
+@@ -292,7 +297,8 @@ static struct regval_list ov7670_default_regs[] = {
+
+ { REG_COM3, 0 }, { REG_COM14, 0 },
+ /* Mystery scaling numbers */
+- { 0x70, 0x3a }, { 0x71, 0x35 },
++ { REG_SCALING_XSC, 0x3a },
++ { REG_SCALING_YSC, 0x35 },
+ { 0x72, 0x11 }, { 0x73, 0xf0 },
+ { 0xa2, 0x02 }, { REG_COM10, 0x0 },
+
+@@ -568,6 +574,19 @@ static int ov7670_write(struct v4l2_subdev *sd, unsigned char reg,
+ return ov7670_write_i2c(sd, reg, value);
+ }
+
++static int ov7670_update_bits(struct v4l2_subdev *sd, unsigned char reg,
++ unsigned char mask, unsigned char value)
++{
++ unsigned char orig;
++ int ret;
++
++ ret = ov7670_read(sd, reg, &orig);
++ if (ret)
++ return ret;
++
++ return ov7670_write(sd, reg, (orig & ~mask) | (value & mask));
++}
++
+ /*
+ * Write a list of register settings; ff/ff stops the process.
+ */
+@@ -1470,6 +1489,25 @@ static int ov7670_s_autoexp(struct v4l2_subdev *sd,
+ return ret;
+ }
+
++static const char * const ov7670_test_pattern_menu[] = {
++ "No test output",
++ "Shifting \"1\"",
++ "8-bar color bar",
++ "Fade to gray color bar",
++};
++
++static int ov7670_s_test_pattern(struct v4l2_subdev *sd, int value)
++{
++ int ret;
++
++ ret = ov7670_update_bits(sd, REG_SCALING_XSC, TEST_PATTTERN_0,
++ value & BIT(0) ? TEST_PATTTERN_0 : 0);
++ if (ret)
++ return ret;
++
++ return ov7670_update_bits(sd, REG_SCALING_YSC, TEST_PATTTERN_1,
++ value & BIT(1) ? TEST_PATTTERN_1 : 0);
++}
+
+ static int ov7670_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
+ {
+@@ -1516,6 +1554,8 @@ static int ov7670_s_ctrl(struct v4l2_ctrl *ctrl)
+ return ov7670_s_exp(sd, info->exposure->val);
+ }
+ return ov7670_s_autoexp(sd, ctrl->val);
++ case V4L2_CID_TEST_PATTERN:
++ return ov7670_s_test_pattern(sd, ctrl->val);
+ }
+ return -EINVAL;
+ }
+@@ -1770,6 +1810,10 @@ static int ov7670_probe(struct i2c_client *client,
+ info->auto_exposure = v4l2_ctrl_new_std_menu(&info->hdl, &ov7670_ctrl_ops,
+ V4L2_CID_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL, 0,
+ V4L2_EXPOSURE_AUTO);
++ v4l2_ctrl_new_std_menu_items(&info->hdl, &ov7670_ctrl_ops,
++ V4L2_CID_TEST_PATTERN,
++ ARRAY_SIZE(ov7670_test_pattern_menu) - 1, 0, 0,
++ ov7670_test_pattern_menu);
+ sd->ctrl_handler = &info->hdl;
+ if (info->hdl.error) {
+ ret = info->hdl.error;
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0528-media-replace-all-spaces-tab-occurrences.patch b/patches/linux/4.9.mx6_legacy/0528-media-replace-all-spaces-tab-occurrences.patch
new file mode 100644
index 000000000..6aa7fe6e6
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0528-media-replace-all-spaces-tab-occurrences.patch
@@ -0,0 +1,96 @@
+From 6e6a8b5a38cb04d5ef35d4eb57836126b954e7c8 Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mc...@s-...>
+Date: Thu, 4 Jan 2018 13:08:56 -0500
+Subject: [PATCH 528/531] media: replace all <spaces><tab> occurrences
+
+There are a lot of places where sequences of space/tabs are
+found. Get rid of all spaces before tabs.
+
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 38 +++++++++++++++++++-------------------
+ 1 file changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index c6c32f649777..fd229bc8a0e5 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -412,12 +412,12 @@ static struct regval_list ov7670_fmt_yuv422[] = {
+ { REG_COM1, 0 }, /* CCIR601 */
+ { REG_COM15, COM15_R00FF },
+ { REG_COM9, 0x48 }, /* 32x gain ceiling; 0x8 is reserved bit */
+- { 0x4f, 0x80 }, /* "matrix coefficient 1" */
+- { 0x50, 0x80 }, /* "matrix coefficient 2" */
++ { 0x4f, 0x80 }, /* "matrix coefficient 1" */
++ { 0x50, 0x80 }, /* "matrix coefficient 2" */
+ { 0x51, 0 }, /* vb */
+- { 0x52, 0x22 }, /* "matrix coefficient 4" */
+- { 0x53, 0x5e }, /* "matrix coefficient 5" */
+- { 0x54, 0x80 }, /* "matrix coefficient 6" */
++ { 0x52, 0x22 }, /* "matrix coefficient 4" */
++ { 0x53, 0x5e }, /* "matrix coefficient 5" */
++ { 0x54, 0x80 }, /* "matrix coefficient 6" */
+ { REG_COM13, COM13_GAMMA|COM13_UVSAT },
+ { 0xff, 0xff },
+ };
+@@ -427,13 +427,13 @@ static struct regval_list ov7670_fmt_rgb565[] = {
+ { REG_RGB444, 0 }, /* No RGB444 please */
+ { REG_COM1, 0x0 }, /* CCIR601 */
+ { REG_COM15, COM15_RGB565 },
+- { REG_COM9, 0x38 }, /* 16x gain ceiling; 0x8 is reserved bit */
+- { 0x4f, 0xb3 }, /* "matrix coefficient 1" */
+- { 0x50, 0xb3 }, /* "matrix coefficient 2" */
++ { REG_COM9, 0x38 }, /* 16x gain ceiling; 0x8 is reserved bit */
++ { 0x4f, 0xb3 }, /* "matrix coefficient 1" */
++ { 0x50, 0xb3 }, /* "matrix coefficient 2" */
+ { 0x51, 0 }, /* vb */
+- { 0x52, 0x3d }, /* "matrix coefficient 4" */
+- { 0x53, 0xa7 }, /* "matrix coefficient 5" */
+- { 0x54, 0xe4 }, /* "matrix coefficient 6" */
++ { 0x52, 0x3d }, /* "matrix coefficient 4" */
++ { 0x53, 0xa7 }, /* "matrix coefficient 5" */
++ { 0x54, 0xe4 }, /* "matrix coefficient 6" */
+ { REG_COM13, COM13_GAMMA|COM13_UVSAT },
+ { 0xff, 0xff },
+ };
+@@ -443,13 +443,13 @@ static struct regval_list ov7670_fmt_rgb444[] = {
+ { REG_RGB444, R444_ENABLE }, /* Enable xxxxrrrr ggggbbbb */
+ { REG_COM1, 0x0 }, /* CCIR601 */
+ { REG_COM15, COM15_R01FE|COM15_RGB565 }, /* Data range needed? */
+- { REG_COM9, 0x38 }, /* 16x gain ceiling; 0x8 is reserved bit */
+- { 0x4f, 0xb3 }, /* "matrix coefficient 1" */
+- { 0x50, 0xb3 }, /* "matrix coefficient 2" */
++ { REG_COM9, 0x38 }, /* 16x gain ceiling; 0x8 is reserved bit */
++ { 0x4f, 0xb3 }, /* "matrix coefficient 1" */
++ { 0x50, 0xb3 }, /* "matrix coefficient 2" */
+ { 0x51, 0 }, /* vb */
+- { 0x52, 0x3d }, /* "matrix coefficient 4" */
+- { 0x53, 0xa7 }, /* "matrix coefficient 5" */
+- { 0x54, 0xe4 }, /* "matrix coefficient 6" */
++ { 0x52, 0x3d }, /* "matrix coefficient 4" */
++ { 0x53, 0xa7 }, /* "matrix coefficient 5" */
++ { 0x54, 0xe4 }, /* "matrix coefficient 6" */
+ { REG_COM13, COM13_GAMMA|COM13_UVSAT|0x2 }, /* Magic rsvd bit */
+ { 0xff, 0xff },
+ };
+@@ -667,7 +667,7 @@ static struct ov7670_format_struct {
+ {
+ .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+- .regs = ov7670_fmt_yuv422,
++ .regs = ov7670_fmt_yuv422,
+ .cmatrix = { 128, -128, 0, -34, -94, 128 },
+ },
+ {
+@@ -685,7 +685,7 @@ static struct ov7670_format_struct {
+ {
+ .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+- .regs = ov7670_fmt_raw,
++ .regs = ov7670_fmt_raw,
+ .cmatrix = { 0, 0, 0, 0, 0, 0 },
+ },
+ };
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0529-media-entity-Add-a-nop-variant-of-media_entity_clean.patch b/patches/linux/4.9.mx6_legacy/0529-media-entity-Add-a-nop-variant-of-media_entity_clean.patch
new file mode 100644
index 000000000..335a92c6f
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0529-media-entity-Add-a-nop-variant-of-media_entity_clean.patch
@@ -0,0 +1,63 @@
+From 3580112b6d6f51725ba605c146db14af61e87628 Mon Sep 17 00:00:00 2001
+From: Sakari Ailus <sak...@li...>
+Date: Tue, 9 Jan 2018 05:20:34 -0500
+Subject: [PATCH] media: entity: Add a nop variant of media_entity_cleanup
+
+Add nop variant of media_entity_cleanup. This allows calling
+media_entity_cleanup whether or not Media controller is enabled,
+simplifying driver code.
+
+Also drop #ifdefs on a few drivers around media_entity_cleanup().
+
+Signed-off-by: Sakari Ailus <sak...@li...>
+Reviewed-by: Arnd Bergmann <ar...@ar...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 4 ----
+ include/media/media-entity.h | 6 +++++-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index fd229bc8a0e5..28571de1c2f6 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1846,9 +1846,7 @@ static int ov7670_probe(struct i2c_client *client,
+ return 0;
+
+ entity_cleanup:
+-#if defined(CONFIG_MEDIA_CONTROLLER)
+ media_entity_cleanup(&info->sd.entity);
+-#endif
+ hdl_free:
+ v4l2_ctrl_handler_free(&info->hdl);
+ power_off:
+@@ -1867,9 +1865,7 @@ static int ov7670_remove(struct i2c_client *client)
+ v4l2_async_unregister_subdev(sd);
+ v4l2_ctrl_handler_free(&info->hdl);
+ clk_disable_unprepare(info->clk);
+-#if defined(CONFIG_MEDIA_CONTROLLER)
+ media_entity_cleanup(&info->sd.entity);
+-#endif
+ ov7670_s_power(sd, 0);
+ return 0;
+ }
+diff --git a/include/media/media-entity.h b/include/media/media-entity.h
+index d7a669058b5e..a732af1dbba0 100644
+--- a/include/media/media-entity.h
++++ b/include/media/media-entity.h
+@@ -634,7 +634,11 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
+ * This function must be called during the cleanup phase after unregistering
+ * the entity (currently, it does nothing).
+ */
+-static inline void media_entity_cleanup(struct media_entity *entity) {};
++#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
++static inline void media_entity_cleanup(struct media_entity *entity) {}
++#else
++#define media_entity_cleanup(entity) do { } while (false)
++#endif
+
+ /**
+ * media_create_pad_link() - creates a link between two entities.
+--
+2.16.1
+
diff --git a/patches/linux/4.9.mx6_legacy/0530-media-convert-g-s_parm-to-g-s_frame_interval-in-subd.patch b/patches/linux/4.9.mx6_legacy/0530-media-convert-g-s_parm-to-g-s_frame_interval-in-subd.patch
new file mode 100644
index 000000000..d18b744f1
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0530-media-convert-g-s_parm-to-g-s_frame_interval-in-subd.patch
@@ -0,0 +1,72 @@
+From 4471109e3894f500079d21fea4bc4d58bbdc4045 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <han...@ci...>
+Date: Mon, 22 Jan 2018 04:00:45 -0500
+Subject: [PATCH 530/531] media: convert g/s_parm to g/s_frame_interval in
+ subdevs
+
+Convert all g/s_parm calls to g/s_frame_interval. This allows us
+to remove the g/s_parm ops since those are a duplicate of
+g/s_frame_interval.
+
+Signed-off-by: Hans Verkuil <han...@ci...>
+Acked-by: Sakari Ailus <sak...@li...>
+Signed-off-by: Mauro Carvalho Chehab <mc...@s-...>
+---
+ drivers/media/i2c/ov7670.c | 22 ++++++++--------------
+ 1 file changed, 8 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
+index 28571de1c2f6..31b0c33cfc5b 100644
+--- a/drivers/media/i2c/ov7670.c
++++ b/drivers/media/i2c/ov7670.c
+@@ -1100,30 +1100,24 @@ static int ov7670_get_fmt(struct v4l2_subdev *sd,
+ * Implement G/S_PARM. There is a "high quality" mode we could try
+ * to do someday; for now, we just do the frame rate tweak.
+ */
+-static int ov7670_g_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
++static int ov7670_g_frame_interval(struct v4l2_subdev *sd,
++ struct v4l2_subdev_frame_interval *ival)
+ {
+- struct v4l2_captureparm *cp = &parms->parm.capture;
+ struct ov7670_info *info = to_state(sd);
+
+- if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+- return -EINVAL;
+
+- cp->capability = V4L2_CAP_TIMEPERFRAME;
+- info->devtype->get_framerate(sd, &cp->timeperframe);
++ info->devtype->get_framerate(sd, &ival->interval);
+
+ return 0;
+ }
+
+-static int ov7670_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *parms)
++static int ov7670_s_frame_interval(struct v4l2_subdev *sd,
++ struct v4l2_subdev_frame_interval *ival)
+ {
+- struct v4l2_captureparm *cp = &parms->parm.capture;
+- struct v4l2_fract *tpf = &cp->timeperframe;
++ struct v4l2_fract *tpf = &ival->interval;
+ struct ov7670_info *info = to_state(sd);
+
+- if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+- return -EINVAL;
+
+- cp->capability = V4L2_CAP_TIMEPERFRAME;
+ return info->devtype->set_framerate(sd, tpf);
+ }
+
+@@ -1636,8 +1630,8 @@ static const struct v4l2_subdev_core_ops ov7670_core_ops = {
+ };
+
+ static const struct v4l2_subdev_video_ops ov7670_video_ops = {
+- .s_parm = ov7670_s_parm,
+- .g_parm = ov7670_g_parm,
++ .s_frame_interval = ov7670_s_frame_interval,
++ .g_frame_interval = ov7670_g_frame_interval,
+ };
+
+ static const struct v4l2_subdev_pad_ops ov7670_pad_ops = {
+--
+2.16.1
+
diff --git a/patches/linux/4.1.mx6_legacy/0700-armadeus-pcie_clk_defined_in_uboot.patch b/patches/linux/4.9.mx6_legacy/0700-armadeus-pcie_clk_defined_in_uboot.patch
similarity index 72%
copy from patches/linux/4.1.mx6_legacy/0700-armadeus-pcie_clk_defined_in_uboot.patch
copy to patches/linux/4.9.mx6_legacy/0700-armadeus-pcie_clk_defined_in_uboot.patch
index d6f0477be..62def284b 100644
--- a/patches/linux/4.1.mx6_legacy/0700-armadeus-pcie_clk_defined_in_uboot.patch
+++ b/patches/linux/4.9.mx6_legacy/0700-armadeus-pcie_clk_defined_in_uboot.patch
@@ -6,15 +6,15 @@ Signed-off-by: Fabien Marteau <fab...@ar...>
Signed-off-by: Sébastien Szymanski <seb...@ar...>
---
-Index: linux-imx_4.1.15_2.0.0_ga/arch/arm/mach-imx/clk-imx6q.c
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/clk/imx/clk-imx6q.c
===================================================================
---- linux-imx_4.1.15_2.0.0_ga.orig/arch/arm/mach-imx/clk-imx6q.c
-+++ linux-imx_4.1.15_2.0.0_ga/arch/arm/mach-imx/clk-imx6q.c
-@@ -870,7 +870,12 @@ static void __init imx6q_clocks_init(str
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/clk/imx/clk-imx6q.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/clk/imx/clk-imx6q.c
+@@ -1020,7 +1020,12 @@ static void __init imx6q_clocks_init(str
/* All existing boards with PCIe use LVDS1 */
if (IS_ENABLED(CONFIG_PCI_IMX6)) {
-- imx_clk_set_parent(clk[IMX6QDL_CLK_LVDS1_SEL], clk[IMX6QDL_CLK_SATA_REF_100M]);
+- clk_set_parent(clk[IMX6QDL_CLK_LVDS1_SEL], clk[IMX6QDL_CLK_SATA_REF_100M]);
+ if (of_machine_is_compatible("armadeus,imx6dl-apf6") ||
+ of_machine_is_compatible("armadeus,imx6q-apf6"))
+ clk_prepare_enable(clk[IMX6QDL_CLK_SATA_REF_100M]);
diff --git a/patch...
[truncated message content] |