From nobody Thu Dec 18 11:29:50 2025 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E984516B38F for ; Tue, 9 Jul 2024 13:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532895; cv=none; b=RKtEtAqMlDrFTdID1MdETJAYOlp369CHxdSK4SREI4h0QjCC93WxiLKLlc8+W3LF5RSn60M4pYuVh42l4pybMs/U4ZUqIrLVXSkVFYF1FZr20uWYpOPDUuPWcxH1HJvYPA9Vr6aZB+aHTDD5m3tLrptKmZoavJ0e3h6Qj93dytQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532895; c=relaxed/simple; bh=YN5rayB4FkzBfWo05KRJJBtnLL3iGZVj26fPYXLj4II=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=hGwCvttL2U/cnnDyckOhCug9p+DNqH3IAo2MIGOM5NDLFslMUFFbiHi+wBMnIG8EdbYauncYJaiDdgDX+nA1PEXD7tEmjrvZqdQqN7kgHu/j5189sAhaitdQSNJE0ccDZ7B9JwvzLgMRTmZUimOlXRMxXwbS1tbskEddhpwxu54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=DTKxc8hE; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="DTKxc8hE" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1fb3cf78fbdso26296805ad.1 for ; Tue, 09 Jul 2024 06:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1720532893; x=1721137693; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=CYdWEsy6O+5XGf0fUOZ1in9Gq/j66NH1BeYWcQlMcy8=; b=DTKxc8hEPMSVsLqxGef9yqgKzjufcaQoItboSzPiqycNZ8cgW+R/VdTpuUFykpT6vL +p2W/qXK5zXTJLV3onISoLWDeKKkg3bBwaVyfzU2OY8LRUrDR7h2Hw+j4969aQl/TMW0 S/Y0RndNjwH1eJbUsX9OgOI7whj5SQX9bnrRJfTVfx4dd5qzuSYP43Kz5OmeLZjI+Gxs s1Kkz5N9Xav7uDmC6o2cLUrTs8qMPi3O79gQe9W7Z20R3I+vBGngPgQoADfUfv55l8eb vsCLGu9hBXut9o6Ts5TPPiqZyWxU+3g1FJjj/H7THadj/PAYJJPPK35yJ31trFLXGGd5 A4AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720532893; x=1721137693; h=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=CYdWEsy6O+5XGf0fUOZ1in9Gq/j66NH1BeYWcQlMcy8=; b=plnW0XsEAGJDIrEpSvVvaI2zoJBoSH67AlfqQ92Bgcqd/Zb65Di2XLIjh3P1xmOsd5 dvWsvy+NioVcwvpou3/DI2NL2HxMLNFVuXMLFbXHiVkmg34H8w/CS6YCSVUK78wh9Ma1 EujOnpBCGMP7t+culrIQNFvbDKpWRzGzD0ZsXuhzJjk97e7256lNoeAIzxnPp27K9Ekz fdLZeW+NR/l5CewZxKcDyIoJIQYSUNuMfnkSH/BaDvS/TEAVfjMCxVeMysXtSissZJf3 LJjDj6eSs/7+sXlhzsCwrSnxl33tHeH3fBCdG2LZwPY3OeCGMmH08qMeIemTlYTD6R5R w5aw== X-Forwarded-Encrypted: i=1; AJvYcCUO8a1cVjsDJg7o1zzevkh9+H/Y6wnVidxrv9I8VBrFZpisGFv/lGwLTK0emSjsI1p6bA66YBgN/ee5Ssst2m6U/MxJXiU7fyNa57lh X-Gm-Message-State: AOJu0YxUK8/E20VA+ODWYBs+Xp2feGXIavv981GCOT8uTDzCacZ2JhkN yZUkDvf8tlvpVWjKauaIlzmDEuHXb78/YiN642FfmHMOkWeI8l0N12/yYuCnzMc= X-Google-Smtp-Source: AGHT+IHf3jGkzIV/7x6CYbaGZ5oidggGkve7x/0gRMjUtvEvEhpQPLV5dlBWQeOqvyZ4ARjS8WK1Aw== X-Received: by 2002:a17:903:283:b0:1fb:9a83:4496 with SMTP id d9443c01a7336-1fbb6cd18dfmr23414525ad.2.1720532893234; Tue, 09 Jul 2024 06:48:13 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ab6b9fsm16211685ad.138.2024.07.09.06.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:48:12 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@google.com, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v6 1/5] drm/panel: boe-th101mb31ig002 : Make it compatible with other panel. Date: Tue, 9 Jul 2024 21:47:50 +0800 Message-Id: <20240709134754.28013-2-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This driver currently only applies to one panel. Modify it to be compatible with other panels. Signed-off-by: Zhaoxiong Lv Reviewed-by: Neil Armstrong --- Changes between V6 and V5: - 1. Corrected the use of "->init" in struct panel_desc,=20 - 2. Modify indentation in "boe_th101mb31ig002_of_match[]" v5: https://lore.kernel.org/all/20240704072958.27876-2-lvzhaoxiong@huaqin.c= orp-partner.google.com/ --- .../drm/panel/panel-boe-th101mb31ig002-28a.c | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers= /gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index 763e9f8342d3..8f03920e3503 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -17,11 +17,21 @@ #include #include =20 +struct panel_desc { + const struct drm_display_mode *modes; + unsigned long mode_flags; + enum mipi_dsi_pixel_format format; + int (*init)(struct drm_panel *panel); + unsigned int lanes; +}; + struct boe_th101mb31ig002 { struct drm_panel panel; =20 struct mipi_dsi_device *dsi; =20 + const struct panel_desc *desc; + struct regulator *power; struct gpio_desc *enable; struct gpio_desc *reset; @@ -161,7 +171,10 @@ static int boe_th101mb31ig002_prepare(struct drm_panel= *panel) gpiod_set_value_cansleep(ctx->enable, 1); msleep(50); boe_th101mb31ig002_reset(ctx); - boe_th101mb31ig002_enable(panel); + + ret =3D ctx->desc->init(panel); + if (ret) + return ret; =20 return 0; } @@ -181,6 +194,16 @@ static const struct drm_display_mode boe_th101mb31ig00= 2_default_mode =3D { .type =3D DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, }; =20 +static const struct panel_desc boe_th101mb31ig002_desc =3D { + .modes =3D &boe_th101mb31ig002_default_mode, + .lanes =3D 4, + .format =3D MIPI_DSI_FMT_RGB888, + .mode_flags =3D MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_NO_EOT_PACKET | + MIPI_DSI_MODE_LPM, + .init =3D boe_th101mb31ig002_enable, +}; + static int boe_th101mb31ig002_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -237,6 +260,7 @@ static const struct drm_panel_funcs boe_th101mb31ig002_= funcs =3D { static int boe_th101mb31ig002_dsi_probe(struct mipi_dsi_device *dsi) { struct boe_th101mb31ig002 *ctx; + const struct panel_desc *desc; int ret; =20 ctx =3D devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); @@ -246,11 +270,11 @@ static int boe_th101mb31ig002_dsi_probe(struct mipi_d= si_device *dsi) mipi_dsi_set_drvdata(dsi, ctx); ctx->dsi =3D dsi; =20 - dsi->lanes =3D 4; - dsi->format =3D MIPI_DSI_FMT_RGB888; - dsi->mode_flags =3D MIPI_DSI_MODE_VIDEO_BURST | - MIPI_DSI_MODE_NO_EOT_PACKET | - MIPI_DSI_MODE_LPM; + desc =3D of_device_get_match_data(&dsi->dev); + dsi->lanes =3D desc->lanes; + dsi->format =3D desc->format; + dsi->mode_flags =3D desc->mode_flags; + ctx->desc =3D desc; =20 ctx->power =3D devm_regulator_get(&dsi->dev, "power"); if (IS_ERR(ctx->power)) @@ -302,7 +326,10 @@ static void boe_th101mb31ig002_dsi_remove(struct mipi_= dsi_device *dsi) } =20 static const struct of_device_id boe_th101mb31ig002_of_match[] =3D { - { .compatible =3D "boe,th101mb31ig002-28a", }, + { + .compatible =3D "boe,th101mb31ig002-28a", + .data =3D &boe_th101mb31ig002_desc + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, boe_th101mb31ig002_of_match); --=20 2.17.1 From nobody Thu Dec 18 11:29:50 2025 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8B8017995B for ; Tue, 9 Jul 2024 13:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532908; cv=none; b=fumQ313IO1Z8oH5xJ7E8hrKvPylWwhLZi1JVl38vcw9YZAFaY+tCqWD+ymbQYBi9ZkmGjsBZFFDHzVPDrkV1iAaIcI1TShB3Oo3PdSeswGpaDrYa56bClcm2JKICru+pIvWj3ugFLThO6NGT6yYcd7Hbj2YNPvLxFiCnCsMKnng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532908; c=relaxed/simple; bh=pYPTNY8X4IxGHrR0aSERyjf84J9xMrNFhAnJJZV75Tg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=aK2cMkemHMRBB+X62M3IIY5evlF3DXiioGmRHUvnAWyYnXuf10f0fpuT/Pj9gRnS0P+/3eW3b1WoxbqvufWSzWuBrwBk5zrf2bTV2G0vyENLZuhgbUq5hIe9dbFAdAutvEmgEQ+BbSLXK/8u/6C4EIfVaUYcDDbtt5S3le9F/2o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=rFhzhbGG; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="rFhzhbGG" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1fb64d627b0so14225665ad.0 for ; Tue, 09 Jul 2024 06:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1720532902; x=1721137702; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=EcZGfscxWH1cfj2JazAFXoJC02WpocVggpq54m1oHTg=; b=rFhzhbGGNorhXYF/A5bwxIO/XkFdwTiqdKRPSUG/Y5uxbEr8UTQ9lQ+UWtBbu0Bjyl xlXPVIDN28YM3FtFXdzSQyO2T3+DP0UFFq5Kk7NsEG7e+ZHypP+IwfkxrJAYzQ5/r8bb RlVtFBjnFQuniR5qAuxTgvGEx6lqh7IGCgbr7GRarG7DYDK3iR9yKOUo3JPTn2jpQvmy lu51t39ktT3utHuC1Kt4/pJAfK8zpnytutSF0yviSJi4OIfdJdDCAfG1AhGzOkim9t2r Rl+UlirOf9f+uJWE+sGyLwJ+LIHfw3yBAdTUPRORqv8A4LmeKPpvgJ5OjQJ5iWHNyOrR t1KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720532902; x=1721137702; h=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=EcZGfscxWH1cfj2JazAFXoJC02WpocVggpq54m1oHTg=; b=wvST9ZzPlVCM+KvZeAkdKlThjM1gN8cQ9TGIOaODQ91mc8Od+PboiFmhsoYTQfFe0b Q96yTuFOL5gMOXk8jWIzEz1C3th+fvjnryjnK9FC+/plu006701guMXuVdiGm5ed8tto JfjBRq0+kbDEDOu6kY+60LBpDLsE2S6PSZuPQKNicuvoe9vwCNvLPHgw/uZBWtKHOMk2 pKW4rMRyfxAIkmLTM+z5H0+sfPiwjwaTSYYvffTNF7rj1JsXEdHC0cqSlv9d5cx5Awr7 5ASPxzBnfIMT15jv8m0dOKAka4/cpfzl4H7e5lfA42ljRqYfgNzGc2snzd5232OpaHZg Kj6Q== X-Forwarded-Encrypted: i=1; AJvYcCVSxPuBI5nI1HAm/V6JsPxOMMtKjlSbR3gNG+W/sXL2vT5JexK0clnFChGrFL4yTTXTut7JwT9ba+IhCXBYZ+Wf1T6ZspPICVlue7Ol X-Gm-Message-State: AOJu0YzdnpckejcHRw+oLUNoKiHD2Y/0ixhZlmK/2TftuClzxKcIeJ6Y h+hrrRYAlLz3N2ikoZ95e5UfhhtGNK7QsJ236I22FJ03tSd08IX1pyiuWBoyhYs= X-Google-Smtp-Source: AGHT+IFX21o+X3VwRasdQwyrEqH0PuWe1B+40bbzeOg94dAYx5KftRVmTty5gE2r5cIfdyuv5HR6pw== X-Received: by 2002:a17:902:d552:b0:1fb:90bd:afc2 with SMTP id d9443c01a7336-1fbb6d2516emr17327055ad.36.1720532901816; Tue, 09 Jul 2024 06:48:21 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ab6b9fsm16211685ad.138.2024.07.09.06.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:48:21 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@google.com, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v6 2/5] drm/panel: boe-th101mb31ig002: switch to devm_gpiod_get_optional() for reset_gpio Date: Tue, 9 Jul 2024 21:47:51 +0800 Message-Id: <20240709134754.28013-3-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Switch the driver to use devm_gpiod_get_optional() on reset_gpio to avoid driver probe issues when reset line is not specified. Signed-off-by: Zhaoxiong Lv Reviewed-by: Neil Armstrong --- Changes between V6 and V5: - 1. No changes. v5: https://lore.kernel.org/all/20240704072958.27876-3-lvzhaoxiong@huaqin.c= orp-partner.google.com/ --- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers= /gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index 8f03920e3503..b92082bfc932 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -286,7 +286,7 @@ static int boe_th101mb31ig002_dsi_probe(struct mipi_dsi= _device *dsi) return dev_err_probe(&dsi->dev, PTR_ERR(ctx->enable), "Failed to get enable GPIO\n"); =20 - ctx->reset =3D devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_HIGH); + ctx->reset =3D devm_gpiod_get_optional(&dsi->dev, "reset", GPIOD_OUT_HIGH= ); if (IS_ERR(ctx->reset)) return dev_err_probe(&dsi->dev, PTR_ERR(ctx->reset), "Failed to get reset GPIO\n"); --=20 2.17.1 From nobody Thu Dec 18 11:29:50 2025 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A546180A84 for ; Tue, 9 Jul 2024 13:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532922; cv=none; b=f+JaJe5T0GowCskKJSmkGVRwkfszl4KfnHr5kvn//mLx+jjd0/KRcWCm7WzSKjf382iXvHtuzEVw1+s4Xd48YVjNLyBnjGQ9xgeZ0c410zO06s+L1CkeDeFS9Elfdv+1mgZN8xBWY7kpkbvg/6O8+NMgL9t4oZ+y7MRgj0zyN0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532922; c=relaxed/simple; bh=pUuFfAxFZ8ZLgyyqmvA5GwMs340NtJBbp8mYHg/taqI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=BFc2nym1iF5qds4Kfd0tJdrejBCUgpjiixrSQhA3vE4+TWXUEHIOPapebjxfY5Thsd77Lj6VA5Q19WVQbmQb3VDx57e4KpP9VI4O36eE3RkV3UVUMPnFRgZFTe3XQic+IBB1OJm11VF+l+g5PodGNPbo7cJmEjPIdNQeEuUeCZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=yCD8a2NC; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="yCD8a2NC" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1fb1c918860so40847825ad.1 for ; Tue, 09 Jul 2024 06:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1720532911; x=1721137711; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=uMEcoi4kfATq1PQH6tKRvYV7e4/pW6GOXmmHjAZqR4A=; b=yCD8a2NCAy4CDsX7qJ7TNVopFhBxXF55gQO7MqLJVyfzwexQV7+r1pjU48rz1y7hZ/ v0QNEdA5FSs+prvdVe+3s4vd4FH11QOHg9aiPtZa7mTkYRZHZldUWgFo+mySlSRUAA60 0dan5sjPdAvzsl3jz31PEX/bpMlaDIO3av8m8r4RJ0YSTtis2Es0amdhUWMpsfzr7wzk o9tQNz2hBk5GpGuwGdEy1tn1oL7yEQoOrQ7J8ZB4dVWTt8nxfIco+DDwUHOB4WGGL/eK dSXUQqyEz1ifkH8qUshWzootdISh4RS77R1ZKYk9iRlOe2bb3JU/B1n77aWcbuTLpXeZ UvPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720532911; x=1721137711; h=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=uMEcoi4kfATq1PQH6tKRvYV7e4/pW6GOXmmHjAZqR4A=; b=mKRVYobWdvBM4q3Av1TlzSc/+p5WKGtbxk7x1cDJh4bkccdGxUI5htARiK4Go94pg8 4gBk/33acc3DoR25Fxuv7GrR57mSGqPHzqZjcz2GNfiK5xmfhbHdjWfzyrfV7+cuL0Am kd+9qRmyU1xuRUZ2eL7fgDHj208VqE/qglrYhaDuaKSEIGXNIHyvDMWRMmU1bdqoxhat kUL49QvVzg317c24SJ/FZyuJ9sZ6dCyJbbSH+m4Y25oT3tVl0QBVKbKjZGKq7JrRZVVc tDTcLgpMoxgnpdMtfiTZhJEzzjhleA2GsEZMCwZ8GRtzMqa6DUqg9Wky91If67vIfx8T Ktcw== X-Forwarded-Encrypted: i=1; AJvYcCUBC9WLebl9JzxpznzOOTuFsCIo8cAJVFGZWz/CLrZrxSpoGz5n0iW+JWjXAbp1lO93iICTdDiqBFwR+q/EurDKNdeGe96OuIfRoMN2 X-Gm-Message-State: AOJu0Yxjz2D2de+AsXGCZUzAE4sm1vXNIgOgf1f+COXS9PYLhiOgbbCq A9aSx+eVtqMIckBNf4t9jItPisK+MiK8CqyH1fruZ7U7vaCfMsy7ObjIeSAmidc= X-Google-Smtp-Source: AGHT+IErsldRGCVjJQNp++bdJGJi0KJOcV/dPRZo0OLh77MLEfFqBsbmHn5CVGSnCvabvweP9duUog== X-Received: by 2002:a17:902:f687:b0:1f9:f3aa:fa86 with SMTP id d9443c01a7336-1fbb80b31d9mr35884485ad.33.1720532911116; Tue, 09 Jul 2024 06:48:31 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ab6b9fsm16211685ad.138.2024.07.09.06.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:48:30 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@google.com, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v6 3/5] drm/panel: boe-th101mb31ig002: use wrapped MIPI DCS functions Date: Tue, 9 Jul 2024 21:47:52 +0800 Message-Id: <20240709134754.28013-4-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove conditional code and always use mipi_dsi_dcs_*multi() wrappers to simplify driver's init/enable/exit code. Convert the hex in init_code from UPPERCASE to lowercase. Signed-off-by: Zhaoxiong Lv Reviewed-by: Neil Armstrong --- Changes between V6 and V5: - 1. No changes. v5: https://lore.kernel.org/all/20240704072958.27876-4-lvzhaoxiong@huaqin.c= orp-partner.google.com/ --- .../drm/panel/panel-boe-th101mb31ig002-28a.c | 143 ++++++++---------- 1 file changed, 63 insertions(+), 80 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers= /gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index b92082bfc932..5993e6c0cc4a 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -17,11 +17,13 @@ #include #include =20 +struct boe_th101mb31ig002; + struct panel_desc { const struct drm_display_mode *modes; unsigned long mode_flags; enum mipi_dsi_pixel_format format; - int (*init)(struct drm_panel *panel); + int (*init)(struct boe_th101mb31ig002 *ctx); unsigned int lanes; }; =20 @@ -49,74 +51,61 @@ static void boe_th101mb31ig002_reset(struct boe_th101mb= 31ig002 *ctx) usleep_range(5000, 6000); } =20 -static int boe_th101mb31ig002_enable(struct drm_panel *panel) +static int boe_th101mb31ig002_enable(struct boe_th101mb31ig002 *ctx) { - struct boe_th101mb31ig002 *ctx =3D container_of(panel, - struct boe_th101mb31ig002, - panel); - struct mipi_dsi_device *dsi =3D ctx->dsi; - struct device *dev =3D &dsi->dev; - int ret; - - mipi_dsi_dcs_write_seq(dsi, 0xE0, 0xAB, 0xBA); - mipi_dsi_dcs_write_seq(dsi, 0xE1, 0xBA, 0xAB); - mipi_dsi_dcs_write_seq(dsi, 0xB1, 0x10, 0x01, 0x47, 0xFF); - mipi_dsi_dcs_write_seq(dsi, 0xB2, 0x0C, 0x14, 0x04, 0x50, 0x50, 0x14); - mipi_dsi_dcs_write_seq(dsi, 0xB3, 0x56, 0x53, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xB4, 0x33, 0x30, 0x04); - mipi_dsi_dcs_write_seq(dsi, 0xB6, 0xB0, 0x00, 0x00, 0x10, 0x00, 0x10, - 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xB8, 0x05, 0x12, 0x29, 0x49, 0x48, 0x00, - 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xB9, 0x7C, 0x65, 0x55, 0x49, 0x46, 0x36, - 0x3B, 0x24, 0x3D, 0x3C, 0x3D, 0x5C, 0x4C, - 0x55, 0x47, 0x46, 0x39, 0x26, 0x06, 0x7C, - 0x65, 0x55, 0x49, 0x46, 0x36, 0x3B, 0x24, - 0x3D, 0x3C, 0x3D, 0x5C, 0x4C, 0x55, 0x47, - 0x46, 0x39, 0x26, 0x06); - mipi_dsi_dcs_write_seq(dsi, 0x00, 0xFF, 0x87, 0x12, 0x34, 0x44, 0x44, - 0x44, 0x44, 0x98, 0x04, 0x98, 0x04, 0x0F, - 0x00, 0x00, 0xC1); - mipi_dsi_dcs_write_seq(dsi, 0xC1, 0x54, 0x94, 0x02, 0x85, 0x9F, 0x00, - 0x7F, 0x00, 0x54, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xC2, 0x17, 0x09, 0x08, 0x89, 0x08, 0x11, - 0x22, 0x20, 0x44, 0xFF, 0x18, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xC3, 0x86, 0x46, 0x05, 0x05, 0x1C, 0x1C, - 0x1D, 0x1D, 0x02, 0x1F, 0x1F, 0x1E, 0x1E, - 0x0F, 0x0F, 0x0D, 0x0D, 0x13, 0x13, 0x11, - 0x11, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xC4, 0x07, 0x07, 0x04, 0x04, 0x1C, 0x1C, - 0x1D, 0x1D, 0x02, 0x1F, 0x1F, 0x1E, 0x1E, - 0x0E, 0x0E, 0x0C, 0x0C, 0x12, 0x12, 0x10, - 0x10, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xC6, 0x2A, 0x2A); - mipi_dsi_dcs_write_seq(dsi, 0xC8, 0x21, 0x00, 0x31, 0x42, 0x34, 0x16); - mipi_dsi_dcs_write_seq(dsi, 0xCA, 0xCB, 0x43); - mipi_dsi_dcs_write_seq(dsi, 0xCD, 0x0E, 0x4B, 0x4B, 0x20, 0x19, 0x6B, - 0x06, 0xB3); - mipi_dsi_dcs_write_seq(dsi, 0xD2, 0xE3, 0x2B, 0x38, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xD4, 0x00, 0x01, 0x00, 0x0E, 0x04, 0x44, - 0x08, 0x10, 0x00, 0x00, 0x00); - mipi_dsi_dcs_write_seq(dsi, 0xE6, 0x80, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF); - mipi_dsi_dcs_write_seq(dsi, 0xF0, 0x12, 0x03, 0x20, 0x00, 0xFF); - mipi_dsi_dcs_write_seq(dsi, 0xF3, 0x00); - - ret =3D mipi_dsi_dcs_exit_sleep_mode(dsi); - if (ret < 0) { - dev_err(dev, "Failed to exit sleep mode: %d\n", ret); - return ret; - } - - msleep(120); - - ret =3D mipi_dsi_dcs_set_display_on(dsi); - if (ret < 0) { - dev_err(dev, "Failed to set panel on: %d\n", ret); - return ret; - } - - return 0; + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D ctx->dsi }; + + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe0, 0xab, 0xba); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe1, 0xba, 0xab); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb1, 0x10, 0x01, 0x47, 0xff); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb2, 0x0c, 0x14, 0x04, 0x50, 0x50= , 0x14); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb3, 0x56, 0x53, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb4, 0x33, 0x30, 0x04); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb6, 0xb0, 0x00, 0x00, 0x10, 0x00= , 0x10, + 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb8, 0x05, 0x12, 0x29, 0x49, 0x48= , 0x00, + 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x7c, 0x65, 0x55, 0x49, 0x46= , 0x36, + 0x3b, 0x24, 0x3d, 0x3c, 0x3d, 0x5c, 0x4c, + 0x55, 0x47, 0x46, 0x39, 0x26, 0x06, 0x7c, + 0x65, 0x55, 0x49, 0x46, 0x36, 0x3b, 0x24, + 0x3d, 0x3c, 0x3d, 0x5c, 0x4c, 0x55, 0x47, + 0x46, 0x39, 0x26, 0x06); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x00, 0xff, 0x87, 0x12, 0x34, 0x44= , 0x44, + 0x44, 0x44, 0x98, 0x04, 0x98, 0x04, 0x0f, + 0x00, 0x00, 0xc1); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc1, 0x54, 0x94, 0x02, 0x85, 0x9f= , 0x00, + 0x7f, 0x00, 0x54, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc2, 0x17, 0x09, 0x08, 0x89, 0x08= , 0x11, + 0x22, 0x20, 0x44, 0xff, 0x18, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc3, 0x86, 0x46, 0x05, 0x05, 0x1c= , 0x1c, + 0x1d, 0x1d, 0x02, 0x1f, 0x1f, 0x1e, 0x1e, + 0x0f, 0x0f, 0x0d, 0x0d, 0x13, 0x13, 0x11, + 0x11, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc4, 0x07, 0x07, 0x04, 0x04, 0x1c= , 0x1c, + 0x1d, 0x1d, 0x02, 0x1f, 0x1f, 0x1e, 0x1e, + 0x0e, 0x0e, 0x0c, 0x0c, 0x12, 0x12, 0x10, + 0x10, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc6, 0x2a, 0x2a); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc8, 0x21, 0x00, 0x31, 0x42, 0x34= , 0x16); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xca, 0xcb, 0x43); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcd, 0x0e, 0x4b, 0x4b, 0x20, 0x19= , 0x6b, + 0x06, 0xb3); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd2, 0xe3, 0x2b, 0x38, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd4, 0x00, 0x01, 0x00, 0x0e, 0x04= , 0x44, + 0x08, 0x10, 0x00, 0x00, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe6, 0x80, 0x01, 0xff, 0xff, 0xff= , 0xff, + 0xff, 0xff); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x12, 0x03, 0x20, 0x00, 0xff= ); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf3, 0x00); + + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); + + mipi_dsi_msleep(&dsi_ctx, 120); + + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + + return dsi_ctx.accum_err; } =20 static int boe_th101mb31ig002_disable(struct drm_panel *panel) @@ -124,21 +113,15 @@ static int boe_th101mb31ig002_disable(struct drm_pane= l *panel) struct boe_th101mb31ig002 *ctx =3D container_of(panel, struct boe_th101mb31ig002, panel); - struct mipi_dsi_device *dsi =3D ctx->dsi; - struct device *dev =3D &dsi->dev; - int ret; + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D ctx->dsi }; =20 - ret =3D mipi_dsi_dcs_set_display_off(dsi); - if (ret < 0) - dev_err(dev, "Failed to set panel off: %d\n", ret); + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); =20 - msleep(120); + mipi_dsi_msleep(&dsi_ctx, 120); =20 - ret =3D mipi_dsi_dcs_enter_sleep_mode(dsi); - if (ret < 0) - dev_err(dev, "Failed to enter sleep mode: %d\n", ret); + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); =20 - return 0; + return dsi_ctx.accum_err; } =20 static int boe_th101mb31ig002_unprepare(struct drm_panel *panel) @@ -172,7 +155,7 @@ static int boe_th101mb31ig002_prepare(struct drm_panel = *panel) msleep(50); boe_th101mb31ig002_reset(ctx); =20 - ret =3D ctx->desc->init(panel); + ret =3D ctx->desc->init(ctx); if (ret) return ret; =20 --=20 2.17.1 From nobody Thu Dec 18 11:29:50 2025 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E62618508E for ; Tue, 9 Jul 2024 13:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532934; cv=none; b=r3etLGtjSPo20ScJ6myLSo9SlUGpWpoI+mItApgSJp9jyD/JvDdHDNdfaHuL71plOu1FSlRHVTQ0PWPi8ODGyfM8MN2INycsX/NtyYB5IIpFCSZBeLEbRkNQLZboeJUZe8VaOsd2auBv/1HBsxZ7+6QE46GgSzcDsulomEAQ0oE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532934; c=relaxed/simple; bh=kPtprpEAbia452Yz5dZXjFq21tQm/BBQy7vGeFnn+H4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=I47i+Oa3ujnDWI9xo4jYO25Ahyr/bMlKPMaKhBoyftWQrIccrNQf54Ad5tE8/RDH72OTB45WJXP9yCo/o03wn82f1ULZu2AnMmY1Ss8GHaD1kkCgWciwLr+TNDVvALCNXh+sxwtHl8sFMUdbvnOFSOVxOhcRwM4ILk7lioZN6is= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=wrTvyM57; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="wrTvyM57" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1fb1c918860so40849375ad.1 for ; Tue, 09 Jul 2024 06:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1720532922; x=1721137722; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=d1cg3oGj3xn4CjG29iqKzWVPtEDspEWgovxGLFjyf9Y=; b=wrTvyM57sKB5Z8niFcU23jnkki/OE80Q4wWalEld4Lgkdpsk4Yh7A55iHc7YTRL6mv B4IFymDVGg6NszfjwPX/E9ta+noybkKITQ+5JVJNF+t32i+eeCJMPdPzKtfcI5rXIjI4 HWyZSvjKDD+fWOo8C6miuP0EuNVOtNYHo6ddziAeVQyuOm7852ujOKRxY7impwyHmjE+ X6sYFucBfZ4/I8h+IK9bHZDdn3W+btjo6CMwm30TmGuBumUPBkixkVfTnmhDZ+fqyH0E WkQTsipa6MT4EOv8sdwXAYqpykUmudavy8pi35xH5PTXeVViTOgUtXVh7T2iCfPM+qOk 8zRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720532922; x=1721137722; h=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=d1cg3oGj3xn4CjG29iqKzWVPtEDspEWgovxGLFjyf9Y=; b=kbpnINHsvfXA0iodMFaNPjb1dFhmkcDnomOzlgmALeHaoiqfOqFMAq7ti06yDQDv8O YZ2TiErRMA7ZYCdVluv221Ke6lJFu/pmFznSdaTD5RVBHjIDSl3DR0eC+DM6ow606VXX 5YrvSAj8SOKiLUBLIjB07dh5w+F9n6Lr9Ua2qE3W/1ZzPYt6hcnfDO7HEwEI42VqjgGK YPY+67rgIcCiZF+Xz4nGumUaDI3QWJQFjp6hi07cbZ4FGDANExGIAuD2QvinNdljO/GY tUtC59F8hgvCe+YIS3rXeV7qI9KLcKPf6Ic8AwjtJ3DV0fGEcgTGfB4Y5WBOYFFiC45R OWlw== X-Forwarded-Encrypted: i=1; AJvYcCX51yla+8tlfcAD5jIl5U0saAMw6Hne4wY/o/c9BKQvC5axxOL1R+KSDSJ/kKumE99xyScC2LzBKSUBab24O6h/OpMB+FnuoNQPPiMy X-Gm-Message-State: AOJu0Yz0sFSAF4RGWuvDkvObaSp7+Sj3lcz1Ak1MDEqH7s+M9nuZYet9 4fmnJlMxcgUDVFPOvbJOPhWp4/EunQz+Iwf6yadWCwkVSLV0jNI+81AhMgoU/vk= X-Google-Smtp-Source: AGHT+IGLfknG2M8X0lovKsSP0vKbezDHgILVPXhoA81XpBuj5dwR7qFpbLQUQaFiZglTuwKGg6Rz4Q== X-Received: by 2002:a17:902:d2c1:b0:1fb:7530:61c6 with SMTP id d9443c01a7336-1fbb7f7a9f7mr41595795ad.2.1720532921676; Tue, 09 Jul 2024 06:48:41 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ab6b9fsm16211685ad.138.2024.07.09.06.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:48:41 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@google.com, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v6 4/5] dt-bindings: display: panel: Add compatible for starry-er88577 Date: Tue, 9 Jul 2024 21:47:53 +0800 Message-Id: <20240709134754.28013-5-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The starry-er88577 is a 10.1" WXGA TFT-LCD panel, and the init_code of the starry-er88577 panel is very similar to the boe-th101mb31ig002 panel, so We will add a new configuration based on "boe,th101mb31ig002-28a.yaml". Because the panel used reset gpio before but did not add the definition of "reset gpio" in binding, reset gpio was added in binding, but since=20 the starry-er88577 panel did not use "reset gpio", a judgment was added=20 here. Signed-off-by: Zhaoxiong Lv Acked-by: Conor Dooley --- Changes between V6 and V5: - 1. Modify the commit information. - 2. Modify "reset gpio" binding. v4: https://lore.kernel.org/all/20240704072958.27876-5-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V5 and V4: - 1. We are compatible with starry-er88577 panels in the boe-th101mb31ig002 - driver, so add it to the "boe,th101mb31ig002-28a.yaml". v4: https://lore.kernel.org/all/20240620115245.31540-2-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V4 and V3: - 1. Move positions to keep the list sorted. v3: https://lore.kernel.org/all/20240614145609.25432-2-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V3 and V2: - 1. Separate the Starry bindings from kingdisplay, and add it to panel-si= mple-dsi.yaml v2: https://lore.kernel.org/all/20240601084528.22502-4-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V2 and V1: - 1. Add compatible for Starry er88577 in Kingdisplay kd101ne3 dt-bindings. --- .../display/panel/boe,th101mb31ig002-28a.yaml | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/boe,th101mb31i= g002-28a.yaml b/Documentation/devicetree/bindings/display/panel/boe,th101mb= 31ig002-28a.yaml index 32df26cbfeed..c5efc560ba1c 100644 --- a/Documentation/devicetree/bindings/display/panel/boe,th101mb31ig002-28= a.yaml +++ b/Documentation/devicetree/bindings/display/panel/boe,th101mb31ig002-28= a.yaml @@ -9,18 +9,18 @@ title: BOE TH101MB31IG002-28A WXGA DSI Display Panel maintainers: - Manuel Traut =20 -allOf: - - $ref: panel-common.yaml# - properties: compatible: enum: # BOE TH101MB31IG002-28A 10.1" WXGA TFT LCD panel - boe,th101mb31ig002-28a + # The Starry-er88577 is a 10.1" WXGA TFT-LCD panel + - starry,er88577 =20 reg: true backlight: true enable-gpios: true + reset-gpios: true power-supply: true port: true rotation: true @@ -31,6 +31,20 @@ required: - enable-gpios - power-supply =20 +allOf: + - $ref: panel-common.yaml# + - if: + properties: + compatible: + # The Starry-er88577 is a 10.1" WXGA TFT-LCD panel + const: starry,er88577 + then: + properties: + reset-gpios: false + else: + required: + - reset-gpios + additionalProperties: false =20 examples: @@ -45,6 +59,7 @@ examples: reg =3D <0>; backlight =3D <&backlight_lcd0>; enable-gpios =3D <&gpio 45 GPIO_ACTIVE_HIGH>; + reset-gpios =3D <&gpio 55 GPIO_ACTIVE_LOW>; rotation =3D <90>; power-supply =3D <&vcc_3v3>; port { --=20 2.17.1 From nobody Thu Dec 18 11:29:50 2025 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B34F4185E48 for ; Tue, 9 Jul 2024 13:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532942; cv=none; b=bXPgNyEt16K+xrcD1NCPptiRHRhFbslJtRw3oEzo6e3tp/RWFNwjK74lTD87hxwoHSJRVE4H6q10pxzONjzr8abegkT3QADgvXQZJjBM2SbD9vfr64et+ARi1yFM0WuqzRM3Psske1CCiFMJjxpIOEVfo+vJGlysM8brQAod2nI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720532942; c=relaxed/simple; bh=+U1Cc+L8+24kC297OtXZuhjLZaBeGH3xqgFMNHm0MAI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=l5A72YdnVQP0gEqzoOSGpHDblhAkiGJ+1Fv+LNNdUgAMNabJ5lOzu2g9yAYsHADO7Dghzng4mxD7HHIG2sNTLe/01cGKwdCh97qoxtp6ai86WJ5f4PmTeASol9qP6CMArrXNj5K7uVhbpQTPLt+N+pYupg7EUxrQNFhqNaDr64I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b=EnU8WpOn; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaqin.corp-partner.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="EnU8WpOn" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1fafb9a33b3so25285315ad.1 for ; Tue, 09 Jul 2024 06:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1720532931; x=1721137731; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=0LDer4lgG10CfZwv78g2/1O/QsyYKSsveDj/sHWq8Y0=; b=EnU8WpOnUDF0/Dazo5gy1DT1zMkxf0/lYBVPuoiEeOO748YH1PK8KCXN7BAM5pLSK3 DOEKyJmujz4lTTaXCfCNesp2Rdo9hyTqt78yxlJQKWr06NcV6UY0DzxHBDxB9PVjanA7 x4n1oiSirWfMLY0wJe4wil2Nt7wCihFjIX/uPPVF+WPS1QaLb3GfzunznS+S6KwR/ROs W2/YNgNKly5Axnm35G81Ygv2sef9dWGIgEyTDDQM1kzrUsewsBR5s8e69QRpXGAaASis L7DNvj/zJi6c3cmzPhAAdgjbGmYC86XR7yZ5Ee8Yt81gtLHnmd3h6duQtvulOUJcVkQq GhXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720532931; x=1721137731; h=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=0LDer4lgG10CfZwv78g2/1O/QsyYKSsveDj/sHWq8Y0=; b=lPJl2Og/mGBdlpyqKhrK66QaSvE47RWxvaciXBuvIoyuK+TvMlt0fDtvdKqGrtijvi w5gGK2LdDLeYHc/yszhJTKa7bTkPEIkAxb+pysYa3QzBkF8cV7MLcX/Yp/RMaBQjZA4/ e7/UdUxBUkx078OS+nbCPQkXPSxYN1dbBQhrlrOZkziXVaLi+wUbzhHiCwRmw2/skEdk nNvZ2OQvieIIL045fve5nMVSh6rf0K7Pcymv654QlF+22G5L9sstezrSllSH2IWgAjeo XcMO5ORRBctdMNo5PL4wGzfMMentKlctFRElOigMpocr5jryQrHQVZDOxFKn0a6n5+kI tIyA== X-Forwarded-Encrypted: i=1; AJvYcCXDP2mfh8wORrUb//tn6hL7AeAC2YG3c5aSmNL0nZEzfkTQ8K5JRQNHd4vN2lWoAgXwV295xPWGwiRJTsuxCkf29ow+0VKkZizSPX2C X-Gm-Message-State: AOJu0YxZY7HmKvcu2v9U28F9hEz1kDhxXe9U8I75j9vLhKf3ZedFi+4Q MDEXgBq3Tpn1/LwJ1ZZG5v411PzP95dM8xn9V/OpkSNlXf1f5lxbfKOp99U0cRo= X-Google-Smtp-Source: AGHT+IEtRsRUTkkAu9rxsEOQiPZlA0Ipx5vAQh5WtecZ3b2Kq2sfW2mId2orsJOk1NcJPnyoJ7RbSQ== X-Received: by 2002:a17:902:ecce:b0:1fb:7e13:a7cd with SMTP id d9443c01a7336-1fbb6d34be6mr22069205ad.37.1720532931188; Tue, 09 Jul 2024 06:48:51 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6ab6b9fsm16211685ad.138.2024.07.09.06.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 06:48:50 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@google.com, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v6 5/5] drm/panel: boe-th101mb31ig002: Support for starry-er88577 MIPI-DSI panel Date: Tue, 9 Jul 2024 21:47:54 +0800 Message-Id: <20240709134754.28013-6-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240709134754.28013-1-lvzhaoxiong@huaqin.corp-partner.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The init_code of the starry-er88577 panel is very similar to the panel-boe-th101mb31ig002-28a.c driver, so we make it compatible with the panel-boe-th101mb31ig002-28a.c driver Signed-off-by: Zhaoxiong Lv Reviewed-by: Neil Armstrong --- Changes between V6 and V5: - 1. Add two lines of init_code (D1 and D3) to modify the internal resista= nce of the mipi channel. v5: https://lore.kernel.org/all/20240704072958.27876-6-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V5 and V4: - 1. Compatible with starry-er88577 panel in panel-boe-th101mb31ig002-28a.= c driver,. v4: https://lore.kernel.org/all/20240620115245.31540-3-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V4 and V3: - 1. Adjust the ".clock" assignment format. v3: https://lore.kernel.org/all/20240614145609.25432-3-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V3 and V2: - Separate Starry-er88577 from the panel-kingdisplay-kd101ne3 driver. - Use mipi_dsi_dcs_set_display_on_multi(). - Use mipi_dsi_dcs_exit_sleep_mode_multi() and mipi_dsi_msleep(). v2: https://lore.kernel.org/all/20240601084528.22502-5-lvzhaoxiong@huaqin.c= orp-partner.google.com/ Changes between V2 and V1: - Add compatible for Starry er88577 in panel-kingdisplay-kd101ne3 drivers. --- .../drm/panel/panel-boe-th101mb31ig002-28a.c | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers= /gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index 5993e6c0cc4a..b55cf80c5522 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -25,6 +25,12 @@ struct panel_desc { enum mipi_dsi_pixel_format format; int (*init)(struct boe_th101mb31ig002 *ctx); unsigned int lanes; + bool lp11_before_reset; + unsigned int vcioo_to_lp11_delay_ms; + unsigned int lp11_to_reset_delay_ms; + unsigned int backlight_off_to_display_off_delay_ms; + unsigned int enter_sleep_to_reset_down_delay_ms; + unsigned int power_off_delay_ms; }; =20 struct boe_th101mb31ig002 { @@ -108,6 +114,68 @@ static int boe_th101mb31ig002_enable(struct boe_th101m= b31ig002 *ctx) return dsi_ctx.accum_err; } =20 +static int starry_er88577_init_cmd(struct boe_th101mb31ig002 *ctx) +{ + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D ctx->dsi }; + + msleep(70); + + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe0, 0xab, 0xba); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe1, 0xba, 0xab); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb1, 0x10, 0x01, 0x47, 0xff); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb2, 0x0c, 0x14, 0x04, 0x50, 0x50= , 0x14); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb3, 0x56, 0x53, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb4, 0x33, 0x30, 0x04); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb6, 0xb0, 0x00, 0x00, 0x10, 0x00= , 0x10, + 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb8, 0x05, 0x12, 0x29, 0x49, 0x40= ); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x7c, 0x61, 0x4f, 0x42, 0x3e= , 0x2d, + 0x31, 0x1a, 0x33, 0x33, 0x33, 0x52, 0x40, + 0x47, 0x38, 0x34, 0x26, 0x0e, 0x06, 0x7c, + 0x61, 0x4f, 0x42, 0x3e, 0x2d, 0x31, 0x1a, + 0x33, 0x33, 0x33, 0x52, 0x40, 0x47, 0x38, + 0x34, 0x26, 0x0e, 0x06); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc0, 0xcc, 0x76, 0x12, 0x34, 0x44= , 0x44, + 0x44, 0x44, 0x98, 0x04, 0x98, 0x04, 0x0f, + 0x00, 0x00, 0xc1); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc1, 0x54, 0x94, 0x02, 0x85, 0x9f= , 0x00, + 0x6f, 0x00, 0x54, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc2, 0x17, 0x09, 0x08, 0x89, 0x08= , 0x11, + 0x22, 0x20, 0x44, 0xff, 0x18, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc3, 0x87, 0x47, 0x05, 0x05, 0x1c= , 0x1c, + 0x1d, 0x1d, 0x02, 0x1e, 0x1e, 0x1f, 0x1f, + 0x0f, 0x0f, 0x0d, 0x0d, 0x13, 0x13, 0x11, + 0x11, 0x24); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc4, 0x06, 0x06, 0x04, 0x04, 0x1c= , 0x1c, + 0x1d, 0x1d, 0x02, 0x1e, 0x1e, 0x1f, 0x1f, + 0x0e, 0x0e, 0x0c, 0x0c, 0x12, 0x12, 0x10, + 0x10, 0x24); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc8, 0x21, 0x00, 0x31, 0x42, 0x34= , 0x16); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xca, 0xcb, 0x43); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcd, 0x0e, 0x4b, 0x4b, 0x20, 0x19= , 0x6b, + 0x06, 0xb3); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd1, 0x40, 0x0d, 0xff, 0x0f); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd2, 0xe3, 0x2b, 0x38, 0x08); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x33, 0x20, 0x3a, 0xd5, 0x86, 0xf3); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd4, 0x00, 0x01, 0x00, 0x0e, 0x04= , 0x44, + 0x08, 0x10, 0x00, 0x00, 0x00); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xe6, 0x80, 0x09, 0xff, 0xff, 0xff= , 0xff, + 0xff, 0xff); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x12, 0x03, 0x20, 0x00, 0xff= ); + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf3, 0x00); + + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); + + mipi_dsi_msleep(&dsi_ctx, 120); + + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + + mipi_dsi_msleep(&dsi_ctx, 20); + + return dsi_ctx.accum_err; +} + static int boe_th101mb31ig002_disable(struct drm_panel *panel) { struct boe_th101mb31ig002 *ctx =3D container_of(panel, @@ -115,12 +183,18 @@ static int boe_th101mb31ig002_disable(struct drm_pane= l *panel) panel); struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D ctx->dsi }; =20 + if (ctx->desc->backlight_off_to_display_off_delay_ms) + mipi_dsi_msleep(&dsi_ctx, ctx->desc->backlight_off_to_display_off_delay_= ms); + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); =20 mipi_dsi_msleep(&dsi_ctx, 120); =20 mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); =20 + if (ctx->desc->enter_sleep_to_reset_down_delay_ms) + mipi_dsi_msleep(&dsi_ctx, ctx->desc->enter_sleep_to_reset_down_delay_ms); + return dsi_ctx.accum_err; } =20 @@ -134,6 +208,9 @@ static int boe_th101mb31ig002_unprepare(struct drm_pane= l *panel) gpiod_set_value_cansleep(ctx->enable, 0); regulator_disable(ctx->power); =20 + if (ctx->desc->power_off_delay_ms) + msleep(ctx->desc->power_off_delay_ms); + return 0; } =20 @@ -151,6 +228,18 @@ static int boe_th101mb31ig002_prepare(struct drm_panel= *panel) return ret; } =20 + if (ctx->desc->vcioo_to_lp11_delay_ms) + msleep(ctx->desc->vcioo_to_lp11_delay_ms); + + if (ctx->desc->lp11_before_reset) { + ret =3D mipi_dsi_dcs_nop(ctx->dsi); + if (ret) + return ret; + } + + if (ctx->desc->lp11_to_reset_delay_ms) + msleep(ctx->desc->lp11_to_reset_delay_ms); + gpiod_set_value_cansleep(ctx->enable, 1); msleep(50); boe_th101mb31ig002_reset(ctx); @@ -187,6 +276,36 @@ static const struct panel_desc boe_th101mb31ig002_desc= =3D { .init =3D boe_th101mb31ig002_enable, }; =20 +static const struct drm_display_mode starry_er88577_default_mode =3D { + .clock =3D (800 + 25 + 25 + 25) * (1280 + 20 + 4 + 12) * 60 / 1000, + .hdisplay =3D 800, + .hsync_start =3D 800 + 25, + .hsync_end =3D 800 + 25 + 25, + .htotal =3D 800 + 25 + 25 + 25, + .vdisplay =3D 1280, + .vsync_start =3D 1280 + 20, + .vsync_end =3D 1280 + 20 + 4, + .vtotal =3D 1280 + 20 + 4 + 12, + .width_mm =3D 135, + .height_mm =3D 216, + .type =3D DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, +}; + +static const struct panel_desc starry_er88577_desc =3D { + .modes =3D &starry_er88577_default_mode, + .lanes =3D 4, + .format =3D MIPI_DSI_FMT_RGB888, + .mode_flags =3D MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | + MIPI_DSI_MODE_LPM, + .init =3D starry_er88577_init_cmd, + .lp11_before_reset =3D true, + .vcioo_to_lp11_delay_ms =3D 5, + .lp11_to_reset_delay_ms =3D 50, + .backlight_off_to_display_off_delay_ms =3D 100, + .enter_sleep_to_reset_down_delay_ms =3D 100, + .power_off_delay_ms =3D 1000, +}; + static int boe_th101mb31ig002_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -313,6 +432,10 @@ static const struct of_device_id boe_th101mb31ig002_of= _match[] =3D { .compatible =3D "boe,th101mb31ig002-28a", .data =3D &boe_th101mb31ig002_desc }, + { + .compatible =3D "starry,er88577", + .data =3D &starry_er88577_desc + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, boe_th101mb31ig002_of_match); --=20 2.17.1