1 // SPDX-License-Identifier: GPL-2.0+
8 #include <linux/media-bus-format.h>
9 #include <linux/mfd/syscon.h>
10 #include <linux/module.h>
12 #include <linux/of_device.h>
13 #include <linux/of_graph.h>
14 #include <linux/phy/phy.h>
15 #include <linux/pm_runtime.h>
16 #include <linux/regmap.h>
18 #include <drm/drm_atomic_state_helper.h>
19 #include <drm/drm_bridge.h>
20 #include <drm/drm_connector.h>
21 #include <drm/drm_fourcc.h>
22 #include <drm/drm_of.h>
23 #include <drm/drm_print.h>
25 #include "imx-ldb-helper.h"
27 #define LDB_CH_SEL BIT(28)
30 #define CH_HSYNC_M(id) BIT(0 + ((id) * 2))
31 #define CH_VSYNC_M(id) BIT(1 + ((id) * 2))
32 #define CH_PHSYNC(id) BIT(0 + ((id) * 2))
33 #define CH_PVSYNC(id) BIT(1 + ((id) * 2))
35 #define DRIVER_NAME "imx8qxp-ldb"
37 struct imx8qxp_ldb_channel {
38 struct ldb_channel base;
46 struct imx8qxp_ldb_channel channel[MAX_LDB_CHAN_NUM];
47 struct clk *clk_pixel;
48 struct clk *clk_bypass;
49 struct drm_bridge *companion;
53 static inline struct imx8qxp_ldb_channel *
54 base_to_imx8qxp_ldb_channel(struct ldb_channel *base)
56 return container_of(base, struct imx8qxp_ldb_channel, base);
59 static inline struct imx8qxp_ldb *base_to_imx8qxp_ldb(struct ldb *base)
61 return container_of(base, struct imx8qxp_ldb, base);
64 static void imx8qxp_ldb_set_phy_cfg(struct imx8qxp_ldb *imx8qxp_ldb,
65 unsigned long di_clk, bool is_split,
66 struct phy_configure_opts_lvds *phy_cfg)
68 phy_cfg->bits_per_lane_and_dclk_cycle = 7;
72 phy_cfg->differential_clk_rate = di_clk / 2;
73 phy_cfg->is_slave = !imx8qxp_ldb->companion;
75 phy_cfg->differential_clk_rate = di_clk;
76 phy_cfg->is_slave = false;
81 imx8qxp_ldb_bridge_atomic_check(struct drm_bridge *bridge,
82 struct drm_bridge_state *bridge_state,
83 struct drm_crtc_state *crtc_state,
84 struct drm_connector_state *conn_state)
86 struct ldb_channel *ldb_ch = bridge->driver_private;
87 struct ldb *ldb = ldb_ch->ldb;
88 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch =
89 base_to_imx8qxp_ldb_channel(ldb_ch);
90 struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb);
91 struct drm_bridge *companion = imx8qxp_ldb->companion;
92 struct drm_display_mode *adj = &crtc_state->adjusted_mode;
93 unsigned long di_clk = adj->clock * 1000;
94 bool is_split = ldb_channel_is_split_link(ldb_ch);
95 union phy_configure_opts opts = { };
96 struct phy_configure_opts_lvds *phy_cfg = &opts.lvds;
99 ret = ldb_bridge_atomic_check_helper(bridge, bridge_state,
100 crtc_state, conn_state);
104 imx8qxp_ldb_set_phy_cfg(imx8qxp_ldb, di_clk, is_split, phy_cfg);
105 ret = phy_validate(imx8qxp_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts);
107 DRM_DEV_DEBUG_DRIVER(imx8qxp_ldb->dev,
108 "failed to validate PHY: %d\n", ret);
112 if (is_split && companion) {
113 ret = companion->funcs->atomic_check(companion,
114 bridge_state, crtc_state, conn_state);
123 imx8qxp_ldb_bridge_mode_set(struct drm_bridge *bridge,
124 const struct drm_display_mode *mode,
125 const struct drm_display_mode *adjusted_mode)
127 struct ldb_channel *ldb_ch = bridge->driver_private;
128 struct ldb_channel *companion_ldb_ch;
129 struct ldb *ldb = ldb_ch->ldb;
130 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch =
131 base_to_imx8qxp_ldb_channel(ldb_ch);
132 struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb);
133 struct drm_bridge *companion = imx8qxp_ldb->companion;
134 struct device *dev = imx8qxp_ldb->dev;
135 unsigned long di_clk = adjusted_mode->clock * 1000;
136 bool is_split = ldb_channel_is_split_link(ldb_ch);
137 union phy_configure_opts opts = { };
138 struct phy_configure_opts_lvds *phy_cfg = &opts.lvds;
139 u32 chno = ldb_ch->chno;
142 ret = pm_runtime_get_sync(dev);
144 DRM_DEV_ERROR(dev, "failed to get runtime PM sync: %d\n", ret);
146 ret = phy_init(imx8qxp_ldb_ch->phy);
148 DRM_DEV_ERROR(dev, "failed to initialize PHY: %d\n", ret);
150 ret = phy_set_mode(imx8qxp_ldb_ch->phy, PHY_MODE_LVDS);
152 DRM_DEV_ERROR(dev, "failed to set PHY mode: %d\n", ret);
154 if (is_split && companion) {
155 companion_ldb_ch = bridge_to_ldb_ch(companion);
157 companion_ldb_ch->in_bus_format = ldb_ch->in_bus_format;
158 companion_ldb_ch->out_bus_format = ldb_ch->out_bus_format;
161 clk_set_rate(imx8qxp_ldb->clk_bypass, di_clk);
162 clk_set_rate(imx8qxp_ldb->clk_pixel, di_clk);
164 imx8qxp_ldb_set_phy_cfg(imx8qxp_ldb, di_clk, is_split, phy_cfg);
165 ret = phy_configure(imx8qxp_ldb_ch->phy, &opts);
167 DRM_DEV_ERROR(dev, "failed to configure PHY: %d\n", ret);
170 ldb->ldb_ctrl &= ~LDB_CH_SEL;
172 ldb->ldb_ctrl |= LDB_CH_SEL;
174 /* input VSYNC signal from pixel link is active low */
175 if (imx8qxp_ldb_ch->di_id == 0)
176 ldb->ldb_ctrl |= LDB_DI0_VS_POL_ACT_LOW;
178 ldb->ldb_ctrl |= LDB_DI1_VS_POL_ACT_LOW;
181 * For split mode, settle input VSYNC signal polarity and
182 * channel selection down early.
185 regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl);
187 ldb_bridge_mode_set_helper(bridge, mode, adjusted_mode);
189 if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
190 regmap_update_bits(ldb->regmap, SS_CTRL, CH_VSYNC_M(chno), 0);
191 else if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
192 regmap_update_bits(ldb->regmap, SS_CTRL,
193 CH_VSYNC_M(chno), CH_PVSYNC(chno));
195 if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
196 regmap_update_bits(ldb->regmap, SS_CTRL, CH_HSYNC_M(chno), 0);
197 else if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
198 regmap_update_bits(ldb->regmap, SS_CTRL,
199 CH_HSYNC_M(chno), CH_PHSYNC(chno));
201 if (is_split && companion)
202 companion->funcs->mode_set(companion, mode, adjusted_mode);
206 imx8qxp_ldb_bridge_atomic_pre_enable(struct drm_bridge *bridge,
207 struct drm_bridge_state *old_bridge_state)
209 struct ldb_channel *ldb_ch = bridge->driver_private;
210 struct ldb *ldb = ldb_ch->ldb;
211 struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb);
212 struct drm_bridge *companion = imx8qxp_ldb->companion;
213 bool is_split = ldb_channel_is_split_link(ldb_ch);
215 clk_prepare_enable(imx8qxp_ldb->clk_pixel);
216 clk_prepare_enable(imx8qxp_ldb->clk_bypass);
218 if (is_split && companion)
219 companion->funcs->atomic_pre_enable(companion, old_bridge_state);
223 imx8qxp_ldb_bridge_atomic_enable(struct drm_bridge *bridge,
224 struct drm_bridge_state *old_bridge_state)
226 struct ldb_channel *ldb_ch = bridge->driver_private;
227 struct ldb *ldb = ldb_ch->ldb;
228 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch =
229 base_to_imx8qxp_ldb_channel(ldb_ch);
230 struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb);
231 struct drm_bridge *companion = imx8qxp_ldb->companion;
232 struct device *dev = imx8qxp_ldb->dev;
233 bool is_split = ldb_channel_is_split_link(ldb_ch);
236 if (ldb_ch->chno == 0 || is_split) {
237 ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
238 ldb->ldb_ctrl |= imx8qxp_ldb_ch->di_id == 0 ?
239 LDB_CH0_MODE_EN_TO_DI0 : LDB_CH0_MODE_EN_TO_DI1;
241 if (ldb_ch->chno == 1 || is_split) {
242 ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK;
243 ldb->ldb_ctrl |= imx8qxp_ldb_ch->di_id == 0 ?
244 LDB_CH1_MODE_EN_TO_DI0 : LDB_CH1_MODE_EN_TO_DI1;
247 ldb_bridge_enable_helper(bridge);
249 ret = phy_power_on(imx8qxp_ldb_ch->phy);
251 DRM_DEV_ERROR(dev, "failed to power on PHY: %d\n", ret);
253 if (is_split && companion)
254 companion->funcs->atomic_enable(companion, old_bridge_state);
258 imx8qxp_ldb_bridge_atomic_disable(struct drm_bridge *bridge,
259 struct drm_bridge_state *old_bridge_state)
261 struct ldb_channel *ldb_ch = bridge->driver_private;
262 struct ldb *ldb = ldb_ch->ldb;
263 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch =
264 base_to_imx8qxp_ldb_channel(ldb_ch);
265 struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb);
266 struct drm_bridge *companion = imx8qxp_ldb->companion;
267 struct device *dev = imx8qxp_ldb->dev;
268 bool is_split = ldb_channel_is_split_link(ldb_ch);
271 ret = phy_power_off(imx8qxp_ldb_ch->phy);
273 DRM_DEV_ERROR(dev, "failed to power off PHY: %d\n", ret);
275 ret = phy_exit(imx8qxp_ldb_ch->phy);
277 DRM_DEV_ERROR(dev, "failed to teardown PHY: %d\n", ret);
279 ldb_bridge_disable_helper(bridge);
281 clk_disable_unprepare(imx8qxp_ldb->clk_bypass);
282 clk_disable_unprepare(imx8qxp_ldb->clk_pixel);
284 if (is_split && companion)
285 companion->funcs->atomic_disable(companion, old_bridge_state);
287 ret = pm_runtime_put(dev);
289 DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
292 static const u32 imx8qxp_ldb_bus_output_fmts[] = {
293 MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
294 MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
295 MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
299 static bool imx8qxp_ldb_bus_output_fmt_supported(u32 fmt)
303 for (i = 0; i < ARRAY_SIZE(imx8qxp_ldb_bus_output_fmts); i++) {
304 if (imx8qxp_ldb_bus_output_fmts[i] == fmt)
312 imx8qxp_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
313 struct drm_bridge_state *bridge_state,
314 struct drm_crtc_state *crtc_state,
315 struct drm_connector_state *conn_state,
317 unsigned int *num_input_fmts)
319 struct drm_display_info *di;
320 const struct drm_format_info *finfo;
323 if (!imx8qxp_ldb_bus_output_fmt_supported(output_fmt))
328 input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL);
332 switch (output_fmt) {
333 case MEDIA_BUS_FMT_FIXED:
334 di = &conn_state->connector->display_info;
337 * Look at the first bus format to determine input format.
338 * Default to MEDIA_BUS_FMT_RGB888_1X24, if no match.
340 if (di->num_bus_formats) {
341 finfo = drm_format_info(di->bus_formats[0]);
343 input_fmts[0] = finfo->depth == 18 ?
344 MEDIA_BUS_FMT_RGB666_1X24_CPADHI :
345 MEDIA_BUS_FMT_RGB888_1X24;
347 input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
350 case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
351 input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
353 case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
354 case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
355 input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
367 imx8qxp_ldb_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
368 struct drm_bridge_state *bridge_state,
369 struct drm_crtc_state *crtc_state,
370 struct drm_connector_state *conn_state,
371 unsigned int *num_output_fmts)
373 *num_output_fmts = ARRAY_SIZE(imx8qxp_ldb_bus_output_fmts);
374 return kmemdup(imx8qxp_ldb_bus_output_fmts,
375 sizeof(imx8qxp_ldb_bus_output_fmts), GFP_KERNEL);
378 static enum drm_mode_status
379 imx8qxp_ldb_bridge_mode_valid(struct drm_bridge *bridge,
380 const struct drm_display_info *info,
381 const struct drm_display_mode *mode)
383 struct ldb_channel *ldb_ch = bridge->driver_private;
384 bool is_single = ldb_channel_is_single_link(ldb_ch);
386 if (mode->clock > 170000)
387 return MODE_CLOCK_HIGH;
389 if (mode->clock > 150000 && is_single)
390 return MODE_CLOCK_HIGH;
395 static const struct drm_bridge_funcs imx8qxp_ldb_bridge_funcs = {
396 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
397 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
398 .atomic_reset = drm_atomic_helper_bridge_reset,
399 .mode_valid = imx8qxp_ldb_bridge_mode_valid,
400 .attach = ldb_bridge_attach_helper,
401 .atomic_check = imx8qxp_ldb_bridge_atomic_check,
402 .mode_set = imx8qxp_ldb_bridge_mode_set,
403 .atomic_pre_enable = imx8qxp_ldb_bridge_atomic_pre_enable,
404 .atomic_enable = imx8qxp_ldb_bridge_atomic_enable,
405 .atomic_disable = imx8qxp_ldb_bridge_atomic_disable,
406 .atomic_get_input_bus_fmts =
407 imx8qxp_ldb_bridge_atomic_get_input_bus_fmts,
408 .atomic_get_output_bus_fmts =
409 imx8qxp_ldb_bridge_atomic_get_output_bus_fmts,
412 static int imx8qxp_ldb_set_di_id(struct imx8qxp_ldb *imx8qxp_ldb)
414 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch =
415 &imx8qxp_ldb->channel[imx8qxp_ldb->active_chno];
416 struct ldb_channel *ldb_ch = &imx8qxp_ldb_ch->base;
417 struct device_node *ep, *remote;
418 struct device *dev = imx8qxp_ldb->dev;
419 struct of_endpoint endpoint;
422 ep = of_graph_get_endpoint_by_regs(ldb_ch->np, 0, -1);
424 DRM_DEV_ERROR(dev, "failed to get port0 endpoint\n");
428 remote = of_graph_get_remote_endpoint(ep);
431 DRM_DEV_ERROR(dev, "failed to get port0 remote endpoint\n");
435 ret = of_graph_parse_endpoint(remote, &endpoint);
438 DRM_DEV_ERROR(dev, "failed to parse port0 remote endpoint: %d\n",
443 imx8qxp_ldb_ch->di_id = endpoint.id;
449 imx8qxp_ldb_check_chno_and_dual_link(struct ldb_channel *ldb_ch, int link)
451 if ((link == DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS && ldb_ch->chno != 0) ||
452 (link == DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS && ldb_ch->chno != 1))
458 static int imx8qxp_ldb_parse_dt_companion(struct imx8qxp_ldb *imx8qxp_ldb)
460 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch =
461 &imx8qxp_ldb->channel[imx8qxp_ldb->active_chno];
462 struct ldb_channel *ldb_ch = &imx8qxp_ldb_ch->base;
463 struct ldb_channel *companion_ldb_ch;
464 struct device_node *companion;
465 struct device_node *child;
466 struct device_node *companion_port = NULL;
467 struct device_node *port1, *port2;
468 struct device *dev = imx8qxp_ldb->dev;
469 const struct of_device_id *match;
474 /* Locate the companion LDB for dual-link operation, if any. */
475 companion = of_parse_phandle(dev->of_node, "fsl,companion-ldb", 0);
479 if (!of_device_is_available(companion)) {
480 DRM_DEV_ERROR(dev, "companion LDB is not available\n");
486 * Sanity check: the companion bridge must have the same compatible
489 match = of_match_device(dev->driver->of_match_table, dev);
490 if (!of_device_is_compatible(companion, match->compatible)) {
491 DRM_DEV_ERROR(dev, "companion LDB is incompatible\n");
496 for_each_available_child_of_node(companion, child) {
497 ret = of_property_read_u32(child, "reg", &i);
498 if (ret || i > MAX_LDB_CHAN_NUM - 1) {
500 "invalid channel node address: %u\n", i);
507 * Channel numbers have to be different, because channel0
508 * transmits odd pixels and channel1 transmits even pixels.
510 if (i == (ldb_ch->chno ^ 0x1)) {
511 companion_port = child;
516 if (!companion_port) {
518 "failed to find companion LDB channel port\n");
524 * We need to work out if the sink is expecting us to function in
525 * dual-link mode. We do this by looking at the DT port nodes we are
526 * connected to. If they are marked as expecting odd pixels and
527 * even pixels than we need to enable LDB split mode.
529 port1 = of_graph_get_port_by_id(ldb_ch->np, 1);
530 port2 = of_graph_get_port_by_id(companion_port, 1);
531 dual_link = drm_of_lvds_get_dual_link_pixel_order(port1, port2);
536 case DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS:
537 ldb_ch->link_type = LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS;
539 case DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS:
540 ldb_ch->link_type = LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS;
545 "failed to get dual link pixel order: %d\n", ret);
549 ret = imx8qxp_ldb_check_chno_and_dual_link(ldb_ch, dual_link);
552 "unmatched channel number(%u) vs dual link(%d)\n",
553 ldb_ch->chno, dual_link);
557 imx8qxp_ldb->companion = of_drm_find_bridge(companion_port);
558 if (!imx8qxp_ldb->companion) {
560 DRM_DEV_DEBUG_DRIVER(dev,
561 "failed to find bridge for companion bridge: %d\n",
566 DRM_DEV_DEBUG_DRIVER(dev,
567 "dual-link configuration detected (companion bridge %pOF)\n",
570 companion_ldb_ch = bridge_to_ldb_ch(imx8qxp_ldb->companion);
571 companion_ldb_ch->link_type = ldb_ch->link_type;
573 of_node_put(companion_port);
574 of_node_put(companion);
578 static int imx8qxp_ldb_probe(struct platform_device *pdev)
580 struct device *dev = &pdev->dev;
581 struct imx8qxp_ldb *imx8qxp_ldb;
582 struct imx8qxp_ldb_channel *imx8qxp_ldb_ch;
584 struct ldb_channel *ldb_ch;
587 imx8qxp_ldb = devm_kzalloc(dev, sizeof(*imx8qxp_ldb), GFP_KERNEL);
591 imx8qxp_ldb->clk_pixel = devm_clk_get(dev, "pixel");
592 if (IS_ERR(imx8qxp_ldb->clk_pixel)) {
593 ret = PTR_ERR(imx8qxp_ldb->clk_pixel);
594 if (ret != -EPROBE_DEFER)
596 "failed to get pixel clock: %d\n", ret);
600 imx8qxp_ldb->clk_bypass = devm_clk_get(dev, "bypass");
601 if (IS_ERR(imx8qxp_ldb->clk_bypass)) {
602 ret = PTR_ERR(imx8qxp_ldb->clk_bypass);
603 if (ret != -EPROBE_DEFER)
605 "failed to get bypass clock: %d\n", ret);
609 imx8qxp_ldb->dev = dev;
611 ldb = &imx8qxp_ldb->base;
613 ldb->ctrl_reg = 0xe0;
615 for (i = 0; i < MAX_LDB_CHAN_NUM; i++)
616 ldb->channel[i] = &imx8qxp_ldb->channel[i].base;
618 ret = ldb_init_helper(ldb);
622 if (ldb->available_ch_cnt == 0) {
623 DRM_DEV_DEBUG_DRIVER(dev, "no available channel\n");
625 } else if (ldb->available_ch_cnt > 1) {
626 DRM_DEV_ERROR(dev, "invalid available channel number(%u)\n",
627 ldb->available_ch_cnt);
631 for (i = 0; i < MAX_LDB_CHAN_NUM; i++) {
632 imx8qxp_ldb_ch = &imx8qxp_ldb->channel[i];
633 ldb_ch = &imx8qxp_ldb_ch->base;
635 if (ldb_ch->is_available) {
636 imx8qxp_ldb->active_chno = ldb_ch->chno;
641 imx8qxp_ldb_ch->phy = devm_of_phy_get(dev, ldb_ch->np, "lvds_phy");
642 if (IS_ERR(imx8qxp_ldb_ch->phy)) {
643 ret = PTR_ERR(imx8qxp_ldb_ch->phy);
644 if (ret != -EPROBE_DEFER)
645 DRM_DEV_ERROR(dev, "failed to get channel%d PHY: %d\n",
646 imx8qxp_ldb->active_chno, ret);
650 ret = ldb_find_next_bridge_helper(ldb);
654 ret = imx8qxp_ldb_set_di_id(imx8qxp_ldb);
658 ret = imx8qxp_ldb_parse_dt_companion(imx8qxp_ldb);
662 platform_set_drvdata(pdev, imx8qxp_ldb);
663 pm_runtime_enable(dev);
665 ldb_add_bridge_helper(ldb, &imx8qxp_ldb_bridge_funcs);
670 static void imx8qxp_ldb_remove(struct platform_device *pdev)
672 struct imx8qxp_ldb *imx8qxp_ldb = platform_get_drvdata(pdev);
673 struct ldb *ldb = &imx8qxp_ldb->base;
675 ldb_remove_bridge_helper(ldb);
677 pm_runtime_disable(&pdev->dev);
680 static int __maybe_unused imx8qxp_ldb_runtime_suspend(struct device *dev)
685 static int __maybe_unused imx8qxp_ldb_runtime_resume(struct device *dev)
687 struct imx8qxp_ldb *imx8qxp_ldb = dev_get_drvdata(dev);
688 struct ldb *ldb = &imx8qxp_ldb->base;
690 /* disable LDB by resetting the control register to POR default */
691 regmap_write(ldb->regmap, ldb->ctrl_reg, 0);
696 static const struct dev_pm_ops imx8qxp_ldb_pm_ops = {
697 SET_RUNTIME_PM_OPS(imx8qxp_ldb_runtime_suspend,
698 imx8qxp_ldb_runtime_resume, NULL)
701 static const struct of_device_id imx8qxp_ldb_dt_ids[] = {
702 { .compatible = "fsl,imx8qxp-ldb" },
705 MODULE_DEVICE_TABLE(of, imx8qxp_ldb_dt_ids);
707 static struct platform_driver imx8qxp_ldb_driver = {
708 .probe = imx8qxp_ldb_probe,
709 .remove_new = imx8qxp_ldb_remove,
711 .pm = &imx8qxp_ldb_pm_ops,
713 .of_match_table = imx8qxp_ldb_dt_ids,
716 module_platform_driver(imx8qxp_ldb_driver);
718 MODULE_DESCRIPTION("i.MX8QXP LVDS Display Bridge(LDB)/Pixel Mapper bridge driver");
720 MODULE_LICENSE("GPL v2");
721 MODULE_ALIAS("platform:" DRIVER_NAME);