Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp993948pxk; Fri, 25 Sep 2020 03:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKEtdyfjd1WJB42mpnsVzAIR820LssSowVzrfZGDx23YrEpxDrT7bPSdd8CVKDlfPWR61z X-Received: by 2002:a17:906:37c6:: with SMTP id o6mr2071968ejc.404.1601029756525; Fri, 25 Sep 2020 03:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601029756; cv=none; d=google.com; s=arc-20160816; b=09gJOTNqu7XLc7Y4FH39VGCXQCCtwRj71u5hNFI/X3zwrMMCazTZ932+INT6jY/oYe xd9frOUHeB4+AvUAQvHsZbkWVAC6y2gOAaF1Ng+Ad3tCIaIaiy+Ibe5O3U5UNAxZIoC3 ao6xi1E+MJiVpwmvUpqNIr3EWpyji0hxTBfbRAOZJLQITn/prNtP2LOjiV5WPrAnPf6o mS7yaSEBQX9GWpMiehs3uJyn2v+KDuGInwfKBjgb1O3ZuA+lQ5A2RuGj1qL16klDhz++ 6qW3sgfhEbAlrPsFjRztNhoaFHL/JjCDCC2d+42aoA8DAuVFkE9NEiswu3xhU4fT0Co6 Kmag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=furd6J9lKYw7rEQJct0IXtstQo7k4wrpljtEUJ2R3XM=; b=M0We5MIDMNTXqc4I/CFhVUWKaRKjW3M/A2/Q/Jojsxc0g5SR7w4NpsEoMULsgFpYUF vK6Ke+Pep8N32NQHVvqaTow5BomdSnNczx6BMggJ5HbnRTH6Gmx2WjcZRle0eGzWFOwx 8ypxW1OFZgPGHmLFcIX5C2lPpXGvsjCX/yuhgX+Gcf/R1UA8gzT551aNQLyLYwohvbrd VpMo6V3vWFiOVl1wNvbQIgkL3h/jcqVmtn8487B1bbxzLmJlMueiKphScLNaOaEcTk7P 5hXl+RVTv9hg6hWO3rxUg+kAg8Mxfla0dyae0jwd91N54KwBrl1y4g+SeSzBjZ6N4SVS fGLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=N8wJCbgX; 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 n12si1563530ejx.468.2020.09.25.03.28.51; Fri, 25 Sep 2020 03:29:16 -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=N8wJCbgX; 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 S1727846AbgIYKZf (ORCPT + 99 others); Fri, 25 Sep 2020 06:25:35 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:37652 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727132AbgIYKZf (ORCPT ); Fri, 25 Sep 2020 06:25:35 -0400 X-UUID: 8e940b4733d54b73b81cd9dd791b9a9b-20200925 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=furd6J9lKYw7rEQJct0IXtstQo7k4wrpljtEUJ2R3XM=; b=N8wJCbgXUmJTijCMnBU1JdtQUxzkc8/F7ijdUUzpmXT+UInL5DGxgRg/K6Zo235bcYtcKD51h3aPta8hspDOLVgtQylyyWtuCRjHSdXkgjIxxM95GM+FJ3iPyZOMJ4djGyc+IyPVcLLb8vknBZuOUBbQjU/X0BFlCWc3lNotLIM=; X-UUID: 8e940b4733d54b73b81cd9dd791b9a9b-20200925 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1970134338; Fri, 25 Sep 2020 18:25:23 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 25 Sep 2020 18:25:21 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 25 Sep 2020 18:25:21 +0800 Message-ID: <1601029522.1346.53.camel@mtksdaap41> Subject: Re: [PATCH 02/12] soc: mediatek: Add MediaTek SCPSYS power domains From: Weiyi Lu To: Enric Balletbo i Serra CC: , Collabora Kernel ML , , , , , Matthias Brugger , , Date: Fri, 25 Sep 2020 18:25:22 +0800 In-Reply-To: <20200910172826.3074357-3-enric.balletbo@collabora.com> References: <20200910172826.3074357-1-enric.balletbo@collabora.com> <20200910172826.3074357-3-enric.balletbo@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVGh1LCAyMDIwLTA5LTEwIGF0IDE5OjI4ICswMjAwLCBFbnJpYyBCYWxsZXRibyBpIFNlcnJh IHdyb3RlOg0KPiBUaGUgU3lzdGVtIENvbnRyb2wgUHJvY2Vzc29yIFN5c3RlbSAoU0NQ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