diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2018-01-10 19:59:37 +0100 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2018-01-15 15:13:47 +0100 |
commit | 070ab1283a57d7bfff5cce9ce58be64b90173a8f (patch) | |
tree | 91b7b1c2eaaf799f8adf0fae7609ccee90e4d1e1 /drivers/gpu/drm/tinydrm/mi0283qt.c | |
parent | 22edc8d38ba5e912d0fd0d4d23ed268ae152c5ee (diff) |
drm/tinydrm/mipi-dbi: Add poweron-reset functions
Split out common poweron-reset functionality.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: David Lechner <david@lechnology.com>
Tested-by: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180110185940.53841-5-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/tinydrm/mi0283qt.c')
-rw-r--r-- | drivers/gpu/drm/tinydrm/mi0283qt.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index c69a4d958f24..1617405faed4 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c @@ -49,33 +49,17 @@ static int mi0283qt_init(struct mipi_dbi *mipi) { - struct tinydrm_device *tdev = &mipi->tinydrm; - struct device *dev = tdev->drm->dev; u8 addr_mode; int ret; DRM_DEBUG_KMS("\n"); - ret = regulator_enable(mipi->regulator); - if (ret) { - DRM_DEV_ERROR(dev, "Failed to enable regulator %d\n", ret); + ret = mipi_dbi_poweron_conditional_reset(mipi); + if (ret < 0) return ret; - } - - /* Avoid flicker by skipping setup if the bootloader has done it */ - if (mipi_dbi_display_is_on(mipi)) + if (ret == 1) return 0; - mipi_dbi_hw_reset(mipi); - ret = mipi_dbi_command(mipi, MIPI_DCS_SOFT_RESET); - if (ret) { - DRM_DEV_ERROR(dev, "Error sending command %d\n", ret); - regulator_disable(mipi->regulator); - return ret; - } - - msleep(20); - mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_OFF); mipi_dbi_command(mipi, ILI9341_PWCTRLB, 0x00, 0x83, 0x30); |