Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1881182pxa; Thu, 6 Aug 2020 19:24:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3gYygeMkCaNPZpO/kVc6gJQuRk9bijkBNJAh2z3RUi6MCVLiMPRfYIh/gwEl+gZrhnmYQ X-Received: by 2002:a17:906:1396:: with SMTP id f22mr551668ejc.227.1596767047218; Thu, 06 Aug 2020 19:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596767047; cv=none; d=google.com; s=arc-20160816; b=IQcskEroF8GHbVza3I8uGOY6bl6hOOrqaQfNhKdkeoOIKPpEDBlBTqQ347s4jkyw2Z 3aZk5ofJC7zXtS4lNQJ983fnCXtjv7r41SRNXC88oqRcvrNdJ+a/cRiPFMxiNfFpdRaI 5RenuJd0kTuKfFfWif+5FDpfW6wGas4K/uomy4abo7+lCbReXpZ/QXfzZ9JPAapy0yUD jugpe8XtpKXEIYV2iM3eNgZO38XvcoBET70vmybGy9nn938GJh4sea+THy3V2jMq84Ia Yh+pzm+uqgOCghgUphMwVOYwthgN7jjwm1lzD5FaKouba7L+7l+T3o4Iz4yhUWqnSRKe 3LpA== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=sU4rKl06jnrJqpkxacbtjbZWpWXsW6hGD15dSaUV7f0=; b=X+t2slzJjH0f7Iz6V1338jyjJaxJXGgLt6h96x0wRM9ikSWeRVznsB+CWBTOR/cQ8W wMJpsu6yUHc+OdIYrAnf0QlxdHgcevj3VAKZLVrCUYVbjWB8AVKPu/WO/vBjYV6JuHz1 oVIU4M3eVqSqf23Mf1lRSTSRgZUHG+fcCJb7ULPtqIS2pZopJOz7ZPuo+y5Ii9+Mbd3x /Loz2sRt281/NmNlHj7gwBcb160dPZ9TwD3S4WdciFnRMKSgNeg67FXL2UrKS3jMcm8F wXuLqMQfuJ67mUi50OCRkdZipZIl8IgYegzcfYRedtKZJBdB7BTjHFCf3lMDToub3jUh 7vdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=lZBUDqW0; 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 b21si4281879eja.19.2020.08.06.19.23.44; Thu, 06 Aug 2020 19:24:07 -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=lZBUDqW0; 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 S1726396AbgHGCWo (ORCPT + 99 others); Thu, 6 Aug 2020 22:22:44 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:37354 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725947AbgHGCWn (ORCPT ); Thu, 6 Aug 2020 22:22:43 -0400 X-UUID: ca1dd014d0e04f95835023303b1fac1c-20200807 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=sU4rKl06jnrJqpkxacbtjbZWpWXsW6hGD15dSaUV7f0=; b=lZBUDqW0v9YD4pM+nq3GwIq3MGd9c8c3Wp0NCC6FRutB7qcdjOkZPR7QEMP5wF0BEQh6abCo/Qg/vS1mHlu+HiIInCtCzSYO8uXw7SgJQbUWsEtThu4Wl95tpXV4B2DOc7o5k5rT6ejG7q9XHCOhg9zNbgymg6j0YvuYFVKQi38=; X-UUID: ca1dd014d0e04f95835023303b1fac1c-20200807 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1856416110; Fri, 07 Aug 2020 10:22:32 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 Aug 2020 10:22:29 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 Aug 2020 10:22:29 +0800 From: Neal Liu To: Rob Herring , Matthias Brugger CC: Neal Liu , , , , lkml , Subject: [PATCH v5 2/2] soc: mediatek: add mt6779 devapc driver Date: Fri, 7 Aug 2020 10:22:28 +0800 Message-ID: <1596766948-29767-3-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1596766948-29767-1-git-send-email-neal.liu@mediatek.com> References: <1596766948-29767-1-git-send-email-neal.liu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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 TWVkaWFUZWsgYnVzIGZhYnJpYyBwcm92aWRlcyBUcnVzdFpvbmUgc2VjdXJpdHkgc3VwcG9ydCBh bmQgZGF0YQ0KcHJvdGVjdGlvbiB0byBwcmV2ZW50IHNsYXZlcyBmcm9tIGJlaW5nIGFjY2Vzc2Vk IGJ5IHVuZXhwZWN0ZWQNCm1hc3RlcnMu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