Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46358C433FE for ; Mon, 20 Dec 2021 06:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237632AbhLTG4f (ORCPT ); Mon, 20 Dec 2021 01:56:35 -0500 Received: from 113.196.136.146.ll.static.sparqnet.net ([113.196.136.146]:54602 "EHLO mg.sunplus.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232310AbhLTG4e (ORCPT ); Mon, 20 Dec 2021 01:56:34 -0500 X-MailGates: (flag:3,DYNAMIC,RELAY,NOHOST:PASS)(compute_score:DELIVER,40 ,3) Received: from 172.17.9.112 by mg02.sunplus.com with MailGates ESMTP Server V5.0(49491:0:AUTH_RELAY) (envelope-from ); Mon, 20 Dec 2021 14:56:30 +0800 (CST) Received: from sphcmbx02.sunplus.com.tw (172.17.9.112) by sphcmbx02.sunplus.com.tw (172.17.9.112) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Mon, 20 Dec 2021 14:56:24 +0800 Received: from sphcmbx02.sunplus.com.tw ([fe80::fd3d:ad1a:de2a:18bd]) by sphcmbx02.sunplus.com.tw ([fe80::fd3d:ad1a:de2a:18bd%14]) with mapi id 15.00.1497.026; Mon, 20 Dec 2021 14:56:24 +0800 From: =?utf-8?B?TGggS3VvIOmDreWKm+ixqg==?= To: Andy Shevchenko , Li-hao Kuo CC: Philipp Zabel , Mark Brown , Rob Herring , linux-spi , devicetree , Linux Kernel Mailing List , =?utf-8?B?V2VsbHMgTHUg5ZGC6Iqz6aiw?= Subject: RE: [PATCH v4 1/2] SPI: Add SPI driver for Sunplus SP7021 Thread-Topic: [PATCH v4 1/2] SPI: Add SPI driver for Sunplus SP7021 Thread-Index: AQHX7aQdqhfHTPMKakCCsqwpEyTHn6w2f9cAgARz93A= Date: Mon, 20 Dec 2021 06:56:24 +0000 Message-ID: References: <65fb77debacc95ed3f54adac978ba24f2470f92e.1639123362.git.lhjeff911@gmail.com> In-Reply-To: Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.25.108.51] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgTXIgQW5keSBTaGV2Y2hlbmtvDQoNCj4gDQo+ID4gK2NvbmZpZyBTUElfU1VOUExVU19TUDcw MjENCj4gPiArICAgICAgIHRyaXN0YXRlICJTdW5wbHVzIFNQNzAyMSBTUEkgY29udHJvbGxlciIN Cj4gPiArICAgICAgIGRlcGVuZHMgb24gU09DX1NQNzAyMQ0KPiANCj4gTm8gQ09NUElMRV9URVNU Pw0KPg0KDQpJIHdpbGwgYWRkIGl0IGluIG5leHQgbmV4dCBzdWJtaXNzaW9uDQoNCg0KDQoNCj4g Li4uDQo+IAkNCj4gPiArY29uZmlnIFNQSV9TVU5QTFVTX1NQNzAyMQ0KPiA+ICsgICAgICAgdHJp c3RhdGUgIlN1bnBsdXMgU1A3MDIxIFNQSSBjb250cm9sbGVyIg0KPiA+ICsgICAgICAgZGVwZW5k cyBvbiBTT0NfU1A3MDIxDQo+IA0KPiBObyBDT01QSUxFX1RFU1Q/DQo+DQoNCj4gDQo+ID4gKyNk ZWZpbmUgU1A3MDIxX0ZJRk9fREFUQV9CSVRTICAgICAoMTYgKiA4KQ0KPiANCj4gV2hhdCBkb2Vz IHRoaXMgbXVsdGlwbGljYXRpb24gbWVhbj8NCj4gDQo+IC4uLg0KPg0KDQpJdCB3aWxsIGRlZmlu ZSB0aGUgbGVuZ3RoIG9mIHRoZSBGSUZPDQpJIHdpbGwgZGVmaW5lIGl0IGNsZWFybHkgYXMgZm9s bG93cw0KDQojZG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g ICAgICAgICAgICAgICAgICAgZWxzZQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcnhfY250ID0gRklFTERfR0VUKFNQNzAyMV9SWF9DTlRfTUFTSywNCj4gPiArIGZkX3N0YXR1 cyk7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGlmIChyeF9jbnQgPiAwKQ0K PiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A3MDIxX3NwaV9tYXNfcmIocHNw aW0sIHJ4X2NudCk7DQo+ID4gKyAgICAgICAgICAgICAgIH0NCj4gPiArICAgICAgICAgICAgICAg d3JpdGVsKHJlYWRsKHBzcGltLT5tYXNfYmFzZSArIFNQNzAyMV9JTlRfQlVTWV9SRUcpDQo+ID4g KyAgICAgICAgICAgICAgICAgICAgICAgfCBTUDcwMjFfQ0xSX01BU19JTlQsIHBzcGltLT5tYXNf YmFzZSArIFNQNzAyMV9JTlRfQlVTWV9SRUcpOw0KPiA+ICsgICAgICAgICAgICAgICB3cml0ZWwo U1A3MDIxX0ZJTklTSF9GTEFHLCBwc3BpbS0+bWFzX2Jhc2UgKw0KPiA+ICsgU1A3MDIxX1NQSV9T VEFUVVNfUkVHKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIGlzcmRvbmUgPSB0cnVlOw0K PiA+ICsgICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgIGlmIChpc3Jkb25lKQ0KPiA+ICsgICAg ICAgICAgICAgICBjb21wbGV0ZSgmcHNwaW0tPmlzcl9kb25lKTsNCj4gPiArICAgICAgIHNwaW5f dW5sb2NrX2lycXJlc3RvcmUoJnBzcGltLT5sb2NrLCBmbGFncyk7DQo+ID4gKyAgICAgICByZXR1 cm4gSVJRX0hBTkRMRUQ7DQo+ID4gK30NCj4gPiArDQo+ID4gK3N0YXRpYyB2b2lkIHNwNzAyMV9w cmVwX3RyYW5zZmVyKHN0cnVjdCBzcGlfY29udHJvbGxlciA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yMV9TUElfQ09ORklHX1JFRyk7DQo+ID4gKw0K PiA+ICsgICAgICAgICAgICAgICByZWdfdGVtcCA9IEZJRUxEX1BSRVAoU1A3MDIxX1NFVF9UWF9M RU4sIHhmZXJfbGVuKSB8DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBGSUVMRF9QUkVQKFNQNzAyMV9TRVRfWEZFUl9MRU4sIHhmZXJfbGVuKSB8DQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTUDcwMjFfU1BJX1NUQVJUX0ZEOw0KPiA+ ICsgICAgICAgICAgICAgICB3cml0ZWwocmVnX3RlbXAsIHBzcGltLT5tYXNfYmFzZSArDQo+ID4g KyBTUDcwMjFfU1BJX1NUQVRVU19SRUcpOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgaWYg KCF3YWl0X2Zvcl9jb21wbGV0aW9uX2ludGVycnVwdGlibGVfdGltZW91dCgmcHNwaW0tPmlzcl9k b25lLCB0aW1lb3V0KSkgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGRldl9lcnIoJnNw aS0+ZGV2LCAid2FpdF9mb3JfY29tcGxldGlvbiBlcnJcbiIpOw0KPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgIHJldHVybiAtRVRJTUVET1VUOw0KPiA+ICsgICAgICAgICAgICAgICB9DQo+ID4g Kw0KPiA+ICsgICAgICAgICAgICAgICByZWdfdGVtcCA9IHJlYWRsKHBzcGltLT5tYXNfYmFzZSAr IFNQNzAyMV9TUElfU1RBVFVTX1JFRyk7DQo+ID4gKyAgICAgICAgICAgICAgIGlmIChyZWdfdGVt cCAmIFNQNzAyMV9GSU5JU0hfRkxBRykgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIHdy aXRlbChTUDcwMjFfRklOSVNIX0ZMQUcsIHBzcGltLT5tYXNfYmFzZSArDQo+IFNQNzAyMV9TUElf U1RBVFVTX1JFRyk7DQo+ID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ICAgICBp bnQgbW9kZSwgcmV0ID0gMDsNCj4gPiArDQo+ID4gKyAgICAgICBtb2RlID0gU1A3MDIxX1NQSV9J RExFOw0KPiA+ICsgICAgICAgaWYgKHNwaV9jb250cm9sbGVyX2lzX3NsYXZlKGN0bHIpKSB7DQo+ ID4gKyAgICAgICAgICAgICAgIGlmICh4ZmVyLT50eF9idWYgJiYgeGZlci0+cnhfYnVmKSB7DQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgZGV2X2RiZygmY3Rsci0+ZGV2LCAiJXMoKSB3cm9u ZyBjb21tYW5kXG4iLCBfX2Z1bmNfXyk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgcmV0 ID0gLUVJTlZBTDsNCj4gPiArICAgICAgICAgICAgICAgfSBlbHNlIGlmICh4ZmVyLT50eF9idWYp IHsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICB4ZmVyLT50eF9kbWEgPSBkbWFfbWFwX3Np bmdsZShkZXYsICh2b2lkICopeGZlci0+dHhfYnVmLA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhmZXItPmxlbiwgRE1BX1RPX0RFVklD RSk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRtYV9tYXBwaW5nX2Vycm9yKGRl diwgeGZlci0+dHhfZG1hKSkNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJl dHVybiAtRU5PTUVNOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIG1vZGUgPSBTUDcwMjFf U0xBX1dSSVRFOw0KPiA+ICsgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHhmZXItPnJ4X2J1Zikg ew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIHhmZXItPnJ4X2RtYSA9IGRtYV9tYXBfc2lu Z2xlKGRldiwgeGZlci0+cnhfYnVmLCB4ZmVyLT5sZW4sDQo+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRE1BX0ZST01fREVWSUNFKTsNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG1hX21hcHBpbmdfZXJyb3IoZGV2LCB4ZmVy LT5yeF9kbWEpKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1F Tk9NRU07DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgbW9kZSA9IFNQNzAyMV9TTEFfUkVB RDsNCj4gPiArICAgICAgICAgICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgc3dp dGNoIChtb2RlKSB7DQo+ID4gKyAgICAgICAgICAgICAgIGNhc2UgU1A3MDIxX1NMQV9XUklURToN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgICBzcDcwMjFfc3BpX3NsYV90eChzcGksIHhmZXIp Ow0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KPiA+ICsgICAgICAgICAgICAg ICBjYXNlIFNQNzAyMV9TTEFfUkVBRDoNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBzcDcw MjFfc3BpX3NsYV9yeChzcGksIHhmZXIpOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGJy ZWFrOw0KPiA+ICsgICAgICAgICAgICAgICBkZWZhdWx0Og0KPiA+ICsgICAgICAgICAgICAgICAg ICAgICAgIGJyZWFrOw0KPiA+ICsgICAgICAgICAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAg ICAgICAgICBpZiAoeGZlci0+dHhfYnVmKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGRt YV91bm1hcF9zaW5nbGUoZGV2LCB4ZmVyLT50eF9kbWEsIHhmZXItPmxlbiwgRE1BX1RPX0RFVklD RSk7DQo+ID4gKyAgICAgICAgICAgICAgIGlmICh4ZmVyLT5yeF9idWYpDQo+ID4gKyAgICAgICAg ICAgIC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BpbS0+c2xhX2lycTsNCj4gPiArDQo+ID4g KyAgICAgICByZXQgPSBkZXZtX3JlcXVlc3RfaXJxKGRldiwgcHNwaW0tPm1hc19pcnEsIHNwNzAy MV9zcGlfbWFzX2lycSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVJRRl9U UklHR0VSX1JJU0lORywgcGRldi0+bmFtZSwgcHNwaW0pOw0KPiA+ICsgICAgICAgaWYgKHJldCkN Cj4gPiArICAgICAgICAgICAgICAgcmV0dXJuIHJldDsNCj4gPiArDQo+ID4gKyAgICAgICByZXQg PSBkZXZtX3JlcXVlc3RfaXJxKGRldiwgcHNwaW0tPnNsYV9pcnEsIHNwNzAyMV9zcGlfc2xhX2ly cSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVJRRl9UUklHR0VSX1JJU0lO RywgcGRldi0+bmFtZSwgcHNwaW0pOw0KPiA+ICsgICAgICAgaWYgKHJldCkNCj4gPiArICAgICAg ICAgICAgICAgcmV0dXJuIHJldDsNCj4gPiArDQo+ID4gKyAgICAgICBwc3BpbS0+c3BpX2NsayA9 IGRldm1fY2xrX2dldChkZXYsIE5VTEwpOw0KPiA+ICsgICAgICAgaWYgKElTX0VSUihwc3BpbS0+ c3BpX2NsaykpDQo+ID4gKyAgICAgICAgICAgICAgIHJldHVybiBkZXZfZXJyX3Byb2JlKGRldiwg UFRSX0VSUihwc3BpbS0+c3BpX2NsayksDQo+ID4gKyAiY2xrIGdldCBmYWlsXG4iKTsNCj4gPiAr DQo+ID4gKyAgICAgICBwc3BpbS0+cnN0YyA9IGRldm1fcmVzZXRfY29udHJvbF9nZXRfZXhjbHVz aXZlKGRldiwgTlVMTCk7DQo+ID4gKyAgICAgICBpZiAoSVNfRVJSKHBzcGltLT5yc3RjKSkNCj4g PiArICAgICAgICAgICAgICAgcmV0dXJuIGRldl9lcnJfcHJvYmUoZGV2LCBQVFJfRVJSKHBzcGlt LT5yc3RjKSwgInJzdA0KPiA+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