Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1605974ybz; Thu, 30 Apr 2020 02:17:22 -0700 (PDT) X-Google-Smtp-Source: APiQypIrKjkINyk+rLEjVFt0XrzZ4LVRBc15nARjikK4rsL5cs8CZ3m1H7rIZNqnQUmqWLH3rk7P X-Received: by 2002:a05:6402:3129:: with SMTP id dd9mr1733453edb.121.1588238242601; Thu, 30 Apr 2020 02:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588238242; cv=none; d=google.com; s=arc-20160816; b=oBtHw2oP6mr0qqacdiaThlzsfZSKBPfshzSFXXqlaLdCSSZfal/BH9Lia+D3cUfcF1 s79yWKxJkvL7WjzcXs3M18xPaZGQR9qB2mIQEFFFNCeUFOQIXbvdPMLdWmec8UqWQ3JV W4XOUmYB72kGCvsvJjxtISmxRIg4rC2H4R4apzoVTWGO7tf8dU2n10Or8fmUHhxNfknw mRq7eAkqz1l2RnNHzN8gLD3+3gXHfzmA9S0pLmQnxnvy4V0tsAakKU6qQPqfFddUMDje eicupOuRcW/2pyOPhspZa4QhYso7knQ8vVRF8L95HrQUujMQUFdO/DEwjs+wmuds04Oz x/yA== 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=FMiN3IO1GCMdXmYJ4tb+VErwGj8w9GUJT7bbTjKdszA=; b=H+C7cTC78VrkxaAmgUOiocHA2vGkCfohKv2R92SYaQ4yrytzSHBfvTtljJ8uWJ+Kld ImhaVLSsHviOuaCeQXXi0lfeiO0NGIHI9Lw59dwlnXcL7Cyiew51INgSI9L5OT/AbHwZ pqo1TJ6UG5QslL5pbiVBZ5ZxJJVil+s4mtzonBzShNQ61tcaqCoHwbEOTRJBlNdlmX5t D5KGTpJLRr22Re1plQ89zt1yi1BRdrLIV+aKTBRwPrzpiNkkuwsBlS1f1/3LU7HiY8xQ RU5W7oXsQS6sa3/4F5JuKMJvX90ouwro5UT5D8YiWZdI9BVoNR96qMUNS4opSCqHS4k0 Y/ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qPYhWQ4g; 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 j24si5391488ejb.58.2020.04.30.02.16.57; Thu, 30 Apr 2020 02:17:22 -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=qPYhWQ4g; 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 S1726616AbgD3JOt (ORCPT + 99 others); Thu, 30 Apr 2020 05:14:49 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:49361 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726391AbgD3JOs (ORCPT ); Thu, 30 Apr 2020 05:14:48 -0400 X-UUID: 393c66c19eb2460988ebf43377ba7058-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=FMiN3IO1GCMdXmYJ4tb+VErwGj8w9GUJT7bbTjKdszA=; b=qPYhWQ4gKPlwTqyXfbzZkBfWxCCXTZyl8tZWFb5NXiecU0KM1nmL21MDmR5eUS7LO7GNgEKwN6bCLxTdCe+79rUaCA0XAH1LyKYSXxHoZRADe0bpS/l96HkDob+HQni1WBiCWSbBT1tTjnvTScgHjGaAJsO/LZoYFgQuyat+PQg=; X-UUID: 393c66c19eb2460988ebf43377ba7058-20200430 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 696927261; Thu, 30 Apr 2020 17:14:42 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 30 Apr 2020 17:14:38 +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:41 +0800 From: Henry Yen To: Zhang Rui , Daniel Lezcano , Amit Kucheria , Matthias Brugger CC: , , , , Steven Liu , Henry Yen , Michael Kao Subject: [PATCH v2 1/2] thermal: mediatek: prepare to add support for other platforms Date: Thu, 30 Apr 2020 17:14:33 +0800 Message-ID: <1588238074-19338-2-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 SXQgaXMga25vd24gdGhhdCBNZWRpYXRlayBvd25zIHR3byB0aGVybWFsIHN5c3RlbXMsIHdoaWNo IG9ubHkgZGlmZmVyDQppbiB0aGUgd2F5IG9mIHJlYWRpbmcgY2FsaWJyYXRpb24gZGF0YSBhbmQg Y29udmVydGluZyB0ZW1wZ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