From patchwork Thu Sep 19 14:22:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8959B1745 for ; Thu, 19 Sep 2019 14:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58D52222C0 for ; Thu, 19 Sep 2019 14:24:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="uUfGFo9Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389065AbfISOYh (ORCPT ); Thu, 19 Sep 2019 10:24:37 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46456 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390479AbfISOXZ (ORCPT ); Thu, 19 Sep 2019 10:23:25 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142323euoutp0112b99908ad1acc0ce2cdc8738e040b21~F3Pgu5HYC2191721917euoutp01C for ; Thu, 19 Sep 2019 14:23:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142323euoutp0112b99908ad1acc0ce2cdc8738e040b21~F3Pgu5HYC2191721917euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903003; bh=AfthMmM6EgHw5o7aJ+tOGSYwkpSBVAIvY47THmRlg88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUfGFo9QIDKkubnSJ5/YQMuqyznHJ0n2dRX/MpysB1HAGdhN3OKccdnTnPzSW9fSZ J5fPYC2ZcGw7ZI64nfB9qI8jSm3P2GAaP7jp36X9AS8qDPF7pTBcLclVExcA4JCo0N e8IxiOhUBw/Jb4QzH73svIjcl6ty2FYF/QGKl2gE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142323eucas1p2137d5fd4ba615c27d374c78200548f67~F3PgKgjez2883328833eucas1p2u; Thu, 19 Sep 2019 14:23:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id C2.0C.04469.A5F838D5; Thu, 19 Sep 2019 15:23:22 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142322eucas1p24bc477ee6e1bcd65546c305d55af097d~F3PfLq4zH3081130811eucas1p2n; Thu, 19 Sep 2019 14:23:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142321eusmtrp19477a6779bcf10be72c5ec00a5f107ab~F3Pe881yZ0555105551eusmtrp1K; Thu, 19 Sep 2019 14:23:21 +0000 (GMT) X-AuditID: cbfec7f2-54fff70000001175-f8-5d838f5a4ad8 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7C.55.04117.95F838D5; Thu, 19 Sep 2019 15:23:21 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142320eusmtip13d096101d63cf3d7c53334a2bda52896~F3PeLg9Oy3274232742eusmtip1o; Thu, 19 Sep 2019 14:23:20 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 01/11] devfreq: exynos-bus: Extract exynos_bus_profile_init() Date: Thu, 19 Sep 2019 16:22:26 +0200 Message-Id: <20190919142236.4071-2-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRjuO7cdV7PjFHqzMlv4o8gbZHxRSULUiUAUoh+G1CkPJs0LO9r1 R1MzvKSWVs5LKhVeE+fU0OWl1nJY5LJsKWmrLCKxrNQuUNLmMerf87zP5f1e+FhS/ZL2ZROS UkVdkqDVMErqVt9Pe2BMYWZsyP3fgdjS167AzsoshFsMzTR+PvOexlXWARoPzU4xuKTbxOAi 5wUK2+1GBa4b+0Jj07iDxk/NFQyezrcibLD3ELjJOqbAL9LrGGwo/sBs9+JNDTkMP+roYnhn no3gW2+c4Vs+dRD83U9dBF/Q1oD4aZNfFBuj3BonahOOibrg8IPKI/2frUzKo1UnMh7r9Cgf cpEHC9xGuDL3hMhFSlbN1SG4NFFDy2QGwfD1MiSTaQQj7U3M30hvr3EhUoug+Gbpv0i/YWze xXARUHT5lcIt+HBWl6t6inITkrtBQEG5nXS7vLl9MGgw0m5McQFQP3ptfq7iMLTrnbS8bzU0 Gu/Mzz24zTDTU0XJHi/oL307j0mXJ7O9nHQvAC6dhecVJS6BdZEdMNm4W+7xhglbm0LGK+Fh 8XlKxhK863TSclaPwFRjJWVhC9yzDdLuHpJbB83mYHkcAfVvvhByvScMf/SSn+AJRbdKSHms guxzah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RoCvTaRGYp0eR8YHLJK4k3NDU0t7A0NDc2Nzaz UBLn7RA4GCMkkJ5YkpqdmlqQWgTTx8TBKdXAKDU1pS1X2W9/TrVQ08wHC3fc6pab5hYQuFj3 Wp1Z86sfj0Prn4SfWa+7/LFjjT2PSdnsdl7luSvf7Go+8zPDl+cB/8ff15+6vQqbMdHjVCHX jcSkkpdTexarclbvzJ30S/GD8Y8qG7+0X9MXmj36rBfwjvWuy7aHiZ3cd/88al84ZUrc9rNH xJRYijMSDbWYi4oTAbT4Bh32AgAA X-CMS-MailID: 20190919142322eucas1p24bc477ee6e1bcd65546c305d55af097d X-Msg-Generator: CA X-RootMTR: 20190919142322eucas1p24bc477ee6e1bcd65546c305d55af097d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142322eucas1p24bc477ee6e1bcd65546c305d55af097d References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch adds a new static function, exynos_bus_profile_init(), extracted from exynos_bus_probe(). Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 92 +++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 29f422469960..78f38b7fb596 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -287,12 +287,62 @@ static int exynos_bus_parse_of(struct device_node *np, return ret; } +static int exynos_bus_profile_init(struct exynos_bus *bus, + struct devfreq_dev_profile *profile) +{ + struct device *dev = bus->dev; + struct devfreq_simple_ondemand_data *ondemand_data; + int ret; + + /* Initialize the struct profile and governor data for parent device */ + profile->polling_ms = 50; + profile->target = exynos_bus_target; + profile->get_dev_status = exynos_bus_get_dev_status; + profile->exit = exynos_bus_exit; + + ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); + if (!ondemand_data) { + ret = -ENOMEM; + goto err; + } + ondemand_data->upthreshold = 40; + ondemand_data->downdifferential = 5; + + /* Add devfreq device to monitor and handle the exynos bus */ + bus->devfreq = devm_devfreq_add_device(dev, profile, + DEVFREQ_GOV_SIMPLE_ONDEMAND, + ondemand_data); + if (IS_ERR(bus->devfreq)) { + dev_err(dev, "failed to add devfreq device\n"); + ret = PTR_ERR(bus->devfreq); + goto err; + } + + /* + * Enable devfreq-event to get raw data which is used to determine + * current bus load. + */ + ret = exynos_bus_enable_edev(bus); + if (ret < 0) { + dev_err(dev, "failed to enable devfreq-event devices\n"); + goto err; + } + + ret = exynos_bus_set_event(bus); + if (ret < 0) { + dev_err(dev, "failed to set event to devfreq-event devices\n"); + goto err; + } + +err: + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node, *node; struct devfreq_dev_profile *profile; - struct devfreq_simple_ondemand_data *ondemand_data; struct devfreq_passive_data *passive_data; struct devfreq *parent_devfreq; struct exynos_bus *bus; @@ -334,45 +384,9 @@ static int exynos_bus_probe(struct platform_device *pdev) if (passive) goto passive; - /* Initialize the struct profile and governor data for parent device */ - profile->polling_ms = 50; - profile->target = exynos_bus_target; - profile->get_dev_status = exynos_bus_get_dev_status; - profile->exit = exynos_bus_exit; - - ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); - if (!ondemand_data) { - ret = -ENOMEM; + ret = exynos_bus_profile_init(bus, profile); + if (ret < 0) goto err; - } - ondemand_data->upthreshold = 40; - ondemand_data->downdifferential = 5; - - /* Add devfreq device to monitor and handle the exynos bus */ - bus->devfreq = devm_devfreq_add_device(dev, profile, - DEVFREQ_GOV_SIMPLE_ONDEMAND, - ondemand_data); - if (IS_ERR(bus->devfreq)) { - dev_err(dev, "failed to add devfreq device\n"); - ret = PTR_ERR(bus->devfreq); - goto err; - } - - /* - * Enable devfreq-event to get raw data which is used to determine - * current bus load. - */ - ret = exynos_bus_enable_edev(bus); - if (ret < 0) { - dev_err(dev, "failed to enable devfreq-event devices\n"); - goto err; - } - - ret = exynos_bus_set_event(bus); - if (ret < 0) { - dev_err(dev, "failed to set event to devfreq-event devices\n"); - goto err; - } goto out; passive: From patchwork Thu Sep 19 14:22:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152643 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0B0D14ED for ; Thu, 19 Sep 2019 14:24:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7ED2121927 for ; Thu, 19 Sep 2019 14:24:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="C6T3JoXr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390516AbfISOX1 (ORCPT ); Thu, 19 Sep 2019 10:23:27 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46488 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390499AbfISOX1 (ORCPT ); Thu, 19 Sep 2019 10:23:27 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142324euoutp01c5d8759c7a7acfaceb23f1028ebbe24f~F3PhiSf-42200122001euoutp01z for ; Thu, 19 Sep 2019 14:23:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142324euoutp01c5d8759c7a7acfaceb23f1028ebbe24f~F3PhiSf-42200122001euoutp01z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903004; bh=g5BuchGjulmMrqHu7UnNWSPjw3PX42w6jYwlR2z1Rfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6T3JoXrmDr315AUzTCkwRr7TLrJk/JzHE+8ZjeINxyUxVi2O3ZZ/XdmhsTqX8rNd /fmKEK8gLqTdUqzVIGBIl4F+bdYD62cdJhcJ6BjlPXP+qFaYDEvD/tZMSIRqz++CCs db6LidNrZM+h7Mcai8dEX++P5K4TggX6kGGw8JTA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190919142323eucas1p19985294982f8a206d190447d9d111ac6~F3Pgvj2m30292702927eucas1p17; Thu, 19 Sep 2019 14:23:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 54.0C.04469.B5F838D5; Thu, 19 Sep 2019 15:23:23 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190919142322eucas1p1949ad95468af26698c4c5addc060ce00~F3Pf9116O1888018880eucas1p18; Thu, 19 Sep 2019 14:23:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142322eusmtrp1d6241a1800bd62d08a28d8a886482408~F3Pfuxx9k0555105551eusmtrp1N; Thu, 19 Sep 2019 14:23:22 +0000 (GMT) X-AuditID: cbfec7f2-994db9c000001175-fe-5d838f5b4888 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3E.55.04117.A5F838D5; Thu, 19 Sep 2019 15:23:22 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142321eusmtip1ddb6ff07278fac49544b852180531b8e~F3Pe9szH-3161631616eusmtip1b; Thu, 19 Sep 2019 14:23:21 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 02/11] devfreq: exynos-bus: Extract exynos_bus_profile_init_passive() Date: Thu, 19 Sep 2019 16:22:27 +0200 Message-Id: <20190919142236.4071-3-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SeyyVYRjv/W7nI0efo+aJppytNjZKsd6GRqv1ra3Lam2NoVO+0XLrfC6V LbdpkVRouYWW5TbDQSFUpxM144RSQsdWVsllrslWy/FR/vu9v8vze57tZUnFJ9qaPRcaIahD VcFKxpR61PpL7+hzM9F3x1QhYG1rnQwb8pMQrs6qpPH7ma80LtB10vjt7ASD7zZrGJxuuEVh vb5KhksGJ2ms+dxL457GPAZP39AhnKVvIXCFblCG++NLGJyV8Z3xtOA1ZckMP9DbxPCG620E X1MUy1eP1xP88/Emgk+rLUP8tMb2GOtt6h4gBJ+LEtTb9542DfrWMUKGP914MX7qFRGH4jek IBMWOBcY+FNBGrGCK0HQ0rM2BZku4hkET2pGGekxjeBFwzy1kpjrf0pLQjGCx8WV1L/Iz/xy xuhiOC9IvzMkMwrrOR2CjMKJJRfJFRGQlqtfarTk/GD2Rx+RgliW4rZCwjs7Iy3nMJSPliKp bjOUVz1bsptwe2CmpYCSPB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BJmBmpt3jqbeQKj4CwkVbMQqmYhqVrAyLyK USS1tDg3PbfYSK84Mbe4NC9dLzk/dxMjMIK3Hfu5ZQdj17vgQ4wCHIxKPLwK5c2xQqyJZcWV uYcYJTiYlUR455g2xQrxpiRWVqUW5ccXleakFh9iNAX6bCKzlGhyPjC55JXEG5oamltYGpob mxubWSiJ83YIHIwREkhPLEnNTk0tSC2C6WPi4JRqYFQQ3u1sNGGxUdVs5eNLNj8Wrwn++TTk ztZJsl3VRzPeFNxm9f1xOvy4vlRqa94erpXiiftLN0ds27b8yIP2K4727O5pWW1/rvxPnSs8 49ICKx/VOyrHJrAIpnNbiv/5KHArllGX/bPfPc1+Obbgqqs+3//lfPhbysPncXk7w3Rvb6fH O5N1m5VYijMSDbWYi4oTATIk7Rz2AgAA X-CMS-MailID: 20190919142322eucas1p1949ad95468af26698c4c5addc060ce00 X-Msg-Generator: CA X-RootMTR: 20190919142322eucas1p1949ad95468af26698c4c5addc060ce00 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142322eucas1p1949ad95468af26698c4c5addc060ce00 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch adds a new static function, exynos_bus_profile_init_passive(), extracted from exynos_bus_probe(). Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 70 +++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 78f38b7fb596..f85bed241631 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -338,13 +338,51 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, return ret; } +static int exynos_bus_profile_init_passive(struct exynos_bus *bus, + struct devfreq_dev_profile *profile) +{ + struct device *dev = bus->dev; + struct devfreq_passive_data *passive_data; + struct devfreq *parent_devfreq; + int ret = 0; + + /* Initialize the struct profile and governor data for passive device */ + profile->target = exynos_bus_target; + profile->exit = exynos_bus_passive_exit; + + /* Get the instance of parent devfreq device */ + parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); + if (IS_ERR(parent_devfreq)) { + ret = -EPROBE_DEFER; + goto err; + } + + passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); + if (!passive_data) { + ret = -ENOMEM; + goto err; + } + passive_data->parent = parent_devfreq; + + /* Add devfreq device for exynos bus with passive governor */ + bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, + passive_data); + if (IS_ERR(bus->devfreq)) { + dev_err(dev, + "failed to add devfreq dev with passive governor\n"); + ret = PTR_ERR(bus->devfreq); + goto err; + } + +err: + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node, *node; struct devfreq_dev_profile *profile; - struct devfreq_passive_data *passive_data; - struct devfreq *parent_devfreq; struct exynos_bus *bus; int ret, max_state; unsigned long min_freq, max_freq; @@ -390,33 +428,9 @@ static int exynos_bus_probe(struct platform_device *pdev) goto out; passive: - /* Initialize the struct profile and governor data for passive device */ - profile->target = exynos_bus_target; - profile->exit = exynos_bus_passive_exit; - - /* Get the instance of parent devfreq device */ - parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); - if (IS_ERR(parent_devfreq)) { - ret = -EPROBE_DEFER; + ret = exynos_bus_profile_init_passive(bus, profile); + if (ret < 0) goto err; - } - - passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); - if (!passive_data) { - ret = -ENOMEM; - goto err; - } - passive_data->parent = parent_devfreq; - - /* Add devfreq device for exynos bus with passive governor */ - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, - passive_data); - if (IS_ERR(bus->devfreq)) { - dev_err(dev, - "failed to add devfreq dev with passive governor\n"); - ret = PTR_ERR(bus->devfreq); - goto err; - } out: max_state = bus->devfreq->profile->max_state; From patchwork Thu Sep 19 14:22:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5195B1747 for ; Thu, 19 Sep 2019 14:24:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 253EB218AF for ; Thu, 19 Sep 2019 14:24:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="otKnG8UD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390523AbfISOX1 (ORCPT ); Thu, 19 Sep 2019 10:23:27 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:53429 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390503AbfISOX0 (ORCPT ); Thu, 19 Sep 2019 10:23:26 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142325euoutp02e1b7f4d62f997b3388f373e8e990458a~F3PiXPfG21748917489euoutp02G for ; Thu, 19 Sep 2019 14:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190919142325euoutp02e1b7f4d62f997b3388f373e8e990458a~F3PiXPfG21748917489euoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903005; bh=9vBjzZ8WEuvpoJoW1P0oRATI3VJ/Xiwt0zbgAf9dLLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=otKnG8UDxVe3aVHAwOIivSEkiKqULW6U8Tsh8VzfzDcuu9j5ZR5EqwubCZ0SOz0mF deGwxb0BMfEe14kPkAYgI9UK4uAeQWYH+TSoSF1J9zKKy4xAu0j992L7W4K5KWyxX+ 4Q0wyoE7/ELJfjja2IXbPVWASXg+BJiPpyVPovjs= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142324eucas1p2c6dcf28205c412e8ae407490ef04a781~F3Phm-q8v2469924699eucas1p2I; Thu, 19 Sep 2019 14:23:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 9E.59.04374.C5F838D5; Thu, 19 Sep 2019 15:23:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142323eucas1p2fc73a765389432f880fa28945fd28975~F3Pgz1CDa3081730817eucas1p2n; Thu, 19 Sep 2019 14:23:23 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190919142323eusmtrp20894d9aa07c91aa87c9b5ad91c68b53b~F3Pglrtp-3074530745eusmtrp2c; Thu, 19 Sep 2019 14:23:23 +0000 (GMT) X-AuditID: cbfec7f5-92d689c000001116-f9-5d838f5c29a2 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DF.0F.04166.B5F838D5; Thu, 19 Sep 2019 15:23:23 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142322eusmtip13d904712bb324cac14c4bb82ec7db1dc~F3PfwIqp63226332263eusmtip1A; Thu, 19 Sep 2019 14:23:22 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 03/11] devfreq: exynos-bus: Change goto-based logic to if-else logic Date: Thu, 19 Sep 2019 16:22:28 +0200 Message-Id: <20190919142236.4071-4-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SWUwTURSGvZ3OdGgsGQqEAxKXRh5Ewd1clBiJmkzkxcSEB7WRKiOgbOmw iIaILC6oqKCBFhAkFRBEsSyBimxWNpHaICgBhARU1AhRqEZDQMoU5e079/z/OedPLk3Ih0g3 OjQimlNHqMIUlFRc0/rb5HX0RrJyU1OKM25prZbg4bupCD/Jfkzit9OfSJxv7CbxG8skhbOe 6SmcMXxTjE2mCgkuGfpOYv1oH4l7DLkUnrpuRDjb1CDC5cYhCR64UELh7MzP1B4HVl96hWIH ++opdvhqm4it1J1nn0zUitjmiXoRm15Vitgp/cqD9GGpbxAXFhrLqTfuDpSGdGrLJFFF0jON pm6UiLLoNGRHA7MNxscqqTQkpeVMCYKp1lkkFNMIbnXVkEIxhSD/dz9atMxYLDZLMYJL1wqp f5bRvFSxVUUxfpBxZ0RibTgxRgSZBZNia0EwOhGk55iINETTjowSfnb5WA1ixgNul3aRVpYx GJLeVxDCulVQVtG0wHaMD0w35IsFjQN0aMYWmJjXJFfn2PQXaHhR6CXwPsi72i4R2BG+tFXZ 2B3m6vJFAvPwoW54IScwiQj0RUbboF3wvM1MWu8kmHXw2LDRijAf7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zbFCrIllxZW5hxgl OJiVRHjnmDbFCvGmJFZWpRblxxeV5qQWH2I0BXptIrOUaHI+MMHklcQbmhqaW1gamhubG5tZ KInzdggcjBESSE8sSc1OTS1ILYLpY+LglGpg1LssfnWhUoz5Q8sc08aHz4Q7ZYvNjl2VOXis 18VmearqjTVZ7UVhNVvVXprd7AtvcqrozdljVfVX7kvXWvPOU/Hvt32XL/OXE3E3+LwpIlzA frmTq4iGviavT7Fesv/GhUGuPywNJnYImvFVFR+/4LLq/udJ6/TX7vy/mHFmQuJrJtX5R9mV WIozEg21mIuKEwEVJ1JQ+AIAAA== X-CMS-MailID: 20190919142323eucas1p2fc73a765389432f880fa28945fd28975 X-Msg-Generator: CA X-RootMTR: 20190919142323eucas1p2fc73a765389432f880fa28945fd28975 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142323eucas1p2fc73a765389432f880fa28945fd28975 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch improves code readability by changing the following construct: > if (cond) > goto passive; > foo(); > goto out; >passive: > bar(); >out: into this: > if (cond) > bar(); > else > foo(); Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index f85bed241631..60ad4319fd80 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -420,19 +420,13 @@ static int exynos_bus_probe(struct platform_device *pdev) goto err_reg; if (passive) - goto passive; + ret = exynos_bus_profile_init_passive(bus, profile); + else + ret = exynos_bus_profile_init(bus, profile); - ret = exynos_bus_profile_init(bus, profile); if (ret < 0) goto err; - goto out; -passive: - ret = exynos_bus_profile_init_passive(bus, profile); - if (ret < 0) - goto err; - -out: 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); From patchwork Thu Sep 19 14:22:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152637 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 892F51747 for ; Thu, 19 Sep 2019 14:24:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CD4D20882 for ; Thu, 19 Sep 2019 14:24:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="DLyi5bDJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390485AbfISOYa (ORCPT ); Thu, 19 Sep 2019 10:24:30 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46496 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390469AbfISOX2 (ORCPT ); Thu, 19 Sep 2019 10:23:28 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142326euoutp01a81ca555ff570f7f4a767e08f0182ab4~F3PjQsVBT2200122001euoutp013 for ; Thu, 19 Sep 2019 14:23:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142326euoutp01a81ca555ff570f7f4a767e08f0182ab4~F3PjQsVBT2200122001euoutp013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903006; bh=oOfZ6+laMOXh5GfXFPnoq8LTAumrs8RYsN9+Zezp3sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DLyi5bDJQ+walUmvREtb0wAd3C6w1I7EMJePoPhlP1/qIs/GayV1YVJVNoI8R3AWM VBG53qrz6LkGiUTd6YbRhHMfwD1Yan6OkfkS/LXyFoLZvyOuKG9CM+4efnho2pwfDC Js6iiMv9OT4Q+4cs1KVOgZWALy3OCnJNNIiQPmmE= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142325eucas1p28da7adeb9a17d92b68ff117af505bb7d~F3Pid87qa3077830778eucas1p22; Thu, 19 Sep 2019 14:23:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 37.1B.04309.D5F838D5; Thu, 19 Sep 2019 15:23:25 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190919142324eucas1p1638cec2aafbfcaf03cfdfa7d0189143a~F3PhpKc5N0293102931eucas1p1R; Thu, 19 Sep 2019 14:23:24 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142324eusmtrp11cbda700507d309e234a9e67168d05e2~F3PhXOw7W0555105551eusmtrp1V; Thu, 19 Sep 2019 14:23:24 +0000 (GMT) X-AuditID: cbfec7f4-ae1ff700000010d5-4f-5d838f5d03ee Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A0.65.04117.C5F838D5; Thu, 19 Sep 2019 15:23:24 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142323eusmtip118431cc5357ffe0dbc83832c0e4d758f~F3PgiCxp_3039930399eusmtip1e; Thu, 19 Sep 2019 14:23:23 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 04/11] devfreq: exynos-bus: Clean up code Date: Thu, 19 Sep 2019 16:22:29 +0200 Message-Id: <20190919142236.4071-5-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRju29m5KB05HgVfNCoHQRe8FAlfV5L6cSKKgkgwhq08XtBN2VHL IlNHZuYllEpdmZKablk6L9kwsbkmYThCMTHNqEQqVGKzC1jWPOvy73mf93me930/PobgJ8lg JlmXIep1mlQV5avscnwfClOXGdSRebM8tjk6aTxVcxHhtsoHJH7pniHxbfsQiUcW5il847GF wuVTV5XY6WylcdPkZxJb3o2SeNh6k8KuEjvClc5eBW6xT9L4VV4ThSsrPlB7/AWL6TIlTIz2 UMLUlQGF0F5/QWib61YIT+Z6FEJphwkJLsvqw0ys7854MTU5S9RH7D7hm9Qya0fpXzacsQzG 5qLJ0CLkwwC3FV4V/1QWIV+G55oQtLcuegs3AvOzW6RcuBDU2T5SRYhZtvQtaGT+LoKZ1uuK vw6Dow55cikuGsqvvaE9jUDOjqCidn45l+DqFVBqdBIeVQC3B9xDbtoTq+TWgWHwgIdmOQzX Lt+h5QXXgLm1b1nuw20Dd+9tpazxh2dV75cx8Vtj6DQSnnzgLjJQavpByuZ98GKpxhsUAB8H Orx4FQxWFCtlLMH0oylSNucisDTaCbmxA/oH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hVShvjhViTSwrrsw9 xCjBwawkwjvHtClWiDclsbIqtSg/vqg0J7X4EKMp0GcTmaVEk/OBqSWvJN7Q1NDcwtLQ3Njc 2MxCSZy3Q+BgjJBAemJJanZqakFqEUwfEwenVAPjhnNZTNuXh+enLzm47Z7i+Yc1Rw++YH23 Y7Ox5tmchvenxZ+zvKhkvK91ulBq9TaxPrX+AwsufBSyu1S+RG/nNHWOE97Gx9r0lk5zNAuK +iF4tuG+Tu43Rf6JTB8elH0QNr3nqSB5Z8Ga+o0xN3acv6Xd6/IkR2bvVKlNtpEexzenNPN3 BXSYK7EUZyQaajEXFScCABrO2lX1AgAA X-CMS-MailID: 20190919142324eucas1p1638cec2aafbfcaf03cfdfa7d0189143a X-Msg-Generator: CA X-RootMTR: 20190919142324eucas1p1638cec2aafbfcaf03cfdfa7d0189143a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142324eucas1p1638cec2aafbfcaf03cfdfa7d0189143a References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch adds minor improvements to the exynos-bus driver. Signed-off-by: Artur Świgoń Reviewed-by: Krzysztof Kozlowski --- drivers/devfreq/exynos-bus.c | 66 ++++++++++++++---------------------- 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 60ad4319fd80..8d44810cac69 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -15,11 +15,10 @@ #include #include #include -#include +#include #include #include #include -#include #define DEFAULT_SATURATION_RATIO 40 @@ -178,7 +177,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np, struct device *dev = bus->dev; struct opp_table *opp_table; const char *vdd = "vdd"; - int i, ret, count, size; + int i, ret, count; opp_table = dev_pm_opp_set_regulators(dev, &vdd, 1); if (IS_ERR(opp_table)) { @@ -201,8 +200,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np, } bus->edev_count = count; - size = sizeof(*bus->edev) * count; - bus->edev = devm_kzalloc(dev, size, GFP_KERNEL); + bus->edev = devm_kcalloc(dev, count, sizeof(*bus->edev), GFP_KERNEL); if (!bus->edev) { ret = -ENOMEM; goto err_regulator; @@ -301,10 +299,9 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, profile->exit = exynos_bus_exit; ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL); - if (!ondemand_data) { - ret = -ENOMEM; - goto err; - } + if (!ondemand_data) + return -ENOMEM; + ondemand_data->upthreshold = 40; ondemand_data->downdifferential = 5; @@ -314,8 +311,7 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, ondemand_data); if (IS_ERR(bus->devfreq)) { dev_err(dev, "failed to add devfreq device\n"); - ret = PTR_ERR(bus->devfreq); - goto err; + return PTR_ERR(bus->devfreq); } /* @@ -325,16 +321,13 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, ret = exynos_bus_enable_edev(bus); if (ret < 0) { dev_err(dev, "failed to enable devfreq-event devices\n"); - goto err; + return ret; } ret = exynos_bus_set_event(bus); - if (ret < 0) { + if (ret < 0) dev_err(dev, "failed to set event to devfreq-event devices\n"); - goto err; - } -err: return ret; } @@ -344,7 +337,6 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus, struct device *dev = bus->dev; struct devfreq_passive_data *passive_data; struct devfreq *parent_devfreq; - int ret = 0; /* Initialize the struct profile and governor data for passive device */ profile->target = exynos_bus_target; @@ -352,30 +344,26 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus, /* Get the instance of parent devfreq device */ parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); - if (IS_ERR(parent_devfreq)) { - ret = -EPROBE_DEFER; - goto err; - } + if (IS_ERR(parent_devfreq)) + return -EPROBE_DEFER; passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); - if (!passive_data) { - ret = -ENOMEM; - goto err; - } + if (!passive_data) + return -ENOMEM; + passive_data->parent = parent_devfreq; /* Add devfreq device for exynos bus with passive governor */ - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, + bus->devfreq = devm_devfreq_add_device(dev, profile, + DEVFREQ_GOV_PASSIVE, passive_data); if (IS_ERR(bus->devfreq)) { dev_err(dev, "failed to add devfreq dev with passive governor\n"); - ret = PTR_ERR(bus->devfreq); - goto err; + return PTR_ERR(bus->devfreq); } -err: - return ret; + return 0; } static int exynos_bus_probe(struct platform_device *pdev) @@ -393,18 +381,18 @@ static int exynos_bus_probe(struct platform_device *pdev) return -EINVAL; } - bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); + bus = devm_kzalloc(dev, sizeof(*bus), GFP_KERNEL); if (!bus) return -ENOMEM; mutex_init(&bus->lock); - bus->dev = &pdev->dev; + bus->dev = dev; platform_set_drvdata(pdev, bus); profile = devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL); if (!profile) return -ENOMEM; - node = of_parse_phandle(dev->of_node, "devfreq", 0); + node = of_parse_phandle(np, "devfreq", 0); if (node) { of_node_put(node); passive = true; @@ -461,12 +449,10 @@ static int exynos_bus_resume(struct device *dev) int ret; ret = exynos_bus_enable_edev(bus); - if (ret < 0) { + if (ret < 0) dev_err(dev, "failed to enable the devfreq-event devices\n"); - return ret; - } - return 0; + return ret; } static int exynos_bus_suspend(struct device *dev) @@ -475,12 +461,10 @@ static int exynos_bus_suspend(struct device *dev) int ret; ret = exynos_bus_disable_edev(bus); - if (ret < 0) { + if (ret < 0) dev_err(dev, "failed to disable the devfreq-event devices\n"); - return ret; - } - return 0; + return ret; } #endif From patchwork Thu Sep 19 14:22:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88B9A1745 for ; Thu, 19 Sep 2019 14:24:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5ADEF20882 for ; Thu, 19 Sep 2019 14:24:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Cqg31bnN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403776AbfISOX2 (ORCPT ); Thu, 19 Sep 2019 10:23:28 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:53445 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390485AbfISOX2 (ORCPT ); Thu, 19 Sep 2019 10:23:28 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142327euoutp0262f6b2f80c200969052419cdbb6e0ca2~F3Pj_cN7X1748917489euoutp02J for ; Thu, 19 Sep 2019 14:23:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190919142327euoutp0262f6b2f80c200969052419cdbb6e0ca2~F3Pj_cN7X1748917489euoutp02J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903007; bh=w2UfJ6ezBPlUEZnplzVKt++ooGfyIuCYzPhz55Bgqb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cqg31bnNoolGhUGnzvbS1SsL9Zi1cxq3UBL5UlIBq+Bexfi33Gzvu0nqi7W2/h0qb Vni/KJo6W2l9be2pqs7RR31UhymBlZl5PQTceDyN181y94qRVBa62AeuJRZuiRHH4Q qJ7W47BXvDBtzwroBQJuZObfW6APG9G5lFQDei+8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142326eucas1p29743d0d0f6a4c44888d4446079565359~F3PjExPt63079930799eucas1p27; Thu, 19 Sep 2019 14:23:26 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F8.0C.04469.D5F838D5; Thu, 19 Sep 2019 15:23:25 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142325eucas1p28102446c22b1e1c61aae0bad46d079b0~F3PiUCWQt3080630806eucas1p2g; Thu, 19 Sep 2019 14:23:25 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142325eusmtrp1bb5ff0307cc675ca3d309dbb76a680b1~F3PiFV8J80555105551eusmtrp1X; Thu, 19 Sep 2019 14:23:25 +0000 (GMT) X-AuditID: cbfec7f2-54fff70000001175-0b-5d838f5d6501 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 02.1F.04166.D5F838D5; Thu, 19 Sep 2019 15:23:25 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142324eusmtip1e21b74ae9efc6b6226bd53e23436627c~F3PhTa9XB3039930399eusmtip1f; Thu, 19 Sep 2019 14:23:24 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 05/11] interconnect: Export of_icc_get_from_provider() Date: Thu, 19 Sep 2019 16:22:30 +0200 Message-Id: <20190919142236.4071-6-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUhTYRTu3f3YVdq8TsGTZtZAwiAtKHjVsASxawQF/soQnXmZ6aa2m2VG pC6tNE0cmWl+YB8uP1KXio2UmqNRVsMyDVpNKImUlPwqwSK3a+W/5znnPOd5zsvLEAoH5c8c zzzJ6zJVGiXtSfY+XXq1PfGqPnHHmCMCW572SLGzvgjhruoOCo/Nf6Fwg/UVhUcWZmh8vd9E 40pnBYnt9k4pNn74TmHTp1EKvzHfpPFcmRXhavuABLdbP0jx+wIjjasNX+l93pyp5TLNOUYf 0Zyz1CbhHtw+z3VN90m4J9OPJFx5dwvi5kybDjMJnntSec3xU7wuLCrZM62muwdlv2Vz25rL UT6qk5cghgF2F9xzRJUgT0bBGhG8MA4TIplHUD44vkrmECyOmFeIh1vhbH0uERvNCGxVw9J/ koIftcg1RbPRUHlt3N3wZa0IDI0zpIsQ7G0JlNfaCZe7D3sIioZYl4Bkg+HhVCnpKstYDBOz saJbELR2PnY7e7DhMD/QQLqwjPWGZzc+uzGxMqPvqXVHBfYyA7OWGUoUx8DP9iZaxD4waeuW ingjDBmukCIWYOKhkxLF+QhMd62rd0bCoG2YcgUi2BDoMIeJDxYNvdYTIpTDu2/eYgQ5VPZe J8SyDC4VK0SoBPMNubgOoLB1dHU1Bw77BbICbalZc0vNmltq/rs2IqIF+fE5glbNCzsz+dOh gkor5GSqQ49laU1o5c8N/bbN9qGF1ykWxDJIuV62+bQ+UUGpTglntBYEDKH0ld3cXZiokKWq zuTxuqwkXY6GFywogC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Sy60m8hMacwp/qhqfmzWD48tbrmPpL m7fJX16qu2UKCMr/U43646nY63OVS//Uq4e6HXIKB+0cFhyVfL9B7YNL02HH5y80q9iDC6c6 fVjc8leJpTgj0VCLuag4EQBcdGda9gIAAA== X-CMS-MailID: 20190919142325eucas1p28102446c22b1e1c61aae0bad46d079b0 X-Msg-Generator: CA X-RootMTR: 20190919142325eucas1p28102446c22b1e1c61aae0bad46d079b0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142325eucas1p28102446c22b1e1c61aae0bad46d079b0 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch makes the above function public (for use in exynos-bus devfreq driver). Signed-off-by: Artur Świgoń Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi --- drivers/interconnect/core.c | 3 ++- include/linux/interconnect-provider.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 7b971228df38..95850700e367 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -279,7 +279,7 @@ EXPORT_SYMBOL_GPL(of_icc_xlate_onecell); * Returns a valid pointer to struct icc_node on success or ERR_PTR() * on failure. */ -static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) { struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; @@ -298,6 +298,7 @@ static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) return node; } +EXPORT_SYMBOL_GPL(of_icc_get_from_provider); /** * of_icc_get() - get a path handle from a DT node based on name diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h index b16f9effa555..070e411564e1 100644 --- a/include/linux/interconnect-provider.h +++ b/include/linux/interconnect-provider.h @@ -100,6 +100,7 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider); void icc_node_del(struct icc_node *node); int icc_provider_add(struct icc_provider *provider); int icc_provider_del(struct icc_provider *provider); +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec); #else @@ -140,6 +141,11 @@ static inline int icc_provider_del(struct icc_provider *provider) return -ENOTSUPP; } +struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) +{ + return ERR_PTR(-ENOTSUPP); +} + #endif /* CONFIG_INTERCONNECT */ #endif /* __LINUX_INTERCONNECT_PROVIDER_H */ From patchwork Thu Sep 19 14:22:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152627 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CF0914ED for ; Thu, 19 Sep 2019 14:24:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2AFB20882 for ; Thu, 19 Sep 2019 14:24:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Xpv+vFwi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387693AbfISOY1 (ORCPT ); Thu, 19 Sep 2019 10:24:27 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46511 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390485AbfISOX3 (ORCPT ); Thu, 19 Sep 2019 10:23:29 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142328euoutp0188ba7b925461ed12da97c9039c758d97~F3Pk6mRfD2200122001euoutp016 for ; Thu, 19 Sep 2019 14:23:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142328euoutp0188ba7b925461ed12da97c9039c758d97~F3Pk6mRfD2200122001euoutp016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903008; bh=AnLAppA40BqI8z9CshVPHeubC24brELzTHSPwO597YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xpv+vFwizO8MF8htiBDmDI6/+MEBOo28EozwPyXQir4HfD8XYVM67AtJD8V+zFTP+ BBkURovEhn+GnOFs6L2BR4Ydc0T99DMIJxqTmtpVKHtWz/cPK3XH9mej5KLWEfk1Bk g+g4+o9MPgUOjLkZGU3xnQ91tLKLhs3+H4oDp9Ck= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142327eucas1p2ed6a1e2c127dd2789af76ab265167b07~F3PkJG0Yp3082530825eucas1p2m; Thu, 19 Sep 2019 14:23:27 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A9.1B.04309.F5F838D5; Thu, 19 Sep 2019 15:23:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142326eucas1p204819014fe85716b47e2de4af9102cd5~F3PjKGocO2469524695eucas1p2L; Thu, 19 Sep 2019 14:23:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142326eusmtrp1095ef82681f3c06555d9fdcc527e3361~F3Pi7onA90555105551eusmtrp1a; Thu, 19 Sep 2019 14:23:26 +0000 (GMT) X-AuditID: cbfec7f4-afbff700000010d5-56-5d838f5f8266 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B2.65.04117.D5F838D5; Thu, 19 Sep 2019 15:23:25 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142325eusmtip10316e90c68f927ac1cd0f37950339202~F3PiEhIDb3226332263eusmtip1B; Thu, 19 Sep 2019 14:23:25 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 06/11] interconnect: Relax requirement in of_icc_get_from_provider() Date: Thu, 19 Sep 2019 16:22:31 +0200 Message-Id: <20190919142236.4071-7-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+3YuOxtNjlPypYvZNKEsu9DlK0UKQw5E0B8FooiuOmikU3a8 dIEyzZqXtCaiuTArU1NMXfPSNDMbmUiuZZpQa9W63yS2kKgs57Hyv9/3Ps/zPd8LH0MoHdR8 Zr8mnddq1MkqWk623/0+tDK+JDdudWejFPfdbZNiR1Uewq0VzRR+7H5L4QuWIQo/+jZO4/Kb RhrrHWdIbLW2SHG9/SuFjc5RCg+bz9PYddqCcIW1R4KbLHYpfnK8nsYVpe/pLd6csSGf5p6O dtOco7Bfwl2vOca1fumUcLe/dEu4YlMD4lxG/51MjDx8H5+8P5PXropIkCc1ua9SaVbpweY6 E5GNzHQBkjHAroPeiTGy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0aJb+fOgyXYBBwlJk19wA6SEBE4xSixdfk5sCpmgQ1M EsufvgSrEhaIlvjzfiMTiM0ioCoxb9ZFdhCbV8BCYlnDAmaIFfISqzccALM5BSwlvuybD3aG EFDN3MdzGSHqBSVOznwCFOcAWqAusX6eEEiYGai1eets5gmMgrOQVM1CqJqFpGoBI/MqRpHU 0uLc9NxiI73ixNzi0rx0veT83E2MwCjeduznlh2MXe+CDzEKcDAq8fAqlDfHCrEmlhVX5h5i lOBgVhLhnWPaFCvEm5JYWZValB9fVJqTWnyI0RTotYnMUqLJ+cAEk1cSb2hqaG5haWhubG5s ZqEkztshcDBGSCA9sSQ1OzW1ILUIpo+Jg1OqgXHzizM5okftX/LsumzmY9PM/bM/qOKUhq91 tXuCfKn5IQmmtEd/FFnu3PCc176Zc8V+1Z3PL4SE3FOt3FTRvFFe9Lz5vKfSiumX5scK7ghe 7/Zh9dJTuow7vObyld04cyXytZJR+bbzfGkf2nY6THwQIHQwdhVD4RmXf7LBvVXfLtxgbdGp u6bEUpyRaKjFXFScCAA/QVJ9+AIAAA== X-CMS-MailID: 20190919142326eucas1p204819014fe85716b47e2de4af9102cd5 X-Msg-Generator: CA X-RootMTR: 20190919142326eucas1p204819014fe85716b47e2de4af9102cd5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142326eucas1p204819014fe85716b47e2de4af9102cd5 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch relaxes the condition in of_icc_get_from_provider() so that it is no longer required to set #interconnect-cells = <1> in the DT. In case of the devfreq driver for exynos-bus, #interconnect-cells is always zero. Signed-off-by: Artur Świgoń Acked-by: Krzysztof Kozlowski --- drivers/interconnect/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 95850700e367..f357c3a78858 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -284,7 +284,7 @@ struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; - if (!spec || spec->args_count != 1) + if (!spec) return ERR_PTR(-EINVAL); mutex_lock(&icc_lock); From patchwork Thu Sep 19 14:22:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152625 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 242921745 for ; Thu, 19 Sep 2019 14:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED743218AF for ; Thu, 19 Sep 2019 14:24:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="YxU38emj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403923AbfISOYY (ORCPT ); Thu, 19 Sep 2019 10:24:24 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46496 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390551AbfISOXa (ORCPT ); Thu, 19 Sep 2019 10:23:30 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142329euoutp014b9fdb19fdb1dcae3d56c40b6da18b3f~F3Pl1OD4-2320923209euoutp01F for ; Thu, 19 Sep 2019 14:23:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142329euoutp014b9fdb19fdb1dcae3d56c40b6da18b3f~F3Pl1OD4-2320923209euoutp01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903009; bh=+PvoXwVxpcTid0j87bA2tcY3zWf42daZc3R0G6YTUlc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YxU38emjcGVQXoG7BBxxjU8OxRTWPhHrofsGqWdJJ5T+JZTdqHHOQdH0Ij3/Fc45R +heUQJNlZxQJdnrZjnnToCF4mevVw5xIBuD80meKIBNlv1X9K+HY5lUN25QIbP5Owg 3biDrNLgmzWkTkYfPjvjRY0L/lywB2zOTjUQV/uk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142328eucas1p242dc467060e42704b69ed7f086bbb466~F3Pk2708H3081730817eucas1p2s; Thu, 19 Sep 2019 14:23:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 51.69.04374.F5F838D5; Thu, 19 Sep 2019 15:23:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190919142327eucas1p183470eede07b50c1e3acda58f2af1eba~F3PkEGT6Y0295602956eucas1p1S; Thu, 19 Sep 2019 14:23:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142326eusmtrp164d5d419c24ac75e6ccfb6e7a3e4ca01~F3Pju1HxD0555105551eusmtrp1b; Thu, 19 Sep 2019 14:23:26 +0000 (GMT) X-AuditID: cbfec7f5-4ddff70000001116-06-5d838f5f5030 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 53.1F.04166.E5F838D5; Thu, 19 Sep 2019 15:23:26 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142326eusmtip10794ddcef50859ab7030e7943910eeb3~F3Pi4fy-a3274232742eusmtip1p; Thu, 19 Sep 2019 14:23:25 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 07/11] interconnect: Relax condition in apply_constraints() Date: Thu, 19 Sep 2019 16:22:32 +0200 Message-Id: <20190919142236.4071-8-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUyMcRzA/Z63e665PHeX9V2Muo2NTcnrzxjCeOav2vpLwqlnV9Od3KMS f0iJIsnd0vWily1JadzpLC055zgvy7myQqUMM2+hLpt3XU/ov8/35fP7fr/bjyVVz+gQNtmw VzAatCkaJoC6cvurZ8H2kznxC4c8kdh52y7DA5W5CFstF2nc43tN4yrXAxo/Gv3I4JJrNgab Booo7PFckuH6/s80tr3opnFXawWDR064ELZ42gnc5OqX4d5D9Qy2mN8wa5W8rSGf4fu62xh+ 4Lib4C/XHuStQy0Ef2OojeALmxsQP2KbFc1uCViVKKQkpwvGiNU7ApLqb5ynU7+y+6y9ZUQW qpMdQ3IWuCXgrLlF+1nF1SMY/Bx9DAWMsQ9BfrdFJgUjCNoch+m/Rof1PS0VziG4l/uE/Kc0 F3dS/i6GiwJT8eC4HsS5EJirP1L+gORqCSgs94wpLKvmYqEmP9gvUNwcyM/zIj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+A4hxAC9Ql1s8TAgkzA7U2b53NPIFRcBaSqlkIVbOQVC1gZF7FKJJa WpybnltsqFecmFtcmpeul5yfu4kRGMXbjv3cvIPx0sbgQ4wCHIxKPLwK5c2xQqyJZcWVuYcY JTiYlUR455g2xQrxpiRWVqUW5ccXleakFh9iNAV6bSKzlGhyPjDB5JXEG5oamltYGpobmxub WSiJ83YIHIwREkhPLEnNTk0tSC2C6WPi4JRqYJwpV9W1y7wkYfp8hfiW078fvuljPDbRZ8W+ +W1T2wJ6r/Iuz3DieZfOe/CN8xomk8DDF2Z6JLUf4T9dcVn/j5Aa65GVl/+JLl+1J2WvnPTp e8vOH331T31yReisO2n77MwOh+ZHPeBmT3LVeZPkc35bjf0pJ8bfUawtN83X9fn4Mtl853vq X6fEUpyRaKjFXFScCADxKStz+AIAAA== X-CMS-MailID: 20190919142327eucas1p183470eede07b50c1e3acda58f2af1eba X-Msg-Generator: CA X-RootMTR: 20190919142327eucas1p183470eede07b50c1e3acda58f2af1eba X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142327eucas1p183470eede07b50c1e3acda58f2af1eba References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń The exynos-bus devfreq driver is extended with interconnect functionality by a subsequent patch. This patch removes a check from the interconnect framework that prevents interconnect from working on exynos-bus, in which every bus is a separate interconnect provider. Signed-off-by: Artur Świgoń --- drivers/interconnect/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index f357c3a78858..e8243665d5ba 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -224,11 +224,8 @@ static int apply_constraints(struct icc_path *path) for (i = 0; i < path->num_nodes; i++) { next = path->reqs[i].node; - /* - * Both endpoints should be valid master-slave pairs of the - * same interconnect provider that will be configured. - */ - if (!prev || next->provider != prev->provider) { + /* both endpoints should be valid master-slave pairs */ + if (!prev) { prev = next; continue; } From patchwork Thu Sep 19 14:22:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 499BB1745 for ; Thu, 19 Sep 2019 14:24:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2123021928 for ; Thu, 19 Sep 2019 14:24:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="KOINmmmK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403777AbfISOYS (ORCPT ); Thu, 19 Sep 2019 10:24:18 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:53480 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390579AbfISOXc (ORCPT ); Thu, 19 Sep 2019 10:23:32 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142330euoutp0236250b471103d865762fc14f62c519cc~F3PndIyaR1748917489euoutp02O for ; Thu, 19 Sep 2019 14:23:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190919142330euoutp0236250b471103d865762fc14f62c519cc~F3PndIyaR1748917489euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903010; bh=4kG6qE0VCmH9gQI7bgdBe+khJWWomB1XqLRfnIX4VG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KOINmmmKaPK8aJILecaUTQWIITuNNeEWgbhCu7FUqXien5IZQybeJaViYUzuYVSIH +QcEdf3tdIP73znI6kvqkMFkt8wUZfj2DVUlvm+PAF5/5RTLPeP6jIXfk8vTKqGSmM xkaRTqJW0lC4QoxDDXSz/Zj2hqjPrywEiCi65vS0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190919142330eucas1p1f715b753b2134f8715c31ad53ceeba37~F3PmtgJcX1885218852eucas1p1c; Thu, 19 Sep 2019 14:23:30 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id AB.0C.04469.16F838D5; Thu, 19 Sep 2019 15:23:29 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142329eucas1p299762f99dd55a5d625633ceec84219f9~F3PlxHo1y3081230812eucas1p2m; Thu, 19 Sep 2019 14:23:29 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142328eusmtrp1e7e9e485ce2ebd973b537efbd222d550~F3Plimzbc0555105551eusmtrp1g; Thu, 19 Sep 2019 14:23:28 +0000 (GMT) X-AuditID: cbfec7f2-54fff70000001175-17-5d838f6124d1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 25.65.04117.06F838D5; Thu, 19 Sep 2019 15:23:28 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142328eusmtip15930d3c33f56712647f28e35c4242502~F3Pkv2Ktx3032330323eusmtip14; Thu, 19 Sep 2019 14:23:27 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 08/11] arm: dts: exynos: Add parents and #interconnect-cells to Exynos4412 Date: Thu, 19 Sep 2019 16:22:33 +0200 Message-Id: <20190919142236.4071-9-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTcRTH+93X7qTJdQqeTHqsgl66yoJfGJYUcaF/gkohk1p609JZ7frI +qOlGFnOTPOtKWW2pqJOywdWtoZLfAwrLUib9CAUUktFBZWc1x7/fc453+95wGFJpYP2Ys/G xAq6GE20inGhnrbN2H00t5NDt7V3qrGl7YkMO+6lIFybV03j9xPfaVxi7abxu8lRBuc+MzM4 05FBYbu9RoaNAz9pbP7SR+O3zUUMHjdYEc6zPydwlXVAhj9eMzI4L2uI2efGm02pDN/f18Lw jls2gq8ru8rXjjQS/MuRFoJPrzchfty86jB73GVPuBB9Nl7QqQNOuUSO9HfTF6wrLjVM3af1 KMPjJpKzwO2ENP0UcRO5sErOiOBB5iAjBRMIXtytJaVgHIHeYif+WHobDUuWRwgMhiryr2Wk q5xyqhguEDKzB2XOggdnRZBVOko5A5IrIyC90E46Ve5cGJjSpheZ4jaAqb+cdrKCw1Az1stI 81ZDRU3rokbO7YaJ5yWUpHGD9vyvi0wuaJKfFJKSPpWF8mfnJD4AX/p7lvq4w7CtXiaxN3Rk pVESi/CtyUE7lwNOj8Bcbl1q5A+vbD0LBXZhwCaoblZL6UC4Xpkrc6aBc4UP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RHeOaZNsUK8KYmVValF+fFFpTmpxYcYTYFem8gsJZqcD0wveSXxhqaG5haWhubG 5sZmFkrivB0CB2OEBNITS1KzU1MLUotg+pg4OKUaGDl1WDT+Rb83zPa1cft/o/25Z94rkxOP Vlgz2l/Xyjb8vnYK+7nzd3lF1ifM33SisXpWyXP9d7kz+f/JBxoyT41ZdcDRWmJq0Ztg2W1F vy+es5tted1I4Fqw5kzRe5N12qLf5CaGODvwTwpYFX63kXv6pk8HdX48CDi29VhqhJtJ7sLd BzM+qyuxFGckGmoxFxUnAgAbkcaK9wIAAA== X-CMS-MailID: 20190919142329eucas1p299762f99dd55a5d625633ceec84219f9 X-Msg-Generator: CA X-RootMTR: 20190919142329eucas1p299762f99dd55a5d625633ceec84219f9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142329eucas1p299762f99dd55a5d625633ceec84219f9 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch adds two fields to the Exynos4412 DTS: - parent: to declare connections between nodes that are not in a parent-child relation in devfreq; - #interconnect-cells: required by the interconnect framework. Please note that #interconnect-cells is always zero and node IDs are not hardcoded anywhere. The above-mentioned parent-child relation in devfreq means that there is a shared power line ('devfreq' property). The 'parent' property only signifies an interconnect connection. Signed-off-by: Artur Świgoń --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + arch/arm/boot/dts/exynos4412.dtsi | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index ea55f377d17c..bdd61ae86103 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -106,6 +106,7 @@ &bus_leftbus { devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; vdd-supply = <&buck3_reg>; + parent = <&bus_dmc>; status = "okay"; }; diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index d20db2dfe8e2..a70a671acacd 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -390,6 +390,7 @@ clocks = <&clock CLK_DIV_DMC>; clock-names = "bus"; operating-points-v2 = <&bus_dmc_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -398,6 +399,7 @@ clocks = <&clock CLK_DIV_ACP>; clock-names = "bus"; operating-points-v2 = <&bus_acp_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -406,6 +408,7 @@ clocks = <&clock CLK_DIV_C2C>; clock-names = "bus"; operating-points-v2 = <&bus_dmc_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -459,6 +462,7 @@ clocks = <&clock CLK_DIV_GDL>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -467,6 +471,7 @@ clocks = <&clock CLK_DIV_GDR>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -475,6 +480,7 @@ clocks = <&clock CLK_ACLK160>; clock-names = "bus"; operating-points-v2 = <&bus_display_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -483,6 +489,7 @@ clocks = <&clock CLK_ACLK133>; clock-names = "bus"; operating-points-v2 = <&bus_fsys_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -491,6 +498,7 @@ clocks = <&clock CLK_ACLK100>; clock-names = "bus"; operating-points-v2 = <&bus_peri_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -499,6 +507,7 @@ clocks = <&clock CLK_SCLK_MFC>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; status = "disabled"; }; From patchwork Thu Sep 19 14:22:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152619 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE8DD14ED for ; Thu, 19 Sep 2019 14:24:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8B0B21D7A for ; Thu, 19 Sep 2019 14:24:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="UK/iL0mu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403899AbfISOYR (ORCPT ); Thu, 19 Sep 2019 10:24:17 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46487 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390586AbfISOXc (ORCPT ); Thu, 19 Sep 2019 10:23:32 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142331euoutp01b46df918b68fa26301778ac7d64f9020~F3PoR5ifS2256022560euoutp01j for ; Thu, 19 Sep 2019 14:23:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142331euoutp01b46df918b68fa26301778ac7d64f9020~F3PoR5ifS2256022560euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903011; bh=D6O2vi1XFTzvAfXi4lZNJ+jX68pC4swcd5xtePoIdpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UK/iL0muiGT+GRxdvdSeBGK/rRNfLRMhby1to/QFm3AiipSoWizmRDmOAf9k5HDW9 UAjJ8n7DgqAO+FprFTuCN6QaKXiEVlrnOzMD50bAl/xdWi/Ow8H0uRv8GZ9/pwfiD6 LSYmprmm75cRuhen9t0HD0BpuHz1iH9K4JBkYxg4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190919142330eucas1p1dce149e7c648e6ce551fa74f9cb03431~F3PnZ6T9K1889418894eucas1p1S; Thu, 19 Sep 2019 14:23:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5C.1B.04309.26F838D5; Thu, 19 Sep 2019 15:23:30 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142329eucas1p2e53992eab9ec6b404f716f955b3c228e~F3Pml-I3T3084730847eucas1p2z; Thu, 19 Sep 2019 14:23:29 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142329eusmtrp10fc1c968997d1254489c18d3c5a2e802~F3PmXol0x0562505625eusmtrp1L; Thu, 19 Sep 2019 14:23:29 +0000 (GMT) X-AuditID: cbfec7f4-ae1ff700000010d5-61-5d838f62dfa0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 85.1F.04166.16F838D5; Thu, 19 Sep 2019 15:23:29 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142328eusmtip1da3ae3dff76a6d3af6177c4e689bea6f~F3Plh4up63272632726eusmtip1m; Thu, 19 Sep 2019 14:23:28 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 09/11] devfreq: exynos-bus: Add interconnect functionality to exynos-bus Date: Thu, 19 Sep 2019 16:22:34 +0200 Message-Id: <20190919142236.4071-10-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRj2O+fs7CjNzqbVm0Xlwh9JTYuCT4pICDo/utFPQ2rmQSU3Zcdl V5qX7GKlboTXUlPTlHIuFRtqOkciiWLWKjUmZGlZWm1RQlTbzqz+Pd9zeZ/3hY8hFU5JGJOi zeB1WnWqkg6i2h8vDG1KKMiJj3ZZI7DtcZsUO29dQLilpFmCX7inJbjSPiTBz77N07i4y0Jj o7OQwsPDZilueP1Fgi1vHBI8aq2gseuaHeGS4W4C37O/luLxrAYal5je07vknKXxMs1NODpp zpnfT3APas9zLXMdBNc710lw11sbEeeyrDnIxAXtSORTU07wuqidR4OSn5qmiPSarSdv5zYT BvQu8goKZIDdCu9HDdIrKIhRsA0I6htnKPHhRjDT9NWvuBDkjU9LFyPT1yr9rnoElfX30d/I QP53n4tmY8F4Y9IXD2XtCExV874IydYScL18mPS6Qlg1DNb+8GGKjYDcgs+EF8vYGKi2mWmx by00mXt8nkAP7+72dns9chgonfJh0uPJaSsnRf8FBozGdBHvhlGTmRBxCHzob/XfsBqemK5S Ihbg7UOnxLscsAYEljt2/6Dt0Nc/4hEYT8EGaLZGiXQsDGaPUV4a2GB4+UkurhAMxvZiUqRl cClPIUIlWEuDxSBAdpPDP5uD1pw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UosPMZoCvTaRWUo0OR+YYPJK4g1NDc0tLA3Njc2N zSyUxHk7BA7GCAmkJ5akZqemFqQWwfQxcXBKNTAGsU/t97jS78Z25YSqY8CKJiOrbrZ7byac mjV/xb6KF2fifrl6Hb/ry7T2+sz3618uMf1y9xLjaxlrCVYxvfY5TwWvfVLbZZW3/WduouNf w7jFC01CjjQtCGzeL7Yh8o3cGg5XRksxjlgfpdXvOBPfNT16PNNjry/j4XtsRcuubYiZXx/O 1TFHiaU4I9FQi7moOBEAjZlCuPgCAAA= X-CMS-MailID: 20190919142329eucas1p2e53992eab9ec6b404f716f955b3c228e X-Msg-Generator: CA X-RootMTR: 20190919142329eucas1p2e53992eab9ec6b404f716f955b3c228e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142329eucas1p2e53992eab9ec6b404f716f955b3c228e References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch adds interconnect functionality to the exynos-bus devfreq driver. The SoC topology is a graph (or, more specifically, a tree) and most of its edges are taken from the devfreq parent-child hierarchy (cf. Documentation/devicetree/bindings/devfreq/exynos-bus.txt). Due to unspecified relative probing order, -EPROBE_DEFER may be propagated to guarantee that a child is probed before its parent. Each bus is now an interconnect provider and an interconnect node as well (cf. Documentation/interconnect/interconnect.rst), i.e. every bus registers itself as a node. Node IDs are not hardcoded but rather assigned at runtime, in probing order (subject to the above-mentioned exception regarding relative order). This approach allows for using this driver with various Exynos SoCs. Frequencies requested via the interconnect API for a given node are propagated to devfreq using dev_pm_qos_update_request(). Please note that it is not an error when CONFIG_INTERCONNECT is 'n', in which case all interconnect API functions are no-op. Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 153 +++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 8d44810cac69..e0232202720d 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -14,14 +14,19 @@ #include #include #include +#include +#include #include #include #include +#include #include #include #define DEFAULT_SATURATION_RATIO 40 +#define icc_units_to_khz(x) ((x) / 8) + struct exynos_bus { struct device *dev; @@ -35,6 +40,12 @@ struct exynos_bus { struct opp_table *opp_table; struct clk *clk; unsigned int ratio; + + /* One provider per bus, one node per provider */ + struct icc_provider provider; + struct icc_node *node; + + struct dev_pm_qos_request qos_req; }; /* @@ -59,6 +70,13 @@ exynos_bus_ops_edev(enable_edev); exynos_bus_ops_edev(disable_edev); exynos_bus_ops_edev(set_event); +static int exynos_bus_next_id(void) +{ + static DEFINE_IDA(exynos_bus_icc_ida); + + return ida_alloc(&exynos_bus_icc_ida, GFP_KERNEL); +} + static int exynos_bus_get_event(struct exynos_bus *bus, struct devfreq_event_data *edata) { @@ -171,6 +189,38 @@ static void exynos_bus_passive_exit(struct device *dev) clk_disable_unprepare(bus->clk); } +static int exynos_bus_icc_set(struct icc_node *src, struct icc_node *dst) +{ + struct exynos_bus *src_bus = src->data, *dst_bus = dst->data; + s32 src_freq = icc_units_to_khz(src->avg_bw); + s32 dst_freq = icc_units_to_khz(dst->avg_bw); + + dev_pm_qos_update_request(&src_bus->qos_req, src_freq); + dev_pm_qos_update_request(&dst_bus->qos_req, dst_freq); + + return 0; +} + +static int exynos_bus_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) +{ + *agg_avg += avg_bw; + *agg_peak = max(*agg_peak, peak_bw); + + return 0; +} + +static struct icc_node *exynos_bus_icc_xlate(struct of_phandle_args *spec, + void *data) +{ + struct exynos_bus *bus = data; + + if (spec->np != bus->dev->of_node) + return ERR_PTR(-EINVAL); + + return bus->node; +} + static int exynos_bus_parent_parse_of(struct device_node *np, struct exynos_bus *bus) { @@ -366,6 +416,101 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus, return 0; } +static int exynos_bus_icc_connect(struct exynos_bus *bus) +{ + struct device_node *np = bus->dev->of_node; + struct devfreq *parent_devfreq; + struct icc_node *parent_node = NULL; + struct of_phandle_args args; + int ret = 0; + + parent_devfreq = devfreq_get_devfreq_by_phandle(bus->dev, 0); + if (!IS_ERR(parent_devfreq)) { + struct exynos_bus *parent_bus; + + parent_bus = dev_get_drvdata(parent_devfreq->dev.parent); + parent_node = parent_bus->node; + } else { + /* Look for parent in DT */ + int num = of_count_phandle_with_args(np, "parent", + "#interconnect-cells"); + if (num != 1) + goto out; /* 'parent' is optional */ + + ret = of_parse_phandle_with_args(np, "parent", + "#interconnect-cells", + 0, &args); + if (ret < 0) + goto out; + + of_node_put(args.np); + + parent_node = of_icc_get_from_provider(&args); + if (IS_ERR(parent_node)) { + /* May be -EPROBE_DEFER */ + ret = PTR_ERR(parent_node); + goto out; + } + } + + ret = icc_link_create(bus->node, parent_node->id); + +out: + return ret; +} + +static int exynos_bus_icc_init(struct exynos_bus *bus) +{ + struct device *dev = bus->dev; + struct icc_provider *provider = &bus->provider; + struct icc_node *node; + int id, ret; + + /* Initialize the interconnect provider */ + provider->set = exynos_bus_icc_set; + provider->aggregate = exynos_bus_icc_aggregate; + provider->xlate = exynos_bus_icc_xlate; + provider->dev = dev; + provider->data = bus; + + ret = icc_provider_add(provider); + if (ret < 0) + goto out; + + ret = id = exynos_bus_next_id(); + if (ret < 0) + goto err_node; + + node = icc_node_create(id); + if (IS_ERR(node)) { + ret = PTR_ERR(node); + goto err_node; + } + + bus->node = node; + node->name = dev->of_node->name; + node->data = bus; + icc_node_add(node, provider); + + ret = exynos_bus_icc_connect(bus); + if (ret < 0) + goto err_connect; + + ret = dev_pm_qos_add_request(bus->devfreq->dev.parent, &bus->qos_req, + DEV_PM_QOS_MIN_FREQUENCY, 0); + +out: + return ret; + +err_connect: + icc_node_del(node); + icc_node_destroy(id); +err_node: + icc_provider_del(provider); + + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -415,6 +560,14 @@ static int exynos_bus_probe(struct platform_device *pdev) if (ret < 0) goto err; + /* + * Initialize interconnect provider. A return value of -ENOTSUPP means + * that CONFIG_INTERCONNECT is disabled. + */ + ret = exynos_bus_icc_init(bus); + if (ret < 0 && ret != -ENOTSUPP) + 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); From patchwork Thu Sep 19 14:22:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152617 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84F8514ED for ; Thu, 19 Sep 2019 14:24:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 591752196E for ; Thu, 19 Sep 2019 14:24:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="so7tlrb4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388823AbfISOYM (ORCPT ); Thu, 19 Sep 2019 10:24:12 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:53498 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403783AbfISOXd (ORCPT ); Thu, 19 Sep 2019 10:23:33 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142332euoutp028e6ae93a2b85e38e085e0d464fc10508~F3PpCbNzf1748917489euoutp02R for ; Thu, 19 Sep 2019 14:23:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190919142332euoutp028e6ae93a2b85e38e085e0d464fc10508~F3PpCbNzf1748917489euoutp02R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903012; bh=TV1z+igvsoIbVfWWAwJfb3ELED5sMO01fLplbggkMEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=so7tlrb4EJFRN5H0a/t2QfQeloVQlmEZoQkL2PIFwtajjdETyoyIvX10shYA99QcD i72G6wt0+jBLEYNNuft8u//kic+PgUz6wkB0vxoLlqlRKhk68ddGNMNsW5Y8LbiRF3 OtG9JdF5k6UI748aAebbl7rD7kbL7aZaCeSnZJJ4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190919142331eucas1p2796f51835a980ab05279a92068aed907~F3PoOErBV3077830778eucas1p28; Thu, 19 Sep 2019 14:23:31 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id CD.1B.04309.36F838D5; Thu, 19 Sep 2019 15:23:31 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190919142330eucas1p1eceae78b148a03f2af71657b7cdd6694~F3PnWgSvX1761817618eucas1p1F; Thu, 19 Sep 2019 14:23:30 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142330eusmtrp17672e43b993bed51c1c88b1c4d09ee9d~F3PnIF1Do0555105551eusmtrp1j; Thu, 19 Sep 2019 14:23:30 +0000 (GMT) X-AuditID: cbfec7f4-afbff700000010d5-66-5d838f63b8af Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 47.65.04117.26F838D5; Thu, 19 Sep 2019 15:23:30 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142329eusmtip1135a0ffecb68779a53fbb8d79a1c0bd0~F3PmUlWIN3163331633eusmtip1L; Thu, 19 Sep 2019 14:23:29 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, krzk@kernel.org Subject: [RFC PATCH v2 10/11] arm: dts: exynos: Add interconnects to Exynos4412 mixer Date: Thu, 19 Sep 2019 16:22:35 +0200 Message-Id: <20190919142236.4071-11-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUhTYRTHe3bv7u6sq9dZdDBLHYhUpGZFTyRREnELP/hNSsSmXtR8yXa1 Nz/kC5bam7gsU0nTkeYKdanoMtE1GmY0ylqlzllWVpAV07LobdtdL99+53/O//yfAw9NKOxS fzo9O5dXZ6sylZQX2X3nq2VN8tnihAjdqD823umSYfulEoQ7qtuk+MnstBTXm+5L8aO5DxS+ cEtP4Up7BYktlnYZbrF9kmL9lFWKRwx1FHacNiFcbemX4OsmmwyPFbZQuFrzltrqy+lbyyhu 3NpHcfaTZgl3Q3uM65jpkXCDM30S7kxnK+Ic+hWx9B6vqBQ+M/0grw7fstcr7WbhnCxnRHa4 3TiNClA3VY7kNLDrwaEzoXLkRSvYFgQVjQ9lYjGL4KVpwtNxIDAPl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HVsUssIFJ YvnTl0DtHBzCAqESKy7ogzSwCKhKPL72ghnE5hWwlLi6chEjxAZ5idUbDoDFOYHiX/bNZwGx hQQsJOY+nssIUS8ocXLmExaQkcwC6hLr5wmBhJmBWpu3zmaewCg4C0nVLISqWUiqFjAyr2IU SS0tzk3PLTbSK07MLS7NS9dLzs/dxAiM4W3Hfm7Zwdj1LvgQowAHoxIPr0J5c6wQa2JZcWXu IUYJDmYlEd45pk2xQrwpiZVVqUX58UWlOanFhxhNgV6byCwlmpwPTC95JfGGpobmFpaG5sbm xmYWSuK8HQIHY4QE0hNLUrNTUwtSi2D6mDg4pRoYez7s57rkwSMV/P9sGPf8kn8PzoVppfk5 pTD/LA/9nch6ndHsFPcbQVWGI1Ivne5x9/BMydwf8yWht0V8Nf+WRV17/L1+fbaoWnEjcvO0 9615in1iNWFqxSsS9i0NS9yhYmfPE1LE2fz+93K/BpO/q5Pes+1Yqn57dQx30OP7ySyyQr1h Pi5KLMUZiYZazEXFiQA6iPJh9wIAAA== X-CMS-MailID: 20190919142330eucas1p1eceae78b148a03f2af71657b7cdd6694 X-Msg-Generator: CA X-RootMTR: 20190919142330eucas1p1eceae78b148a03f2af71657b7cdd6694 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142330eucas1p1eceae78b148a03f2af71657b7cdd6694 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Artur Świgoń This patch adds an 'interconnects' property to Exynos4412 DTS in order to declare the interconnect path used by the mixer. Please note that the 'interconnect-names' property is not needed when there is only one path in 'interconnects', in which case calling of_icc_get() with a NULL name simply returns the right path. Signed-off-by: Artur Świgoń --- arch/arm/boot/dts/exynos4412.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index a70a671acacd..faaec6c40412 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -789,6 +789,7 @@ clock-names = "mixer", "hdmi", "sclk_hdmi", "vp"; clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>; + interconnects = <&bus_display &bus_dmc>; }; &pmu { From patchwork Thu Sep 19 14:22:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11152613 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2B2414ED for ; Thu, 19 Sep 2019 14:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9FAE21928 for ; Thu, 19 Sep 2019 14:24:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XHb6t26B" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388998AbfISOYB (ORCPT ); Thu, 19 Sep 2019 10:24:01 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:46555 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403788AbfISOXe (ORCPT ); Thu, 19 Sep 2019 10:23:34 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190919142332euoutp01d853b35f6aad85ecd904b78b2cdbbe72~F3PpVi-rv2200122001euoutp01C for ; Thu, 19 Sep 2019 14:23:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190919142332euoutp01d853b35f6aad85ecd904b78b2cdbbe72~F3PpVi-rv2200122001euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568903012; bh=aqnq76AJ7cEM6iPpck0/T4PBR1c8/aJ2zN+gU2OjO5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XHb6t26Bwhlx8ziUSsjIvsiO9CSLGIHg2adTCQXu5puBk5jBGdNYgvxkVJTJZxh/r 7w29RIN6i14odEBINmhL64gMPHsV6QYEnu2Bv1hTQPCw4r9sLNZVIwDYG/N+ljaY+4 aCc25or0xD60AfvHnLLBMBweIL+9xBbz+/UT1yow= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190919142332eucas1p1d51a1e7ed38d5ff9cbf66beda86860db~F3Poz8KI31885218852eucas1p1l; Thu, 19 Sep 2019 14:23:32 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 65.69.04374.46F838D5; Thu, 19 Sep 2019 15:23:32 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190919142331eucas1p2107a7cb9ce8b3817ed171c21a8ad5b00~F3Pn_C_-93080630806eucas1p2o; Thu, 19 Sep 2019 14:23:31 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190919142331eusmtrp1821b6ff67c64b3c0456b691cd09cb0a8~F3Pn9GMsH0562505625eusmtrp1Q; Thu, 19 Sep 2019 14:23:31 +0000 (GMT) X-AuditID: cbfec7f5-4ddff70000001116-14-5d838f64ce27 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 18.1F.04166.36F838D5; Thu, 19 Sep 2019 15:23:31 +0100 (BST) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190919142330eusmtip18daa369ad8728ac48cc1b4e8d0870d63~F3PnI7tvl3039930399eusmtip1h; Thu, 19 Sep 2019 14:23:30 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Marek Szyprowski , cw00.choi@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, georgi.djakov@linaro.org, leonard.crestez@nxp.com, b.zolnierkie@samsung.com, krzk@kernel.org, =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= Subject: [RFC PATCH v2 11/11] drm: exynos: mixer: Add interconnect support Date: Thu, 19 Sep 2019 16:22:36 +0200 Message-Id: <20190919142236.4071-12-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919142236.4071-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRju27nsKM2OU/DN0mpkUNBFLPikCwn+OPgjJAm6KLbypCOdsuO1 kEyz8lLJxNIpJt0UxdSjNbWatYarDFekK0qZZZLZxWwahWK5HUP/Pe9z+d7nhY8hlA7Kn9Fo U3mdVp2ooj3Ju91/bBvjLuXFbGkfkGFz9x05dlTnI9xS3kTh15OfKHzV0kvhvqlxGl95INJY 7yghsc3WLMd1gxMUFoftFH7VWUVj5wULwuU2kww3Wgbl+N3pOhqXl36md3tzYn0BzQ3Y79Oc o8gq41pvnOJavrfLuEff78u4i231iHOKgZHMQc8dcXyiJp3Xbd512DPB2f+FTBHXZj77ekae g34GFCIPBtitIP6sQYXIk1GydQi6++yENEwisBtb5dLgRPDDVkX/j5Q+yqEloRbBYMvQQqRo tBu5XDQbBvqyIXfcl7UgKK0ZJ10DwXbI4EV5I+Fy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BZhCbEyj8Zd98 FohlFhJzH88Fa+UVEJQ4OfMJC0grs4C6xPp5QiBhZqDW5q2zmScwCs5CUjULoWoWkqoFjMyr GEVSS4tz03OLDfWKE3OLS/PS9ZLzczcxAiN427Gfm3cwXtoYfIhRgINRiYdXobw5Vog1say4 MvcQowQHs5II7xzTplgh3pTEyqrUovz4otKc1OJDjKZAn01klhJNzgcml7ySeENTQ3MLS0Nz Y3NjMwslcd4OgYMxQgLpiSWp2ampBalFMH1MHJxSDYzV5VM5QlPcJz3evelj+e9HdUsnNAR8 UXJV5dab+9U/apWCooCE85PKa7NXlChUSf2bLOL1ddMzP/FLV00OzTe9/6Bx7kaVCQkcpbe3 z3VwzIqbOWPt4zzPF/yBqtzHAswjeeMltOytZbbelC+ylP/tsTFN/dKqjxKBy37JW7Nl3BUQ X5uS36TEUpyRaKjFXFScCACPvzrD9gIAAA== X-CMS-MailID: 20190919142331eucas1p2107a7cb9ce8b3817ed171c21a8ad5b00 X-Msg-Generator: CA X-RootMTR: 20190919142331eucas1p2107a7cb9ce8b3817ed171c21a8ad5b00 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190919142331eucas1p2107a7cb9ce8b3817ed171c21a8ad5b00 References: <20190919142236.4071-1-a.swigon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Marek Szyprowski This patch adds interconnect support to exynos-mixer. Please note that the mixer works the same as before when CONFIG_INTERCONNECT is 'n'. Co-developed-by: Artur Świgoń Signed-off-by: Marek Szyprowski Signed-off-by: Artur Świgoń --- drivers/gpu/drm/exynos/exynos_mixer.c | 71 +++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 7b24338fad3c..a44f3284b071 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -97,6 +98,7 @@ struct mixer_context { struct exynos_drm_crtc *crtc; struct exynos_drm_plane planes[MIXER_WIN_NR]; unsigned long flags; + struct icc_path *soc_path; int irq; void __iomem *mixer_regs; @@ -931,6 +933,40 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc) mixer_reg_writemask(mixer_ctx, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); } +static void mixer_set_memory_bandwidth(struct exynos_drm_crtc *crtc) +{ + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; + struct mixer_context *ctx = crtc->ctx; + unsigned long bw, bandwidth = 0; + int i, j, sub; + + if (!ctx->soc_path) + return; + + for (i = 0; i < MIXER_WIN_NR; i++) { + struct drm_plane *plane = &ctx->planes[i].base; + const struct drm_format_info *format; + + if (plane->state && plane->state->crtc && plane->state->fb) { + format = plane->state->fb->format; + bw = mode->hdisplay * mode->vdisplay * + drm_mode_vrefresh(mode); + if (mode->flags & DRM_MODE_FLAG_INTERLACE) + bw /= 2; + for (j = 0; j < format->num_planes; j++) { + sub = j ? (format->vsub * format->hsub) : 1; + bandwidth += format->cpp[j] * bw / sub; + } + } + } + + /* add 20% safety margin */ + bandwidth = bandwidth / 4 * 5; + + dev_dbg(ctx->dev, "exynos-mixer: safe bandwidth %ld Bps\n", bandwidth); + icc_set_bw(ctx->soc_path, Bps_to_icc(bandwidth), 0); +} + static void mixer_atomic_begin(struct exynos_drm_crtc *crtc) { struct mixer_context *ctx = crtc->ctx; @@ -982,6 +1018,7 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) return; + mixer_set_memory_bandwidth(crtc); mixer_enable_sync(mixer_ctx); exynos_crtc_handle_event(crtc); } @@ -1029,6 +1066,7 @@ static void mixer_disable(struct exynos_drm_crtc *crtc) for (i = 0; i < MIXER_WIN_NR; i++) mixer_disable_plane(crtc, &ctx->planes[i]); + mixer_set_memory_bandwidth(crtc); exynos_drm_pipe_clk_enable(crtc, false); pm_runtime_put(ctx->dev); @@ -1220,12 +1258,22 @@ static int mixer_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; const struct mixer_drv_data *drv; struct mixer_context *ctx; + struct icc_path *path; int ret; + /* + * Returns NULL if CONFIG_INTERCONNECT is disabled. + * May return ERR_PTR(-EPROBE_DEFER). + */ + path = of_icc_get(dev, NULL); + if (IS_ERR(path)) + return PTR_ERR(path); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_DEV_ERROR(dev, "failed to alloc mixer context.\n"); - return -ENOMEM; + ret = -ENOMEM; + goto err; } drv = of_device_get_match_data(dev); @@ -1233,6 +1281,7 @@ static int mixer_probe(struct platform_device *pdev) ctx->pdev = pdev; ctx->dev = dev; ctx->mxr_ver = drv->version; + ctx->soc_path = path; if (drv->is_vp_enabled) __set_bit(MXR_BIT_VP_ENABLED, &ctx->flags); @@ -1242,17 +1291,29 @@ static int mixer_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ctx); ret = component_add(&pdev->dev, &mixer_component_ops); - if (!ret) - pm_runtime_enable(dev); + if (ret < 0) + goto err; + + pm_runtime_enable(dev); + + return 0; + +err: + icc_put(path); return ret; } static int mixer_remove(struct platform_device *pdev) { - pm_runtime_disable(&pdev->dev); + struct device *dev = &pdev->dev; + struct mixer_context *ctx = dev_get_drvdata(dev); - component_del(&pdev->dev, &mixer_component_ops); + pm_runtime_disable(dev); + + component_del(dev, &mixer_component_ops); + + icc_put(ctx->soc_path); return 0; }