From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F230C83003 for ; Wed, 29 Apr 2020 10:37:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE9EE21D80 for ; Wed, 29 Apr 2020 10:37:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZMIN9DI4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DIXfay/d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE9EE21D80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=mKpKT3Bnrpo8ceV4oVBbvoYSMeywQ+wuMyp5doTuJIQ=; b=ZMIN9DI4PJ0XJEcroCoGVKGTDl uB5NidSmsLTD0mocjkGfKIeILpftdGLNwKd7Vt81P2c+A5KOVrKLoPRsNxrt+Q/m8fV9/Au5QPt+i rXWf1fKjcto7cFHzHS9rpGgPZ1n4X3o42QYV73wKMp8kMI99SPp2PNEygtij1wF2MYgoRmqMKdMWN 4/MIb9YI5ZEWHxYxHTZsFytfdQHblfXmdFh26SkkukEUa23aiPiMIs1iYK47lXhkoJiu1SJocGdrY 8lc+tXhOw/EmCvbnKhRFtgD+d5oin9iB0GjWh+W/NOz980ZfnFRtIBBWKeZrvoXP32agl7PPUmMgd ZvihG7XA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTk5q-0003mv-UV; Wed, 29 Apr 2020 10:37:30 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTk5o-0003m0-RO for linux-arm-kernel@lists.infradead.org; Wed, 29 Apr 2020 10:37:30 +0000 Received: by mail-wm1-x342.google.com with SMTP id u16so1453058wmc.5 for ; Wed, 29 Apr 2020 03:37: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; bh=Ajg0V3YAnieY8dp7jTqVJrYiDVgIPrXCOEB/FDyd0IQ=; b=DIXfay/duBznmXB5ADvUzPnyxxtfIxj2kizhan9HisAwxNdjLTa9l9i34gr0wqk+xa 2uanBNCtdDDTcrKxiKdyuGrCXH7HBG+yfZXWa2pdBp8lCpCnGKL0Ls2zQkox09/Mpzhw FZGjZ7b4fdPWGsKhHWwwHmbv/9x9fX8Wz+BHSQZYT+yxx89w0Fiqa8v3d5jRt8Jbtf8s 8s5RCIs36RQOsJvNFWuPXx7N6wNGWHwA5BhBM8VCLlZAfOlTHJQCLZ0mudu5YNzTwJbf u7P+sm/ev50j2OXnv85QUHDySZCx66DCWZOUPqqDrwJi29iaIJ/S6F81weuQ/XuYqzRe RFzw== 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=Ajg0V3YAnieY8dp7jTqVJrYiDVgIPrXCOEB/FDyd0IQ=; b=b6+feNEjuuxPs2JWtN3lPEcrAzM05vUhz9nw+51a6obnCPBnbWQEX7ybTpkxpOWAF6 Mgo4hTl0V6/OTd2Lzr5TzItqM7tFIX9UzvyQ4wNtAbxJMW9oCVL5Q9rm+BIVGz92B3ep nTnImog1IKglXLO2gTvEgsiGlWi6pvt1+b0l88oDleJATH7ejmkAcRKu4Uku2L9SPskW tMCfr1ora5h2S25H+FCjuTeOvTFD5ZRc5iFRaTHMljlfPYWPvVFuI3UqAuWLMKfXiELh dqpZvlMyP6JMUoChEqihNnAAztqjy3verTyQVVEQM5heBGVQuJyN+ZmcmfnZjT+cdEgT k8zg== X-Gm-Message-State: AGi0PuaHfZ9UD0Lp2novtWtWTcANH2C19M+L5r0bFFqzyrx+ytm/R7dI /CHI1HT+/qWJ+y/flZcSCCtzAA== X-Google-Smtp-Source: APiQypL2Sn2tfnITVPTTIZTbiEuPWWxOp8fRjGWJTovGUEqEE9S7DWyLRwyQAHtRin4DiTrlvqRpGQ== X-Received: by 2002:a1c:bd08:: with SMTP id n8mr2479044wmf.23.1588156646488; Wed, 29 Apr 2020 03:37:26 -0700 (PDT) Received: from localhost.localdomain ([2a01:e34:ed2f:f020:d494:5741:b700:698f]) by smtp.gmail.com with ESMTPSA id f23sm6899576wml.4.2020.04.29.03.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 03:37:25 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Subject: [PATCH v4 4/4] thermal: cpuidle: Register cpuidle cooling device Date: Wed, 29 Apr 2020 12:36:42 +0200 Message-Id: <20200429103644.5492-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200429103644.5492-1-daniel.lezcano@linaro.org> References: <20200429103644.5492-1-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200429_033728_886132_FA21C7CA X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , "open list:CPU IDLE TIME MANAGEMENT FRAMEWORK" , "Rafael J. Wysocki" , open list , "open list:CPUIDLE DRIVER - ARM PSCI" , Sudeep Holla , lukasz.luba@arm.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The cpuidle driver can be used as a cooling device by injecting idle cycles. The DT binding for the idle state added an optional When the property is set, register the cpuidle driver with the idle state node pointer as a cooling device. The thermal framework will do the association automatically with the thermal zone via the cooling-device defined in the device tree cooling-maps section. Signed-off-by: Daniel Lezcano --- - V4: - Do not check the return value as the function does no longer return one --- drivers/cpuidle/cpuidle-arm.c | 3 +++ drivers/cpuidle/cpuidle-psci.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 9e5156d39627..8c758920d699 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) "CPUidle arm: " fmt +#include #include #include #include @@ -124,6 +125,8 @@ static int __init arm_idle_init_cpu(int cpu) if (ret) goto out_kfree_drv; + cpuidle_cooling_register(drv); + return 0; out_kfree_drv: diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c index bae9140a65a5..1f38e0dfc9b2 100644 --- a/drivers/cpuidle/cpuidle-psci.c +++ b/drivers/cpuidle/cpuidle-psci.c @@ -9,6 +9,7 @@ #define pr_fmt(fmt) "CPUidle PSCI: " fmt #include +#include #include #include #include @@ -313,6 +314,8 @@ static int __init psci_idle_init_cpu(int cpu) if (ret) goto out_kfree_drv; + cpuidle_cooling_register(drv); + return 0; out_kfree_drv: -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel