Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3283763ybt; Mon, 22 Jun 2020 21:07:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSsTU1LXZF1VTQKFUBVptQfRP5IuxIMKWQa6r2Shps2RUrFf8sJVtETFXMcUu4GljUVM9N X-Received: by 2002:a17:906:c2d0:: with SMTP id ch16mr744941ejb.414.1592885275840; Mon, 22 Jun 2020 21:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592885275; cv=none; d=google.com; s=arc-20160816; b=bO4mFMeHQ2RgD9LKxwifvvNz01wkDJZ613kobVs2e7mzUHguWCOWp4hs4KYiksccL6 od67b4tkZ1+C95igT9dXIctfBDP0IURC9S4Q4RLanflJRDbw5cGfdydWqwQxjiXEyCRa beQ1hjzNAcayFnAdMXDKJd+5qV3firbIoKh9au7F0yeo0hv8mTX0Jc65lgOEDO3if3/r s9RrGUTN+vwU4hVQOMVi0JKF4+ebBv2b8obYpLdx5aQsmKvjvO8g9Mnywxs+gTucXfDN Qudp21E3OqTmPGRAShCwjZvacm4Vl6nOkJCYXXDshjJXqsr4gX934cEKeo8QyfkdICgn f3fQ== 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=e5gLSl/1mTN2/gkuRR/doutH5GxfcozvGZbTJlualu0=; b=Ra3NCDwnvQikxJyV3EWO4QXH5S/hpz8Xqk2nkK22cQ2oU3WExWw/lUBRIIrpoDk2SE TitxGvjtUL3EmD/YWZXoN5h3nHqfRWNEyTwgO32t81cAa2tGye9AdnxS0XKZDYxPdTyF EEUEs+RHMrW6XL1+5HP8917oT89kuuxG/QZJs4jNE/LkqhLyijuc9TPRh+pFQDwoVGVw CaXTYgxAeLNnvPvvCscWJyBKeKRqHUbwIBXA7/Jr/6JnVsxR+uQbF0ET5vRMc+6E9gMR u2goUWW9osEpgZJ1Zx7cBentYMl//JCLeJ1pNbzzeEZmfgBI2waPLKg7We8mA2pr3tBx Ecsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Pr0uOWSW; 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 oz40si2293876ejb.432.2020.06.22.21.07.33; Mon, 22 Jun 2020 21:07:55 -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=Pr0uOWSW; 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 S1732296AbgFWEDL (ORCPT + 99 others); Tue, 23 Jun 2020 00:03:11 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:21868 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732241AbgFWEDG (ORCPT ); Tue, 23 Jun 2020 00:03:06 -0400 X-UUID: bd2d35281db1495b9f582c8778a958cc-20200623 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=e5gLSl/1mTN2/gkuRR/doutH5GxfcozvGZbTJlualu0=; b=Pr0uOWSWrbSgcGJtlofyCmQ8KXfhY1NFbA6jXTQVfgisYCnCZO9UtqnXZL7Zm1wbgoYuj+wxPu6LxM92eYnQ8i8Wr0XI/YiT+nAV28yJJp6veHxvMsGY+eZc6wdUA0PXDqDU9bKMcVeI1jKp4y/mWK1DDJ+e19+g5NRfn+2zerQ=; X-UUID: bd2d35281db1495b9f582c8778a958cc-20200623 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 2006745245; Tue, 23 Jun 2020 12:02:58 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 23 Jun 2020 12:02:51 +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, 23 Jun 2020 12:02:51 +0800 Message-ID: <1592884977.14160.1.camel@mtkswgap22> Subject: Re: [PATCH v2 2/2] soc: mediatek: devapc: add devapc-mt6873 driver From: Neal Liu To: Chun-Kuang Hu CC: Neal Liu , Rob Herring , Matthias Brugger , , wsd_upstream , linux-kernel , "moderated list:ARM/Mediatek SoC support" , Linux ARM Date: Tue, 23 Jun 2020 12:02:57 +0800 In-Reply-To: References: <1592559720-8482-1-git-send-email-neal.liu@mediatek.com> <1592559720-8482-3-git-send-email-neal.liu@mediatek.com> <1592623132.15277.7.camel@mtkswgap22> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: E4501519B3A57E7D1488FAEBD1E9F8F9321B0C6E1892EB37DAC542BC5E176C632000: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 SGkgQ2h1bi1LdWFuZywNCg0KDQpPbiBTdW4sIDIwMjAtMDY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HNsYXZlX3R5cGUrKykgew0KPiA+ID4gPiArICAgICAgICAgICAgICAgcGRfYXBj X2Nvbl9yZWcgPSBtdGtfZGV2YXBjX3BkX2dldChkZXZhcGNfY3R4LCBzbGF2ZV90eXBlLA0KPiA+ ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBB UENfQ09OLCAwKTsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgIHBkX3Zpb19zaGlmdF9zdGFfcmVn ID0gbXRrX2RldmFwY19wZF9nZXQoZGV2YXBjX2N0eCwgc2xhdmVfdHlwZSwNCj4gPiA+ID4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVklP X1NISUZUX1NUQSwgMCk7DQo+ID4gPiA+ICsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgIGlmICgh cGRfYXBjX2Nvbl9yZWcgfHwgIXBkX3Zpb19zaGlmdF9zdGFfcmVnIHx8ICFkZXZpY2VfaW5mbykN Cj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOw0KPiA+ID4gPiArDQo+ID4g PiA+ICsgICAgICAgICAgICAgICAvKiBDbGVhciBERVZBUEMgdmlvbGF0aW9uIHN0YXR1cyAqLw0K PiA+ID4gPiArICAgICAgICAgICAgICAgd3JpdGVsKEJJVCgzMSksIHBkX2FwY19jb25fcmVnKTsN Cj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgICAgICAgICAgLyogQ2xlYXIgdmlvbGF0aW9uIHNo aWZ0IHN0YXR1cyAqLw0KPiA+ID4gPiArICAgICAgICAgICAgICAgdmlvX3NoaWZ0X3N0YSA9IHJl YWRsKHBkX3Zpb19zaGlmdF9zdGFfcmVnKTsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgIGlmICh2 aW9fc2hpZnRfc3RhKQ0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICB3cml0ZWwodmlv X3NoaWZ0X3N0YSwgcGRfdmlvX3NoaWZ0X3N0YV9yZWcpOw0KPiA+ID4gPiArDQo+ID4gPiA+ICsg ICAgICAgICAgICAgICAvKiBDbGVhciB0eXBlIDIgdmlvbGF0aW9uIHN0YXR1cyAqLw0KPiA+ID4g PiArICAgICAgICAgICAgICAgY2hlY2tfdHlwZTJfdmlvX3N0YXR1cyhkZXZhcGNfY3R4LCBzbGF2 ZV90eXBlLCAmdmlvX2lkeCwgJmkpOw0KPiA+ID4gPiArDQo+ID4gPiA+ICsgICAgICAgICAgICAg ICAvKiBDbGVhciB2aW9sYXRpb24gc3RhdHVzICovDQo+ID4gPiA+ICsgICAgICAgICAgICAgICBm b3IgKGkgPSAwOyBpIDwgbmRldmljZXNbc2xhdmVfdHlwZV0udmlvX3NsYXZlX251bTsgaSsrKSB7 DQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIHZpb19pZHggPSBkZXZpY2VfaW5mb1tz bGF2ZV90eXBlXVtpXS52aW9faW5kZXg7DQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAg IGlmICgoY2hlY2tfdmlvX3N0YXR1cyhkZXZhcGNfY3R4LCBzbGF2ZV90eXBlLCB2aW9faWR4KQ0K PiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g VklPTEFUSU9OX1RSSUdHRVJFRCkgJiYNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjbGVhcl92aW9fc3RhdHVzKGRldmFwY19jdHgsIHNsYXZlX3R5cGUsDQo+ID4gPiA+ICsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aW9faWR4KSkgew0K PiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByX3dhcm4oUEZYICJDbGVh ciB2aW8gc3RhdHVzIGZhaWxlZCwgc2xhdmVfdHlwZToweCV4LCB2aW9faW5kZXg6MHgleFxuIiwN Cj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsYXZlX3R5 cGUsIHZpb19pZHgpOw0KPiA+ID4gPiArDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW5kZXggPSBpOw0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG10a19kZXZhcGNfZHVtcF92aW9fZGJnKGRldmFwY19jdHgsIHNsYXZlX3R5cGUsDQo+ID4g PiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJnZpb19pZHgsICZpbmRleCk7DQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaSA9IGluZGV4IC0gMTsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgfQ0K PiA+ID4gPiArDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIG1hc2tfbW9kdWxlX2ly cShkZXZhcGNfY3R4LCBzbGF2ZV90eXBlLCB2aW9faWR4LCBmYWxzZSk7DQo+ID4gPiA+ICsgICAg ICAgICAgICAgICB9DQo+ID4gPiA+ICsgICAgICAgfQ0KPiA+ID4gPiArfQ0KPiA+ID4gPiArDQo+ ID4gPiA+ICtzdGF0aWMgREVGSU5FX1NQSU5MT0NLKGRldmFwY19sb2NrKTsNCj4gPiA+DQo+ID4g PiBVc2VsZXNzLCBzbyByZW1vdmUgaXQuDQo+ID4NCj4gPiBXZSB1c2UgZGV2YXBjX2xvY2sgaW4g YmVsb3cgaXNyLCB3aGF0IGRvIHlvdSBtZWFuIHVzZWxlc3M/DQo+IA0KPiBXZSB1c2Ugc3Bpbmxv Y2sgYmVjYXVzZSBhIHRocmVhZCBjb250ZXh0IGFuZCBpcnEgY29udGV4dCB3b3VsZCBhY2Nlc3MN Cj4gdGhlIHNhbWUgcmVzb3VyY2UsIGJ1dCB3aGVy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bmRleDsNCj4g PiA+ID4gKyAgICAgICBjb25zdCBjaGFyICp2aW9fbWFzdGVyOw0KPiA+ID4gPiArICAgICAgIHVu c2lnbmVkIGxvbmcgZmxhZ3M7DQo+ID4gPiA+ICsgICAgICAgdTggcGVybTsNCj4gPiA+ID4gKw0K PiA+ID4gPiArICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZkZXZhcGNfbG9jaywgZmxhZ3MpOw0K PiA+ID4gPiArDQo+ID4gPiA+ICsgICAgICAgZGV2aWNlX2luZm8gPSBkZXZhcGNfY3R4LT5zb2Mt PmRldmljZV9pbmZvOw0KPiA+ID4gPiArICAgICAgIHZpb19pbmZvID0gZGV2YXBjX2N0eC0+c29j LT52aW9faW5mbzsNCj4gPiA+ID4gKyAgICAgICB2aW9faWR4ID0gLTE7DQo+ID4gPiA+ICsgICAg ICAgaW5kZXggPSAtMTsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgIC8qIFRoZXJlIGFyZSBt dWx0aXBsZSBERVZBUENfUEQgKi8NCj4gPiA+ID4gKyAgICAgICBmb3IgKHNsYXZlX3R5cGUgPSAw OyBzbGF2ZV90eXBlIDwgc2xhdmVfdHlwZV9udW07IHNsYXZlX3R5cGUrKykgew0KPiA+ID4gPiAr ICAgICAgICAgICAgICAgaWYgKCFjaGVja190eXBlMl92aW9fc3RhdHVzKGRldmFwY19jdHgsIHNs YXZlX3R5cGUsICZ2aW9faWR4LA0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICZpbmRleCkpDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAg IGlmICghbXRrX2RldmFwY19kdW1wX3Zpb19kYmcoZGV2YXBjX2N0eCwgc2xhdmVfdHlwZSwNCj4g PiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmdmlvX2lkeCwgJmluZGV4KSkNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb250aW51ZTsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgICAgICAgICAgLyogRW5z dXJlIHRoYXQgdmlvbGF0aW9uIGluZm8gYXJlIHdyaXR0ZW4gYmVmb3JlDQo+ID4gPiA+ICsgICAg ICAgICAgICAgICAgKiBmdXJ0aGVyIG9wZXJhdGlvbnMNCj4gPiA+ID4gKyAgICAgICAgICAgICAg ICAqLw0KPiA+ID4gPiArICAgICAgICAgICAgICAgc21wX21iKCk7DQo+ID4gPiA+ICsNCj4gPiA+ ID4gKyAgICAgICAgICAgICAgIG1hc2tfbW9kdWxlX2lycShkZXZhcGNfY3R4LCBzbGF2ZV90eXBl LCB2aW9faWR4LCB0cnVlKTsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgICAgICAgICAgY2xl YXJfdmlvX3N0YXR1cyhkZXZhcGNfY3R4LCBzbGF2ZV90eXBlLCB2aW9faWR4KTsNCj4gPiA+ID4g Kw0KPiA+ID4gPiArICAgICAgICAgICAgICAgcGVybSA9IGdldF9wZXJtaXNzaW9uKGRldmFwY19j dHgsIHNsYXZlX3R5cGUsIGluZGV4LA0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHZpb19pbmZvLT5kb21haW5faWQpOw0KPiA+ID4gPiArDQo+ID4gPiA+ICsg ICAgICAgICAgICAgICB2aW9fbWFzdGVyID0gZGV2YXBjX2N0eC0+c29jLT5tYXN0ZXJfZ2V0DQo+ ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICh2aW9faW5mby0+bWFzdGVyX2lkLA0KPiA+ ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgdmlvX2luZm8tPnZpb19hZGRyLA0KPiA+ID4g PiArICAgICAgICAgICAgICAgICAgICAgICAgc2xhdmVfdHlwZSwNCj4gPiA+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgIHZpb19pbmZvLT5zaGlmdF9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