summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sti/sti_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/sti/sti_drv.c')
-rw-r--r--drivers/gpu/drm/sti/sti_drv.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index ef6a4e63198f..f16345f01065 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -5,19 +5,24 @@
*/
#include <linux/component.h>
+#include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_drv.h>
-#include <drm/drm_fbdev_generic.h>
+#include <drm/drm_fbdev_dma.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_of.h>
+#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include "sti_drv.h"
@@ -25,7 +30,6 @@
#define DRIVER_NAME "sti"
#define DRIVER_DESC "STMicroelectronics SoC DRM"
-#define DRIVER_DATE "20140601"
#define DRIVER_MAJOR 1
#define DRIVER_MINOR 0
@@ -133,12 +137,12 @@ static const struct drm_driver sti_driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
.fops = &sti_driver_fops,
DRM_GEM_DMA_DRIVER_OPS,
+ DRM_FBDEV_DMA_DRIVER_OPS,
.debugfs_init = sti_drm_dbg_init,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
- .date = DRIVER_DATE,
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
};
@@ -172,6 +176,7 @@ static void sti_cleanup(struct drm_device *ddev)
drm_atomic_helper_shutdown(ddev);
drm_mode_config_cleanup(ddev);
component_unbind_all(ddev->dev, ddev);
+ dev_set_drvdata(ddev->dev, NULL);
kfree(private);
ddev->dev_private = NULL;
}
@@ -199,7 +204,7 @@ static int sti_bind(struct device *dev)
drm_mode_config_reset(ddev);
- drm_fbdev_generic_setup(ddev, 32);
+ drm_client_setup(ddev, NULL);
return 0;
@@ -227,30 +232,25 @@ static const struct component_master_ops sti_ops = {
static int sti_platform_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *node = dev->of_node;
- struct device_node *child_np;
- struct component_match *match = NULL;
+ int ret;
- dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+ ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+ if (ret)
+ return ret;
devm_of_platform_populate(dev);
- child_np = of_get_next_available_child(node, NULL);
-
- while (child_np) {
- drm_of_component_match_add(dev, &match, component_compare_of,
- child_np);
- child_np = of_get_next_available_child(node, child_np);
- }
-
- return component_master_add_with_match(dev, &sti_ops, match);
+ return drm_of_component_probe(dev, component_compare_of, &sti_ops);
}
-static int sti_platform_remove(struct platform_device *pdev)
+static void sti_platform_remove(struct platform_device *pdev)
{
component_master_del(&pdev->dev, &sti_ops);
+}
- return 0;
+static void sti_platform_shutdown(struct platform_device *pdev)
+{
+ drm_atomic_helper_shutdown(platform_get_drvdata(pdev));
}
static const struct of_device_id sti_dt_ids[] = {
@@ -262,6 +262,7 @@ MODULE_DEVICE_TABLE(of, sti_dt_ids);
static struct platform_driver sti_platform_driver = {
.probe = sti_platform_probe,
.remove = sti_platform_remove,
+ .shutdown = sti_platform_shutdown,
.driver = {
.name = DRIVER_NAME,
.of_match_table = sti_dt_ids,