From nobody Fri Oct 2 14:03:29 2026 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 5E948192B75 for ; Fri, 31 Jul 2026 00:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785456701; cv=none; b=GMrOmctQiZ++LEjANSc/3hrtA2NHX2TJFWiGd4oDJ+jInTvv5ocuIzWJ1lXkJY33f4QhIsTt+fOmss3jj7UPZcqClYGBXOIs5NoADIOW+a+i+qNC3DQbZOEkNr0YQRfekYIhtCAvEYg8eBmXeJ2WxdMz7dubGkUwLHPa9/OE5aQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785456701; c=relaxed/simple; bh=+KpHHX4nmdSzdY+7ecMU2NcXdtitOes6kezhJcooBBI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=Aw/HWaaK/zFb74c78IkLebN0RgW9xfomSIdzzX2SfxUGINCej+uh96n0aNroVwWxWIh5IKu51DlbdDeVdas6/8/pAe8yUeldH88TkJsVpzBR9KEvbI9X4LVj5O8F+O9O0eFqriGFo3lXoM7eYd1Q52k2IBa2HhGhTj4JkzTZybU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U2N879HH; arc=none smtp.client-ip=209.85.128.172 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.b="U2N879HH" Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-7ff05e5d009so5349637b3.1 for ; Thu, 30 Jul 2026 17:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785456699; x=1786061499; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=0X7N1rP90nQg4clD2xUsUJGcghWiLSs6t/EHWysAEeA=; b=U2N879HH/ecS7YCbwtLKQdSOlSa9y0I4ASUeOMzj6ivBeu+ziXEjJ6RhBUuyY0viQY NkylIFGVqq+Ufzpwp4c/f/99OkRT5Kq8cWIGNVhAn2bni8qL6VTD5lEuuCE7ywpdL9iu MY+9Ta33DS1YBzcHmq6XYm3var+Zp3BPILZcXgxSr0T1UxuFkyMNg7ZjjfnwLPUBJl6g 7LMHdp6ecGY7+D9yBLHYsqvJP50s48fU5kWPFD6rwzKLswHpSZbfgD8xh99FZpRt2qvv 8D6WQ92kyhJekNro3TDzlm7jxTkAA4BlEWZNSBI5qealAojoAPpJ10GnsCeMUiUD94QJ 6xjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785456699; x=1786061499; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=0X7N1rP90nQg4clD2xUsUJGcghWiLSs6t/EHWysAEeA=; b=YkAPGgn/8O7KHNrzTg1noqwAJn6zxknTk+aydzwWzio4PYD8E2Z21d/HXf+oaAHrVk A0f9dk6tKEyHVlwaA3IP96EMTLVeu+84HL3eZ5X3yQ5MIAB35QUS9ahfzwUxwqwNZBIA CkCazjT+KNys2yr1AgCVK/0rRFRjemC8Z34ITNZXhNSf3dKjlGB7HKs+MSSghJqpwhnl EJnDupubbaMxT4J8UbWN/XwgnSBR83BZk8C/2r3bxEdWpNLOFEiMOm9LBdu4zv3g2jWF TWwgkz/VGO2knbZxBaoYatV8NQEUJ6lgfeKU72NUTmUJrqHErtcLlmjrIC9Ekxtw8rWV JA7g== X-Forwarded-Encrypted: i=1; AHgh+RrGZBA/ptdghAMGBPmGWdA8ExtR+7N6ZTrIJ7YFqndHMKR9dsP5C2lknOW2K312G3BXlagy70qXFS044cw=@vger.kernel.org X-Gm-Message-State: AOJu0Yyu1nu66eiB37V8hXFZ4G1Fvxn+HiBDFDQvNEZGWp7YfvF36H7K UY1AW7H86xGSBPDl+Xnr2G1FRnj6LN7mRZ5bBaLwRIgZ9SlkBmNuYI8a X-Gm-Gg: AR+sD11GQSmNwbUijJmECVa3+7qkt7UVNMIEAQJBFW0h/l8Xs6NQ8eDVEeyoCb2Zqcz 0xS4ViGarfa4Ln/U4llY+VIWkk/tYnCd8fWrD1JaS84sM9z7ggx3YvSJciVmZcWeNtTWvi3tBOa D9qvjWlciL4kxBdsj4ajgzhzZ0D2G6S5OEAxy64utRiQkvHyWn8CYCk3nFMpEc+Ssxvt83KbhDh UGxG2ZwFvfzhWe0k8P35EZFvPu2OSX7HdWwCC/ZEP1YseShxbu47biNrc+X+Tljwl22ZI7uriZ6 EyUTFJQ/GEjI4hgQa9sMQFOrjvg7S6/96jnySOYiO4QrVVfQ6DWI4BCvtVQA5ABtYCFrw7zpVwU RYD+gSshg8lrKBgiwOvfbGTBzk3DlCMX+gaNRQaipm6awNJgI+bxEVy8isabGdoMT/8xyxwqbB+ waLH/FxqH6x8FKXH1YWm0QuLMZlsZLGN8PpGg4qFNnoVMerBVmcm5ABffLalLNHORpr5rnLXijk bO+ X-Received: by 2002:a05:690c:4d84:b0:81e:97c9:bcf7 with SMTP id 00721157ae682-81fb8b06e85mr36813767b3.71.1785456699054; Thu, 30 Jul 2026 17:11:39 -0700 (PDT) Received: from [192.168.1.71] ([2600:1702:56e9:4b40:e3a9:78c5:641e:a58c]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81fb88c4a92sm19292357b3.7.2026.07.30.17.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 17:11:38 -0700 (PDT) From: Akash Sukhavasi Date: Thu, 30 Jul 2026 19:11:31 -0500 Subject: [PATCH v3] drm/panel: tdo-tl070wsh30: Use mipi_dsi_*_multi(); fix minor bugs 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: quoted-printable Message-Id: <20260730-mipi-dsi-tl070wsh30-multi-v3-1-60592caef4f4@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33NQQ6DIBCF4asY1qWBoYJ01Xs0XaigTiLVgKVtj HcvmjRx5fJ/yXwzk2A92kCu2Uy8jRhweKYQp4zUXflsLUWTmgADyRQAdTgiNQHp1DPF3qETjLp XPyEFpnPQ2uQVB5LuR28b/Gz2/ZG6wzAN/ru9inxd/2p+oEZOOZWaS1YVQhdgb60rsT/XgyOrG mEvqSMJktRcVKWFkoIbsZeWZfkBR+EHmgwBAAA= X-Change-ID: 20260722-mipi-dsi-tl070wsh30-multi-2095299d5b12 To: Doug Anderson , Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Akash Sukhavasi X-Mailer: b4 0.14.3 The mipi_dsi_dcs_*() functions used by this driver are deprecated in favor of their _multi() counterparts, as noted in Documentation/gpu/todo.rst. The _multi() variants record the first error in a context structure and skip every later call once an error is set, so the return value no longer has to be checked after each command. They also log their own failures, which makes the per-call dev_err() calls redundant. Convert prepare() and unprepare(). prepare() uses mipi_dsi_msleep() for the delays between DSI commands. unprepare() uses plain usleep_range() so the delays run unconditionally after the accumulated error is cleared. The delays in the GPIO reset sequence stay as plain msleep() and usleep_range(), since they run before any DSI transaction. unprepare() now disables the regulator unconditionally and returns 0. Previously a failure of set_display_off() was logged and the sequence continued, while a failure of enter_sleep_mode() returned early, leaving the regulator enabled and the panel unable to be brought back up, since drm_panel_unprepare() skips panel->prepared =3D false on error. The accumulated error from set_display_off() is cleared so that the delay and enter_sleep_mode() are still attempted, preserving the original fall-through behavior. Both drm_panel_prepare() and drm_panel_unprepare() return void, so the error was never propagated to a caller in any case. Signed-off-by: Akash Sukhavasi Reviewed-by: Douglas Anderson --- Changes in v3: - Update subject line to reflect the minor bugfixes, per Doug's review. - Pack blank lines in both functions per Doug's review. - Preserve the original fall-through behavior in unprepare(): clear accum_err after set_display_off() so the delay and enter_sleep_mode() are still attempted even if display off fails. - Link to v2: https://lore.kernel.org/r/20260727-mipi-dsi-tl070wsh30-multi-= v2-1-f47b937631d3@gmail.com Compile tested only, no hardware available. checkpatch and a W=3D1 build are clean. Changes in v2: - unprepare() disables the regulator unconditionally and returns 0, per Sashiko's review on v1. Returning an error left panel->prepared set, so the panel could not be prepared again. - Link to v1: https://lore.kernel.org/r/20260725-mipi-dsi-tl070wsh30-multi-= v1-1-69160b83982e@gmail.com --- drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 40 +++++++++---------------= ---- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm= /panel/panel-tdo-tl070wsh30.c index 13cfe252a838..fa961abdd2d7 100644 --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c @@ -35,6 +35,7 @@ struct tdo_tl070wsh30_panel *to_tdo_tl070wsh30_panel(stru= ct drm_panel *panel) static int tdo_tl070wsh30_panel_prepare(struct drm_panel *panel) { struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =3D to_tdo_tl070wsh30_panel(p= anel); + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D tdo_tl070wsh30->link= }; int err; =20 err =3D regulator_enable(tdo_tl070wsh30->supply); @@ -51,44 +52,27 @@ static int tdo_tl070wsh30_panel_prepare(struct drm_pane= l *panel) =20 msleep(200); =20 - err =3D mipi_dsi_dcs_exit_sleep_mode(tdo_tl070wsh30->link); - if (err < 0) { - dev_err(panel->dev, "failed to exit sleep mode: %d\n", err); - regulator_disable(tdo_tl070wsh30->supply); - return err; - } - - msleep(200); + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 200); + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); + mipi_dsi_msleep(&dsi_ctx, 20); =20 - err =3D mipi_dsi_dcs_set_display_on(tdo_tl070wsh30->link); - if (err < 0) { - dev_err(panel->dev, "failed to set display on: %d\n", err); + if (dsi_ctx.accum_err) regulator_disable(tdo_tl070wsh30->supply); - return err; - } - - msleep(20); =20 - return 0; + return dsi_ctx.accum_err; } =20 static int tdo_tl070wsh30_panel_unprepare(struct drm_panel *panel) { struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =3D to_tdo_tl070wsh30_panel(p= anel); - int err; - - err =3D mipi_dsi_dcs_set_display_off(tdo_tl070wsh30->link); - if (err < 0) - dev_err(panel->dev, "failed to set display off: %d\n", err); + struct mipi_dsi_multi_context dsi_ctx =3D { .dsi =3D tdo_tl070wsh30->link= }; =20 + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); + /* Reset error to continue power-down sequence even if display off failed= */ + dsi_ctx.accum_err =3D 0; usleep_range(10000, 11000); - - err =3D mipi_dsi_dcs_enter_sleep_mode(tdo_tl070wsh30->link); - if (err < 0) { - dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); - return err; - } - + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); usleep_range(10000, 11000); =20 regulator_disable(tdo_tl070wsh30->supply); --- base-commit: e05b559f9cda350d0ab33c44a8c1151ca62d2875 change-id: 20260722-mipi-dsi-tl070wsh30-multi-2095299d5b12 Best regards, --=20 Akash Sukhavasi