Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp404050ybb; Wed, 8 Apr 2020 02:08:38 -0700 (PDT) X-Google-Smtp-Source: APiQypJz6dBEEFndq9UFSRhT3b3+mznU7iR/LP/HDzNklUCOckWjHGEAWRIynVKJq4kv+SawXF/p X-Received: by 2002:a05:6830:15d4:: with SMTP id j20mr4819005otr.303.1586336917938; Wed, 08 Apr 2020 02:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586336917; cv=none; d=google.com; s=arc-20160816; b=zUE69CAUI/GRGMeaxLrbw33tgBEVyclAXsJYV9mLLaTfqcnhnAaWYWr6eEvpquDVky 7ucxz8UxgQUq5jehLtpDbLk/5+uenJb2/DWxa9UNqeXE1jC892WEuM6rR6h4czJ+3cfJ VWnKcgHc5G9seBtxOPx4IsUM4Q6RVqBuFN8DoESBvpjUfMNAV5bMNzNbXFKQwcHCVi2z 20IRgSJ742zgl294lPzEKZhoIgOAV9RQ3w0VUhLmvfVtn8gjgeOMC1vfNRRgAkXJwPdp lUylv8wbPR10cpMjppw9BzDTDTOmlGLY0JwJZCVFaUvGArFDNs2S9nuNDFTynn7z3g+h MybQ== 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=i+cO+9EMM2JD6F6o50QfwlTXOe8ZQhfDqfgiLUw0a0Q=; b=N2r28fyeJ/wRxmoAyWb5PVi7pH15pwx/dVCm2qEOhdxixF8ZYbFxNAGVaYFP31KNJ4 uIzLwKNE0R+Zp3O9fiKzJZzYyFaPWmPopBQHxZkC+uLE8ZlRLurEOsHJb7LwEiXTptJo DKnbM1QebgpHIOApOy1NSwet9GWXjy4HQn6feFyrgMbODXNJNeD6uT/HkZqpDqzPa2os +j3NPBJKvihcp7jvEUSKaFJDBG6kDHA+1vqq8pFU5bzUWXuhYZESv1eldNmQ6e/C4URr IbT0ytXJrvoBrfki6ZYzU8pouxphADXggFKRUf9Z4ERngac02lddBSTuK+jhGCZT3Dqj hqyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=NnUlJ7Dc; 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 c67si2208735oif.5.2020.04.08.02.08.22; Wed, 08 Apr 2020 02:08:37 -0700 (PDT) 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=NnUlJ7Dc; 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 S1727859AbgDHJGL (ORCPT + 99 others); Wed, 8 Apr 2020 05:06:11 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:17133 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727593AbgDHJGJ (ORCPT ); Wed, 8 Apr 2020 05:06:09 -0400 X-UUID: 0df92e5b88774149b64a973690f36de6-20200408 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=i+cO+9EMM2JD6F6o50QfwlTXOe8ZQhfDqfgiLUw0a0Q=; b=NnUlJ7DcSgFb6eLlPCNXyuPELXW5j5RNIvRfE6fIkCGURicoldmRab/Vq5O+3xYLA52yoEtE5ZgLimUPr89miSZC/r+ANZd2V9r9IU5T6aq/HcPq+/HwRmm098JCF0U2nvwfv7VE7Zw0d1LlFxH4zxIwL1HPsljgLPzmKIA6DYk=; X-UUID: 0df92e5b88774149b64a973690f36de6-20200408 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 130815472; Wed, 08 Apr 2020 17:06:01 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Apr 2020 17:05:57 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 8 Apr 2020 17:05:57 +0800 From: Michael Kao To: , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Matthias Brugger , , , CC: , , , , Louis Yu Subject: [RESEND PATCH] thermal: mediatek: add suspend/resume callback Date: Wed, 8 Apr 2020 17:05:58 +0800 Message-ID: <20200408090558.12410-2-michael.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200408090558.12410-1-michael.kao@mediatek.com> References: <20200408090558.12410-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 ZXNwZWN0aXZ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F0aWMgdm9p ZCBtdGtfdGhlcm1hbF9pbml0X2Jhbmsoc3RydWN0IG10a190aGVybWFsICptdCwgaW50IG51bSwN CiAJYmFuay0+aWQgPSBudW07DQogCWJhbmstPm10ID0gbXQ7DQogDQotCW10a190aGVybWFsX2dl dF9iYW5rKGJhbmspOw0KKwltdGtfdGhlcm1hbF9sb2NrX2JhbmsoYmFuayk7DQogDQogCS8qIGJ1 cyBjbG9jayA2Nk0gY291bnRpbmcgdW5pdCBpcyAxMiAqIDE1LjE1bnMgKiAyNTYgPSA0Ni41NDB1 cyAqLw0KIAl3cml0ZWwoVEVNUF9NT05DVEwxX1BFUklPRF9VTklUKDEyKSwgY29udHJvbGxlcl9i YXNlICsgVEVNUF9NT05DVEwxKTsNCkBAIC03NDMsNyArNzU0LDQzIEBAIHN0YXRpYyB2b2lkIG10 a190aGVybWFsX2luaXRfYmFuayhzdHJ1Y3QgbXRrX3RoZXJtYWwgKm10LCBpbnQgbnVtLA0KIAkg ICAgICAgVEVNUF9BRENXUklURUNUUkxfQURDX01VWF9XUklURSwNCiAJICAgICAgIGNvbnRyb2xs ZXJfYmFzZSArIFRFTVBfQURDV1JJVEVDVFJMKTsNCiANCi0JbXRrX3RoZXJtYWxfcHV0X2Jhbmso YmFuayk7DQorCW10a190aGVybWFsX3VubG9ja19iYW5rKGJhbmspOw0KK30NCisNCitzdGF0aWMg aW50IG10a190aGVybWFsX2Rpc2FibGVfc2Vuc2luZyhzdHJ1Y3QgbXRrX3RoZXJtYWwgKm10LCBp bnQgbnVtKQ0KK3sNCisJc3RydWN0IG10a190aGVybWFsX2JhbmsgKmJhbmsgPSAmbXQtPmJhbmtz W251bV07DQorCXUzMiB2YWw7DQorCXVuc2lnbmVkIGxvbmcgdGltZW91dDsNCisJdm9pZCBfX2lv bWVtICphZGRyOw0KKwlpbnQgcmV0ID0gMDsNCisNCisJYmFuay0+aWQgPSBudW07DQorCWJhbmst Pm10ID0gbXQ7DQorDQorCW10a190aGVybWFsX2xvY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