* [PATCH v2 0/7] Add support to the mmsys driver to be a reset controller
@ 2021-07-14 10:11 Enric Balletbo i Serra
2021-07-14 10:11 ` [PATCH v2 3/7] dt-bindings: display: mediatek: add dsi reset optional property Enric Balletbo i Serra
2021-07-14 10:11 ` [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware Enric Balletbo i Serra
0 siblings, 2 replies; 6+ messages in thread
From: Enric Balletbo i Serra @ 2021-07-14 10:11 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arm-kernel, chunkuang.hu, drinkcat, jitao.shi,
Fabien Parent, David Airlie, Wim Van Sebroeck, eizan, devicetree,
Rob Herring, linux-mediatek, dri-devel, hsinyi, matthias.bgg,
Crystal Guo, kernel, Guenter Roeck, linux-watchdog
Dear all,
The following patchset is a reimplementation of the patch sent by Jitao
Shi [1] some time ago. As suggested by Chun-Kuang Hu, this time the
reset is done using the reset API, where the mmsys driver is the reset
controller and the mtk_dsi driver is the reset consumer.
Note that the first patch is kind of unrelated change, it's just a
cleanup but is needed if you want to apply all the following patches
cleanly.
This patchset is important in order to have the DSI panel working on some
kukui MT8183 Chromebooks (i.e Lenovo IdeaPad Duet). Without it, you just
get a black screen.
Best regards,
Enric
[1] https://lore.kernel.org/linux-arm-kernel/20210420132614.150242-4-jitao.shi@mediatek.com/
Changes in v2:
- Fix build test ERROR Reported-by: kernel test robot <lkp@intel.com>
- Added a new patch to describe the dsi reset optional property.
Enric Balletbo i Serra (7):
arm64: dts: mediatek: Move reset controller constants into common
location
dt-bindings: mediatek: Add #reset-cells to mmsys system controller
dt-bindings: display: mediatek: add dsi reset optional property
arm64: dts: mt8173: Add the mmsys reset bit to reset the dsi0
arm64: dts: mt8183: Add the mmsys reset bit to reset the dsi0
soc: mediatek: mmsys: Add reset controller support
drm/mediatek: mtk_dsi: Reset the dsi0 hardware
.../bindings/arm/mediatek/mediatek,mmsys.txt | 2 +
.../display/mediatek/mediatek,dsi.txt | 6 ++
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 5 +-
drivers/gpu/drm/mediatek/mtk_dsi.c | 5 +-
drivers/soc/mediatek/mtk-mmsys.c | 69 +++++++++++++++++++
drivers/soc/mediatek/mtk-mmsys.h | 2 +
drivers/watchdog/mtk_wdt.c | 6 +-
.../mt2712-resets.h | 0
include/dt-bindings/reset/mt8173-resets.h | 2 +
.../mt8183-resets.h | 3 +
.../mt8192-resets.h | 0
12 files changed, 96 insertions(+), 6 deletions(-)
rename include/dt-bindings/{reset-controller => reset}/mt2712-resets.h (100%)
rename include/dt-bindings/{reset-controller => reset}/mt8183-resets.h (98%)
rename include/dt-bindings/{reset-controller => reset}/mt8192-resets.h (100%)
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 3/7] dt-bindings: display: mediatek: add dsi reset optional property
2021-07-14 10:11 [PATCH v2 0/7] Add support to the mmsys driver to be a reset controller Enric Balletbo i Serra
@ 2021-07-14 10:11 ` Enric Balletbo i Serra
2021-07-16 17:55 ` Rob Herring
2021-07-14 10:11 ` [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware Enric Balletbo i Serra
1 sibling, 1 reply; 6+ messages in thread
From: Enric Balletbo i Serra @ 2021-07-14 10:11 UTC (permalink / raw)
To: linux-kernel
Cc: chunkuang.hu, drinkcat, jitao.shi, devicetree, David Airlie,
dri-devel, eizan, Rob Herring, linux-mediatek, hsinyi,
matthias.bgg, kernel, linux-arm-kernel
Update device tree binding documentation for the dsi to add the optional
property to reset the dsi controller.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
Changes in v2:
- Added a new patch to describe the dsi reset optional property.
.../devicetree/bindings/display/mediatek/mediatek,dsi.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt b/Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt
index 8238a86686be..3209b700ded6 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt
@@ -19,6 +19,11 @@ Required properties:
Documentation/devicetree/bindings/graph.txt. This port should be connected
to the input port of an attached DSI panel or DSI-to-eDP encoder chip.
+Optional properties:
+- resets: list of phandle + reset specifier pair, as described in [1].
+
+[1] Documentation/devicetree/bindings/reset/reset.txt
+
MIPI TX Configuration Module
============================
@@ -45,6 +50,7 @@ dsi0: dsi@1401b000 {
clocks = <&mmsys MM_DSI0_ENGINE>, <&mmsys MM_DSI0_DIGITAL>,
<&mipi_tx0>;
clock-names = "engine", "digital", "hs";
+ resets = <&mmsys MT8173_MMSYS_SW0_RST_B_DISP_DSI0>;
phys = <&mipi_tx0>;
phy-names = "dphy";
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 3/7] dt-bindings: display: mediatek: add dsi reset optional property
2021-07-14 10:11 ` [PATCH v2 3/7] dt-bindings: display: mediatek: add dsi reset optional property Enric Balletbo i Serra
@ 2021-07-16 17:55 ` Rob Herring
0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-07-16 17:55 UTC (permalink / raw)
To: Enric Balletbo i Serra
Cc: chunkuang.hu, drinkcat, jitao.shi, devicetree, David Airlie,
linux-kernel, dri-devel, eizan, Rob Herring, linux-mediatek,
hsinyi, matthias.bgg, kernel, linux-arm-kernel
On Wed, 14 Jul 2021 12:11:37 +0200, Enric Balletbo i Serra wrote:
> Update device tree binding documentation for the dsi to add the optional
> property to reset the dsi controller.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
> Changes in v2:
> - Added a new patch to describe the dsi reset optional property.
>
> .../devicetree/bindings/display/mediatek/mediatek,dsi.txt | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware
2021-07-14 10:11 [PATCH v2 0/7] Add support to the mmsys driver to be a reset controller Enric Balletbo i Serra
2021-07-14 10:11 ` [PATCH v2 3/7] dt-bindings: display: mediatek: add dsi reset optional property Enric Balletbo i Serra
@ 2021-07-14 10:11 ` Enric Balletbo i Serra
2021-08-02 23:21 ` Chun-Kuang Hu
2021-08-06 17:33 ` Matthias Brugger
1 sibling, 2 replies; 6+ messages in thread
From: Enric Balletbo i Serra @ 2021-07-14 10:11 UTC (permalink / raw)
To: linux-kernel
Cc: chunkuang.hu, drinkcat, jitao.shi, David Airlie, dri-devel, eizan,
linux-mediatek, hsinyi, matthias.bgg, kernel, linux-arm-kernel
Reset dsi0 HW to default when power on. This prevents to have different
settingbetween the bootloader and the kernel.
As not all Mediatek boards have the reset consumer configured in their
board description, also is not needed on all of them, the reset is optional,
so the change is compatible with all boards.
Cc: Jitao Shi <jitao.shi@mediatek.com>
Suggested-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
(no changes since v1)
drivers/gpu/drm/mediatek/mtk_dsi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index ae403c67cbd9..d8b81e2ab841 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -11,6 +11,7 @@
#include <linux/of_platform.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
+#include <linux/reset.h>
#include <video/mipi_display.h>
#include <video/videomode.h>
@@ -980,8 +981,10 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
struct mtk_dsi *dsi = dev_get_drvdata(dev);
ret = mtk_dsi_encoder_init(drm, dsi);
+ if (ret)
+ return ret;
- return ret;
+ return device_reset_optional(dev);
}
static void mtk_dsi_unbind(struct device *dev, struct device *master,
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware
2021-07-14 10:11 ` [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware Enric Balletbo i Serra
@ 2021-08-02 23:21 ` Chun-Kuang Hu
2021-08-06 17:33 ` Matthias Brugger
1 sibling, 0 replies; 6+ messages in thread
From: Chun-Kuang Hu @ 2021-08-02 23:21 UTC (permalink / raw)
To: Enric Balletbo i Serra
Cc: linux-kernel, Chun-Kuang Hu, Hsin-Yi Wang, Collabora Kernel ML,
Nicolas Boichat, Eizan Miyamoto,
moderated list:ARM/Mediatek SoC support, Matthias Brugger,
Jitao Shi, Daniel Vetter, David Airlie, Philipp Zabel,
DRI Development, Linux ARM
Hi, Enric:
Enric Balletbo i Serra <enric.balletbo@collabora.com> 於 2021年7月14日 週三 下午6:12寫道:
>
> Reset dsi0 HW to default when power on. This prevents to have different
> settingbetween the bootloader and the kernel.
>
> As not all Mediatek boards have the reset consumer configured in their
> board description, also is not needed on all of them, the reset is optional,
> so the change is compatible with all boards.
Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
>
> Cc: Jitao Shi <jitao.shi@mediatek.com>
> Suggested-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
> (no changes since v1)
>
> drivers/gpu/drm/mediatek/mtk_dsi.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index ae403c67cbd9..d8b81e2ab841 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -11,6 +11,7 @@
> #include <linux/of_platform.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> +#include <linux/reset.h>
>
> #include <video/mipi_display.h>
> #include <video/videomode.h>
> @@ -980,8 +981,10 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
> struct mtk_dsi *dsi = dev_get_drvdata(dev);
>
> ret = mtk_dsi_encoder_init(drm, dsi);
> + if (ret)
> + return ret;
>
> - return ret;
> + return device_reset_optional(dev);
> }
>
> static void mtk_dsi_unbind(struct device *dev, struct device *master,
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware
2021-07-14 10:11 ` [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware Enric Balletbo i Serra
2021-08-02 23:21 ` Chun-Kuang Hu
@ 2021-08-06 17:33 ` Matthias Brugger
1 sibling, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2021-08-06 17:33 UTC (permalink / raw)
To: Enric Balletbo i Serra, linux-kernel
Cc: chunkuang.hu, hsinyi, kernel, drinkcat, eizan, linux-mediatek,
jitao.shi, Daniel Vetter, David Airlie, Philipp Zabel, dri-devel,
linux-arm-kernel
On 14/07/2021 12:11, Enric Balletbo i Serra wrote:
> Reset dsi0 HW to default when power on. This prevents to have different
> settingbetween the bootloader and the kernel.
settings between the...
>
> As not all Mediatek boards have the reset consumer configured in their
> board description, also is not needed on all of them, the reset is optional,
> so the change is compatible with all boards.
>
> Cc: Jitao Shi <jitao.shi@mediatek.com>
> Suggested-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
>
> (no changes since v1)
>
> drivers/gpu/drm/mediatek/mtk_dsi.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index ae403c67cbd9..d8b81e2ab841 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -11,6 +11,7 @@
> #include <linux/of_platform.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> +#include <linux/reset.h>
>
> #include <video/mipi_display.h>
> #include <video/videomode.h>
> @@ -980,8 +981,10 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
> struct mtk_dsi *dsi = dev_get_drvdata(dev);
>
> ret = mtk_dsi_encoder_init(drm, dsi);
> + if (ret)
> + return ret;
>
> - return ret;
> + return device_reset_optional(dev);
> }
>
> static void mtk_dsi_unbind(struct device *dev, struct device *master,
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-08-06 17:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-14 10:11 [PATCH v2 0/7] Add support to the mmsys driver to be a reset controller Enric Balletbo i Serra
2021-07-14 10:11 ` [PATCH v2 3/7] dt-bindings: display: mediatek: add dsi reset optional property Enric Balletbo i Serra
2021-07-16 17:55 ` Rob Herring
2021-07-14 10:11 ` [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware Enric Balletbo i Serra
2021-08-02 23:21 ` Chun-Kuang Hu
2021-08-06 17:33 ` Matthias Brugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox