diff options
Diffstat (limited to 'drivers/gpu/drm/xlnx')
-rw-r--r-- | drivers/gpu/drm/xlnx/Kconfig | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/xlnx/zynqmp_dp.c | 244 | ||||
-rw-r--r-- | drivers/gpu/drm/xlnx/zynqmp_dp_audio.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/xlnx/zynqmp_kms.c | 3 |
5 files changed, 88 insertions, 172 deletions
diff --git a/drivers/gpu/drm/xlnx/Kconfig b/drivers/gpu/drm/xlnx/Kconfig index dbecca9bdd54..cfabf5e2a0bb 100644 --- a/drivers/gpu/drm/xlnx/Kconfig +++ b/drivers/gpu/drm/xlnx/Kconfig @@ -22,6 +22,7 @@ config DRM_ZYNQMP_DPSUB_AUDIO bool "ZynqMP DisplayPort Audio Support" depends on DRM_ZYNQMP_DPSUB depends on SND && SND_SOC + depends on SND_SOC=y || DRM_ZYNQMP_DPSUB=m select SND_SOC_GENERIC_DMAENGINE_PCM help Choose this option to enable DisplayPort audio support in the ZynqMP diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 979f6d3239ba..34ddbf98e81d 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1437,7 +1437,7 @@ zynqmp_dp_disp_connected_live_layer(struct zynqmp_dp *dp) } static void zynqmp_dp_disp_enable(struct zynqmp_dp *dp, - struct drm_bridge_state *old_bridge_state) + struct drm_atomic_state *state) { struct zynqmp_disp_layer *layer; struct drm_bridge_state *bridge_state; @@ -1447,8 +1447,7 @@ static void zynqmp_dp_disp_enable(struct zynqmp_dp *dp, if (!layer) return; - bridge_state = drm_atomic_get_new_bridge_state(old_bridge_state->base.state, - old_bridge_state->bridge); + bridge_state = drm_atomic_get_new_bridge_state(state, &dp->bridge); if (WARN_ON(!bridge_state)) return; @@ -1482,6 +1481,7 @@ static void zynqmp_dp_disp_disable(struct zynqmp_dp *dp, */ static int zynqmp_dp_bridge_attach(struct drm_bridge *bridge, + struct drm_encoder *encoder, enum drm_bridge_attach_flags flags) { struct zynqmp_dp *dp = bridge_to_dp(bridge); @@ -1495,7 +1495,7 @@ static int zynqmp_dp_bridge_attach(struct drm_bridge *bridge, } if (dp->next_bridge) { - ret = drm_bridge_attach(bridge->encoder, dp->next_bridge, + ret = drm_bridge_attach(encoder, dp->next_bridge, bridge, flags); if (ret < 0) goto error; @@ -1534,10 +1534,10 @@ zynqmp_dp_bridge_mode_valid(struct drm_bridge *bridge, } /* Check with link rate and lane count */ - mutex_lock(&dp->lock); - rate = zynqmp_dp_max_rate(dp->link_config.max_rate, - dp->link_config.max_lanes, dp->config.bpp); - mutex_unlock(&dp->lock); + scoped_guard(mutex, &dp->lock) + rate = zynqmp_dp_max_rate(dp->link_config.max_rate, + dp->link_config.max_lanes, + dp->config.bpp); if (mode->clock > rate) { dev_dbg(dp->dev, "filtered mode %s for high pixel rate\n", mode->name); @@ -1549,10 +1549,9 @@ zynqmp_dp_bridge_mode_valid(struct drm_bridge *bridge, } static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) + struct drm_atomic_state *state) { struct zynqmp_dp *dp = bridge_to_dp(bridge); - struct drm_atomic_state *state = old_bridge_state->base.state; const struct drm_crtc_state *crtc_state; const struct drm_display_mode *adjusted_mode; const struct drm_display_mode *mode; @@ -1565,7 +1564,7 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge, pm_runtime_get_sync(dp->dev); guard(mutex)(&dp->lock); - zynqmp_dp_disp_enable(dp, old_bridge_state); + zynqmp_dp_disp_enable(dp, state); /* * Retrieve the CRTC mode and adjusted mode. This requires a little @@ -1627,8 +1626,10 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm_bridge *bridge, } static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) + struct drm_atomic_state *state) { + struct drm_bridge_state *old_bridge_state = drm_atomic_get_old_bridge_state(state, + bridge); struct zynqmp_dp *dp = bridge_to_dp(bridge); mutex_lock(&dp->lock); @@ -1719,16 +1720,13 @@ disconnected: return connector_status_disconnected; } -static enum drm_connector_status zynqmp_dp_bridge_detect(struct drm_bridge *bridge) +static enum drm_connector_status +zynqmp_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector) { struct zynqmp_dp *dp = bridge_to_dp(bridge); - enum drm_connector_status ret; - mutex_lock(&dp->lock); - ret = __zynqmp_dp_bridge_detect(dp); - mutex_unlock(&dp->lock); - - return ret; + guard(mutex)(&dp->lock); + return __zynqmp_dp_bridge_detect(dp); } static const struct drm_edid *zynqmp_dp_bridge_edid_read(struct drm_bridge *bridge, @@ -1872,21 +1870,14 @@ static int zynqmp_dp_test_setup(struct zynqmp_dp *dp) static ssize_t zynqmp_dp_pattern_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { - struct dentry *dentry = file->f_path.dentry; struct zynqmp_dp *dp = file->private_data; char buf[16]; ssize_t ret; - ret = debugfs_file_get(dentry); - if (unlikely(ret)) - return ret; + scoped_guard(mutex, &dp->lock) + ret = snprintf(buf, sizeof(buf), "%s\n", + test_pattern_str[dp->test.pattern]); - mutex_lock(&dp->lock); - ret = snprintf(buf, sizeof(buf), "%s\n", - test_pattern_str[dp->test.pattern]); - mutex_unlock(&dp->lock); - - debugfs_file_put(dentry); return simple_read_from_buffer(user_buf, count, ppos, buf, ret); } @@ -1894,27 +1885,20 @@ static ssize_t zynqmp_dp_pattern_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { - struct dentry *dentry = file->f_path.dentry; struct zynqmp_dp *dp = file->private_data; char buf[16]; ssize_t ret; int pattern; - ret = debugfs_file_get(dentry); - if (unlikely(ret)) - return ret; - ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); if (ret < 0) - goto out; + return ret; buf[ret] = '\0'; pattern = sysfs_match_string(test_pattern_str, buf); - if (pattern < 0) { - ret = -EINVAL; - goto out; - } + if (pattern < 0) + return -EINVAL; mutex_lock(&dp->lock); dp->test.pattern = pattern; @@ -1923,8 +1907,6 @@ static ssize_t zynqmp_dp_pattern_write(struct file *file, dp->test.custom) ?: ret; mutex_unlock(&dp->lock); -out: - debugfs_file_put(dentry); return ret; } @@ -1939,24 +1921,18 @@ static int zynqmp_dp_enhanced_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = dp->test.enhanced; - mutex_unlock(&dp->lock); return 0; } static int zynqmp_dp_enhanced_set(void *data, u64 val) { struct zynqmp_dp *dp = data; - int ret = 0; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); dp->test.enhanced = val; - if (dp->test.active) - ret = zynqmp_dp_test_setup(dp); - mutex_unlock(&dp->lock); - - return ret; + return dp->test.active ? zynqmp_dp_test_setup(dp) : 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_enhanced, zynqmp_dp_enhanced_get, @@ -1966,24 +1942,19 @@ static int zynqmp_dp_downspread_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = dp->test.downspread; - mutex_unlock(&dp->lock); return 0; } static int zynqmp_dp_downspread_set(void *data, u64 val) { struct zynqmp_dp *dp = data; - int ret = 0; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); dp->test.downspread = val; - if (dp->test.active) - ret = zynqmp_dp_test_setup(dp); - mutex_unlock(&dp->lock); - return ret; + return dp->test.active ? zynqmp_dp_test_setup(dp) : 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_downspread, zynqmp_dp_downspread_get, @@ -1993,33 +1964,32 @@ static int zynqmp_dp_active_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = dp->test.active; - mutex_unlock(&dp->lock); return 0; } static int zynqmp_dp_active_set(void *data, u64 val) { struct zynqmp_dp *dp = data; - int ret = 0; + int ret; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); if (val) { if (val < 2) { ret = zynqmp_dp_test_setup(dp); if (ret) - goto out; + return ret; } ret = zynqmp_dp_set_test_pattern(dp, dp->test.pattern, dp->test.custom); if (ret) - goto out; + return ret; ret = zynqmp_dp_update_vs_emph(dp, dp->test.train_set); if (ret) - goto out; + return ret; dp->test.active = true; } else { @@ -2032,10 +2002,8 @@ static int zynqmp_dp_active_set(void *data, u64 val) err); zynqmp_dp_train_loop(dp); } -out: - mutex_unlock(&dp->lock); - return ret; + return 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_active, zynqmp_dp_active_get, @@ -2044,20 +2012,13 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_active, zynqmp_dp_active_get, static ssize_t zynqmp_dp_custom_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { - struct dentry *dentry = file->f_path.dentry; struct zynqmp_dp *dp = file->private_data; ssize_t ret; - ret = debugfs_file_get(dentry); - if (unlikely(ret)) - return ret; - mutex_lock(&dp->lock); ret = simple_read_from_buffer(user_buf, count, ppos, &dp->test.custom, sizeof(dp->test.custom)); mutex_unlock(&dp->lock); - - debugfs_file_put(dentry); return ret; } @@ -2065,18 +2026,13 @@ static ssize_t zynqmp_dp_custom_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { - struct dentry *dentry = file->f_path.dentry; struct zynqmp_dp *dp = file->private_data; ssize_t ret; char buf[sizeof(dp->test.custom)]; - ret = debugfs_file_get(dentry); - if (unlikely(ret)) - return ret; - ret = simple_write_to_buffer(buf, sizeof(buf), ppos, user_buf, count); if (ret < 0) - goto out; + return ret; mutex_lock(&dp->lock); memcpy(dp->test.custom, buf, ret); @@ -2084,9 +2040,6 @@ static ssize_t zynqmp_dp_custom_write(struct file *file, ret = zynqmp_dp_set_test_pattern(dp, dp->test.pattern, dp->test.custom) ?: ret; mutex_unlock(&dp->lock); - -out: - debugfs_file_put(dentry); return ret; } @@ -2102,9 +2055,8 @@ static int zynqmp_dp_swing_get(void *data, u64 *val) struct zynqmp_dp_train_set_priv *priv = data; struct zynqmp_dp *dp = priv->dp; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = dp->test.train_set[priv->lane] & DP_TRAIN_VOLTAGE_SWING_MASK; - mutex_unlock(&dp->lock); return 0; } @@ -2113,12 +2065,11 @@ static int zynqmp_dp_swing_set(void *data, u64 val) struct zynqmp_dp_train_set_priv *priv = data; struct zynqmp_dp *dp = priv->dp; u8 *train_set = &dp->test.train_set[priv->lane]; - int ret = 0; if (val > 3) return -EINVAL; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *train_set &= ~(DP_TRAIN_MAX_SWING_REACHED | DP_TRAIN_VOLTAGE_SWING_MASK); *train_set |= val; @@ -2126,10 +2077,9 @@ static int zynqmp_dp_swing_set(void *data, u64 val) *train_set |= DP_TRAIN_MAX_SWING_REACHED; if (dp->test.active) - ret = zynqmp_dp_update_vs_emph(dp, dp->test.train_set); - mutex_unlock(&dp->lock); + return zynqmp_dp_update_vs_emph(dp, dp->test.train_set); - return ret; + return 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_swing, zynqmp_dp_swing_get, @@ -2140,10 +2090,9 @@ static int zynqmp_dp_preemphasis_get(void *data, u64 *val) struct zynqmp_dp_train_set_priv *priv = data; struct zynqmp_dp *dp = priv->dp; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = FIELD_GET(DP_TRAIN_PRE_EMPHASIS_MASK, dp->test.train_set[priv->lane]); - mutex_unlock(&dp->lock); return 0; } @@ -2152,12 +2101,11 @@ static int zynqmp_dp_preemphasis_set(void *data, u64 val) struct zynqmp_dp_train_set_priv *priv = data; struct zynqmp_dp *dp = priv->dp; u8 *train_set = &dp->test.train_set[priv->lane]; - int ret = 0; if (val > 2) return -EINVAL; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *train_set &= ~(DP_TRAIN_MAX_PRE_EMPHASIS_REACHED | DP_TRAIN_PRE_EMPHASIS_MASK); *train_set |= val; @@ -2165,10 +2113,9 @@ static int zynqmp_dp_preemphasis_set(void *data, u64 val) *train_set |= DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; if (dp->test.active) - ret = zynqmp_dp_update_vs_emph(dp, dp->test.train_set); - mutex_unlock(&dp->lock); + return zynqmp_dp_update_vs_emph(dp, dp->test.train_set); - return ret; + return 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_preemphasis, zynqmp_dp_preemphasis_get, @@ -2178,31 +2125,24 @@ static int zynqmp_dp_lanes_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = dp->test.link_cnt; - mutex_unlock(&dp->lock); return 0; } static int zynqmp_dp_lanes_set(void *data, u64 val) { struct zynqmp_dp *dp = data; - int ret = 0; if (val > ZYNQMP_DP_MAX_LANES) return -EINVAL; - mutex_lock(&dp->lock); - if (val > dp->num_lanes) { - ret = -EINVAL; - } else { - dp->test.link_cnt = val; - if (dp->test.active) - ret = zynqmp_dp_test_setup(dp); - } - mutex_unlock(&dp->lock); + guard(mutex)(&dp->lock); + if (val > dp->num_lanes) + return -EINVAL; - return ret; + dp->test.link_cnt = val; + return dp->test.active ? zynqmp_dp_test_setup(dp) : 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_lanes, zynqmp_dp_lanes_get, @@ -2212,9 +2152,8 @@ static int zynqmp_dp_rate_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000ULL; - mutex_unlock(&dp->lock); return 0; } @@ -2222,7 +2161,6 @@ static int zynqmp_dp_rate_set(void *data, u64 val) { struct zynqmp_dp *dp = data; int link_rate; - int ret = 0; u8 bw_code; if (do_div(val, 10000)) @@ -2237,13 +2175,9 @@ static int zynqmp_dp_rate_set(void *data, u64 val) bw_code != DP_LINK_BW_5_4) return -EINVAL; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); dp->test.bw_code = bw_code; - if (dp->test.active) - ret = zynqmp_dp_test_setup(dp); - mutex_unlock(&dp->lock); - - return ret; + return dp->test.active ? zynqmp_dp_test_setup(dp) : 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_rate, zynqmp_dp_rate_get, @@ -2253,9 +2187,8 @@ static int zynqmp_dp_ignore_aux_errors_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->aux.hw_mutex); + guard(mutex)(&dp->lock); *val = dp->ignore_aux_errors; - mutex_unlock(&dp->aux.hw_mutex); return 0; } @@ -2266,9 +2199,8 @@ static int zynqmp_dp_ignore_aux_errors_set(void *data, u64 val) if (val != !!val) return -EINVAL; - mutex_lock(&dp->aux.hw_mutex); + guard(mutex)(&dp->lock); dp->ignore_aux_errors = val; - mutex_unlock(&dp->aux.hw_mutex); return 0; } @@ -2280,9 +2212,8 @@ static int zynqmp_dp_ignore_hpd_get(void *data, u64 *val) { struct zynqmp_dp *dp = data; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); *val = dp->ignore_hpd; - mutex_unlock(&dp->lock); return 0; } @@ -2293,9 +2224,8 @@ static int zynqmp_dp_ignore_hpd_set(void *data, u64 val) if (val != !!val) return -EINVAL; - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); dp->ignore_hpd = val; - mutex_lock(&dp->lock); return 0; } @@ -2391,14 +2321,12 @@ static void zynqmp_dp_hpd_work_func(struct work_struct *work) struct zynqmp_dp *dp = container_of(work, struct zynqmp_dp, hpd_work); enum drm_connector_status status; - mutex_lock(&dp->lock); - if (dp->ignore_hpd) { - mutex_unlock(&dp->lock); - return; - } + scoped_guard(mutex, &dp->lock) { + if (dp->ignore_hpd) + return; - status = __zynqmp_dp_bridge_detect(dp); - mutex_unlock(&dp->lock); + status = __zynqmp_dp_bridge_detect(dp); + } drm_bridge_hpd_notify(&dp->bridge, status); } @@ -2410,11 +2338,9 @@ static void zynqmp_dp_hpd_irq_work_func(struct work_struct *work) u8 status[DP_LINK_STATUS_SIZE + 2]; int err; - mutex_lock(&dp->lock); - if (dp->ignore_hpd) { - mutex_unlock(&dp->lock); + guard(mutex)(&dp->lock); + if (dp->ignore_hpd) return; - } err = drm_dp_dpcd_read(&dp->aux, DP_SINK_COUNT, status, DP_LINK_STATUS_SIZE + 2); @@ -2428,7 +2354,6 @@ static void zynqmp_dp_hpd_irq_work_func(struct work_struct *work) zynqmp_dp_train_loop(dp); } } - mutex_unlock(&dp->lock); } static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data) @@ -2483,12 +2408,11 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) struct platform_device *pdev = to_platform_device(dpsub->dev); struct drm_bridge *bridge; struct zynqmp_dp *dp; - struct resource *res; int ret; - dp = kzalloc(sizeof(*dp), GFP_KERNEL); - if (!dp) - return -ENOMEM; + dp = devm_drm_bridge_alloc(&pdev->dev, struct zynqmp_dp, bridge, &zynqmp_dp_bridge_funcs); + if (IS_ERR(dp)) + return PTR_ERR(dp); dp->dev = &pdev->dev; dp->dpsub = dpsub; @@ -2500,35 +2424,26 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) INIT_WORK(&dp->hpd_irq_work, zynqmp_dp_hpd_irq_work_func); /* Acquire all resources (IOMEM, IRQ and PHYs). */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dp"); - dp->iomem = devm_ioremap_resource(dp->dev, res); - if (IS_ERR(dp->iomem)) { - ret = PTR_ERR(dp->iomem); - goto err_free; - } + dp->iomem = devm_platform_ioremap_resource_byname(pdev, "dp"); + if (IS_ERR(dp->iomem)) + return PTR_ERR(dp->iomem); dp->irq = platform_get_irq(pdev, 0); - if (dp->irq < 0) { - ret = dp->irq; - goto err_free; - } + if (dp->irq < 0) + return dp->irq; dp->reset = devm_reset_control_get(dp->dev, NULL); - if (IS_ERR(dp->reset)) { - if (PTR_ERR(dp->reset) != -EPROBE_DEFER) - dev_err(dp->dev, "failed to get reset: %ld\n", - PTR_ERR(dp->reset)); - ret = PTR_ERR(dp->reset); - goto err_free; - } + if (IS_ERR(dp->reset)) + return dev_err_probe(dp->dev, PTR_ERR(dp->reset), + "failed to get reset\n"); ret = zynqmp_dp_reset(dp, true); if (ret < 0) - goto err_free; + return ret; ret = zynqmp_dp_reset(dp, false); if (ret < 0) - goto err_free; + return ret; ret = zynqmp_dp_phy_probe(dp); if (ret) @@ -2536,7 +2451,6 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) /* Initialize the bridge. */ bridge = &dp->bridge; - bridge->funcs = &zynqmp_dp_bridge_funcs; bridge->ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD; bridge->type = DRM_MODE_CONNECTOR_DisplayPort; @@ -2589,8 +2503,6 @@ err_phy_exit: zynqmp_dp_phy_exit(dp); err_reset: zynqmp_dp_reset(dp, true); -err_free: - kfree(dp); return ret; } diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp_audio.c b/drivers/gpu/drm/xlnx/zynqmp_dp_audio.c index fa5f0ace6084..1a46a046103f 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp_audio.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp_audio.c @@ -45,7 +45,6 @@ struct zynqmp_dpsub_audio { struct { struct snd_soc_dai_link_component cpu; - struct snd_soc_dai_link_component codec; struct snd_soc_dai_link_component platform; } components[ZYNQMP_NUM_PCMS]; @@ -323,12 +322,16 @@ int zynqmp_audio_init(struct zynqmp_dpsub *dpsub) audio->dai_name = devm_kasprintf(dev, GFP_KERNEL, "%s-dai", dev_name(dev)); + if (!audio->dai_name) + return -ENOMEM; for (unsigned int i = 0; i < ZYNQMP_NUM_PCMS; ++i) { audio->link_names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s-dp-%u", dev_name(dev), i); audio->pcm_names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s-pcm-%u", dev_name(dev), i); + if (!audio->link_names[i] || !audio->pcm_names[i]) + return -ENOMEM; } audio->base = devm_platform_ioremap_resource_byname(pdev, "aud"); @@ -399,10 +402,8 @@ int zynqmp_audio_init(struct zynqmp_dpsub *dpsub) link->num_cpus = 1; link->cpus[0].dai_name = audio->dai_name; - link->codecs = &audio->components[i].codec; + link->codecs = &snd_soc_dummy_dlc; link->num_codecs = 1; - link->codecs[0].name = "snd-soc-dummy"; - link->codecs[0].dai_name = "snd-soc-dummy-dai"; link->platforms = &audio->components[i].platform; link->num_platforms = 1; diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index f953ca48a930..2764c4b17c5e 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -180,7 +180,6 @@ static int zynqmp_dpsub_parse_dt(struct zynqmp_dpsub *dpsub) void zynqmp_dpsub_release(struct zynqmp_dpsub *dpsub) { kfree(dpsub->disp); - kfree(dpsub->dp); kfree(dpsub); } @@ -201,6 +200,8 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) if (ret) return ret; + dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + /* Try the reserved memory. Proceed if there's none. */ of_reserved_mem_device_init(&pdev->dev); diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqmp_kms.c index b47463473472..2bee0a2275ed 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -373,6 +373,7 @@ static int zynqmp_dpsub_dumb_create(struct drm_file *file_priv, static struct drm_framebuffer * zynqmp_dpsub_fb_create(struct drm_device *drm, struct drm_file *file_priv, + const struct drm_format_info *info, const struct drm_mode_fb_cmd2 *mode_cmd) { struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(drm); @@ -383,7 +384,7 @@ zynqmp_dpsub_fb_create(struct drm_device *drm, struct drm_file *file_priv, for (i = 0; i < ARRAY_SIZE(cmd.pitches); ++i) cmd.pitches[i] = ALIGN(cmd.pitches[i], dpsub->dma_align); - return drm_gem_fb_create(drm, file_priv, &cmd); + return drm_gem_fb_create(drm, file_priv, info, &cmd); } static const struct drm_mode_config_funcs zynqmp_dpsub_mode_config_funcs = { |