@@ -863,7 +863,7 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge)
adv->connector.polled = DRM_CONNECTOR_POLL_CONNECT |
DRM_CONNECTOR_POLL_DISCONNECT;
- ret = drm_connector_init(bridge->dev, &adv->connector,
+ ret = drm_connector_init(bridge->encoder->dev, &adv->connector,
&adv7511_connector_funcs,
DRM_MODE_CONNECTOR_HDMIA);
if (ret) {
@@ -541,7 +541,7 @@ static int anx6345_bridge_attach(struct drm_bridge *bridge)
return err;
}
- err = drm_connector_init(bridge->dev, &anx6345->connector,
+ err = drm_connector_init(bridge->encoder->dev, &anx6345->connector,
&anx6345_connector_funcs,
DRM_MODE_CONNECTOR_eDP);
if (err) {
@@ -908,7 +908,7 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge)
return err;
}
- err = drm_connector_init(bridge->dev, &anx78xx->connector,
+ err = drm_connector_init(bridge->encoder->dev, &anx78xx->connector,
&anx78xx_connector_funcs,
DRM_MODE_CONNECTOR_DisplayPort);
if (err) {
@@ -651,7 +651,7 @@ static int cdns_dsi_bridge_attach(struct drm_bridge *bridge)
struct cdns_dsi *dsi = input_to_dsi(input);
struct cdns_dsi_output *output = &dsi->output;
- if (!drm_core_check_feature(bridge->dev, DRIVER_ATOMIC)) {
+ if (!drm_core_check_feature(bridge->encoder->dev, DRIVER_ATOMIC)) {
dev_err(dsi->base.dev,
"cdns-dsi driver is only compatible with DRM devices supporting atomic updates");
return -ENOTSUPP;
@@ -112,7 +112,7 @@ static int dumb_vga_attach(struct drm_bridge *bridge)
drm_connector_helper_add(&vga->connector,
&dumb_vga_con_helper_funcs);
- ret = drm_connector_init_with_ddc(bridge->dev, &vga->connector,
+ ret = drm_connector_init_with_ddc(bridge->encoder->dev, &vga->connector,
&dumb_vga_con_funcs,
DRM_MODE_CONNECTOR_VGA,
vga->ddc);
@@ -223,7 +223,7 @@ static int ge_b850v3_lvds_attach(struct drm_bridge *bridge)
drm_connector_helper_add(connector,
&ge_b850v3_lvds_connector_helper_funcs);
- ret = drm_connector_init(bridge->dev, connector,
+ ret = drm_connector_init(bridge->encoder->dev, connector,
&ge_b850v3_lvds_connector_funcs,
DRM_MODE_CONNECTOR_DisplayPort);
if (ret) {
@@ -247,7 +247,7 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge)
}
ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD;
- ret = drm_connector_init(bridge->dev, &ptn_bridge->connector,
+ ret = drm_connector_init(bridge->encoder->dev, &ptn_bridge->connector,
&ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
if (ret) {
DRM_ERROR("Failed to initialize connector with drm\n");
@@ -67,7 +67,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge)
drm_connector_helper_add(connector,
&panel_bridge_connector_helper_funcs);
- ret = drm_connector_init(bridge->dev, connector,
+ ret = drm_connector_init(bridge->encoder->dev, connector,
&panel_bridge_connector_funcs,
panel_bridge->connector_type);
if (ret) {
@@ -487,7 +487,7 @@ static int ps8622_attach(struct drm_bridge *bridge)
}
ps8622->connector.polled = DRM_CONNECTOR_POLL_HPD;
- ret = drm_connector_init(bridge->dev, &ps8622->connector,
+ ret = drm_connector_init(bridge->encoder->dev, &ps8622->connector,
&ps8622_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
if (ret) {
DRM_ERROR("Failed to initialize connector with drm\n");
@@ -402,7 +402,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
static int sii902x_bridge_attach(struct drm_bridge *bridge)
{
struct sii902x *sii902x = bridge_to_sii902x(bridge);
- struct drm_device *drm = bridge->dev;
+ struct drm_device *drm = bridge->encoder->dev;
int ret;
drm_connector_helper_add(&sii902x->connector,
@@ -820,8 +820,8 @@ static irqreturn_t sii902x_interrupt(int irq, void *data)
mutex_unlock(&sii902x->mutex);
- if ((status & SII902X_HOTPLUG_EVENT) && sii902x->bridge.dev)
- drm_helper_hpd_irq_event(sii902x->bridge.dev);
+ if ((status & SII902X_HOTPLUG_EVENT) && sii902x->bridge.encoder)
+ drm_helper_hpd_irq_event(sii902x->bridge.encoder->dev);
return IRQ_HANDLED;
}
@@ -2346,7 +2346,7 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
drm_connector_helper_add(connector, &dw_hdmi_connector_helper_funcs);
- drm_connector_init_with_ddc(bridge->dev, connector,
+ drm_connector_init_with_ddc(bridge->encoder->dev, connector,
&dw_hdmi_connector_funcs,
DRM_MODE_CONNECTOR_HDMIA,
hdmi->ddc);
@@ -2554,8 +2554,8 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
if (intr_stat & HDMI_IH_PHY_STAT0_HPD) {
dev_dbg(hdmi->dev, "EVENT=%s\n",
phy_int_pol & HDMI_PHY_HPD ? "plugin" : "plugout");
- if (hdmi->bridge.dev)
- drm_helper_hpd_irq_event(hdmi->bridge.dev);
+ if (hdmi->bridge.encoder)
+ drm_helper_hpd_irq_event(hdmi->bridge.encoder->dev);
}
hdmi_writeb(hdmi, intr_stat, HDMI_IH_PHY_STAT0);
@@ -352,7 +352,7 @@ static void tc358764_enable(struct drm_bridge *bridge)
static int tc358764_attach(struct drm_bridge *bridge)
{
struct tc358764 *ctx = bridge_to_tc358764(bridge);
- struct drm_device *drm = bridge->dev;
+ struct drm_device *drm = bridge->encoder->dev;
int ret;
ctx->connector.polled = DRM_CONNECTOR_POLL_HPD;
@@ -378,7 +378,7 @@ static int tc358764_attach(struct drm_bridge *bridge)
static void tc358764_detach(struct drm_bridge *bridge)
{
struct tc358764 *ctx = bridge_to_tc358764(bridge);
- struct drm_device *drm = bridge->dev;
+ struct drm_device *drm = bridge->encoder->dev;
drm_connector_unregister(&ctx->connector);
drm_fb_helper_remove_one_connector(drm->fb_helper, &ctx->connector);
@@ -1407,7 +1407,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge)
{
u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
struct tc_data *tc = bridge_to_tc(bridge);
- struct drm_device *drm = bridge->dev;
+ struct drm_device *drm = bridge->encoder->dev;
int ret;
/* Create DP/eDP connector */
@@ -1514,7 +1514,7 @@ static irqreturn_t tc_irq_handler(int irq, void *arg)
dev_err(tc->dev, "syserr %x\n", stat);
}
- if (tc->hpd_pin >= 0 && tc->bridge.dev) {
+ if (tc->hpd_pin >= 0 && tc->bridge.encoder) {
/*
* H is triggered when the GPIO goes high.
*
@@ -1528,7 +1528,7 @@ static irqreturn_t tc_irq_handler(int irq, void *arg)
h ? "H" : "", lc ? "LC" : "");
if (h || lc)
- drm_kms_helper_hotplug_event(tc->bridge.dev);
+ drm_kms_helper_hotplug_event(tc->bridge.encoder->dev);
}
regmap_write(tc->regmap, INTSTS_G, val);
@@ -275,7 +275,7 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge)
.node = NULL,
};
- ret = drm_connector_init(bridge->dev, &pdata->connector,
+ ret = drm_connector_init(bridge->encoder->dev, &pdata->connector,
&ti_sn_bridge_connector_funcs,
DRM_MODE_CONNECTOR_eDP);
if (ret) {
@@ -135,7 +135,7 @@ static int tfp410_attach(struct drm_bridge *bridge)
drm_connector_helper_add(&dvi->connector,
&tfp410_con_helper_funcs);
- ret = drm_connector_init_with_ddc(bridge->dev, &dvi->connector,
+ ret = drm_connector_init_with_ddc(bridge->encoder->dev, &dvi->connector,
&tfp410_con_funcs,
dvi->connector_type,
dvi->ddc);
@@ -179,8 +179,8 @@ static void tfp410_hpd_work_func(struct work_struct *work)
dvi = container_of(work, struct tfp410, hpd_work.work);
- if (dvi->bridge.dev)
- drm_helper_hpd_irq_event(dvi->bridge.dev);
+ if (dvi->bridge.encoder)
+ drm_helper_hpd_irq_event(dvi->bridge.encoder->dev);
}
static irqreturn_t tfp410_hpd_irq_thread(int irq, void *arg)
@@ -119,13 +119,12 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
if (!encoder || !bridge)
return -EINVAL;
- if (previous && (!previous->dev || previous->encoder != encoder))
+ if (previous && previous->encoder != encoder)
return -EINVAL;
- if (bridge->dev)
+ if (bridge->encoder)
return -EBUSY;
- bridge->dev = encoder->dev;
bridge->encoder = encoder;
if (previous)
@@ -137,7 +136,6 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
ret = bridge->funcs->attach(bridge);
if (ret < 0) {
list_del(&bridge->chain_node);
- bridge->dev = NULL;
bridge->encoder = NULL;
return ret;
}
@@ -152,14 +150,14 @@ void drm_bridge_detach(struct drm_bridge *bridge)
if (WARN_ON(!bridge))
return;
- if (WARN_ON(!bridge->dev))
+ if (WARN_ON(!bridge->encoder))
return;
if (bridge->funcs->detach)
bridge->funcs->detach(bridge);
list_del(&bridge->chain_node);
- bridge->dev = NULL;
+ bridge->encoder = NULL;
}
/**
@@ -1360,7 +1360,7 @@ static int tda998x_bridge_attach(struct drm_bridge *bridge)
{
struct tda998x_priv *priv = bridge_to_tda998x_priv(bridge);
- return tda998x_connector_init(priv, bridge->dev);
+ return tda998x_connector_init(priv, bridge->encoder->dev);
}
static void tda998x_bridge_detach(struct drm_bridge *bridge)
@@ -846,7 +846,7 @@ static void mcde_dsi_bridge_disable(struct drm_bridge *bridge)
static int mcde_dsi_bridge_attach(struct drm_bridge *bridge)
{
struct mcde_dsi *d = bridge_to_mcde_dsi(bridge);
- struct drm_device *drm = bridge->dev;
+ struct drm_device *drm = bridge->encoder->dev;
int ret;
if (!drm_core_check_feature(drm, DRIVER_ATOMIC)) {
@@ -47,7 +47,7 @@ static void edp_bridge_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
const struct drm_display_mode *adjusted_mode)
{
- struct drm_device *dev = bridge->dev;
+ struct drm_device *dev = bridge->encoder->dev;
struct drm_connector *connector;
struct edp_bridge *edp_bridge = to_edp_bridge(bridge);
struct msm_edp *edp = edp_bridge->edp;
@@ -20,7 +20,7 @@ void msm_hdmi_bridge_destroy(struct drm_bridge *bridge)
static void msm_hdmi_power_on(struct drm_bridge *bridge)
{
- struct drm_device *dev = bridge->dev;
+ struct drm_device *dev = bridge->encoder->dev;
struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
struct hdmi *hdmi = hdmi_bridge->hdmi;
const struct hdmi_platform_config *config = hdmi->config;
@@ -56,7 +56,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge)
static void power_off(struct drm_bridge *bridge)
{
- struct drm_device *dev = bridge->dev;
+ struct drm_device *dev = bridge->encoder->dev;
struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
struct hdmi *hdmi = hdmi_bridge->hdmi;
const struct hdmi_platform_config *config = hdmi->config;
@@ -622,7 +622,8 @@ static int rcar_lvds_attach(struct drm_bridge *bridge)
if (!lvds->panel)
return 0;
- ret = drm_connector_init(bridge->dev, connector, &rcar_lvds_conn_funcs,
+ ret = drm_connector_init(bridge->encoder->dev, connector,
+ &rcar_lvds_conn_funcs,
DRM_MODE_CONNECTOR_LVDS);
if (ret < 0)
return ret;
@@ -380,8 +380,6 @@ struct drm_bridge_timings {
* struct drm_bridge - central DRM bridge control structure
*/
struct drm_bridge {
- /** @dev: DRM device this bridge belongs to */
- struct drm_device *dev;
/** @encoder: encoder to which this bridge is connected */
struct drm_encoder *encoder;
/** @chain_node: used to form a bridge chain */