xref: /linux/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c (revision b4a6aaeaf4aa79f23775f6688a7e8db3ee1c1303)
14f2a8f58SJoel Stanley // SPDX-License-Identifier: GPL-2.0+
24f2a8f58SJoel Stanley // Copyright 2018 IBM Corporation
34f2a8f58SJoel Stanley 
44f2a8f58SJoel Stanley #include <linux/clk.h>
54f2a8f58SJoel Stanley #include <linux/dma-mapping.h>
64f2a8f58SJoel Stanley #include <linux/irq.h>
74f2a8f58SJoel Stanley #include <linux/mfd/syscon.h>
84f2a8f58SJoel Stanley #include <linux/module.h>
94f2a8f58SJoel Stanley #include <linux/of.h>
10bce724faSJoel Stanley #include <linux/of_device.h>
114f2a8f58SJoel Stanley #include <linux/of_reserved_mem.h>
124f2a8f58SJoel Stanley #include <linux/platform_device.h>
134f2a8f58SJoel Stanley #include <linux/regmap.h>
144f2a8f58SJoel Stanley #include <linux/reset.h>
154f2a8f58SJoel Stanley 
164f2a8f58SJoel Stanley #include <drm/drm_atomic_helper.h>
174f2a8f58SJoel Stanley #include <drm/drm_crtc_helper.h>
184f2a8f58SJoel Stanley #include <drm/drm_device.h>
194f2a8f58SJoel Stanley #include <drm/drm_fb_cma_helper.h>
204f2a8f58SJoel Stanley #include <drm/drm_fb_helper.h>
214f2a8f58SJoel Stanley #include <drm/drm_gem_cma_helper.h>
224f2a8f58SJoel Stanley #include <drm/drm_gem_framebuffer_helper.h>
234f2a8f58SJoel Stanley #include <drm/drm_probe_helper.h>
244f2a8f58SJoel Stanley #include <drm/drm_simple_kms_helper.h>
254f2a8f58SJoel Stanley #include <drm/drm_vblank.h>
264f2a8f58SJoel Stanley #include <drm/drm_drv.h>
274f2a8f58SJoel Stanley 
284f2a8f58SJoel Stanley #include "aspeed_gfx.h"
294f2a8f58SJoel Stanley 
304f2a8f58SJoel Stanley /**
314f2a8f58SJoel Stanley  * DOC: ASPEED GFX Driver
324f2a8f58SJoel Stanley  *
334f2a8f58SJoel Stanley  * This driver is for the ASPEED BMC SoC's 'GFX' display hardware, also called
344f2a8f58SJoel Stanley  * the 'SOC Display Controller' in the datasheet. This driver runs on the ARM
354f2a8f58SJoel Stanley  * based BMC systems, unlike the ast driver which runs on a host CPU and is for
364f2a8f58SJoel Stanley  * a PCIe graphics device.
374f2a8f58SJoel Stanley  *
384f2a8f58SJoel Stanley  * The AST2500 supports a total of 3 output paths:
394f2a8f58SJoel Stanley  *
404f2a8f58SJoel Stanley  *   1. VGA output, the output target can choose either or both to the DAC
414f2a8f58SJoel Stanley  *   or DVO interface.
424f2a8f58SJoel Stanley  *
434f2a8f58SJoel Stanley  *   2. Graphics CRT output, the output target can choose either or both to
444f2a8f58SJoel Stanley  *   the DAC or DVO interface.
454f2a8f58SJoel Stanley  *
464f2a8f58SJoel Stanley  *   3. Video input from DVO, the video input can be used for video engine
474f2a8f58SJoel Stanley  *   capture or DAC display output.
484f2a8f58SJoel Stanley  *
494f2a8f58SJoel Stanley  * Output options are selected in SCU2C.
504f2a8f58SJoel Stanley  *
514f2a8f58SJoel Stanley  * The "VGA mode" device is the PCI attached controller. The "Graphics CRT"
524f2a8f58SJoel Stanley  * is the ARM's internal display controller.
534f2a8f58SJoel Stanley  *
544f2a8f58SJoel Stanley  * The driver only supports a simple configuration consisting of a 40MHz
554f2a8f58SJoel Stanley  * pixel clock, fixed by hardware limitations, and the VGA output path.
564f2a8f58SJoel Stanley  *
574f2a8f58SJoel Stanley  * The driver was written with the 'AST2500 Software Programming Guide' v17,
584f2a8f58SJoel Stanley  * which is available under NDA from ASPEED.
594f2a8f58SJoel Stanley  */
604f2a8f58SJoel Stanley 
61bce724faSJoel Stanley struct aspeed_gfx_config {
62bce724faSJoel Stanley 	u32 dac_reg;		/* DAC register in SCU */
63bce724faSJoel Stanley 	u32 vga_scratch_reg;	/* VGA scratch register in SCU */
64bce724faSJoel Stanley 	u32 throd_val;		/* Default Threshold Seting */
65bce724faSJoel Stanley 	u32 scan_line_max;	/* Max memory size of one scan line */
66bce724faSJoel Stanley };
67bce724faSJoel Stanley 
68bce724faSJoel Stanley static const struct aspeed_gfx_config ast2400_config = {
69bce724faSJoel Stanley 	.dac_reg = 0x2c,
70bce724faSJoel Stanley 	.vga_scratch_reg = 0x50,
71bce724faSJoel Stanley 	.throd_val = CRT_THROD_LOW(0x1e) | CRT_THROD_HIGH(0x12),
72bce724faSJoel Stanley 	.scan_line_max = 64,
73bce724faSJoel Stanley };
74bce724faSJoel Stanley 
75bce724faSJoel Stanley static const struct aspeed_gfx_config ast2500_config = {
76bce724faSJoel Stanley 	.dac_reg = 0x2c,
77bce724faSJoel Stanley 	.vga_scratch_reg = 0x50,
78bce724faSJoel Stanley 	.throd_val = CRT_THROD_LOW(0x24) | CRT_THROD_HIGH(0x3c),
79bce724faSJoel Stanley 	.scan_line_max = 128,
80bce724faSJoel Stanley };
81bce724faSJoel Stanley 
82bce724faSJoel Stanley static const struct of_device_id aspeed_gfx_match[] = {
83bce724faSJoel Stanley 	{ .compatible = "aspeed,ast2400-gfx", .data = &ast2400_config },
84bce724faSJoel Stanley 	{ .compatible = "aspeed,ast2500-gfx", .data = &ast2500_config },
85bce724faSJoel Stanley 	{ },
86bce724faSJoel Stanley };
87bce724faSJoel Stanley MODULE_DEVICE_TABLE(of, aspeed_gfx_match);
88bce724faSJoel Stanley 
894f2a8f58SJoel Stanley static const struct drm_mode_config_funcs aspeed_gfx_mode_config_funcs = {
904f2a8f58SJoel Stanley 	.fb_create		= drm_gem_fb_create,
914f2a8f58SJoel Stanley 	.atomic_check		= drm_atomic_helper_check,
924f2a8f58SJoel Stanley 	.atomic_commit		= drm_atomic_helper_commit,
934f2a8f58SJoel Stanley };
944f2a8f58SJoel Stanley 
95c2c25c1cSDaniel Vetter static int aspeed_gfx_setup_mode_config(struct drm_device *drm)
964f2a8f58SJoel Stanley {
97c2c25c1cSDaniel Vetter 	int ret;
98c2c25c1cSDaniel Vetter 
99c2c25c1cSDaniel Vetter 	ret = drmm_mode_config_init(drm);
100c2c25c1cSDaniel Vetter 	if (ret)
101c2c25c1cSDaniel Vetter 		return ret;
1024f2a8f58SJoel Stanley 
1034f2a8f58SJoel Stanley 	drm->mode_config.min_width = 0;
1044f2a8f58SJoel Stanley 	drm->mode_config.min_height = 0;
1054f2a8f58SJoel Stanley 	drm->mode_config.max_width = 800;
1064f2a8f58SJoel Stanley 	drm->mode_config.max_height = 600;
1074f2a8f58SJoel Stanley 	drm->mode_config.funcs = &aspeed_gfx_mode_config_funcs;
108c2c25c1cSDaniel Vetter 
109c2c25c1cSDaniel Vetter 	return ret;
1104f2a8f58SJoel Stanley }
1114f2a8f58SJoel Stanley 
1124f2a8f58SJoel Stanley static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)
1134f2a8f58SJoel Stanley {
1144f2a8f58SJoel Stanley 	struct drm_device *drm = data;
115cd829454SDaniel Vetter 	struct aspeed_gfx *priv = to_aspeed_gfx(drm);
1164f2a8f58SJoel Stanley 	u32 reg;
1174f2a8f58SJoel Stanley 
1184f2a8f58SJoel Stanley 	reg = readl(priv->base + CRT_CTRL1);
1194f2a8f58SJoel Stanley 
1204f2a8f58SJoel Stanley 	if (reg & CRT_CTRL_VERTICAL_INTR_STS) {
1214f2a8f58SJoel Stanley 		drm_crtc_handle_vblank(&priv->pipe.crtc);
1224f2a8f58SJoel Stanley 		writel(reg, priv->base + CRT_CTRL1);
1234f2a8f58SJoel Stanley 		return IRQ_HANDLED;
1244f2a8f58SJoel Stanley 	}
1254f2a8f58SJoel Stanley 
1264f2a8f58SJoel Stanley 	return IRQ_NONE;
1274f2a8f58SJoel Stanley }
1284f2a8f58SJoel Stanley 
1294f2a8f58SJoel Stanley static int aspeed_gfx_load(struct drm_device *drm)
1304f2a8f58SJoel Stanley {
1314f2a8f58SJoel Stanley 	struct platform_device *pdev = to_platform_device(drm->dev);
132cd829454SDaniel Vetter 	struct aspeed_gfx *priv = to_aspeed_gfx(drm);
13392614ad5SJoel Stanley 	struct device_node *np = pdev->dev.of_node;
134bce724faSJoel Stanley 	const struct aspeed_gfx_config *config;
135bce724faSJoel Stanley 	const struct of_device_id *match;
1364f2a8f58SJoel Stanley 	struct resource *res;
1374f2a8f58SJoel Stanley 	int ret;
1384f2a8f58SJoel Stanley 
1394f2a8f58SJoel Stanley 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1404f2a8f58SJoel Stanley 	priv->base = devm_ioremap_resource(drm->dev, res);
1414f2a8f58SJoel Stanley 	if (IS_ERR(priv->base))
1424f2a8f58SJoel Stanley 		return PTR_ERR(priv->base);
1434f2a8f58SJoel Stanley 
144bce724faSJoel Stanley 	match = of_match_device(aspeed_gfx_match, &pdev->dev);
145bce724faSJoel Stanley 	if (!match)
146bce724faSJoel Stanley 		return -EINVAL;
147bce724faSJoel Stanley 	config = match->data;
148bce724faSJoel Stanley 
149bce724faSJoel Stanley 	priv->dac_reg = config->dac_reg;
150bce724faSJoel Stanley 	priv->vga_scratch_reg = config->vga_scratch_reg;
151bce724faSJoel Stanley 	priv->throd_val = config->throd_val;
152bce724faSJoel Stanley 	priv->scan_line_max = config->scan_line_max;
153bce724faSJoel Stanley 
15492614ad5SJoel Stanley 	priv->scu = syscon_regmap_lookup_by_phandle(np, "syscon");
15592614ad5SJoel Stanley 	if (IS_ERR(priv->scu)) {
1564f2a8f58SJoel Stanley 		priv->scu = syscon_regmap_lookup_by_compatible("aspeed,ast2500-scu");
1574f2a8f58SJoel Stanley 		if (IS_ERR(priv->scu)) {
1584f2a8f58SJoel Stanley 			dev_err(&pdev->dev, "failed to find SCU regmap\n");
1594f2a8f58SJoel Stanley 			return PTR_ERR(priv->scu);
1604f2a8f58SJoel Stanley 		}
16192614ad5SJoel Stanley 	}
1624f2a8f58SJoel Stanley 
1634f2a8f58SJoel Stanley 	ret = of_reserved_mem_device_init(drm->dev);
1644f2a8f58SJoel Stanley 	if (ret) {
1654f2a8f58SJoel Stanley 		dev_err(&pdev->dev,
1664f2a8f58SJoel Stanley 			"failed to initialize reserved mem: %d\n", ret);
1674f2a8f58SJoel Stanley 		return ret;
1684f2a8f58SJoel Stanley 	}
1694f2a8f58SJoel Stanley 
1704f2a8f58SJoel Stanley 	ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32));
1714f2a8f58SJoel Stanley 	if (ret) {
1724f2a8f58SJoel Stanley 		dev_err(&pdev->dev, "failed to set DMA mask: %d\n", ret);
1734f2a8f58SJoel Stanley 		return ret;
1744f2a8f58SJoel Stanley 	}
1754f2a8f58SJoel Stanley 
1764f2a8f58SJoel Stanley 	priv->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
1774f2a8f58SJoel Stanley 	if (IS_ERR(priv->rst)) {
1784f2a8f58SJoel Stanley 		dev_err(&pdev->dev,
1794f2a8f58SJoel Stanley 			"missing or invalid reset controller device tree entry");
1804f2a8f58SJoel Stanley 		return PTR_ERR(priv->rst);
1814f2a8f58SJoel Stanley 	}
1824f2a8f58SJoel Stanley 	reset_control_deassert(priv->rst);
1834f2a8f58SJoel Stanley 
1844f2a8f58SJoel Stanley 	priv->clk = devm_clk_get(drm->dev, NULL);
1854f2a8f58SJoel Stanley 	if (IS_ERR(priv->clk)) {
1864f2a8f58SJoel Stanley 		dev_err(&pdev->dev,
1874f2a8f58SJoel Stanley 			"missing or invalid clk device tree entry");
1884f2a8f58SJoel Stanley 		return PTR_ERR(priv->clk);
1894f2a8f58SJoel Stanley 	}
1904f2a8f58SJoel Stanley 	clk_prepare_enable(priv->clk);
1914f2a8f58SJoel Stanley 
1924f2a8f58SJoel Stanley 	/* Sanitize control registers */
1934f2a8f58SJoel Stanley 	writel(0, priv->base + CRT_CTRL1);
1944f2a8f58SJoel Stanley 	writel(0, priv->base + CRT_CTRL2);
1954f2a8f58SJoel Stanley 
196c2c25c1cSDaniel Vetter 	ret = aspeed_gfx_setup_mode_config(drm);
197c2c25c1cSDaniel Vetter 	if (ret < 0)
198c2c25c1cSDaniel Vetter 		return ret;
1994f2a8f58SJoel Stanley 
2004f2a8f58SJoel Stanley 	ret = drm_vblank_init(drm, 1);
2014f2a8f58SJoel Stanley 	if (ret < 0) {
2024f2a8f58SJoel Stanley 		dev_err(drm->dev, "Failed to initialise vblank\n");
2034f2a8f58SJoel Stanley 		return ret;
2044f2a8f58SJoel Stanley 	}
2054f2a8f58SJoel Stanley 
2064f2a8f58SJoel Stanley 	ret = aspeed_gfx_create_output(drm);
2074f2a8f58SJoel Stanley 	if (ret < 0) {
2084f2a8f58SJoel Stanley 		dev_err(drm->dev, "Failed to create outputs\n");
2094f2a8f58SJoel Stanley 		return ret;
2104f2a8f58SJoel Stanley 	}
2114f2a8f58SJoel Stanley 
2124f2a8f58SJoel Stanley 	ret = aspeed_gfx_create_pipe(drm);
2134f2a8f58SJoel Stanley 	if (ret < 0) {
2144f2a8f58SJoel Stanley 		dev_err(drm->dev, "Cannot setup simple display pipe\n");
2154f2a8f58SJoel Stanley 		return ret;
2164f2a8f58SJoel Stanley 	}
2174f2a8f58SJoel Stanley 
2184f2a8f58SJoel Stanley 	ret = devm_request_irq(drm->dev, platform_get_irq(pdev, 0),
2194f2a8f58SJoel Stanley 			       aspeed_gfx_irq_handler, 0, "aspeed gfx", drm);
2204f2a8f58SJoel Stanley 	if (ret < 0) {
2214f2a8f58SJoel Stanley 		dev_err(drm->dev, "Failed to install IRQ handler\n");
2224f2a8f58SJoel Stanley 		return ret;
2234f2a8f58SJoel Stanley 	}
2244f2a8f58SJoel Stanley 
2254f2a8f58SJoel Stanley 	drm_mode_config_reset(drm);
2264f2a8f58SJoel Stanley 
2274f2a8f58SJoel Stanley 	return 0;
2284f2a8f58SJoel Stanley }
2294f2a8f58SJoel Stanley 
2304f2a8f58SJoel Stanley static void aspeed_gfx_unload(struct drm_device *drm)
2314f2a8f58SJoel Stanley {
2324f2a8f58SJoel Stanley 	drm_kms_helper_poll_fini(drm);
2334f2a8f58SJoel Stanley }
2344f2a8f58SJoel Stanley 
2354f2a8f58SJoel Stanley DEFINE_DRM_GEM_CMA_FOPS(fops);
2364f2a8f58SJoel Stanley 
23770a59dd8SDaniel Vetter static const struct drm_driver aspeed_gfx_driver = {
2380424fdafSDaniel Vetter 	.driver_features        = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
239178c7235SThomas Zimmermann 	DRM_GEM_CMA_DRIVER_OPS,
2404f2a8f58SJoel Stanley 	.fops = &fops,
2414f2a8f58SJoel Stanley 	.name = "aspeed-gfx-drm",
2424f2a8f58SJoel Stanley 	.desc = "ASPEED GFX DRM",
2434f2a8f58SJoel Stanley 	.date = "20180319",
2444f2a8f58SJoel Stanley 	.major = 1,
2454f2a8f58SJoel Stanley 	.minor = 0,
2464f2a8f58SJoel Stanley };
2474f2a8f58SJoel Stanley 
248696029ebSJoel Stanley static ssize_t dac_mux_store(struct device *dev, struct device_attribute *attr,
249696029ebSJoel Stanley 			     const char *buf, size_t count)
250696029ebSJoel Stanley {
251696029ebSJoel Stanley 	struct aspeed_gfx *priv = dev_get_drvdata(dev);
252696029ebSJoel Stanley 	u32 val;
253696029ebSJoel Stanley 	int rc;
254696029ebSJoel Stanley 
255696029ebSJoel Stanley 	rc = kstrtou32(buf, 0, &val);
256696029ebSJoel Stanley 	if (rc)
257696029ebSJoel Stanley 		return rc;
258696029ebSJoel Stanley 
259696029ebSJoel Stanley 	if (val > 3)
260696029ebSJoel Stanley 		return -EINVAL;
261696029ebSJoel Stanley 
262bce724faSJoel Stanley 	rc = regmap_update_bits(priv->scu, priv->dac_reg, 0x30000, val << 16);
263696029ebSJoel Stanley 	if (rc < 0)
264696029ebSJoel Stanley 		return 0;
265696029ebSJoel Stanley 
266696029ebSJoel Stanley 	return count;
267696029ebSJoel Stanley }
268696029ebSJoel Stanley 
269696029ebSJoel Stanley static ssize_t dac_mux_show(struct device *dev, struct device_attribute *attr, char *buf)
270696029ebSJoel Stanley {
271696029ebSJoel Stanley 	struct aspeed_gfx *priv = dev_get_drvdata(dev);
272696029ebSJoel Stanley 	u32 reg;
273696029ebSJoel Stanley 	int rc;
274696029ebSJoel Stanley 
275bce724faSJoel Stanley 	rc = regmap_read(priv->scu, priv->dac_reg, &reg);
276696029ebSJoel Stanley 	if (rc)
277696029ebSJoel Stanley 		return rc;
278696029ebSJoel Stanley 
279696029ebSJoel Stanley 	return sprintf(buf, "%u\n", (reg >> 16) & 0x3);
280696029ebSJoel Stanley }
281696029ebSJoel Stanley static DEVICE_ATTR_RW(dac_mux);
282696029ebSJoel Stanley 
283696029ebSJoel Stanley static ssize_t
284696029ebSJoel Stanley vga_pw_show(struct device *dev, struct device_attribute *attr, char *buf)
285696029ebSJoel Stanley {
286696029ebSJoel Stanley 	struct aspeed_gfx *priv = dev_get_drvdata(dev);
287696029ebSJoel Stanley 	u32 reg;
288696029ebSJoel Stanley 	int rc;
289696029ebSJoel Stanley 
290bce724faSJoel Stanley 	rc = regmap_read(priv->scu, priv->vga_scratch_reg, &reg);
291696029ebSJoel Stanley 	if (rc)
292696029ebSJoel Stanley 		return rc;
293696029ebSJoel Stanley 
294*b4a6aaeaSJoel Stanley 	return sprintf(buf, "%u\n", reg);
295696029ebSJoel Stanley }
296696029ebSJoel Stanley static DEVICE_ATTR_RO(vga_pw);
297696029ebSJoel Stanley 
298696029ebSJoel Stanley static struct attribute *aspeed_sysfs_entries[] = {
299696029ebSJoel Stanley 	&dev_attr_vga_pw.attr,
300696029ebSJoel Stanley 	&dev_attr_dac_mux.attr,
301696029ebSJoel Stanley 	NULL,
302696029ebSJoel Stanley };
303696029ebSJoel Stanley 
304696029ebSJoel Stanley static struct attribute_group aspeed_sysfs_attr_group = {
305696029ebSJoel Stanley 	.attrs = aspeed_sysfs_entries,
306696029ebSJoel Stanley };
307696029ebSJoel Stanley 
3084f2a8f58SJoel Stanley static int aspeed_gfx_probe(struct platform_device *pdev)
3094f2a8f58SJoel Stanley {
310cd829454SDaniel Vetter 	struct aspeed_gfx *priv;
3114f2a8f58SJoel Stanley 	int ret;
3124f2a8f58SJoel Stanley 
313cd829454SDaniel Vetter 	priv = devm_drm_dev_alloc(&pdev->dev, &aspeed_gfx_driver,
314cd829454SDaniel Vetter 				  struct aspeed_gfx, drm);
315cd829454SDaniel Vetter 	if (IS_ERR(priv))
316cd829454SDaniel Vetter 		return PTR_ERR(priv);
3174f2a8f58SJoel Stanley 
318cd829454SDaniel Vetter 	ret = aspeed_gfx_load(&priv->drm);
3194f2a8f58SJoel Stanley 	if (ret)
320cd829454SDaniel Vetter 		return ret;
3214f2a8f58SJoel Stanley 
3225dd331d4SJulia Lawall 	platform_set_drvdata(pdev, priv);
323696029ebSJoel Stanley 
324696029ebSJoel Stanley 	ret = sysfs_create_group(&pdev->dev.kobj, &aspeed_sysfs_attr_group);
325696029ebSJoel Stanley 	if (ret)
326696029ebSJoel Stanley 		return ret;
327696029ebSJoel Stanley 
328cd829454SDaniel Vetter 	ret = drm_dev_register(&priv->drm, 0);
3294f2a8f58SJoel Stanley 	if (ret)
3304f2a8f58SJoel Stanley 		goto err_unload;
3314f2a8f58SJoel Stanley 
33222493574SGuenter Roeck 	drm_fbdev_generic_setup(&priv->drm, 32);
3334f2a8f58SJoel Stanley 	return 0;
3344f2a8f58SJoel Stanley 
3354f2a8f58SJoel Stanley err_unload:
336696029ebSJoel Stanley 	sysfs_remove_group(&pdev->dev.kobj, &aspeed_sysfs_attr_group);
337cd829454SDaniel Vetter 	aspeed_gfx_unload(&priv->drm);
3384f2a8f58SJoel Stanley 
3394f2a8f58SJoel Stanley 	return ret;
3404f2a8f58SJoel Stanley }
3414f2a8f58SJoel Stanley 
3424f2a8f58SJoel Stanley static int aspeed_gfx_remove(struct platform_device *pdev)
3434f2a8f58SJoel Stanley {
3444f2a8f58SJoel Stanley 	struct drm_device *drm = platform_get_drvdata(pdev);
3454f2a8f58SJoel Stanley 
346696029ebSJoel Stanley 	sysfs_remove_group(&pdev->dev.kobj, &aspeed_sysfs_attr_group);
3474f2a8f58SJoel Stanley 	drm_dev_unregister(drm);
3484f2a8f58SJoel Stanley 	aspeed_gfx_unload(drm);
3494f2a8f58SJoel Stanley 
3504f2a8f58SJoel Stanley 	return 0;
3514f2a8f58SJoel Stanley }
3524f2a8f58SJoel Stanley 
3534f2a8f58SJoel Stanley static struct platform_driver aspeed_gfx_platform_driver = {
3544f2a8f58SJoel Stanley 	.probe		= aspeed_gfx_probe,
3554f2a8f58SJoel Stanley 	.remove		= aspeed_gfx_remove,
3564f2a8f58SJoel Stanley 	.driver = {
3574f2a8f58SJoel Stanley 		.name = "aspeed_gfx",
3584f2a8f58SJoel Stanley 		.of_match_table = aspeed_gfx_match,
3594f2a8f58SJoel Stanley 	},
3604f2a8f58SJoel Stanley };
3614f2a8f58SJoel Stanley 
3624f2a8f58SJoel Stanley module_platform_driver(aspeed_gfx_platform_driver);
3634f2a8f58SJoel Stanley 
3644f2a8f58SJoel Stanley MODULE_AUTHOR("Joel Stanley <joel@jms.id.au>");
3654f2a8f58SJoel Stanley MODULE_DESCRIPTION("ASPEED BMC DRM/KMS driver");
3664f2a8f58SJoel Stanley MODULE_LICENSE("GPL");
367