Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp94228lqh; Fri, 3 May 2024 14:39:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1lnE/WTYT4wYHRA+AY9/dJREIG9gTMtGD1vFzLGopEb1jWSPOYhEQGpgCLFkvyhQIeE2AkE7B0+XDrJqbpknbTs2dmjs9MMn1MEAwnQ== X-Google-Smtp-Source: AGHT+IEf3Rqewrti4H8oeMNSOgzM7FVHoS0cl55z0PBe5ilJ+L3RKF3NPLmiPuKxqiTbYofSGYPY X-Received: by 2002:a05:6214:2401:b0:6a0:cb69:54a2 with SMTP id fv1-20020a056214240100b006a0cb6954a2mr4440223qvb.58.1714772360625; Fri, 03 May 2024 14:39:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714772360; cv=pass; d=google.com; s=arc-20160816; b=jFv2hI/pTrYLnOF/5FcBgVvmdfS7nFvku9X4QomqHioNDnMSZvm9CYPe/zogdRfkM7 PSq/JPwN6SzFkpcHJYPUK+k96JNvpjIomz87xUgt+vyq64OtXqKwIIuB7rCTQrR1byUO GEpQeielyT2o7e+wArFfGdtRSwnfxRgAcEeSFP8Jp6Z6UomnqmSF3fLcc9jDuYOqFR+K +6Ykgdys1+Wb0O+9mrcBAZMp2Svzoob5ZYMwQcRSws72GtdKuIksaIl1N6rVAg2b4aYE DVlr6w3nAh/2tfBVaXJMMq/Ee8achaQwFCVmvtPhaiXPU/KU3E+wXBcUc/DRwEIv8od5 LaBg== 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=fIbC9LrwuAAq79Jeay6jAxq6GRcu3tw3vRcfcGuhdCM=; fh=KFaorPHqsYI/xyxzttrNAHSoFyTnh0B9zPEUcUrTmno=; b=KETaVVS3P+h3cTGrc1RRfHni08ds9vFfTwUNC4YNZNYHJg1axzqIylT2+kISEySGoY lTjZ/DjTRNaEtTJWVNncNBzzy5OiFDrX2jSBccV6hlWf31+OG1tp/0kxcmIGhvzf2oQk cv0y7LwoDem0usggSH+umnHkFUtwF8WZl8ENFLpgBKztRnZ/lL7969hgsvkLwXdazgHC 0JSkZiIwMTAVMQLXSi90VHEL0u+2J9Gyx18z5D+I7wFlr3Rh3gsdM1GPqWxbPNxnkiQf 246Mj6vanjmODqZ9HN4l3UgIXp15PDwb75dj7kGW0INAsVjQodp0rcCE2rKzQFE0oAtT pXmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UBgEKdDI; 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-168275-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168275-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ed1-20020ad44ea1000000b006a0846da5d6si4216840qvb.559.2024.05.03.14.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168275-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UBgEKdDI; 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-168275-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168275-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 4B7EF1C20B40 for ; Fri, 3 May 2024 21:39:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 331C112F378; Fri, 3 May 2024 21:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UBgEKdDI" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 D093212C7FD for ; Fri, 3 May 2024 21:36:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772215; cv=none; b=tucUR5gcoHyEK6E5WQSPivtoscvFjpQGS04c7jhCV9FZaXV3vGwg9K8lCO++LldRRLdTDbI1kb5paOOW/b9th2AHhsjx0BwEUoasSxMWWQhweVoAQT4tp8Li4q0uiVLj3JwS857SibbKawRubrymdpkvloEdNt9UGaSLXBAv0mk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714772215; c=relaxed/simple; bh=NzqglraYiL6N3znxl8ANLNzO3z0wT085E7fsKkcmN34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P7PClL5CyAtTBdCKANfu8jyZSu/kbLiygJMkSzpgEEImE1L5BI5kyZEPzQFACvRPSPAFed2ZW6LSLN6Scp1zs+5lrNd+JdL40fStBbpWWyRgrw5geUOVzIVvCPdUq2/UU+4ZKKgxUYYUHPDWv8A79TKDRhfAXUs9qe98zivrqUo= 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=UBgEKdDI; arc=none smtp.client-ip=209.85.214.174 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-f174.google.com with SMTP id d9443c01a7336-1ed835f3c3cso1038125ad.3 for ; Fri, 03 May 2024 14:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714772213; x=1715377013; 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=fIbC9LrwuAAq79Jeay6jAxq6GRcu3tw3vRcfcGuhdCM=; b=UBgEKdDI1ZHtsaGmHM9Mx3gEYjF39JjqLknDtVO0VOr8cG0G0rLrU3K40QvsW1vU66 hSJYF2E1s93K7/6k802hTyS0zS+Ws3bZtDrJkn5580Y3YAmgqb00tUg1rI9sLVCujzec EOCS7UFc251wcXfqypJYS36V8BfNADtafJSDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772213; x=1715377013; 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=fIbC9LrwuAAq79Jeay6jAxq6GRcu3tw3vRcfcGuhdCM=; b=TPyBhdahB3z5T53dOlPN+Ws7jiZu4MpAFGqNgaE4rcv27/J5OoW1/WJ5D0r7JrRVDm 1PR3Mh4O0tm1D/HB8X4nS0gXnsjqU6gEg2XP2yT13GiVeEAs4S9icXBWznjVtGJtD6OI dGrSl5b+klcN6oeOCWW5ZlrhjKAJAuKfNFKLBlf2kogXzjLIt6cRXGuNe4Mclue88ldw UeHPRbf6/zHHGvabaAnD4qtmnqkL40X4AfLWGqS52U8Sf7jGkcNpPvDarsFRrWkvwqhb 5hFnQbaVpJcO9yBpfQP/tkDJJWrkGSnt88EIdIECqzOAItXaD8UkjWjeygM2aTVG3pdA uZnw== X-Forwarded-Encrypted: i=1; AJvYcCV1SVH5sP1KsJWtS/thYECLx8grNdaBwpFdM3ItVD0yTXmppdkcbZGjUNAlSUx5IKwYfOATJfuCQ7VmQHETRjCae/3mwASfk+gylQPf X-Gm-Message-State: AOJu0YzaOAo1ccfQNgUU4x+DT//h7ahkh4J0isXMRJm8ed0Rr+Wtj0Pr OI5le7sD28TiRN8KZBKibPljjZJaA15xv5O/XtPCM7JnKy9MUX2Qv1d9iXW6AA== X-Received: by 2002:a17:902:9f98:b0:1eb:6468:7fc3 with SMTP id g24-20020a1709029f9800b001eb64687fc3mr3513255plq.62.1714772213125; Fri, 03 May 2024 14:36:53 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:36:52 -0700 (PDT) From: Douglas Anderson To: dri-devel@lists.freedesktop.org, Maxime Ripard Cc: Linus Walleij , Chris Morgan , Yuran Pereira , Neil Armstrong , Douglas Anderson , Brian Norris , Chris Zhong , Nickey Yang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 12/48] drm/panel: kingdisplay-kd097d04: Stop tracking prepared/enabled Date: Fri, 3 May 2024 14:32:53 -0700 Message-ID: <20240503143327.RFT.v2.12.I711d07c4f4738df199697fd534c452cdfa46a21f@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-Type: text/plain; charset=UTF-8 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: Brian Norris Cc: Chris Zhong Cc: Nickey Yang Cc: "Heiko Stübner" Signed-off-by: Douglas Anderson --- Changes in v2: - Only handle 1 panel per patch. - Split removal of prepared/enabled from handling of remove/shutdown. .../drm/panel/panel-kingdisplay-kd097d04.c | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c index 17f8d80cf2b3..88d775e000d4 100644 --- a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c @@ -23,9 +23,6 @@ struct kingdisplay_panel { struct regulator *supply; struct gpio_desc *enable_gpio; - - bool prepared; - bool enabled; }; struct kingdisplay_panel_cmd { @@ -185,15 +182,10 @@ static int kingdisplay_panel_disable(struct drm_panel *panel) struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel); int err; - if (!kingdisplay->enabled) - return 0; - err = mipi_dsi_dcs_set_display_off(kingdisplay->link); if (err < 0) dev_err(panel->dev, "failed to set display off: %d\n", err); - kingdisplay->enabled = false; - return 0; } @@ -202,9 +194,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel) struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel); int err; - if (!kingdisplay->prepared) - return 0; - err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link); if (err < 0) { dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); @@ -220,8 +209,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel) if (err < 0) return err; - kingdisplay->prepared = false; - return 0; } @@ -231,9 +218,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) int err, regulator_err; unsigned int i; - if (kingdisplay->prepared) - return 0; - gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0); err = regulator_enable(kingdisplay->supply); @@ -275,8 +259,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) /* T7: 10ms */ usleep_range(10000, 11000); - kingdisplay->prepared = true; - return 0; poweroff: @@ -289,18 +271,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) return err; } -static int kingdisplay_panel_enable(struct drm_panel *panel) -{ - struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel); - - if (kingdisplay->enabled) - return 0; - - kingdisplay->enabled = true; - - return 0; -} - static const struct drm_display_mode default_mode = { .clock = 229000, .hdisplay = 1536, @@ -341,7 +311,6 @@ static const struct drm_panel_funcs kingdisplay_panel_funcs = { .disable = kingdisplay_panel_disable, .unprepare = kingdisplay_panel_unprepare, .prepare = kingdisplay_panel_prepare, - .enable = kingdisplay_panel_enable, .get_modes = kingdisplay_panel_get_modes, }; -- 2.45.0.rc1.225.g2a3ae87e7f-goog