Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp484723ybl; Fri, 6 Dec 2019 00:58:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzuYL17D+Avk8nXqQ7Zl5kt6wrVojYRTkqA3YFIaJNlJw1TN2PqIsBRvTo70rQ59QRiADCC X-Received: by 2002:aca:111a:: with SMTP id 26mr10717690oir.145.1575622690758; Fri, 06 Dec 2019 00:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575622690; cv=none; d=google.com; s=arc-20160816; b=oC92IwqoOxwhItd6sfk92ufSOAQ2SdQpcIocQtdP52L4SxOxJ0is+7O3PM5Q34ITF5 FFQypPdPApexnmCVd9FqTQ+dG/qAweNewTKuHuwqLvv66aLAlPAfaxO/vWPfjCewIES3 IVj0qh3C75B0ZObpbW74kA2nP27MsHDxNwLcdiqFGdsst0zHmwzGia72n1/8SQpidqj+ modmBIGkiVAFZCjsv7ZZu+Zpip22JFBYjV93vBHUVBb8VcQIad5of6HnxrSILYsVaOCj MfzeAea24vffcerzclqccVSfufF9p4YfnoT5/+1tkYq8rzBUk1M0aXXB6vzbzb59QFIu CWgg== 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=SOTafVilRh+dUaxelZIZmn7E79UtcnT9UfoFCTjh+RQ=; b=wV/u7eK74PnzoNUk/cDcN/6buGDDtaoMbL0gMkuZT3KW+4Iwjsv1i3KrVTyWTeiMWg DQ9ci0Nnow3Go35rpf8cdWPr1INjy1JMyAlKF+3EsCtrFY++Tb1w0MPF1dP7PVdJJLaE wD2/px9xmGXN14uIqGUlHyxUeBdc7VWIc7qDpUz5+Kl/Dg/GsAHDb2hH1skP+kOR+0en 1y2WBAJaCBCA5sA2Rtrfqyzc/LdRwDbSkjSMarwzav2pfyUo2GOFZnjzoo70Ow4aT03c 3KEQ65qQVVQ4u/1JqBfP2Ff64lnpN7jwjeW3+doa1qH6vVErnkt1udZF6+s4+EpH5Z4N dAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=K49lk4An; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 53si6650956oty.260.2019.12.06.00.57.58; Fri, 06 Dec 2019 00:58:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=K49lk4An; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726371AbfLFI4O (ORCPT + 99 others); Fri, 6 Dec 2019 03:56:14 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:60982 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726088AbfLFI4N (ORCPT ); Fri, 6 Dec 2019 03:56:13 -0500 X-UUID: 92b6c0aa11944161a82836dacd3cd910-20191206 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=SOTafVilRh+dUaxelZIZmn7E79UtcnT9UfoFCTjh+RQ=; b=K49lk4AncgphGZ+vXs9sLKBFCE7JTWrABNNUiyWpHMM5ozAWfStKYylvDdbuGD/yrR+LNAh5vqERTCrO5NBNUX9HcKPjBNUbZQ9avkAmqonlF2lJfdFTrdAA+uBU2n+2z+nSvDokxHJTrQ5KutrQAQa1kwbbKk2WH7en7r7AFcg=; X-UUID: 92b6c0aa11944161a82836dacd3cd910-20191206 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1545069799; Fri, 06 Dec 2019 16:56:00 +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.1395.4; Fri, 6 Dec 2019 16:55:41 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 6 Dec 2019 16:55:56 +0800 Message-ID: <1575622558.17300.5.camel@mtksdaap41> Subject: Re: [PATCH v5 06/10] mfd: Add support for the MediaTek MT6358 PMIC From: Hsin-hsiung Wang To: Pi-Hsun Shih CC: Mark Rutland , Alessandro Zummo , Alexandre Belloni , , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Greg Kroah-Hartman , Sean Wang , "Liam Girdwood" , Rob Herring , open list , Richard Fontana , "Mark Brown" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , Thomas Gleixner , Eddie Huang , Lee Jones , Kate Stewart , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" Date: Fri, 6 Dec 2019 16:55:58 +0800 In-Reply-To: References: <1566531931-9772-1-git-send-email-hsin-hsiung.wang@mediatek.com> <1566531931-9772-7-git-send-email-hsin-hsiung.wang@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 537BB6683E4ECF705D4E44CF13D6ED29EF455E78C6A942E910245C10E9CACEEF2000: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 SGksDQoNCk9uIE1vbiwgMjAxOS0xMi0wMiBhdCAxNjowNiArMDgwMCwgUGktSHN1biBTaGloIHdy b3RlOg0KPiBIaSwNCj4gDQo+IE9uIEZyaSwgQXVnIDIzLCAyMDE5IGF0IDExOjQ2IEFNIEhzaW4t SHNpdW5nIFdhbmcNCj4gPGhzaW4taHNpdW5nLndhbmdAbWVkaWF0ZWsuY29tPiB3cm90ZToNCj4g Pg0KPiA+IFRoaXMgYWRkcyBzdXBwb3J0IGZvciB0aGUgTWVkaWFUZWsgTVQ2MzU4IFBNSUMuIFRo aXMgaXMgYQ0KPiA+IG11bHRpZnVuY3Rpb24gZGV2aWNlIHdpdGggdGhlIGZvbGxvd2luZyBzdWIg bW9kdWxlczoNCj4gPg0KPiA+IC0gUmVndWxhdG9yDQo+ID4gLSBSVEMNCj4gPiAtIENvZGVjDQo+ ID4gLSBJbnRlcnJ1cHQNCj4gPg0KPiA+IEl0IGlzIGludGVyZmFjZWQgdG8gdGhlIGhvc3QgY29u dHJvbGxlciB1c2luZyBTUEkgaW50ZXJmYWNlDQo+ID4gYnkgYSBwcm9wcmlldGFyeSBoYXJkd2Fy ZSBjYWxsZWQgUE1JQyB3cmFwcGVyIG9yIHB3cmFwLg0KPiA+IE1UNjM1OCBNRkQgaXMgYSBjaGls ZCBkZXZpY2Ugb2YgdGhlIHB3cmFwLg0KPiA+DQo+ID4gU2lnbmVkLW9mZi1ieTogSHNpbi1Ic2l1 bmcgV2FuZyA8aHNpbi1oc2l1bmcud2FuZ0BtZWRpYXRlay5jb20+DQo+ID4gLS0tDQo+ID4gIGRy aXZlcnMvbWZkL01ha2VmaWxlICAgICAgICAgICAgICAgICB8ICAgMyArLQ0KPiA+ICBkcml2ZXJz L21mZC9tdDYzNTgta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dpcnEsIHZpcnE7DQo+ID4gKyAgICAgICBpbnQgcmV0LCBpLCBqOw0KPiA+ICsN Cj4gPiArICAgICAgIGZvciAoaSA9IDA7IGkgPCBtdDYzNThfaW50c1t0b3BfZ3BdLm51bV9pbnRf cmVnczsgaSsrKSB7DQo+ID4gKyAgICAgICAgICAgICAgIHN0YV9yZWcgPSBtdDYzNThfaW50c1t0 b3BfZ3BdLnN0YV9yZWcgKw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIG10NjM1OF9pbnRz W3RvcF9ncF0uc3RhX3JlZ19zaGlmdCAqIGk7DQo+ID4gKyAgICAgICAgICAgICAgIHJldCA9IHJl Z21hcF9yZWFkKGNoaXAtPnJlZ21hcCwgc3RhX3JlZywgJmlycV9zdGF0dXMpOw0KPiA+ICsgICAg ICAgICAgICAgICBpZiAocmV0KSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgZGV2X2Vy cihjaGlwLT5kZXYsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmFpbGVk IHRvIHJlYWQgaXJxIHN0YXR1czogJWRcbiIsIHJldCk7DQo+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgcmV0dXJuOw0KPiA+ICsgICAgICAgICAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAg ICAgICAgICBpZiAoIWlycV9zdGF0dXMpDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgY29u dGludWU7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgTVQ2MzU4 X1JFR19XSURUSCA7IGorKykgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGlmICgoaXJx X3N0YXR1cyAmIEJJVChqKSkgPT0gMCkNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGNvbnRpbnVlOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGh3aXJxID0gbXQ2MzU4 X2ludHNbdG9wX2dwXS5od2lycV9iYXNlICsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIE1UNjM1OF9SRUdfV0lEVEggKiBpICsgajsNCj4gPiArICAgICAgICAgICAgICAgICAg ICAgICB2aXJxID0gaXJxX2ZpbmRfbWFwcGluZyhjaGlwLT5pcnFfZG9tYWluLCBod2lycSk7DQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZpcnEpDQo+ID4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBoYW5kbGVfbmVzdGVkX2lycSh2aXJxKTsNCj4gPiArICAgICAgICAg ICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgcmVnbWFwX3dyaXRlKGNoaXAtPnJl Z21hcCwgc3RhX3JlZywgaXJxX3N0YXR1cyk7DQo+ID4gKyAgICAgICB9DQo+ID4gK30NCj4gPiAr DQo+ID4gK3N0YXRpYyBpcnFyZXR1cm5fdCBtdDYzNThfaXJxX2hhbmRsZXIoaW50IGlycSwgdm9p ZCAqZGF0YSkNCj4gPiArew0KPiA+ICsgICAgICAgc3RydWN0IG10NjM5N19jaGlwICpjaGlwID0g ZGF0YTsNCj4gPiArICAgICAgIHN0cnVjdCBwbWljX2lycV9kYXRhICptdDYzNThfaXJxX2RhdGEg PSBjaGlwLT5pcnFfZGF0YTsNCj4gPiArICAgICAgIHVuc2lnbmVkIGludCB0b3BfaXJxX3N0YXR1 czsNCj4gPiArICAgICAgIHVuc2lnbmVkIGludCBpOw0KPiA+ICsgICAgICAgaW50IHJldDsNCj4g PiArDQo+ID4gKyAgICAgICByZXQgPSByZWdtYXBfcmVhZChjaGlwLT5yZWdtYXAsDQo+ID4gKyAg ICAgICAgICAgICAgICAgICAgICAgICBtdDYzNThfaXJxX2RhdGEtPnRvcF9pbnRfc3RhdHVzX3Jl ZywNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICZ0b3BfaXJxX3N0YXR1cyk7DQo+ID4g KyAgICAg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UlJBWV9TSVpFKG10 NjM1OF9pbnRzKSBpcyBzdGlsbCB1c2VkIGluIHBtaWNfaXJxX3N5bmNfdW5sb2NrLiBJcyB0aGlz DQo+IHZhcmlhYmxlIG5lZWRlZCwgb3Igc2hvdWxkIHRoZSBBUlJBWV9TSVpFKG10NjM1OF9pbnRz KSBpbg0KPiBwbWljX2lycV9zeW5jX3VubG9jayBiZSBjaGFuZ2VkIHRvIGlycWQtPm51bV90b3Ag dG9vPw0KPiANCg0KSSB3aWxsIHVwZGF0ZSB0byBpcnFkLT5udW1fdG9wIGZyb20gQVJSQVlfU0la RShtdDYzNThfaW50cykgaW4NCnBtaWNfaXJxX3N5bmNfdW5sb2NrLg0KDQo+ID4gKw0KPiA+ICsg ICAgICAgaXJxZC0+ZW5hYmxlX2h3aXJxID0gZGV2bV9rY2FsbG9jKGNoaXAtPmRldiwNCj4gPiAr ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcnFkLT5udW1fcG1pY19p cnFzLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVv Zihib29sKSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBH RlBfS0VSTkVMKTsNCj4gPiArICAgICAgIGlmICghaXJxZC0+ZW5hYmxlX2h3aXJxKQ0KPiA+ICsg ICAgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsNCj4gPiArDQo+ID4gKyAgICAgICBpcnFkLT5j YWNoZV9od2lycSA9IGRldm1fa2NhbGxvYyhjaGlwLT5kZXYsDQo+ID4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpcnFkLT5udW1fcG1pY19pcnFzLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGJvb2wpLA0KPiA+ICsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7DQo+ID4g KyAgICAgICBpZiAoIWlycWQtPmNhY2hlX2h3aXJxKQ0KPiA+ICsgICAgICAgICAgICAgICByZXR1 cm4gLUVOT01FTTsNCj4gPiArDQo+ID4gKyAgICAgICAvKiBEaXNhYmxlIGFsbCBpbnRlcnJ1cHRz IGZvciBpbml0aWFsaXppbmcgKi8NCj4gPiArICAgICAgIGZvciAoaSA9IDA7IGkgPCBpcnFkLT5u dW1fdG9wOyBpKyspIHsNCj4gPiArICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IG10NjM1 OF9pbnRzW2ldLm51bV9pbnRfcmVnczsgaisrKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAg IHJlZ21hcF93cml0ZShjaGlwLT5yZWdtYXAsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG10NjM1OF9pbnRzW2ldLmVuX3JlZyArDQo+ID4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG10NjM1OF9pbnRzW2ldLmVuX3JlZ19zaGlmdCAqIGosIDAp Ow0KPiA+ICsgICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgIGNoaXAtPmlycV9kb21haW4gPSBp cnFfZG9tYWluX2FkZF9saW5lYXIoY2hpcC0+ZGV2LT5vZl9ub2RlLA0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcnFkLT5udW1fcG1pY19pcnFz LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm bXQ2MzU4X2lycV9kb21haW5fb3BzLCBjaGlwKTsNCj4gPiArICAgICAgIGlmICghY2hpcC0+aXJx X2RvbWFpbikgew0KPiA+ICsgICAgICAgICAgICAgICBkZXZfZXJyKGNoaXAtPmRldiwgImNvdWxk IG5vdCBjcmVhdGUgSVJRIGRvbWFpblxuIik7DQo+ID4gKyAgICAgICAgICAgICAgIHJldHVybiAt RU5PREVWOw0KPiA+ICsgICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgIHJldCA9IGRldm1fcmVx dWVzdF90aHJlYWRlZF9pcnEoY2hpcC0+ZGV2LCBjaGlwLT5pcnEsIE5VTEwsDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10NjM1OF9pcnFfaGFuZGxlciwgSVJR Rl9PTkVTSE9ULA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt dDYzNThfaXJxX2NoaXAubmFtZSwgY2hpcCk7DQo+ID4gKyAgICAgICBpZiAocmV0KSB7DQo+ID4g KyAgICAgICAgICAgICAgIGRldl9lcnIoY2hpcC0+ZGV2LCAiZmFpbGVkIHRvIHJlZ2lzdGVyIGly cT0lZDsgZXJyOiAlZFxuIiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBjaGlwLT5pcnEs IHJldCk7DQo+ID4gKyAgICAgICAgICAgICAgIHJldHVybiByZXQ7DQo+ID4gKyAgICAgICB9DQo+ ID4gKw0KPiA+ICsgICAgICAgZW5hYmxlX2lycV93YWtlKGNoaXAtPmlycSk7DQo+ID4gKyAgICAg ICByZXR1cm4gcmV0Ow0KPiA+ICt9DQo+ID4gKC4uLikNCj4gDQo+IF9fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+IExpbnV4LW1lZGlhdGVrIG1haWxpbmcg bGlzdA0KPiBMaW51eC1tZWRpYXRla0BsaXN0cy5pbmZyYWRlYWQub3JnDQo+IGh0dHA6Ly9saXN0 cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtbWVkaWF0ZWsNCg0K