From patchwork Wed Nov 20 12:56:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 179839 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2063946ilf; Wed, 20 Nov 2019 04:56:47 -0800 (PST) X-Google-Smtp-Source: APXvYqzfQA5VBGzw67VBh8i1umJYH2QGjiQAYOdfCoF/6wnjw/tH561fTjLdf2MRM6f8SaGfWOcP X-Received: by 2002:a17:906:d9c4:: with SMTP id qk4mr5115302ejb.214.1574254607112; Wed, 20 Nov 2019 04:56:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574254607; cv=none; d=google.com; s=arc-20160816; b=EiCq7Hd3I8ClfbotGzYT+t0xcjuwtlam8RUdHfVyCFJDTJAeitTm3XnQ5S4lVjEbKM Y0TRKM9lAlbYfQM0KoEbeE1ZFkO519jla9gJa571n4S0D23A4NfkwaEKHd89yRFYgNzK lRAfp+3eR8yYHiVigNrAQ8eInfl0AiOgAamN34RfJxjxlBjJUk1RYPcK6D65P+Oa0BIc K0fqxu3puN0+KjoFmNeGoM1apT382/vsckZ7atYwJnSB3O2t4xMaKILT9wuegsSFxo/9 dKuRGOfI7fxyJx9l5zt9vqaKah2HUXOqG99cL7Oo0bpUM/5w5VQckr2vPi1doL4uNuMo gGFg== 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=e3cBvCJGRcxYKob0R3G9a3fkI3S2TOmBRjT4BE52Zwg=; b=MNdEx4UkxC+Sds73BM2jZGT96t2HM5WmtAzp59WMLRvPHcncRp/RqP9XVyDz7Ufn8P kve0ZRXJUHpO18eVKjaQIM6J11M/XI1gLwMrCq2okpMlka4Ckn/c33qSIUD20vQ3AVko Uk6nlbQqLgI6/tlDWWx5gH3Nfaz+/cWoEjUNb/lizz1MntbzJHlyqozxHXeWkkRt0nHt WJsDFz80gYUoqIBL38I7n2uBBFWG291n31shlQKiTiV5P9AJ3m4ZWs0q9jEjcKkvFsVb u6JiGtDhLgg1auXi71KKIAFRngqB8WNPpoeVeR4PrVDimPP/SICPsqQojhMPA3LO7PtF A8Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ArXeuvGp; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 c12si18495326eda.402.2019.11.20.04.56.46; Wed, 20 Nov 2019 04:56:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=ArXeuvGp; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726477AbfKTM4p (ORCPT + 10 others); Wed, 20 Nov 2019 07:56:45 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:38854 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728243AbfKTM4o (ORCPT ); Wed, 20 Nov 2019 07:56:44 -0500 Received: by mail-qt1-f194.google.com with SMTP id p20so28806208qtq.5 for ; Wed, 20 Nov 2019 04:56:44 -0800 (PST) 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=e3cBvCJGRcxYKob0R3G9a3fkI3S2TOmBRjT4BE52Zwg=; b=ArXeuvGpoBlrfpILMx/M83+Zn/RbRWXihN50pPnTAw2ZLLkb/hp/kzXGE4e3pJcJ3R gsYaNqlAFKy0EJHJMMUsBRCdN68xbd0/u9HLA/lwkwTiRIie2u8OQ4ubtENtMbs+NnKA Cmru7KlvSqU/6oQTWAAxXSVXZ6dwfTVAU3AzwldjvPeVnpnzaSmGsFp5a7oWXickOmYY lTxHgbpbFs/+r9OWV46swlR8FLMWOQm2U4HrrqbOFOYw4nt/ffV6HidWqcKbMNWUSzi9 AvukxXBhZ5W7XQoSKlFGkGDOkaR04e6y3vxHPJgKzQqCIvZauZdPMGjAh/jNQPeUlWKf 7XSQ== 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=e3cBvCJGRcxYKob0R3G9a3fkI3S2TOmBRjT4BE52Zwg=; b=O3U8N2FrXLMPTdy5MrhDjahoK3mCuZSUzYKB2I9Piry3zAfhJ21nX5/WfrRccwKM2Y Bs7qrExEV1SkJEV3AU77xeHh/SZfaCeLUYphITsx55ZZbIOApu4VHbi5+3+uTw7GJ6ft nBlUw3fKngoo8/fiUyERkfNU0FitZemSi0Lpo1FH9ti/PVa1IktrPYU32f8NnC1X0Uh6 Y7+HUP4Qw9VoF9ZRcadyucoKVUNSf3tDlDT2+8HM7pb+V70tvmRj0roIObPHDX+wSJz2 Nyl6yjtR27vi5n6K31BZTFo5F10j2VEuAwORrSkShhwjMWjSaTFHHKrmUal3WFmelCTb bqSw== X-Gm-Message-State: APjAAAWkBm1NU8/dDUtpMr713wSSDitE6yB6yvSYADZ8HPlsFk5oeH/O 7ZxFjzxgEPNg5bmAhUXGr4tnyg== X-Received: by 2002:aed:3c0a:: with SMTP id t10mr2434630qte.173.1574254603451; Wed, 20 Nov 2019 04:56:43 -0800 (PST) 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 r2sm14109637qtc.28.2019.11.20.04.56.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Nov 2019 04:56:41 -0800 (PST) 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 v4 1/7] PM/Domains: Add support for retrieving genpd performance states information Date: Wed, 20 Nov 2019 07:56:27 -0500 Message-Id: <1574254593-16078-2-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1574254593-16078-1-git-send-email-thara.gopinath@linaro.org> References: <1574254593-16078-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Ulf Hansson --- 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 Nov 20 12:56:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 179841 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2064073ilf; Wed, 20 Nov 2019 04:56:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzxB7HLs1EzQJPLWUygl+XZBY3JggC6Nuan80sUjOqfkrB8mtDIa3jsjL0brH318T7hZTfO X-Received: by 2002:a17:906:b25a:: with SMTP id ce26mr5255034ejb.13.1574254614352; Wed, 20 Nov 2019 04:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574254614; cv=none; d=google.com; s=arc-20160816; b=ezyLAjKBeyhxuWyCSx0mhdPWWUcWe/NPuL2ZuxEadelErJYX9j3BPLBHRysU/SlU9j QJotf6+ADBou4GQnqckzxZw37+sxrjLlCHcEDH9FoAViR8LcvfU/QKOIBZnI6nWYsACe f8CnGM407+w4kk3mASin3M/PCPJR/MohWNxfUkGD6MKCK84oeCHJqs4eD74YLLLnK59p KRf9sFf1i9U7JTrbnl1uRwx6rOU4BL700kDZsBNLcv1knt/ezYxJXw+muSTrEyuAs5Vu 87aBDVFOq5yYL02y8UAoVzI+YjIZ3j+BVdQEKNUW4ztNPnUbSkUHuJrZaFVahL//oqbb GR4w== 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=wtD/eNE9TAmXsnR2IF1O0WWLLWtlBArf0uI74fbpZrc=; b=WceFT1VICSpocEcpGnTapdInklKQWWJXt5xsGIflKSkWzN7Z5tSdU1TfrJCtoEnoaz CU4lHmNlyqJ8DvKlCT+IrvOcviGkIqR2RDYxcbyf37fK9b9FKOD2EgiFMVQMQS4eN8f9 MKqa0roDndipxaTQGwz8p2goQ2P+Rzz0qK5fHQs/119LEMuGcLC0bKEeYLPUEvhAtNob E4vn2U4uPrCAEBsol+l0KwOgesu4cPxSxTt9N1yMy69YwGPXPMrtkeHSSiR8JeU+18fb uzBUDcAjqrRK59LFtkhGoD2xobTiYSeEaa9iqI9KJhguYuvIdY1BF0ayhj0tqDZFnsxu sfLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I6Y1ofWc; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 d5si14456121edv.385.2019.11.20.04.56.54; Wed, 20 Nov 2019 04:56:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=I6Y1ofWc; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1729969AbfKTM4x (ORCPT + 10 others); Wed, 20 Nov 2019 07:56:53 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:37276 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729971AbfKTM4w (ORCPT ); Wed, 20 Nov 2019 07:56:52 -0500 Received: by mail-qv1-f68.google.com with SMTP id s18so9652030qvr.4 for ; Wed, 20 Nov 2019 04:56:50 -0800 (PST) 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=wtD/eNE9TAmXsnR2IF1O0WWLLWtlBArf0uI74fbpZrc=; b=I6Y1ofWcZLyq/uKNmdCCl9/kv6h14tQOGMfF99XIcPBr2zXYHDnctewepPWDp45hWX 34HWqvhN/ZLdDC4eL2yFrqN4yMwpNuPs2gY325lwOdWhGvbVEWeInv79vO8V8BfpLlkX 9JEpTyJJiI9ai+op+ZgJtoCD6l2BW8uOj5m+SZi84oFxc+s1N36WSISTqqDbSR4SkY6a tfA/Vovqqcwynhv5sqOdWM5nYh3U1PpHaSsYTvrcJq1FDcTgw41q2YDf8j/3KvRSqifa WQPZ9h2Zo2akBqX6c5sZPSkQ1wzwlOGpsiC5eE8v458CijsaEqC1+rSHLeM+GfHVRbN1 vovg== 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=wtD/eNE9TAmXsnR2IF1O0WWLLWtlBArf0uI74fbpZrc=; b=btm+4zvFgb0UiUGtPMLbLqwe1tKekDX67cLVW17g0FzTOP867f/khNjbkilU2TBsBa nKbl9NLvpR9FjURkGy3TwchTMTNgAskS35HpXnJ15ut/7EfRQC4ebEqfRuBjNsjCL+Nn T0+V7Y/6DlEICctWddF7Huq5kCB1iIWXyyMshzyYhHJESRitM7NCpJaqt27piXta8qwR 94sDpItkRS0hFoJKLjY6OfwCLvMIpIfRLSeCrDeWV6bV2+2MpIM1HWM8YFnbnGbBNEqU AgM7Db32bgLzIWRaboFHM1ngCShXeTCBpWLWmCZ2Pw5Bj0JsQjlrV/6SjiNvKwlT3n2m bFyQ== X-Gm-Message-State: APjAAAWDDY/sQP+Q9xSDdyIWiHxp6tGOkWjvoBliaJ5eekyeDk7H3qi7 nAw6KPDYhsN3am6rn1OFuyDuiA== X-Received: by 2002:ad4:404e:: with SMTP id r14mr2428885qvp.4.1574254609837; Wed, 20 Nov 2019 04:56:49 -0800 (PST) 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 r2sm14109637qtc.28.2019.11.20.04.56.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Nov 2019 04:56:48 -0800 (PST) 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 v4 3/7] thermal: core: Allow cooling devices to register a parent. Date: Wed, 20 Nov 2019 07:56:29 -0500 Message-Id: <1574254593-16078-4-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1574254593-16078-1-git-send-email-thara.gopinath@linaro.org> References: <1574254593-16078-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org With introduction of power domain warming devices, devices that control the power domain are registered as the parent of the cooling device so that the device-genpd hierarchy in kernel is maintained intact. To enable this, introduce a new API thermal_of_cooling_device_parent_register that takes a parent device pointer as input. Also, modify __thermal_cooling_device_register to register parent of a newly created cooling device, if specified. Signed-off-by: Thara Gopinath --- drivers/thermal/thermal_core.c | 22 +++++++++++++++++++--- include/linux/thermal.h | 15 +++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) -- 2.1.4 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index d4481cc..912ba75 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -947,6 +947,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev) */ static struct thermal_cooling_device * __thermal_cooling_device_register(struct device_node *np, + struct device *parent, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { @@ -979,6 +980,8 @@ __thermal_cooling_device_register(struct device_node *np, cdev->ops = ops; cdev->updated = false; cdev->device.class = &thermal_class; + if (parent) + cdev->device.parent = parent; cdev->devdata = devdata; thermal_cooling_device_setup_sysfs(cdev); dev_set_name(&cdev->device, "cooling_device%d", cdev->id); @@ -1024,7 +1027,8 @@ struct thermal_cooling_device * thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(NULL, type, devdata, ops); + return __thermal_cooling_device_register(NULL, NULL, type, + devdata, ops); } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); @@ -1048,10 +1052,22 @@ thermal_of_cooling_device_register(struct device_node *np, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(np, type, devdata, ops); + return __thermal_cooling_device_register(np, NULL, type, devdata, ops); } EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); +struct thermal_cooling_device * +thermal_of_cooling_device_parent_register(struct device_node *np, + struct device *parent, + const char *type, void *devdata, + const struct + thermal_cooling_device_ops *ops) +{ + return __thermal_cooling_device_register(np, parent, type, + devdata, ops); +} +EXPORT_SYMBOL_GPL(thermal_of_cooling_device_parent_register); + static void thermal_cooling_device_release(struct device *dev, void *res) { thermal_cooling_device_unregister( @@ -1088,7 +1104,7 @@ devm_thermal_of_cooling_device_register(struct device *dev, if (!ptr) return ERR_PTR(-ENOMEM); - tcd = __thermal_cooling_device_register(np, type, devdata, ops); + tcd = __thermal_cooling_device_register(np, NULL, type, devdata, ops); if (IS_ERR(tcd)) { devres_free(ptr); return tcd; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e45659c..ac5f268 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -448,6 +448,11 @@ struct thermal_cooling_device * thermal_of_cooling_device_register(struct device_node *np, const char *, void *, const struct thermal_cooling_device_ops *); struct thermal_cooling_device * +thermal_of_cooling_device_parent_register(struct device_node *np, + struct device *parent, + const char *, void *, const struct + thermal_cooling_device_ops *); +struct thermal_cooling_device * devm_thermal_of_cooling_device_register(struct device *dev, struct device_node *np, char *type, void *devdata, @@ -508,6 +513,16 @@ static inline struct thermal_cooling_device * thermal_of_cooling_device_register(struct device_node *np, char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } + +static inline struct thermal_cooling_device * +thermal_of_cooling_device_parent_register(struct device_node *np, + struct device *parent, + const char *, void *, const struct + thermal_cooling_device_ops *) +{ + return ERR_PTR(-ENODEV); +} + static inline struct thermal_cooling_device * devm_thermal_of_cooling_device_register(struct device *dev, struct device_node *np,