Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2767585ybv; Mon, 24 Feb 2020 11:13:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyig1ykc8l5Z6G9vMED1mBFUYe5Sj1OLRpDAHq9NhvxG9b7m9UQTnmi6lg0dQ3KxqdjYK9W X-Received: by 2002:aca:cc07:: with SMTP id c7mr413195oig.165.1582571592423; Mon, 24 Feb 2020 11:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582571592; cv=none; d=google.com; s=arc-20160816; b=Xc5kUAMbmYm2Hj5urrHyVGZn880MHl062YdNk66NlWA1Er87sfaksYB1AdRwPNqxNz o2D5xu0qObZVLfqHg89xxvOGVQ6Uz/Nr6Ci5L34pq8q459Q+jT1eqPjWJOgxQlYMZ/wk BUshZKgyhEOmokKFJEGsawZs97EJd63KF0kYyEAztg6rrVe7pAbJxKXnv5h/NB2+m7Yi V6nR8tTrRCzvsRngS+tgILAZcbH1ffyEgWFGA9Gs3fMs+2YHitd/CkTTRThRPCsE5mVw t/uPyAReW1AKI2XecQXqHeuXeAUCzYjGikMfe52pgo2qqXoHAldEuii25OFYz5gFv1Fu qTag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+WknWXOkFFSmeP1G2IK1JGi7Q0pbTKLU8U+c56sFrdk=; b=zeMqXj3ASREP4XE6uD+SMhhw+n1zWFCYKO51q3jaXaKhELJW33xRG1X0AVruw2qISu EC+pK2djsSjKdP/gNO+HeX2Kqe8hAfEMIoRWtZrPmCyoq2yTooM6zYj+9IqtzQP0abRV on1Ts/dIg9l2JpkEVchw9fR/jwePSxn8Gx82Q46IhCTH0mI4M83w4UW12Tx10YIX+rBI 78mwpQ1/50uUU3ZH6jlL2iOHVP8Xi4RXmf1IoifCBEz6S6RWhL57bxnbEsAJXhq5zirz PodcWRRlkeixSAAoQwmh2pbrBVWUXmqpRQzAoAQoFM1QpROLRg7vGk3yfc//kPNmWC8t agng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si5182400oic.7.2020.02.24.11.12.59; Mon, 24 Feb 2020 11:13:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727312AbgBXTMp (ORCPT + 99 others); Mon, 24 Feb 2020 14:12:45 -0500 Received: from muru.com ([72.249.23.125]:57074 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbgBXTMo (ORCPT ); Mon, 24 Feb 2020 14:12:44 -0500 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 7ED158162; Mon, 24 Feb 2020 19:13:27 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: "Andrew F . Davis" , Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Keerthy , Nishanth Menon , Peter Ujfalusi , Roger Quadros , Suman Anna , Tero Kristo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Jyri Sarha , Laurent Pinchart , Tomi Valkeinen Subject: [PATCH 1/3] drm/omap: Prepare DSS for probing without legacy platform data Date: Mon, 24 Feb 2020 11:12:28 -0800 Message-Id: <20200224191230.30972-2-tony@atomide.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200224191230.30972-1-tony@atomide.com> References: <20200224191230.30972-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to probe display subsystem (DSS) components with ti-sysc interconnect target module without legacy platform data and using devicetree, we need to update dss probing a bit. In the device tree, we will be defining the data also for the interconnect target modules as DSS really is a private interconnect. There is some information about that in 4460 TRM in "Figure 10-3. DSS Integration" for example where it mentions "32-bit interconnect (SLX)". The changes we need to make are: 1. Parse also device tree subnodes for the compatible property fixup 2. Update the component code to consider device tree subnodes Cc: dri-devel@lists.freedesktop.org Cc: Jyri Sarha Cc: Laurent Pinchart Cc: Tomi Valkeinen Signed-off-by: Tony Lindgren --- This is needed for dropping DSS platform data that I'll be posting seprately. If this looks OK, can you guys please test and ack? --- drivers/gpu/drm/omapdrm/dss/dss.c | 25 ++++++++++++++++--- .../gpu/drm/omapdrm/dss/omapdss-boot-init.c | 25 +++++++++++++------ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1339,9 +1339,15 @@ static int dss_component_compare(struct device *dev, void *data) return dev == child; } +struct dss_component_match_data { + struct device *dev; + struct component_match **match; +}; + static int dss_add_child_component(struct device *dev, void *data) { - struct component_match **match = data; + struct dss_component_match_data *cmatch = data; + struct component_match **match = cmatch->match; /* * HACK @@ -1352,7 +1358,17 @@ static int dss_add_child_component(struct device *dev, void *data) if (strstr(dev_name(dev), "rfbi")) return 0; - component_match_add(dev->parent, match, dss_component_compare, dev); + /* + * Handle possible interconnect target modules defined within the DSS. + * The DSS components can be children of an interconnect target module + * after the device tree has been updated for the module data. + * See also omapdss_boot_init() for compatible fixup. + */ + if (strstr(dev_name(dev), "target-module")) + return device_for_each_child(dev, cmatch, + dss_add_child_component); + + component_match_add(cmatch->dev, match, dss_component_compare, dev); return 0; } @@ -1395,6 +1411,7 @@ static int dss_probe_hardware(struct dss_device *dss) static int dss_probe(struct platform_device *pdev) { const struct soc_device_attribute *soc; + struct dss_component_match_data cmatch; struct component_match *match = NULL; struct resource *dss_mem; struct dss_device *dss; @@ -1472,7 +1489,9 @@ static int dss_probe(struct platform_device *pdev) omapdss_gather_components(&pdev->dev); - device_for_each_child(&pdev->dev, &match, dss_add_child_component); + cmatch.dev = &pdev->dev; + cmatch.match = &match; + device_for_each_child(&pdev->dev, &cmatch, dss_add_child_component); r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); if (r) diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c --- a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c +++ b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c @@ -183,9 +183,24 @@ static const struct of_device_id omapdss_of_fixups_whitelist[] __initconst = { {}, }; +static void __init omapdss_find_children(struct device_node *np) +{ + struct device_node *child; + + for_each_available_child_of_node(np, child) { + if (!of_find_property(child, "compatible", NULL)) + continue; + + omapdss_walk_device(child, true); + + if (of_device_is_compatible(child, "ti,sysc")) + omapdss_find_children(child); + } +} + static int __init omapdss_boot_init(void) { - struct device_node *dss, *child; + struct device_node *dss; INIT_LIST_HEAD(&dss_conv_list); @@ -195,13 +210,7 @@ static int __init omapdss_boot_init(void) return 0; omapdss_walk_device(dss, true); - - for_each_available_child_of_node(dss, child) { - if (!of_find_property(child, "compatible", NULL)) - continue; - - omapdss_walk_device(child, true); - } + omapdss_find_children(dss); while (!list_empty(&dss_conv_list)) { struct dss_conv_node *n; -- 2.25.1