Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp864781pxf; Wed, 7 Apr 2021 13:37:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy55wpFBheGGk/jITxeiHKObadtYOYtmo4tYRdkN8urYQ73OO4gsmxZVMiNvBdHeqDaY3bF X-Received: by 2002:a05:6402:254a:: with SMTP id l10mr6773989edb.160.1617827853782; Wed, 07 Apr 2021 13:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617827853; cv=none; d=google.com; s=arc-20160816; b=QFvySAs/3MEooZDyDHIxVj2t5q1YVepiTTg1mHDpjDbFeOdtPjDrlZAgdM0IJKCk6S wjgfNI/DAl+GieCJFcoVba3o6gJ82/F93a59fRCYVWweAiuDhOZ7m0smSyYZh7ssiX/F NJXUG59DOwFIHnx88yZc/s0UvRHK4F410RxejdsuunbMiV+R3NHQ1dQ+EpU6TjOFghSw 1KpCkMfPb5WhZ/XLXzu2iK9ROSwFI+8Sk0C+foLYNuDIO1ooEcOsAzNYw1e1IC8Rokay IkEjn4Mz1DAguJrSiy91EKwbYaCHLPNC4lt3aCaddlSiXJxaXlLABKiZaPtEfA+Hm5PK eGsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=zplQN6NoPcssa1o1o1+M/kM9dwPi858NTpFtVnCbbak=; b=lStZnKe2xJDkdKM5imN3vemY9aaRD+Cbjh6gmhUzP0Tke+awco1o9N7MvrXdNo28Ci hJGRDBOgNd3wX/ADMyKeNAaj4m1V/mTKqG0jKNJ1nZXXWpxwfXDJ8UeqGbrAhWMu7yIl khd88AYgV/uwiFMBA9kIf5TJuBtaSKoUKucElYhmmu/NCP2Pub2+7zAxZ8KJEHD8Sb/D l4vMCmr+kPbFMvaDxJ9aLC1B5A3yYY/aZ1sRXoH0Xv2lmaoLW/VXeQfEVA2BBajWG9JX obD7lkX8n4xivVa76QbSqUv4yLO8L6f9AhKDjp8vgvSdrVnddM7Q5cwu41BZbUxHeQWL Qg+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Wdgq6hrn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si6710794edm.605.2021.04.07.13.37.10; Wed, 07 Apr 2021 13:37:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Wdgq6hrn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243800AbhDGI53 (ORCPT + 99 others); Wed, 7 Apr 2021 04:57:29 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:46942 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232509AbhDGI52 (ORCPT ); Wed, 7 Apr 2021 04:57:28 -0400 X-UUID: cecec5c2925846dd8b9eb650043c563f-20210407 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=zplQN6NoPcssa1o1o1+M/kM9dwPi858NTpFtVnCbbak=; b=Wdgq6hrnGMtH+WeYkjfzn+S0K5jm2zh0FX1byLz7I+qtgW794le7JLOIBHkqnA8fNifjBvGHtl5lexNA3McVT1Wxr3a3BcZrZlWN75rEICA1/9FClYUC90tQBckjE6affb9sTRtmGaN4oz14qbX2kZjSJ0x1xy8SaQCBKpkyzQE=; X-UUID: cecec5c2925846dd8b9eb650043c563f-20210407 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2063600223; Wed, 07 Apr 2021 16:49:15 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Apr 2021 16:49:13 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 7 Apr 2021 16:49:14 +0800 Message-ID: <1617785354.12846.0.camel@mtksdccf07> Subject: Re: [v7, 3/3] thermal: mediatek: add another get_temp ops for thermal sensors From: Michael Kao To: Daniel Lezcano CC: Zhang Rui , , , Eduardo Valentin , "Rob Herring" , Mark Rutland , "Matthias Brugger" , , , , , Date: Wed, 7 Apr 2021 16:49:14 +0800 In-Reply-To: <20210316070144.28440-4-michael.kao@mediatek.com> References: <20210316070144.28440-1-michael.kao@mediatek.com> <20210316070144.28440-4-michael.kao@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgTWFpbnRhaW5lcnMsDQoNCkdlbnRsZSBwaW4gZm9yIHRoaXMgcGF0Y2guDQoNClRoYW5rcw0K DQpPbiBUdWUsIDIwMjEtMDMtMTYgYXQgMTU6MDEgKzA4MDAsIE1pY2hhZWwgS2FvIHd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