From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 B13DC2C028F for ; Thu, 16 Apr 2026 07:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776325172; cv=none; b=GOOG0TOk0RdWMQMg+VwnIkWE7JGVyq1zD5WYyADzuThUIwIECASV2XcUlCjDj75j3YG6SB/187h82tfM6mvEfqNpiShJuarF/Q/RrePUIfKPwB6P1BuyTiFa5CqLJTHFZcHGnF2tAwKS7z62CIcz1I1m+6S1eDpEYP2f56MCe9w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776325172; c=relaxed/simple; bh=SuuukJ9w3AsS6fW/xaUfzmJoDb35F7gdl3aoHgi0LDw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DdwfG44o8fqcIQCGph0oq+sqbOxunjvgZU1F1UJ8Z8RO+/mcj2jnjRQvhsbYWI3lTDtI9b1DFC28mLRjhcHP/QCIxllqHysLtzU3iRFX96NkI7pvGkcpPJ05ZFtIypUQocjE3IxSiwtcWBAY6Jr5Ah3HC6YVtnHP1C+aT8QgqNw= 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=M/bvA77I; arc=none smtp.client-ip=209.85.216.44 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="M/bvA77I" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-354a18c48b5so6713473a91.1 for ; Thu, 16 Apr 2026 00:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776325171; x=1776929971; 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=Kd33L34PL49HjLxsixOFb8JXjhyLJWELYvYdT4Ym4XY=; b=M/bvA77IRYha0uignVYMpzu6ucX+jNCTzRFZ1tPmdGZwHH0FPsRorkGcZHx8+21ms2 DDhCUL9/nRmG9Sp8bm8VaXn2PSBrnptx+u9H/KblPyzqMjNTOB+nVgpecqDdtpsQKNae gyU0DCwaWhlcW8/V7LgFaKyiNhdf/03jaSzruG/S+Pc+x3VrliVgcJK7F7Rcf8QVkiog yO5we2YycvWyfp0yWWZh88cYCDEv+0XiVgQ4xjyYfCL0edWyyIF+29xu69//jetikk46 xgw+QtGetndDPFz4795QFv02JowpA0bDUzEN03W3W2khaPbF4wp1zyla69g1k2t/OfIS tW3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776325171; x=1776929971; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Kd33L34PL49HjLxsixOFb8JXjhyLJWELYvYdT4Ym4XY=; b=Fzug77+JG2X5rwHdLIDc2b9sod3SgSaUeNVrEPHcTfcOCePgO6WZykaFCvINVH31io mO48UtcS68Iyf7d5Rz7eLkU0H95olj6jQzAj9EdcHk5F3Iinkc5dp7f6ZVopq0ZejfAY ihIjFQPLDxTBdg/cnsukjEcCVab/mud415pijS6dNYF57BVyJ7Pl+uOrc/svN9etOoGf N0eS61dSWAsCtau0dvhHy6TarP30iRMjuIxoLcSykYUdDazxNfBfvPopx2vQ6oSuOP+T NN47dTmQOvEwBKSB4JrJ21pfw0jAxTpJEjnj+Pg6HRV5Um3QhRpxbPiWfVsk3GNx62aa gsTQ== X-Forwarded-Encrypted: i=1; AFNElJ9AEX/Z5BrFtOpr86bmGOrH1adQnbvizBQuTRLE1hzf3TQXP8CWYpt9RmiYZBD516b5JVBot8+1A5L2fQ0=@vger.kernel.org X-Gm-Message-State: AOJu0YxaxmUJzPOUky7rdnSPFjmngNahLv0izKxCbukxqjW1LkzOn788 gTTeQmtfUHtJv4wVxwOEUK1jUEwd8gESEPkL2pJNDq04UP2h1cC4TqNZ X-Gm-Gg: AeBDietppptnFcDwRNLE1cWDCoAaW6aXBD6PQQidwxTYBMbvVxSkuzx5vyphEC3Ci9u NB1ob2gCORFp3Bistn2H91m/kF8XJ6f3fN9fhOiwUxzfuAk6ImqWvahx4UJg+MtCvJ7Mfv86rNN IoZW4q7hXq3YMEx1BNtAEcF4o7xE/lDriloDR3HTmGP71MDuCeyY24n0rRh7Vgf6lHqnBqr+hjq Y6QqL4gSvHCNLZRibKV5ybeG5YYgOXyQEA9pbq6WHBwdBqcoFuRrvBwQD/7oj99Z3Dl9sSIVphV E3T67a/864avRig/fj8hCj5bEcPp9/aEnZLqYUdvoeJIIyl+lmWMh19fME228paQDBEWZnXNIh3 laZ+qGnWRg4+ZXS6r8BZcUsi6//n0x3dAW/HYNLHf41nLN32MYbVx6sNmiT5IPf+Y+6GA13ceav kKqwFlDQt3wgxV3YSKfy7Tfpr1aIIjm9S1PaHPukC6rTuhJqaCKcD/goM= X-Received: by 2002:a17:90b:1d8a:b0:35e:3e86:e2d3 with SMTP id 98e67ed59e1d1-35e42777a47mr26140311a91.10.1776325170954; Thu, 16 Apr 2026 00:39:30 -0700 (PDT) Received: from fedoraemon.neon-universe.ts.net ([2406:7400:11d:a9dc:9a14:72eb:1a60:868a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36132d9d228sm1735245a91.10.2026.04.16.00.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 00:39:30 -0700 (PDT) From: Avinal Kumar To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org, dianders@chromium.org Cc: lumag@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch Subject: [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Date: Thu, 16 Apr 2026 13:07:21 +0530 Message-ID: <20260416073722.719036-2-avinal.xlvii@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260416073722.719036-1-avinal.xlvii@gmail.com> References: <20260416073722.719036-1-avinal.xlvii@gmail.com> 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 function 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 0390e14d3157..911e7ca5b9d5 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 convenient to make serial 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 2ab651a36115..b429acde4f71 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -393,6 +393,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.53.0