Skip to content

Commit 2d22b63

Browse files
committed
drm/mipi-dsi: Add dev_is_mipi_dsi function
This will be especially useful for generic panels (like panel-simple) which can take different code path depending on if they are MIPI-DSI devices or platform devices. Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Francesco Dolcini <[email protected]> # Toradex Colibri iMX6 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent 55e8ff8 commit 2d22b63

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/gpu/drm/drm_mipi_dsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
9191
.restore = pm_generic_restore,
9292
};
9393

94-
static const struct bus_type mipi_dsi_bus_type = {
94+
const struct bus_type mipi_dsi_bus_type = {
9595
.name = "mipi-dsi",
9696
.match = mipi_dsi_device_match,
9797
.uevent = mipi_dsi_uevent,
9898
.pm = &mipi_dsi_device_pm_ops,
9999
};
100+
EXPORT_SYMBOL_GPL(mipi_dsi_bus_type);
100101

101102
/**
102103
* of_find_mipi_dsi_device_by_node() - find the MIPI DSI device matching a

include/drm/drm_mipi_dsi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ struct mipi_dsi_multi_context {
223223

224224
#define to_mipi_dsi_device(__dev) container_of_const(__dev, struct mipi_dsi_device, dev)
225225

226+
extern const struct bus_type mipi_dsi_bus_type;
227+
#define dev_is_mipi_dsi(dev) ((dev)->bus == &mipi_dsi_bus_type)
228+
226229
/**
227230
* mipi_dsi_pixel_format_to_bpp - obtain the number of bits per pixel for any
228231
* given pixel format defined by the MIPI DSI

0 commit comments

Comments
 (0)