Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp680559ybm; Fri, 29 May 2020 09:34:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx749D/owadLLphXdeDzVEub/l7LY57Wuxt93aCSjn/Y10/7RcehK698eOGW7zjjoFa0X/J X-Received: by 2002:a17:907:1106:: with SMTP id qu6mr8120008ejb.321.1590770093305; Fri, 29 May 2020 09:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590770093; cv=none; d=google.com; s=arc-20160816; b=FwfyoCxUmcspfKUjIyubJwVT7NoSbGpGwZXIO84Y4JGZ6XE2NinkLN8Myt2Y8FvUmA coEmo/ny2RTJLnJM5vwwUFYJVt2jDCmEi20Kv4tceGnpvbGEp81Qw8Sb/Yo4VHavpE/K 8EJ83lr6RZbwM4vxMbJPoIgwXvCotWOzscVvr8Un8EbMzIdj7+JdsX6PWBQZAYXr90dJ RBV8eX3DjyPBxbgTR0ihAl+BC0BwjikF34VWsVXQKynIaDRzJ8uvJ/BUIW5cOm91BsgM H2w/dXF0WDvdveQzajjFNQJz5SQHzsNz8ZOetxEDa+N6NVQbksQkVDyGWVqqw+NltzcA 0Eig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=4yHPFFntuEb3nqdS26esoxlWGiVCWTYWFfHMdlSGTc4=; b=Baa5OOWeywCXA6mGkIK8cxf1iPhNn3M0hVbYxPkapU1+yqZKANEfb4HQsYSPtDFV4L UfG61jsWIMtJ9pTd7qwR0Kb/bYoqSEEaOAebE+WI1EBGgX+Ei9u27KmxCaXFreJOZAhg q0MGP0l9wRR+NigcKWjZsM2Zr4EkeBrMwRmJuBuo4pOUPJvFGoFCicW+MD2cHh8m0R9H 7RDxnvMuSH2/WkUAq4laPr3+S+vvJ3yTQtLV8xrFFa5cnBv1o74BN0JDgClKMumx6vg8 QjMiIQdE9gqGP+xu3IVGq1EePZcC2hkzMGmR8smNmk9t9ljmyJ571ecNaO9pmQYW0GEe wp6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=l2m0QRhT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si5549631edn.589.2020.05.29.09.34.30; Fri, 29 May 2020 09:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=l2m0QRhT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727847AbgE2Qc3 (ORCPT + 99 others); Fri, 29 May 2020 12:32:29 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33786 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbgE2Qc1 (ORCPT ); Fri, 29 May 2020 12:32:27 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200529163226euoutp0280c54b3d1a4aa5b764217c6f1a5c8c1f~TjNZyQfFQ1718417184euoutp02E for ; Fri, 29 May 2020 16:32:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200529163226euoutp0280c54b3d1a4aa5b764217c6f1a5c8c1f~TjNZyQfFQ1718417184euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590769946; bh=4yHPFFntuEb3nqdS26esoxlWGiVCWTYWFfHMdlSGTc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l2m0QRhTsLRTRoGq/hSbPwoUHV8v7rOTqdVRGHTfSHwakmOJPJF6OKt9A9rdP28mh 7sDiATzbfh1vgEv6fyQNDqioASOlqdHtpHPHZDGKWJe01zduWMBiHt//zvhQndg1NW k6KKLDkk/2fjUuxlGVqSSD88PZWu4F5E88/y4JHI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200529163225eucas1p26f9ed0a9bba89af44330590464ecaf22~TjNZioWjP2034120341eucas1p2a; Fri, 29 May 2020 16:32:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 22.10.60698.91931DE5; Fri, 29 May 2020 17:32:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200529163225eucas1p1cfb2233c869dcc3dab84b754bbce17b6~TjNY_DsPp0538605386eucas1p19; Fri, 29 May 2020 16:32:25 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200529163225eusmtrp24476b6ce41f7cd45a5cd27093fde5b6e~TjNY9Xsq00733307333eusmtrp2S; Fri, 29 May 2020 16:32:25 +0000 (GMT) X-AuditID: cbfec7f5-a29ff7000001ed1a-24-5ed13919443d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 80.EA.08375.81931DE5; Fri, 29 May 2020 17:32:25 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200529163224eusmtip1863c4173d5ee60d8ab32a320efd09ffb~TjNYL-qhR1819818198eusmtip1U; Fri, 29 May 2020 16:32:24 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, s.nawrocki@samsung.com, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v5 3/6] PM / devfreq: exynos-bus: Add registration of interconnect child device Date: Fri, 29 May 2020 18:31:57 +0200 Message-Id: <20200529163200.18031-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200529163200.18031-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEKsWRmVeSWpSXmKPExsWy7djPc7qSlhfjDA7t1rK4P6+V0WLjjPWs Fte/PGe1uPL1PZvF9L2b2Cwm3Z/AYnH+/AZ2i02Pr7FaXN41h81ixvl9TBZrj9xlt7jduILN 4vCbdlaLGZNfsjnweWxa1cnmcefaHjaP+93HmTw2L6n36NuyitHj8ya5ALYoLpuU1JzMstQi fbsEroyjh10LNgpU3Dg/ka2BcSNvFyMnh4SAicT/009YQWwhgRWMEn+eOnQxcgHZX4Ds3bvZ IZzPjBJP9u1nhumY8fA3I0RiOaPEu7ev2eFaunq/sYFUsQkYSvQe7WMEsUUEXCTans5jASli FtjDJLFv9jsgh4NDWCBV4vqMfJAaFgFVie6Hi1lAbF4Ba4knG9+zQGyTl1i94QDYZk4BG4nu PzOYQeZICKxjl1h57jdUkYvEjRUb2SBsYYlXx7ewQ9gyEv93zmeCaGhmlOjZfZsdwpnAKHH/ +AJGiCpriTvnfrGBXMQsoCmxfpc+RNhR4srv5WBhCQE+iRtvBUHCzEDmpG3TmSHCvB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j4wNvNK4g1NDc0tLA3Njc2NzSyUxHk7BA7G CAmkJ5akZqemFqQWwfQxcXBKNTD67lHZbHzuVPgT61gXlUjdwENHpYNu3JxtXjGfw8XgZvbU dXnOv5S/TVXcVLTJ1Fv3ikz49m+Zd9ssshRm2jp977xv2Zkl37FXX/fFi3llQX9nV7uLFe3m 1+n90PT4tsLFRb7fLKRWRvovuLemZL7pwde+s6rjNthkb+Nr1fv17LHUVE8f909KLMUZiYZa zEXFiQBANR3LlQIAAA== X-CMS-MailID: 20200529163225eucas1p1cfb2233c869dcc3dab84b754bbce17b6 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200529163225eucas1p1cfb2233c869dcc3dab84b754bbce17b6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200529163225eucas1p1cfb2233c869dcc3dab84b754bbce17b6 References: <20200529163200.18031-1-s.nawrocki@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds registration of a child platform device for the exynos interconnect driver. It is assumed that the interconnect provider will only be needed when #interconnect-cells property is present in the bus DT node, hence the child device will be created only when such a property is present. Signed-off-by: Sylwester Nawrocki Changes for v5: - new patch. --- drivers/devfreq/exynos-bus.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 8fa8eb5..856e37d 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -24,6 +24,7 @@ struct exynos_bus { struct device *dev; + struct platform_device *icc_pdev; struct devfreq *devfreq; struct devfreq_event_dev **edev; @@ -156,6 +157,8 @@ static void exynos_bus_exit(struct device *dev) if (ret < 0) dev_warn(dev, "failed to disable the devfreq-event devices\n"); + platform_device_unregister(bus->icc_pdev); + dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); if (bus->opp_table) { @@ -168,6 +171,8 @@ static void exynos_bus_passive_exit(struct device *dev) { struct exynos_bus *bus = dev_get_drvdata(dev); + platform_device_unregister(bus->icc_pdev); + dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); } @@ -431,6 +436,18 @@ static int exynos_bus_probe(struct platform_device *pdev) if (ret < 0) goto err; + /* Create child platform device for the interconnect provider */ + if (of_get_property(dev->of_node, "#interconnect-cells", NULL)) { + bus->icc_pdev = platform_device_register_data( + dev, "exynos-generic-icc", + PLATFORM_DEVID_AUTO, NULL, 0); + + if (IS_ERR(bus->icc_pdev)) { + ret = PTR_ERR(bus->icc_pdev); + goto err; + } + } + max_state = bus->devfreq->profile->max_state; min_freq = (bus->devfreq->profile->freq_table[0] / 1000); max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000); -- 2.7.4