linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: chunkuang.hu@kernel.org, hsinyi@chromium.org,
	kernel@collabora.com, drinkcat@chromium.org, eizan@chromium.org,
	linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com,
	jitao.shi@mediatek.com, Daniel Vetter <daniel@ffwll.ch>,
	David Airlie <airlied@linux.ie>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware
Date: Wed, 14 Jul 2021 12:11:41 +0200	[thread overview]
Message-ID: <20210714121116.v2.7.Idbb4727ddf00ba2fe796b630906baff10d994d89@changeid> (raw)
In-Reply-To: <20210714101141.2089082-1-enric.balletbo@collabora.com>

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


  parent reply	other threads:[~2021-07-14 10:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/7] arm64: dts: mediatek: Move reset controller constants into common location Enric Balletbo i Serra
2021-07-30  5:04   ` Guenter Roeck
2021-08-06 15:43   ` Matthias Brugger
2021-07-14 10:11 ` [PATCH v2 2/7] dt-bindings: mediatek: Add #reset-cells to mmsys system controller Enric Balletbo i Serra
2021-07-16 17:42   ` Rob Herring
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 4/7] arm64: dts: mt8173: Add the mmsys reset bit to reset the dsi0 Enric Balletbo i Serra
2021-07-16 17:56   ` Rob Herring
2021-07-14 10:11 ` [PATCH v2 5/7] arm64: dts: mt8183: " Enric Balletbo i Serra
2021-07-16 17:57   ` Rob Herring
2021-07-14 10:11 ` [PATCH v2 6/7] soc: mediatek: mmsys: Add reset controller support Enric Balletbo i Serra
2021-07-20 10:52   ` Philipp Zabel
2021-07-20 17:07     ` Enric Balletbo i Serra
2021-07-21  9:53       ` Philipp Zabel
2021-08-06 17:34   ` Matthias Brugger
2021-07-14 10:11 ` Enric Balletbo i Serra [this message]
2021-08-02 23:21   ` [PATCH v2 7/7] drm/mediatek: mtk_dsi: Reset the dsi0 hardware Chun-Kuang Hu
2021-08-06 17:33   ` Matthias Brugger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210714121116.v2.7.Idbb4727ddf00ba2fe796b630906baff10d994d89@changeid \
    --to=enric.balletbo@collabora.com \
    --cc=airlied@linux.ie \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drinkcat@chromium.org \
    --cc=eizan@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=jitao.shi@mediatek.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).