Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp729896ybg; Sun, 26 Jul 2020 20:08:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8mcIftW2AjxJjn9GSvh6mtlFODsOMxtNi/dw0M0qNy4pdStewfjutLrDatnYHxr8oQr4g X-Received: by 2002:a17:906:4f82:: with SMTP id o2mr19815514eju.424.1595819282782; Sun, 26 Jul 2020 20:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595819282; cv=none; d=google.com; s=arc-20160816; b=h4A96trjND3RXkS033WHAWV7NQjjP378R9jMM9i+y08xa6n1T73HjXbh9qg0jvQWFQ YcT82ct0IULTfiUlG19iz3pCoCaKa+XUDGxYVeAtDvpIgcC7ZbYI/ng4rQDQO7KX/zNy HEqLUlOzeEYvo3U9JNyYJBjs4/3lfU2IP7rDWEkD4GHkwv5QrfUlsLsZwWw8/7bAyoD8 uEefKAt20lZXPp5VerbnT/zxtX3fguWF8PUZMSlHTpn69J9rQFWUeTGqvXWJAKAuMILv d79L2LeQ7yyHO0mJKkTstsIQKf1nYVzLHwoBRAu1538CA9hgdmKWLYzQvEcJvuburb6b 0TcQ== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=5/V0PEXQVPj/V13UI/llyoR37okP9kJm90/hNHhsHC8=; b=Hx8C+dShEXkPbu8kaBS8x/DsH57/qrwA8+0MtVJK8rCC54MRGP3r19i/2ctg5xa/yz EdiJVf6rhdybbFTzEGWiW1r8Yu3mTkQurZ3ALTeVlkcPWYkENq/x1jIx2z2G+8Xebu6/ 4mbRqlz2Rfi7noU77ieMriVyLzOy3JjIDiRhnOx9amfhAJ2/xXO3XkczpQWsLdwN1qja vEDQPRB+XWg/Bbl9ZYkyggo2I04E6Oeg0iaoAQMQ4xQfJ35uFqox5UKZuMvhH/1yjbth dE3wYZsD23cW5+a4Ke6qTHg38ofLx8EcljU27Et+lqFXMWWuvlbe8XZwIgN/ip8nZyJR 6V5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=RyTWY7MP; 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 w10si5341302ejv.259.2020.07.26.20.07.40; Sun, 26 Jul 2020 20:08: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=RyTWY7MP; 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 S1727817AbgG0DGF (ORCPT + 99 others); Sun, 26 Jul 2020 23:06:05 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:44553 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726044AbgG0DGF (ORCPT ); Sun, 26 Jul 2020 23:06:05 -0400 X-UUID: 5d19f6b12033479897dfa350949168bd-20200727 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=5/V0PEXQVPj/V13UI/llyoR37okP9kJm90/hNHhsHC8=; b=RyTWY7MPHYUXMrgyLOdDAvgsc20fJNQ7x4XPDAspnmTgtw18G7+MfkW98ZgFbnlB8Jpg8V2aIqIg/m67E8sQGNiVJTpXAb4/dlgNujHgKAwUQMlrmATx2StAWnKDj/EjwbqG5dcUaXg4ybrQfEqw70KTEhUPepcyoZBr1J+k30I=; X-UUID: 5d19f6b12033479897dfa350949168bd-20200727 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1109948874; Mon, 27 Jul 2020 11:05:53 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Jul 2020 11:05:51 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 27 Jul 2020 11:05:51 +0800 Message-ID: <1595819152.7630.13.camel@mtkswgap22> Subject: Re: [PATCH v3 2/2] soc: mediatek: add mtk-devapc driver From: Neal Liu To: Chun-Kuang Hu CC: Neal Liu , Rob Herring , Matthias Brugger , "devicetree@vger.kernel.org" , wsd_upstream , lkml , "moderated list:ARM/Mediatek SoC support" , Linux ARM Date: Mon, 27 Jul 2020 11:05:52 +0800 In-Reply-To: References: <1595303971-8793-1-git-send-email-neal.liu@mediatek.com> <1595303971-8793-3-git-send-email-neal.liu@mediatek.com> <1595389756.20193.12.camel@mtkswgap22> <1595484707.26237.12.camel@mtkswgap22> <1595573719.24412.9.camel@mtkswgap22> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 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 SGkgQ2h1bi1LdWFuZywNCg0KT24gRnJpLCAyMDIwLTA3LTI0IGF0IDIzOjU1ICswODAwLCBD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