From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 C52EA50096E for ; Fri, 9 Jan 2026 15:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767973938; cv=none; b=M8UOjoQbNqIOIuKmqRaaEuqTBydlpIDSSxbPNABu5BY7aDRcC6CKYlq1FEjdYrXSJMsHnps4CdrL6z49DRQdAATpF/8IPFD6RlZcHPv3LUfZ5qgMRQXmuoUoPYv64Ln20wehrNFEbX8uGZDuIGi+hmEfU3TtT2VfC/hb9I+1bMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767973938; c=relaxed/simple; bh=4q3prGW4JUjHVB4IVlvb5WsYPcnrot+/6I23ixO9UZo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JUMStCRjKbURMtqWRZcyP7wPbh+u8zDMI5U23jxIBm3GvcIIhCYnyyu3kakUwpc4/D+rc8afeiMm8x6/cma8g4bdffwqqN1O44wNsigzWdl+okauTQIl1FmEUkPUNlLinOLA/qtSpQg1FsTOAjdXABVh3VIFHsvm8uvmvTldFHo= 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=Vxowex+O; arc=none smtp.client-ip=209.85.214.175 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="Vxowex+O" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2a0833b5aeeso46035425ad.1 for ; Fri, 09 Jan 2026 07:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767973934; x=1768578734; 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=XrlduJZJPMbIa1RfsQnFtGNBelRs3n9wJNobxuDPXfM=; b=Vxowex+Omo/HfG/czoPqyACMMRvWXLwrEvY7fZ3TwJaGH2PbsQAhunoqWD5Hc1/ZgH fkWswuTL87qbwVP/b5Z/k2LKunIL1pF5W71QvOUSWJAZnQFDdSPVChit6oItUrh8tMQO Q0UvtKn51roqF/wfyDxQ9kkdeL4jE84ekBs3co+N5hbfG+LsZxZ9OE8xbpLnoLLsEZ/k j3mrtCaUbY3tWTkZYee6fJTSgRNQnnh2eobuBqK3spzVutwfd5FDCyCCxYbeaBAE/EXT Pb9M+HAED29opJ2LeJJEFa4yh3jX8a4PS+XQXbF0xTlVrSlvUDd6t+7EJvyctffagIrV NRcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767973934; x=1768578734; 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=XrlduJZJPMbIa1RfsQnFtGNBelRs3n9wJNobxuDPXfM=; b=dFt1dePV9rCJ5VKvCCem/Xpys3R/yRnHNk4BOpC4wYdOL8ZJaYOEqBO0OeGJaSD/uh D8tSp2iPyi+2M+Ie861O91DY3SFfne9wzyeZjmxJ5VSgOe8F6qTs5a+t1JSg0cxhK9K8 Az8yE7a0sL8tOrhgy+MfQIjvR8h+1lKcJnZYByuEtNxZH9ZPvmLQoGXTq4I9AJAdbmia 6yH/4ZNcRv+Yk+3QS1s0dqfFozIohHiSN8XjUKVpTAX8VNCDuKyFYymlLoygQV3T2zWk fxlYRWEMx/WeLklM47FNTKS3/COA+yQnIKVAS34KR9kgIsGh6dGZE2YKHeAdL0xnkEjA 66bA== X-Gm-Message-State: AOJu0YzuNrxRQjgTB+0RPJ9a8ljBEcQ6fcOoXALFFgLb5Fop3uCVKKql 0m8lESmynAaySWhFEqeSxMPpq0APH2wZT9dY/czpuXHBtsmBcFbBBzCy X-Gm-Gg: AY/fxX4FEI8NIYDwyOE9zKl80BvDS0ZHNZu0BLDl3+ltXx9DNuiAdiFlju2mfN5G0lV tuuIZIMJedkQ/4i0Z1OdtFFiAtwaEm3TKsUrdOdjaYdWBqihInQWVcbkYcgCcRF2nqCUhJ0D7oV oRBbfxjE+WkrXQxJszGcgCrfI4G6ULlQ0ApCeOuK/xnUrVvoq8dtwm61jUv7QbvXlr/KY3YMnEr OV1x5FV3v8SWIex04JD1xVelYeEyBxKMSiGdP/aBkQFAzNuyBaiGdiGI7ecHsZf2Yt/O7o+fES4 NJrEfyqi9/8h1nGyD0vDJBAtS2AaQUg+lPZpV4X4S/x+FvpDe5GQBEOPaz13d3SNfN0GWq/HhXO YD94GUm5d01yO9B4NciGe3/WFAsg5jTaio2NqvWIsw6WJ420EIhTq78UPJYZf+AlzV02FnFyEV/ 1pzFI6g4iQ4doIiD3e/+O0XKAHA/IboSJkwKT033qpGq0= X-Google-Smtp-Source: AGHT+IFIH81GCZVymyVjhEEPzWp2FMic73Pt0leqM4AriPEjr1nxoaSr4ogDtTYjeZ1QHstoFsbm/g== X-Received: by 2002:a17:903:9ce:b0:2a2:f1d4:3b64 with SMTP id d9443c01a7336-2a3ee4447e1mr102257355ad.21.1767973934086; Fri, 09 Jan 2026 07:52:14 -0800 (PST) Received: from fedoraemon.neon-universe.ts.net ([2406:7400:11d:8d1e:1613:9777:a803:43fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a3e3cd4654sm110278455ad.97.2026.01.09.07.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jan 2026 07:52:13 -0800 (PST) From: Avinal Kumar To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, neil.armstrong@linaro.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch Subject: [PATCH v2 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Date: Fri, 9 Jan 2026 21:22:02 +0530 Message-ID: <20260109155203.34886-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: 8bit Add mipi_dsi_shutdown_peripheral_multi function and mark mipi_dsi_shutdown_peripheral fucntion as deprecated. Signed-off-by: Avinal Kumar --- 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 mipi_dsi_multi_context *ctx, } EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline_multi); +/** + * mipi_dsi_shutdown_peripheral_multi() - sends a Shutdown Peripheral command + * @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 = ctx->dsi; + struct device *dev = &dsi->dev; + int ret; + + if (ctx->accum_err) + return; + + ret = mipi_dsi_shutdown_peripheral(dsi); + if (ret < 0) { + ctx->accum_err = 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 = 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_dsi_multi_context *ctx, void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx, 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