From patchwork Thu Sep 19 16:18:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 174070 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1223516ill; Thu, 19 Sep 2019 09:18:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqHoWaP13mD3qRLmouCl6xg6QvWbYB0oAy4+4HoHmcEjKuoljpRkW57nbyl2WLo0b16BK7 X-Received: by 2002:a50:f616:: with SMTP id c22mr16583733edn.235.1568909906025; Thu, 19 Sep 2019 09:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568909906; cv=none; d=google.com; s=arc-20160816; b=yLyv3JuPRAS6grdpR0EiFAxK3wHFLps8QHfYPy1oT0976za/wP1YVmyWNDvaBmpWwW fWyCbqBkJ9ZNPWbQF+NEvXRZFq1rhbKjp/RCzm9+OZgbxmOK+jrZNC94zkE/XQ+MOJNY As2/5hISSpBQMNEZxQDFDXtMVwnqOLe3guIGC9uc0Nlr9OZ0pUuegxZ6k4aVQwidSnNj Mc99/82W+0mgMYgROE7PN8z3E8l8olFNJKZlxkNgnSv+2iiYU3tV38QQG0uAlfAe9q81 MW1lIKSPTzkt1hp6TZEFNOYa0ARQRUpXvbEqcZz1ww0Hvq91Fl5xUw8/U7aH0FVwGLC/ hEow== 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=MurjLyLQjH1Slww54avg10UOySHfyppQJJY+VszCz3cEROtxhYh2GYHF+YMXXvR+z0 z5IpjWY9/eUePtSEgYyiDO6UXktFheDPKqCDrtMhxw5ACA1Xs548pwWSd+4jcSuopLRV RooSJ6I8fMocoZf9p7ejrg/R3+S0ZbNS9Wo6y5DtHeaUAZ8CikzxPQbblts8EAc08sKD 8AuvRhsJFrgxGFJRD8PYUDMNizt1rRLqbxcSO4K2f+TqW4Kp9d9UCuHsZniY6CUJKxc6 s4DmPV7LhMDIBAJbPYEUOjhKivbExw0/kS3fZ/r4yJ6APzJJRxNlx4zelle7LX8Wxdge dj7w== 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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 f20si5108263edm.365.2019.09.19.09.18.25; Thu, 19 Sep 2019 09:18:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S2390448AbfISQSZ (ORCPT + 15 others); Thu, 19 Sep 2019 12:18:25 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41134 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390392AbfISQSY (ORCPT ); Thu, 19 Sep 2019 12:18:24 -0400 Received: by mail-qk1-f196.google.com with SMTP id p10so3955491qkg.8 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=frxkmjuQ5G6CAJubOaKd26FX+AJs4mUjWLXB7RIVq0AkHuBgmNbClgLyfQ7615JJuV iz45N1Wy/fdU/9q08DfuhcUmsayknL7T9oncwq/PFe6FweKakeX0xuIDdSLyS3lEyECj /8dyrzdL3TkGPD9YZttkyedO7IAbo3b35IxOW+wbyQI+Byfmey7+vaA4dEjtjJqriEPA TJaf9PuLUlMIcsz9w1NPGTAti0rTMEJf9b3VeyDlKUnvebBj1MOW3RatP2CxM2FQriW3 qNZhU6XwpCPrV9X7fcJCKkiq2COipcQ8vhqfiuDbfCszq4tlny7MDjAP4ZGG8AbddAex EBMQ== X-Gm-Message-State: APjAAAXASzeQ0EUYgJ1RLSLF/r2gFoTlx6C30Zb7rie7mHI/9M+pcmgy hFOgOxbKffIvwvXvwrRFRAWi7g== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(-) -- 2.1.4 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,