Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1607373ybz; Thu, 30 Apr 2020 02:19:02 -0700 (PDT) X-Google-Smtp-Source: APiQypLPsmxlt17colr6n6PqWRkTR5d+NuVS8DL16DKgeLMyekFlorcohL1cMypBdIgHqkB5xY/c X-Received: by 2002:a17:906:310e:: with SMTP id 14mr1841734ejx.177.1588238342353; Thu, 30 Apr 2020 02:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588238342; cv=none; d=google.com; s=arc-20160816; b=oB8lLrtOtJMsgf0h2KXZUO+38fwtkGJD8v3G0LkScwot4DQkf2gVBT5yxQl6ASxSHw tounWGvOQeJFgzwyN5yIoGicbfevTuynmKqPWUDiOEisiD24yCiLULjR8Z6WgcYAT4dZ iBTgaeXtMKaXbr+GSLz2zZwRS0hUfk+oCL2KRLUvFI22yeAvN9B0FFbAYKgXO0O9reJS W1xDSpZYfrexfxHYhFfxCfeBHMGYcsrGH3Y/OqQuBxCWyFnYZJ59LycFwtXsdRqjmtB8 KUC/CmcDjFYuPUzRJCCGTjsms2MPfZSawHkIcP4RfR4rkmnsVBDVtXJcBmJyLrobE6Zl vscA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ig/CV/AWBavhja044N0Zt1j1YShLtmo/bIEfrOu5Bu0=; b=ajIkSlF7Ia7P2PR45JSkeN1LukMdONJXFHLKazfAfAyZ/pG05osEkcjHHjNTqgCvqm ioWp9zfBonQ5rHk4SH8uBhW7uI/W/R6XT8cAgUY6wG8q2OoHfye40phaxB0Fk9JLUpVh BIUpushNlg5jqn71nP3SmqguZdGPZti2DltweOISvCOVBsY7tkYxGcDRV7GCkct+y85Z UdPyo//mqB9ex90xgObTIjC9KQwksab7xgIp8kG7RKr9qIuMlROi9PLU6sygNNjrpQkN 49xdaFqrxNVwy5Db3NGFkx711tjGwI7HlBnZEvPlPLJpVKzFMAOx/0HNS6bfGrgbixTZ FvWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="KmW0zd/V"; 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 y10si5304964ejw.53.2020.04.30.02.18.38; Thu, 30 Apr 2020 02:19:02 -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="KmW0zd/V"; 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 S1726701AbgD3JOu (ORCPT + 99 others); Thu, 30 Apr 2020 05:14:50 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:7097 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726358AbgD3JOs (ORCPT ); Thu, 30 Apr 2020 05:14:48 -0400 X-UUID: 97040824735c44ec94a332ca8db7469d-20200430 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Ig/CV/AWBavhja044N0Zt1j1YShLtmo/bIEfrOu5Bu0=; b=KmW0zd/V7epOg55fQiJpbfI3X91r3wfF4/x32LUmX4AD4BNmTM7uqUB79BoVuhy4QsJrgphg+z0I6Jj/KVJ9ikU/zzXt6kLRD84Bzi0kX6XVT+pzyLbuLQnfPCHWK/mei86N63Xg1ygT6vjcs3Mjl0IMVytKhiLSsC1Eze6hY2I=; X-UUID: 97040824735c44ec94a332ca8db7469d-20200430 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 689896391; Thu, 30 Apr 2020 17:14:43 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Apr 2020 17:14:39 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 30 Apr 2020 17:14:42 +0800 From: Henry Yen To: Zhang Rui , Daniel Lezcano , Amit Kucheria , Matthias Brugger CC: , , , , Steven Liu , Henry Yen , Michael Kao Subject: [PATCH v2 2/2] thermal: mediatek: add tsensor support for V2 thermal system Date: Thu, 30 Apr 2020 17:14:34 +0800 Message-ID: <1588238074-19338-3-git-send-email-henry.yen@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1588238074-19338-1-git-send-email-henry.yen@mediatek.com> References: <1588238074-19338-1-git-send-email-henry.yen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VGhpcyBwYXRjaCBhZGRzIGZ1bGwgc3VwcG9ydCBmb3IgdmVyIDIgdGhlcm1hbCBzeXN0ZW0gKGUu Zy4sIE1UNzYyMiBTb0MpLg0KVGhlIG5ldyBjaGFuZ2VzIGluY2x1ZGUgcmVhZGluZyBjYWxpYnJh dGlvbiBkYXRhLCBjb252ZXJ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