diff options
author | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-01-11 18:32:10 +0300 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-01-11 18:32:10 +0300 |
commit | 23d19ba06b9c5614d6457f5fed349ec8f6d4dac9 (patch) | |
tree | 39f0b657e5b1b5b958780cae4ae6360f69548d50 /drivers/gpu/drm/msm/hdmi | |
parent | 7d0250ed8e69fb6a66caecf60b8753a21224cc1a (diff) | |
parent | e3d093070eb0b5e3df668d3eb04100ea79343c65 (diff) | |
download | linux-23d19ba06b9c5614d6457f5fed349ec8f6d4dac9.tar.xz |
Merge drm/drm-next into drm-misc-next
drm-next has been forwarded to 5.0-rc1, and we need it to apply the damage
helper for dirtyfb series from Noralf Trønnes.
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi')
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi.c | 40 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_i2c.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_phy.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c | 4 |
8 files changed, 48 insertions, 47 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 23670907a29d..e247d6942a49 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -98,7 +98,7 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi) phy_node = of_parse_phandle(pdev->dev.of_node, "phys", 0); if (!phy_node) { - dev_err(&pdev->dev, "cannot find phy device\n"); + DRM_DEV_ERROR(&pdev->dev, "cannot find phy device\n"); return -ENXIO; } @@ -109,7 +109,7 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi) of_node_put(phy_node); if (!phy_pdev || !hdmi->phy) { - dev_err(&pdev->dev, "phy driver is not ready\n"); + DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n"); return -EPROBE_DEFER; } @@ -153,7 +153,7 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) hdmi->qfprom_mmio = msm_ioremap(pdev, config->qfprom_mmio_name, "HDMI_QFPROM"); if (IS_ERR(hdmi->qfprom_mmio)) { - dev_info(&pdev->dev, "can't find qfprom resource\n"); + DRM_DEV_INFO(&pdev->dev, "can't find qfprom resource\n"); hdmi->qfprom_mmio = NULL; } @@ -172,7 +172,7 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) config->hpd_reg_names[i]); if (IS_ERR(reg)) { ret = PTR_ERR(reg); - dev_err(&pdev->dev, "failed to get hpd regulator: %s (%d)\n", + DRM_DEV_ERROR(&pdev->dev, "failed to get hpd regulator: %s (%d)\n", config->hpd_reg_names[i], ret); goto fail; } @@ -195,7 +195,7 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) config->pwr_reg_names[i]); if (IS_ERR(reg)) { ret = PTR_ERR(reg); - dev_err(&pdev->dev, "failed to get pwr regulator: %s (%d)\n", + DRM_DEV_ERROR(&pdev->dev, "failed to get pwr regulator: %s (%d)\n", config->pwr_reg_names[i], ret); goto fail; } @@ -217,7 +217,7 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) clk = msm_clk_get(pdev, config->hpd_clk_names[i]); if (IS_ERR(clk)) { ret = PTR_ERR(clk); - dev_err(&pdev->dev, "failed to get hpd clk: %s (%d)\n", + DRM_DEV_ERROR(&pdev->dev, "failed to get hpd clk: %s (%d)\n", config->hpd_clk_names[i], ret); goto fail; } @@ -239,7 +239,7 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) clk = msm_clk_get(pdev, config->pwr_clk_names[i]); if (IS_ERR(clk)) { ret = PTR_ERR(clk); - dev_err(&pdev->dev, "failed to get pwr clk: %s (%d)\n", + DRM_DEV_ERROR(&pdev->dev, "failed to get pwr clk: %s (%d)\n", config->pwr_clk_names[i], ret); goto fail; } @@ -254,14 +254,14 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev) hdmi->i2c = msm_hdmi_i2c_init(hdmi); if (IS_ERR(hdmi->i2c)) { ret = PTR_ERR(hdmi->i2c); - dev_err(&pdev->dev, "failed to get i2c: %d\n", ret); + DRM_DEV_ERROR(&pdev->dev, "failed to get i2c: %d\n", ret); hdmi->i2c = NULL; goto fail; } ret = msm_hdmi_get_phy(hdmi); if (ret) { - dev_err(&pdev->dev, "failed to get phy\n"); + DRM_DEV_ERROR(&pdev->dev, "failed to get phy\n"); goto fail; } @@ -303,7 +303,7 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, hdmi->bridge = msm_hdmi_bridge_init(hdmi); if (IS_ERR(hdmi->bridge)) { ret = PTR_ERR(hdmi->bridge); - dev_err(dev->dev, "failed to create HDMI bridge: %d\n", ret); + DRM_DEV_ERROR(dev->dev, "failed to create HDMI bridge: %d\n", ret); hdmi->bridge = NULL; goto fail; } @@ -311,7 +311,7 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, hdmi->connector = msm_hdmi_connector_init(hdmi); if (IS_ERR(hdmi->connector)) { ret = PTR_ERR(hdmi->connector); - dev_err(dev->dev, "failed to create HDMI connector: %d\n", ret); + DRM_DEV_ERROR(dev->dev, "failed to create HDMI connector: %d\n", ret); hdmi->connector = NULL; goto fail; } @@ -319,7 +319,7 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, hdmi->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); if (hdmi->irq < 0) { ret = hdmi->irq; - dev_err(dev->dev, "failed to get irq: %d\n", ret); + DRM_DEV_ERROR(dev->dev, "failed to get irq: %d\n", ret); goto fail; } @@ -327,11 +327,17 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, msm_hdmi_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "hdmi_isr", hdmi); if (ret < 0) { - dev_err(dev->dev, "failed to request IRQ%u: %d\n", + DRM_DEV_ERROR(dev->dev, "failed to request IRQ%u: %d\n", hdmi->irq, ret); goto fail; } + ret = msm_hdmi_hpd_enable(hdmi->connector); + if (ret < 0) { + DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret); + goto fail; + } + encoder->bridge = hdmi->bridge; priv->bridges[priv->num_bridges++] = hdmi->bridge; @@ -476,7 +482,7 @@ static int msm_hdmi_audio_hw_params(struct device *dev, void *data, unsigned int level_shift = 0; /* 0dB */ bool down_mix = false; - dev_dbg(dev, "%u Hz, %d bit, %d channels\n", params->sample_rate, + DRM_DEV_DEBUG(dev, "%u Hz, %d bit, %d channels\n", params->sample_rate, params->sample_width, params->cea.channels); switch (params->cea.channels) { @@ -527,7 +533,7 @@ static int msm_hdmi_audio_hw_params(struct device *dev, void *data, rate = HDMI_SAMPLE_RATE_192KHZ; break; default: - dev_err(dev, "rate[%d] not supported!\n", + DRM_DEV_ERROR(dev, "rate[%d] not supported!\n", params->sample_rate); return -EINVAL; } @@ -571,7 +577,7 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) { struct drm_device *drm = dev_get_drvdata(master); struct msm_drm_private *priv = drm->dev_private; - static struct hdmi_platform_config *hdmi_cfg; + struct hdmi_platform_config *hdmi_cfg; struct hdmi *hdmi; struct device_node *of_node = dev->of_node; int i, err; @@ -579,7 +585,7 @@ static int msm_hdmi_bind(struct device *dev, struct device *master, void *data) hdmi_cfg = (struct hdmi_platform_config *) of_device_get_match_data(dev); if (!hdmi_cfg) { - dev_err(dev, "unknown hdmi_cfg: %pOFn\n", of_node); + DRM_DEV_ERROR(dev, "unknown hdmi_cfg: %pOFn\n", of_node); return -ENXIO; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index accc9a61611d..5c5df6ab2a57 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -245,6 +245,7 @@ void msm_hdmi_bridge_destroy(struct drm_bridge *bridge); void msm_hdmi_connector_irq(struct drm_connector *connector); struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi); +int msm_hdmi_hpd_enable(struct drm_connector *connector); /* * i2c adapter for ddc: diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 5ed4cab2819f..7ba6f52ed72c 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -40,7 +40,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) for (i = 0; i < config->pwr_reg_cnt; i++) { ret = regulator_enable(hdmi->pwr_regs[i]); if (ret) { - dev_err(dev->dev, "failed to enable pwr regulator: %s (%d)\n", + DRM_DEV_ERROR(dev->dev, "failed to enable pwr regulator: %s (%d)\n", config->pwr_reg_names[i], ret); } } @@ -49,7 +49,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) DBG("pixclock: %lu", hdmi->pixclock); ret = clk_set_rate(hdmi->pwr_clks[0], hdmi->pixclock); if (ret) { - dev_err(dev->dev, "failed to set pixel clk: %s (%d)\n", + DRM_DEV_ERROR(dev->dev, "failed to set pixel clk: %s (%d)\n", config->pwr_clk_names[0], ret); } } @@ -57,7 +57,7 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) for (i = 0; i < config->pwr_clk_cnt; i++) { ret = clk_prepare_enable(hdmi->pwr_clks[i]); if (ret) { - dev_err(dev->dev, "failed to enable pwr clk: %s (%d)\n", + DRM_DEV_ERROR(dev->dev, "failed to enable pwr clk: %s (%d)\n", config->pwr_clk_names[i], ret); } } @@ -82,7 +82,7 @@ static void power_off(struct drm_bridge *bridge) for (i = 0; i < config->pwr_reg_cnt; i++) { ret = regulator_disable(hdmi->pwr_regs[i]); if (ret) { - dev_err(dev->dev, "failed to disable pwr regulator: %s (%d)\n", + DRM_DEV_ERROR(dev->dev, "failed to disable pwr regulator: %s (%d)\n", config->pwr_reg_names[i], ret); } } @@ -106,7 +106,7 @@ static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi) len = hdmi_infoframe_pack(&frame, buffer, sizeof(buffer)); if (len < 0) { - dev_err(&hdmi->pdev->dev, + DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to configure avi infoframe\n"); return; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index e9c9a0af508e..a6eeab2c4dc3 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c @@ -90,7 +90,7 @@ static int gpio_config(struct hdmi *hdmi, bool on) if (gpio.num != -1) { ret = gpio_request(gpio.num, gpio.label); if (ret) { - dev_err(dev, + DRM_DEV_ERROR(dev, "'%s'(%d) gpio_request failed: %d\n", gpio.label, gpio.num, ret); goto err; @@ -156,7 +156,7 @@ static void enable_hpd_clocks(struct hdmi *hdmi, bool enable) ret = clk_prepare_enable(hdmi->hpd_clks[i]); if (ret) { - dev_err(dev, + DRM_DEV_ERROR(dev, "failed to enable hpd clk: %s (%d)\n", config->hpd_clk_names[i], ret); } @@ -167,8 +167,9 @@ static void enable_hpd_clocks(struct hdmi *hdmi, bool enable) } } -static int hpd_enable(struct hdmi_connector *hdmi_connector) +int msm_hdmi_hpd_enable(struct drm_connector *connector) { + struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector); struct hdmi *hdmi = hdmi_connector->hdmi; const struct hdmi_platform_config *config = hdmi->config; struct device *dev = &hdmi->pdev->dev; @@ -179,7 +180,7 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector) for (i = 0; i < config->hpd_reg_cnt; i++) { ret = regulator_enable(hdmi->hpd_regs[i]); if (ret) { - dev_err(dev, "failed to enable hpd regulator: %s (%d)\n", + DRM_DEV_ERROR(dev, "failed to enable hpd regulator: %s (%d)\n", config->hpd_reg_names[i], ret); goto fail; } @@ -187,13 +188,13 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector) ret = pinctrl_pm_select_default_state(dev); if (ret) { - dev_err(dev, "pinctrl state chg failed: %d\n", ret); + DRM_DEV_ERROR(dev, "pinctrl state chg failed: %d\n", ret); goto fail; } ret = gpio_config(hdmi, true); if (ret) { - dev_err(dev, "failed to configure GPIOs: %d\n", ret); + DRM_DEV_ERROR(dev, "failed to configure GPIOs: %d\n", ret); goto fail; } @@ -450,7 +451,6 @@ struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) { struct drm_connector *connector = NULL; struct hdmi_connector *hdmi_connector; - int ret; hdmi_connector = kzalloc(sizeof(*hdmi_connector), GFP_KERNEL); if (!hdmi_connector) @@ -471,12 +471,6 @@ struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) connector->interlace_allowed = 0; connector->doublescan_allowed = 0; - ret = hpd_enable(hdmi_connector); - if (ret) { - dev_err(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret); - return ERR_PTR(ret); - } - drm_connector_attach_encoder(connector, hdmi->encoder); return connector; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c index 73e20219d431..25d2fe2c60e8 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_i2c.c @@ -66,7 +66,7 @@ static int ddc_clear_irq(struct hdmi_i2c_adapter *hdmi_i2c) } while ((ddc_int_ctrl & HDMI_DDC_INT_CTRL_SW_DONE_INT) && retry); if (!retry) { - dev_err(dev->dev, "timeout waiting for DDC\n"); + DRM_DEV_ERROR(dev->dev, "timeout waiting for DDC\n"); return -ETIMEDOUT; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c index 4157722d6b4d..1f4331ed69bd 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c @@ -37,7 +37,7 @@ static int msm_hdmi_phy_resource_init(struct hdmi_phy *phy) reg = devm_regulator_get(dev, cfg->reg_names[i]); if (IS_ERR(reg)) { ret = PTR_ERR(reg); - dev_err(dev, "failed to get phy regulator: %s (%d)\n", + DRM_DEV_ERROR(dev, "failed to get phy regulator: %s (%d)\n", cfg->reg_names[i], ret); return ret; } @@ -51,7 +51,7 @@ static int msm_hdmi_phy_resource_init(struct hdmi_phy *phy) clk = msm_clk_get(phy->pdev, cfg->clk_names[i]); if (IS_ERR(clk)) { ret = PTR_ERR(clk); - dev_err(dev, "failed to get phy clock: %s (%d)\n", + DRM_DEV_ERROR(dev, "failed to get phy clock: %s (%d)\n", cfg->clk_names[i], ret); return ret; } @@ -73,14 +73,14 @@ int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy) for (i = 0; i < cfg->num_regs; i++) { ret = regulator_enable(phy->regs[i]); if (ret) - dev_err(dev, "failed to enable regulator: %s (%d)\n", + DRM_DEV_ERROR(dev, "failed to enable regulator: %s (%d)\n", cfg->reg_names[i], ret); } for (i = 0; i < cfg->num_clks; i++) { ret = clk_prepare_enable(phy->clks[i]); if (ret) - dev_err(dev, "failed to enable clock: %s (%d)\n", + DRM_DEV_ERROR(dev, "failed to enable clock: %s (%d)\n", cfg->clk_names[i], ret); } @@ -159,7 +159,7 @@ static int msm_hdmi_phy_probe(struct platform_device *pdev) phy->mmio = msm_ioremap(pdev, "hdmi_phy", "HDMI_PHY"); if (IS_ERR(phy->mmio)) { - dev_err(dev, "%s: failed to map phy base\n", __func__); + DRM_DEV_ERROR(dev, "%s: failed to map phy base\n", __func__); return -ENOMEM; } @@ -177,7 +177,7 @@ static int msm_hdmi_phy_probe(struct platform_device *pdev) ret = msm_hdmi_phy_pll_init(pdev, phy->cfg->type); if (ret) { - dev_err(dev, "couldn't init PLL\n"); + DRM_DEV_ERROR(dev, "couldn't init PLL\n"); msm_hdmi_phy_resource_disable(phy); return ret; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c index 0df504c61833..318708f26731 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c @@ -725,7 +725,7 @@ int msm_hdmi_pll_8996_init(struct platform_device *pdev) pll->mmio_qserdes_com = msm_ioremap(pdev, "hdmi_pll", "HDMI_PLL"); if (IS_ERR(pll->mmio_qserdes_com)) { - dev_err(dev, "failed to map pll base\n"); + DRM_DEV_ERROR(dev, "failed to map pll base\n"); return -ENOMEM; } @@ -737,7 +737,7 @@ int msm_hdmi_pll_8996_init(struct platform_device *pdev) pll->mmio_qserdes_tx[i] = msm_ioremap(pdev, name, label); if (IS_ERR(pll->mmio_qserdes_tx[i])) { - dev_err(dev, "failed to map pll base\n"); + DRM_DEV_ERROR(dev, "failed to map pll base\n"); return -ENOMEM; } } @@ -745,7 +745,7 @@ int msm_hdmi_pll_8996_init(struct platform_device *pdev) clk = devm_clk_register(dev, &pll->clk_hw); if (IS_ERR(clk)) { - dev_err(dev, "failed to register pll clock\n"); + DRM_DEV_ERROR(dev, "failed to register pll clock\n"); return -EINVAL; } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c index 99590758c68b..c6dae6e437f9 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_pll_8960.c @@ -445,7 +445,7 @@ int msm_hdmi_pll_8960_init(struct platform_device *pdev) pll->mmio = msm_ioremap(pdev, "hdmi_pll", "HDMI_PLL"); if (IS_ERR(pll->mmio)) { - dev_err(dev, "failed to map pll base\n"); + DRM_DEV_ERROR(dev, "failed to map pll base\n"); return -ENOMEM; } @@ -454,7 +454,7 @@ int msm_hdmi_pll_8960_init(struct platform_device *pdev) clk = devm_clk_register(dev, &pll->clk_hw); if (IS_ERR(clk)) { - dev_err(dev, "failed to register pll clock\n"); + DRM_DEV_ERROR(dev, "failed to register pll clock\n"); return -EINVAL; } |