Unverified Commit 2d22b63f authored by Maxime Ripard's avatar Maxime Ripard
Browse files

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: default avatarJavier Martinez Canillas <javierm@redhat.com>
Tested-by: Francesco Dolcini <francesco.dolcini@toradex.com> # Toradex Colibri iMX6
Link: https://lore.kernel.org/r/20250626-drm-panel-simple-fixes-v2-1-5afcaa608bdc@kernel.org


Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
parent 55e8ff84
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -91,12 +91,13 @@ static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
	.restore = pm_generic_restore,
};

static const struct bus_type mipi_dsi_bus_type = {
const struct bus_type mipi_dsi_bus_type = {
	.name = "mipi-dsi",
	.match = mipi_dsi_device_match,
	.uevent = mipi_dsi_uevent,
	.pm = &mipi_dsi_device_pm_ops,
};
EXPORT_SYMBOL_GPL(mipi_dsi_bus_type);

/**
 * of_find_mipi_dsi_device_by_node() - find the MIPI DSI device matching a
+3 −0
Original line number Diff line number Diff line
@@ -223,6 +223,9 @@ struct mipi_dsi_multi_context {

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

extern const struct bus_type mipi_dsi_bus_type;
#define dev_is_mipi_dsi(dev)	((dev)->bus == &mipi_dsi_bus_type)

/**
 * mipi_dsi_pixel_format_to_bpp - obtain the number of bits per pixel for any
 *                                given pixel format defined by the MIPI DSI