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@m...
Enric Balletbo i Serra (6): arm64: dts: mediatek: Move reset controller constants into common location dt-bindings: mediatek: Add #reset-cells to mmsys system controller 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 + 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 + .../mt2712-resets.h | 0 include/dt-bindings/reset/mt8173-resets.h | 2 + .../mt8183-resets.h | 3 + .../mt8192-resets.h | 0 10 files changed, 87 insertions(+), 3 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%)
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 ---
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,
dri-devel@lists.freedesktop.org