Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2300911ybt; Tue, 16 Jun 2020 02:24:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZrj2YEmibVMJVeYltqrlpgZl2AQHJe35PqRwaT1IBJ5C/HzAAqvlk3hb16AcrbwpVOYg4 X-Received: by 2002:a17:906:b04b:: with SMTP id bj11mr1869075ejb.516.1592299468913; Tue, 16 Jun 2020 02:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592299468; cv=none; d=google.com; s=arc-20160816; b=u2nBNvQoNklmPNdg1a5maAIOZWU9d9y4BpGe46WoFlckc0WIUp0UYYIeQCwRgy2Iiq tkJ9HCZZK8GyT5ehoOdFYJtqNSSjjTIvu6juGV8gREMIXlVc9NMbH+n/ZbfdAOqcMw7/ xDRZ9mF0qAlw/kGMlVqWwe4xE+2GCqVKZ2mTwIOuy3OJmk4c0jKyFDy6rAdnFLyJYaHD Gs2xed0g3H2fEvJSDNtyCpZ3lfnGZiV48lBq9zNEr8rqBoVQaQyxDLAIpiNwUrx6i8HY ox82NhOLU4ux76ZSBCwhgdb2kyfqYs6WZxIsg5s5NDbvDNKCe9TpDlyqoLZOG7HguaG1 8AKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+wHrMEFkxSMye57oHUOG3l7PNKPowUwTpUrNyYP51eE=; b=SuVM/HDyk32hUj7tePr+U6ca7Nd/IOfM1YBwW+t35xPCG7EMonrToDwMDKgDTNfvlE JON0IjjCqvxdd0+pE8YoLyf6a3WEh6OTi+s85sZx1HCgwfBxT+NZ3XecN92YuVpRkJsz ScdP6H8Zvwj3ddNQEcyi6A/5t+H2wGjCYsDUdEZfcet1RPGJ063t6n15PRvLU2kHru7T nfwjy690wbdgIDGYpJF2Ym0smH43Lv3IwlNYSE1mTo/qe//UTV2ViaO/PrL8ysYCNQQL 6nVN1cDznX3xgBI6X6yRhEaIBOzceitFXhBlSfhQuweUhQ6T+IbrdgV3HxYcw3lJsy8i 7D7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P3LtKPch; 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 v23si9964095edi.391.2020.06.16.02.24.06; Tue, 16 Jun 2020 02:24:28 -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=P3LtKPch; 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 S1727837AbgFPJWR (ORCPT + 99 others); Tue, 16 Jun 2020 05:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728139AbgFPJWM (ORCPT ); Tue, 16 Jun 2020 05:22:12 -0400 Received: from mail-vk1-xa44.google.com (mail-vk1-xa44.google.com [IPv6:2607:f8b0:4864:20::a44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901FCC03E97C for ; Tue, 16 Jun 2020 02:22:11 -0700 (PDT) Received: by mail-vk1-xa44.google.com with SMTP id s6so1431478vkb.9 for ; Tue, 16 Jun 2020 02:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+wHrMEFkxSMye57oHUOG3l7PNKPowUwTpUrNyYP51eE=; b=P3LtKPchCGZi6AsLylkhutT1uyaRVoQxStI7htwR5DFc8uzpiyChRcZUMNiTD66rmR rQJWx94FUnFx9QxhSxXkL4L52UeWm/B07rF6VD8nX6U6h8kjzOjumzRIc8dowg+A3J4i j6Dd+ehlVD5HMEqQ3cyoLBGtfuyDS8nANlDhQ7ZEiMfBnh2yyzk7I3EW5px7VsbWndf8 0gvoE3GrNabmzklxvZvT6yZfl/zOaOvbTWav7k6aKeF0miXPdY3KgTB/4TUv0qPFyPih xlTFxKkaNUeBR9le0uQx/J4w9emkXM6FUzvJH0md6EAPqkJEG4pGTml8Of2MuHq7OMw8 uISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+wHrMEFkxSMye57oHUOG3l7PNKPowUwTpUrNyYP51eE=; b=hOx+rwdelGcXcvTjYeCgcA1k+G/K+g1SJ9swe7QpLWrjehPANPqtBLKllVa3DIST0l G09AKNFJjSwFBjOb5CtjT7TWbFSG+jmXmVQtHwYn07hJE5NrTsR8Pw0uJLasDWHAMlz3 1OkM6fzMU1qV+Og5qSHAEj9KTYktynuqE3GMYImcMlwoU7dtBxBgL+C+ix7Si3AzRpAR 1Y6+cc/xcz1y/jUNeXJEvrJSMbwFzuTM/jrNBBJeIw35xSEjpBtCnK/gJrVZ88uayS+F FD3BhZIL9tLIlT/xpwdO8NWBa95ygW2O1iMGfUHUax3ObJE0ys3HbCuZYYYGbrkqMCle yndA== X-Gm-Message-State: AOAM533+696VaYyP8ypBoU/mAxTbCxi3C8ls51vPEB3pvZ3ElxD6nya4 J6bO83qN9xHwL4kK1DJKUDaT1QCcmau/HlpzDYwxhg== X-Received: by 2002:ac5:cc44:: with SMTP id l4mr821024vkm.43.1592299330804; Tue, 16 Jun 2020 02:22:10 -0700 (PDT) MIME-Version: 1.0 References: <20200604015317.31389-1-thara.gopinath@linaro.org> <20200604015317.31389-5-thara.gopinath@linaro.org> In-Reply-To: <20200604015317.31389-5-thara.gopinath@linaro.org> From: Ulf Hansson Date: Tue, 16 Jun 2020 11:21:34 +0200 Message-ID: Subject: Re: [PATCH v6 4/6] soc: qcom: Extend RPMh power controller driver to register warming devices. To: Thara Gopinath Cc: Zhang Rui , Daniel Lezcano , Bjorn Andersson , Andy Gross , Rob Herring , Amit Kucheria , Mark Rutland , "Rafael J. Wysocki" , Linux PM , DTML , linux-arm-msm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Jun 2020 at 03:53, Thara Gopinath wrote: > > 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 Reviewed-by: Ulf Hansson Kind regards Uffe > --- > > 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 >