From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796038943; b=apjcr7pY+SkCYxcFqGNztfK7AzjmD1/mKYklhMhHXmT6JPlTl8vSJQv/lTDMyEJfKiz/ HyPB2o/a8u1tcY/ne7ZJZifSzQv4VuM6SsmT/NM6Qqk6eSQP2bihLwCKj4UaM9FBxr9Tc RVBdVAQPceUnH8SyLf9KnEdi9hTKWy0SA5ynyc1qhKHnP3PiPffr0HePUjXBuxAkjWpwm un9SfEIIaZyqoczUI5qQ8uj2cDc97Ia1StyMrdlIRLvEUvcK+4w0P2LPYc0U0Glcs1Sy8 QZaJgcXKrqpCEhUF7evp6Ac66QXTqEFNSNQzR+7DrSCieCoHa9oM0zFtOrOwOwXGmHw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796038943; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=5zmMUpT3vvlpzDVPpzJ3YLzPxFR0VtCBMhv9lxMpM2o=; b=fGZXO3ZKM36GfMjKHnGlLIhBUuAgELfdPki3I/EYUJuiCvMRTcZvVlM9Cy+PZm/s+kpo 5S29KY38Pl4F0gTSkDkysW97CyDmKMpyeAX+c0OYc0alWCwPH409JtOZScsWv77Cl0Qr2 wnXxobHDn4FnAeWeBAl5DCN+6RYZHs/ctejBnBozyuPPB5i1Jrx529S40myOVSj7wx7NR m0CjRtWMJGNdK0TpF+Wsxk98uqmQObTkOpBlfdGYN7cIbph7TxH5hIg45pL2V+uyZzpKd ugVat2Aq8iMbJpIeQ0V8O2OedGTT3g8zVBcOdlS0IW3lpTVYKswDyM+i/SgCD2ICyDg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XIK7S0T5; arc=none smtp.remote-ip=209.85.218.45 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1800D606A683 for ; Mon, 30 Nov 2026 11:42:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1800D606A683 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XIK7S0T5 Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-c5188e4980fso795125566b.2 for ; Mon, 30 Nov 2026 03:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796038941; x=1796643741; darn=vger.kernel.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:content-type; bh=5zmMUpT3vvlpzDVPpzJ3YLzPxFR0VtCBMhv9lxMpM2o=; b=XIK7S0T5VtsdrFGhCttPOhDDLjEmuSPVQKSRn9Dj8S5FzA2Kmy+UeiNMNLCtGc9lWv Z9gkNxMktFdvTXm7kYOOOLUpqotO/QaShKCAo0kr9ALQsd9I+TcNDjjFeOA0NI5Xs+rX CfEV/32QdkWI9cdoTbqWDkY/5lY1SI+feY5AMBszeACesUBADXOGJ7CMQ7o+4OrHB7MW lIxuwaXNrd+GV4xL5rpM1RY4g5fdQd00jHmz5/yTdjDfvdnRqLmPoCdiiBW7TQ7aIpdY pIgyQ8fKbbbM/V+peD9vicuhZY51tWH9groWj5/iF8c4r11WPUj4IlN4oy7iAdjE103A lSTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796038941; x=1796643741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=5zmMUpT3vvlpzDVPpzJ3YLzPxFR0VtCBMhv9lxMpM2o=; b=b5hnwd94KduVBUrLALJ4kP+Rxao/EkCbMNuZ3pS4SCNV1cn0PXIc+j7c/AOjOglUfm qdwIcyf7ah3iZNYH2N90WzSh6SVxeC6EYVOcHynCUbPRl3OQwEKGv8CKwgWjeBMVojrJ m/PZlqF0rUhxfjGKUjAV1F/5DQPGBvX7/5EoDpp6dOwZ5Ns4X0BegzVhV08GJQFvobUd 9n4/1i4hqsFzoR8Ep41DWJH5Y6HLtLBaZqXPgiwOBuWl8sXB+HKvVkrqocIIC21clE+V N0XEYs8OmtlhhYp1C4RtVMuJUAbiVtwbKfWnJcqIY+Y60PLkaBolRCq99dnWvrlzcdZk u40A== X-Forwarded-Encrypted: i=1; AL+hErFaw1eS6qnfmV4ULD4j0oT9w9NaiM83brDM94HPUpnyMKMZ1+xc2dIayiufYwQDqdAJvCnDws5iAiFt8YM=@vger.kernel.org X-Gm-Message-State: APuU4Z97klZQRTKdPQGrmNB7bK5aV3aZJ/kySgcLWmqJvcdCoPqtfYRN 7jYAajHh+hJl3YVLLwUSr/xUcafFm2q8Ir1FsdpKPpvmVAKemnYJC/WI X-Gm-Gg: AZFdTZcNnoFLl5gTd2PDWS64zmQ9dVkYO854QQfaELqbAlS+s2jWih3RmvyARCl/R27 ipzmKltX9KT/84/FryYmRQbHoDu2kXPDdw8e5xkansZEPOOKLcB6hV1x0TvtOqivXnGuTJBhCnt haCboNBMl2I/SulBZx5KMk/nQFxRozCjf3Ov6IJj81r8rGIHiGuvyZPQ3n3xQS24kAVSXWJZ0Qh 9xgTjLLDW0LuajTlL3SXjHP8b9QhBeJQ7948wYlxITb2pfhvHbvw/hVT+uWa2d12ovXSfa5qdND VitsFqver551OsgLpeNID2LvFDwU7s25J9TJWiHKv4/AWcL3VDS+PznjFueC4Fam0VnwxID4yK0 ArOOJ4956KOkNmAYChnHOHZwLL5FZZ+2ZtOlb0ZK+B9afn95RnLOfJ4dbP2Doc0nK+EVPhb9N0X btfcmpdonamYVo/EZbmSoHVgMOajcJ+2s2Snb7m0jfiS7rF+3Jsw3cIV83a6ZmFKjo8R48Q5YA+ vW6+MidmMS+zYb9Eq0bI3naaszBrXLsqsm51BxanMkZEICK3B+f4CrmsE0KFVMmrKj5aXxSG8vP PLm8h99UhUHm/t8m/cGriFsuKckvUyvdMjaEzxvFE8NpnQJuyXE5KZiv4/knaBDX4G9ktudJCr+ 8iIvZwsMk4g== X-Received: by 2002:a17:906:7944:b0:c41:8e21:4d58 with SMTP id a640c23a62f3a-c513a41edc0mr2636496766b.5.1796038941316; Mon, 30 Nov 2026 03:42:21 -0800 (PST) Received: from xeon ([188.163.112.54]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513afc73d3sm1139733466b.64.2026.11.30.03.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 03:42:20 -0800 (PST) From: Svyatoslav Ryhel To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Jonathan Hunter , Neil Armstrong , Jessica Zhang , Mikko Perttunen , Svyatoslav Ryhel Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 03/13] drm/panel: panel-hitachi-tx10d07vm0baa: Convert to mipi_dbi_write_seq_multi() Date: Mon, 30 Nov 2026 13:41:44 +0200 Message-ID: <20261130114155.72920-4-clamor95@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261130114155.72920-1-clamor95@gmail.com> References: <20261130114155.72920-1-clamor95@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Switch from the internal panel command-sending macro to a generic one to improve code reuse. Reviewed-by: Mikko Perttunen Signed-off-by: Svyatoslav Ryhel --- .../drm/panel/panel-hitachi-tx10d07vm0baa.c | 213 +++++++++--------- 1 file changed, 101 insertions(+), 112 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c b/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c index 8c17132728807..37bbd93edd8d0 100644 --- a/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c +++ b/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c @@ -34,19 +34,6 @@ static inline struct hitachi_tx10d07vm0baa *to_hitachi_tx10d07vm0baa(struct drm_ return container_of(panel, struct hitachi_tx10d07vm0baa, panel); } -#define panel_dbi_command(priv, cmd, seq...) \ -({ \ - const u8 d[] = { seq }; \ - struct drm_panel *panel = &(priv)->panel; \ - struct mipi_dbi_device *dbidev = (priv)->dbidev; \ - struct device *dev = panel->dev; \ - int ret; \ - ret = mipi_dbi_command_stackbuf((dbidev)->dbi, cmd, d, ARRAY_SIZE(d)); \ - if (ret) \ - dev_err_ratelimited(dev, "error %d when sending command %#02x\n", ret, cmd); \ - ret; \ -}) - static int hitachi_tx10d07vm0baa_prepare(struct drm_panel *panel) { struct hitachi_tx10d07vm0baa *priv = to_hitachi_tx10d07vm0baa(panel); @@ -73,118 +60,120 @@ static int hitachi_tx10d07vm0baa_prepare(struct drm_panel *panel) static int hitachi_tx10d07vm0baa_enable(struct drm_panel *panel) { struct hitachi_tx10d07vm0baa *priv = to_hitachi_tx10d07vm0baa(panel); - - panel_dbi_command(priv, MIPI_DCS_SET_PARTIAL_ROWS, 0x00, 0x00, 0x03, 0x1f); - panel_dbi_command(priv, MIPI_DCS_SET_SCROLL_AREA, 0x00, 0x00, 0x03, 0x20, - 0x00, 0x00); - - panel_dbi_command(priv, MIPI_DCS_SET_ADDRESS_MODE, 0x0a); - panel_dbi_command(priv, MIPI_DCS_SET_SCROLL_START, 0x00, 0x00); - - panel_dbi_command(priv, MIPI_DCS_SET_PIXEL_FORMAT, MIPI_DCS_PIXEL_FMT_24BIT); - panel_dbi_command(priv, MIPI_DCS_SET_TEAR_SCANLINE, 0x00, 0x00); - - panel_dbi_command(priv, 0x71, 0x00); /* Ex_Vsync_en */ - - panel_dbi_command(priv, 0xb2, 0x00); /* VCSEL */ - panel_dbi_command(priv, 0xb4, 0xaa); /* setvgmpm */ - panel_dbi_command(priv, 0xb5, 0x33); /* rbias1 */ - panel_dbi_command(priv, 0xb6, 0x03); /* rbias2 */ - - panel_dbi_command(priv, 0xb7, 0x1a, 0x33, 0x03, 0x03, - 0x03, 0x00, 0x00, 0x01, 0x02, 0x00, - 0x00, 0x04, 0x00, 0x01, 0x01, 0x01); /* set_ddvdhp */ - panel_dbi_command(priv, 0xb8, 0x1c, 0x53, 0x03, 0x03, - 0x00, 0x01, 0x02, 0x00, 0x00, 0x04, - 0x00, 0x01, 0x01); /* set_ddvdhm */ - - panel_dbi_command(priv, 0xb9, 0x0a, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x02, 0x00, 0x02, 0x01); /* set_vgh */ - panel_dbi_command(priv, 0xba, 0x0f, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x02, 0x00, 0x02, 0x01); /* set_vgl */ - panel_dbi_command(priv, 0xbb, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x01); /* set_vcl */ - - panel_dbi_command(priv, 0xc1, 0x01); /* number of lines */ - panel_dbi_command(priv, 0xc2, 0x08); /* number of fp lines */ - panel_dbi_command(priv, 0xc3, 0x04); /* gateset(1) */ - panel_dbi_command(priv, 0xc4, 0x4c); /* 1h period */ - panel_dbi_command(priv, 0xc5, 0x03); /* source precharge */ - panel_dbi_command(priv, 0xc6, 0xc4, 0x04); /* source precharge timing */ - panel_dbi_command(priv, 0xc7, 0x00); /* source level */ - panel_dbi_command(priv, 0xc8, 0x02); /* number of bp lines */ - panel_dbi_command(priv, 0xc9, 0x10); /* gateset(2) */ - panel_dbi_command(priv, 0xca, 0x04, 0x04); /* gateset(3) */ - panel_dbi_command(priv, 0xcb, 0x03); /* gateset(4) */ - panel_dbi_command(priv, 0xcc, 0x12); /* gateset(5) */ - panel_dbi_command(priv, 0xcd, 0x12); /* gateset(6) */ - panel_dbi_command(priv, 0xce, 0x30); /* gateset(7) */ - panel_dbi_command(priv, 0xcf, 0x30); /* gateset(8) */ - panel_dbi_command(priv, 0xd0, 0x40); /* gateset(9) */ - panel_dbi_command(priv, 0xd1, 0x22); /* flhw */ - panel_dbi_command(priv, 0xd2, 0x22); /* vckhw */ - panel_dbi_command(priv, 0xd3, 0x04); /* flt */ - panel_dbi_command(priv, 0xd4, 0x14); /* tctrl */ - panel_dbi_command(priv, 0xd6, 0x02); /* dotinv */ - panel_dbi_command(priv, 0xd7, 0x00); /* on/off sequence period */ - - panel_dbi_command(priv, 0xd8, 0x01, 0x05, 0x06, 0x0d, - 0x18, 0x09, 0x22, 0x23, 0x00); /* ponseqa */ - panel_dbi_command(priv, 0xd9, 0x24, 0x01); /* ponseqb */ - panel_dbi_command(priv, 0xde, 0x09, 0x0f, 0x21, 0x12, - 0x04); /* ponseqc */ - - panel_dbi_command(priv, 0xdf, 0x02, 0x06, 0x06, 0x06, - 0x06, 0x00); /* pofseqa */ - panel_dbi_command(priv, 0xe0, 0x01); /* pofseqb */ - - panel_dbi_command(priv, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0xff); - panel_dbi_command(priv, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x40); - - panel_dbi_command(priv, 0xe2, 0x00, 0x00); /* cabc pwm */ - panel_dbi_command(priv, 0xe3, 0x03); /* cabc */ - panel_dbi_command(priv, 0xe4, 0x66, 0x7b, 0x90, 0xa5, - 0xbb, 0xc7, 0xe1, 0xe5); /* cabc brightness */ - panel_dbi_command(priv, 0xe5, 0xc5, 0xc5, 0xc9, 0xc9, - 0xd1, 0xe1, 0xf1, 0xfe); /* cabc brightness */ - panel_dbi_command(priv, 0xe7, 0x2a); /* cabc */ - panel_dbi_command(priv, 0xe8, 0x00); /* brt_rev */ - panel_dbi_command(priv, 0xe9, 0x00); /* tefreq */ - - panel_dbi_command(priv, 0xea, 0x01); /* high speed ram */ - - panel_dbi_command(priv, 0xeb, 0x00, 0x33, 0x0e, 0x15, - 0xb7, 0x78, 0x88, 0x0f); /* gamma setting r pos */ - panel_dbi_command(priv, 0xec, 0x00, 0x33, 0x0e, 0x15, - 0xb7, 0x78, 0x88, 0x0f); /* gamma setting r neg */ - panel_dbi_command(priv, 0xed, 0x00, 0x33, 0x0e, 0x15, - 0xb7, 0x78, 0x88, 0x0f); /* gamma setting g pos */ - panel_dbi_command(priv, 0xee, 0x00, 0x33, 0x0e, 0x15, - 0xb7, 0x78, 0x88, 0x0f); /* gamma setting g neg */ - panel_dbi_command(priv, 0xef, 0x00, 0x33, 0x0e, 0x15, - 0xb7, 0x78, 0x88, 0x0f); /* gamma setting b pos */ - panel_dbi_command(priv, 0xf0, 0x00, 0x33, 0x0e, 0x15, - 0xb7, 0x78, 0x88, 0x0f); /* gamma setting b neg */ - - panel_dbi_command(priv, MIPI_DCS_EXIT_SLEEP_MODE); + struct mipi_dbi_multi_context ctx = { .dbidev = priv->dbidev }; + + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_PARTIAL_ROWS, 0x00, 0x00, 0x03, 0x1f); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_SCROLL_AREA, 0x00, 0x00, 0x03, 0x20, + 0x00, 0x00); + + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x0a); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_SCROLL_START, 0x00, 0x00); + + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_PIXEL_FORMAT, MIPI_DCS_PIXEL_FMT_24BIT); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_TEAR_SCANLINE, 0x00, 0x00); + + mipi_dbi_write_seq_multi(&ctx, 0x71, 0x00); /* Ex_Vsync_en */ + + mipi_dbi_write_seq_multi(&ctx, 0xb2, 0x00); /* VCSEL */ + mipi_dbi_write_seq_multi(&ctx, 0xb4, 0xaa); /* setvgmpm */ + mipi_dbi_write_seq_multi(&ctx, 0xb5, 0x33); /* rbias1 */ + mipi_dbi_write_seq_multi(&ctx, 0xb6, 0x03); /* rbias2 */ + + mipi_dbi_write_seq_multi(&ctx, 0xb7, 0x1a, 0x33, 0x03, 0x03, + 0x03, 0x00, 0x00, 0x01, 0x02, 0x00, + 0x00, 0x04, 0x00, 0x01, 0x01, 0x01); /* set_ddvdhp */ + mipi_dbi_write_seq_multi(&ctx, 0xb8, 0x1c, 0x53, 0x03, 0x03, + 0x00, 0x01, 0x02, 0x00, 0x00, 0x04, + 0x00, 0x01, 0x01); /* set_ddvdhm */ + + mipi_dbi_write_seq_multi(&ctx, 0xb9, 0x0a, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x02, 0x01); /* set_vgh */ + mipi_dbi_write_seq_multi(&ctx, 0xba, 0x0f, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x02, 0x01); /* set_vgl */ + mipi_dbi_write_seq_multi(&ctx, 0xbb, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x01); /* set_vcl */ + + mipi_dbi_write_seq_multi(&ctx, 0xc1, 0x01); /* number of lines */ + mipi_dbi_write_seq_multi(&ctx, 0xc2, 0x08); /* number of fp lines */ + mipi_dbi_write_seq_multi(&ctx, 0xc3, 0x04); /* gateset(1) */ + mipi_dbi_write_seq_multi(&ctx, 0xc4, 0x4c); /* 1h period */ + mipi_dbi_write_seq_multi(&ctx, 0xc5, 0x03); /* source precharge */ + mipi_dbi_write_seq_multi(&ctx, 0xc6, 0xc4, 0x04); /* source precharge timing */ + mipi_dbi_write_seq_multi(&ctx, 0xc7, 0x00); /* source level */ + mipi_dbi_write_seq_multi(&ctx, 0xc8, 0x02); /* number of bp lines */ + mipi_dbi_write_seq_multi(&ctx, 0xc9, 0x10); /* gateset(2) */ + mipi_dbi_write_seq_multi(&ctx, 0xca, 0x04, 0x04); /* gateset(3) */ + mipi_dbi_write_seq_multi(&ctx, 0xcb, 0x03); /* gateset(4) */ + mipi_dbi_write_seq_multi(&ctx, 0xcc, 0x12); /* gateset(5) */ + mipi_dbi_write_seq_multi(&ctx, 0xcd, 0x12); /* gateset(6) */ + mipi_dbi_write_seq_multi(&ctx, 0xce, 0x30); /* gateset(7) */ + mipi_dbi_write_seq_multi(&ctx, 0xcf, 0x30); /* gateset(8) */ + mipi_dbi_write_seq_multi(&ctx, 0xd0, 0x40); /* gateset(9) */ + mipi_dbi_write_seq_multi(&ctx, 0xd1, 0x22); /* flhw */ + mipi_dbi_write_seq_multi(&ctx, 0xd2, 0x22); /* vckhw */ + mipi_dbi_write_seq_multi(&ctx, 0xd3, 0x04); /* flt */ + mipi_dbi_write_seq_multi(&ctx, 0xd4, 0x14); /* tctrl */ + mipi_dbi_write_seq_multi(&ctx, 0xd6, 0x02); /* dotinv */ + mipi_dbi_write_seq_multi(&ctx, 0xd7, 0x00); /* on/off sequence period */ + + mipi_dbi_write_seq_multi(&ctx, 0xd8, 0x01, 0x05, 0x06, 0x0d, + 0x18, 0x09, 0x22, 0x23, 0x00); /* ponseqa */ + mipi_dbi_write_seq_multi(&ctx, 0xd9, 0x24, 0x01); /* ponseqb */ + mipi_dbi_write_seq_multi(&ctx, 0xde, 0x09, 0x0f, 0x21, 0x12, + 0x04); /* ponseqc */ + + mipi_dbi_write_seq_multi(&ctx, 0xdf, 0x02, 0x06, 0x06, 0x06, + 0x06, 0x00); /* pofseqa */ + mipi_dbi_write_seq_multi(&ctx, 0xe0, 0x01); /* pofseqb */ + + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0xff); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x40); + + mipi_dbi_write_seq_multi(&ctx, 0xe2, 0x00, 0x00); /* cabc pwm */ + mipi_dbi_write_seq_multi(&ctx, 0xe3, 0x03); /* cabc */ + mipi_dbi_write_seq_multi(&ctx, 0xe4, 0x66, 0x7b, 0x90, 0xa5, + 0xbb, 0xc7, 0xe1, 0xe5); /* cabc brightness */ + mipi_dbi_write_seq_multi(&ctx, 0xe5, 0xc5, 0xc5, 0xc9, 0xc9, + 0xd1, 0xe1, 0xf1, 0xfe); /* cabc brightness */ + mipi_dbi_write_seq_multi(&ctx, 0xe7, 0x2a); /* cabc */ + mipi_dbi_write_seq_multi(&ctx, 0xe8, 0x00); /* brt_rev */ + mipi_dbi_write_seq_multi(&ctx, 0xe9, 0x00); /* tefreq */ + + mipi_dbi_write_seq_multi(&ctx, 0xea, 0x01); /* high speed ram */ + + mipi_dbi_write_seq_multi(&ctx, 0xeb, 0x00, 0x33, 0x0e, 0x15, + 0xb7, 0x78, 0x88, 0x0f); /* gamma setting r pos */ + mipi_dbi_write_seq_multi(&ctx, 0xec, 0x00, 0x33, 0x0e, 0x15, + 0xb7, 0x78, 0x88, 0x0f); /* gamma setting r neg */ + mipi_dbi_write_seq_multi(&ctx, 0xed, 0x00, 0x33, 0x0e, 0x15, + 0xb7, 0x78, 0x88, 0x0f); /* gamma setting g pos */ + mipi_dbi_write_seq_multi(&ctx, 0xee, 0x00, 0x33, 0x0e, 0x15, + 0xb7, 0x78, 0x88, 0x0f); /* gamma setting g neg */ + mipi_dbi_write_seq_multi(&ctx, 0xef, 0x00, 0x33, 0x0e, 0x15, + 0xb7, 0x78, 0x88, 0x0f); /* gamma setting b pos */ + mipi_dbi_write_seq_multi(&ctx, 0xf0, 0x00, 0x33, 0x0e, 0x15, + 0xb7, 0x78, 0x88, 0x0f); /* gamma setting b neg */ + + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_EXIT_SLEEP_MODE); msleep(110); - panel_dbi_command(priv, MIPI_DCS_SET_DISPLAY_ON); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_DISPLAY_ON); - return 0; + return ctx.accum_err; } static int hitachi_tx10d07vm0baa_disable(struct drm_panel *panel) { struct hitachi_tx10d07vm0baa *priv = to_hitachi_tx10d07vm0baa(panel); + struct mipi_dbi_multi_context ctx = { .dbidev = priv->dbidev }; - panel_dbi_command(priv, MIPI_DCS_SET_DISPLAY_OFF); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_SET_DISPLAY_OFF); msleep(35); - panel_dbi_command(priv, MIPI_DCS_ENTER_SLEEP_MODE); + mipi_dbi_write_seq_multi(&ctx, MIPI_DCS_ENTER_SLEEP_MODE); msleep(50); - return 0; + return ctx.accum_err; } static int hitachi_tx10d07vm0baa_unprepare(struct drm_panel *panel) -- 2.53.0