mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
Merge tag 'mediatek-drm-fixes-20260729' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes
Mediatek DRM Fixes - 20260729 1. Check CRTC state before freeing 2. mtk_hdmi: Fix DDC adapter double put in v2 3. mtk_hdmi_common: take i2c adapter module reference 4. mtk_dsi: Enable HS clock only at pre-enable 5. ovl_adaptor: balance component registrations Signed-off-by: Dave Airlie <airlied@redhat.com> From: Chun-Kuang Hu <chunkuang.hu@kernel.org> Link: https://patch.msgid.link/20260729131701.4158-1-chunkuang.hu@kernel.org
This commit is contained in:
@@ -154,10 +154,10 @@ static void mtk_crtc_reset(struct drm_crtc *crtc)
|
||||
{
|
||||
struct mtk_crtc_state *state;
|
||||
|
||||
if (crtc->state)
|
||||
if (crtc->state) {
|
||||
__drm_atomic_helper_crtc_destroy_state(crtc->state);
|
||||
|
||||
kfree(to_mtk_crtc_state(crtc->state));
|
||||
kfree(to_mtk_crtc_state(crtc->state));
|
||||
}
|
||||
crtc->state = NULL;
|
||||
|
||||
state = kzalloc_obj(*state);
|
||||
|
||||
@@ -625,6 +625,7 @@ static void mtk_disp_ovl_adaptor_master_unbind(struct device *dev)
|
||||
struct mtk_disp_ovl_adaptor *priv = dev_get_drvdata(dev);
|
||||
|
||||
priv->children_bound = false;
|
||||
component_unbind_all(dev, priv->mmsys_dev);
|
||||
}
|
||||
|
||||
static const struct component_master_ops mtk_disp_ovl_adaptor_master_ops = {
|
||||
@@ -651,12 +652,15 @@ static int mtk_disp_ovl_adaptor_probe(struct platform_device *pdev)
|
||||
|
||||
priv->mmsys_dev = pdev->dev.platform_data;
|
||||
|
||||
component_master_add_with_match(dev, &mtk_disp_ovl_adaptor_master_ops, match);
|
||||
ret = component_master_add_with_match(dev, &mtk_disp_ovl_adaptor_master_ops, match);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to add component master\n");
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
ret = component_add(dev, &mtk_disp_ovl_adaptor_comp_ops);
|
||||
if (ret != 0) {
|
||||
component_master_del(dev, &mtk_disp_ovl_adaptor_master_ops);
|
||||
pm_runtime_disable(dev);
|
||||
return dev_err_probe(dev, ret, "Failed to add component\n");
|
||||
}
|
||||
@@ -666,6 +670,7 @@ static int mtk_disp_ovl_adaptor_probe(struct platform_device *pdev)
|
||||
|
||||
static void mtk_disp_ovl_adaptor_remove(struct platform_device *pdev)
|
||||
{
|
||||
component_del(&pdev->dev, &mtk_disp_ovl_adaptor_comp_ops);
|
||||
component_master_del(&pdev->dev, &mtk_disp_ovl_adaptor_master_ops);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
}
|
||||
|
||||
@@ -743,8 +743,6 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
|
||||
mtk_dsi_set_vm_cmd(dsi);
|
||||
mtk_dsi_config_vdo_timing(dsi);
|
||||
mtk_dsi_set_interrupt_enable(dsi);
|
||||
mtk_dsi_lane_ready(dsi);
|
||||
mtk_dsi_clk_hs_mode(dsi, 1);
|
||||
|
||||
return 0;
|
||||
err_disable_engine_clk:
|
||||
@@ -858,6 +856,9 @@ static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
|
||||
ret = mtk_dsi_poweron(dsi);
|
||||
if (ret < 0)
|
||||
drm_err(drm, "failed to power on dsi\n");
|
||||
|
||||
mtk_dsi_lane_ready(dsi);
|
||||
mtk_dsi_clk_hs_mode(dsi, 1);
|
||||
}
|
||||
|
||||
static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
|
||||
|
||||
@@ -290,6 +290,13 @@ static int mtk_hdmi_get_cec_dev(struct mtk_hdmi *hdmi, struct device *dev, struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mtk_hdmi_put_adapter(void *_adap)
|
||||
{
|
||||
struct i2c_adapter *adap = _adap;
|
||||
|
||||
i2c_put_adapter(adap);
|
||||
}
|
||||
|
||||
static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device *pdev,
|
||||
const char * const *clk_names, size_t num_clocks)
|
||||
{
|
||||
@@ -328,12 +335,12 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device
|
||||
if (!i2c_np)
|
||||
return dev_err_probe(dev, -EINVAL, "No ddc-i2c-bus in connector\n");
|
||||
|
||||
hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
|
||||
hdmi->ddc_adpt = of_get_i2c_adapter_by_node(i2c_np);
|
||||
of_node_put(i2c_np);
|
||||
if (!hdmi->ddc_adpt)
|
||||
return dev_err_probe(dev, -EPROBE_DEFER, "Failed to get ddc i2c adapter by node\n");
|
||||
|
||||
ret = devm_add_action_or_reset(dev, mtk_hdmi_put_device, &hdmi->ddc_adpt->dev);
|
||||
ret = devm_add_action_or_reset(dev, mtk_hdmi_put_adapter, hdmi->ddc_adpt);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -1499,13 +1499,6 @@ static int mtk_hdmi_v2_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mtk_hdmi_v2_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mtk_hdmi *hdmi = platform_get_drvdata(pdev);
|
||||
|
||||
i2c_put_adapter(hdmi->ddc_adpt);
|
||||
}
|
||||
|
||||
static const struct of_device_id mtk_drm_hdmi_v2_of_ids[] = {
|
||||
{ .compatible = "mediatek,mt8188-hdmi-tx", .data = &mtk_hdmi_conf_mt8188 },
|
||||
{ .compatible = "mediatek,mt8195-hdmi-tx", .data = &mtk_hdmi_conf_mt8195 },
|
||||
@@ -1515,7 +1508,6 @@ MODULE_DEVICE_TABLE(of, mtk_drm_hdmi_v2_of_ids);
|
||||
|
||||
static struct platform_driver mtk_hdmi_v2_driver = {
|
||||
.probe = mtk_hdmi_v2_probe,
|
||||
.remove = mtk_hdmi_v2_remove,
|
||||
.driver = {
|
||||
.name = "mediatek-drm-hdmi-v2",
|
||||
.of_match_table = mtk_drm_hdmi_v2_of_ids,
|
||||
|
||||
Reference in New Issue
Block a user