Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp91322ima; Thu, 31 Jan 2019 23:38:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN6f0GxENgz7g30z+pdGGp7N9ot+FCURjYOkCZA2m6zFFECnMQeWwE6VgtkSks6eAoF8JOMH X-Received: by 2002:a63:5e43:: with SMTP id s64mr34736180pgb.101.1549006737585; Thu, 31 Jan 2019 23:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549006737; cv=none; d=google.com; s=arc-20160816; b=gLE08Kc/fM0RfsqhOKy43p9+PbiNQTdMdGxthcTEAjUIc58Ewek2RMI92tcNybIfWB OfynMWkOXQkHoqhN47CAHtP/g17eZ216BVvy72b0KuQfgDwJ1oMTeHLy/rmD3R8UkJYV xfbHIyygP1GXIMQEjZhG4mEq91AWQ6YeOrxEyDKzaZBmcE0A0Wc0P+Un08I3exlDXzF6 YfJxUEfWx59rXn0dEVeIZHEpMQEwpwKFEZDrlTldfubyOdKA9j4N94sEPS3FN8lTnoGz VFKR46wcKwS34f3E48YtcAv9Lo6Ghkx8g5TjhO83X0dUd7Zv/1Pp+leUXWGlnNSyoRA1 Imfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=3JXrP4+Futcib3/L9BVB8RI//VFNFwFl9i1xq2cGKrA=; b=EWcb+/4k+XOWuXUrJ+ysHXG75kSMI0iTSdh7Ke7YPJLWv/cOP2d6F45qFKhPhzxy6Z YUG+P3pQiERc5PuEFGdy1Zx3q1OC3P3GCekbJRnh4gmd0vlg+RIknyVojC1/zpkET6DW QSHPi97qy/ACCFAaY1p4zVFkDvoJIvZURwAdJOVBFXgnVANAHRioLYGEkDp1uib+YYDR 91aPenfGhup0HbbRP+8Y1RNo9DQEBxZhftR4RTnTTIdDXQQl+ek66xwgtKFsHDjeCtdX CueEn1IdbW6OsUw2v65TCQGwDHHDkSjUY34qdgCXXxcig1SYenjkXXUsUKa7eTtHV5UM LDFg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si7233151plj.94.2019.01.31.23.38.41; Thu, 31 Jan 2019 23:38:57 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727538AbfBAHi2 (ORCPT + 99 others); Fri, 1 Feb 2019 02:38:28 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:40085 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726598AbfBAHiX (ORCPT ); Fri, 1 Feb 2019 02:38:23 -0500 X-UUID: 44aedf86825d4f4884f945b7fd1bf4bb-20190201 X-UUID: 44aedf86825d4f4884f945b7fd1bf4bb-20190201 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1212903535; Fri, 01 Feb 2019 15:38:17 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 1 Feb 2019 15:38:15 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 1 Feb 2019 15:38:15 +0800 From: To: =Zhang Rui , =Eduardo Valentin , =Daniel Lezcano , =Rob Herring , =Mark Rutland , =Matthias Brugger CC: , , , , , , Michael Kao Subject: [PATCH 1/7] thermal: mediatek: fix register index error Date: Fri, 1 Feb 2019 15:38:07 +0800 Message-ID: <1549006693-11659-2-git-send-email-michael.kao@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1549006693-11659-1-git-send-email-michael.kao@mediatek.com> References: <1549006693-11659-1-git-send-email-michael.kao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 3D1BE058A890CEF57825F23700AE1479721020C6CFD79D515C8126FA6F2F4F9E2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Kao The index of msr and adcpnp should match the sensor which belongs to the selected bank in the for loop. Signed-off-by: Michael Kao --- drivers/thermal/mtk_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index 0691f26..f646436 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -431,7 +431,8 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank) u32 raw; for (i = 0; i < conf->bank_data[bank->id].num_sensors; i++) { - raw = readl(mt->thermal_base + conf->msr[i]); + raw = readl(mt->thermal_base + + conf->msr[conf->bank_data[bank->id].sensors[i]]); temp = raw_to_mcelsius(mt, conf->bank_data[bank->id].sensors[i], @@ -568,7 +569,8 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num, for (i = 0; i < conf->bank_data[num].num_sensors; i++) writel(conf->sensor_mux_values[conf->bank_data[num].sensors[i]], - mt->thermal_base + conf->adcpnp[i]); + mt->thermal_base + + conf->adcpnp[conf->bank_data[num].sensors[i]]); writel((1 << conf->bank_data[num].num_sensors) - 1, mt->thermal_base + TEMP_MONCTL0); -- 1.9.1