summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2024-06-26 16:22:08 +0200
committerNeil Armstrong <neil.armstrong@linaro.org>2024-06-26 18:38:29 +0200
commit3ebc76c424bc0f0768f5c346667e8f51217917ba (patch)
tree8ea88f66bb656c62a772f60939d6266ea065a710 /include/drm
parent47d5c1934edcbda13d4fab4d7019b9ec8be0fe08 (diff)
drm/mipi-dsi: add mipi_dsi_usleep_range helper
Like for mipi_dsi_msleep(), usleep_range() may often be called in between mipi_dsi_dcs_*() functions and needs a multi compatible counter part. Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20240626142212.1341556-3-jbrunet@baylibre.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240626142212.1341556-3-jbrunet@baylibre.com
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_mipi_dsi.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 71d121aeef24..0f520eeeaa8e 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -10,6 +10,7 @@
#define __DRM_MIPI_DSI_H__
#include <linux/device.h>
+#include <linux/delay.h>
struct mipi_dsi_host;
struct mipi_dsi_device;
@@ -297,6 +298,12 @@ ssize_t mipi_dsi_generic_read(struct mipi_dsi_device *dsi, const void *params,
msleep(delay); \
} while (0)
+#define mipi_dsi_usleep_range(ctx, min, max) \
+ do { \
+ if (!(ctx)->accum_err) \
+ usleep_range(min, max); \
+ } while (0)
+
/**
* enum mipi_dsi_dcs_tear_mode - Tearing Effect Output Line mode
* @MIPI_DSI_DCS_TEAR_MODE_VBLANK: the TE output line consists of V-Blanking