Commit 65cf7c02 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'exynos-drm-fixes-v5.19-rc3' of...

Merge tag 'exynos-drm-fixes-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes

two regression fixups
- Check a null pointer instead of IS_ERR().
- Rework initialization code of Exynos MIC driver.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Inki Dae <inki.dae@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220614141336.88614-1-inki.dae@samsung.com
parents d08227a8 7d787184
...@@ -176,15 +176,15 @@ static struct exynos_drm_driver_info exynos_drm_drivers[] = { ...@@ -176,15 +176,15 @@ static struct exynos_drm_driver_info exynos_drm_drivers[] = {
}, { }, {
DRV_PTR(mixer_driver, CONFIG_DRM_EXYNOS_MIXER), DRV_PTR(mixer_driver, CONFIG_DRM_EXYNOS_MIXER),
DRM_COMPONENT_DRIVER DRM_COMPONENT_DRIVER
}, {
DRV_PTR(mic_driver, CONFIG_DRM_EXYNOS_MIC),
DRM_COMPONENT_DRIVER
}, { }, {
DRV_PTR(dp_driver, CONFIG_DRM_EXYNOS_DP), DRV_PTR(dp_driver, CONFIG_DRM_EXYNOS_DP),
DRM_COMPONENT_DRIVER DRM_COMPONENT_DRIVER
}, { }, {
DRV_PTR(dsi_driver, CONFIG_DRM_EXYNOS_DSI), DRV_PTR(dsi_driver, CONFIG_DRM_EXYNOS_DSI),
DRM_COMPONENT_DRIVER DRM_COMPONENT_DRIVER
}, {
DRV_PTR(mic_driver, CONFIG_DRM_EXYNOS_MIC),
DRM_COMPONENT_DRIVER
}, { }, {
DRV_PTR(hdmi_driver, CONFIG_DRM_EXYNOS_HDMI), DRV_PTR(hdmi_driver, CONFIG_DRM_EXYNOS_HDMI),
DRM_COMPONENT_DRIVER DRM_COMPONENT_DRIVER
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <drm/drm_print.h> #include <drm/drm_print.h>
#include "exynos_drm_drv.h" #include "exynos_drm_drv.h"
#include "exynos_drm_crtc.h"
/* Sysreg registers for MIC */ /* Sysreg registers for MIC */
#define DSD_CFG_MUX 0x1004 #define DSD_CFG_MUX 0x1004
...@@ -100,9 +101,7 @@ struct exynos_mic { ...@@ -100,9 +101,7 @@ struct exynos_mic {
bool i80_mode; bool i80_mode;
struct videomode vm; struct videomode vm;
struct drm_encoder *encoder;
struct drm_bridge bridge; struct drm_bridge bridge;
struct drm_bridge *next_bridge;
bool enabled; bool enabled;
}; };
...@@ -229,8 +228,6 @@ static void mic_set_reg_on(struct exynos_mic *mic, bool enable) ...@@ -229,8 +228,6 @@ static void mic_set_reg_on(struct exynos_mic *mic, bool enable)
writel(reg, mic->reg + MIC_OP); writel(reg, mic->reg + MIC_OP);
} }
static void mic_disable(struct drm_bridge *bridge) { }
static void mic_post_disable(struct drm_bridge *bridge) static void mic_post_disable(struct drm_bridge *bridge)
{ {
struct exynos_mic *mic = bridge->driver_private; struct exynos_mic *mic = bridge->driver_private;
...@@ -297,34 +294,30 @@ static void mic_pre_enable(struct drm_bridge *bridge) ...@@ -297,34 +294,30 @@ static void mic_pre_enable(struct drm_bridge *bridge)
mutex_unlock(&mic_mutex); mutex_unlock(&mic_mutex);
} }
static void mic_enable(struct drm_bridge *bridge) { }
static int mic_attach(struct drm_bridge *bridge,
enum drm_bridge_attach_flags flags)
{
struct exynos_mic *mic = bridge->driver_private;
return drm_bridge_attach(bridge->encoder, mic->next_bridge,
&mic->bridge, flags);
}
static const struct drm_bridge_funcs mic_bridge_funcs = { static const struct drm_bridge_funcs mic_bridge_funcs = {
.disable = mic_disable,
.post_disable = mic_post_disable, .post_disable = mic_post_disable,
.mode_set = mic_mode_set, .mode_set = mic_mode_set,
.pre_enable = mic_pre_enable, .pre_enable = mic_pre_enable,
.enable = mic_enable,
.attach = mic_attach,
}; };
static int exynos_mic_bind(struct device *dev, struct device *master, static int exynos_mic_bind(struct device *dev, struct device *master,
void *data) void *data)
{ {
struct exynos_mic *mic = dev_get_drvdata(dev); struct exynos_mic *mic = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
struct exynos_drm_crtc *crtc = exynos_drm_crtc_get_by_type(drm_dev,
EXYNOS_DISPLAY_TYPE_LCD);
struct drm_encoder *e, *encoder = NULL;
drm_for_each_encoder(e, drm_dev)
if (e->possible_crtcs == drm_crtc_mask(&crtc->base))
encoder = e;
if (!encoder)
return -ENODEV;
mic->bridge.driver_private = mic; mic->bridge.driver_private = mic;
return 0; return drm_bridge_attach(encoder, &mic->bridge, NULL, 0);
} }
static void exynos_mic_unbind(struct device *dev, struct device *master, static void exynos_mic_unbind(struct device *dev, struct device *master,
...@@ -388,7 +381,6 @@ static int exynos_mic_probe(struct platform_device *pdev) ...@@ -388,7 +381,6 @@ static int exynos_mic_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct exynos_mic *mic; struct exynos_mic *mic;
struct device_node *remote;
struct resource res; struct resource res;
int ret, i; int ret, i;
...@@ -432,16 +424,6 @@ static int exynos_mic_probe(struct platform_device *pdev) ...@@ -432,16 +424,6 @@ static int exynos_mic_probe(struct platform_device *pdev)
} }
} }
remote = of_graph_get_remote_node(dev->of_node, 1, 0);
mic->next_bridge = of_drm_find_bridge(remote);
if (IS_ERR(mic->next_bridge)) {
DRM_DEV_ERROR(dev, "mic: Failed to find next bridge\n");
ret = PTR_ERR(mic->next_bridge);
goto err;
}
of_node_put(remote);
platform_set_drvdata(pdev, mic); platform_set_drvdata(pdev, mic);
mic->bridge.funcs = &mic_bridge_funcs; mic->bridge.funcs = &mic_bridge_funcs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment