Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1705720ybl; Thu, 19 Dec 2019 01:26:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwWpIVckk2kBN1LsRjVExQJiZq8MBkRhGm2aW4cPseUTL5G7B/g99PcR6ZvpRMgpqlmi0Ll X-Received: by 2002:a9d:51ca:: with SMTP id d10mr7575632oth.76.1576747569565; Thu, 19 Dec 2019 01:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576747569; cv=none; d=google.com; s=arc-20160816; b=RhdZBtvz5Gnw0jp7vSUzF1REBzNPo4ZpAuqsqm0lAgwy2fd6RqkuDGKr9lweUUaeBB yASVQTjxxkn0FgqjhjpSYgE5nILbxBR0DY74H5yrAkcCGoeVNfPKtHkb5oBGslXCGEOa Bd4TL8zbdwAXnoa9K/8bfEGmIiAYSAeAs0lESkE7lqgDPbJukCtTJhNrh7z9iynbiKLf 8TI1FqejfzzB87KQbq7IFJHNqiBI3LPP3amdfKiTWjxTMQwlK9oDMN9be6Csbd9qzmKD P4xNMiGL40+DTvne2OoqiiWAJtBG/v2zF6170CRtVTCfS2NmuXbxc3lLvvvuLA9rA6Oq ucHA== 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=PzE8Jigjcr7qmAjdAVnZQtdly9WAOx8geY5bzYg6u2Q=; b=SnP8pYxv6QsSI3PnmwvQVsdlako55cWv+/qCxKBAD+p6m1aBmpu4333q8WMrP9t99I pSQjveeJ4E/6K4Nr3RNv//95d0OXrX87c7BXZ19GwsOuiIFHEsc5pzSp/bCdJ4+jwCOU qGyNwjwBh3pnJkCSoie0OESjl6nK02TUsqD0O+sqiMD0KICVi8s4/IwWX1OO4eFaWiC3 m8ls+umTlsAL9sFLEq2B0C6Jmy3C9/qgCweMd87m9hCNU/iAkKm/LAwZ1hz5tOc8aJEL pw0/fpbcLVzKIsBpuxp3QVemmfiWLcQUUB8q8kh8hZgzHcPoZw4DcsgsNZn8+7Rr/6tT aDMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ji2Z5HYC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q127si2582142oic.99.2019.12.19.01.25.57; Thu, 19 Dec 2019 01:26:09 -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; dkim=pass header.i=@mediatek.com header.s=dk header.b=ji2Z5HYC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbfLSJYv (ORCPT + 99 others); Thu, 19 Dec 2019 04:24:51 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:18139 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726620AbfLSJYv (ORCPT ); Thu, 19 Dec 2019 04:24:51 -0500 X-UUID: 35ff8c3b0f264c079a34f5de706f77df-20191219 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=PzE8Jigjcr7qmAjdAVnZQtdly9WAOx8geY5bzYg6u2Q=; b=ji2Z5HYCAWoLLg3hWzRKp0+JxycpxVvk8yPqpDoc8Pq99Nla1JAcB+g0tw7uatGhlY+CVknQc831UIewuy2fWEcH0VaxPtvKT7KkUwcaqHaXHvPZPsX0B0NMfen3u14lCezfMm2IJRdLpsJivYsp0m7IczR8NHBTymLjj7AiVtA=; X-UUID: 35ff8c3b0f264c079a34f5de706f77df-20191219 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1428346128; Thu, 19 Dec 2019 17:24:44 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 19 Dec 2019 17:24:04 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 19 Dec 2019 17:24:39 +0800 From: Michael Kao To: Zhang Rui , Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Matthias Brugger , , , CC: , , , , Louis Yu , Michael Kao Subject: [RESEND][PATCH] thermal: mediatek: add suspend/resume callback Date: Thu, 19 Dec 2019 17:24:31 +0800 Message-ID: <20191219092431.8935-2-michael.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20191219092431.8935-1-michael.kao@mediatek.com> References: <20191219092431.8935-1-michael.kao@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 RnJvbTogTG91aXMgWXUgPGxvdWlzLnl1QG1lZGlhdGVrLmNvbT4NCg0KQWRkIHN1c3BlbmQvcmVz dW1lIGNhbGxiYWNrIHRvIGRpc2FibGUvZW5hYmxlIE1lZGlhdGVrIHRoZXJtYWwgc2Vuc29yDQp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