From patchwork Sat Aug 10 04:54:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Vipin X-Patchwork-Id: 13759410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7206C3DA7F for ; Sat, 10 Aug 2024 04:55:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 072B110E028; Sat, 10 Aug 2024 04:55:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EEEvhdRy"; dkim-atps=neutral Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26DE610E028 for ; Sat, 10 Aug 2024 04:55:05 +0000 (UTC) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3db50abf929so2016962b6e.2 for ; Fri, 09 Aug 2024 21:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723265704; x=1723870504; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IS2eypZenlB0YB7xDQlNlol297l5Xqi9mIfw1aOttS8=; b=EEEvhdRybTieHcJhwKIvXcStgEF25D6nnr0v9ROIEv2xX6qUlTJ/zWGrbf/GDlWdLZ wLRchDwtOaIc7pG9EvgRfhtWeQ21fWFdyvxvpu5Kcea3oiRP8OBKYYmUDWFEzLf2QqBv xcvWV7W0iR99WxbXZ5CvKgiqYJDVfJZK2b0iRzY7FRoob1tz3dhGAh1BDygLmesJ90pg Wl8Zu/S5A0bF8+dTjoWt8Gjl6IQU3GoB3tZjyNQWZYsPmXdlGcUq2Mov7XmFsBQ219e8 3mgZ/pLRq85SJOyoAlavsk8FZ/lWJNXz7VjM85hJ9W9MTooW3nCMCCzg7RRTlIn14bth gMGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723265704; x=1723870504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IS2eypZenlB0YB7xDQlNlol297l5Xqi9mIfw1aOttS8=; b=wk9SJlUjoAF8Q/v5GpfVtaT6gHsegMKVAfMxYzkpzulK+uj6kFz5DI/yraypleFdOB DEQMrs/Yd4T88sNCseXRFGaft6B5IJZtO0WAJefcm2HR7XQY+lBft17OvMD1TAZZDDDA uBi1rzUGWRMngql3MYcG7G1LrTE/CUb0khzEh7wrjk3IqgR7V8vO4xfjCtBx1YmNGzVE d20oDGRl0ezXy8QZ6Oh6VBVbQzYm45g+2cyhPxwthvRwn6UfT6d7FLcrgbbK7uGNzeqU xo/wbyyCZbcidhqRp95tfxjbvDNi22loHBHnwoMSjVQBu6iJMKwNFSqk1+aX3S5wG8es vjYw== X-Forwarded-Encrypted: i=1; AJvYcCVJVkSk+5ncNUDZ/dJGEdVVJmRVYhEUxsxcyn27LCOMRrFgUlAe+A0H2y7FDlH+L47RoTE28ZndeF0b/JaYbY4Yi7jmUhpoLFahHSykx7Yl X-Gm-Message-State: AOJu0YySJE0QAIJTngHLDOwtZAec1zV4m6cpQxqJI534ek3wce3RRQC2 55JqyxXDOG0WIZbYIPtAMyfg2P327YCvUbfF1Gz5hfkHOZ2eVIMG X-Google-Smtp-Source: AGHT+IHDNq0Y0g8CWga0ectmzl5Wbkm4MdbLEC+pLI0m00o5hpFZx9xFMZDa1UF7ISR8lw2Pl0kiiw== X-Received: by 2002:a05:6808:6542:b0:3d9:3e48:8b13 with SMTP id 5614622812f47-3dc4166b4d4mr3997158b6e.10.1723265704323; Fri, 09 Aug 2024 21:55:04 -0700 (PDT) Received: from distilledx.srmu.edu.in ([103.4.221.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-200bb8fd82asm5227005ad.73.2024.08.09.21.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 21:55:04 -0700 (PDT) From: Tejas Vipin To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, neil.armstrong@linaro.org, quic_jesszhan@quicinc.com Cc: dianders@chromium.org, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tejas Vipin Subject: [PATCH 1/2] drm/mipi-dsi: Add mipi_dsi_dcs_set_tear_scanline_multi Date: Sat, 10 Aug 2024 10:24:03 +0530 Message-ID: <20240810045404.188146-2-tejasvipin76@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240810045404.188146-1-tejasvipin76@gmail.com> References: <20240810045404.188146-1-tejasvipin76@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" mipi_dsi_dcs_set_tear_scanline_multi can heavily benefit from being converted to a multi style function as it is often called in the context of similar functions. Signed-off-by: Tejas Vipin Reviewed-by: Douglas Anderson --- drivers/gpu/drm/drm_mipi_dsi.c | 31 +++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 2 ++ 2 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 8d0a866cf1e0..b7ad18c148c2 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -1339,6 +1339,9 @@ EXPORT_SYMBOL(mipi_dsi_dcs_set_pixel_format); * @dsi: DSI peripheral device * @scanline: scanline to use as trigger * + * This function is deprecated. Use mipi_dsi_dcs_set_tear_scanline_multi() + * instead. + * * Return: 0 on success or a negative error code on failure */ int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline) @@ -1833,6 +1836,34 @@ void mipi_dsi_dcs_set_page_address_multi(struct mipi_dsi_multi_context *ctx, } EXPORT_SYMBOL(mipi_dsi_dcs_set_page_address_multi); +/** + * mipi_dsi_dcs_set_tear_scanline_multi() - set the scanline to use as trigger for + * the Tearing Effect output signal of the display module + * @ctx: Context for multiple DSI transactions + * @scanline: scanline to use as trigger + * + * Like mipi_dsi_dcs_set_tear_scanline() but deals with errors in a way that + * makes it convenient to make several calls in a row. + */ +void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx, + u16 scanline) +{ + struct mipi_dsi_device *dsi = ctx->dsi; + struct device *dev = &dsi->dev; + int ret; + + if (ctx->accum_err) + return; + + ret = mipi_dsi_dcs_set_tear_scanline(dsi, scanline); + if (ret < 0) { + ctx->accum_err = ret; + dev_err(dev, "Failed to set tear scanline: %d\n", + ctx->accum_err); + } +} +EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline_multi); + static int mipi_dsi_drv_probe(struct device *dev) { struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver); diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 602be6ce081a..c823cc13ad1f 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -375,6 +375,8 @@ void mipi_dsi_dcs_set_column_address_multi(struct mipi_dsi_multi_context *ctx, u16 start, u16 end); void mipi_dsi_dcs_set_page_address_multi(struct mipi_dsi_multi_context *ctx, u16 start, u16 end); +void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx, + u16 scanline); /** * mipi_dsi_generic_write_seq - transmit data using a generic write packet From patchwork Sat Aug 10 04:54:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Vipin X-Patchwork-Id: 13759411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF92AC3DA7F for ; Sat, 10 Aug 2024 04:55:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 11A1610E0B9; Sat, 10 Aug 2024 04:55:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c3PEMKKE"; dkim-atps=neutral Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51DA010E0B9 for ; Sat, 10 Aug 2024 04:55:08 +0000 (UTC) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1fc66fc35f2so27005425ad.0 for ; Fri, 09 Aug 2024 21:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723265708; x=1723870508; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=19rt3cYGIz9ovZGS8R2mAVuVxzzyQDGkKj8/iUwXAXE=; b=c3PEMKKEOyvjSl3mtq3zM1exzZSKa9LWNRWkoJQBYle4wj2lT9T9TulcZ2xBcfZ+XG oXkQ0P32sap/QoxYh6AMBYEcJTQwencbCYlqheR5YdFXvtblAWcLrk+vKBxaeU1P6L17 kladhGiGH1tToJJMHDg7UDuisMKtlcEDbkhNj+YjXJAr2+oVPYph0RV933+OnUgJJzoZ 6K+TlOsf80Ca0//9mDzjQwA79W0vMdUfuFSS1BFg4AqK8Msk30SnqaQpxurinReH/Pmu IQ6DKOQKT8VKalzB+yVTDeeYWT0+4HXRndecV6icZJiHAYH1MMthYdrBOw4Od6QpNAel B3wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723265708; x=1723870508; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=19rt3cYGIz9ovZGS8R2mAVuVxzzyQDGkKj8/iUwXAXE=; b=wjF5x22mPQon2JgQFpINS/KWPllox+KA3JBAe97ZjTDwuTLbwng1lSSfbvPsi/C1Im MomPZ1ZNeYXZOYPiri7Ad/EPVg+BCSeF4yx0DxIn/+wIgCJ8oO5puEVspFVessFyRwCU 8lv5aR03YuoiiL5Ktw+Fahrwy5LVBhXRBt6j/PcoJylgOUD1Jlo+K8wfjhhbuSBXPxME xioYUTj9u4pwcYDcsQZZ2P11V/9V/E7g1zJXrNiGbtGjJaJHcWjY+hAsDhe9HEkr7MZo lfzhQlZHsNOISUpNYypDjlORQIrK9A6xaoxHBvGQsc0XrE5y1Sh1C84g9e5CoZsDu+X1 xhKA== X-Forwarded-Encrypted: i=1; AJvYcCWsxNz+P62zeU0FpFSqFwfD/Ip3HWlk6q/H4XA/VcJgiN/Gh9nz8X9z2PvgfuPFoE3QJBEl6npcbQQ3Lp2gsMtiLYDDMqJbr9XWRzuEOyJB X-Gm-Message-State: AOJu0Ywn8dRybFs8xannPRETRxdu5h/CUBJJnJno6OMVUAQ++iI6VJfY KZRFI2juYmblKD2NQXPtI4UiQJnwT/owHrrgzAusmJ1N7pzNdKq3 X-Google-Smtp-Source: AGHT+IHlx1kQsTJ98HNGtbgTUm2+DBvCCePAmf3vd6I3xO5Wjd0CVQtCUkh5r/ZzM9mb4PGZk+PFeQ== X-Received: by 2002:a17:903:2345:b0:1f7:3a70:9e71 with SMTP id d9443c01a7336-200ae540e3amr57633735ad.13.1723265707658; Fri, 09 Aug 2024 21:55:07 -0700 (PDT) Received: from distilledx.srmu.edu.in ([103.4.221.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-200bb8fd82asm5227005ad.73.2024.08.09.21.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 21:55:07 -0700 (PDT) From: Tejas Vipin To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, neil.armstrong@linaro.org, quic_jesszhan@quicinc.com Cc: dianders@chromium.org, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tejas Vipin Subject: [PATCH 2/2] drm/panel: jdi-fhd-r63452: transition to mipi_dsi wrapped functions Date: Sat, 10 Aug 2024 10:24:04 +0530 Message-ID: <20240810045404.188146-3-tejasvipin76@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240810045404.188146-1-tejasvipin76@gmail.com> References: <20240810045404.188146-1-tejasvipin76@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Changes the jdi-fhd-r63452 panel to use multi style functions for improved error handling. Signed-off-by: Tejas Vipin --- drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 125 ++++++------------- 1 file changed, 39 insertions(+), 86 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c index 483dc88d16d8..32a244d4bae7 100644 --- a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c +++ b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c @@ -41,79 +41,41 @@ static void jdi_fhd_r63452_reset(struct jdi_fhd_r63452 *ctx) static int jdi_fhd_r63452_on(struct jdi_fhd_r63452 *ctx) { struct mipi_dsi_device *dsi = ctx->dsi; - struct device *dev = &dsi->dev; - int ret; + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; dsi->mode_flags |= MIPI_DSI_MODE_LPM; - mipi_dsi_generic_write_seq(dsi, 0xb0, 0x00); - mipi_dsi_generic_write_seq(dsi, 0xd6, 0x01); - mipi_dsi_generic_write_seq(dsi, 0xec, - 0x64, 0xdc, 0xec, 0x3b, 0x52, 0x00, 0x0b, 0x0b, - 0x13, 0x15, 0x68, 0x0b, 0xb5); - mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x00); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xd6, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xec, + 0x64, 0xdc, 0xec, 0x3b, 0x52, 0x00, 0x0b, 0x0b, + 0x13, 0x15, 0x68, 0x0b, 0xb5); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x03); - ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); - if (ret < 0) { - dev_err(dev, "Failed to set tear on: %d\n", ret); - return ret; - } + mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK); - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_ADDRESS_MODE, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x00); - ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x77); - if (ret < 0) { - dev_err(dev, "Failed to set pixel format: %d\n", ret); - return ret; - } + mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx, 0x77); + mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0x0000, 0x0437); + mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0x0000, 0x077f); + mipi_dsi_dcs_set_tear_scanline_multi(&dsi_ctx, 0x0000); + mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, 0x00ff); - ret = mipi_dsi_dcs_set_column_address(dsi, 0x0000, 0x0437); - if (ret < 0) { - dev_err(dev, "Failed to set column address: %d\n", ret); - return ret; - } + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x24); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_CABC_MIN_BRIGHTNESS, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x84, 0x00); - ret = mipi_dsi_dcs_set_page_address(dsi, 0x0000, 0x077f); - if (ret < 0) { - dev_err(dev, "Failed to set page address: %d\n", ret); - return ret; - } - - ret = mipi_dsi_dcs_set_tear_scanline(dsi, 0x0000); - if (ret < 0) { - dev_err(dev, "Failed to set tear scanline: %d\n", ret); - return ret; - } + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 20); + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 80); - ret = mipi_dsi_dcs_set_display_brightness(dsi, 0x00ff); - if (ret < 0) { - dev_err(dev, "Failed to set display brightness: %d\n", ret); - return ret; - } - - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x24); - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_CABC_MIN_BRIGHTNESS, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0x84, 0x00); - - ret = mipi_dsi_dcs_set_display_on(dsi); - if (ret < 0) { - dev_err(dev, "Failed to set display on: %d\n", ret); - return ret; - } - msleep(20); - - ret = mipi_dsi_dcs_exit_sleep_mode(dsi); - if (ret < 0) { - dev_err(dev, "Failed to exit sleep mode: %d\n", ret); - return ret; - } - msleep(80); - - mipi_dsi_generic_write_seq(dsi, 0xb0, 0x04); - mipi_dsi_dcs_write_seq(dsi, 0x84, 0x00); - mipi_dsi_generic_write_seq(dsi, 0xc8, 0x11); - mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x04); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x84, 0x00); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xc8, 0x11); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x03); return 0; } @@ -121,31 +83,22 @@ static int jdi_fhd_r63452_on(struct jdi_fhd_r63452 *ctx) static int jdi_fhd_r63452_off(struct jdi_fhd_r63452 *ctx) { struct mipi_dsi_device *dsi = ctx->dsi; - struct device *dev = &dsi->dev; - int ret; + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi }; dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; - mipi_dsi_generic_write_seq(dsi, 0xb0, 0x00); - mipi_dsi_generic_write_seq(dsi, 0xd6, 0x01); - mipi_dsi_generic_write_seq(dsi, 0xec, - 0x64, 0xdc, 0xec, 0x3b, 0x52, 0x00, 0x0b, 0x0b, - 0x13, 0x15, 0x68, 0x0b, 0x95); - mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); - - ret = mipi_dsi_dcs_set_display_off(dsi); - if (ret < 0) { - dev_err(dev, "Failed to set display off: %d\n", ret); - return ret; - } - usleep_range(2000, 3000); - - ret = mipi_dsi_dcs_enter_sleep_mode(dsi); - if (ret < 0) { - dev_err(dev, "Failed to enter sleep mode: %d\n", ret); - return ret; - } - msleep(120); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x00); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xd6, 0x01); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xec, + 0x64, 0xdc, 0xec, 0x3b, 0x52, 0x00, 0x0b, 0x0b, + 0x13, 0x15, 0x68, 0x0b, 0x95); + mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x03); + + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); + if (!dsi_ctx.accum_err) + usleep_range(2000, 3000); + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 120); return 0; }