From patchwork Mon May 8 11:32:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9716037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D68F60364 for ; Mon, 8 May 2017 11:34:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 231AC26530 for ; Mon, 8 May 2017 11:34:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17FC826861; Mon, 8 May 2017 11:34:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C0AD826530 for ; Mon, 8 May 2017 11:34:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A493A6E242; Mon, 8 May 2017 11:33:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from galahad.ideasonboard.com (galahad.ideasonboard.com [IPv6:2001:4b98:dc2:45:216:3eff:febb:480d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E6276E233 for ; Mon, 8 May 2017 11:33:20 +0000 (UTC) Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 07CD921474; Mon, 8 May 2017 13:32:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1494243130; bh=HmbmghP7hcSVmPG8bhBzrZXmen3KNWJQl5lphpDYz5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8BGNGEIlbefylk1lj02aGfJTXaFUJEs1sy7xwe98B/brl4PxpJSXfiNryx6a5xMr yL51Xrjp+ClPvn2iFU81rzN5dMpXQ1uQPkgwtz7xOGj1qXACd8AdIihYsoFXTqaISb 3vcMiyaUHoSvkngwUhf5eOEiE+NXoPWFWESbd7tc= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 13/28] drm: omapdrm: dss: Initialize DSS internal features at probe time Date: Mon, 8 May 2017 14:32:48 +0300 Message-Id: <20170508113303.27521-14-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170508113303.27521-1-laurent.pinchart@ideasonboard.com> References: <20170508113303.27521-1-laurent.pinchart@ideasonboard.com> Cc: Tomi Valkeinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The DSS internal features are derived from the platform device compatible string which is available at probe time. Don't delay initialization until bind time. This prepares for the merge of the two DSS features structures that will be needed before the DSS is bound. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/dss/dss.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 7546ba8ab955..4fdb77dd90b8 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1183,23 +1183,10 @@ static const struct soc_device_attribute dss_soc_devices[] = { static int dss_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); - const struct soc_device_attribute *soc; struct resource *dss_mem; u32 rev; int r; - dss.pdev = pdev; - - /* - * The various OMAP3-based SoCs can be told apart from the compatible - * string, use SoC device matching. - */ - soc = soc_device_match(dss_soc_devices); - if (soc) - dss.feat = soc->data; - else - dss.feat = of_match_device(dss_of_match, &pdev->dev)->data; - dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0); dss.base = devm_ioremap_resource(&pdev->dev, dss_mem); if (!dss.base) @@ -1331,9 +1318,22 @@ static int dss_add_child_component(struct device *dev, void *data) static int dss_probe(struct platform_device *pdev) { + const struct soc_device_attribute *soc; struct component_match *match = NULL; int r; + dss.pdev = pdev; + + /* + * The various OMAP3-based SoCs can be told apart from the compatible + * string, use SoC device matching. + */ + soc = soc_device_match(dss_soc_devices); + if (soc) + dss.feat = soc->data; + else + dss.feat = of_match_device(dss_of_match, &pdev->dev)->data; + /* add all the child devices as components */ device_for_each_child(&pdev->dev, &match, dss_add_child_component);