From 3ea46d2f3b154880422b87ef7e27703caf987fff Mon Sep 17 00:00:00 2001 From: Shubham Talekar Date: Mon, 6 Nov 2023 12:52:40 +0530 Subject: [PATCH 1/2] disp/bridge/lt9611uxc: remove lt9611uxc_attach_dsi from probe Attach lt9611uxc bridge to DSI connector once drm connector and encoder is initialized and attached. Change-Id: I144938bc06b28a0b440b86318f45f18476182b3a Signed-off-by: Shubham Talekar --- bridge-drivers/lt9611uxc.c | 49 ++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/bridge-drivers/lt9611uxc.c b/bridge-drivers/lt9611uxc.c index 750832c648..20d020df70 100644 --- a/bridge-drivers/lt9611uxc.c +++ b/bridge-drivers/lt9611uxc.c @@ -4,6 +4,10 @@ * Copyright (c) 2019-2020. Linaro Limited. */ +/* + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. + */ + #include #include #include @@ -353,7 +357,31 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc return ret; } - return drm_connector_attach_encoder(<9611uxc->connector, bridge->encoder); + ret = drm_connector_attach_encoder(<9611uxc->connector, bridge->encoder); + if (ret) { + DRM_ERROR("Failed to link up connector to encoder: %d\n", ret); + return ret; + } + + /* Attach primary DSI */ + lt9611uxc->dsi0 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi0_node); + if (IS_ERR(lt9611uxc->dsi0)) { + ret = PTR_ERR(lt9611uxc->dsi0); + drm_bridge_remove(<9611uxc->bridge); + return ret; + } + + /* Attach secondary DSI, if specified */ + if (lt9611uxc->dsi1_node) { + lt9611uxc->dsi1 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi1_node); + if (IS_ERR(lt9611uxc->dsi1)) { + ret = PTR_ERR(lt9611uxc->dsi1); + drm_bridge_remove(<9611uxc->bridge); + return ret; + } + } + + return ret; } static int lt9611uxc_bridge_attach(struct drm_bridge *bridge, @@ -948,27 +976,8 @@ retry: drm_bridge_add(<9611uxc->bridge); - /* Attach primary DSI */ - lt9611uxc->dsi0 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi0_node); - if (IS_ERR(lt9611uxc->dsi0)) { - ret = PTR_ERR(lt9611uxc->dsi0); - goto err_remove_bridge; - } - - /* Attach secondary DSI, if specified */ - if (lt9611uxc->dsi1_node) { - lt9611uxc->dsi1 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi1_node); - if (IS_ERR(lt9611uxc->dsi1)) { - ret = PTR_ERR(lt9611uxc->dsi1); - goto err_remove_bridge; - } - } - return lt9611uxc_audio_init(dev, lt9611uxc); -err_remove_bridge: - drm_bridge_remove(<9611uxc->bridge); - err_disable_regulators: regulator_bulk_disable(ARRAY_SIZE(lt9611uxc->supplies), lt9611uxc->supplies); From de1e6dfd5899298cc08a2826fad50a27a8b55d1e Mon Sep 17 00:00:00 2001 From: Shubham Talekar Date: Tue, 21 Nov 2023 15:56:40 +0530 Subject: [PATCH 2/2] disp/bridge/lt9611uxc: update bridge_attach and compatible string Update lt9611uxc bridge attach function for external bridge to create drm connector. Update compatible string to avoid conflict with upstream lt9611uxc driver. Change-Id: I5933b14ac724cc1417f89f000046ba3c3afbcf5c Signed-off-by: Shubham Talekar --- bridge-drivers/lt9611uxc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bridge-drivers/lt9611uxc.c b/bridge-drivers/lt9611uxc.c index 20d020df70..03c0067968 100644 --- a/bridge-drivers/lt9611uxc.c +++ b/bridge-drivers/lt9611uxc.c @@ -390,11 +390,9 @@ static int lt9611uxc_bridge_attach(struct drm_bridge *bridge, struct lt9611uxc *lt9611uxc = bridge_to_lt9611uxc(bridge); int ret; - if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { - ret = lt9611uxc_connector_init(bridge, lt9611uxc); - if (ret < 0) - return ret; - } + ret = lt9611uxc_connector_init(bridge, lt9611uxc); + if (ret < 0) + return ret; return 0; } @@ -1006,12 +1004,12 @@ static void lt9611uxc_remove(struct i2c_client *client) } static struct i2c_device_id lt9611uxc_id[] = { - { "lontium,lt9611uxc", 0 }, + { "lt,lt9611uxc", 0 }, { /* sentinel */ } }; static const struct of_device_id lt9611uxc_match_table[] = { - { .compatible = "lontium,lt9611uxc" }, + { .compatible = "lt,lt9611uxc" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, lt9611uxc_match_table);