From 072af37855d1839fe533d7d80399171ad2d9be87 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 4 Sep 2023 16:11:43 +0200 Subject: linux-toradex-mainline: refresh patches for 6.6-rc Drop 0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch and 0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch. Their functionality has been added upstream. Refresh the remaining 4 patches so that they apply cleanly. Signed-off-by: Max Krummenacher --- ...panel-simple-drop-use-of-data-mapping-pro.patch | 60 ------------ ...a-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch | 40 -------- ...async-fix-binding-async-subdevs-with-mult.patch | 107 --------------------- ...hermal-imx-Update-critical-temp-threshold.patch | 8 +- ...panel-simple-drop-use-of-data-mapping-pro.patch | 61 ++++++++++++ ...rs-chipidea-disable-runtime-pm-for-imx6ul.patch | 39 -------- ...edia-i2c-ov5640-Implement-get_mbus_config.patch | 54 ----------- ...rs-chipidea-disable-runtime-pm-for-imx6ul.patch | 39 ++++++++ ...edia-i2c-ov5640-Implement-get_mbus_config.patch | 54 +++++++++++ recipes-kernel/linux/linux-toradex-mainline_git.bb | 8 +- 10 files changed, 161 insertions(+), 309 deletions(-) delete mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch delete mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch delete mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch create mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch delete mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch delete mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0002-media-i2c-ov5640-Implement-get_mbus_config.patch create mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch create mode 100644 recipes-kernel/linux/linux-toradex-mainline-git/0004-media-i2c-ov5640-Implement-get_mbus_config.patch diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch deleted file mode 100644 index 4da324c..0000000 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d0e9aca518b2255d0776a448dfae8ae977a3811e Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Thu, 1 Sep 2022 14:04:50 +0200 -Subject: [PATCH] Revert "drm/panel-simple: drop use of data-mapping property" - -This reverts commit d021d751c14752a0266865700f6f212fab40a18c. - -Re-enable the data-mapping property which was already used in the -5.4-2.3.0 downstream kernel. - -In addition to the revert set bpc from the data-mapping value -as a WARN_ON is printed if missing. -In addition to the revert have mapping pointing to the empty string to -prevent a kernel panic if data-mapping can not be read from the dt and -then an uninitialized pointer is used in strcmp. - -Upstream-Status: denied [Alternative solution being discused] -https://lore.kernel.org/all/20220628181838.2031-1-max.oss.09@gmail.com/ -Signed-off-by: Max Krummenacher ---- - drivers/gpu/drm/panel/panel-simple.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index ff5e1a44c43a..f94dd09cf76f 100644 ---- a/drivers/gpu/drm/panel/panel-simple.c -+++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -467,6 +467,7 @@ static int panel_dpi_probe(struct device *dev, - struct panel_desc *desc; - unsigned int bus_flags; - struct videomode vm; -+ const char *mapping = ""; - int ret; - - np = dev->of_node; -@@ -491,6 +492,21 @@ static int panel_dpi_probe(struct device *dev, - of_property_read_u32(np, "width-mm", &desc->size.width); - of_property_read_u32(np, "height-mm", &desc->size.height); - -+ of_property_read_string(np, "data-mapping", &mapping); -+ if (!strcmp(mapping, "rgb24")) { -+ desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24; -+ desc->bpc = 8; -+ } else if (!strcmp(mapping, "rgb565")) { -+ desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16; -+ desc->bpc = 6; -+ } else if (!strcmp(mapping, "bgr666")) { -+ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18; -+ desc->bpc = 6; -+ } else if (!strcmp(mapping, "lvds666")) { -+ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; -+ desc->bpc = 6; -+ } -+ - /* Extract bus_flags from display_timing */ - bus_flags = 0; - vm.flags = timing->flags; --- -2.35.3 - diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch deleted file mode 100644 index a0575ad..0000000 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 3557195151f8a5de785dc75c26aea30288473c5b Mon Sep 17 00:00:00 2001 -From: Aishwarya Kothari -Date: Mon, 22 May 2023 11:17:34 +0200 -Subject: [PATCH] Revert "media: v4l2-async: Use endpoints in - __v4l2_async_nf_add_fwnode_remote()" - -linux-toradex-mainline: fix hdmi-csi bridge with imx6 - -Revert f446077d62514ee29f75970dff3d55a432. - -This reverted commit breaks the async subdevice probing that is needed -by TC358743 HDMI to MIPI-CSI2 bridge on Apalis iMX6. See [1] for details. - -The V4L2 async framework for the iMX6 seem to be fixed by [2] -patch series, that it is not yet merged. -While waiting for this patch series to be merged we revert this single commit. - -[1] https://lore.kernel.org/all/8360125.31r3eYUQgx@steina-w/ -[2] https://lore.kernel.org/all/20230525091615.2324824-1-sakari.ailus@linux.intel.com/ - ---- - drivers/media/v4l2-core/v4l2-async.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c -index 008a2a3e312e..0c88d2594671 100644 ---- a/drivers/media/v4l2-core/v4l2-async.c -+++ b/drivers/media/v4l2-core/v4l2-async.c -@@ -713,7 +713,7 @@ __v4l2_async_nf_add_fwnode_remote(struct v4l2_async_notifier *notif, - struct v4l2_async_subdev *asd; - struct fwnode_handle *remote; - -- remote = fwnode_graph_get_remote_endpoint(endpoint); -+ remote = fwnode_graph_get_remote_port_parent(endpoint); - if (!remote) - return ERR_PTR(-ENOTCONN); - --- -2.34.1 - diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch deleted file mode 100644 index cff4391..0000000 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch +++ /dev/null @@ -1,107 +0,0 @@ -From ba50876f7b4fd05b51b19a6774ff6748ba9b6902 Mon Sep 17 00:00:00 2001 -From: Philipp Zabel -Date: Wed, 10 Aug 2022 12:48:48 +0200 -Subject: [PATCH 1/2] media: v4l2-async: fix binding async subdevs with - multiple source ports - -Asynchronous subdevice probing on imx-media with imx6-mipi-csi2 is -broken since commit 1f391df44607 ("media: v4l2-async: Use endpoints in -__v4l2_async_nf_add_fwnode_remote()"). - -This is a side effect of imx6-mipi-csi2 having a single subdevice with -four separate source ports connected to different subdevices. Before, -the imx-media-csi and video-mux devices registered async sub-devices -via device fwnode that matched the imx6-mipi-csi2 device on their -respective notifiers. This caused the first asd to be put on the -notifier waiting list, and the other three to return -EEXIST and be -ignored. - -With async subdev registration via endpoint fwnode, all four asds are -distinct and three of them keep dangling on their notifiers after the -first one is bound. - -This patch modifies __v4l2_async_nf_has_async_subdev() to consider -asds matching different fwnode endpoints of the same sub-device equal -if the latter is already bound and matches via device fwnode. Further, -v4l2_async_register_subdev() is modified to remove dangling duplicate -asds that were registered before the sub-device was available to check -its fwnode. - -Fixes: 1f391df44607 ("media: v4l2-async: Use endpoints in __v4l2_async_nf_add_fwnode_remote()") -Signed-off-by: Philipp Zabel -Upstream-Status: Submitted [https://lore.kernel.org/all/20220810104848.846783-1-p.zabel@pengutronix.de/] ---- - drivers/media/v4l2-core/v4l2-async.c | 43 ++++++++++++++++++++++++++++ - 1 file changed, 43 insertions(+) - -diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c -index 2f1b718a9189..b24220ed7077 100644 ---- a/drivers/media/v4l2-core/v4l2-async.c -+++ b/drivers/media/v4l2-core/v4l2-async.c -@@ -452,6 +452,22 @@ __v4l2_async_nf_has_async_subdev(struct v4l2_async_notifier *notifier, - - if (asd_equal(asd, sd->asd)) - return true; -+ -+ /* -+ * If the asd matches an endpoint fwnode, handle sub-devices -+ * with device fwnode that were already matched by another asd -+ * with a different endpoint fwnode on the same device. -+ */ -+ if (asd->match_type == V4L2_ASYNC_MATCH_FWNODE && -+ fwnode_graph_is_endpoint(asd->match.fwnode) && -+ sd->fwnode && !fwnode_graph_is_endpoint(sd->fwnode)) { -+ struct fwnode_handle *devnode; -+ -+ devnode = fwnode_graph_get_port_parent(asd->match.fwnode); -+ fwnode_handle_put(devnode); -+ if (devnode == sd->fwnode) -+ return true; -+ } - } - - return false; -@@ -749,6 +765,24 @@ __v4l2_async_nf_add_i2c(struct v4l2_async_notifier *notifier, int adapter_id, - } - EXPORT_SYMBOL_GPL(__v4l2_async_nf_add_i2c); - -+static void v4l2_async_remove_duplicate_matches(struct v4l2_subdev *sd) -+{ -+ struct v4l2_async_notifier *notifier; -+ -+ lockdep_assert_held(&list_lock); -+ -+ list_for_each_entry(notifier, ¬ifier_list, list) { -+ struct v4l2_async_subdev *asd; -+ -+ asd = v4l2_async_find_match(notifier, sd); -+ if (!asd) -+ continue; -+ -+ /* Remove from the waiting list */ -+ list_del(&asd->list); -+ } -+} -+ - int v4l2_async_register_subdev(struct v4l2_subdev *sd) - { - struct v4l2_async_notifier *subdev_notifier; -@@ -783,6 +817,15 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) - if (ret) - goto err_unbind; - -+ /* -+ * At this point the asd is removed from the notifier wait list. -+ * There might be other notifiers with asds matching different -+ * fwnode endpoints of the same sd remaining. If the sd matches -+ * by device fwnode, remove the dangling asds. -+ */ -+ if (sd->fwnode && !fwnode_graph_is_endpoint(sd->fwnode)) -+ v4l2_async_remove_duplicate_matches(sd); -+ - ret = v4l2_async_nf_try_complete(notifier); - if (ret) - goto err_unbind; --- -2.34.1 - diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0001-thermal-imx-Update-critical-temp-threshold.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0001-thermal-imx-Update-critical-temp-threshold.patch index f62210c..c09abb9 100644 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0001-thermal-imx-Update-critical-temp-threshold.patch +++ b/recipes-kernel/linux/linux-toradex-mainline-git/0001-thermal-imx-Update-critical-temp-threshold.patch @@ -1,7 +1,7 @@ -From 07558dd2a672caca882d6a6ac03a1d7f061f6a1a Mon Sep 17 00:00:00 2001 +From 212abec626e1c82616a1cf6e492e467cf79aef23 Mon Sep 17 00:00:00 2001 From: Francesco Dolcini Date: Wed, 20 Apr 2022 11:13:00 +0200 -Subject: [PATCH] thermal: imx: Update critical temp threshold +Subject: [PATCH 1/4] thermal: imx: Update critical temp threshold Increase the critical temperature threshold to the datasheet defined value according to the temperature grade of the SoC, increasing the @@ -18,10 +18,10 @@ Signed-off-by: Francesco Dolcini 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c -index fb0d5cab70af..0ff8cbedf560 100644 +index 826358cbe810..4fcbf15b2768 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c -@@ -485,11 +485,11 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0) +@@ -458,11 +458,11 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0) } /* diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch new file mode 100644 index 0000000..5067258 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-mainline-git/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch @@ -0,0 +1,61 @@ +From fdd0972a24818dc336b2235ce93000ee7b88240e Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Thu, 1 Sep 2022 14:04:50 +0200 +Subject: [PATCH 2/4] Revert "drm/panel-simple: drop use of data-mapping + property" + +This reverts commit d021d751c14752a0266865700f6f212fab40a18c. + +Re-enable the data-mapping property which was already used in the +5.4-2.3.0 downstream kernel. + +In addition to the revert set bpc from the data-mapping value +as a WARN_ON is printed if missing. +In addition to the revert have mapping pointing to the empty string to +prevent a kernel panic if data-mapping can not be read from the dt and +then an uninitialized pointer is used in strcmp. + +Upstream-Status: denied [Alternative solution being discused] +https://lore.kernel.org/all/20220628181838.2031-1-max.oss.09@gmail.com/ +Signed-off-by: Max Krummenacher +--- + drivers/gpu/drm/panel/panel-simple.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c +index 95959dcc6e0e..4518eb5d7acb 100644 +--- a/drivers/gpu/drm/panel/panel-simple.c ++++ b/drivers/gpu/drm/panel/panel-simple.c +@@ -464,6 +464,7 @@ static int panel_dpi_probe(struct device *dev, + struct panel_desc *desc; + unsigned int bus_flags; + struct videomode vm; ++ const char *mapping = ""; + int ret; + + np = dev->of_node; +@@ -488,6 +489,21 @@ static int panel_dpi_probe(struct device *dev, + of_property_read_u32(np, "width-mm", &desc->size.width); + of_property_read_u32(np, "height-mm", &desc->size.height); + ++ of_property_read_string(np, "data-mapping", &mapping); ++ if (!strcmp(mapping, "rgb24")) { ++ desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24; ++ desc->bpc = 8; ++ } else if (!strcmp(mapping, "rgb565")) { ++ desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16; ++ desc->bpc = 6; ++ } else if (!strcmp(mapping, "bgr666")) { ++ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18; ++ desc->bpc = 6; ++ } else if (!strcmp(mapping, "lvds666")) { ++ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; ++ desc->bpc = 6; ++ } ++ + /* Extract bus_flags from display_timing */ + bus_flags = 0; + vm.flags = timing->flags; +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch deleted file mode 100644 index 9286c47..0000000 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 4fe56e7be311f93b67411ae092754af908c57d73 Mon Sep 17 00:00:00 2001 -From: Philippe Schenker -Date: Wed, 2 Nov 2022 14:25:56 +0100 -Subject: [PATCH 2/2] drivers: chipidea: disable runtime-pm for imx6ul - -Colibri iMX6ULL does not properly work with runtime-pm enabled. We see -two issues with that enabled: - -1. Runtime PM disconnects the line as it thinks there is no VBUS - - because this signal is not hooked up in hardware. The driver gets a - wakeup signal from the attached hub after about 2s which leads to a - reset loop. -2. In Dual-Role switching mode usb-device is not detected when plugged - in. The reason was never fully understood. - -Upstream-Status: Inappropriate [Configuration for colibri-imx6ull] - -Signed-off-by: Philippe Schenker ---- - drivers/usb/chipidea/ci_hdrc_imx.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c -index 9ffcecd3058c..de6de10dbd1b 100644 ---- a/drivers/usb/chipidea/ci_hdrc_imx.c -+++ b/drivers/usb/chipidea/ci_hdrc_imx.c -@@ -56,8 +56,7 @@ static const struct ci_hdrc_imx_platform_flag imx6sx_usb_data = { - }; - - static const struct ci_hdrc_imx_platform_flag imx6ul_usb_data = { -- .flags = CI_HDRC_SUPPORTS_RUNTIME_PM | -- CI_HDRC_TURN_VBUS_EARLY_ON | -+ .flags = CI_HDRC_TURN_VBUS_EARLY_ON | - CI_HDRC_DISABLE_DEVICE_STREAMING, - }; - --- -2.38.0 - diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0002-media-i2c-ov5640-Implement-get_mbus_config.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0002-media-i2c-ov5640-Implement-get_mbus_config.patch deleted file mode 100644 index 1d9bdb5..0000000 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0002-media-i2c-ov5640-Implement-get_mbus_config.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 9d247c3a53a1603d912e19ed7fc23eff13555fca Mon Sep 17 00:00:00 2001 -From: Aishwarya Kothari -Date: Wed, 25 Jan 2023 13:09:15 +0100 -Subject: [PATCH 2/2] media: i2c: ov5640: Implement get_mbus_config - -Implement the introduced get_mbus_config operation to report the -config of the MIPI CSI-2, BT.656 and Parallel interface. - -Signed-off-by: Aishwarya Kothari -Upstream-Status: Submitted [https://lore.kernel.org/all/20230306063649.7387-1-marcel@ziswiler.com/] ---- - drivers/media/i2c/ov5640.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c -index e0f908af581b..d50ce58d8032 100644 ---- a/drivers/media/i2c/ov5640.c -+++ b/drivers/media/i2c/ov5640.c -@@ -3733,6 +3733,24 @@ static int ov5640_init_cfg(struct v4l2_subdev *sd, - return 0; - } - -+static int ov5640_get_mbus_config(struct v4l2_subdev *sd, -+ unsigned int pad, -+ struct v4l2_mbus_config *cfg) -+{ -+ struct ov5640_dev *sensor = to_ov5640_dev(sd); -+ -+ cfg->type = sensor->ep.bus_type; -+ if (ov5640_is_csi2(sensor)) { -+ cfg->bus.mipi_csi2.num_data_lanes = -+ sensor->ep.bus.mipi_csi2.num_data_lanes; -+ cfg->bus.mipi_csi2.flags = sensor->ep.bus.mipi_csi2.flags; -+ } else { -+ cfg->bus.parallel.flags = sensor->ep.bus.parallel.flags; -+ } -+ -+ return 0; -+} -+ - static const struct v4l2_subdev_core_ops ov5640_core_ops = { - .log_status = v4l2_ctrl_subdev_log_status, - .subscribe_event = v4l2_ctrl_subdev_subscribe_event, -@@ -3753,6 +3771,7 @@ static const struct v4l2_subdev_pad_ops ov5640_pad_ops = { - .get_selection = ov5640_get_selection, - .enum_frame_size = ov5640_enum_frame_size, - .enum_frame_interval = ov5640_enum_frame_interval, -+ .get_mbus_config = ov5640_get_mbus_config, - }; - - static const struct v4l2_subdev_ops ov5640_subdev_ops = { --- -2.34.1 - diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch new file mode 100644 index 0000000..4f5e2c0 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-mainline-git/0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch @@ -0,0 +1,39 @@ +From 070e2b7b7c3ef6e640e13aeb120c958e09accbb1 Mon Sep 17 00:00:00 2001 +From: Philippe Schenker +Date: Wed, 2 Nov 2022 14:25:56 +0100 +Subject: [PATCH 3/4] drivers: chipidea: disable runtime-pm for imx6ul + +Colibri iMX6ULL does not properly work with runtime-pm enabled. We see +two issues with that enabled: + +1. Runtime PM disconnects the line as it thinks there is no VBUS - + because this signal is not hooked up in hardware. The driver gets a + wakeup signal from the attached hub after about 2s which leads to a + reset loop. +2. In Dual-Role switching mode usb-device is not detected when plugged + in. The reason was never fully understood. + +Upstream-Status: Inappropriate [Configuration for colibri-imx6ull] + +Signed-off-by: Philippe Schenker +--- + drivers/usb/chipidea/ci_hdrc_imx.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c +index e28bb2f2612d..4da4aa4ee70d 100644 +--- a/drivers/usb/chipidea/ci_hdrc_imx.c ++++ b/drivers/usb/chipidea/ci_hdrc_imx.c +@@ -57,8 +57,7 @@ static const struct ci_hdrc_imx_platform_flag imx6sx_usb_data = { + }; + + static const struct ci_hdrc_imx_platform_flag imx6ul_usb_data = { +- .flags = CI_HDRC_SUPPORTS_RUNTIME_PM | +- CI_HDRC_TURN_VBUS_EARLY_ON | ++ .flags = CI_HDRC_TURN_VBUS_EARLY_ON | + CI_HDRC_DISABLE_DEVICE_STREAMING, + }; + +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0004-media-i2c-ov5640-Implement-get_mbus_config.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0004-media-i2c-ov5640-Implement-get_mbus_config.patch new file mode 100644 index 0000000..7205135 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-mainline-git/0004-media-i2c-ov5640-Implement-get_mbus_config.patch @@ -0,0 +1,54 @@ +From 3317d3298cd06213d457ad7090ec0fd56eefc5d2 Mon Sep 17 00:00:00 2001 +From: Aishwarya Kothari +Date: Wed, 25 Jan 2023 13:09:15 +0100 +Subject: [PATCH 4/4] media: i2c: ov5640: Implement get_mbus_config + +Implement the introduced get_mbus_config operation to report the +config of the MIPI CSI-2, BT.656 and Parallel interface. + +Signed-off-by: Aishwarya Kothari +Upstream-Status: Submitted [https://lore.kernel.org/all/20230306063649.7387-1-marcel@ziswiler.com/] +--- + drivers/media/i2c/ov5640.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c +index 5fe85aa2d2ec..8cb966fb1b79 100644 +--- a/drivers/media/i2c/ov5640.c ++++ b/drivers/media/i2c/ov5640.c +@@ -3755,6 +3755,24 @@ static int ov5640_init_cfg(struct v4l2_subdev *sd, + return 0; + } + ++static int ov5640_get_mbus_config(struct v4l2_subdev *sd, ++ unsigned int pad, ++ struct v4l2_mbus_config *cfg) ++{ ++ struct ov5640_dev *sensor = to_ov5640_dev(sd); ++ ++ cfg->type = sensor->ep.bus_type; ++ if (ov5640_is_csi2(sensor)) { ++ cfg->bus.mipi_csi2.num_data_lanes = ++ sensor->ep.bus.mipi_csi2.num_data_lanes; ++ cfg->bus.mipi_csi2.flags = sensor->ep.bus.mipi_csi2.flags; ++ } else { ++ cfg->bus.parallel.flags = sensor->ep.bus.parallel.flags; ++ } ++ ++ return 0; ++} ++ + static const struct v4l2_subdev_core_ops ov5640_core_ops = { + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, +@@ -3775,6 +3793,7 @@ static const struct v4l2_subdev_pad_ops ov5640_pad_ops = { + .get_selection = ov5640_get_selection, + .enum_frame_size = ov5640_enum_frame_size, + .enum_frame_interval = ov5640_enum_frame_interval, ++ .get_mbus_config = ov5640_get_mbus_config, + }; + + static const struct v4l2_subdev_ops ov5640_subdev_ops = { +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-mainline_git.bb b/recipes-kernel/linux/linux-toradex-mainline_git.bb index e9bc377..713d098 100644 --- a/recipes-kernel/linux/linux-toradex-mainline_git.bb +++ b/recipes-kernel/linux/linux-toradex-mainline_git.bb @@ -27,11 +27,9 @@ SRC_URI = " \ SRC_URI:append = " \ file://0001-thermal-imx-Update-critical-temp-threshold.patch \ - file://0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch \ - file://0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch \ - file://0001-media-v4l2-async-fix-binding-async-subdevs-with-mult.patch \ - file://0002-media-i2c-ov5640-Implement-get_mbus_config.patch \ - file://0001-Revert-media-v4l2-async-Use-endpoints-in-__v4l2_asyn.patch \ + file://0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch \ + file://0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch \ + file://0004-media-i2c-ov5640-Implement-get_mbus_config.patch \ " LINUX_VERSION ?= "6.5-rc" -- cgit v1.2.3