From patchwork Wed Oct 16 19:37:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 176518 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7827171ill; Wed, 16 Oct 2019 12:37:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPbCTqMSlxur7tIqSnqi0zsz0wEnO2pG61Yrxgfi10LfjuazrPkU/8dtfj2o8YcCnuX5z2 X-Received: by 2002:a50:af45:: with SMTP id g63mr40527746edd.21.1571254652296; Wed, 16 Oct 2019 12:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571254652; cv=none; d=google.com; s=arc-20160816; b=cVE31PXJCQZv2NjZnsUtUrlZ194AySOIwPQVToQ5lfjIqSQuTBABT7LtrTwCOHiCNv OQKo8CqsNvhxwyuf4IeYmhaurHgj22A5iTLomtsJfNmOUIjvv0p7jTmDoaI4JpTuYbda ojx154iFjH1Zh7IqYnAqo1YD+Kb4TibB0w3ZPd9JoP9QpAEP4iPocUt/7fmkqoujQeeu Yh+dV/3pf/+bE5LFmsM/96kGUSM1t5U41SwPPwW87NrZrTi6nie9cCscLnuyhVocTLW9 SGikrTQMs6UxfklMYqr76DL/mGB2e2t0zG6JayVDi0u/wPdx2J8lR1R2AE/kYP3xCk5f H4Rw== 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=O+e4P1QVmJfIMHeM4ld6pm/7hZNUvEAXXUg+herLbDU=; b=UanvjxiHRoJmNK14xoQbUVP0ZinCdEwVx7cZAkxugqsoCKjXOukMV6FtVJJXzEa0NX pW7NJaQN2p8FK0/EH+OBbhVdJSC67dYaXthbZ37lgTsSf1x3rxI5pe2Lt+9kyuDyYrX+ 6K10kuT+WiiSX6UX2YSRWzryMyqS3XQ93MXkcvOePkMin64FliBPj0rmlJ8MnLp3WwIq LOrAI1JccJe0solV4x8hNoW7K/cuVIenKK8cSP7RY1cPxLspRLrHnGFZmIGpILSIMe// 4hZMHyv7Vvt/Hl6EzF1vKpuPBOqae+kTdqWRYosHzQVvFW3sp29W3hYKxGJmRtSDdruK DnRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Km01FxsN; 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 b20si17195091edc.359.2019.10.16.12.37.32; Wed, 16 Oct 2019 12:37:32 -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=Km01FxsN; 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 S2394427AbfJPThb (ORCPT + 8 others); Wed, 16 Oct 2019 15:37:31 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41356 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394418AbfJPThb (ORCPT ); Wed, 16 Oct 2019 15:37:31 -0400 Received: by mail-qt1-f196.google.com with SMTP id v52so37856990qtb.8 for ; Wed, 16 Oct 2019 12:37:30 -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=O+e4P1QVmJfIMHeM4ld6pm/7hZNUvEAXXUg+herLbDU=; b=Km01FxsNsfs4bfJReg3ItWzLtqe5B6Zko3KM06evWv/KNiIuJmW3EURmoJ/YfVReQZ c7A8hFKcFVaNiESaiYjOmaKeunxu2c3xRSSzOFGUmgxQS0kp1RktUlidPtxe0YcrIOB9 RfFmTETa21tkhEcOJP1oxGYwqhQLtuzYcVAb+d2UTJ2HsSeoga+fmks2RbmozcyQ2Wn0 aOXeRGC+taFMKVC0+n0/yfgy/EwaN4/xMApY87zkJ85mivUwoP24IsR1Mj6c8/v95PzF VefQlrEBYFzukAc13s2m7vmLxBrmkbI8rWah6tlJOWbcvHvrNLIG5pV3D/dzaflP+QEh fyrQ== 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=O+e4P1QVmJfIMHeM4ld6pm/7hZNUvEAXXUg+herLbDU=; b=lASoaijLbspKJiP8YjfGG/kAOACEQkznZnhy4ravSJ7pAi0JA7wHydEsjXlkewgINo 1XxtQbBoAumSng1IndONMS6HLmHeL7ZGqJAjTC0kKUYrSRiGL+oXqhOyv6GuPPK2PEs6 y7otkgq9k4MS6MZxhIjjXZMu1sI/Aggvsvq4EKsn1iiLt+mBMzspK0f0Egfuikpdc1hG XZvAvRJTZR9bXF6P16uXbQJzN3sr9ZOhgJO53PdW1JWR1UNXul3MqDFE+rzCJWzoNJqA PG8hoaGt57/TTaSHmm6E3pmslYeGxRq2Z3a5iZgNQ7za3ZYSJRynOZPULzTc+KNMTzyp SsBA== X-Gm-Message-State: APjAAAXBxNINMa9Z6j0FRlPKYb0FWRfnu9O6+k30dlXHAoS6CNTgnuGO ziI5x2aP5OWeOR6c0/AhZhVBzg== X-Received: by 2002:ad4:408c:: with SMTP id l12mr42407364qvp.210.1571254649895; Wed, 16 Oct 2019 12:37:29 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Oct 2019 12:37:29 -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 1/7] PM/Domains: Add support for retrieving genpd performance states information Date: Wed, 16 Oct 2019 15:37:15 -0400 Message-Id: <1571254641-13626-2-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 Add two new APIs in the genpd framework, dev_pm_genpd_get_performance_state to return the current performance state of a power domain and dev_pm_genpd_performance_state_count to return the total number of performance states supported by a power domain. Since the genpd framework does not maintain a count of number of performance states supported by a power domain, introduce a new callback(.get_performance_state_count) that can be used to retrieve this information from power domain drivers. These APIs are added to aid the implementation of a power domain as a warming device. Linux kernel cooling device framework(into which warming device can be plugged in) requires during initialization to be provided with the maximum number of states that can be supported. When a power domain acts as a warming device, the max state is the max number of perfomrance states supported by the power domain. The cooling device framework implements API to retrieve the current state of the cooling device. This in turn translates to the current performance state of the power domain. Signed-off-by: Thara Gopinath --- drivers/base/power/domain.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/pm_domain.h | 13 +++++++++++++ 2 files changed, 50 insertions(+) -- 2.1.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index cc85e87..507e530 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -408,6 +408,43 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state) } EXPORT_SYMBOL_GPL(dev_pm_genpd_set_performance_state); +int dev_pm_genpd_get_performance_state(struct device *dev) +{ + struct generic_pm_domain *genpd; + unsigned int state; + + genpd = dev_to_genpd_safe(dev); + if (IS_ERR(genpd)) + return -ENODEV; + + genpd_lock(genpd); + state = genpd->performance_state; + genpd_unlock(genpd); + + return state; +} +EXPORT_SYMBOL_GPL(dev_pm_genpd_get_performance_state); + +int dev_pm_genpd_performance_state_count(struct device *dev) +{ + struct generic_pm_domain *genpd; + int count; + + genpd = dev_to_genpd_safe(dev); + if (IS_ERR(genpd)) + return -ENODEV; + + if (unlikely(!genpd->get_performance_state_count)) + return -EINVAL; + + genpd_lock(genpd); + count = genpd->get_performance_state_count(genpd); + genpd_unlock(genpd); + + return count; +} +EXPORT_SYMBOL_GPL(dev_pm_genpd_performance_state_count); + static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed) { unsigned int state_idx = genpd->state_idx; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index baf02ff..e88e57f 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -117,6 +117,7 @@ struct generic_pm_domain { struct dev_pm_opp *opp); int (*set_performance_state)(struct generic_pm_domain *genpd, unsigned int state); + int (*get_performance_state_count)(struct generic_pm_domain *genpd); struct gpd_dev_ops dev_ops; s64 max_off_time_ns; /* Maximum allowed "suspended" time. */ bool max_off_time_changed; @@ -204,6 +205,8 @@ int pm_genpd_init(struct generic_pm_domain *genpd, struct dev_power_governor *gov, bool is_off); int pm_genpd_remove(struct generic_pm_domain *genpd); int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state); +int dev_pm_genpd_get_performance_state(struct device *dev); +int dev_pm_genpd_performance_state_count(struct device *dev); extern struct dev_power_governor simple_qos_governor; extern struct dev_power_governor pm_domain_always_on_gov; @@ -251,6 +254,16 @@ static inline int dev_pm_genpd_set_performance_state(struct device *dev, return -ENOTSUPP; } +static inline int dev_pm_genpd_get_performance_state(struct device *dev) +{ + return -ENOTSUPP; +} + +static inline int dev_pm_genpd_performance_state_count(struct device *dev) +{ + return -ENOTSUPP; +} + #define simple_qos_governor (*(struct dev_power_governor *)(NULL)) #define pm_domain_always_on_gov (*(struct dev_power_governor *)(NULL)) #endif From patchwork Wed Oct 16 19:37:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 176524 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7827650ill; Wed, 16 Oct 2019 12:38:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0uj1VZNDkr0czLefKF7IZWb6GosZ4lktrImbkkU86SOQAJ7yVFPKU75+V/QJlTtsrvk2T X-Received: by 2002:a17:906:9246:: with SMTP id c6mr40633087ejx.64.1571254681541; Wed, 16 Oct 2019 12:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571254681; cv=none; d=google.com; s=arc-20160816; b=sguuDll01hpEEBI7Hd9n7xpKV7VSPGKdkQnEeLNMv7N/4a8lo6zMjN2ZtUGWL3zC63 mEb9cmKkh4YBLoKgVKjKG8N+TsD54fVDDFuZHHPLs5v5pYVD9g92LjgOaK033Z+nrAbp kLPfyD/8qoH82E+wM1EGF+NvrtmaLe2otieeVZxF72zi3dCRqQW6C4Ppa6Ax2GeklsUC 9D02PX6/0XK78sSBIW4c2Qx4MjzxncV5yAnMYi825laSgfMwdTmtXgb3ukBvYzZ9y6Al EsbnhP5ARg6M6lxKYoZXvIHEo9ocVwGiwMqoxEWhV6VOJfmOaJfeTdImBGJhiXfsfmt6 6DpQ== 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=38nUlQ280db1teoWXJr5goa3S5XCcmnJve1ialuZYvw=; b=NwG5zGRgs0pG8otcVH/pPSODSXMPJCiIDfl+/x7fWdCz4oxBLh/3lexFKpG6X32cUp ll5IwUUEEA8wnmqSYb5z8eBJXgzWukYXluOi4Gv0uGHNfNCJC7Q1p1rSUWhIckVPWL4m IqiQBENNrtDrdyBTfFrfuxSIIp6vtJcltsD/QSBpBUcpI0WGeJv8+/mIEIyqZKlJsvk+ uewAq3MbnakU5UgHEDCpU0xdZiB3hBztJxqI5lgP6uGDhpVl/AXDcNLtkc5HAnvAnz1G Ndi2PH6x2/jsxckMh0yjpWVDuLh7uXqDz/GqbiefJqA3jtqbRysaNKJuvnopflWwfOuz AtgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="v/D8Y7BX"; 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 64si13894702eda.384.2019.10.16.12.38.01; Wed, 16 Oct 2019 12:38:01 -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="v/D8Y7BX"; 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 S2394527AbfJPTh7 (ORCPT + 8 others); Wed, 16 Oct 2019 15:37:59 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:40173 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394474AbfJPThh (ORCPT ); Wed, 16 Oct 2019 15:37:37 -0400 Received: by mail-qk1-f194.google.com with SMTP id y144so23894971qkb.7 for ; Wed, 16 Oct 2019 12:37:35 -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=38nUlQ280db1teoWXJr5goa3S5XCcmnJve1ialuZYvw=; b=v/D8Y7BXvaM6J4ToYwytgKAszlQ2KPBpo663ZehSYFofsjHDLPgvmwgVr48dLKV60q k4/IV1qmrP/bfQfepJLIsGocha/KYKZ8DESwYGMfwGsTZPYXRRw1ZgFI90lobiPBlPAD ow9KSH+phCTVKdYntLWqt3ePrOfmK1x0gzrKWJRRxWJirQ2OCwKDLeURiSTda23mrnxu HTDA3C1XcYVCScZ6AJmseKbJbmoIbtA0L53LE2GYEfhFgiiAYX7/d/dpB7TiU7zJkcWl isPwThklVOYKgez/NZtjSjWTUPudlv9K1GvMe+JLN7A+hxG8wvwY3il1ocf5JPlSOc4k Ipvg== 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=38nUlQ280db1teoWXJr5goa3S5XCcmnJve1ialuZYvw=; b=KroQxIpzDLFDqNONZhc3hap2xQO2zKvsk3uEL0sOeOhP+CA/Czv1ZBad53LUbxPf8O mNill9rEljutuhMCGIqyts81IAjnx4fqMZxk8FcouqlXwHQCYlWOGoqb9HjdYomIQ3hG 7KyLJSgxpQ/eMXiYx3lmC96wlUvOxI94Zn5gma50lxMmt3UdErN78JartjlXPDjMeG6K KVox9b/KIZBCLr6uTG4Ao6N/Ow041GF8KLNCN66HXpkcKTvFWtVccu3TMpGQx3nVzKaW P8TSBKZWeuiqipfd0x2I3fY7LrFunVjj7svzrGEIv4AukwRCqTYH6oMM58ry5ghweeV+ FxmA== X-Gm-Message-State: APjAAAX7m2RMKBaNTh5Rv2LJ5SborNaf9onG4ZT3IvUihfI4/VSAxzSm RvDLc6U3JkOnWPuo3+g+F4kFoQ== X-Received: by 2002:a37:ef04:: with SMTP id j4mr43633188qkk.482.1571254654648; Wed, 16 Oct 2019 12:37:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Oct 2019 12:37:33 -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 4/7] thermal: Add generic power domain warming device driver. Date: Wed, 16 Oct 2019 15:37:18 -0400 Message-Id: <1571254641-13626-5-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 Resources modeled as power domains in linux kenrel can be used to warm the SoC(eg. mx power domain on sdm845). To support this feature, introduce a generic power domain warming device driver that can be plugged into the thermal framework (The thermal framework itself requires further modifiction to support a warming device in place of a cooling device. Those extensions are not introduced in this patch series). Signed-off-by: Thara Gopinath --- drivers/thermal/Kconfig | 10 +++ drivers/thermal/Makefile | 2 + drivers/thermal/pwr_domain_warming.c | 136 +++++++++++++++++++++++++++++++++++ include/linux/pwr_domain_warming.h | 31 ++++++++ 4 files changed, 179 insertions(+) create mode 100644 drivers/thermal/pwr_domain_warming.c create mode 100644 include/linux/pwr_domain_warming.h -- 2.1.4 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 001a21a..0c5c93e 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -187,6 +187,16 @@ config DEVFREQ_THERMAL If you want this support, you should say Y here. +config PWR_DOMAIN_WARMING_THERMAL + bool "Power Domain based warming device" + depends on PM_GENERIC_DOMAINS_OF + help + This implements the generic power domain based warming + mechanism through increasing the performance state of + a power domain. + + If you want this support, you should say Y here. + config THERMAL_EMULATION bool "Thermal emulation mode support" help diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile index 74a37c7..382c64a 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -27,6 +27,8 @@ thermal_sys-$(CONFIG_CLOCK_THERMAL) += clock_cooling.o # devfreq cooling thermal_sys-$(CONFIG_DEVFREQ_THERMAL) += devfreq_cooling.o +thermal_sys-$(CONFIG_PWR_DOMAIN_WARMING_THERMAL) += pwr_domain_warming.o + # platform thermal drivers obj-y += broadcom/ obj-$(CONFIG_THERMAL_MMIO) += thermal_mmio.o diff --git a/drivers/thermal/pwr_domain_warming.c b/drivers/thermal/pwr_domain_warming.c new file mode 100644 index 0000000..60fae3e --- /dev/null +++ b/drivers/thermal/pwr_domain_warming.c @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019, Linaro Ltd + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct pd_warming_device { + struct thermal_cooling_device *cdev; + struct generic_pm_domain *gpd; + struct device *dev; + int max_state; + int cur_state; + bool runtime_resumed; +}; + +static int pd_wdev_get_max_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + + *state = pd_wdev->max_state; + return 0; +} + +static int pd_wdev_get_cur_state(struct thermal_cooling_device *cdev, + unsigned long *state) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + + *state = dev_pm_genpd_get_performance_state(pd_wdev->dev); + + return 0; +} + +static int pd_wdev_set_cur_state(struct thermal_cooling_device *cdev, + unsigned long state) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + struct device *dev = pd_wdev->dev; + int ret; + + ret = dev_pm_genpd_set_performance_state(dev, state); + + if (ret) + return ret; + + if (state && !pd_wdev->runtime_resumed) { + ret = pm_runtime_get_sync(dev); + pd_wdev->runtime_resumed = true; + } else if (!state && pd_wdev->runtime_resumed) { + ret = pm_runtime_put(dev); + pd_wdev->runtime_resumed = false; + } + + return ret; +} + +static int pd_wdev_late_init(struct thermal_cooling_device *cdev) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + struct device *dev = &cdev->device; + int state_count, ret; + + ret = pm_genpd_add_device(pd_wdev->gpd, dev); + + if (ret) + return ret; + + state_count = dev_pm_genpd_performance_state_count(dev); + if (state_count < 0) + return state_count; + + pm_runtime_enable(dev); + + pd_wdev->dev = dev; + pd_wdev->max_state = state_count - 1; + + return 0; +} + +static struct thermal_cooling_device_ops pd_warming_device_ops = { + .late_init = pd_wdev_late_init, + .get_max_state = pd_wdev_get_max_state, + .get_cur_state = pd_wdev_get_cur_state, + .set_cur_state = pd_wdev_set_cur_state, +}; + +struct thermal_cooling_device * +pwr_domain_warming_register(struct device_node *node, + struct generic_pm_domain *gpd) +{ + struct pd_warming_device *pd_wdev; + + pd_wdev = kzalloc(sizeof(*pd_wdev), GFP_KERNEL); + if (!pd_wdev) + return ERR_PTR(-ENOMEM); + + pd_wdev->runtime_resumed = false; + pd_wdev->gpd = gpd; + + pd_wdev->cdev = thermal_of_cooling_device_register + (node, gpd->name, pd_wdev, + &pd_warming_device_ops); + if (IS_ERR(pd_wdev->cdev)) { + pr_err("unable to register %s cooling device\n", gpd->name); + if (pd_wdev->dev) + pm_runtime_disable(pd_wdev->dev); + } + + return pd_wdev->cdev; +} +EXPORT_SYMBOL_GPL(pwr_domain_warming_register); + +void pwr_domain_warming_unregister(struct thermal_cooling_device *cdev) +{ + struct pd_warming_device *pd_wdev = cdev->devdata; + struct device *dev = pd_wdev->dev; + + if (pd_wdev->runtime_resumed) { + dev_pm_genpd_set_performance_state(dev, 0); + pm_runtime_put(dev); + pd_wdev->runtime_resumed = false; + } + pm_runtime_disable(pd_wdev->dev); + thermal_cooling_device_unregister(cdev); + kfree(pd_wdev); +} +EXPORT_SYMBOL_GPL(pwr_domain_warming_unregister); diff --git a/include/linux/pwr_domain_warming.h b/include/linux/pwr_domain_warming.h new file mode 100644 index 0000000..ed9942b --- /dev/null +++ b/include/linux/pwr_domain_warming.h @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2019, Linaro Ltd. + */ +#ifndef __PWR_DOMAIN_WARMING_H__ +#define __PWR_DOMAIN_WARMING_H__ + +#include +#include + +#ifdef CONFIG_PWR_DOMAIN_WARMING_THERMAL +struct thermal_cooling_device * +pwr_domain_warming_register(struct device_node *node, + struct generic_pm_domain *gpd); + +void pwr_domain_warming_unregister(struct thermal_cooling_device *cdev); + +#else +static inline struct thermal_cooling_device * +pwr_domain_warming_register(struct device_node *node, + struct generic_pm_domain *gpd) +{ + return ERR_PTR(-ENOSYS); +} + +static inline void +pwr_domain_warming_unregister(struct thermal_cooling_device *cdev) +{ +} +#endif /* CONFIG_PWR_DOMAIN_WARMING_THERMAL */ +#endif /* __PWR_DOMAIN_WARMING_H__ */ 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 = { From patchwork Wed Oct 16 19:37:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 176521 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7827309ill; Wed, 16 Oct 2019 12:37:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6eRJ6M7v9PJ5G+Hoo6+Thd9fPojccwJK7lm2v88Oldx2uUtVfIqFt11guIlhpYMFyhGG8 X-Received: by 2002:a05:6402:160f:: with SMTP id f15mr40872812edv.142.1571254660869; Wed, 16 Oct 2019 12:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571254660; cv=none; d=google.com; s=arc-20160816; b=UP1ixhlGKm/tOiPWnjuilAv8zhmWt+NPFokOzcVuBsnJiRUVf4u1LArw7YS6Gvhl05 8HmTHd4yqy6CfmT8ZWMyQA/NDg1SHJa2zcaZAX5m/9GDwATgFSqqRBl1ICOVM9CIarQb BJ3sdThqLVYp3ON65WOmqhgsA+YpDAIuUXLIf+XgCZ8RCcKp4fizWkiiPyefhdScF/Hz BamUOAVBJYxVEJS8TNX1MEoqKzSwifbDstSR+WmoeA44l/GJjfrXZ5sdCxO15ZyD917A 3T/+wAHgwYpXt45XyNAIrjn6psljTq5MmIEclEARXe4ehOq3Oi4DWzDGdeqjd3DlhZWH KfLA== 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=n/EfPfS/rzayptMKHYVpYurUSNAbaOippVZDRNzUE4k=; b=bE2W0WWDxu+/8/T4GMXn9v8HQ+Ue3CaRzCEwDE3v2enzVEgOPYkcodvOZULPl+tlk0 I+OIMZYku6xqrqHwgRSR0l54yTj2g+S2/Nn+BZ+hQggBEiCC/ttPY/OvO8uKy/BS4iRy CCqBsYTSp1OwHJRCibHKFHJh5JILg8XUQNusdjHB59WmrqyaVOyFPk8rmdMFjn//eRCT Gc9QnD0Va9+GgzQOMa7cyeOCrNVkqt/+6jNjC0+Y/tUHkeXW9cNokJGwAyiRJkn+WCBQ k4dRSBJGvubXQn1hiKZY5sC1D6TqQLP9/NjQw3BBEsgooUvRGcVERi0p53EcO3634Waf CNeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F7ysRnFJ; 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.40; Wed, 16 Oct 2019 12:37:40 -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=F7ysRnFJ; 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 S2394487AbfJPThj (ORCPT + 8 others); Wed, 16 Oct 2019 15:37:39 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:46744 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394464AbfJPThi (ORCPT ); Wed, 16 Oct 2019 15:37:38 -0400 Received: by mail-qk1-f193.google.com with SMTP id e66so3350171qkf.13 for ; Wed, 16 Oct 2019 12:37:38 -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=n/EfPfS/rzayptMKHYVpYurUSNAbaOippVZDRNzUE4k=; b=F7ysRnFJGgjboY0XKIl3CtLjZJFKjN3OJG4bCNjVjWav0TojjT7TlmD3PaAM6iQR9u GcS1Z5nBswY2DKOKvyJO/RvfLfj7i0rWvBNgLB88JfwDCy5oYNpt7b3atBSY+sipZjr/ bF5X2OMqJwz/Ou9jLpokuEH3QARY+FUTC2MiGwgqv9Gde2DlexNMDXUSZgQdneRlaFB6 lqGBlMzHG+5HX+EN8CN0rrN6Hfi+wrfQBnR00tko+t/VJLtGGAEm6fvdThSOJikYa+wi /vD0th1bPwVwJYlguPu+7gbN0zL9mEjngSxc6XxE+EeeqafD4MbtcpRxcc50fYQdkQNM iyfg== 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=n/EfPfS/rzayptMKHYVpYurUSNAbaOippVZDRNzUE4k=; b=pFGlcHnISASnVbxedE3hHPioz2wEY7R/YrG37obq+j6gWdC2kSdNz/yxlsbdaUtZGu X/ni/ex4i/ut00DoV8yuL9gienrkDYfkYTFlmz7kMYDQxfonD/TSbyloDGLxKVnbYP88 ZIi3rcoTdEXiwL/+eZBWLZ33A3FILat3uO3+EIlm5wZuaevcUZMt0anIpsyTB1STXtZf /9RKn3VNQ+dZpwZQ76zMaEBqAJKB5QjPlgDH0I97+2YHm5VflMz3kPdMpSUXj6rAMPzQ VB9GEEv+7HOu5x9VuXsLn1YVvTag5GoFExtmxxEsLuFBUiPh2fFLnraaPGZuKdBPdCV5 WZZQ== X-Gm-Message-State: APjAAAW0ZEIX81AY+bqoSAH3Y8vXRfwlmhGWD4F1A+CBDmpBgeHL0aGn r4ZiG5QTkOY8H7rb1TocQ4g+HA== X-Received: by 2002:a37:907:: with SMTP id 7mr43233321qkj.129.1571254657726; Wed, 16 Oct 2019 12:37:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Oct 2019 12:37:37 -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 6/7] dt-bindings: soc: qcom: Extend RPMh power controller binding to describe thermal warming device Date: Wed, 16 Oct 2019 15:37:20 -0400 Message-Id: <1571254641-13626-7-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 controller hosts mx domain that can be used as thermal warming device. Add a sub-node to specify this. Signed-off-by: Thara Gopinath --- Documentation/devicetree/bindings/power/qcom,rpmpd.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.1.4 diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt index eb35b22..fff695d 100644 --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt @@ -18,6 +18,16 @@ Required Properties: Refer to for the level values for various OPPs for different platforms as well as Power domain indexes += SUBNODES +RPMh alsp hosts power domains that can behave as thermal warming device. +These are expressed as subnodes of the RPMh. The name of the node is used +to identify the power domain and must therefor be "mx". + +- #cooling-cells: + Usage: optional + Value type: + Definition: must be 2 + Example: rpmh power domain controller and OPP table #include From patchwork Wed Oct 16 19:37:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 176523 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp7827354ill; Wed, 16 Oct 2019 12:37:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzawhXDZf9wQaDLfroKky4Vns6qg5Wkj8/hLvgUpTiF+NACsN19EdkD3OTWvHyXZziv2mhE X-Received: by 2002:a05:6402:32a:: with SMTP id q10mr42199027edw.149.1571254663896; Wed, 16 Oct 2019 12:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571254663; cv=none; d=google.com; s=arc-20160816; b=BsV0/yjMqsRhpu1Q2cUUQ4e9B8HQxKw3sITI4SkbnBaQCgMJLAiMZdf96Uv3PRd3Mg 7PgE2D4rKvDJJUj2OQ0V9TmdXEUNskz+oHF6fPBUS4esURLDRn6ajzR4KbzRtCD9OQeA wJ2XahSijSLarrUK/mOuwBNRm0kUjtporM5tzApt/+XpjoFpZi/uyPlO93y02ooO63en 5PvzBF+zqLP3wqhWLzDcuiVRL5W4CBG2yy8YvrsSdUOBUkyPyW3dZm//6m2+D7A29uic RSO67lIeKoK7epXSnDxhnTtjXg/F8xneFI+PSCRrJbITp0Ct1naCrz2bMWiLZ9j9Mtp5 Dihg== 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=97s95T4wB8D9WrZ0/COnoxS/a+SRIAWB8dyFC3vn+tQ=; b=KKXPkg5VHsWcThqS+d3O0be+5KlplgXftYJ70/Yc17Cy2RDyB33eu6S3VWsKivjfZg WulFYwhfvB5wFbg2DZ2UewplbMjS3c3JBecXmQL51MJo3iHWnzErdvJAXDMJbGoZJq/9 C+Z9z0p8Xiy3uS1mWm2vyMK6t2CtC9dscqJ2BO/j1/hWyFY2Rid31UfnpzDjh7LsTM9n S8lFczwJ5kznIgh4cFylVMEyFIEis1+PfaITi3do7Ls2MXUSqac5AqRVKCHUhdCQcus/ k2HcC9ndmiT7/RSN2iIQwj3n+qsb6WuslhKjXSJJVMcmgdDoL2b7YyN3vzSHXMZFCk5e ueaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GlwUaK99; 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.43; Wed, 16 Oct 2019 12:37:43 -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=GlwUaK99; 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 S2394504AbfJPThm (ORCPT + 8 others); Wed, 16 Oct 2019 15:37:42 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:40183 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394499AbfJPThl (ORCPT ); Wed, 16 Oct 2019 15:37:41 -0400 Received: by mail-qk1-f194.google.com with SMTP id y144so23895235qkb.7 for ; Wed, 16 Oct 2019 12:37:39 -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=97s95T4wB8D9WrZ0/COnoxS/a+SRIAWB8dyFC3vn+tQ=; b=GlwUaK9975uKLB3Il8iCJWGw/WsurZbpXrfmvB0+cOiSlTw33tqB9UabOx9UJXv+Py Ysh/dTg6ZIn4vamzHcJM6xAi+ICquA2136RhPwyUOL8hSeVjsNtkt7Sl7oRNq6Xpm7OZ fsofHsRW4JP2sDrS9ml6JUy5xcCUNdSnzWE+RwqfZYdptSJEF9AvxmqycZAFKSflbzNd /HKCAjlNMVxg1QsA7M4yAJyT0hrPGZ1lc89+aXpqKYp7sJ/p7JNvrSqYz7DKG3yclS6O YNjQ6KcDd7F1Yxc0kARpql5np+oJ3Nj+EhLex92Qsd2OkJm1dXy7GUXDMMDIuH2X3Wdq jfxw== 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=97s95T4wB8D9WrZ0/COnoxS/a+SRIAWB8dyFC3vn+tQ=; b=coTx8Thy02abB8GceL3TJGA7eJv/lY9c62Sf+Fj9PsuVo+bvT47/Lvu+M710kKv3cY 2s/NaRBmTlY9zYyNiSW7ViKPh/cr6jJ1JMzxSygp7DLc/AwZ3WgndsesgK6HMRzKD1BD ErorJsXnZEmdXX+YYKiyBjNptFEipWjnmT8YJXQb9ZzV2EKutZpr+a0OcNx2+CDUP6O0 vi7rVCrgro/WEa0qsl90gxpJz3isjaYNUn0J7eA8Uc3v/LkzNZdpFjleO5/rJ1rqBddy pJgrKp/mBVA+aAa2z5ABI+TD6aUvXxhb5TWXwfKM4bSw9k9n4FhX05TTzeJHJ69hP90O iJjQ== X-Gm-Message-State: APjAAAWpf1YhqhcPCoPsPDuA4UDjoGsP2GQBZqjxHFSh0veiKupoEGC2 5TvMOiEfNUK/ahedhqUA2j63ZQ== X-Received: by 2002:a37:4146:: with SMTP id o67mr28594780qka.23.1571254659370; Wed, 16 Oct 2019 12:37:39 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Oct 2019 12:37:38 -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 7/7] arm64: dts: qcom: Add mx power domain as thermal warming device. Date: Wed, 16 Oct 2019 15:37:21 -0400 Message-Id: <1571254641-13626-8-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 hosts mx power domain that can be used to warm up the SoC. Add sub-node to rpmhpd node for mx to be recognized as thermal warming device on sdm845. Signed-off-by: Thara Gopinath --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 5 +++++ 1 file changed, 5 insertions(+) -- 2.1.4 diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index 0222f48..0671c8a 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -3788,6 +3788,11 @@ opp-level = ; }; }; + + mx_cdev: mx { + #cooling-cells = <2>; + .name = "mx"; + }; }; rsc_hlos: interconnect {