From patchwork Mon Sep 1 12:19:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4818841 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 694649F314 for ; Mon, 1 Sep 2014 12:19:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16A7620170 for ; Mon, 1 Sep 2014 12:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 756EF2015E for ; Mon, 1 Sep 2014 12:19:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753065AbaIAMTz (ORCPT ); Mon, 1 Sep 2014 08:19:55 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:26605 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752311AbaIAMTz (ORCPT ); Mon, 1 Sep 2014 08:19:55 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NB8001R4294N010@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Mon, 01 Sep 2014 21:19:53 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id D3.8E.04049.86464045; Mon, 01 Sep 2014 21:19:52 +0900 (KST) X-AuditID: cbfee68e-f79536d000000fd1-8f-54046468e648 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 56.CD.04943.86464045; Mon, 01 Sep 2014 21:19:52 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NB8008IB294V2C0@mmp2.samsung.com>; Mon, 01 Sep 2014 21:19:52 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, linux-samsung-soc@vger.kernel.org, linux@arm.linux.org.uk, Inki Dae Subject: [PATCH] drm/exynos: update to use component match support Date: Mon, 01 Sep 2014 21:19:52 +0900 Message-id: <1409573992-19721-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsWyRsSkSDcjhSXEYPd9K4vecyeZLK58fc9m Men+BBaLGef3MVncvszrwOrR0tzD5rH92wNWj/vdx5k8+rasYvT4vEkugDWKyyYlNSezLLVI 3y6BK2P2xQ9MBetlKiZ++cbUwNgl3sXIySEhYCJx8sUqJghbTOLCvfVsXYxcHEICSxklGg58 YIEp2v3zNAtEYjqjxL9XW5ggnG4miY8Td7KBVLEJqEpMXHEfzBYRUJb4O3EVI4jNLFAk8XzJ EjBbWMBJ4vnOOawgNgtQ/YrmLrANvAIuEp+v7WbvYuQA2qYgMWeSDch8CYH3bBKNa/exQ9QL SHybfIgFokZWYtMBZojjJCUOrrjBMoFRcAEjwypG0dSC5ILipPQiI73ixNzi0rx0veT83E2M wAA9/e9Z3w7GmwesDzEKcDAq8fA+mMUcIsSaWFZcmXuI0RRow0RmKdHkfGAc5JXEGxqbGVmY mpgaG5lbmimJ8yZI/QwWEkhPLEnNTk0tSC2KLyrNSS0+xMjEwSnVwFikKVxb65p1RPZV8qJZ yxt+3mD3y3wffOdXIcMsF22O1OJ5lxdMyOw9qZuomhXskfx3wc2MdM4nrapfLi0/zvj/3MtV Ql2VWVYeT+Yn1n34/jv37NebaTN4ZBcuYfnF8TTOUl72za3n50PaTP4U2Z2ryGvYVxZuzF0j vIRj8VeO/y3hbGctnymxFGckGmoxFxUnAgBoiqECSwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42I5/e+xoG5GCkuIweNTRha9504yWVz5+p7N YtL9CSwWM87vY7K4fZnXgdWjpbmHzWP7twesHve7jzN59G1ZxejxeZNcAGtUA6NNRmpiSmqR Qmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+ArltmDtByJYWyxJxSoFBAYnGx kr4dpgmhIW66FjCNEbq+IUFwPUYGaCBhDWPG7IsfmArWy1RM/PKNqYGxS7yLkZNDQsBEYvfP 0ywQtpjEhXvr2boYuTiEBKYzSvx7tYUJwulmkvg4cScbSBWbgKrExBX3wWwRAWWJvxNXMYLY zAJFEs+XLAGzhQWcJJ7vnMMKYrMA1a9o7gLbwCvgIvH52m72LkYOoG0KEnMm2Uxg5F7AyLCK UTS1ILmgOCk911CvODG3uDQvXS85P3cTIzj8n0ntYFzZYHGIUYCDUYmH98Es5hAh1sSy4src Q4wSHMxKIrwHk1hChHhTEiurUovy44tKc1KLDzGaAi2fyCwlmpwPjM28knhDYxMzI0sjc0ML I2NzJXHeA63WgUIC6YklqdmpqQWpRTB9TBycUg2M1r3Vf+9dDOJsdj5u5fvOQOz7io0XNkoo 6iU7fBJ2eHpy9r2HO+bkeW5rMpZz+r2vMjnF6OZS0WWHVq87fu6f6K7rr1VTrxi8Oxy0rqpw x7OvM1WrY8OOx1xkmdIZ1KByzH3Fo9rfp+MOym1cO/lK42W396/sJDO2hEZV9J1/ra9yWSFW bv71n0osxRmJhlrMRcWJABxLMDyVAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update Exynos's DRM driver to use component match support rater than add_components. Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 40 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index feee991..dae62c2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -503,16 +503,15 @@ static int compare_of(struct device *dev, void *data) return dev == (struct device *)data; } -static int exynos_drm_add_components(struct device *dev, struct master *m) +static struct component_match *exynos_drm_match_add(struct device *dev) { + struct component_match *match = NULL; struct component_dev *cdev; unsigned int attach_cnt = 0; mutex_lock(&drm_component_lock); list_for_each_entry(cdev, &drm_component_list, list) { - int ret; - /* * Add components to master only in case that crtc and * encoder/connector device objects exist. @@ -527,16 +526,10 @@ static int exynos_drm_add_components(struct device *dev, struct master *m) /* * fimd and dpi modules have same device object so add * only crtc device object in this case. - * - * TODO. if dpi module follows driver-model driver then - * below codes can be removed. */ if (cdev->crtc_dev == cdev->conn_dev) { - ret = component_master_add_child(m, compare_of, - cdev->crtc_dev); - if (ret < 0) - return ret; - + component_match_add(dev, &match, compare_of, + cdev->crtc_dev); goto out_lock; } @@ -546,11 +539,8 @@ static int exynos_drm_add_components(struct device *dev, struct master *m) * connector/encoder need pipe number of crtc when they * are created. */ - ret = component_master_add_child(m, compare_of, cdev->crtc_dev); - ret |= component_master_add_child(m, compare_of, - cdev->conn_dev); - if (ret < 0) - return ret; + component_match_add(dev, &match, compare_of, cdev->crtc_dev); + component_match_add(dev, &match, compare_of, cdev->conn_dev); out_lock: mutex_lock(&drm_component_lock); @@ -558,7 +548,7 @@ out_lock: mutex_unlock(&drm_component_lock); - return attach_cnt ? 0 : -ENODEV; + return attach_cnt ? match : ERR_PTR(-EPROBE_DEFER); } static int exynos_drm_bind(struct device *dev) @@ -572,13 +562,13 @@ static void exynos_drm_unbind(struct device *dev) } static const struct component_master_ops exynos_drm_ops = { - .add_components = exynos_drm_add_components, .bind = exynos_drm_bind, .unbind = exynos_drm_unbind, }; static int exynos_drm_platform_probe(struct platform_device *pdev) { + struct component_match *match; int ret; pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); @@ -645,13 +635,19 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) goto err_unregister_ipp_drv; #endif - ret = component_master_add(&pdev->dev, &exynos_drm_ops); - if (ret < 0) - DRM_DEBUG_KMS("re-tried by last sub driver probed later.\n"); + match = exynos_drm_match_add(&pdev->dev); + if (IS_ERR(match)) { + ret = PTR_ERR(match); + goto err_unregister_ipp_dev; + } - return 0; + return component_master_add_with_match(&pdev->dev, &exynos_drm_ops, + match); + +err_unregister_ipp_dev: #ifdef CONFIG_DRM_EXYNOS_IPP + exynos_platform_device_ipp_unregister(); err_unregister_ipp_drv: platform_driver_unregister(&ipp_driver); err_unregister_gsc_drv: