Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp94066lqh; Fri, 3 May 2024 14:38:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAzGvBbn3JyFz2bzaC4+7sOvhqXYdMTRSIUlHgBuFNKPjuQAFMsew4211MzBOg4HqHxtT3ssNekAA6sNIJN+moZO/swJlntf9+3swZCQ== X-Google-Smtp-Source: AGHT+IGtLYoBepACcZ381WOfmiJpLOy3DsrYn0kt6ypJFQbdUAnLyb9PzPgaJs+s2fMkoNe164SC X-Received: by 2002:aca:1808:0:b0:3c9:53b2:d84b with SMTP id h8-20020aca1808000000b003c953b2d84bmr4019377oih.16.1714772338022; Fri, 03 May 2024 14:38:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714772337; cv=pass; d=google.com; s=arc-20160816; b=CbjnViapwCb25nYp1Mgrm+w/8fXWh/pbVP3XDe8ETEp4DskePNmKHP18DS0AUbp/dS Xeufo8bxwY6RCOZqsJ5itHSAaFfmZy/pUGvvQrEp9olUv0BAnhfHDvlHaARPFQvxRNEu BnXlEcbLY8duKNSaYFq/ECXpyN0Yr2TMkAZrEfcvelYXOtOFhfZ4AhrTV1kHZiPRHd6W Fz0uPnZOZxQ6jWzq8fGFK9aRtqDWHKV2+JXiOVnmBBDJWYaDerig8kHGDS7HEgwHV0/G 5kyAf4ztzO/NcN1SynKsSZwYO0/0jpiRYaZkr3vLW0JXKy3SOYW3n/U0Sa6mmEVUyAO5 khtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NGK5xSZNNlb2uRbxmyeRSuB7caWdrwYvtVpURnzxX80=; fh=EM034AgFFEwS9uUDd8s7QTtG7Yx35lVOhn+Zv2eJia8=; b=kHw+RzdKMl4xI0Lksg+jlNTYleWdfGQmzEvkPf9q1tC05Jz110i7/ZII8hSC8Vwq1i Z13lYH2ocLl+SmUwdPFZnc3Dvg+axHmM58Q2nwfOjhuF1Ocq4kbUa6m6MeVZ7sT90ThX ZBm9+XFfUAPCbka/8GXe+FCdtJExYura9TaJoWOevyLV6vPQZsm9SU5Jc0ifoMfBCpK4 5L1+TdIYDbf6W4L+GVmM/f5Mh9YZwieusfWI+P97V+RJcNe7t1JTPtgX6BbkghUNz6H8 LPMGmd0Pg9NT37FbBsNR1gSI4r0ezpjm73RO1NSwYd45SfC0MXbmHXMkKr37TS1YEGrO lvPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gCoyoTnT; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-168273-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 9-20020ad45ba9000000b006a0c792ac71si3974279qvq.191.2024.05.03.14.38.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:38:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168273-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gCoyoTnT; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-168273-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1AC991C23BCF for ; Fri, 3 May 2024 21:38:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4DA1129E6D; Fri, 3 May 2024 21:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gCoyoTnT" 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 80B14126F11 for ; Fri, 3 May 2024 21:36:49 +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=1714772210; cv=none; b=VXwz86k2ZVb6RDJKTmNbEs/Cb/H6xWRNv0OfQSVqqqVgUpfUL/zHV5FP5P+7Pe+v7A2MEzyRIyoMFhpKcO5xFdch3enVbPAFX036Ma5QYfGvya98Csqc26glUKl7it1nmm0rs1t3osrRfS5u6bek+qGsmTyurprkR3ooyZVF67I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772210; c=relaxed/simple; bh=lGsGSu2+gwavy9O86uOGkKCD4hIuresXwGsoETcDQE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hcoGmkQXzJsgI4YJmptj700gDRWrtyk5l7mDDyOZHRdSCGb8Pkz7d/T9/UvpsYlakOmRBMunzqQPNDbOpKNf5MAdpylFCcqAl8Jv/Z8UnP2L/hbiN7G+Jab/k+cZGvsLSLpe6yrrv9xqCk9m/PUqU+TxD5/9VhAbH3yv95iIBXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gCoyoTnT; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1eb24e3a2d9so1142735ad.1 for ; Fri, 03 May 2024 14:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772209; x=1715377009; 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; bh=NGK5xSZNNlb2uRbxmyeRSuB7caWdrwYvtVpURnzxX80=; b=gCoyoTnTCgwqKZ2OUb4dc/yu4sG+JDphbIin4Ogu5FrtN+aWpvvSDJ59ShqAYioAMs PasDhhF2iGkTQxSlkXsVeD3sMDx/BO0wgW6Nrd8APie76EoxqhBs1ZlEnfrTROMYY0Sc EmLPWaxynmUoJIZgf08VVq+FnV9aWxEfwdaA4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772209; x=1715377009; 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=NGK5xSZNNlb2uRbxmyeRSuB7caWdrwYvtVpURnzxX80=; b=qBw+D4In83+bMTDMN+TYqJ1ubj+fC8aOnGJD067ilu3leV7eUP3SZgCoUComPnCMqz oiYIKtu0sz86rhrSZUi3ehGQME6sQuUcEKgw+viG1IiQ4wOGzh3RQ958+3GiwPxVqfmC p3X4Q0K0yzKradZDDD5OtH6RGFoDu+RJjNBuKakWFCNuD+gEt5LgonrBhUAh+7JZBbHv YNo6Go9wrqrwrU59FUMYusOgtAtTrDjnZtSW7ZvMBk4WgGJ9yNoiETwmBry+qkzf4Cj+ QFSgZQajmPIHKDcT3FKZpd6FbNZdBqyZcr07irOKbJHrlmXByX16U/35di0utNjLwzhj CJjA== X-Forwarded-Encrypted: i=1; AJvYcCW+AWWvVj3IhNCLVN7zFO729nia2BCOXV7MdZVHtNk8O99b3VKO3+4kc+KC1XRRU4/wK/udr0uEZ4Ml87044aKjcnu7WcKTGFtKUX32 X-Gm-Message-State: AOJu0Ywot3cz8fcQQKdx9X6BfAP9D9dFfqpFw1i5fBp/ymnm6Kzf7hdE orSTerLXgSgSSweERE+36xckcNpUGcygZqLuJZ2zxKocI/tspEUfVmKWRB+AbA== X-Received: by 2002:a17:902:b617:b0:1dd:e114:121c with SMTP id b23-20020a170902b61700b001dde114121cmr3627968pls.56.1714772208843; Fri, 03 May 2024 14:36:48 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:fb6a:b54b:7580:64f3]) by smtp.gmail.com with ESMTPSA id j12-20020a170903024c00b001eb51a46f5bsm3729134plh.43.2024.05.03.14.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:47 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Jacobe Zang , Nicolas Belin , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 10/48] drm/panel: khadas-ts050: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:51 -0700 Message-ID: <20240503143327.RFT.v2.10.Ibed1026f20cab08c90fa376e68c2f23a343e826b@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240503213441.177109-1-dianders@chromium.org> References: <20240503213441.177109-1-dianders@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As talked about in commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel"), we want to remove needless code from panel drivers that was storing and double-checking the prepared/enabled state. Even if someone was relying on the double-check before, that double-check is now in the core and not needed in individual drivers. Cc: Jacobe Zang Cc: Nicolas Belin Cc: Neil Armstrong Signed-off-by: Douglas Anderson --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. drivers/gpu/drm/panel/panel-khadas-ts050.c | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.c b/drivers/gpu/drm/panel/panel-khadas-ts050.c index c54be0cc3f08..e35762ebdbd1 100644 --- a/drivers/gpu/drm/panel/panel-khadas-ts050.c +++ b/drivers/gpu/drm/panel/panel-khadas-ts050.c @@ -26,9 +26,6 @@ struct khadas_ts050_panel { struct gpio_desc *reset_gpio; struct gpio_desc *enable_gpio; struct khadas_ts050_panel_data *panel_data; - - bool prepared; - bool enabled; }; struct khadas_ts050_panel_cmd { @@ -642,9 +639,6 @@ static int khadas_ts050_panel_prepare(struct drm_panel *panel) unsigned int i; int err; - if (khadas_ts050->prepared) - return 0; - gpiod_set_value_cansleep(khadas_ts050->enable_gpio, 0); err = regulator_enable(khadas_ts050->supply); @@ -708,8 +702,6 @@ static int khadas_ts050_panel_prepare(struct drm_panel *panel) usleep_range(10000, 11000); - khadas_ts050->prepared = true; - return 0; poweroff: @@ -726,11 +718,6 @@ static int khadas_ts050_panel_unprepare(struct drm_panel *panel) struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); int err; - if (!khadas_ts050->prepared) - return 0; - - khadas_ts050->prepared = false; - err = mipi_dsi_dcs_enter_sleep_mode(khadas_ts050->link); if (err < 0) dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); @@ -747,31 +734,17 @@ static int khadas_ts050_panel_unprepare(struct drm_panel *panel) return 0; } -static int khadas_ts050_panel_enable(struct drm_panel *panel) -{ - struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); - - khadas_ts050->enabled = true; - - return 0; -} - static int khadas_ts050_panel_disable(struct drm_panel *panel) { struct khadas_ts050_panel *khadas_ts050 = to_khadas_ts050_panel(panel); int err; - if (!khadas_ts050->enabled) - return 0; - err = mipi_dsi_dcs_set_display_off(khadas_ts050->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); usleep_range(10000, 11000); - khadas_ts050->enabled = false; - return 0; } @@ -815,7 +788,6 @@ static int khadas_ts050_panel_get_modes(struct drm_panel *panel, static const struct drm_panel_funcs khadas_ts050_panel_funcs = { .prepare = khadas_ts050_panel_prepare, .unprepare = khadas_ts050_panel_unprepare, - .enable = khadas_ts050_panel_enable, .disable = khadas_ts050_panel_disable, .get_modes = khadas_ts050_panel_get_modes, }; -- 2.45.0.rc1.225.g2a3ae87e7f-goog