aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 932e96b75528..51e0c3958796 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -17,6 +17,8 @@
17 * this program. If not, see <http://www.gnu.org/licenses/>. 17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
20#include <linux/sys_soc.h>
21
20#include <drm/drm_atomic.h> 22#include <drm/drm_atomic.h>
21#include <drm/drm_atomic_helper.h> 23#include <drm/drm_atomic_helper.h>
22#include <drm/drm_crtc_helper.h> 24#include <drm/drm_crtc_helper.h>
@@ -518,9 +520,17 @@ static struct drm_driver omap_drm_driver = {
518 .patchlevel = DRIVER_PATCHLEVEL, 520 .patchlevel = DRIVER_PATCHLEVEL,
519}; 521};
520 522
523static const struct soc_device_attribute omapdrm_soc_devices[] = {
524 { .family = "OMAP3", .data = (void *)0x3430 },
525 { .family = "OMAP4", .data = (void *)0x4430 },
526 { .family = "OMAP5", .data = (void *)0x5430 },
527 { .family = "DRA7", .data = (void *)0x0752 },
528 { /* sentinel */ }
529};
530
521static int pdev_probe(struct platform_device *pdev) 531static int pdev_probe(struct platform_device *pdev)
522{ 532{
523 struct omap_drm_platform_data *pdata = pdev->dev.platform_data; 533 const struct soc_device_attribute *soc;
524 struct omap_drm_private *priv; 534 struct omap_drm_private *priv;
525 struct drm_device *ddev; 535 struct drm_device *ddev;
526 unsigned int i; 536 unsigned int i;
@@ -546,7 +556,8 @@ static int pdev_probe(struct platform_device *pdev)
546 556
547 priv->dispc_ops = dispc_get_ops(); 557 priv->dispc_ops = dispc_get_ops();
548 558
549 priv->omaprev = pdata->omaprev; 559 soc = soc_device_match(omapdrm_soc_devices);
560 priv->omaprev = soc ? (unsigned int)soc->data : 0;
550 priv->wq = alloc_ordered_workqueue("omapdrm", 0); 561 priv->wq = alloc_ordered_workqueue("omapdrm", 0);
551 562
552 spin_lock_init(&priv->list_lock); 563 spin_lock_init(&priv->list_lock);