Received: by 10.223.185.116 with SMTP id b49csp6051992wrg; Wed, 28 Feb 2018 03:12:41 -0800 (PST) X-Google-Smtp-Source: AH8x2240Hc7GcEYhg2ALjoRyvZbgEkb0lk3RD1L+ncSTB8L8KDrSOWv4oF9/mTXtqKsLWvC2BVoE X-Received: by 10.98.82.138 with SMTP id g132mr17458089pfb.120.1519816361606; Wed, 28 Feb 2018 03:12:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519816361; cv=none; d=google.com; s=arc-20160816; b=vzY4v4vUAdVhDL4fQtHVMaJGV42U4ac4mOdem+ZYhj964KiC2ug2TlKPS7tjsfc4h7 4WVNk+F0G970f90Gg+X66nysjsjN2Y8xe9JYSVSb0o//5l0dSyLUlMGt5nTmv6XjlFwx MOxTScz13VFAKehMFlRBam0DYsLz7Aw4XDJM0gVG4mYVHXXoK5gJ+9Xgzdz0nUFy7JyH 8re8UGNEQ+GtU0RZbIacJOdAUY3m2ruq1oDgiEloYw/z9drMRF7v56G1guViemsUS174 1g6PmeyhQPzCNwugHAqT7P8dlwsId3H+nDEFz0gaA1Mn8tv13rWr9ku9tOI0uA8Hyt9u 55uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Vmc6RPtvIC61PbbZ0TB6UbdJouywJvvrBIg97hGB7kU=; b=UQvfj8p2Y0Ouelrllh46uqtavO1IGHuN0usWrZ3OgpWcBmxP4VAgIi1Q6+UH+5/CJG 5OS8K1iLNWCqjpGSDw4mQ5VHHS7z8A3AP9DVkznfzaDNbIDWGRTpqAkNziBVVuPfzCnm vzr3XSN9PTFJEshRdPPDlyfG5VkxUnbqq/72aAPQTdWGiyUDvdAv2cS8Cb1IRaGj0TDm 8GeMrUsREEnF90NlTcdIY5zLZV4WMLZtVtBE/pV8fK8Y7uQRjx7VUrEweBhwkmCpXP1b KPYHxHuC2bfiKP8F+eafG36xoG/Q+3qOZ9Dl3vEa+QI1cKfZSQF8/XjHeaqS/zxdSA5G VA6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si894760pgr.205.2018.02.28.03.12.26; Wed, 28 Feb 2018 03:12:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbeB1LLq (ORCPT + 99 others); Wed, 28 Feb 2018 06:11:46 -0500 Received: from regular1.263xmail.com ([211.150.99.130]:42891 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbeB1LLp (ORCPT ); Wed, 28 Feb 2018 06:11:45 -0500 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.158]) by regular1.263xmail.com (Postfix) with ESMTP id DF9EDB1C9; Wed, 28 Feb 2018 19:11:30 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 418C8383; Wed, 28 Feb 2018 19:11:22 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 26163RKZF9; Wed, 28 Feb 2018 19:11:32 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org Cc: tfiga@chromium.org, dmitry.torokhov@gmail.com, robin.murphy@arm.com, heiko@sntech.de, wxt@rock-chips.com, Jeffy Chen , Elaine Zhang , linux-rockchip@lists.infradead.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, Ulf Hansson Subject: [PATCH] soc: rockchip: power-domain: remove PM clocks Date: Wed, 28 Feb 2018 19:11:13 +0800 Message-Id: <20180228111113.13639-1-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we are adding all of the attached devices' clocks as pm clocks and enable them when powering on the power domain. This seems unnecessary, because those clocks are already controlled in the devices' drivers with better error handling. Tested on my chromebook minnie(rk3288) and chromebook kevin(rk3399). Signed-off-by: Jeffy Chen --- drivers/soc/rockchip/pm_domains.c | 42 --------------------------------------- 1 file changed, 42 deletions(-) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 5c342167b9db..39723ef6f7dc 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -320,44 +319,6 @@ static int rockchip_pd_power_off(struct generic_pm_domain *domain) return rockchip_pd_power(pd, false); } -static int rockchip_pd_attach_dev(struct generic_pm_domain *genpd, - struct device *dev) -{ - struct clk *clk; - int i; - int error; - - dev_dbg(dev, "attaching to power domain '%s'\n", genpd->name); - - error = pm_clk_create(dev); - if (error) { - dev_err(dev, "pm_clk_create failed %d\n", error); - return error; - } - - i = 0; - while ((clk = of_clk_get(dev->of_node, i++)) && !IS_ERR(clk)) { - dev_dbg(dev, "adding clock '%pC' to list of PM clocks\n", clk); - error = pm_clk_add_clk(dev, clk); - if (error) { - dev_err(dev, "pm_clk_add_clk failed %d\n", error); - clk_put(clk); - pm_clk_destroy(dev); - return error; - } - } - - return 0; -} - -static void rockchip_pd_detach_dev(struct generic_pm_domain *genpd, - struct device *dev) -{ - dev_dbg(dev, "detaching from power domain '%s'\n", genpd->name); - - pm_clk_destroy(dev); -} - static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, struct device_node *node) { @@ -476,9 +437,6 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, pd->genpd.name = node->name; pd->genpd.power_off = rockchip_pd_power_off; pd->genpd.power_on = rockchip_pd_power_on; - pd->genpd.attach_dev = rockchip_pd_attach_dev; - pd->genpd.detach_dev = rockchip_pd_detach_dev; - pd->genpd.flags = GENPD_FLAG_PM_CLK; if (pd_info->active_wakeup) pd->genpd.flags |= GENPD_FLAG_ACTIVE_WAKEUP; pm_genpd_init(&pd->genpd, NULL, false); -- 2.11.0