Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1702634ybl; Thu, 19 Dec 2019 01:22:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzpffxGLRWM7wcGCCIMituceWzYL4FTkcZtfZKLQQivN1Z/GnVYoqHqiMGXYiFhyfBq7jJi X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr7638805otp.108.1576747324731; Thu, 19 Dec 2019 01:22:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576747324; cv=none; d=google.com; s=arc-20160816; b=g/oQlgvkeVD4rtBllUZrP9b6vGlscqc1b48q4Wtfpqsascd/mJb4s7M59heedzTIQa PBYGHd2YemBYzOG5zRDiegdzZZTJdQANElqoT3K6DgxGeHQ0daBEHfLXvyd7LnZ9IsHp Q5ogvgcrn0CfpRpcpecud9W3X5XMHP7aGc/ooC7I3Nm+7R3k9BXQl7ZiW38rDDOsFPlS DW+isRxE6KJVYNv/3rn6pgzx9XIr5VUKeZbnaaqeREy0pvQIlxC0KCb9orAd0Q8T90op uE7b+ILmETdiJ1PQLVoEtyhSDhqO509evJAcngGlhh3r8Z2jH66hkHsByG8efRUshdzx 9jMQ== 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=w/bOO5JOWTK5hVu2GliiQCw6LFEtMQE5vYA+Jnm8bY3sK6/lHRy8QKTHOZMIm6aDXN b9ic/ciblweut4GB9sPXn+Zw4bW7gT4yfTu1WFAn8+aVI20etzf61BsY6pQsfI5qQcrz I5BcEy1ydDz9AqrLZTFKxTZi4/t0nj19WsPiMQJXPMoj3coTLMNJmoRGaw33P6+zSBrE 0cY2eCdeLak/N0yz3U6lM4QIFOh6d3JGjmMKncFpCAtGmc+OYBFzequCsbR0YEgEyMxJ 7B+CzKYCEPl/X0PgRkIH+i8mipbTwxLjKvRZwuRJUdZ5+gHCwpz7353rLPS3qbRRz4Cl GDEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=QZb9yj0L; 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 r1si2974888otq.298.2019.12.19.01.21.52; Thu, 19 Dec 2019 01:22:04 -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=QZb9yj0L; 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 S1726754AbfLSJVP (ORCPT + 99 others); Thu, 19 Dec 2019 04:21:15 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:25266 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726599AbfLSJVO (ORCPT ); Thu, 19 Dec 2019 04:21:14 -0500 X-UUID: bb2d43e916c04938bef55fbe51e3236d-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=QZb9yj0LnkhnqmC4RR8ekbh3yXhDDwNHGr0/HdwojNvUJHyfGf/OotALd1DbM3esGp+62titXCLGE821RYO4Mutn6uvJ+rUdMhq6sDYwWVEXLyorNJjuuAXSbzMIr9NEqTbdMzcydUjHKu0UqHDazvlj2R95gNqhWXJLBvFNie4=; X-UUID: bb2d43e916c04938bef55fbe51e3236d-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 607649933; Thu, 19 Dec 2019 17:21:07 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 19 Dec 2019 17:20:47 +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:21:08 +0800 From: Michael Kao To: Zhang Rui , Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Matthias Brugger , , , CC: , , , , Louis Yu , Michael Kao Subject: [PATCH] thermal: mediatek: add suspend/resume callback Date: Thu, 19 Dec 2019 17:21:03 +0800 Message-ID: <20191219092103.8839-2-michael.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20191219092103.8839-1-michael.kao@mediatek.com> References: <20191219092103.8839-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 dW1lIGNhbGxiYWNrIHRvIGRpc2FibGUvZW5hYmxlIE1lZGlhdGVrIHRoZXJtYWwgc2Vuc29yDQpy ZXNwZWN0aXZlbHkuI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