Skip to content

Commit b2f3418

Browse files
committed
drm/imx: ldb: drop custom DDC bus support
None of the boards ever supported by the upstream kernel used the custom DDC bus support with the LDB connector. If a need arises to do so, one should use panel-simple and its DDC bus code. Drop ddc-i2c-bus support from the imx-ldb driver. Reviewed-by: Philipp Zabel <[email protected]> Tested-by: Chris Healy <[email protected]> Tested-by: Philipp Zabel <[email protected]> # on imx6q-nitrogen6x Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent aed7b50 commit b2f3418

File tree

1 file changed

+10
-63
lines changed

1 file changed

+10
-63
lines changed

drivers/gpu/drm/imx/ipuv3/imx-ldb.c

Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <drm/drm_atomic.h>
2626
#include <drm/drm_atomic_helper.h>
2727
#include <drm/drm_bridge.h>
28-
#include <drm/drm_edid.h>
2928
#include <drm/drm_managed.h>
3029
#include <drm/drm_of.h>
3130
#include <drm/drm_panel.h>
@@ -70,7 +69,6 @@ struct imx_ldb_channel {
7069
struct drm_bridge *bridge;
7170

7271
struct device_node *child;
73-
struct i2c_adapter *ddc;
7472
int chno;
7573
struct drm_display_mode mode;
7674
int mode_valid;
@@ -141,18 +139,6 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)
141139
if (num_modes > 0)
142140
return num_modes;
143141

144-
if (imx_ldb_ch->ddc) {
145-
const struct drm_edid *edid = drm_edid_read_ddc(connector,
146-
imx_ldb_ch->ddc);
147-
148-
if (edid) {
149-
drm_edid_connector_update(connector, edid);
150-
drm_edid_free(edid);
151-
152-
return drm_edid_connector_add_modes(connector);
153-
}
154-
}
155-
156142
if (imx_ldb_ch->mode_valid) {
157143
struct drm_display_mode *mode;
158144

@@ -481,10 +467,9 @@ static int imx_ldb_register(struct drm_device *drm,
481467
*/
482468
drm_connector_helper_add(connector,
483469
&imx_ldb_connector_helper_funcs);
484-
drm_connector_init_with_ddc(drm, connector,
485-
&imx_ldb_connector_funcs,
486-
DRM_MODE_CONNECTOR_LVDS,
487-
imx_ldb_ch->ddc);
470+
drm_connector_init(drm, connector,
471+
&imx_ldb_connector_funcs,
472+
DRM_MODE_CONNECTOR_LVDS);
488473
drm_connector_attach_encoder(connector, encoder);
489474
}
490475

@@ -551,39 +536,6 @@ static const struct of_device_id imx_ldb_dt_ids[] = {
551536
};
552537
MODULE_DEVICE_TABLE(of, imx_ldb_dt_ids);
553538

554-
static int imx_ldb_panel_ddc(struct device *dev,
555-
struct imx_ldb_channel *channel, struct device_node *child)
556-
{
557-
struct device_node *ddc_node;
558-
int ret;
559-
560-
ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0);
561-
if (ddc_node) {
562-
channel->ddc = of_find_i2c_adapter_by_node(ddc_node);
563-
of_node_put(ddc_node);
564-
if (!channel->ddc) {
565-
dev_warn(dev, "failed to get ddc i2c adapter\n");
566-
return -EPROBE_DEFER;
567-
}
568-
}
569-
570-
if (!channel->ddc) {
571-
/* if no DDC available, fallback to hardcoded EDID */
572-
dev_dbg(dev, "no ddc available\n");
573-
574-
if (!channel->panel) {
575-
/* fallback to display-timings node */
576-
ret = of_get_drm_display_mode(child,
577-
&channel->mode,
578-
&channel->bus_flags,
579-
OF_USE_NATIVE_MODE);
580-
if (!ret)
581-
channel->mode_valid = 1;
582-
}
583-
}
584-
return 0;
585-
}
586-
587539
static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
588540
{
589541
struct drm_device *drm = data;
@@ -694,11 +646,15 @@ static int imx_ldb_probe(struct platform_device *pdev)
694646
if (ret && ret != -ENODEV)
695647
goto free_child;
696648

697-
/* panel ddc only if there is no bridge */
698-
if (!channel->bridge) {
699-
ret = imx_ldb_panel_ddc(dev, channel, child);
649+
if (!channel->bridge && !channel->panel) {
650+
ret = of_get_drm_display_mode(child,
651+
&channel->mode,
652+
&channel->bus_flags,
653+
OF_USE_NATIVE_MODE);
700654
if (ret)
701655
goto free_child;
656+
657+
channel->mode_valid = 1;
702658
}
703659

704660
bus_format = of_get_bus_format(dev, child);
@@ -732,15 +688,6 @@ static int imx_ldb_probe(struct platform_device *pdev)
732688

733689
static void imx_ldb_remove(struct platform_device *pdev)
734690
{
735-
struct imx_ldb *imx_ldb = platform_get_drvdata(pdev);
736-
int i;
737-
738-
for (i = 0; i < 2; i++) {
739-
struct imx_ldb_channel *channel = &imx_ldb->channel[i];
740-
741-
i2c_put_adapter(channel->ddc);
742-
}
743-
744691
component_del(&pdev->dev, &imx_ldb_ops);
745692
}
746693

0 commit comments

Comments
 (0)