mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
drm/bridge: ssd2825: don't create a panel_bridge
Now a panel_bridge is automatically created for every drm_panel and the panel-bridge API is just a deprecated wrapper to access it. Update and simplify the code by just getting a reference to the already-existing bridge using of_drm_get_bridge_by_endpoint(). As of_drm_get_bridge_by_endpoint() returns a refcounted bridge, take care of putting the bridge reference when not used anymore. Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260916-drm-bridge-every-panel-v3-16-83afb4f1a707@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
parent
643e89ea52
commit
554d36acf5
|
|
@ -349,8 +349,6 @@ config DRM_SOLOMON_SSD2825
|
|||
depends on SPI_MASTER && OF
|
||||
select DRM_MIPI_DSI
|
||||
select DRM_KMS_HELPER
|
||||
select DRM_PANEL
|
||||
select DRM_PANEL_BRIDGE
|
||||
help
|
||||
Say Y here if you want support for the Solomon SSD2825 RGB/DSI
|
||||
SPI bridge driver.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <video/mipi_display.h>
|
||||
|
||||
#define SSD2825_DEVICE_ID_REG 0xb0
|
||||
|
|
@ -114,7 +113,6 @@ static const struct regulator_bulk_data ssd2825_supplies[] = {
|
|||
|
||||
struct ssd2825_dsi_output {
|
||||
struct mipi_dsi_device *dev;
|
||||
struct drm_panel *panel;
|
||||
struct drm_bridge *bridge;
|
||||
};
|
||||
|
||||
|
|
@ -277,7 +275,6 @@ static int ssd2825_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_d
|
|||
{
|
||||
struct ssd2825_priv *priv = dsi_host_to_ssd2825(host);
|
||||
struct drm_bridge *bridge;
|
||||
struct drm_panel *panel;
|
||||
struct device_node *ep;
|
||||
int ret;
|
||||
|
||||
|
|
@ -295,20 +292,14 @@ static int ssd2825_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_d
|
|||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
ret = drm_of_find_panel_or_bridge(host->dev->of_node, 1, 0, &panel, &bridge);
|
||||
if (ret)
|
||||
return ret;
|
||||
bridge = of_drm_get_bridge_by_endpoint(host->dev->of_node, 1, 0);
|
||||
if (IS_ERR(bridge))
|
||||
return PTR_ERR(bridge);
|
||||
|
||||
if (panel) {
|
||||
bridge = drm_panel_bridge_add_typed(panel, DRM_MODE_CONNECTOR_DSI);
|
||||
drm_panel_put(panel);
|
||||
if (IS_ERR(bridge))
|
||||
return PTR_ERR(bridge);
|
||||
}
|
||||
bridge->type = DRM_MODE_CONNECTOR_DSI;
|
||||
|
||||
priv->output.dev = dev;
|
||||
priv->output.bridge = bridge;
|
||||
priv->output.panel = panel;
|
||||
|
||||
priv->dsi_lanes = dev->lanes;
|
||||
|
||||
|
|
@ -333,8 +324,7 @@ static int ssd2825_dsi_host_detach(struct mipi_dsi_host *host, struct mipi_dsi_d
|
|||
struct ssd2825_priv *priv = dsi_host_to_ssd2825(host);
|
||||
|
||||
drm_bridge_remove(&priv->bridge);
|
||||
if (priv->output.panel)
|
||||
drm_panel_bridge_remove(priv->output.bridge);
|
||||
drm_bridge_put(priv->output.bridge);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -579,9 +569,6 @@ static void ssd2825_bridge_atomic_pre_enable(struct drm_bridge *bridge,
|
|||
/* Initial DSI configuration register set */
|
||||
ssd2825_write_reg(priv, SSD2825_CONFIGURATION_REG, config);
|
||||
ssd2825_write_reg(priv, SSD2825_VC_CTRL_REG, 0);
|
||||
|
||||
if (priv->output.panel)
|
||||
drm_panel_enable(priv->output.panel);
|
||||
}
|
||||
|
||||
static void ssd2825_bridge_atomic_enable(struct drm_bridge *bridge,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user