Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp139973pxa; Wed, 26 Aug 2020 20:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXmhL0NAlFKeAHuTOxpe9WC86p9iNaE3rR18fjlkUwMm/QWV2TC4b7M3lsvayG/7QdwH8k X-Received: by 2002:a17:906:7f0b:: with SMTP id d11mr20175736ejr.116.1598497865459; Wed, 26 Aug 2020 20:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598497865; cv=none; d=google.com; s=arc-20160816; b=wpb/DehJSIw5LIyZcEdau9MPkdIRJUyNCE6ciY0LMgTlgLfWbK3d/+/B7qD+Mv4lZB vyjcoicWRxJXSyQl1s5IZNJySQmyDHv4cc/d/ge3CI5bjlFZ+zK6lTPTyi5/DhOF7eXj +sn1Vrzr0USMhYbeN8kf4HVCm39iRlmJ/Kd8sZaN6qW1ozH0NteaK1aVbSmI+6jLvfvY C9jkDg8iFYlGGFg0MeuyLAbL9W5PBwpWOA8lowpBYLJDvpvC3nRpYWT/zWpSG02czb1J Cbnhu/Er7Bz87J+XBJDVtqYvMtgwWgZUIyr+Bc1TiIID8TOVm5f2xutPvQM2/u7///ls 6wTA== 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=BXG5bKpAqIIeUBAgRT7ICu1rDPXIWdPTOOcN/npDdrE=; b=nfkpfVehLF9NW3fN6imu8OpAM7wNXwDgM6Kvh0rQPMyTTu9uRwV7EJDZO06vG+savc LZm1XaU9UNEhRM+j4G0b89OPEWEd4GMdkOlCK3RXE40qV9xFQe4Q4ZMsxm49mdAUgj/D MW8OfJCShFmfSlnIUWM2khiH/180A33j1usaIV65AnLdCbH10oJtj4sKp0JZKdW3IH/g mkOG8DsFeK8kpxnRNTETE8ogU3Q/90vY+vEXb+7Qn0u61LryHOxz1RfE1k+B+Q22rql4 JmkILRi2bCaVYOIpSw37WUXJtck2QRvy1mo07wJmR5M1GQ7zRNTbcacxnO/jq+foJvy/ u3nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UGWEtlmN; 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 qk7si501166ejb.23.2020.08.26.20.10.42; Wed, 26 Aug 2020 20:11:05 -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=UGWEtlmN; 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 S1726930AbgH0DHb (ORCPT + 99 others); Wed, 26 Aug 2020 23:07:31 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:26913 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726854AbgH0DHb (ORCPT ); Wed, 26 Aug 2020 23:07:31 -0400 X-UUID: 5a67d44873d14b9fafcb1e85b43c1e96-20200827 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=BXG5bKpAqIIeUBAgRT7ICu1rDPXIWdPTOOcN/npDdrE=; b=UGWEtlmNU3ZnkuEDmksGe6xbLhymYPrI7ppFEBgIuk5hPx8oaKTriykMcRLYUintvN5GzCgPmZbXl3EJ+O1xLEoKhGUqTlTyBfZvUlVJKQa/DQ025lOOA6rMvB6wDlw91dNPuWnJXyhK0n0lo4nNGnuOAkL+umhLqPBrSo/oMEg=; X-UUID: 5a67d44873d14b9fafcb1e85b43c1e96-20200827 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 149974940; Thu, 27 Aug 2020 11:07:22 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 Aug 2020 11:06:46 +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; Thu, 27 Aug 2020 11:06:39 +0800 From: Neal Liu To: Rob Herring , Matthias Brugger , Chun-Kuang Hu CC: Neal Liu , , , , lkml , Subject: [PATCH v7 2/2] soc: mediatek: add mt6779 devapc driver Date: Thu, 27 Aug 2020 11:06:33 +0800 Message-ID: <1598497593-15781-3-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1598497593-15781-1-git-send-email-neal.liu@mediatek.com> References: <1598497593-15781-1-git-send-email-neal.liu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: ACF4E102C31550AC6CAA3F167AE1A913935FE1EDED591538BB9A8C7FE9E4B4912000: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 TWVkaWFUZWsgYnVzIGZhYnJpYyBwcm92aWRlcyBUcnVzdFpvbmUgc2VjdXJpdHkgc3VwcG9ydCBh bmQgZGF0YQ0KcHJvdGVjdG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