From nobody Sun Feb 8 08:42:46 2026 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 ACEE531ED7F for ; Tue, 6 Jan 2026 11:23:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767698612; cv=none; b=u9nbK6Qw2zcmxFVLGbFnh5FR1RLWwOXY1RpitilIaGy4SPB7mIJAaPOYJP5w3qafhVensZ9XR3NeAGvfOcj1wWClCK5ppqpMVQZ0kKLpViYCjDrfLldCcdfNKaGB9rnYqgWk2YM8+/3fqzQI5q0Xh/RjhfOMlw1sVvuK/5h5tKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767698612; c=relaxed/simple; bh=W1loB4xSwIlArvFhbK6BveBMVRH0DX/kW16LQ/BYAss=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pGnAQyxutxcPJ+SQujBzUwP9f8rug1kZsyJJm4pPM/iM/FUam5TloINKSmT/A0har2zbEjB/y0lia50KZVJn7rgJroVEj0FLZV+B+bMBWPPun/wrfM7FXzN9sb363sh/KeSBd3dPAxGmyYz7a3ERDm/00On/P7FHX6oNaYwSrc4= 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=DDMP3xof; arc=none smtp.client-ip=209.85.216.42 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="DDMP3xof" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-34ccdcbe520so556622a91.1 for ; Tue, 06 Jan 2026 03:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767698610; x=1768303410; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CdeNxRmOazgFecyP2yX9UiIoy/wJtLsxRt5Z3FieZCI=; b=DDMP3xofTqJPUUgL+1LFP2emNb4JlASTFqV8eqrXTwi7lp6+9Cu2pRCSOKYOkNyV8P X7hb2sN2XTO034HLgS8pBii1FVeafAhR60kLRYbZbaOUxeqnZRyPeLl4UDtMUsMb8D7f MAAo4bydfENp8y3yk4Avii4G8qK9HlheGS2jbp6nvBr30mKxbo+888N67JZfyogb1tDl Vq1DlCdM8VLmCa4PRmBcCccJsmHQYsxZwuIuOEuUjdUyW5U71rbPJdqlJ8bsflAH+nhu n9YnROlHdmhplaqmv6XW7F74pJe8tNa5/AuHe+2TxAZHDv0rSFffTru/I1vRCUmRImLC dyBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767698610; x=1768303410; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CdeNxRmOazgFecyP2yX9UiIoy/wJtLsxRt5Z3FieZCI=; b=NnD/vvf8L8jWxaah8RpJscZptC0Dp7Y8PjdQ8/XL4uNdJpXY3eObS/oAd4fv/6ZfNJ nj5Uj1EEyO/7hZMC2IST/8NSljb5WqeFEzH6pslmCQyjTeh7JCyhVpgLyBMh+lVGmmHp uPNfi5DT6QiOWy6WuSYJE6fj1jTkXChedblclm0qhIc3RELDypZ13OYDmHPZQwmpwh3J wwP+aP+B5KaB2+2TaadsnwkOIOHvwysdIqaOirxbZMWbKKHoIsiZBArlzXdLa/Apk/S2 6EA2W4KYlDXzvRFIcXNi7Bvbl4PZE4K+kK5qT+Q89GjzuoMzylvuxFaJp4XjW5JmmHI5 na2w== X-Forwarded-Encrypted: i=1; AJvYcCUXWoh2yMAsyUwznaOMppBXjC3DSsAVayojgEhtPw5L7nc93cvWiIEvRIO7AwjbR+pugjBsE1FMG4G+tV0=@vger.kernel.org X-Gm-Message-State: AOJu0YzuhLG52iEZ8xGmqJohmIyP9VnoKOygUjfOaW2LnAn5/WH4SBcd 7c0nMpmzGucoqbxSY8lWjQu29XNXMSo533EI53HLCmTulPIzgkwOLOSJbNryfkfZ X-Gm-Gg: AY/fxX78PoeEtosBQkdz2NwwbcI7cuFJEMPVR4SvZr1STI3eEQsCh79RMJOady3Hlpx 0yhhfSUeP6tKRCZvwiv/DRj9fdrBe5L8ZgjyfoTFd6nfIyuYf9Xzg+pe0MvtaflPph6bmMV0gil 9VIveRXWACzclwV3bVEwvrVTvt7Yjf2RTSRLvypoZdMnfb3T2JPIcFE9YLYd3+e+shT/IygYQ9A XkDu5iTIBXH5IGUuLRq6K5NzAt3CObY/sJ2siHGqwMAst5akpH6Pta1p1sHqL7OmHjOiaTSLlpW upHwHsj5vfzFqVwkssQ+39QJ7fjprO/FmIh2ncwLaUktX8Z/9FhcKHPk6VoWq/NbW/wpwS2rg22 wiiC68jvFzPzuQqsKXOcs3wVIzmAtlqNO1fHyaoWrCKAxws4ca3DWGzlCxJWmd6ek9bV2vUKdi8 F3vxHmgsXRu3Oa9o2DH4CH7yLfc4dcn1YXB0xsVX8Uj60= X-Google-Smtp-Source: AGHT+IG/w96HXTUBou/egRTJSncABmhVcvqE3lBhRyJ+OwDJM3mguaIa2ewuMRttfEROTp30zmMaLw== X-Received: by 2002:a17:90b:568c:b0:34c:9cec:3898 with SMTP id 98e67ed59e1d1-34f5f928c3dmr2048134a91.13.1767698609848; Tue, 06 Jan 2026 03:23:29 -0800 (PST) Received: from fedoraemon.neon-universe.ts.net ([2406:7400:11d:8d1e:2efc:b0bd:c261:aa04]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34f5fa78ebdsm2044534a91.4.2026.01.06.03.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 03:23:29 -0800 (PST) From: Avinal Kumar To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch Subject: [PATCH] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Date: Tue, 6 Jan 2026 16:51:58 +0530 Message-ID: <20260106112302.204635-1-avinal.xlvii@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add mipi_dsi_shutdown_peripheral_multi function and mark mipi_dsi_shutdown_peripheral function as deprecated. Signed-off-by: Avinal Kumar --- Please refer: https://patchwork.kernel.org/project/dri-devel/patch/20251127= 161337.396531-1-avinal.xlvii@gmail.com/#26719778 Build and boot tested with QEMU. drivers/gpu/drm/drm_mipi_dsi.c | 28 ++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 29 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index a712e177b350..2fed50172a44 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -587,6 +587,9 @@ EXPORT_SYMBOL(mipi_dsi_create_packet); * mipi_dsi_shutdown_peripheral() - sends a Shutdown Peripheral command * @dsi: DSI peripheral device * + * This function is deprecated. Use mipi_dsi_shutdown_peripheral_multi() + * instead. + * * Return: 0 on success or a negative error code on failure. */ int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi) @@ -1980,6 +1983,31 @@ void mipi_dsi_dcs_set_tear_scanline_multi(struct mip= i_dsi_multi_context *ctx, } EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline_multi); +/** + * mipi_dsi_shutdown_peripheral_multi() - sends a Shutdown Peripheral comm= and + * @ctx: Context for multiple DSI transactions + * + * Like mipi_dsi_shutdown_peripheral() but deals with errors in a way that + * makes it convienient to make seeral calls in a row. + */ +void mipi_dsi_shutdown_peripheral_multi(struct mipi_dsi_multi_context *ctx) +{ + struct mipi_dsi_device *dsi =3D ctx->dsi; + struct device *dev =3D &dsi->dev; + int ret; + + if (ctx->accum_err) + return; + + ret =3D mipi_dsi_shutdown_peripheral(dsi); + if (ret < 0) { + ctx->accum_err =3D ret; + dev_err(dev, "Failed to shutdown peripheral: %d\n", + ctx->accum_err); + } +} +EXPORT_SYMBOL(mipi_dsi_shutdown_peripheral_multi); + static int mipi_dsi_drv_probe(struct device *dev) { struct mipi_dsi_driver *drv =3D to_mipi_dsi_driver(dev->driver); diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 3aba7b380c8d..19ccdf5eeb5f 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -389,6 +389,7 @@ void mipi_dsi_dcs_set_page_address_multi(struct mipi_ds= i_multi_context *ctx, void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *c= tx, u16 scanline); void mipi_dsi_dcs_set_tear_off_multi(struct mipi_dsi_multi_context *ctx); +void mipi_dsi_shutdown_peripheral_multi(struct mipi_dsi_multi_context *ctx= ); /** * mipi_dsi_generic_write_seq_multi - transmit data using a generic write = packet -- 2.52.0