From patchwork Wed Oct 16 19:37:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 176522 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7827321ill; Wed, 16 Oct 2019 12:37:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9Y++lBit2SMETn1CPsevalrz0wjDBMVYiG7bL7DTChFFypYEx3P4cR3uye5lrv/da+Uy/ X-Received: by 2002:a17:906:a88e:: with SMTP id ha14mr40252949ejb.92.1571254661686; Wed, 16 Oct 2019 12:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571254661; cv=none; d=google.com; s=arc-20160816; b=zG/LbgnXhiqX6edNJQDSHwVna6NleP18eb/lX7l3080BnFeKNvDhe6jPoayYcPn7Fl KW2of/qmCZvx2U23IgG42V20k7eOBce95X0xASRHxB9dW1sOdzgYcH4Ro7lXUM1A1XKS /ZcD4f0hwuFLePLtGlnZ5H7r9AGCXsuq8ouW/aIgeirk2fPs5vtPoJrEdAQcVT1fBY4V aEjFt6LEZyQ9azxL48ps2Zt3txXrIwvfGYh20t7roptpSxo/xUbiH61/XJWzzl2FhfN5 XAlAeMHVQvmE6WN2Dhs8iF86gCQUlNwg6Z+DsixXfIh4B91zxCfOgz71kEPHavbP+uP2 jMkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AYapJscjdiPe7azvtC5J+VuWqRbuSj4S49kPVeQ4UUs=; b=QAu8CuUO5XVj+NvOwQn2ejJ8xR/VdDhcgtDl7pgSZaf5kbB2A8SfUtl2Vfi5auK16L 4j6fbJr2qkjSejo/Vw3lEsULeb3CbS8NcCr0rc5h6QWy69VazzN6w+aJZfRz/8Ojpcm/ +PrvedgHLMloyDPkXPmcXY4nIISQSj/z86YQifnQVeae0XiI19zGkKqt8ZdmK8o1JMUp CkyolKHZ14l/qI8paHP44tlIoZaBzaJ8OAuhauI2KJRtDtH7ypwBR+PgGfoTe2UrAsYD ae7yqUQMHnMnWP2aG9dnNkJhdpZ/XmokE1iKbttYup0D4v+OoOJI4jTZJedy3DD/EcSZ cLxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n99gsNcs; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si16302545ejr.244.2019.10.16.12.37.41; Wed, 16 Oct 2019 12:37:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n99gsNcs; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394486AbfJPThk (ORCPT + 8 others); Wed, 16 Oct 2019 15:37:40 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:35857 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394485AbfJPThi (ORCPT ); Wed, 16 Oct 2019 15:37:38 -0400 Received: by mail-qk1-f194.google.com with SMTP id y189so23941617qkc.3 for ; Wed, 16 Oct 2019 12:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AYapJscjdiPe7azvtC5J+VuWqRbuSj4S49kPVeQ4UUs=; b=n99gsNcs/xsd9f7sLUlIs3n+dodwMDeGOMCNrhZpuxG/g48jzQ3odfdm9C5SItRE4k Pafa14Sxnq3Plc+4HV1HZDJ/zTM4zonb27dCFMd8wWCbT2z62TV3RHjnQGnDGEOz6kr5 5EMwt6BaMboBRfZXl1Cy+we5hcQ+lGV7ecTFgdHmj7Y7trSTvgKCppJOz2O8i0M4dRvv avS/QLCrHfaDjCSvlGM2r4nN+y+kR8tik6/rHm3cfsw/vx1rXMiW23dOFRkLwuBGANWH Twc4EH7XpIp9YvZ/wyksM8n4OvXVrCm6bQAre7VXS+wMcQtiIg0//Ik1l+doB2Az5LZD g1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AYapJscjdiPe7azvtC5J+VuWqRbuSj4S49kPVeQ4UUs=; b=jJ0MrIug9/rogFokskDmQERsr7LaPPdr7IP6hvYw6B55qTt9DSa078842NlVxTwC9q F+MJpj0ryIMecVEgv3XHvKKjqDFy/zy2sQzo5rwiR0C6kvsAtaafa0DiVSroI3QVll28 VMHX4V/V2TZ/ULrSad8ymBWSuR1ZccQwXd03vW8HjrXf1tbmajb8F+8Zna1paKVAKwcW WT3yuiub03qbQ9HJx0wLjr25uC/v/MJrbvuR7PqTP1TjIBpzBzIQrHAjBhWE9UpEG2Wa c7R4wvWm6syB+W+wuqqlPt87AMfK+oi43GEqf2zQJZJyx8PpX2CvgIV/iMLLgBZVVsXv Y0vw== X-Gm-Message-State: APjAAAV56TmTlxEXMR3FN/PNBVSjnMiNdlW/U8/UDuYan5wBNGRXKQO7 wXy/pnLEV+sQPHLDyqvRhS6Xuw== X-Received: by 2002:a37:7dc2:: with SMTP id y185mr30531737qkc.348.1571254656219; Wed, 16 Oct 2019 12:37:36 -0700 (PDT) Received: from Thara-Work-Ubuntu.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id 54sm16246030qts.75.2019.10.16.12.37.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Oct 2019 12:37:35 -0700 (PDT) From: Thara Gopinath To: edubezval@gmail.com, rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com, rjw@rjwysocki.net, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/7] soc: qcom: Extend RPMh power controller driver to register warming devices. Date: Wed, 16 Oct 2019 15:37:19 -0400 Message-Id: <1571254641-13626-6-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1571254641-13626-1-git-send-email-thara.gopinath@linaro.org> References: <1571254641-13626-1-git-send-email-thara.gopinath@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org RPMh power control hosts power domains that can be used as thermal warming devices. Register these power domains with the generic power domain warming device thermal framework. Signed-off-by: Thara Gopinath --- drivers/soc/qcom/rpmhpd.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index 9d37534..88ba615 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -333,6 +334,7 @@ static int rpmhpd_probe(struct platform_device *pdev) struct genpd_onecell_data *data; struct rpmhpd **rpmhpds; const struct rpmhpd_desc *desc; + struct device_node *child; desc = of_device_get_match_data(dev); if (!desc) @@ -396,7 +398,24 @@ static int rpmhpd_probe(struct platform_device *pdev) &rpmhpds[i]->pd); } - return of_genpd_add_provider_onecell(pdev->dev.of_node, data); + ret = of_genpd_add_provider_onecell(pdev->dev.of_node, data); + + if (ret) + return ret; + + for_each_available_child_of_node(dev->of_node, child) { + if (!of_find_property(child, "#cooling-cells", NULL)) + continue; + + for (i = 0; i < num_pds; i++) + if (strcmp(child->name, rpmhpds[i]->pd.name) == 0) + break; + if (i == num_pds) + continue; + pwr_domain_warming_register(child, &rpmhpds[i]->pd); + } + + return 0; } static struct platform_driver rpmhpd_driver = {