Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1027712ybt; Fri, 19 Jun 2020 22:06:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiXYPfCDT2NfbXjCTpBi2NauIFgPX+P43R8K52XXMWa4FLIiRWvND1Xumr4gOC8KMT9+4d X-Received: by 2002:a05:6402:b79:: with SMTP id cb25mr6751934edb.334.1592629612817; Fri, 19 Jun 2020 22:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592629612; cv=none; d=google.com; s=arc-20160816; b=GHAd7Lvl+NqQB7ySU/6kYzlkIt8YdZdwPsix9r80d20pqRwjCNycklxs4aEb4gOPQw ad799ezQGM+/IHbon6boXowHmT4mwZ/GKJUWZIQrafcQ3CKA5BfAuruzGVxqoAv+aYRa nGd+weT3OVs+BES/l1CGcXaLaQRGiXEVGwk35Kp+hpMi51314AC2oNYrIckX8V2S/fxa HMaC5RlhGjGlqCA31qHJWTID2oFZGAdJgGD+arqo2kM5DHeacpmH3qRvh8Cf6iIRY7RG 4GhO7Kt3PZrGxSuLMNz0cwThaYqHpu9GMrPipWm33zgwBqEiPVi85LT53/ac9W1lCo3F ql8g== 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=8YLrmKpTqGDWWR37+uYBTclOlhsnj+IIswVserAsQuc=; b=WQQbtNQegudNuwWrCShACJHb0IuLNBThSOqOUsEzgwuxQ/mPWK38mPG/Pnph7SWBoo 2GaFf8h1Oz52jztpBZAK8Wqcc99NDKO05jkaSbM5mQlDdphbZg7UxYFXvDvCtohBziE3 rsCRzmAr0O0F2Dfm8CDGcPrI7d4YJu7Jm1A2FhTG4wVbfUEmYYwIOcKcMO2WXeRUMVRL NzFREqNAheboAD3pe1rAUUT/Up8AqvfYVMMiHxtiZI61ysTQSPW3wU2GW+J/fdEX09yh TR4kLSEi8p/Dv3aV2E+p3p5bZod1+lQUo7B4YvLr+R6e7qQUQ2M0uIMc0G/vIsesYi1Y 3LGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=QF4XNVgZ; 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 d7si4883664edr.520.2020.06.19.22.06.30; Fri, 19 Jun 2020 22:06:52 -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=QF4XNVgZ; 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 S1732503AbgFTDS7 (ORCPT + 99 others); Fri, 19 Jun 2020 23:18:59 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:22703 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732271AbgFTDS7 (ORCPT ); Fri, 19 Jun 2020 23:18:59 -0400 X-UUID: 115cecf19ef5468da985beea2b91f01d-20200620 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=8YLrmKpTqGDWWR37+uYBTclOlhsnj+IIswVserAsQuc=; b=QF4XNVgZRR2iHwt1yLvgkBGq90AVPda/NU1PjhpDFzwngWAe6JES3h//esyr12iiUaOuNhB+cP9gOgOGDpnIwZtnyNnyvhZiwjg31yYxYrAmwFOGQEwTUkwZ8F1iFZDGwFqTxJuXANhTW/+jwzj5RUlDc/19ydUz0tm0/0EBFxc=; X-UUID: 115cecf19ef5468da985beea2b91f01d-20200620 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 376903678; Sat, 20 Jun 2020 11:18: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; Sat, 20 Jun 2020 11:18:47 +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; Sat, 20 Jun 2020 11:18:52 +0800 Message-ID: <1592623132.15277.7.camel@mtkswgap22> Subject: Re: [PATCH v2 2/2] soc: mediatek: devapc: add devapc-mt6873 driver From: Neal Liu To: Chun-Kuang Hu CC: Rob Herring , Matthias Brugger , , wsd_upstream , linux-kernel , "moderated list:ARM/Mediatek SoC support" , Linux ARM Date: Sat, 20 Jun 2020 11:18:52 +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> 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 SGkgQ2h1bi1LdWFuZywNCg0KVGhhbmtzIGZvciB5b3VyIHF1aWNrIGZlZWRiYWNrLg0KDQpPbiBT YXQsIDIwMjAtMDYtMjAgYXQgMDA6MjUgKzA4MDAsIENodW4tS3VhbmcgSHUgd3JvdGU6DQo+I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3R5cGVfbnVtOyBzbGF2ZV90eXBlKyspIHsNCj4gPiArICAgICAgICAgICAgICAgcGRf YXBjX2Nvbl9yZWcgPSBtdGtfZGV2YXBjX3BkX2dldChkZXZhcGNfY3R4LCBzbGF2ZV90eXBlLA0K PiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFQ Q19DT04sIDApOw0KPiA+ICsgICAgICAgICAgICAgICBwZF92aW9fc2hpZnRfc3RhX3JlZyA9IG10 a19kZXZhcGNfcGRfZ2V0KGRldmFwY19jdHgsIHNsYXZlX3R5cGUsDQo+ID4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVklPX1NISUZUX1NU QSwgMCk7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICBpZiAoIXBkX2FwY19jb25fcmVnIHx8 ICFwZF92aW9fc2hpZnRfc3RhX3JlZyB8fCAhZGV2aWNlX2luZm8pDQo+ID4gKyAgICAgICAgICAg ICAgICAgICAgICAgcmV0dXJuOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgLyogQ2xlYXIg REVWQVBDIHZpb2xhdGlvbiBzdGF0dXMgKi8NCj4gPiArICAgICAgICAgICAgICAgd3JpdGVsKEJJ VCgzMSksIHBkX2FwY19jb25fcmVnKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIC8qIENs ZWFyIHZpb2xhdGlvbiBzaGlmdCBzdGF0dXMgKi8NCj4gPiArICAgICAgICAgICAgICAgdmlvX3No aWZ0X3N0YSA9IHJlYWRsKHBkX3Zpb19zaGlmdF9zdGFfcmVnKTsNCj4gPiArICAgICAgICAgICAg ICAgaWYgKHZpb19zaGlmdF9zdGEpDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVs KHZpb19zaGlmdF9zdGEsIHBkX3Zpb19zaGlmdF9zdGFfcmVnKTsNCj4gPiArDQo+ID4gKyAgICAg ICAgICAgICAgIC8qIENsZWFyIHR5cGUgMiB2aW9sYXRpb24gc3RhdHVzICovDQo+ID4gKyAgICAg ICAgICAgICAgIGNoZWNrX3R5cGUyX3Zpb19zdGF0dXMoZGV2YXBjX2N0eCwgc2xhdmVfdHlwZSwg JnZpb19pZHgsICZpKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIC8qIENsZWFyIHZpb2xh dGlvbiBzdGF0dXMgKi8NCj4gPiArICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5kZXZp Y2VzW3NsYXZlX3R5cGVdLnZpb19zbGF2ZV9udW07IGkrKykgew0KPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgIHZpb19pZHggPSBkZXZpY2VfaW5mb1tzbGF2ZV90eXBlXVtpXS52aW9faW5kZXg7 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjaGVja192aW9fc3RhdHVzKGRldmFw Y19jdHgsIHNsYXZlX3R5cGUsIHZpb19pZHgpDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IFZJT0xBVElPTl9UUklHR0VSRUQpICYmDQo+ID4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhcl92aW9fc3RhdHVzKGRldmFwY19jdHgsIHNs YXZlX3R5cGUsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHZpb19pZHgpKSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcl93 YXJuKFBGWCAiQ2xlYXIgdmlvIHN0YXR1cyBmYWlsZWQsIHNsYXZlX3R5cGU6MHgleCwgdmlvX2lu ZGV4OjB4JXhcbiIsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHNsYXZlX3R5cGUsIHZpb19pZHgpOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC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dXMoZGV2YXBjX2N0eCwgc2xhdmVfdHlwZSwgJnZpb19pZHgsDQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaW5kZXgpKQ0K PiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGlmICghbXRrX2RldmFwY19kdW1wX3Zpb19kYmco ZGV2YXBjX2N0eCwgc2xhdmVfdHlwZSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZ2aW9faWR4LCAmaW5kZXgpKQ0KPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7DQo+ID4gKw0KPiA+ICsgICAgICAgICAg ICAgICAvKiBFbnN1cmUgdGhhdCB2aW9sYXRpb24gaW5mbyBhcmUgd3JpdHRlbiBiZWZvcmUNCj4g PiArICAgICAgICAgICAgICAgICogZnVydGhlciBvcGVyYXRpb25zDQo+ID4gKyAgICAgICAgICAg ICAgICAqLw0KPiA+ICsgICAgICAgICAgICAgICBzbXBfbWIoKTsNCj4gPiArDQo+ID4gKyAgICAg ICAgICAgICAgIG1hc2tfbW9kdWxlX2lycShkZXZhcGNfY3R4LCBzbGF2ZV90eXBlLCB2aW9faWR4 LCB0cnVlKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIGNsZWFyX3Zpb19zdGF0dXMoZGV2 YXBjX2N0eCwgc2xhdmVfdHlwZSwgdmlvX2lkeCk7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAg ICBwZXJtID0gZ2V0X3Blcm1pc3Npb24oZGV2YXBjX2N0eCwgc2xhdmVfdHlwZSwgaW5kZXgsDQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aW9faW5mby0+ZG9tYWlu X2lkKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIHZpb19tYXN0ZXIgPSBkZXZhcGNfY3R4 LT5zb2MtPm1hc3Rlcl9nZXQNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAodmlvX2luZm8t Pm1hc3Rlcl9pZCwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgdmlvX2luZm8tPnZpb19h ZGRyLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICBzbGF2ZV90eXBlLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICB2aW9faW5mby0+c2hpZnRfc3RhX2JpdCwNCj4gPiArICAgICAg ICAgICAgICAgICAgICAgICAgdmlvX2luZm8tPmRvbWFpbl9pZCk7DQo+IA0KPiBDYWxsIG10Njg3 M19idXNfaWRfdG9fbWFzdGVyKCkgZGlyZWN0bHkuDQo+IA0KPiA+ICsNCj4gPiArICAgICAgICAg ICAgICAgaWYgKCF2aW9fbWFzdGVyKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIHZpb19t YXN0ZXIgPSAiVU5LTk9XTl9NQVNURVIiOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgcHJf aW5mbyhQRlggIlZpb2xhdGlvbiAtIHNsYXZlX3R5cGU6MHgleCwgc3lzX2luZGV4OjB4JXgsIGN0 cmxfaW5kZXg6MHgleCwgdmlvX2luZGV4OjB4JXhcbiIsDQo+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgc2xhdmVfdHlwZSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2VfaW5m b1tzbGF2ZV90eXBlXVtpbmRleF0uc3lzX2luZGV4LA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgIGRldmljZV9pbmZvW3NsYXZlX3R5cGVdW2luZGV4XS5jdHJsX2luZGV4LA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgIGRldmljZV9pbmZvW3NsYXZlX3R5cGVdW2luZGV4XS52aW9faW5k ZXgpOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgcHJfaW5mbyhQRlggIlZpb2xhdGlvbiBN YXN0ZXI6ICVzXG4iLCB2aW9fbWFzdGVyKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIGRl dmFwY192aW9fcmVhc29uKHBlcm0pOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgbWFza19t b2R1bGVfaXJxKGRldmFwY19jdHgsIHNsYXZlX3R5cGUsIHZpb19pZHgsIGZhbHNlKTsNCj4gPiAr ICAgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgICBzcGluX3VubG9ja19pcnFyZXN0b3JlKCZkZXZh cGNfbG9jaywgZmxhZ3MpOw0KPiA+ICsgICAgICAgcmV0dXJuIElSUV9IQU5ETEVEOw0KPiA+ICt9 DQo+ID4gKw0KDQpbc25pcF0NCg0K