Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp329215ybj; Thu, 19 Sep 2019 15:10:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpFJ9w2zW4KjUv+0Wi/WZ6pgcZztFWaOsiosblZ41DQ3Lxm3dUkckREIC+7annWaC5FXgj X-Received: by 2002:aa7:c98a:: with SMTP id c10mr19074031edt.23.1568931030160; Thu, 19 Sep 2019 15:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568931030; cv=none; d=google.com; s=arc-20160816; b=pZI4DOQGjFKzcUb1JoSeGQu3te04o6wVrcOjMH33aoPdmRiQVuekBVvHn0hRLUt6OH lW9DSx4vQQ01uNjvm0iSWR0MLwODdCPMOYugIbcNfx2/W/4gu5+ol5vUdIuMwDmOxhIY MmfI3uI8GgR29NkitGkn/JOnu3ieFQab9S2ZJ4hI7UQ8Llsl/OkWANEJkLqpnroONHT2 MMSxSISXPKvH/KZTlil2JQTYZOLiWqMb96BtKtM5NA7yR8YGmpe2FOODiod5PmDfxIbi 0SLY9SPHuGznOvHJ80WyBGToEFJvV/o89mHsgVrLKZQ8k1YkSMtfSVIka/6qME+fhLFU psKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=3Yye6iqRCV5drve2C5oFfaJYT6iHjklqWnjrwbuk4nU=; b=FIF5/G3zr5o2dT4pR17nqpTidmdutRA4Qgea/ur9DpzbU0+3ew9C1OYUf3ZE+D5Wre ZUt1Copzzf59j62GE1uYlUQhJCGacaHbZtMziTUbNPY5jJFQWlsoPOJSxqJ++z9wClu5 cpCnXZWgR2tHPSRRzKeSd/zOOokyJm9f9fwXIJS17RgI/DEeH6nxs//qLM+orWfQeuNQ HPkimOhWRhWrVzYEt2rOIPnsr3jExFrfvtpDkFDnxIuyFVpsC4/nK+MIl+sYEMaZas5b LXLjIFalQdM49nTfArcCL2JWsRA1cm+LDiHjSqSdLb/g8HxfhKZ7k5X95FQCW38jveOF dmBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DfOsUoTI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id p40si59238eda.334.2019.09.19.15.10.04; Thu, 19 Sep 2019 15:10:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=DfOsUoTI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2391835AbfISQSZ (ORCPT + 99 others); Thu, 19 Sep 2019 12:18:25 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:32791 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388098AbfISQSY (ORCPT ); Thu, 19 Sep 2019 12:18:24 -0400 Received: by mail-qk1-f196.google.com with SMTP id x134so4021246qkb.0 for ; Thu, 19 Sep 2019 09:18:24 -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; bh=3Yye6iqRCV5drve2C5oFfaJYT6iHjklqWnjrwbuk4nU=; b=DfOsUoTIpzx2QhunV87jDAkhaGaTZF2Wq9kXmOpB+RnTf0cmun6xSFOeGFWc1nlk8i Vbi2UOvCcag/k7KveMGBxKzBCg6linJ09RjddursD6qERVdl8RmzZcglttS95B1AtRz6 t0IdbZ8RQ+GvXnvBMXLvdH/2Wqp8GvwjAwV5dnZ+0E9T/erjw84k5KwDogl1K9OSL3VL 1v5O8ENeEjqq3rbwd2pzUsMXosH69kJ4BcjnYaBudSzO8rxxyM0a/p67VWhjO9pIZ7vH 6h//AyT8kI2oXAKMshKUTETDne/WMwb/v06zc89YrcaE1VSOwHQ3Mu6c8Pnl6eplsePJ iSOg== 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; bh=3Yye6iqRCV5drve2C5oFfaJYT6iHjklqWnjrwbuk4nU=; b=HyYJVzgvGAb0zLgOOOs7yzr23Irx1P7IklLUjLoFbBLXTPhkIr3Q8GFFXd2OYZUwtv yXfXQ2SsrNCC2TQ7kDpO/ceBPch0stkl08ucUxtqVew8T3jH95aDkwNj8AMCPbmx/9cR m81XbjRQHOuO7RwWGTcMpv+G6FSJzUrjdjQBEL0OxINJVOpjiKBhaoVQGrrPLqGu9BwW yezLbE6HWfTcHSCdQ3NJRdLyln4jNDalktrAtJ0fXS7eRBPwhFF/FR+dhUYXziSg/jSn kjm5Njyb7AL8t3DsTXnv6BnKO+HQFSlaOqVJgZRljm//2EsiKUDcoa2dC12Q40Y237T/ Dgkw== X-Gm-Message-State: APjAAAU9dD6Wnu3HNkgsLsedE/wPHOlOVhIfwfu9xacXr3aVbigN57h2 k7lYr938SLTKusoHrRO7J0TDQA== X-Received: by 2002:a05:620a:694:: with SMTP id f20mr3781309qkh.379.1568909903952; Thu, 19 Sep 2019 09:18:23 -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 q62sm4561185qkb.69.2019.09.19.09.18.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Sep 2019 09:18:23 -0700 (PDT) From: Thara Gopinath To: bjorn.andersson@linaro.org, agross@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom: Invert the cooling states for the aoss resources that can act as warming devices Date: Thu, 19 Sep 2019 12:18:22 -0400 Message-Id: <1568909902-8446-1-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thermal framework takes 0 as the lowest/default state for a cooling/warming device. The current code has the order reverted with 1 corresponding to lowest state in hardware and 0 the highest state. Invert this for a better fit with the thermal framework. Signed-off-by: Thara Gopinath --- drivers/soc/qcom/qcom_aoss.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c index 33a27e6..006ac40 100644 --- a/drivers/soc/qcom/qcom_aoss.c +++ b/drivers/soc/qcom/qcom_aoss.c @@ -44,7 +44,7 @@ #define QMP_NUM_COOLING_RESOURCES 2 -static bool qmp_cdev_init_state = 1; +static bool qmp_cdev_max_state = 1; struct qmp_cooling_device { struct thermal_cooling_device *cdev; @@ -402,7 +402,7 @@ static void qmp_pd_remove(struct qmp *qmp) static int qmp_cdev_get_max_state(struct thermal_cooling_device *cdev, unsigned long *state) { - *state = qmp_cdev_init_state; + *state = qmp_cdev_max_state; return 0; } @@ -432,7 +432,7 @@ static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev, snprintf(buf, sizeof(buf), "{class: volt_flr, event:zero_temp, res:%s, value:%s}", qmp_cdev->name, - cdev_state ? "off" : "on"); + cdev_state ? "on" : "off"); ret = qmp_send(qmp_cdev->qmp, buf, sizeof(buf)); @@ -455,7 +455,7 @@ static int qmp_cooling_device_add(struct qmp *qmp, char *cdev_name = (char *)node->name; qmp_cdev->qmp = qmp; - qmp_cdev->state = qmp_cdev_init_state; + qmp_cdev->state = !qmp_cdev_max_state; qmp_cdev->name = cdev_name; qmp_cdev->cdev = devm_thermal_of_cooling_device_register (qmp->dev, node, -- 2.1.4