[Armadeus-commitlog] armadeus branch, master, updated. armadeus-7.0-26-g3a2b6d82d
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2018-11-26 12:55:40
|
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 3a2b6d82d82fc8813f5a834f5b347d416d1e306c (commit)
via 9f3a7f748842af2267f6157fb513e943139e9d65 (commit)
via 8aaa53a5be787b725488ad1701c5ff54cd04b4d1 (commit)
via 9be28a39a8b6187eb073c34c98afa670917fab77 (commit)
via e64864a4a0b99ddd03bd4d4d26a18d706e5ceb7e (commit)
from cc4588d242c31c3d60936a2fbb783ace634b326a (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 3a2b6d82d82fc8813f5a834f5b347d416d1e306c
Author: Sébastien Szymanski <seb...@ar...>
Date: Mon Nov 26 12:07:10 2018 +0100
[LINUX] 4.9.legacy: imx6ull: add SAI alias and cells
commit 9f3a7f748842af2267f6157fb513e943139e9d65
Author: Sébastien Szymanski <seb...@ar...>
Date: Mon Nov 26 12:06:22 2018 +0100
[LINUX] 4.9.legacy: csi: add two fixes
commit 8aaa53a5be787b725488ad1701c5ff54cd04b4d1
Author: Sébastien Szymanski <seb...@ar...>
Date: Mon Nov 26 12:03:38 2018 +0100
[LINUX] 4.9.legacy: csi: backport some patches
commit 9be28a39a8b6187eb073c34c98afa670917fab77
Author: Sébastien Szymanski <seb...@ar...>
Date: Mon Nov 26 11:41:56 2018 +0100
[LINUX] 4.9.legacy: ASoC: cs4265: backport fix
commit e64864a4a0b99ddd03bd4d4d26a18d706e5ceb7e
Author: Sébastien Szymanski <seb...@ar...>
Date: Mon Nov 26 11:38:39 2018 +0100
[LINUX] 4.9.legacy: adv7180: backport some patches
-----------------------------------------------------------------------
Summary of changes:
...adv7180-don-t-clear-V4L2_SUBDEV_FL_IS_I2C.patch | 41 +++++++
...v7180-tvp514x-tvp7002-fix-entity-function.patch | 60 +++++++++++
...80-fix-field-type-to-V4L2_FIELD_ALTERNATE.patch | 67 ++++++++++++
...edia-adv7180-add-g_frame_interval-support.patch | 57 ++++++++++
...-media-v4l2-csi-refine-the-mipi-mode-chec.patch | 101 ++++++++++++++++++
...-media-v4l2-capture-add-handler-for-two-8.patch | 63 +++++++++++
...58-media-csi-fix-spurious-warning-message.patch | 58 ++++++++++
...edia-v4l2-Add-VIDIOC_EXPBUF-ioctl-for-DMA.patch | 46 ++++++++
...edia-csi-Fix-Hresponse-and-Rx-fifo-overfl.patch | 118 +++++++++++++++++++++
...edia-csi-fix-corrupted-image-issue-when-r.patch | 90 ++++++++++++++++
...ASoC-cs4265-fix-MMTLR-Data-switch-control.patch | 13 +--
...mx6s_caputre-add-subdev-complete-callback.patch | 6 +-
...media-mx6s_capture-check-format-by-return.patch | 40 +++++++
...6s_capture-fix-vidioc_enum_input-callback.patch | 19 ++++
...-armadeus-imx6ull-add-sai-alias-and-cells.patch | 38 +++++++
15 files changed, 806 insertions(+), 11 deletions(-)
create mode 100644 patches/linux/4.9.mx6_legacy/0531-media-adv7180-don-t-clear-V4L2_SUBDEV_FL_IS_I2C.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0532-media-adv7180-tvp514x-tvp7002-fix-entity-function.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0533-media-adv7180-fix-field-type-to-V4L2_FIELD_ALTERNATE.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0534-media-adv7180-add-g_frame_interval-support.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0535-MLK-16919-2-media-v4l2-csi-refine-the-mipi-mode-chec.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0536-MLK-16919-7-media-v4l2-capture-add-handler-for-two-8.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0537-MLK-17058-media-csi-fix-spurious-warning-message.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0538-MLK-18095-media-v4l2-Add-VIDIOC_EXPBUF-ioctl-for-DMA.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0539-MLK-19362-media-csi-Fix-Hresponse-and-Rx-fifo-overfl.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0540-MLK-19913-media-csi-fix-corrupted-image-issue-when-r.patch
copy patches/linux/{4.17 => 4.9.mx6_legacy}/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch (76%)
create mode 100644 patches/linux/4.9.mx6_legacy/0810-armadeus-media-mx6s_capture-check-format-by-return.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0811-armadeus-media-mx6s_capture-fix-vidioc_enum_input-callback.patch
create mode 100644 patches/linux/4.9.mx6_legacy/0813-armadeus-imx6ull-add-sai-alias-and-cells.patch
diff --git a/patches/linux/4.9.mx6_legacy/0531-media-adv7180-don-t-clear-V4L2_SUBDEV_FL_IS_I2C.patch b/patches/linux/4.9.mx6_legacy/0531-media-adv7180-don-t-clear-V4L2_SUBDEV_FL_IS_I2C.patch
new file mode 100644
index 000000000..cbf3cba52
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0531-media-adv7180-don-t-clear-V4L2_SUBDEV_FL_IS_I2C.patch
@@ -0,0 +1,41 @@
+From 5cc72c472654c493c461898d892e87cde97994be Mon Sep 17 00:00:00 2001
+From: Akinobu Mita <aki...@gm...>
+Date: Thu, 19 Oct 2017 12:31:20 -0400
+Subject: [PATCH] media: adv7180: don't clear V4L2_SUBDEV_FL_IS_I2C
+
+The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the
+subdev->flags. But this driver overwrites subdev->flags immediately after
+calling v4l2_i2c_subdev_init(). So V4L2_SUBDEV_FL_IS_I2C is not set after
+all.
+
+This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C.
+
+Side note: According to the comment in v4l2_device_unregister(), this is
+problematic only if the device is platform bus device. Device tree or
+ACPI based devices are not affected.
+
+Cc: Lars-Peter Clausen <la...@me...>
+Cc: Mauro Carvalho Chehab <mc...@s-...>
+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/adv7180.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
+index 3df28f2f9b38..6fb818a775db 100644
+--- a/drivers/media/i2c/adv7180.c
++++ b/drivers/media/i2c/adv7180.c
+@@ -1328,7 +1328,7 @@ static int adv7180_probe(struct i2c_client *client,
+ state->input = 0;
+ sd = &state->sd;
+ v4l2_i2c_subdev_init(sd, client, &adv7180_ops);
+- sd->flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
++ sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
+
+ ret = adv7180_init_controls(state);
+ if (ret)
+--
+2.16.4
+
diff --git a/patches/linux/4.9.mx6_legacy/0532-media-adv7180-tvp514x-tvp7002-fix-entity-function.patch b/patches/linux/4.9.mx6_legacy/0532-media-adv7180-tvp514x-tvp7002-fix-entity-function.patch
new file mode 100644
index 000000000..07d10e09a
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0532-media-adv7180-tvp514x-tvp7002-fix-entity-function.patch
@@ -0,0 +1,60 @@
+From ca0fa5f04f33eea010fc1f9dfc87ff58f3a2433f Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <han...@ci...>
+Date: Mon, 18 Jun 2018 05:09:45 -0400
+Subject: [PATCH] media: adv7180/tvp514x/tvp7002: fix entity function
+
+The entity function was ORed with the flags field instead of
+assigned to the function field. Correct this.
+
+Signed-off-by: Hans Verkuil <han...@ci...>
+Acked-by: Sakari Ailus <sak...@li...>
+Reviewed-by: Laurent Pinchart <lau...@id...>
+Signed-off-by: Mauro Carvalho Chehab <mch...@ke...>
+---
+ drivers/media/i2c/adv7180.c | 2 +-
+ drivers/media/i2c/tvp514x.c | 2 +-
+ drivers/media/i2c/tvp7002.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
+index 25d24a3f10a7..a727d7f806a1 100644
+--- a/drivers/media/i2c/adv7180.c
++++ b/drivers/media/i2c/adv7180.c
+@@ -1335,7 +1335,7 @@ static int adv7180_probe(struct i2c_client *client,
+ goto err_unregister_vpp_client;
+
+ state->pad.flags = MEDIA_PAD_FL_SOURCE;
+- sd->entity.flags |= MEDIA_ENT_F_ATV_DECODER;
++ sd->entity.function = MEDIA_ENT_F_ATV_DECODER;
+ ret = media_entity_pads_init(&sd->entity, 1, &state->pad);
+ if (ret)
+ goto err_free_ctrl;
+diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
+index 6a9890531d01..675b9ae212ab 100644
+--- a/drivers/media/i2c/tvp514x.c
++++ b/drivers/media/i2c/tvp514x.c
+@@ -1084,7 +1084,7 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
+ #if defined(CONFIG_MEDIA_CONTROLLER)
+ decoder->pad.flags = MEDIA_PAD_FL_SOURCE;
+ decoder->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+- decoder->sd.entity.flags |= MEDIA_ENT_F_ATV_DECODER;
++ decoder->sd.entity.function = MEDIA_ENT_F_ATV_DECODER;
+
+ ret = media_entity_pads_init(&decoder->sd.entity, 1, &decoder->pad);
+ if (ret < 0) {
+diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
+index 4599b7e28a8d..4f5c627579c7 100644
+--- a/drivers/media/i2c/tvp7002.c
++++ b/drivers/media/i2c/tvp7002.c
+@@ -1010,7 +1010,7 @@ static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
+ #if defined(CONFIG_MEDIA_CONTROLLER)
+ device->pad.flags = MEDIA_PAD_FL_SOURCE;
+ device->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+- device->sd.entity.flags |= MEDIA_ENT_F_ATV_DECODER;
++ device->sd.entity.function = MEDIA_ENT_F_ATV_DECODER;
+
+ error = media_entity_pads_init(&device->sd.entity, 1, &device->pad);
+ if (error < 0)
+--
+2.16.4
+
diff --git a/patches/linux/4.9.mx6_legacy/0533-media-adv7180-fix-field-type-to-V4L2_FIELD_ALTERNATE.patch b/patches/linux/4.9.mx6_legacy/0533-media-adv7180-fix-field-type-to-V4L2_FIELD_ALTERNATE.patch
new file mode 100644
index 000000000..ee6fd914f
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0533-media-adv7180-fix-field-type-to-V4L2_FIELD_ALTERNATE.patch
@@ -0,0 +1,67 @@
+From 6457b6263f0f11a9bff4e03a0141820ae9c81460 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Niklas=20S=C3=B6derlund?=
+ <nik...@ra...>
+Date: Thu, 26 Jul 2018 06:27:15 -0400
+Subject: [PATCH] media: adv7180: fix field type to V4L2_FIELD_ALTERNATE
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The ADV7180 and ADV7182 transmit whole fields, bottom field followed
+by top (or vice-versa, depending on detected video standard). So
+for chips that do not have support for explicitly setting the field
+mode via I2P, set the field mode to V4L2_FIELD_ALTERNATE.
+
+I2P converts fields into frames using an edge adaptive algorithm. The
+frame rate is the same as the 'field rate': e.g. X fields per second
+are now X frames per second.
+
+Signed-off-by: Niklas Söderlund <nik...@ra...>
+Signed-off-by: Hans Verkuil <han...@ci...>
+Signed-off-by: Mauro Carvalho Chehab <mch...@ke...>
+---
+ drivers/media/i2c/adv7180.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
+index a727d7f806a1..5a2751a688b8 100644
+--- a/drivers/media/i2c/adv7180.c
++++ b/drivers/media/i2c/adv7180.c
+@@ -644,6 +644,9 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
+ fmt->width = 720;
+ fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;
+
++ if (state->field == V4L2_FIELD_ALTERNATE)
++ fmt->height /= 2;
++
+ return 0;
+ }
+
+@@ -711,11 +714,11 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
+
+ switch (format->format.field) {
+ case V4L2_FIELD_NONE:
+- if (!(state->chip_info->flags & ADV7180_FLAG_I2P))
+- format->format.field = V4L2_FIELD_INTERLACED;
+- break;
++ if (state->chip_info->flags & ADV7180_FLAG_I2P)
++ break;
++ /* fall through */
+ default:
+- format->format.field = V4L2_FIELD_INTERLACED;
++ format->format.field = V4L2_FIELD_ALTERNATE;
+ break;
+ }
+
+@@ -1291,7 +1294,7 @@ static int adv7180_probe(struct i2c_client *client,
+ return -ENOMEM;
+
+ state->client = client;
+- state->field = V4L2_FIELD_INTERLACED;
++ state->field = V4L2_FIELD_ALTERNATE;
+ state->chip_info = (struct adv7180_chip_info *)id->driver_data;
+
+ state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
+--
+2.16.4
+
diff --git a/patches/linux/4.9.mx6_legacy/0534-media-adv7180-add-g_frame_interval-support.patch b/patches/linux/4.9.mx6_legacy/0534-media-adv7180-add-g_frame_interval-support.patch
new file mode 100644
index 000000000..292e61c04
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0534-media-adv7180-add-g_frame_interval-support.patch
@@ -0,0 +1,57 @@
+From 38566d28ea9114f9019e7f9804d6db5cd98bf6dd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Niklas=20S=C3=B6derlund?=
+ <nik...@ra...>
+Date: Thu, 26 Jul 2018 06:27:16 -0400
+Subject: [PATCH] media: adv7180: add g_frame_interval support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Implement g_frame_interval to return the current standard's frame
+interval.
+
+Signed-off-by: Niklas Söderlund <nik...@ra...>
+Signed-off-by: Hans Verkuil <han...@ci...>
+Signed-off-by: Mauro Carvalho Chehab <mch...@ke...>
+---
+ drivers/media/i2c/adv7180.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
+index 5a2751a688b8..de10367d550b 100644
+--- a/drivers/media/i2c/adv7180.c
++++ b/drivers/media/i2c/adv7180.c
+@@ -461,6 +461,22 @@ static int adv7180_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm)
+ return 0;
+ }
+
++static int adv7180_g_frame_interval(struct v4l2_subdev *sd,
++ struct v4l2_subdev_frame_interval *fi)
++{
++ struct adv7180_state *state = to_state(sd);
++
++ if (state->curr_norm & V4L2_STD_525_60) {
++ fi->interval.numerator = 1001;
++ fi->interval.denominator = 30000;
++ } else {
++ fi->interval.numerator = 1;
++ fi->interval.denominator = 25;
++ }
++
++ return 0;
++}
++
+ static void adv7180_set_power_pin(struct adv7180_state *state, bool on)
+ {
+ if (!state->pwdn_gpio)
+@@ -820,6 +836,7 @@ static int adv7180_subscribe_event(struct v4l2_subdev *sd,
+ static const struct v4l2_subdev_video_ops adv7180_video_ops = {
+ .s_std = adv7180_s_std,
+ .g_std = adv7180_g_std,
++ .g_frame_interval = adv7180_g_frame_interval,
+ .querystd = adv7180_querystd,
+ .g_input_status = adv7180_g_input_status,
+ .s_routing = adv7180_s_routing,
+--
+2.16.4
+
diff --git a/patches/linux/4.9.mx6_legacy/0535-MLK-16919-2-media-v4l2-csi-refine-the-mipi-mode-chec.patch b/patches/linux/4.9.mx6_legacy/0535-MLK-16919-2-media-v4l2-csi-refine-the-mipi-mode-chec.patch
new file mode 100644
index 000000000..d8164894d
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0535-MLK-16919-2-media-v4l2-csi-refine-the-mipi-mode-chec.patch
@@ -0,0 +1,101 @@
+From 7f988e50b86300694ed3326373c4ab58001271bf Mon Sep 17 00:00:00 2001
+From: Robby Cai <rob...@nx...>
+Date: Wed, 22 Nov 2017 03:32:34 +0800
+Subject: [PATCH 535/540] MLK-16919-2 media: v4l2: csi: refine the mipi mode
+ check method
+
+check the property 'fsl,mipi-mode' before parse 'csi-mux-mipi' since
+some SoC don't need to set mux for it.
+
+Signed-off-by: Robby Cai <rob...@nx...>
+Reviewed-by: Sandor Yu <San...@nx...>
+---
+ drivers/media/platform/mxc/capture/mx6s_capture.c | 24 +++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -337,7 +337,7 @@ struct mx6s_csi_dev {
+ struct v4l2_async_notifier subdev_notifier;
+ struct v4l2_async_subdev *async_subdevs[2];
+
+- bool csi_mux_mipi;
++ bool csi_mipi_mode;
+ const bool *rx_fifo_rst;
+ struct mx6s_csi_mux csi_mux;
+ };
+@@ -745,7 +745,7 @@ static int mx6s_csi_enable(struct mx6s_c
+ csi_tvdec_enable(csi_dev, true);
+
+ /* For mipi csi input only */
+- if (csi_dev->csi_mux_mipi == true) {
++ if (csi_dev->csi_mipi_mode == true) {
+ csi_dmareq_rff_enable(csi_dev);
+ csi_enable_int(csi_dev, 1);
+ csi_enable(csi_dev, 1);
+@@ -835,7 +835,7 @@ static int mx6s_configure_csi(struct mx6
+ break;
+ case V4L2_PIX_FMT_UYVY:
+ case V4L2_PIX_FMT_YUYV:
+- if (csi_dev->csi_mux_mipi == true)
++ if (csi_dev->csi_mipi_mode == true)
+ width = pix->width;
+ else
+ /* For parallel 8-bit sensor input */
+@@ -847,7 +847,7 @@ static int mx6s_configure_csi(struct mx6
+ }
+ csi_set_imagpara(csi_dev, width, pix->height);
+
+- if (csi_dev->csi_mux_mipi == true) {
++ if (csi_dev->csi_mipi_mode == true) {
+ cr1 = csi_read(csi_dev, CSI_CSICR1);
+ cr1 &= ~BIT_GCLK_MODE;
+ csi_write(csi_dev, cr1, CSI_CSICR1);
+@@ -1692,18 +1692,24 @@ static int subdev_notifier_bound(struct
+ return 0;
+ }
+
+-static int mx6s_csi_mux_sel(struct mx6s_csi_dev *csi_dev)
++static int mx6s_csi_mode_sel(struct mx6s_csi_dev *csi_dev)
+ {
+ struct device_node *np = csi_dev->dev->of_node;
+ struct device_node *node;
+ phandle phandle;
+ u32 out_val[3];
+- int ret;
++ int ret = 0;
++
++ if (of_get_property(np, "fsl,mipi-mode", NULL))
++ csi_dev->csi_mipi_mode = true;
++ else {
++ csi_dev->csi_mipi_mode = false;
++ return ret;
++ }
+
+ ret = of_property_read_u32_array(np, "csi-mux-mipi", out_val, 3);
+ if (ret) {
+ dev_dbg(csi_dev->dev, "no csi-mux-mipi property found\n");
+- csi_dev->csi_mux_mipi = false;
+ } else {
+ phandle = *out_val;
+
+@@ -1726,8 +1732,6 @@ static int mx6s_csi_mux_sel(struct mx6s_
+
+ regmap_update_bits(csi_dev->csi_mux.gpr, csi_dev->csi_mux.req_gpr,
+ 1 << csi_dev->csi_mux.req_bit, 1 << csi_dev->csi_mux.req_bit);
+-
+- csi_dev->csi_mux_mipi = true;
+ }
+ return ret;
+ }
+@@ -1833,7 +1837,7 @@ static int mx6s_csi_probe(struct platfor
+
+ csi_dev->dev = dev;
+
+- mx6s_csi_mux_sel(csi_dev);
++ mx6s_csi_mode_sel(csi_dev);
+
+ of_id = of_match_node(mx6s_csi_dt_ids, csi_dev->dev->of_node);
+ if (!of_id)
diff --git a/patches/linux/4.9.mx6_legacy/0536-MLK-16919-7-media-v4l2-capture-add-handler-for-two-8.patch b/patches/linux/4.9.mx6_legacy/0536-MLK-16919-7-media-v4l2-capture-add-handler-for-two-8.patch
new file mode 100644
index 000000000..a9b6701a1
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0536-MLK-16919-7-media-v4l2-capture-add-handler-for-two-8.patch
@@ -0,0 +1,63 @@
+From 144d2ad93a9de4d89b2785f3334ec6769340257d Mon Sep 17 00:00:00 2001
+From: Robby Cai <rob...@nx...>
+Date: Wed, 22 Nov 2017 11:32:08 +0800
+Subject: [PATCH 536/540] MLK-16919-7 media: v4l2: capture: add handler for
+ two-8bit-sensor mode
+
+Add handling to parse two-8bit-sensor mode
+
+Signed-off-by: Robby Cai <rob...@nx...>
+Reviewed-by: Sandor Yu <San...@nx...>
+---
+ drivers/media/platform/mxc/capture/mx6s_capture.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -338,6 +338,7 @@ struct mx6s_csi_dev {
+ struct v4l2_async_subdev *async_subdevs[2];
+
+ bool csi_mipi_mode;
++ bool csi_two_8bit_sensor_mode;
+ const bool *rx_fifo_rst;
+ struct mx6s_csi_mux csi_mux;
+ };
+@@ -576,6 +577,8 @@ static void csi_dmareq_rff_enable(struct
+ cr3 |= BIT_HRESP_ERR_EN;
+ cr3 &= ~BIT_RXFF_LEVEL;
+ cr3 |= 0x2 << 4;
++ if (csi_dev->csi_two_8bit_sensor_mode)
++ cr3 |= BIT_TWO_8BIT_SENSOR;
+
+ __raw_writel(cr3, csi_dev->regbase + CSI_CSICR3);
+ __raw_writel(cr2, csi_dev->regbase + CSI_CSICR2);
+@@ -1736,6 +1739,19 @@ static int mx6s_csi_mode_sel(struct mx6s
+ return ret;
+ }
+
++static int mx6s_csi_two_8bit_sensor_mode_sel(struct mx6s_csi_dev *csi_dev)
++{
++ struct device_node *np = csi_dev->dev->of_node;
++
++ if (of_get_property(np, "fsl,two-8bit-sensor-mode", NULL))
++ csi_dev->csi_two_8bit_sensor_mode = true;
++ else {
++ csi_dev->csi_two_8bit_sensor_mode = false;
++ }
++
++ return 0;
++}
++
+ static int mx6sx_register_subdevs(struct mx6s_csi_dev *csi_dev)
+ {
+ struct device_node *parent = csi_dev->dev->of_node;
+@@ -1838,6 +1854,7 @@ static int mx6s_csi_probe(struct platfor
+ csi_dev->dev = dev;
+
+ mx6s_csi_mode_sel(csi_dev);
++ mx6s_csi_two_8bit_sensor_mode_sel(csi_dev);
+
+ of_id = of_match_node(mx6s_csi_dt_ids, csi_dev->dev->of_node);
+ if (!of_id)
diff --git a/patches/linux/4.9.mx6_legacy/0537-MLK-17058-media-csi-fix-spurious-warning-message.patch b/patches/linux/4.9.mx6_legacy/0537-MLK-17058-media-csi-fix-spurious-warning-message.patch
new file mode 100644
index 000000000..1d9cb4222
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0537-MLK-17058-media-csi-fix-spurious-warning-message.patch
@@ -0,0 +1,58 @@
+From 372302157788be4ff0351801840253d2f2b2c49b Mon Sep 17 00:00:00 2001
+From: Robby Cai <rob...@nx...>
+Date: Thu, 7 Dec 2017 20:22:25 +0800
+Subject: [PATCH 537/540] MLK-17058 media: csi: fix spurious warning message
+
+When boot up with 4K HDMI display, and at same time do a capture with
+720p (or above), meet following message.
+
+[ 241.572132] mx6s-csi 30a90000.csi1_bridge: 82300000 != 82300000
+[ 241.604974] mx6s-csi 30a90000.csi1_bridge: 82700000 != 82700000
+[ 241.638305] mx6s-csi 30a90000.csi1_bridge: 82b00000 != 82b00000
+[ 241.704969] mx6s-csi 30a90000.csi1_bridge: 82300000 != 82300000
+...
+
+cast the type of unsigned long to unsigned int before compare two variables
+to fix it.
+
+Signed-off-by: Robby Cai <rob...@nx...>
+Reviewed-by: Sandor Yu <san...@nx...>
+(cherry picked from commit 0972b05917dd5bd3d6aa28e57b7181d647da28b8)
+---
+ drivers/media/platform/mxc/capture/mx6s_capture.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -997,6 +997,8 @@ static void mx6s_csi_frame_done(struct m
+ struct mx6s_buffer *buf;
+ struct vb2_buffer *vb;
+ unsigned long phys;
++ unsigned int phys_fb1;
++ unsigned int phys_fb2;
+
+ ibuf = list_first_entry(&csi_dev->active_bufs, struct mx6s_buf_internal,
+ queue);
+@@ -1013,14 +1015,16 @@ static void mx6s_csi_frame_done(struct m
+ vb = &buf->vb.vb2_buf;
+ phys = vb2_dma_contig_plane_dma_addr(vb, 0);
+ if (bufnum == 1) {
+- if (csi_read(csi_dev, CSI_CSIDMASA_FB2) != phys) {
++ phys_fb2 = csi_read(csi_dev, CSI_CSIDMASA_FB2);
++ if (phys_fb2 != (u32)phys) {
+ dev_err(csi_dev->dev, "%lx != %x\n", phys,
+- csi_read(csi_dev, CSI_CSIDMASA_FB2));
++ phys_fb2);
+ }
+ } else {
+- if (csi_read(csi_dev, CSI_CSIDMASA_FB1) != phys) {
++ phys_fb1 = csi_read(csi_dev, CSI_CSIDMASA_FB1);
++ if (phys_fb1 != (u32)phys) {
+ dev_err(csi_dev->dev, "%lx != %x\n", phys,
+- csi_read(csi_dev, CSI_CSIDMASA_FB1));
++ phys_fb1);
+ }
+ }
+ dev_dbg(csi_dev->dev, "%s (vb=0x%p) 0x%p %lu\n", __func__, vb,
diff --git a/patches/linux/4.9.mx6_legacy/0538-MLK-18095-media-v4l2-Add-VIDIOC_EXPBUF-ioctl-for-DMA.patch b/patches/linux/4.9.mx6_legacy/0538-MLK-18095-media-v4l2-Add-VIDIOC_EXPBUF-ioctl-for-DMA.patch
new file mode 100644
index 000000000..dcd09e9ed
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0538-MLK-18095-media-v4l2-Add-VIDIOC_EXPBUF-ioctl-for-DMA.patch
@@ -0,0 +1,46 @@
+From 601e07cdd1fe900dcb357e684e810e096a1177d3 Mon Sep 17 00:00:00 2001
+From: Robby Cai <rob...@nx...>
+Date: Wed, 18 Apr 2018 17:16:47 +0800
+Subject: [PATCH 538/540] MLK-18095 media: v4l2: Add VIDIOC_EXPBUF ioctl for
+ DMABUF mode
+
+Add VIDIOC_EXPBUF ioctl which exports a buffer as a DMABUF file descriptor.
+After calling VIDIOC_EXPBUF the fd field will be set by a driver. This is a
+DMABUF file descriptor. The application may pass it to other DMABUF-aware
+devices. See V4L2 spec for more details.
+
+Signed-off-by: Robby Cai <rob...@nx...>
+---
+ drivers/media/platform/mxc/capture/mx6s_capture.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -1490,6 +1490,17 @@ static int mx6s_vidioc_querycap(struct f
+ return 0;
+ }
+
++static int mx6s_vidioc_expbuf(struct file *file, void *priv,
++ struct v4l2_exportbuffer *eb)
++{
++ struct mx6s_csi_dev *csi_dev = video_drvdata(file);
++
++ if (eb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
++ return vb2_expbuf(&csi_dev->vb2_vidq, eb);
++
++ return -EINVAL;
++}
++
+ static int mx6s_vidioc_streamon(struct file *file, void *priv,
+ enum v4l2_buf_type i)
+ {
+@@ -1672,6 +1683,7 @@ static const struct v4l2_ioctl_ops mx6s_
+ .vidioc_enum_input = mx6s_vidioc_enum_input,
+ .vidioc_g_input = mx6s_vidioc_g_input,
+ .vidioc_s_input = mx6s_vidioc_s_input,
++ .vidioc_expbuf = mx6s_vidioc_expbuf,
+ .vidioc_streamon = mx6s_vidioc_streamon,
+ .vidioc_streamoff = mx6s_vidioc_streamoff,
+ .vidioc_g_parm = mx6s_vidioc_g_parm,
diff --git a/patches/linux/4.9.mx6_legacy/0539-MLK-19362-media-csi-Fix-Hresponse-and-Rx-fifo-overfl.patch b/patches/linux/4.9.mx6_legacy/0539-MLK-19362-media-csi-Fix-Hresponse-and-Rx-fifo-overfl.patch
new file mode 100644
index 000000000..30e9021d2
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0539-MLK-19362-media-csi-Fix-Hresponse-and-Rx-fifo-overfl.patch
@@ -0,0 +1,118 @@
+From cdc7bdf8ac17d80c66bff6505acdd56b763e0755 Mon Sep 17 00:00:00 2001
+From: Mirela Rabulea <mir...@nx...>
+Date: Wed, 12 Sep 2018 11:50:54 +0300
+Subject: [PATCH 539/540] MLK-19362: media: csi: Fix "Hresponse" and "Rx fifo
+ overflow" camera errors
+
+When the register setting for fifo_send_level is set to high, some residual
+data of a frame which cannot fill up to the send_level, will be sent with
+the next frame data. In this case, for CSI receive dma, sometimes,
+the vertical blanking is too short to finish the storage of the previous
+frame before the next frame start, depending on the system bandwidth.
+
+Tested on imx8mq-evk rev B4 and B3, with OV5640 camera.
+
+This patch was proposed by Tom Zheng <hai...@nx...>
+
+Signed-off-by: Mirela Rabulea <mir...@nx...>
+Reviewed-by: Robby Cai <rob...@nx...>
+---
+ drivers/media/platform/mxc/capture/mx6s_capture.c | 38 +++++++++++++++++------
+ 1 file changed, 29 insertions(+), 9 deletions(-)
+
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -295,6 +295,11 @@ struct mx6s_csi_mux {
+ u8 req_bit;
+ };
+
++struct mx6s_csi_soc {
++ bool rx_fifo_rst;
++ int baseaddr_switch;
++};
++
+ struct mx6s_csi_dev {
+ struct device *dev;
+ struct video_device *vdev;
+@@ -339,7 +344,7 @@ struct mx6s_csi_dev {
+
+ bool csi_mipi_mode;
+ bool csi_two_8bit_sensor_mode;
+- const bool *rx_fifo_rst;
++ const struct mx6s_csi_soc *soc;
+ struct mx6s_csi_mux csi_mux;
+ };
+
+@@ -445,7 +450,9 @@ static void csisw_reset(struct mx6s_csi_
+ isr = csi_read(csi_dev, CSI_CSISR);
+ csi_write(csi_dev, isr, CSI_CSISR);
+
+- /* Ensable csi */
++ cr18 |= csi_dev->soc->baseaddr_switch;
++
++ /* Enable csi */
+ cr18 |= BIT_CSI_ENABLE;
+ csi_write(csi_dev, cr18, CSI_CSICR18);
+ }
+@@ -856,7 +863,7 @@ static int mx6s_configure_csi(struct mx6
+ csi_write(csi_dev, cr1, CSI_CSICR1);
+
+ cr18 = csi_read(csi_dev, CSI_CSICR18);
+- cr18 &= BIT_MIPI_DATA_FORMAT_MASK;
++ cr18 &= ~BIT_MIPI_DATA_FORMAT_MASK;
+ cr18 |= BIT_DATA_FROM_MIPI;
+
+ switch (csi_dev->fmt->pixelformat) {
+@@ -1098,7 +1105,7 @@ static irqreturn_t mx6s_csi_irq_handler(
+
+ if (status & BIT_RFF_OR_INT) {
+ dev_warn(csi_dev->dev, "%s Rx fifo overflow\n", __func__);
+- if (*csi_dev->rx_fifo_rst)
++ if (csi_dev->soc->rx_fifo_rst)
+ csi_error_recovery(csi_dev);
+ }
+
+@@ -1875,7 +1882,7 @@ static int mx6s_csi_probe(struct platfor
+ of_id = of_match_node(mx6s_csi_dt_ids, csi_dev->dev->of_node);
+ if (!of_id)
+ return -EINVAL;
+- csi_dev->rx_fifo_rst = of_id->data;
++ csi_dev->soc = of_id->data;
+
+ snprintf(csi_dev->v4l2_dev.name,
+ sizeof(csi_dev->v4l2_dev.name), "CSI");
+@@ -1975,15 +1982,28 @@ static const struct dev_pm_ops mx6s_csi_
+ SET_RUNTIME_PM_OPS(mx6s_csi_runtime_suspend, mx6s_csi_runtime_resume, NULL)
+ };
+
+-static const u8 mx6s_fifo_rst = true;
+-static const u8 mx6sl_fifo_rst = false;
++static const struct mx6s_csi_soc mx6s_soc = {
++ .rx_fifo_rst = true,
++ .baseaddr_switch = 0,
++};
++static const struct mx6s_csi_soc mx6sl_soc = {
++ .rx_fifo_rst = false,
++ .baseaddr_switch = 0,
++};
++static const struct mx6s_csi_soc mx8mq_soc = {
++ .rx_fifo_rst = true,
++ .baseaddr_switch = 0x80030,
++};
+
+ static const struct of_device_id mx6s_csi_dt_ids[] = {
+ { .compatible = "fsl,imx6s-csi",
+- .data = &mx6s_fifo_rst,
++ .data = &mx6s_soc,
+ },
+ { .compatible = "fsl,imx6sl-csi",
+- .data = &mx6sl_fifo_rst,
++ .data = &mx6sl_soc,
++ },
++ { .compatible = "fsl,imx8mq-csi",
++ .data = &mx8mq_soc,
+ },
+ { /* sentinel */ }
+ };
diff --git a/patches/linux/4.9.mx6_legacy/0540-MLK-19913-media-csi-fix-corrupted-image-issue-when-r.patch b/patches/linux/4.9.mx6_legacy/0540-MLK-19913-media-csi-fix-corrupted-image-issue-when-r.patch
new file mode 100644
index 000000000..349a58281
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0540-MLK-19913-media-csi-fix-corrupted-image-issue-when-r.patch
@@ -0,0 +1,90 @@
+From eea7adecb89440a26cd737f2b402d578bfa55c0a Mon Sep 17 00:00:00 2001
+From: Robby Cai <rob...@nx...>
+Date: Fri, 12 Oct 2018 16:30:47 +0800
+Subject: [PATCH 540/540] MLK-19913 media: csi: fix corrupted image issue when
+ restart CSI bridge
+
+Corrupted image is observed on the capture when do the resolution switch.
+This usually happens with base address switch error (BIT_ADDR_CH_ERR_INT).
+skip the frame if the frame index does not correspond to the requested one
+to resolve it.
+
+This patch was proposed by Tom Zheng <hai...@nx...>
+
+Signed-off-by: Robby Cai <rob...@nx...>
+(cherry picked from commit 8e94e5951363f2c2c0835c8b89be9538620796bf)
+---
+ drivers/media/platform/mxc/capture/mx6s_capture.c | 24 +++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -320,6 +320,8 @@ struct mx6s_csi_dev {
+ void __iomem *regbase;
+ int irq;
+
++ u32 nextfb;
++ u32 skipframe;
+ u32 type;
+ u32 bytesperline;
+ v4l2_std_id std;
+@@ -749,6 +751,7 @@ static int mx6s_csi_enable(struct mx6s_c
+ unsigned long val;
+ int timeout, timeout2;
+
++ csi_dev->skipframe = 0;
+ csisw_reset(csi_dev);
+
+ if (pix->field == V4L2_FIELD_INTERLACED)
+@@ -943,6 +946,8 @@ static int mx6s_start_streaming(struct v
+ mx6s_update_csi_buf(csi_dev, phys, buf->internal.bufnum);
+ list_move_tail(csi_dev->capture.next, &csi_dev->active_bufs);
+
++ csi_dev->nextfb = 0;
++
+ spin_unlock_irqrestore(&csi_dev->slock, flags);
+
+ return mx6s_csi_enable(csi_dev);
+@@ -1048,6 +1053,7 @@ static void mx6s_csi_frame_done(struct m
+ }
+
+ csi_dev->frame_count++;
++ csi_dev->nextfb = (bufnum == 0 ? 1: 0);
+
+ /* Config discard buffer to active_bufs */
+ if (list_empty(&csi_dev->capture)) {
+@@ -1130,6 +1136,7 @@ static irqreturn_t mx6s_csi_irq_handler(
+ cr18 |= BIT_CSI_ENABLE;
+ csi_write(csi_dev, cr18, CSI_CSICR18);
+
++ csi_dev->skipframe = 1;
+ pr_debug("base address switching Change Err.\n");
+ }
+
+@@ -1144,9 +1151,22 @@ static irqreturn_t mx6s_csi_irq_handler(
+ * PDM TKT230775 */
+ pr_debug("Skip two frames\n");
+ } else if (status & BIT_DMA_TSF_DONE_FB1) {
+- mx6s_csi_frame_done(csi_dev, 0, false);
++ if (csi_dev->nextfb == 0) {
++ if (csi_dev->skipframe > 0)
++ csi_dev->skipframe--;
++ else
++ mx6s_csi_frame_done(csi_dev, 0, false);
++ } else
++ pr_warn("skip frame 0 \n");
++
+ } else if (status & BIT_DMA_TSF_DONE_FB2) {
+- mx6s_csi_frame_done(csi_dev, 1, false);
++ if (csi_dev->nextfb == 1) {
++ if (csi_dev->skipframe > 0)
++ csi_dev->skipframe--;
++ else
++ mx6s_csi_frame_done(csi_dev, 1, false);
++ } else
++ pr_warn("skip frame 1 \n");
+ }
+
+ spin_unlock(&csi_dev->slock);
diff --git a/patches/linux/4.17/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch b/patches/linux/4.9.mx6_legacy/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch
similarity index 76%
copy from patches/linux/4.17/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch
copy to patches/linux/4.9.mx6_legacy/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch
index c1a663705..e984c9afb 100644
--- a/patches/linux/4.17/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch
+++ b/patches/linux/4.9.mx6_legacy/0805-ASoC-cs4265-fix-MMTLR-Data-switch-control.patch
@@ -15,11 +15,11 @@ Signed-off-by: Sébastien Szymanski <seb...@ar...>
sound/soc/codecs/cs4265.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
-index 275677de669f..407554175282 100644
---- a/sound/soc/codecs/cs4265.c
-+++ b/sound/soc/codecs/cs4265.c
-@@ -157,8 +157,8 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {
+Index: linux-imx_4.9.11_1.0.0_ga/sound/soc/codecs/cs4265.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/sound/soc/codecs/cs4265.c
++++ linux-imx_4.9.11_1.0.0_ga/sound/soc/codecs/cs4265.c
+@@ -157,8 +157,8 @@ static const struct snd_kcontrol_new cs4
SOC_SINGLE("Validity Bit Control Switch", CS4265_SPDIF_CTL2,
3, 1, 0),
SOC_ENUM("SPDIF Mono/Stereo", spdif_mono_stereo_enum),
@@ -30,6 +30,3 @@ index 275677de669f..407554175282 100644
SOC_ENUM("Mono Channel Select", spdif_mono_select_enum),
SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24),
};
---
-2.16.4
-
diff --git a/patches/linux/4.9.mx6_legacy/0807-armadeus-media-mx6s_caputre-add-subdev-complete-callback.patch b/patches/linux/4.9.mx6_legacy/0807-armadeus-media-mx6s_caputre-add-subdev-complete-callback.patch
index ef4b7687b..338d815ff 100644
--- a/patches/linux/4.9.mx6_legacy/0807-armadeus-media-mx6s_caputre-add-subdev-complete-callback.patch
+++ b/patches/linux/4.9.mx6_legacy/0807-armadeus-media-mx6s_caputre-add-subdev-complete-callback.patch
@@ -5,7 +5,7 @@ Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.
===================================================================
--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
+++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
-@@ -1692,6 +1692,13 @@ static int subdev_notifier_bound(struct
+@@ -1738,6 +1738,13 @@ static int subdev_notifier_bound(struct
return 0;
}
@@ -16,10 +16,10 @@ Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.
+ return v4l2_device_register_subdev_nodes(&csi_dev->v4l2_dev);
+}
+
- static int mx6s_csi_mux_sel(struct mx6s_csi_dev *csi_dev)
+ static int mx6s_csi_mode_sel(struct mx6s_csi_dev *csi_dev)
{
struct device_node *np = csi_dev->dev->of_node;
-@@ -1767,6 +1774,7 @@ static int mx6sx_register_subdevs(struct
+@@ -1830,6 +1837,7 @@ static int mx6sx_register_subdevs(struct
csi_dev->subdev_notifier.subdevs = csi_dev->async_subdevs;
csi_dev->subdev_notifier.num_subdevs = 1;
csi_dev->subdev_notifier.bound = subdev_notifier_bound;
diff --git a/patches/linux/4.9.mx6_legacy/0810-armadeus-media-mx6s_capture-check-format-by-return.patch b/patches/linux/4.9.mx6_legacy/0810-armadeus-media-mx6s_capture-check-format-by-return.patch
new file mode 100644
index 000000000..1794826de
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0810-armadeus-media-mx6s_capture-check-format-by-return.patch
@@ -0,0 +1,40 @@
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -377,7 +377,7 @@ struct mx6s_fmt *format_by_fourcc(int fo
+ return formats + i;
+ }
+
+- pr_err("unknown pixelformat:'%4.4s'\n", (char *)&fourcc);
++ //pr_err("unknown pixelformat:'%4.4s'\n", (char *)&fourcc);
+ return NULL;
+ }
+
+@@ -390,7 +390,7 @@ struct mx6s_fmt *format_by_mbus(u32 code
+ return formats + i;
+ }
+
+- pr_err("unknown mbus:0x%x\n", code);
++ //pr_err("unknown mbus:0x%x\n", code);
+ return NULL;
+ }
+
+@@ -1636,6 +1636,8 @@ static int mx6s_vidioc_enum_framesizes(s
+ int ret;
+
+ fmt = format_by_fourcc(fsize->pixel_format);
++ if (!fmt)
++ return -EINVAL;
+ if (fmt->pixelformat != fsize->pixel_format)
+ return -EINVAL;
+ fse.code = fmt->mbus_code;
+@@ -1678,6 +1680,8 @@ static int mx6s_vidioc_enum_frameinterva
+ int ret;
+
+ fmt = format_by_fourcc(interval->pixel_format);
++ if (!fmt)
++ return -EINVAL;
+ if (fmt->pixelformat != interval->pixel_format)
+ return -EINVAL;
+ fie.code = fmt->mbus_code;
diff --git a/patches/linux/4.9.mx6_legacy/0811-armadeus-media-mx6s_capture-fix-vidioc_enum_input-callback.patch b/patches/linux/4.9.mx6_legacy/0811-armadeus-media-mx6s_capture-fix-vidioc_enum_input-callback.patch
new file mode 100644
index 000000000..5b4f3f4c4
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0811-armadeus-media-mx6s_capture-fix-vidioc_enum_input-callback.patch
@@ -0,0 +1,19 @@
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/platform/mxc/subdev/mx6s_capture.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/platform/mxc/subdev/mx6s_capture.c
+@@ -1288,11 +1288,14 @@ static struct v4l2_file_operations mx6s_
+ static int mx6s_vidioc_enum_input(struct file *file, void *priv,
+ struct v4l2_input *inp)
+ {
++ struct mx6s_csi_dev *csi_dev = video_drvdata(file);
++
+ if (inp->index != 0)
+ return -EINVAL;
+
+ /* default is camera */
+ inp->type = V4L2_INPUT_TYPE_CAMERA;
++ inp->std = csi_dev->vdev->tvnorms;
+ strcpy(inp->name, "Camera");
+
+ return 0;
diff --git a/patches/linux/4.9.mx6_legacy/0813-armadeus-imx6ull-add-sai-alias-and-cells.patch b/patches/linux/4.9.mx6_legacy/0813-armadeus-imx6ull-add-sai-alias-and-cells.patch
new file mode 100644
index 000000000..a7d7fe939
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0813-armadeus-imx6ull-add-sai-alias-and-cells.patch
@@ -0,0 +1,38 @@
+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
+@@ -40,6 +40,9 @@
+ serial5 = &uart6;
+ serial6 = &uart7;
+ serial7 = &uart8;
++ sai1 = &sai1;
++ sai2 = &sai2;
++ sai3 = &sai3;
+ spi0 = &ecspi1;
+ spi1 = &ecspi2;
+ spi2 = &ecspi3;
+@@ -352,6 +355,7 @@
+ };
+
+ sai1: sai@02028000 {
++ #sound-dai-cells = <0>;
+ compatible = "fsl,imx6ul-sai",
+ "fsl,imx6sx-sai";
+ reg = <0x02028000 0x4000>;
+@@ -367,6 +371,7 @@
+ };
+
+ sai2: sai@0202c000 {
++ #sound-dai-cells = <0>;
+ compatible = "fsl,imx6ul-sai",
+ "fsl,imx6sx-sai";
+ reg = <0x0202c000 0x4000>;
+@@ -382,6 +387,7 @@
+ };
+
+ sai3: sai@02030000 {
++ #sound-dai-cells = <0>;
+ compatible = "fsl,imx6ul-sai",
+ "fsl,imx6sx-sai";
+ reg = <0x02030000 0x4000>;
hooks/post-receive
--
armadeus
|