Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp948791ybg; Wed, 3 Jun 2020 19:01:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrUhRReMvDlMjc1i7zKI76/NyioDbLPOKloBx//J6pVbvCCeqoBTfJuELO9n+Po8pLNtXJ X-Received: by 2002:a17:906:7e50:: with SMTP id z16mr1949591ejr.277.1591236102626; Wed, 03 Jun 2020 19:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591236102; cv=none; d=google.com; s=arc-20160816; b=BvUsWqZIfJixkvW1UJXfFbbapndPMdcDm9/oVtR8RAN6ATGEZ+tfwqrhvTz3QPCAMW P0oliE5xyVzD7DhSE3FiOcX0Mj+YOTZgglfG2Dreh9px1t30nzP11bQV4SFjgAbfI7jl OeaJXXvTHffE/A+UUdHJfBtID0/p1fA2K6DPN33vzQLcKDQSreOJfgjTEFUy017xS41O dGtSGk+7E61DNAbN3SUQ6GvGk4sGc/GXi1RIeIAEUQpIKyZwswp5lko/FygjRDm9MmJg h6kkpwvmEtxreI5EGZw4droL64VVa95Zz5OE9vzgRAKiLmrBr2IMLxoMzWiGD8ihvi4+ cn8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tud9p3zmcof67j7J04w2IZJcscMQG/mxzuG6n3catS0=; b=m5Z56lc1A2KFN6+TPP42NWKIibRtnjyZXx8iWjN0tJL5nBG7EirYq6aOtQXhRrDXRb c2DmULtrE+nMzeHZqxMSDgU3j1iNV7ut0p3MW+DkO0JYtY1y6h0/Py1ST74wEYi0tJjx p8kH7oms9jnFqPI/7LLOfSSVgqlGz2CAddZSnufc6hSxJQ+ETkP1GDLziYJIzHaOXMv/ dFxZv3i08VOn+bR4xTLjrgVf5ZeZ5ek905XtyE5ArAWnCqWri/ckoO/YLqDcHe1vEst3 SZdjagtZuBojVMJMVpLyKEto7EmL6Vr9x51n3Sr1ENVnS9c4L4pYqZCDAqrnmj1RDq2M wvdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gvkwNtLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r29si748478edx.420.2020.06.03.19.01.20; Wed, 03 Jun 2020 19:01:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gvkwNtLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728077AbgFDBxq (ORCPT + 99 others); Wed, 3 Jun 2020 21:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728025AbgFDBx1 (ORCPT ); Wed, 3 Jun 2020 21:53:27 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29F1DC03E96D for ; Wed, 3 Jun 2020 18:53:27 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id d27so3969577qtg.4 for ; Wed, 03 Jun 2020 18:53:27 -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 :mime-version:content-transfer-encoding; bh=Tud9p3zmcof67j7J04w2IZJcscMQG/mxzuG6n3catS0=; b=gvkwNtLeDcKfmolxt47SKJqNLrx96FuiXBbqhr6yL6pkbk+6eAfUdi7Ls635NAFRis 1ZRTZoZVrji9WfctgIUCfoTMINNQPtGir1JDuraItDR4TWZbcbMtU2S0+2fwUELd77Wy bXiEYvBqgPMT4Dc1VEEruvyYf+4RPQtWGwAmPQfnJJOWKuWyT2CpsESBkiwsT0Xj/q5h 8+de2RsSZmYinEoYcQcEs9UVRYEozaOh+kuah0oajP4qQlqj8s5sh57asM+LRqT4MmOM G6DkmlqR928RXVNYALs88O1fJBmUerCcuQM7UsK1zK4qxp8y+hMBAYlEPNTA6+pafGZd o6Fg== 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:mime-version:content-transfer-encoding; bh=Tud9p3zmcof67j7J04w2IZJcscMQG/mxzuG6n3catS0=; b=K81triQwQnp4o8yDirr090afhj5N8m6SXxIhJeZtfizA0oZ0oO6aJqB6t+UOBbMtk4 FbIRP/4yI/7ZoGztPiGdEI4r+Ea2bh9+0iLIUw+PwNDrwhsBxdT7F3DfHFIS0ku6W+oK RHJSKmtP0UBOz/vl2WrIQz2DAw2SHO8Le8bib5Ci7Q0yKE6UXTmaXhhpwNUS6BAliW46 FqK2Y7giPiuNuNuz+BMDWrmbGf6hZElzm5VQ0xrRe9UPUW4DRShjJZGfFj8XaYMcOw45 mQRIuRDrUQDlOqCa+r+4jL/NAqoIDimqY7IBIDDHTt8SZrNIaI2lGYQBv25CzSU2/ymX CGug== X-Gm-Message-State: AOAM5339YECP/Bcfj5rzF0rUe/rPf6t9nu8PGwnPBso/3oqAP7IixiUw HiNaip6cULyi2pa4KyB4STWTGg== X-Received: by 2002:aed:2237:: with SMTP id n52mr2160281qtc.83.1591235606250; Wed, 03 Jun 2020 18:53:26 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id t74sm2986439qka.21.2020.06.03.18.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:53:24 -0700 (PDT) From: Thara Gopinath To: rui.zhang@intel.com, ulf.hansson@linaro.org, daniel.lezcano@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org, robh@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 v6 4/6] soc: qcom: Extend RPMh power controller driver to register warming devices. Date: Wed, 3 Jun 2020 21:53:15 -0400 Message-Id: <20200604015317.31389-5-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604015317.31389-1-thara.gopinath@linaro.org> References: <20200604015317.31389-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v3->v4: - Introduce a boolean value is_warming_dev in rpmhpd structure to indicate if a generic power domain can be used as a warming device or not.With this change, device tree no longer has to specify which power domain inside the rpmh power domain provider is a warming device. - Move registering of warming devices into a late initcall to ensure that warming devices are registered after thermal framework is initialized. v5->v6: - Moved back registering of warming devices into probe since Bjorn pointed out that now the driver can be initialized as as a module, late_initcall will not work. Thermal framework takes care of binding a cooling device to a thermal zone even if the cooling device is registered before the thermal framework is initialized. drivers/soc/qcom/rpmhpd.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index a9c597143525..29e1eb4d11af 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,7 @@ struct rpmhpd { bool enabled; const char *res_name; u32 addr; + bool is_warming_dev; }; struct rpmhpd_desc { @@ -90,6 +92,7 @@ static struct rpmhpd sdm845_mx = { .pd = { .name = "mx", }, .peer = &sdm845_mx_ao, .res_name = "mx.lvl", + .is_warming_dev = true, }; static struct rpmhpd sdm845_mx_ao = { @@ -472,7 +475,19 @@ 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; + + if (!of_find_property(dev->of_node, "#cooling-cells", NULL)) + return 0; + + for (i = 0; i < num_pds; i++) + if (rpmhpds[i]->is_warming_dev) + of_pd_warming_register(rpmhpds[i]->dev, i); + + return 0; } static struct platform_driver rpmhpd_driver = { -- 2.20.1