Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2226646ybt; Mon, 15 Jun 2020 23:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyte2R8R26TRbyPmcQYKWyoB1toNR5YYCCqZWU/XAOy0dIq6By4WFnosKxS5jcjOpiL/7mg X-Received: by 2002:a50:f611:: with SMTP id c17mr1187173edn.60.1592290074630; Mon, 15 Jun 2020 23:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592290074; cv=none; d=google.com; s=arc-20160816; b=cJ/Bxooky7AooDmF+Ff7YNNQ5l9SmSNlRQX3caju3xtaKj41Oc0PY9qak9CNRvgaZj aWFTE858CsBsk3+oa3Mdv3cpjMDUKxjHKhen7JfDtjP3aO077Biuf22uPJvgmo0mhpPG hcnm14OYV/bFXvkgtat8tc32A7BDxSpXF2fzJKIHl7EOv5JPPde8XKCEgzIgia7tkoCG pnY/WgzDbQB+M5ATHJGHu1Xzta228bPv26XnTteCx4vi0prUA95WaWglPh+FyoG0SrZY /Cw1WkRNAkPEBRNSnkEax2vbrVWqJXFG+NGhHLYxFqEvZw3R37Ls0nJfGg5WCxz47gof PTYg== 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=W4qKFFMIfCjUV1spWCJfib0w71vRrrWDwj9EgIwR5dc=; b=q/CLAdgUgqwEVWXPt6eAwXWiDkqWRiATBQ0Cva8b2fZlvzoZZWK5tKaWD0gDplZ6Qh drVjus/gNbQwUWPIX3VUS3OJ3do4PJs5s8gdm4dub0vYhNnbJ41DWdxSIGfFuNjOZtKV GnbQb0e2zjX3jcrXHi56qZX6z25ms/OYDBD7HeTsJ8tVJzbim02c3dufOOaNsvVkNmzj ff5y9BQTvd0ZoBnMj7mPmS4oMQ0xpWkSCBwfp1cab6w0etcWhi6UH7LnoVFVYcLhtxYy zAuRS6lV+HxgwzDQCtG3q0rpMw9Do4QCmaPolwImbKrq3aLHi8M6MUZ8QJPx1mkIIM5n V43A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=N7Fb6AjW; 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 a9si9339230edt.344.2020.06.15.23.47.31; Mon, 15 Jun 2020 23:47:54 -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=N7Fb6AjW; 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 S1726303AbgFPGpr (ORCPT + 99 others); Tue, 16 Jun 2020 02:45:47 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:47524 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725710AbgFPGpr (ORCPT ); Tue, 16 Jun 2020 02:45:47 -0400 X-UUID: d83bc4abf8ea4b9c94f87cc1e23e1fa3-20200616 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=W4qKFFMIfCjUV1spWCJfib0w71vRrrWDwj9EgIwR5dc=; b=N7Fb6AjWpI+YMw4lFN26slnXV28iKHUXwihcyVUXyTzAXTjCSlkysuBl7zqmk/ymy+VJWk1OP0/PVPk00QzgotxohatGGXDzliD3WhypHnNyWU1SloS4yJBWI/rBIfMOGBcOUBCuT8j+VRkLCjJmjzBfCF3HYa/f1XsiiVnbrzQ=; X-UUID: d83bc4abf8ea4b9c94f87cc1e23e1fa3-20200616 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 66482698; Tue, 16 Jun 2020 14:45:38 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Jun 2020 14:45:35 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 16 Jun 2020 14:45:36 +0800 Message-ID: <1592289936.18012.13.camel@mtkswgap22> Subject: Re: [PATCH 2/2] soc: mediatek: devapc: add devapc-mt6873 driver From: Neal Liu To: Chun-Kuang Hu CC: Neal Liu , "devicetree@vger.kernel.org" , wsd_upstream , linux-kernel , Rob Herring , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , Linux ARM Date: Tue, 16 Jun 2020 14:45:36 +0800 In-Reply-To: References: <1591698261-22639-1-git-send-email-neal.liu@mediatek.com> <1591698261-22639-3-git-send-email-neal.liu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: DFB70BE6E56C0D09D9683085BFD09108B3FA939408F6671BF8B7A07284CDEAB62000:8 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 SGkgQ2h1bi1LdWFuZywNCg0KDQpPbiBTYXQsIDIwMjAtMDYtMTMgYX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ICsNCj4gPiArICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZkZXZhcGNfbG9jaywgZmxhZ3Mp Ow0KPiA+ICsNCj4gPiArICAgICAgIGRldmljZV9pbmZvID0gbXRrX2RldmFwY19jdHgtPnNvYy0+ ZGV2aWNlX2luZm87DQo+ID4gKyAgICAgICB2aW9faW5mbyA9IG10a19kZXZhcGNfY3R4LT5zb2Mt PnZpb19pbmZvOw0KPiA+ICsgICAgICAgbm9ybWFsID0gZmFsc2U7DQo+ID4gKyAgICAgICB2aW9f aWR4ID0gLTE7DQo+ID4gKyAgICAgICBpbmRleCA9IC0xOw0KPiA+ICsNCj4gPiArICAgICAgIC8q IFRoZXJlIGFyZSBtdWx0aXBsZSBERVZBUENfUEQgKi8NCj4gPiArICAgICAgIGZvciAoc2xhdmVf dHlwZSA9IDA7IHNsYXZlX3R5cGUgPCBzbGF2ZV90eXBlX251bTsgc2xhdmVfdHlwZSsrKSB7DQo+ ID4gKyAgICAgICAgICAgICAgIGlmICghY2hlY2tfdHlwZTJfdmlvX3N0YXR1cyhzbGF2ZV90eXBl LCAmdmlvX2lkeCwgJmluZGV4KSkNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW10 a19kZXZhcGNfZHVtcF92aW9fZGJnKHNsYXZlX3R5cGUsICZ2aW9faWR4LA0KPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmluZGV4KSkNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KPiA+ICsNCj4gPiAr ICAgICAgICAgICAgICAgLyogRW5zdXJlIHRoYXQgdmlvbGF0aW9uIGluZm8gYXJlIHdyaXR0ZW4g YmVmb3JlDQo+ID4gKyAgICAgICAgICAgICAgICAqIGZ1cnRoZXIgb3BlcmF0aW9ucw0KPiA+ICsg ICAgICAgICAgICAgICAgKi8NCj4gPiArICAgICAgICAgICAgICAgc21wX21iKCk7DQo+ID4gKyAg ICAgICAgICAgICAgIG5vcm1hbCA9IHRydWU7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICBt YXNrX21vZHVsZV9pcnEoc2xhdmVfdHlwZSwgdmlvX2lkeCwgdHJ1ZSk7DQo+ID4gKw0KPiA+ICsg ICAgICAgICAgICAgICBpZiAoY2xlYXJfdmlvX3N0YXR1cyhzbGF2ZV90eXBlLCB2aW9faWR4KSkN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgICBwcl93YXJuKFBGWCAiJXMsICVzOjB4JXgsICVz OjB4JXhcbiIsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiY2xlYXIgdmlv IHN0YXR1cyBmYWlsZWQiLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNs YXZlX3R5cGUiLCBzbGF2ZV90eXBlLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgInZpb19pbmRleCIsIHZpb19pZHgpOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgcGVy bSA9IGdldF9wZXJtaXNzaW9uKHNsYXZlX3R5cGUsIGluZGV4LCB2aW9faW5mby0+ZG9tYWluX2lk KTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIHZpb19tYXN0ZXIgPSBtdGtfZGV2YXBjX2N0 eC0+c29jLT5tYXN0ZXJfZ2V0DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgKHZpb19pbmZv LT5tYXN0ZXJfaWQsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgIHZpb19pbmZvLT52aW9f YWRkciwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgc2xhdmVfdHlwZSwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgdmlvX2luZm8tPnNoaWZ0X3N0YV9iaXQsDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAgIHZpb19pbmZvLT5kb21haW5faWQpOw0KPiA+ICsNCj4gPiArICAg ICAgICAgICAgICAgaWYgKCF2aW9fbWFzdGVyKSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAg ICAgcHJfd2FybihQRlggIm1hc3Rlcl9nZXQgZmFpbGVkXG4iKTsNCj4gPiArICAgICAgICAgICAg ICAgICAgICAgICB2aW9fbWFzdGVyID0gIlVOS05PV05fTUFTVEVSIjsNCj4gPiArICAgICAgICAg ICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgcHJfaW5mbyhQRlggIiVzIC0gJXM6 MHgleCwgJXM6MHgleCwgJXM6MHgleCwgJXM6MHgleFxuIiwNCj4gPiArICAgICAgICAgICAgICAg ICAgICAgICAiVmlvbGF0aW9uIiwgInNsYXZlX3R5cGUiLCBzbGF2ZV90eXBlLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICJzeXNfaW5kZXgiLA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgIGRldmljZV9pbmZvW3NsYXZlX3R5cGVdW2luZGV4XS5zeXNfaW5kZXgsDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAgImN0cmxfaW5kZXgiLA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgIGRldmljZV9pbmZvW3NsYXZlX3R5cGVdW2luZGV4XS5jdHJsX2luZGV4LA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICJ2aW9faW5kZXgiLA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgIGRldmljZV9pbmZvW3NsYXZlX3R5cGVdW2luZGV4XS52aW9faW5kZXgpOw0KPiA+ICsNCj4g PiArICAgICAgICAgICAgICAgcHJfaW5mbyhQRlggIiVzICVzICVzICVzXG4iLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICJWaW9sYXRpb24gLSBtYXN0ZXI6IiwgdmlvX21hc3RlciwNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICAiYWNjZXNzIHZpb2xhdGlvbiBzbGF2ZToiLA0KPiA+ ICsgICAgICAgICAgICAgICAgICAgICAgIGRldmljZV9pbmZvW3NsYXZlX3R5cGVdW2luZGV4XS5k ZXZpY2UpOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgZGV2YXBjX3Zpb19yZWFzb24ocGVy bSk7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICBkZXZhcGNfZXh0cmFfaGFuZGxlcihzbGF2 ZV90eXBlLCB2aW9fbWFzdGVyLCB2aW9faWR4LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB2aW9faW5mby0+dmlvX2FkZHIpOw0KPiA+ICsNCj4gPiArICAgICAgICAg ICAgICAgbWFza19tb2R1bGVfaXJxKHNsYXZlX3R5cGUsIHZpb19pZHgsIGZhbHNlKTsNCj4gPiAr ICAgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgICBpZiAobm9ybWFsKSB7DQo+ID4gKyAgICAgICAg ICAgICAgIHNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmRldmFwY19sb2NrLCBmbGFncyk7DQo+ID4g KyAgICAgICAgICAgICAgIHJldHVybiBJUlFfSEFORExFRDsNCj4gPiArICAgICAgIH0NCj4gPiAr DQo+ID4gKyAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZkZXZhcGNfbG9jaywgZmxhZ3Mp Ow0KPiA+ICsgICAgICAgcmV0dXJuIElSUV9IQU5ETEVEOw0KPiA+ICt9DQo+ID4gKw0KPiANCj4g W3NuaXBdDQo+IA0KPiA+ICsNCj4gPiAraW50IG10a19kZXZhcGNfcHJvYmUoc3RydWN0IHBsYXRm b3JtX2RldmljZSAqcGRldiwgc3RydWN0IG10a19kZXZhcGNfc29jICpzb2MpDQo+ID4gK3sNCj4g PiArICAgICAgIHN0cnVjdCBkZXZpY2Vfbm9kZSAqbm9kZSA9IHBkZXYtPmRldi5vZl9ub2RlOw0K PiA+ICsgICAgICAgdTMyIHNsYXZlX3R5cGVfbnVtOw0KPiA+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DQo+ID4gKyAgICAgICBpZiAoIW10a19kZXZhcGNfY3R4LT5kZXZhcGNfaXJxKQ0K PiA+ICsgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsNCj4gPiArDQo+ID4gKyAgICAgICAv KiBDQ0YgKENvbW1vbiBDbG9jayBGcmFtZXdvcmspICovDQo+ID4gKyAgICAgICBtdGtfZGV2YXBj X2N0eC0+ZGV2YXBjX2luZnJhX2NsayA9IGRldm1fY2xrX2dldCgmcGRldi0+ZGV2LA0KPiA+ICsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImRl dmFwYy1pbmZyYS1jbG9jayIpOw0KPiA+ICsNCj4gPiArICAgICAgIGlmIChJU19FUlIobXRrX2Rl dmFwY19jdHgtPmRldmFwY19pbmZyYV9jbGspKQ0KPiA+ICsgICAgICAgICAgICAgICByZXR1cm4g LUVJTlZBTDsNCj4gPiArDQo+ID4gKyAgICAgICBwcm9jX2NyZWF0ZSgiZGV2YXBjX2RiZyIsIDA2 NjQsIE5VTEwsICZkZXZhcGNfZGJnX2ZvcHMpOw0KPiA+ICsNCj4gPiArICAgICAgIGlmIChjbGtf cHJlcGFyZV9lbmFibGUobXRrX2RldmFwY19jdHgtPmRldmFwY19pbmZyYV9jbGspKQ0KPiA+ICsg ICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsNCj4gPiArDQo+ID4gKyAgICAgICBzdGFydF9k ZXZhcGMoKTsNCj4gPiArDQo+ID4gKyAgICAgICByZXQgPSBkZXZtX3JlcXVlc3RfaXJxKCZwZGV2 LT5kZXYsIG10a19kZXZhcGNfY3R4LT5kZXZhcGNfaXJxLA0KPiA+ICsgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoaXJxX2hhbmRsZXJfdClkZXZhcGNfdmlvbGF0aW9uX2lycSwNCj4gPiAr ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVJRRl9UUklHR0VSX05PTkUsICJkZXZhc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