Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp88185pxa; Mon, 10 Aug 2020 19:44:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxuCdK2r2JPVkTaauH6g95hDH7WFdoUzQLARaD6Ao40BhYFVmGkf2l8Qj4Y+K2V9uXKkhC X-Received: by 2002:a17:906:f914:: with SMTP id lc20mr24026432ejb.138.1597113855009; Mon, 10 Aug 2020 19:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597113855; cv=none; d=google.com; s=arc-20160816; b=rNlxqFAyH75BjesLfZmO2gQntJ8GHpM4ANwKGjRyg8um/dfwIXzabRbtjMAF35tkYL M/hdwWLr3njeZawXzUGPB4eLVgp9H8Qr2FJINST+d89MIdRNkfWkpQEpPmZqjlqikzSr 7JWrdAC6mH68zj8j14IuV5Omhto/Bb9qiGqN3jzasQ06MujQ8/K5kZRBAk3XRCxhb0zj NT24ibTZ45cyrfiNZHnh3xospIyppE+k7zBfybTZL4pz2LlIyzasZbx5vuMhnRVwcB/g rPz2n7nn4hn5XhDtnMf5yn73xLo1HyKcw5bmcjVkPd6b0ZtU17foA8CPP84I6AQtr0Zg Vs0g== 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=4dSh8X50lsQTddyaxFcLAsX9p7BVfAPhylW2w4QlGJ0=; b=f8IijbwqesK15BuweeyfIlbmAXkUip1lYt5LCiwnfd1E05VMA1UYym5RBm9qIDOq7q vLo8OJdZ2X9rITJZjGHokasGKjS5z1IUmljsTYUTT4XO5iBSTjHET7dxoAvhePYoPJC7 YJMFTMAL9QSmeSSNE7V7gMREd3IVo4SbWd32twtYYy5ftx27zEUqbd/IModD89XeTTU6 /X6UADHXp6rcls54foLqWibLWtdbbVRzLOCXr5MtU5iASbyyKcgoTXrTPWnGTaHPSMLj /XM4qulogXMGXGO5yFgSem35l0SqtraVCV/Xug0Yip4ouOWneDBd37k4m/C3mkuAELbE BrcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=slXs9tKw; 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 bx25si11560489edb.149.2020.08.10.19.43.51; Mon, 10 Aug 2020 19:44:14 -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=slXs9tKw; 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 S1728210AbgHKCnB (ORCPT + 99 others); Mon, 10 Aug 2020 22:43:01 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:44170 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726831AbgHKCnA (ORCPT ); Mon, 10 Aug 2020 22:43:00 -0400 X-UUID: 50dc2a50074e4d44a7a0587386d627b6-20200811 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=4dSh8X50lsQTddyaxFcLAsX9p7BVfAPhylW2w4QlGJ0=; b=slXs9tKwusDLCzUuAvaZiJXpdHzlz4rTEyCBVnu6zM6/+aJoh5PELc8A9Th5PDdMtxvshGPHcaRMJv1+b/X7xc9R0PKPvVvtJGZQdZX9A0O9A7tu2Ppn3zSC7NS502ASYiRwjwVRHDDJzxvbrycw1HwLr7n+S/yRLJdskOg4e3E=; X-UUID: 50dc2a50074e4d44a7a0587386d627b6-20200811 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 2030525295; Tue, 11 Aug 2020 10:42:46 +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.1497.2; Tue, 11 Aug 2020 10:42:45 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 11 Aug 2020 10:42:45 +0800 Message-ID: <1597113765.15146.3.camel@mtkswgap22> Subject: Re: [PATCH v5 2/2] soc: mediatek: add mt6779 devapc driver From: Neal Liu To: Chun-Kuang Hu CC: Neal Liu , Rob Herring , Matthias Brugger , , wsd_upstream , lkml , "moderated list:ARM/Mediatek SoC support" , Linux ARM Date: Tue, 11 Aug 2020 10:42:45 +0800 In-Reply-To: References: <1596766948-29767-1-git-send-email-neal.liu@mediatek.com> <1596766948-29767-3-git-send-email-neal.liu@mediatek.com> <1597030994.7823.5.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 SGkgQ2h1bi1LdWFuZywNCg0KT24gVHVlLCAyMDIwLTA4LTExIGF0IDA3OjE0ICswODAwLCBDaHVu LUt1YW5nIEh1IHdyb3RlOg0KPiBIaSwgTmVhbDoNCj4gDQo+IE5lYWwgTGl1IDx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AgIGRldmFwY19pcnEgPSBpcnFfb2ZfcGFyc2VfYW5kX21hcChub2RlLCAwKTsN Cj4gPiA+ID4gKyAgICAgICBpZiAoIWRldmFwY19pcnEpDQo+ID4gPiA+ICsgICAgICAgICAgICAg ICByZXR1cm4gLUVJTlZBTDsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgIGN0eC0+aW5mcmFf Y2xrID0gZGV2bV9jbGtfZ2V0KCZwZGV2LT5kZXYsICJkZXZhcGMtaW5mcmEtY2xvY2siKTsNCj4g PiA+ID4gKyAgICAgICBpZiAoSVNfRVJSKGN0eC0+aW5mcmFfY2xrKSkNCj4gPiA+ID4gKyAgICAg ICAgICAgICAgIHJldHVybiAtRUlOVkFMOw0KPiA+ID4gPiArDQo+ID4gPiA+ICsgICAgICAgaWYg KGNsa19wcmVwYXJlX2VuYWJsZShjdHgtPmluZnJhX2NsaykpDQo+ID4gPiA+ICsgICAgICAgICAg ICAgICByZXR1cm4gLUVJTlZBTDsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgIHJldCA9IGRl dm1fcmVxdWVzdF9pcnEoJnBkZXYtPmRldiwgZGV2YXBjX2lycSwNCj4gPiA+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChpcnFfaGFuZGxlcl90KWRldmFwY192aW9sYXRpb25faXJx LA0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVJRRl9UUklHR0VSX05P TkUsICJkZXZhcGMiLCBjdHgpOw0KPiA+ID4gPiArICAgICAgIGlmIChyZXQpIHsNCj4gPiA+ID4g KyAgICAgICAgICAgICAgIGNsa19kaXNhYmxlX3VucHJlcGFyZShjdHgtPmluZnJhX2Nsayk7DQo+ ID4gPiA+ICsgICAgICAgICAgICAgICByZXR1cm4gcmV0Ow0KPiA+ID4gPiArICAgICAgIH0NCj4g PiA+ID4gKw0KPiA+ID4gPiArICAgICAgIHBsYXRmb3JtX3NldF9kcnZkYXRhKHBkZXY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